@shepai/cli 1.147.0 → 1.148.0
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/apis/json-schema/Attachment.yaml +3 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +4 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/compose-user-input.js +3 -1
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts +5 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.js +6 -3
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.js +20 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +5 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts +2 -0
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +4 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +4 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +5 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_5a50254c._.js → _4533d6f8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5a50254c._.js.map → _4533d6f8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_fe63a7f9._.js +3 -0
- package/web/.next/server/chunks/ssr/{_b839d4f1._.js.map → _fe63a7f9._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_523768ca._.js → src_presentation_web_7b2fda40._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_523768ca._.js.map → src_presentation_web_7b2fda40._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +44 -44
- package/web/.next/static/chunks/0137d4850cab3c45.js +5 -0
- package/web/.next/static/chunks/{a0ab3aee9a5e3d02.js → 04869f1d3f5d9071.js} +1 -1
- package/web/.next/static/chunks/063a24b49d9818a0.js +1 -0
- package/web/.next/static/chunks/21e82fee1a7e1668.js +1 -0
- package/web/.next/static/chunks/{9fd5c3ecc8c5eb07.js → 48850e202dd814ac.js} +1 -1
- package/web/.next/static/chunks/49057cf8cd37e262.js +1 -0
- package/web/.next/static/chunks/{28f5e2d65510526a.js → 682563e4503cbd58.js} +1 -1
- package/web/.next/static/chunks/{0539e93ac218f442.js → 683b1d85e789c2eb.js} +2 -2
- package/web/.next/static/chunks/{0ddea46ed4ba1621.js → 6f76e63ead3fac2e.js} +1 -1
- package/web/.next/static/chunks/{a63c16171b149d2d.js → 7c5131e33516a325.js} +1 -1
- package/web/.next/static/chunks/9b8678597fa1db84.css +1 -0
- package/web/.next/static/chunks/{8923825cdb21cf1c.js → 9dad6769d10a32df.js} +1 -1
- package/web/.next/static/chunks/{63f412a89bde2484.js → c731682077fbac4f.js} +1 -1
- package/web/.next/static/chunks/{ebbc5dd20e227e3d.js → d62ae5e449d87057.js} +1 -1
- package/web/.next/server/chunks/ssr/_b839d4f1._.js +0 -3
- package/web/.next/static/chunks/79984461b85f1e4e.js +0 -1
- package/web/.next/static/chunks/7ab5c32984198a7e.js +0 -2
- package/web/.next/static/chunks/869ae48ca73fa328.js +0 -1
- package/web/.next/static/chunks/d61c239df26c61fd.css +0 -1
- package/web/.next/static/chunks/fa556c575c788679.js +0 -1
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_buildManifest.js +0 -0
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{41QsWn4e2sGnQCNBIar6W → zYKuE1zbe1UWwAJv5EVwg}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/presentation/web/components/features/settings/timeout-slider.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-select%402.2.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_1f7b4ff668a805c08339bb4e58c413b0/node_modules/%40radix-ui/react-select/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/select.tsx","../../../../../../../src/presentation/web/app/actions/data%3Acbcd91%20%3Ctext/javascript%3E","../../../../../../../src/presentation/web/components/features/settings/settings-page-client.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slider%401.3.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_ca43abb80e5f786fefe972afd09a8b45/node_modules/%40radix-ui/react-slider/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/slider.tsx","../../../../../../../src/presentation/web/components/common/editor-type-icons.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/chevron-up.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-select%402.2.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_1f7b4ff668a805c08339bb4e58c413b0/node_modules/%40radix-ui/react-select/src/select.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/bell.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/bot.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/settings-2.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/database.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slider%401.3.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_ca43abb80e5f786fefe972afd09a8b45/node_modules/%40radix-ui/react-slider/src/slider.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/flag.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/activity.ts"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { Slider } from '@/components/ui/slider';\n\n/** Fixed duration presets in seconds — slider snaps to these values */\nconst PRESETS = [\n 60, // 1m\n 120, // 2m\n 300, // 5m\n 600, // 10m\n 900, // 15m\n 1800, // 30m\n 2700, // 45m\n 3600, // 1h\n 7200, // 2h\n 10800, // 3h\n 14400, // 4h\n 21600, // 6h\n 28800, // 8h\n 43200, // 12h\n 86400, // 24h\n];\n\nconst SLIDER_MAX = PRESETS.length - 1;\n\n/** Find the closest preset index for a given seconds value */\nfunction secondsToIndex(seconds: number): number {\n let closest = 0;\n let minDiff = Math.abs(seconds - PRESETS[0]);\n for (let i = 1; i < PRESETS.length; i++) {\n const diff = Math.abs(seconds - PRESETS[i]);\n if (diff < minDiff) {\n minDiff = diff;\n closest = i;\n }\n }\n return closest;\n}\n\nexport interface TimeoutSliderProps {\n id: string;\n testId: string;\n /** Current value in seconds (as a string for form compatibility) */\n value: string;\n onChange: (value: string) => void;\n onBlur: () => void;\n defaultSeconds?: number;\n}\n\nfunction formatDuration(totalSeconds: number): string {\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.round((totalSeconds % 3600) / 60);\n\n if (hours === 0) return `${minutes}m`;\n if (minutes === 0) return `${hours}h`;\n return `${hours}h ${minutes}m`;\n}\n\nexport function TimeoutSlider({\n id,\n testId,\n value,\n onChange,\n onBlur,\n defaultSeconds = 1800,\n}: TimeoutSliderProps) {\n const numValue = value === '' ? defaultSeconds : parseInt(value, 10);\n const seconds = numValue || defaultSeconds;\n\n // Local index state prevents snap-back during drag — updates immediately\n // without waiting for the parent to re-render with the new value.\n const [localIndex, setLocalIndex] = useState(() => secondsToIndex(seconds));\n\n // Sync from props only when the resolved index actually differs\n // (e.g. external reset or server push). Avoids overwriting during drag.\n const propsIndex = secondsToIndex(seconds);\n if (propsIndex !== localIndex && PRESETS[localIndex] !== seconds) {\n setLocalIndex(propsIndex);\n }\n\n const handleChange = useCallback(\n ([i]: number[]) => {\n setLocalIndex(i);\n onChange(String(PRESETS[i]));\n },\n [onChange]\n );\n\n return (\n <div className=\"flex w-55 items-center gap-2\">\n <Slider\n id={id}\n data-testid={testId}\n min={0}\n max={SLIDER_MAX}\n step={1}\n value={[localIndex]}\n onValueChange={handleChange}\n onValueCommit={() => onBlur()}\n className=\"min-w-0 flex-1\"\n />\n <span className=\"text-muted-foreground shrink-0 text-right text-xs tabular-nums\">\n {formatDuration(PRESETS[localIndex])}\n </span>\n </div>\n );\n}\n","\"use client\";\n\n// src/select.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { VISUALLY_HIDDEN_STYLES } from \"@radix-ui/react-visually-hidden\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar OPEN_KEYS = [\" \", \"Enter\", \"ArrowUp\", \"ArrowDown\"];\nvar SELECTION_KEYS = [\" \", \"Enter\"];\nvar SELECT_NAME = \"Select\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);\nvar [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);\nvar [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);\nvar Select = (props) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState(null);\n const [valueNode, setValueNode] = React.useState(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SELECT_NAME\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n caller: SELECT_NAME\n });\n const triggerPointerDownPosRef = React.useRef(null);\n const isFormControl = trigger ? form || !!trigger.closest(\"form\") : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());\n const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(\";\");\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsxs(\n SelectProvider,\n {\n required,\n scope: __scopeSelect,\n trigger,\n onTriggerChange: setTrigger,\n valueNode,\n onValueNodeChange: setValueNode,\n valueNodeHasChildren,\n onValueNodeHasChildrenChange: setValueNodeHasChildren,\n contentId: useId(),\n value,\n onValueChange: setValue,\n open,\n onOpenChange: setOpen,\n dir: direction,\n triggerPointerDownPosRef,\n disabled,\n children: [\n /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n SelectNativeOptionsProvider,\n {\n scope: props.__scopeSelect,\n onNativeOptionAdd: React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, []),\n onNativeOptionRemove: React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, []),\n children\n }\n ) }),\n isFormControl ? /* @__PURE__ */ jsxs(\n SelectBubbleInput,\n {\n \"aria-hidden\": true,\n required,\n tabIndex: -1,\n name,\n autoComplete,\n value,\n onChange: (event) => setValue(event.target.value),\n disabled,\n form,\n children: [\n value === void 0 ? /* @__PURE__ */ jsx(\"option\", { value: \"\" }) : null,\n Array.from(nativeOptionsSet)\n ]\n },\n nativeSelectKey\n ) : null\n ]\n }\n ) });\n};\nSelect.displayName = SELECT_NAME;\nvar TRIGGER_NAME = \"SelectTrigger\";\nvar SelectTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef(\"touch\");\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== void 0) {\n context.onValueChange(nextItem.value);\n }\n });\n const handleOpen = (pointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n resetTypeahead();\n }\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY)\n };\n }\n };\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"combobox\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open,\n \"aria-required\": context.required,\n \"aria-autocomplete\": \"none\",\n dir: context.dir,\n \"data-state\": context.open ? \"open\" : \"closed\",\n disabled: isDisabled,\n \"data-disabled\": isDisabled ? \"\" : void 0,\n \"data-placeholder\": shouldShowPlaceholder(context.value) ? \"\" : void 0,\n ...triggerProps,\n ref: composedRefs,\n onClick: composeEventHandlers(triggerProps.onClick, (event) => {\n event.currentTarget.focus();\n if (pointerTypeRef.current !== \"mouse\") {\n handleOpen(event);\n }\n }),\n onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === \"mouse\") {\n handleOpen(event);\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== \"\";\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === \" \") return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nSelectTrigger.displayName = TRIGGER_NAME;\nvar VALUE_NAME = \"SelectValue\";\nvar SelectValue = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, children, placeholder = \"\", ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== void 0;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...valueProps,\n ref: composedRefs,\n style: { pointerEvents: \"none\" },\n children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx(Fragment, { children: placeholder }) : children\n }\n );\n }\n);\nSelectValue.displayName = VALUE_NAME;\nvar ICON_NAME = \"SelectIcon\";\nvar SelectIcon = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...iconProps, ref: forwardedRef, children: children || \"\\u25BC\" });\n }\n);\nSelectIcon.displayName = ICON_NAME;\nvar PORTAL_NAME = \"SelectPortal\";\nvar SelectPortal = (props) => {\n return /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, ...props });\n};\nSelectPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"SelectContent\";\nvar SelectContent = React.forwardRef(\n (props, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState();\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n if (!context.open) {\n const frag = fragment;\n return frag ? ReactDOM.createPortal(\n /* @__PURE__ */ jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(\"div\", { children: props.children }) }) }),\n frag\n ) : null;\n }\n return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });\n }\n);\nSelectContent.displayName = CONTENT_NAME;\nvar CONTENT_MARGIN = 10;\nvar [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME);\nvar CONTENT_IMPL_NAME = \"SelectContentImpl\";\nvar Slot = createSlot(\"SelectContent.RemoveScroll\");\nvar SelectContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n position = \"item-aligned\",\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedItemText, setSelectedItemText] = React.useState(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n useFocusGuards();\n const focusFirst = React.useCallback(\n (candidates) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: \"nearest\" });\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n const handlePointerMove = (event) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))\n };\n };\n const handlePointerUp = (event) => {\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n if (!content.contains(event.target)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener(\"pointermove\", handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener(\"pointermove\", handlePointerMove);\n document.addEventListener(\"pointerup\", handlePointerUp, { capture: true, once: true });\n }\n return () => {\n document.removeEventListener(\"pointermove\", handlePointerMove);\n document.removeEventListener(\"pointerup\", handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [onOpenChange]);\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n setTimeout(() => nextItem.ref.current.focus());\n }\n });\n const itemRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n const SelectPosition = position === \"popper\" ? SelectPopperPosition : SelectItemAlignedPosition;\n const popperContentProps = SelectPosition === SelectPopperPosition ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions\n } : {};\n return /* @__PURE__ */ jsx(\n SelectContentProvider,\n {\n scope: __scopeSelect,\n content,\n viewport,\n onViewportChange: setViewport,\n itemRefCallback,\n selectedItem,\n onItemLeave: handleItemLeave,\n itemTextRefCallback,\n focusSelectedItem,\n selectedItemText,\n position,\n isPositioned,\n searchRef,\n children: /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: context.open,\n onMountAutoFocus: (event) => {\n event.preventDefault();\n },\n onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n }),\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: true,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n SelectPosition,\n {\n role: \"listbox\",\n id: context.contentId,\n \"data-state\": context.open ? \"open\" : \"closed\",\n dir: context.dir,\n onContextMenu: (event) => event.preventDefault(),\n ...contentProps,\n ...popperContentProps,\n onPlaced: () => setIsPositioned(true),\n ref: composedRefs,\n style: {\n // flex layout so we can place the scroll buttons properly\n display: \"flex\",\n flexDirection: \"column\",\n // reset the outline by default as the content MAY get focused\n outline: \"none\",\n ...contentProps.style\n },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current);\n if ([\"ArrowUp\", \"End\"].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if ([\"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n const currentElement = event.target;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n event.preventDefault();\n }\n })\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\nvar ITEM_ALIGNED_POSITION_NAME = \"SelectItemAlignedPosition\";\nvar SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {\n const triggerRect = context.trigger.getBoundingClientRect();\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n if (context.dir !== \"rtl\") {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.left = clampedLeft + \"px\";\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.right = clampedRight + \"px\";\n }\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n if (willAlignWithoutTopOverflow) {\n const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;\n contentWrapper.style.bottom = \"0px\";\n const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + \"px\";\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;\n contentWrapper.style.top = \"0px\";\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + \"px\";\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + \"px\";\n contentWrapper.style.maxHeight = availableHeight + \"px\";\n onPlaced?.();\n requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced\n ]);\n useLayoutEffect(() => position(), [position]);\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n const handleScrollButtonChange = React.useCallback(\n (node) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n return /* @__PURE__ */ jsx(\n SelectViewportProvider,\n {\n scope: __scopeSelect,\n contentWrapper,\n shouldExpandOnScrollRef,\n onScrollButtonChange: handleScrollButtonChange,\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: setContentWrapper,\n style: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"fixed\",\n zIndex: contentZIndex\n },\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...popperProps,\n ref: composedRefs,\n style: {\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: \"border-box\",\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: \"100%\",\n ...popperProps.style\n }\n }\n )\n }\n )\n }\n );\n});\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\nvar POPPER_POSITION_NAME = \"SelectPopperPosition\";\nvar SelectPopperPosition = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeSelect,\n align = \"start\",\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n ...popperScope,\n ...popperProps,\n ref: forwardedRef,\n align,\n collisionPadding,\n style: {\n // Ensure border-box for floating-ui calculations\n boxSizing: \"border-box\",\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-select-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-select-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-select-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-select-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-select-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\nvar [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {});\nvar VIEWPORT_NAME = \"SelectViewport\";\nvar SelectViewport = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`\n },\n nonce\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-select-viewport\": \"\",\n role: \"presentation\",\n ...viewportProps,\n ref: composedRefs,\n style: {\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: \"relative\",\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: \"hidden auto\",\n ...viewportProps.style\n },\n onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n contentWrapper.style.height = clampedNextHeight + \"px\";\n if (contentWrapper.style.bottom === \"0px\") {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n contentWrapper.style.justifyContent = \"flex-end\";\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })\n }\n ) })\n ] });\n }\n);\nSelectViewport.displayName = VIEWPORT_NAME;\nvar GROUP_NAME = \"SelectGroup\";\nvar [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);\nvar SelectGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", \"aria-labelledby\": groupId, ...groupProps, ref: forwardedRef }) });\n }\n);\nSelectGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"SelectLabel\";\nvar SelectLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });\n }\n);\nSelectLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"SelectItem\";\nvar [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);\nvar SelectItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? \"\");\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef(\"touch\");\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n if (value === \"\") {\n throw new Error(\n \"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.\"\n );\n }\n return /* @__PURE__ */ jsx(\n SelectItemContextProvider,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textId,\n isSelected,\n onItemTextChange: React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? \"\").trim());\n }, []),\n children: /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textValue,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"option\",\n \"aria-labelledby\": textId,\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-selected\": isSelected && isFocused,\n \"data-state\": isSelected ? \"checked\" : \"unchecked\",\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : -1,\n ...itemProps,\n ref: composedRefs,\n onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),\n onClick: composeEventHandlers(itemProps.onClick, () => {\n if (pointerTypeRef.current !== \"mouse\") handleSelect();\n }),\n onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {\n if (pointerTypeRef.current === \"mouse\") handleSelect();\n }),\n onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n }),\n onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === \"mouse\") {\n event.currentTarget.focus({ preventScroll: true });\n }\n }),\n onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n }),\n onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== \"\";\n if (isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n if (event.key === \" \") event.preventDefault();\n })\n }\n )\n }\n )\n }\n );\n }\n);\nSelectItem.displayName = ITEM_NAME;\nvar ITEM_TEXT_NAME = \"SelectItemText\";\nvar SelectItemText = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => /* @__PURE__ */ jsx(\"option\", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),\n [itemContext.disabled, itemContext.value, textContent]\n );\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),\n itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null\n ] });\n }\n);\nSelectItemText.displayName = ITEM_TEXT_NAME;\nvar ITEM_INDICATOR_NAME = \"SelectItemIndicator\";\nvar SelectItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...itemIndicatorProps, ref: forwardedRef }) : null;\n }\n);\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SCROLL_UP_BUTTON_NAME = \"SelectScrollUpButton\";\nvar SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const canScrollUp2 = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollUp ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\nvar SCROLL_DOWN_BUTTON_NAME = \"SelectScrollDownButton\";\nvar SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollDown ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\nvar SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext(\"SelectScrollButton\", __scopeSelect);\n const autoScrollTimerRef = React.useRef(null);\n const getItems = useCollection(__scopeSelect);\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: \"nearest\" });\n }, [getItems]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-hidden\": true,\n ...scrollIndicatorProps,\n ref: forwardedRef,\n style: { flexShrink: 0, ...scrollIndicatorProps.style },\n onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })\n }\n );\n});\nvar SEPARATOR_NAME = \"SelectSeparator\";\nvar SelectSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { \"aria-hidden\": true, ...separatorProps, ref: forwardedRef });\n }\n);\nSelectSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"SelectArrow\";\nvar SelectArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === \"popper\" ? /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;\n }\n);\nSelectArrow.displayName = ARROW_NAME;\nvar BUBBLE_INPUT_NAME = \"SelectBubbleInput\";\nvar SelectBubbleInput = React.forwardRef(\n ({ __scopeSelect, value, ...props }, forwardedRef) => {\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const select = ref.current;\n if (!select) return;\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n \"value\"\n );\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"change\", { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(\n Primitive.select,\n {\n ...props,\n style: { ...VISUALLY_HIDDEN_STYLES, ...props.style },\n ref: composedRefs,\n defaultValue: value\n }\n );\n }\n);\nSelectBubbleInput.displayName = BUBBLE_INPUT_NAME;\nfunction shouldShowPlaceholder(value) {\n return value === \"\" || value === void 0;\n}\nfunction useTypeaheadSearch(onSearchChange) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef(\"\");\n const timerRef = React.useRef(0);\n const handleTypeaheadSearch = React.useCallback(\n (key) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n },\n [handleSearchChange]\n );\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = \"\";\n window.clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n return [searchRef, handleTypeaheadSearch, resetTypeahead];\n}\nfunction findNextItem(items, search, currentItem) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find(\n (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : void 0;\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root2 = Select;\nvar Trigger = SelectTrigger;\nvar Value = SelectValue;\nvar Icon = SelectIcon;\nvar Portal = SelectPortal;\nvar Content2 = SelectContent;\nvar Viewport = SelectViewport;\nvar Group = SelectGroup;\nvar Label = SelectLabel;\nvar Item = SelectItem;\nvar ItemText = SelectItemText;\nvar ItemIndicator = SelectItemIndicator;\nvar ScrollUpButton = SelectScrollUpButton;\nvar ScrollDownButton = SelectScrollDownButton;\nvar Separator = SelectSeparator;\nvar Arrow2 = SelectArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Group,\n Icon,\n Item,\n ItemIndicator,\n ItemText,\n Label,\n Portal,\n Root2 as Root,\n ScrollDownButton,\n ScrollUpButton,\n Select,\n SelectArrow,\n SelectContent,\n SelectGroup,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectItemText,\n SelectLabel,\n SelectPortal,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n SelectViewport,\n Separator,\n Trigger,\n Value,\n Viewport,\n createSelectScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","/* __next_internal_action_entry_do_not_use__ [{\"4005786540384444b85a680f731e980f4d605482be\":\"updateSettingsAction\"},\"src/presentation/web/app/actions/update-settings.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"4005786540384444b85a680f731e980f4d605482be\",callServer,void 0,findSourceMapURL,\"updateSettingsAction\");export{$$RSC_SERVER_ACTION_0 as updateSettingsAction};","'use client';\n\nimport { useState, useTransition, useRef, useEffect, useCallback } from 'react';\nimport {\n Check,\n Bot,\n Terminal,\n GitBranch,\n Activity,\n Bell,\n Flag,\n Database,\n Minus,\n Plus,\n ExternalLink,\n Settings2,\n Timer,\n} from 'lucide-react';\nimport { toast } from 'sonner';\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/components/ui/label';\nimport { Switch } from '@/components/ui/switch';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/ui/select';\nimport { updateSettingsAction } from '@/app/actions/update-settings';\nimport { type AgentType, EditorType, TerminalType } from '@shepai/core/domain/generated/output';\nimport { getEditorTypeIcon } from '@/components/common/editor-type-icons';\nimport { AgentModelPicker } from '@/components/features/settings/AgentModelPicker';\nimport { TimeoutSlider } from '@/components/features/settings/timeout-slider';\nimport type {\n Settings,\n FeatureFlags,\n NotificationPreferences,\n} from '@shepai/core/domain/generated/output';\nimport type { AvailableTerminal } from '@/app/actions/get-available-terminals';\n\nconst EDITOR_OPTIONS = [\n { value: EditorType.VsCode, label: 'VS Code' },\n { value: EditorType.Cursor, label: 'Cursor' },\n { value: EditorType.Windsurf, label: 'Windsurf' },\n { value: EditorType.Zed, label: 'Zed' },\n { value: EditorType.Antigravity, label: 'Antigravity' },\n];\n\nconst SHELL_OPTIONS = [\n { value: 'bash', label: 'Bash' },\n { value: 'zsh', label: 'Zsh' },\n { value: 'fish', label: 'Fish' },\n];\n\nconst SECTIONS = [\n { id: 'agent', label: 'Agent', icon: Bot },\n { id: 'environment', label: 'Environment', icon: Terminal },\n { id: 'workflow', label: 'Workflow', icon: GitBranch },\n { id: 'ci', label: 'CI', icon: Activity },\n { id: 'stage-timeouts', label: 'Timeouts', icon: Timer },\n { id: 'notifications', label: 'Notifications', icon: Bell },\n { id: 'feature-flags', label: 'Flags', icon: Flag },\n { id: 'database', label: 'Database', icon: Database },\n] as const;\n\nexport interface SettingsPageClientProps {\n settings: Settings;\n shepHome: string;\n dbFileSize: string;\n availableTerminals?: AvailableTerminal[];\n}\n\nfunction useSaveIndicator() {\n const [isPending, startTransition] = useTransition();\n const [showSaving, setShowSaving] = useState(false);\n const [showSaved, setShowSaved] = useState(false);\n const minTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const pendingDoneRef = useRef(false);\n\n // Show \"Saving...\" with a minimum display time of 600ms\n useEffect(() => {\n if (isPending && !showSaving) {\n setShowSaving(true);\n pendingDoneRef.current = false;\n minTimerRef.current = setTimeout(() => {\n minTimerRef.current = null;\n if (pendingDoneRef.current) {\n setShowSaving(false);\n setShowSaved(true);\n setTimeout(() => setShowSaved(false), 2000);\n }\n }, 350);\n }\n if (!isPending && showSaving) {\n pendingDoneRef.current = true;\n // If min timer already elapsed, transition now\n if (!minTimerRef.current) {\n setShowSaving(false);\n setShowSaved(true);\n setTimeout(() => setShowSaved(false), 2000);\n }\n }\n }, [isPending, showSaving]);\n\n const save = useCallback(\n (payload: Record<string, unknown>) => {\n startTransition(async () => {\n const result = await updateSettingsAction(payload);\n if (!result.success) {\n toast.error(result.error ?? 'Failed to save settings');\n }\n });\n },\n [startTransition]\n );\n\n return { showSaving, showSaved, save };\n}\n\n/* ── Reusable row components ── */\n\nfunction SettingsRow({\n label,\n description,\n htmlFor,\n children,\n}: {\n label: string;\n description?: string;\n htmlFor?: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0\">\n <div className=\"min-w-0\">\n <Label htmlFor={htmlFor} className=\"cursor-pointer text-sm font-normal whitespace-nowrap\">\n {label}\n </Label>\n {description ? (\n <p className=\"text-muted-foreground text-[11px] leading-tight\">{description}</p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">{children}</div>\n </div>\n );\n}\n\nfunction SwitchRow({\n label,\n description,\n id,\n testId,\n checked,\n onChange,\n disabled,\n}: {\n label: string;\n description?: string;\n id: string;\n testId: string;\n checked: boolean;\n onChange: (value: boolean) => void;\n disabled?: boolean;\n}) {\n return (\n <SettingsRow label={label} description={description} htmlFor={id}>\n <Switch\n id={id}\n data-testid={testId}\n checked={checked}\n onCheckedChange={onChange}\n disabled={disabled}\n className={cn('cursor-pointer', disabled && 'cursor-not-allowed opacity-50')}\n />\n </SettingsRow>\n );\n}\n\n/* ── Section card wrapper ── */\n\nfunction SettingsSection({\n icon: Icon,\n title,\n description,\n badge,\n testId,\n children,\n}: {\n icon: React.ComponentType<{ className?: string }>;\n title: string;\n description: string;\n badge?: string;\n testId: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"bg-background rounded-lg border\" data-testid={testId}>\n <div className=\"bg-muted/30 border-b px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n <Icon className=\"text-muted-foreground h-3.5 w-3.5\" />\n <h2 className=\"text-sm font-semibold\">{title}</h2>\n {badge ? (\n <span className=\"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase\">\n {badge}\n </span>\n ) : null}\n </div>\n <p className=\"text-muted-foreground mt-0.5 text-[11px]\">{description}</p>\n </div>\n <div className=\"px-4\">{children}</div>\n </div>\n );\n}\n\nfunction NumberStepper({\n id,\n testId,\n value,\n onChange,\n onBlur,\n placeholder,\n min = 1,\n max,\n step = 1,\n suffix,\n}: {\n id: string;\n testId: string;\n value: string;\n onChange: (value: string) => void;\n onBlur: () => void;\n placeholder: string;\n min?: number;\n max?: number;\n step?: number;\n suffix?: string;\n}) {\n const numValue = value === '' ? undefined : parseInt(value, 10);\n\n const decrement = () => {\n const current = numValue ?? parseInt(placeholder, 10);\n const next = Math.max(min, current - step);\n onChange(String(next));\n };\n\n const increment = () => {\n const current = numValue ?? parseInt(placeholder, 10);\n const next = max != null ? Math.min(max, current + step) : current + step;\n onChange(String(next));\n };\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <div className=\"flex items-center overflow-hidden rounded-md border\">\n <button\n type=\"button\"\n onClick={() => {\n decrement();\n }}\n onMouseUp={onBlur}\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors\"\n aria-label=\"Decrease\"\n >\n <Minus className=\"h-3 w-3\" />\n </button>\n <input\n id={id}\n data-testid={testId}\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n value={value}\n placeholder={placeholder}\n onChange={(e) => {\n const v = e.target.value.replace(/[^0-9]/g, '');\n onChange(v);\n }}\n onBlur={onBlur}\n className=\"h-8 w-14 bg-transparent text-center text-xs outline-none\"\n />\n <button\n type=\"button\"\n onClick={() => {\n increment();\n }}\n onMouseUp={onBlur}\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors\"\n aria-label=\"Increase\"\n >\n <Plus className=\"h-3 w-3\" />\n </button>\n </div>\n {suffix ? <span className=\"text-muted-foreground text-[11px]\">{suffix}</span> : null}\n </div>\n );\n}\n\nfunction SubsectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"border-b pt-3 pb-1\">\n <span className=\"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase\">\n {children}\n </span>\n </div>\n );\n}\n\nfunction SectionHint({\n children,\n links,\n}: {\n children: React.ReactNode;\n links?: { label: string; href: string }[];\n}) {\n return (\n <div className=\"hidden pt-2 lg:block\">\n <p className=\"text-muted-foreground/70 text-[11px] leading-relaxed\">{children}</p>\n {links != null && links.length > 0 ? (\n <div className=\"mt-2 flex flex-col gap-1\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors\"\n >\n <ExternalLink className=\"h-2.5 w-2.5\" />\n {link.label}\n </a>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\n/* ── Main component ── */\n\nexport function SettingsPageClient({\n settings,\n shepHome,\n dbFileSize,\n availableTerminals,\n}: SettingsPageClientProps) {\n const { showSaving, showSaved, save } = useSaveIndicator();\n const featureFlags = settings.featureFlags ?? {\n skills: false,\n envDeploy: false,\n debug: false,\n githubImport: false,\n adoptBranch: false,\n gitRebaseSync: false,\n reactFileManager: false,\n };\n\n // Agent state\n const [agentType, setAgentType] = useState(settings.agent.type);\n\n // Environment state\n const [editor, setEditor] = useState(settings.environment.defaultEditor);\n const [shell, setShell] = useState(settings.environment.shellPreference);\n const [terminal, setTerminal] = useState(\n settings.environment.terminalPreference ?? TerminalType.System\n );\n\n // Filter to only show installed terminals\n const terminalOptions = availableTerminals\n ? availableTerminals.filter((t) => t.available)\n : [{ id: TerminalType.System, name: 'System Terminal', available: true as const }];\n\n // Workflow state\n const [openPr, setOpenPr] = useState(settings.workflow.openPrOnImplementationComplete);\n const [pushOnComplete, setPushOnComplete] = useState(\n settings.workflow.approvalGateDefaults.pushOnImplementationComplete\n );\n const [allowPrd, setAllowPrd] = useState(settings.workflow.approvalGateDefaults.allowPrd);\n const [allowPlan, setAllowPlan] = useState(settings.workflow.approvalGateDefaults.allowPlan);\n const [allowMerge, setAllowMerge] = useState(settings.workflow.approvalGateDefaults.allowMerge);\n const [enableEvidence, setEnableEvidence] = useState(settings.workflow.enableEvidence);\n const [commitEvidence, setCommitEvidence] = useState(settings.workflow.commitEvidence);\n const [ciWatchEnabled, setCiWatchEnabled] = useState(settings.workflow.ciWatchEnabled !== false);\n const [hideCiStatus, setHideCiStatus] = useState(settings.workflow.hideCiStatus !== false);\n const [ciMaxFix, setCiMaxFix] = useState(\n settings.workflow.ciMaxFixAttempts != null ? String(settings.workflow.ciMaxFixAttempts) : ''\n );\n const [ciTimeout, setCiTimeout] = useState(\n settings.workflow.ciWatchTimeoutMs != null\n ? String(Math.round(settings.workflow.ciWatchTimeoutMs / 1000))\n : ''\n );\n const [ciLogMax, setCiLogMax] = useState(\n settings.workflow.ciLogMaxChars != null ? String(settings.workflow.ciLogMaxChars) : ''\n );\n const [ciPollInterval, setCiPollInterval] = useState(\n settings.workflow.ciWatchPollIntervalSeconds != null\n ? String(settings.workflow.ciWatchPollIntervalSeconds)\n : ''\n );\n // Feature agent per-stage timeout states (stored in seconds for display, converted to ms on save)\n // Defaults: feature agent stages = 1_800_000 ms (1800s), analyze-repo = 600_000 ms (600s)\n const stageTimeoutsConfig = settings.workflow.stageTimeouts;\n const [analyzeTimeout, setAnalyzeTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.analyzeMs ?? 1_800_000) / 1000))\n );\n const [requirementsTimeout, setRequirementsTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.requirementsMs ?? 1_800_000) / 1000))\n );\n const [researchTimeout, setResearchTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.researchMs ?? 1_800_000) / 1000))\n );\n const [planTimeout, setPlanTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.planMs ?? 1_800_000) / 1000))\n );\n const [implementTimeout, setImplementTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.implementMs ?? 1_800_000) / 1000))\n );\n const [mergeTimeout, setMergeTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.mergeMs ?? 1_800_000) / 1000))\n );\n // Analyze-repo agent timeout state\n const analyzeRepoConfig = settings.workflow.analyzeRepoTimeouts;\n const [analyzeRepoTimeout, setAnalyzeRepoTimeout] = useState(\n String(Math.round((analyzeRepoConfig?.analyzeMs ?? 600_000) / 1000))\n );\n\n // Notification state\n const [inApp, setInApp] = useState(settings.notifications.inApp.enabled);\n const [events, setEvents] = useState({ ...settings.notifications.events });\n\n // Feature flags state\n const [flags, setFlags] = useState<FeatureFlags>({ ...featureFlags });\n\n // Original CI values for blur comparison\n const originalCiMaxFix =\n settings.workflow.ciMaxFixAttempts != null ? String(settings.workflow.ciMaxFixAttempts) : '';\n const originalCiTimeout =\n settings.workflow.ciWatchTimeoutMs != null\n ? String(Math.round(settings.workflow.ciWatchTimeoutMs / 1000))\n : '';\n const originalCiLogMax =\n settings.workflow.ciLogMaxChars != null ? String(settings.workflow.ciLogMaxChars) : '';\n const originalCiPollInterval =\n settings.workflow.ciWatchPollIntervalSeconds != null\n ? String(settings.workflow.ciWatchPollIntervalSeconds)\n : '';\n const originalAnalyzeTimeout =\n stageTimeoutsConfig?.analyzeMs != null\n ? String(Math.round(stageTimeoutsConfig.analyzeMs / 1000))\n : '';\n const originalRequirementsTimeout =\n stageTimeoutsConfig?.requirementsMs != null\n ? String(Math.round(stageTimeoutsConfig.requirementsMs / 1000))\n : '';\n const originalResearchTimeout =\n stageTimeoutsConfig?.researchMs != null\n ? String(Math.round(stageTimeoutsConfig.researchMs / 1000))\n : '';\n const originalPlanTimeout =\n stageTimeoutsConfig?.planMs != null\n ? String(Math.round(stageTimeoutsConfig.planMs / 1000))\n : '';\n const originalImplementTimeout =\n stageTimeoutsConfig?.implementMs != null\n ? String(Math.round(stageTimeoutsConfig.implementMs / 1000))\n : '';\n const originalMergeTimeout =\n stageTimeoutsConfig?.mergeMs != null\n ? String(Math.round(stageTimeoutsConfig.mergeMs / 1000))\n : '';\n const originalAnalyzeRepoTimeout =\n analyzeRepoConfig?.analyzeMs != null\n ? String(Math.round(analyzeRepoConfig.analyzeMs / 1000))\n : '';\n\n function parseOptionalInt(value: string): number | undefined {\n if (value === '') return undefined;\n const n = parseInt(value, 10);\n return Number.isNaN(n) || n <= 0 ? undefined : n;\n }\n\n function secondsToMs(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n const n = parseOptionalInt(val);\n return n != null ? n * 1000 : undefined;\n }\n\n // Workflow helpers\n function buildWorkflowPayload(\n overrides: {\n openPr?: boolean;\n pushOnComplete?: boolean;\n allowPrd?: boolean;\n allowPlan?: boolean;\n allowMerge?: boolean;\n enableEvidence?: boolean;\n commitEvidence?: boolean;\n ciWatchEnabled?: boolean;\n hideCiStatus?: boolean;\n ciMaxFix?: string;\n ciTimeout?: string;\n ciLogMax?: string;\n ciPollInterval?: string;\n analyzeTimeout?: string;\n requirementsTimeout?: string;\n researchTimeout?: string;\n planTimeout?: string;\n implementTimeout?: string;\n mergeTimeout?: string;\n analyzeRepoTimeout?: string;\n } = {}\n ) {\n const timeoutSeconds = parseOptionalInt(overrides.ciTimeout ?? ciTimeout);\n return {\n workflow: {\n openPrOnImplementationComplete: overrides.openPr ?? openPr,\n approvalGateDefaults: {\n pushOnImplementationComplete: overrides.pushOnComplete ?? pushOnComplete,\n allowPrd: overrides.allowPrd ?? allowPrd,\n allowPlan: overrides.allowPlan ?? allowPlan,\n allowMerge: overrides.allowMerge ?? allowMerge,\n },\n enableEvidence: overrides.enableEvidence ?? enableEvidence,\n commitEvidence: overrides.commitEvidence ?? commitEvidence,\n ciWatchEnabled: overrides.ciWatchEnabled ?? ciWatchEnabled,\n hideCiStatus: overrides.hideCiStatus ?? hideCiStatus,\n ciMaxFixAttempts: parseOptionalInt(overrides.ciMaxFix ?? ciMaxFix),\n ciWatchTimeoutMs: timeoutSeconds != null ? timeoutSeconds * 1000 : undefined,\n ciLogMaxChars: parseOptionalInt(overrides.ciLogMax ?? ciLogMax),\n ciWatchPollIntervalSeconds: parseOptionalInt(overrides.ciPollInterval ?? ciPollInterval),\n stageTimeouts: {\n analyzeMs: secondsToMs(overrides.analyzeTimeout ?? analyzeTimeout),\n requirementsMs: secondsToMs(overrides.requirementsTimeout ?? requirementsTimeout),\n researchMs: secondsToMs(overrides.researchTimeout ?? researchTimeout),\n planMs: secondsToMs(overrides.planTimeout ?? planTimeout),\n implementMs: secondsToMs(overrides.implementTimeout ?? implementTimeout),\n mergeMs: secondsToMs(overrides.mergeTimeout ?? mergeTimeout),\n },\n analyzeRepoTimeouts: {\n analyzeMs: secondsToMs(overrides.analyzeRepoTimeout ?? analyzeRepoTimeout),\n },\n },\n };\n }\n\n // Notification helpers\n function buildNotificationPayload(\n overrides: {\n inApp?: boolean;\n events?: NotificationPreferences['events'];\n } = {}\n ) {\n return {\n notifications: {\n inApp: { enabled: overrides.inApp ?? inApp },\n events: overrides.events ?? events,\n },\n };\n }\n\n const [activeSection, setActiveSection] = useState<string>('agent');\n\n // Track which section is in view via IntersectionObserver\n useEffect(() => {\n const els = SECTIONS.map((s) => document.getElementById(`section-${s.id}`)).filter(\n Boolean\n ) as HTMLElement[];\n if (els.length === 0) return;\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setActiveSection(entry.target.id.replace('section-', ''));\n }\n }\n },\n { rootMargin: '-65px 0px -60% 0px', threshold: 0 }\n );\n\n for (const el of els) observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n const scrollToSection = useCallback((id: string) => {\n const el = document.getElementById(`section-${id}`);\n if (!el) return;\n el.scrollIntoView({ behavior: 'smooth', block: 'start' });\n // Flash highlight\n el.style.animation = 'none';\n // Force reflow\n void el.offsetHeight;\n el.style.animation = 'section-flash 1s ease-out';\n }, []);\n\n return (\n <div data-testid=\"settings-page-client\" className=\"max-w-5xl\">\n {/* Sticky header — title + save indicator + TOC in one row */}\n <div className=\"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]\">\n <div className=\"flex items-center gap-2\">\n <Settings2 className=\"text-muted-foreground h-4 w-4\" />\n <h1 className=\"text-sm font-bold tracking-tight\">Settings</h1>\n <span className=\"relative h-4 w-16\">\n <span\n className={cn(\n 'text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300',\n showSaving ? 'opacity-100' : 'opacity-0'\n )}\n >\n Saving...\n </span>\n <span\n className={cn(\n 'absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300',\n showSaved && !showSaving ? 'opacity-100' : 'opacity-0'\n )}\n >\n <Check className=\"h-3 w-3\" />\n Saved\n </span>\n </span>\n <nav className=\"ml-auto flex items-center gap-0.5\">\n {SECTIONS.map((s) => {\n const SectionIcon = s.icon;\n const isActive = activeSection === s.id;\n return (\n <button\n key={s.id}\n type=\"button\"\n onClick={() => scrollToSection(s.id)}\n className={cn(\n 'flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all',\n isActive\n ? 'bg-accent text-foreground font-medium'\n : 'text-muted-foreground/60 hover:text-foreground hover:bg-accent/50'\n )}\n >\n <SectionIcon className=\"h-3 w-3\" />\n <span className=\"hidden sm:inline\">{s.label}</span>\n </button>\n );\n })}\n </nav>\n </div>\n </div>\n\n <div className=\"flex flex-col gap-3\">\n {/* ── Agent ── */}\n <div\n id=\"section-agent\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Bot}\n title=\"Agent\"\n description=\"AI coding agent and authentication\"\n testId=\"agent-settings-section\"\n >\n <SettingsRow\n label=\"Agent & Model\"\n description=\"Provider and model for all operations\"\n htmlFor=\"agent-model-picker\"\n >\n <AgentModelPicker\n initialAgentType={agentType}\n initialModel={settings.models.default}\n mode=\"settings\"\n onAgentModelChange={(newAgent) => setAgentType(newAgent as AgentType)}\n className=\"w-55\"\n />\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Agent system',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md',\n },\n {\n label: 'Adding agents',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md',\n },\n {\n label: 'Configuration guide',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md',\n },\n ]}\n >\n Choose which AI coding agent powers your features. Each agent supports different models\n and capabilities. Authentication is resolved automatically via your active session.\n </SectionHint>\n </div>\n\n {/* ── Environment ── */}\n <div\n id=\"section-environment\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Terminal}\n title=\"Environment\"\n description=\"Editor, shell, and terminal preferences\"\n testId=\"environment-settings-section\"\n >\n <SettingsRow\n label=\"Default Editor\"\n description=\"Editor launched for file operations\"\n htmlFor=\"default-editor\"\n >\n <Select\n value={editor}\n onValueChange={(v) => {\n setEditor(v as EditorType);\n save({\n environment: {\n defaultEditor: v as EditorType,\n shellPreference: shell,\n terminalPreference: terminal,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"default-editor\"\n data-testid=\"editor-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {EDITOR_OPTIONS.map((opt) => {\n const Icon = getEditorTypeIcon(opt.value);\n return (\n <SelectItem key={opt.value} value={opt.value}>\n <span className=\"flex items-center gap-2 text-xs\">\n <Icon className=\"h-4 w-4 shrink-0\" />\n {opt.label}\n </span>\n </SelectItem>\n );\n })}\n </SelectContent>\n </Select>\n </SettingsRow>\n <SettingsRow\n label=\"Shell\"\n description=\"Default shell for generated scripts\"\n htmlFor=\"shell-preference\"\n >\n <Select\n value={shell}\n onValueChange={(v) => {\n setShell(v);\n save({\n environment: {\n defaultEditor: editor,\n shellPreference: v,\n terminalPreference: terminal,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"shell-preference\"\n data-testid=\"shell-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {SHELL_OPTIONS.map((opt) => (\n <SelectItem key={opt.value} value={opt.value}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n <SettingsRow\n label=\"Terminal\"\n description=\"Terminal emulator for shell sessions\"\n htmlFor=\"terminal-preference\"\n >\n <Select\n value={terminal}\n onValueChange={(v) => {\n setTerminal(v as TerminalType);\n save({\n environment: {\n defaultEditor: editor,\n shellPreference: shell,\n terminalPreference: v as TerminalType,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"terminal-preference\"\n data-testid=\"terminal-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {terminalOptions.map((opt) => (\n <SelectItem key={opt.id} value={opt.id}>\n {opt.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Configuration guide',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md',\n },\n ]}\n >\n Your preferred editor opens files for review. The shell setting controls generated\n scripts. The terminal emulator is launched when opening shell sessions from the web UI.\n </SectionHint>\n </div>\n\n {/* ── Workflow ── */}\n <div\n id=\"section-workflow\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={GitBranch}\n title=\"Workflow\"\n description=\"Automation behavior after implementation\"\n testId=\"workflow-settings-section\"\n >\n <SubsectionLabel>Approve</SubsectionLabel>\n <SwitchRow\n label=\"Auto-approve PRD\"\n description=\"Skip manual review of requirements\"\n id=\"allow-prd\"\n testId=\"switch-allow-prd\"\n checked={allowPrd}\n onChange={(v) => {\n setAllowPrd(v);\n save(buildWorkflowPayload({ allowPrd: v }));\n }}\n />\n <SwitchRow\n label=\"Auto-approve Plan\"\n description=\"Skip manual review of implementation plan\"\n id=\"allow-plan\"\n testId=\"switch-allow-plan\"\n checked={allowPlan}\n onChange={(v) => {\n setAllowPlan(v);\n save(buildWorkflowPayload({ allowPlan: v }));\n }}\n />\n <SwitchRow\n label=\"Auto-approve Merge\"\n description=\"Merge without manual review\"\n id=\"allow-merge\"\n testId=\"switch-allow-merge\"\n checked={allowMerge}\n onChange={(v) => {\n setAllowMerge(v);\n save(buildWorkflowPayload({ allowMerge: v }));\n }}\n />\n <SubsectionLabel>Evidence</SubsectionLabel>\n <SwitchRow\n label=\"Collect evidence\"\n description=\"Capture screenshots and artifacts after implementation\"\n id=\"enable-evidence\"\n testId=\"switch-enable-evidence\"\n checked={enableEvidence}\n onChange={(v) => {\n setEnableEvidence(v);\n if (!v) {\n setCommitEvidence(false);\n save(buildWorkflowPayload({ enableEvidence: v, commitEvidence: false }));\n } else {\n save(buildWorkflowPayload({ enableEvidence: v }));\n }\n }}\n />\n <SwitchRow\n label=\"Add evidence to PR\"\n description=\"Include evidence in the pull request body\"\n id=\"commit-evidence\"\n testId=\"switch-commit-evidence\"\n checked={commitEvidence}\n disabled={!enableEvidence || !openPr}\n onChange={(v) => {\n setCommitEvidence(v);\n save(buildWorkflowPayload({ commitEvidence: v }));\n }}\n />\n <SubsectionLabel>Git</SubsectionLabel>\n <SwitchRow\n label=\"Push on complete\"\n description=\"Push to remote when implementation finishes\"\n id=\"push-on-complete\"\n testId=\"switch-push-on-complete\"\n checked={pushOnComplete}\n onChange={(v) => {\n setPushOnComplete(v);\n save(buildWorkflowPayload({ pushOnComplete: v }));\n }}\n />\n <SwitchRow\n label=\"Open PR on complete\"\n description=\"Create a pull request when done\"\n id=\"open-pr\"\n testId=\"switch-open-pr\"\n checked={openPr}\n onChange={(v) => {\n setOpenPr(v);\n if (!v) {\n setCommitEvidence(false);\n save(buildWorkflowPayload({ openPr: v, commitEvidence: false }));\n } else {\n save(buildWorkflowPayload({ openPr: v }));\n }\n }}\n />\n <SwitchRow\n label=\"Watch CI after push\"\n description=\"Monitor CI and auto-fix failures. Disable to avoid rate limits.\"\n id=\"ci-watch-enabled\"\n testId=\"switch-ci-watch-enabled\"\n checked={ciWatchEnabled}\n onChange={(v) => {\n setCiWatchEnabled(v);\n save(buildWorkflowPayload({ ciWatchEnabled: v }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Approval gates',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml',\n },\n {\n label: 'Push & PR flags',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml',\n },\n ]}\n >\n Control how autonomous each feature run is. Auto-approve skips the human review pause at\n each phase. Push and PR options control what happens after successful implementation.\n </SectionHint>\n </div>\n\n {/* ── CI ── */}\n <div\n id=\"section-ci\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Activity}\n title=\"Continuous Integration\"\n description=\"Limits and timeouts for CI monitoring\"\n testId=\"ci-settings-section\"\n >\n <SettingsRow\n label=\"Max fix attempts\"\n description=\"Agent retries on failing CI\"\n htmlFor=\"ci-max-fix\"\n >\n <NumberStepper\n id=\"ci-max-fix\"\n testId=\"ci-max-fix-input\"\n placeholder=\"3\"\n value={ciMaxFix}\n onChange={setCiMaxFix}\n onBlur={() => {\n if (ciMaxFix !== originalCiMaxFix) save(buildWorkflowPayload({ ciMaxFix }));\n }}\n min={1}\n max={10}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Watch timeout\"\n description=\"Max wait for CI completion\"\n htmlFor=\"ci-timeout\"\n >\n <NumberStepper\n id=\"ci-timeout\"\n testId=\"ci-timeout-input\"\n placeholder=\"300\"\n value={ciTimeout}\n onChange={setCiTimeout}\n onBlur={() => {\n if (ciTimeout !== originalCiTimeout) save(buildWorkflowPayload({ ciTimeout }));\n }}\n min={30}\n step={30}\n suffix=\"sec\"\n />\n </SettingsRow>\n <SettingsRow\n label=\"Max log size\"\n description=\"Truncate CI logs beyond this limit\"\n htmlFor=\"ci-log-max\"\n >\n <NumberStepper\n id=\"ci-log-max\"\n testId=\"ci-log-max-input\"\n placeholder=\"50000\"\n value={ciLogMax}\n onChange={setCiLogMax}\n onBlur={() => {\n if (ciLogMax !== originalCiLogMax) save(buildWorkflowPayload({ ciLogMax }));\n }}\n min={1000}\n step={5000}\n suffix=\"chars\"\n />\n </SettingsRow>\n <SettingsRow\n label=\"Poll interval\"\n description=\"How often to check GitHub for CI status updates\"\n htmlFor=\"ci-poll-interval\"\n >\n <NumberStepper\n id=\"ci-poll-interval\"\n testId=\"ci-poll-interval-input\"\n placeholder=\"30\"\n value={ciPollInterval}\n onChange={setCiPollInterval}\n onBlur={() => {\n if (ciPollInterval !== originalCiPollInterval)\n save(buildWorkflowPayload({ ciPollInterval }));\n }}\n min={5}\n step={5}\n suffix=\"sec\"\n />\n </SettingsRow>\n <SwitchRow\n label=\"Hide CI status\"\n description=\"Hide CI status badges from feature drawer and merge review\"\n id=\"hide-ci-status\"\n testId=\"switch-hide-ci-status\"\n checked={hideCiStatus}\n onChange={(v) => {\n setHideCiStatus(v);\n save(buildWorkflowPayload({ hideCiStatus: v }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'CI/CD pipeline',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md',\n },\n {\n label: 'CI security gates',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md',\n },\n ]}\n >\n When a feature completes, the agent can watch CI and auto-fix failures. These limits\n prevent runaway retries and control how much log output is sent to the agent for\n analysis.\n </SectionHint>\n </div>\n\n {/* ── Stage Timeouts ── */}\n <div\n id=\"section-stage-timeouts\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Timer}\n title=\"Stage Timeouts\"\n description=\"Maximum execution time per agent stage\"\n testId=\"stage-timeouts-settings-section\"\n >\n <SubsectionLabel>Feature Agent</SubsectionLabel>\n <SettingsRow\n label=\"Analyze\"\n description=\"Repository analysis timeout\"\n htmlFor=\"timeout-analyze\"\n >\n <TimeoutSlider\n id=\"timeout-analyze\"\n testId=\"timeout-analyze-input\"\n value={analyzeTimeout}\n onChange={setAnalyzeTimeout}\n onBlur={() => {\n if (analyzeTimeout !== originalAnalyzeTimeout)\n save(buildWorkflowPayload({ analyzeTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Requirements\"\n description=\"Requirements gathering timeout\"\n htmlFor=\"timeout-requirements\"\n >\n <TimeoutSlider\n id=\"timeout-requirements\"\n testId=\"timeout-requirements-input\"\n value={requirementsTimeout}\n onChange={setRequirementsTimeout}\n onBlur={() => {\n if (requirementsTimeout !== originalRequirementsTimeout)\n save(buildWorkflowPayload({ requirementsTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Research\"\n description=\"Technical research timeout\"\n htmlFor=\"timeout-research\"\n >\n <TimeoutSlider\n id=\"timeout-research\"\n testId=\"timeout-research-input\"\n value={researchTimeout}\n onChange={setResearchTimeout}\n onBlur={() => {\n if (researchTimeout !== originalResearchTimeout)\n save(buildWorkflowPayload({ researchTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Plan\"\n description=\"Implementation planning timeout\"\n htmlFor=\"timeout-plan\"\n >\n <TimeoutSlider\n id=\"timeout-plan\"\n testId=\"timeout-plan-input\"\n value={planTimeout}\n onChange={setPlanTimeout}\n onBlur={() => {\n if (planTimeout !== originalPlanTimeout)\n save(buildWorkflowPayload({ planTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Implement\"\n description=\"Code implementation timeout\"\n htmlFor=\"timeout-implement\"\n >\n <TimeoutSlider\n id=\"timeout-implement\"\n testId=\"timeout-implement-input\"\n value={implementTimeout}\n onChange={setImplementTimeout}\n onBlur={() => {\n if (implementTimeout !== originalImplementTimeout)\n save(buildWorkflowPayload({ implementTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Merge\"\n description=\"PR creation and merge timeout\"\n htmlFor=\"timeout-merge\"\n >\n <TimeoutSlider\n id=\"timeout-merge\"\n testId=\"timeout-merge-input\"\n value={mergeTimeout}\n onChange={setMergeTimeout}\n onBlur={() => {\n if (mergeTimeout !== originalMergeTimeout)\n save(buildWorkflowPayload({ mergeTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SubsectionLabel>Analyze Repository Agent</SubsectionLabel>\n <SettingsRow\n label=\"Analyze\"\n description=\"Repository analysis timeout\"\n htmlFor=\"timeout-analyze-repo\"\n >\n <TimeoutSlider\n id=\"timeout-analyze-repo\"\n testId=\"timeout-analyze-repo-input\"\n value={analyzeRepoTimeout}\n onChange={setAnalyzeRepoTimeout}\n onBlur={() => {\n if (analyzeRepoTimeout !== originalAnalyzeRepoTimeout)\n save(buildWorkflowPayload({ analyzeRepoTimeout }));\n }}\n defaultSeconds={600}\n />\n </SettingsRow>\n </SettingsSection>\n <SectionHint>\n Each agent has independently configurable stage timeouts. When a stage exceeds its\n timeout, the agent is terminated. Longer timeouts are useful for complex\n implementations. Feature agent defaults to 30 minutes per stage. Analyze repository\n agent defaults to 10 minutes.\n </SectionHint>\n </div>\n\n {/* ── Notifications ── */}\n <div\n id=\"section-notifications\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Bell}\n title=\"Notifications\"\n description=\"How and when you get notified\"\n testId=\"notification-settings-section\"\n >\n <SubsectionLabel>Channels</SubsectionLabel>\n <SwitchRow\n label=\"In-app\"\n description=\"Notifications inside the Shep UI\"\n id=\"notif-in-app\"\n testId=\"switch-in-app\"\n checked={inApp}\n onChange={(v) => {\n setInApp(v);\n save(buildNotificationPayload({ inApp: v }));\n }}\n />\n\n <SubsectionLabel>Agent Events</SubsectionLabel>\n <SwitchRow\n label=\"Agent started\"\n id=\"notif-event-agentStarted\"\n testId=\"switch-event-agentStarted\"\n checked={events.agentStarted}\n onChange={(v) => {\n const newEvents = { ...events, agentStarted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Phase completed\"\n id=\"notif-event-phaseCompleted\"\n testId=\"switch-event-phaseCompleted\"\n checked={events.phaseCompleted}\n onChange={(v) => {\n const newEvents = { ...events, phaseCompleted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Waiting approval\"\n id=\"notif-event-waitingApproval\"\n testId=\"switch-event-waitingApproval\"\n checked={events.waitingApproval}\n onChange={(v) => {\n const newEvents = { ...events, waitingApproval: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Agent completed\"\n id=\"notif-event-agentCompleted\"\n testId=\"switch-event-agentCompleted\"\n checked={events.agentCompleted}\n onChange={(v) => {\n const newEvents = { ...events, agentCompleted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Agent failed\"\n id=\"notif-event-agentFailed\"\n testId=\"switch-event-agentFailed\"\n checked={events.agentFailed}\n onChange={(v) => {\n const newEvents = { ...events, agentFailed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n\n <SubsectionLabel>Pull Request Events</SubsectionLabel>\n <SwitchRow\n label=\"PR merged\"\n id=\"notif-event-prMerged\"\n testId=\"switch-event-prMerged\"\n checked={events.prMerged}\n onChange={(v) => {\n const newEvents = { ...events, prMerged: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR closed\"\n id=\"notif-event-prClosed\"\n testId=\"switch-event-prClosed\"\n checked={events.prClosed}\n onChange={(v) => {\n const newEvents = { ...events, prClosed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR checks passed\"\n id=\"notif-event-prChecksPassed\"\n testId=\"switch-event-prChecksPassed\"\n checked={events.prChecksPassed}\n onChange={(v) => {\n const newEvents = { ...events, prChecksPassed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR checks failed\"\n id=\"notif-event-prChecksFailed\"\n testId=\"switch-event-prChecksFailed\"\n checked={events.prChecksFailed}\n onChange={(v) => {\n const newEvents = { ...events, prChecksFailed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR blocked\"\n id=\"notif-event-prBlocked\"\n testId=\"switch-event-prBlocked\"\n checked={events.prBlocked}\n onChange={(v) => {\n const newEvents = { ...events, prBlocked: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Merge review ready\"\n id=\"notif-event-mergeReviewReady\"\n testId=\"switch-event-mergeReviewReady\"\n checked={events.mergeReviewReady}\n onChange={(v) => {\n const newEvents = { ...events, mergeReviewReady: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Notification system',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml',\n },\n ]}\n >\n In-app toast notifications keep you in the loop. Fine-tune which agent lifecycle events\n trigger a notification.\n </SectionHint>\n </div>\n\n {/* ── Feature Flags ── */}\n <div\n id=\"section-feature-flags\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Flag}\n title=\"Feature Flags\"\n description=\"Enable or disable experimental features\"\n badge=\"Experimental\"\n testId=\"feature-flags-settings-section\"\n >\n <SwitchRow\n label=\"Skills\"\n description=\"Enable the skills system for agent capabilities\"\n id=\"flag-skills\"\n testId=\"switch-flag-skills\"\n checked={flags.skills}\n onChange={(v) => {\n const newFlags = { ...flags, skills: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Deployments\"\n description=\"Enable environment deployment workflows\"\n id=\"flag-envDeploy\"\n testId=\"switch-flag-envDeploy\"\n checked={flags.envDeploy}\n onChange={(v) => {\n const newFlags = { ...flags, envDeploy: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Debug\"\n description=\"Show debug panels and verbose logging\"\n id=\"flag-debug\"\n testId=\"switch-flag-debug\"\n checked={flags.debug}\n onChange={(v) => {\n const newFlags = { ...flags, debug: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"GitHub Import\"\n description=\"Enable GitHub repository import in the web UI\"\n id=\"flag-githubImport\"\n testId=\"switch-flag-githubImport\"\n checked={flags.githubImport}\n onChange={(v) => {\n const newFlags = { ...flags, githubImport: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Adopt Branch\"\n description=\"Import existing branches as tracked features\"\n id=\"flag-adoptBranch\"\n testId=\"switch-flag-adoptBranch\"\n checked={flags.adoptBranch}\n onChange={(v) => {\n const newFlags = { ...flags, adoptBranch: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Git Rebase & Sync\"\n description=\"Enable git rebase-on-main and sync-main operations\"\n id=\"flag-gitRebaseSync\"\n testId=\"switch-flag-gitRebaseSync\"\n checked={flags.gitRebaseSync}\n onChange={(v) => {\n const newFlags = { ...flags, gitRebaseSync: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"React File Manager\"\n description=\"Use the built-in React file manager instead of the native OS folder picker\"\n id=\"flag-reactFileManager\"\n testId=\"switch-flag-reactFileManager\"\n checked={flags.reactFileManager}\n onChange={(v) => {\n const newFlags = { ...flags, reactFileManager: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n </SettingsSection>\n <SectionHint>\n Experimental features that are still under development. Enable at your own risk — they\n may change or be removed in future versions. Debug mode adds verbose logging useful for\n troubleshooting.\n </SectionHint>\n </div>\n\n {/* ── Database ── */}\n <div\n id=\"section-database\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Database}\n title=\"Database\"\n description=\"Local storage information\"\n testId=\"database-settings-section\"\n >\n <SettingsRow label=\"Location\" description=\"Path to the local SQLite database\">\n <span\n className=\"text-muted-foreground max-w-50 truncate font-mono text-xs\"\n data-testid=\"shep-home-path\"\n >\n {shepHome}\n </span>\n </SettingsRow>\n <SettingsRow label=\"Size\">\n <span className=\"text-muted-foreground text-xs\" data-testid=\"db-file-size\">\n {dbFileSize}\n </span>\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Settings service',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md',\n },\n {\n label: 'Settings spec',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md',\n },\n ]}\n >\n All settings are stored in a local SQLite database at ~/.shep/data. The database uses a\n singleton record pattern with automatic migrations on startup.\n </SectionHint>\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\n// src/slider.tsx\nimport * as React from \"react\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar PAGE_KEYS = [\"PageUp\", \"PageDown\"];\nvar ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"];\nvar BACK_KEYS = {\n \"from-left\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-right\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowRight\"],\n \"from-bottom\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-top\": [\"Home\", \"PageDown\", \"ArrowUp\", \"ArrowLeft\"]\n};\nvar SLIDER_NAME = \"Slider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);\nvar [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [\n createCollectionScope\n]);\nvar [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);\nvar Slider = React.forwardRef(\n (props, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = \"horizontal\",\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {\n },\n onValueCommit = () => {\n },\n inverted = false,\n form,\n ...sliderProps\n } = props;\n const thumbRefs = React.useRef(/* @__PURE__ */ new Set());\n const valueIndexToChangeRef = React.useRef(0);\n const isHorizontal = orientation === \"horizontal\";\n const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n onChange: (value2) => {\n const thumbs = [...thumbRefs.current];\n thumbs[valueIndexToChangeRef.current]?.focus();\n onValueChange(value2);\n }\n });\n const valuesBeforeSlideStartRef = React.useRef(values);\n function handleSlideStart(value2) {\n const closestIndex = getClosestValueIndex(values, value2);\n updateValues(value2, closestIndex);\n }\n function handleSlideMove(value2) {\n updateValues(value2, valueIndexToChangeRef.current);\n }\n function handleSlideEnd() {\n const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];\n const nextValue = values[valueIndexToChangeRef.current];\n const hasChanged = nextValue !== prevValue;\n if (hasChanged) onValueCommit(values);\n }\n function updateValues(value2, atIndex, { commit } = { commit: false }) {\n const decimalCount = getDecimalCount(step);\n const snapToStep = roundValue(Math.round((value2 - min) / step) * step + min, decimalCount);\n const nextValue = clamp(snapToStep, [min, max]);\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue);\n const hasChanged = String(nextValues) !== String(prevValues);\n if (hasChanged && commit) onValueCommit(nextValues);\n return hasChanged ? nextValues : prevValues;\n } else {\n return prevValues;\n }\n });\n }\n return /* @__PURE__ */ jsx(\n SliderProvider,\n {\n scope: props.__scopeSlider,\n name,\n disabled,\n min,\n max,\n valueIndexToChangeRef,\n thumbs: thumbRefs.current,\n values,\n orientation,\n form,\n children: /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(\n SliderOrientation,\n {\n \"aria-disabled\": disabled,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...sliderProps,\n ref: forwardedRef,\n onPointerDown: composeEventHandlers(sliderProps.onPointerDown, () => {\n if (!disabled) valuesBeforeSlideStartRef.current = values;\n }),\n min,\n max,\n inverted,\n onSlideStart: disabled ? void 0 : handleSlideStart,\n onSlideMove: disabled ? void 0 : handleSlideMove,\n onSlideEnd: disabled ? void 0 : handleSlideEnd,\n onHomeKeyDown: () => !disabled && updateValues(min, 0, { commit: true }),\n onEndKeyDown: () => !disabled && updateValues(max, values.length - 1, { commit: true }),\n onStepKeyDown: ({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key);\n const isSkipKey = isPageKey || event.shiftKey && ARROW_KEYS.includes(event.key);\n const multiplier = isSkipKey ? 10 : 1;\n const atIndex = valueIndexToChangeRef.current;\n const value2 = values[atIndex];\n const stepInDirection = step * multiplier * stepDirection;\n updateValues(value2 + stepInDirection, atIndex, { commit: true });\n }\n }\n }\n ) }) })\n }\n );\n }\n);\nSlider.displayName = SLIDER_NAME;\nvar [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext(SLIDER_NAME, {\n startEdge: \"left\",\n endEdge: \"right\",\n size: \"width\",\n direction: 1\n});\nvar SliderHorizontal = React.forwardRef(\n (props, forwardedRef) => {\n const {\n min,\n max,\n dir,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const [slider, setSlider] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setSlider(node));\n const rectRef = React.useRef(void 0);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === \"ltr\";\n const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;\n function getValueFromPointer(pointerPosition) {\n const rect = rectRef.current || slider.getBoundingClientRect();\n const input = [0, rect.width];\n const output = isSlidingFromLeft ? [min, max] : [max, min];\n const value = linearScale(input, output);\n rectRef.current = rect;\n return value(pointerPosition - rect.left);\n }\n return /* @__PURE__ */ jsx(\n SliderOrientationProvider,\n {\n scope: props.__scopeSlider,\n startEdge: isSlidingFromLeft ? \"left\" : \"right\",\n endEdge: isSlidingFromLeft ? \"right\" : \"left\",\n direction: isSlidingFromLeft ? 1 : -1,\n size: \"width\",\n children: /* @__PURE__ */ jsx(\n SliderImpl,\n {\n dir: direction,\n \"data-orientation\": \"horizontal\",\n ...sliderProps,\n ref: composedRefs,\n style: {\n ...sliderProps.style,\n [\"--radix-slider-thumb-transform\"]: \"translateX(-50%)\"\n },\n onSlideStart: (event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideStart?.(value);\n },\n onSlideMove: (event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideMove?.(value);\n },\n onSlideEnd: () => {\n rectRef.current = void 0;\n onSlideEnd?.();\n },\n onStepKeyDown: (event) => {\n const slideDirection = isSlidingFromLeft ? \"from-left\" : \"from-right\";\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }\n }\n )\n }\n );\n }\n);\nvar SliderVertical = React.forwardRef(\n (props, forwardedRef) => {\n const {\n min,\n max,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const sliderRef = React.useRef(null);\n const ref = useComposedRefs(forwardedRef, sliderRef);\n const rectRef = React.useRef(void 0);\n const isSlidingFromBottom = !inverted;\n function getValueFromPointer(pointerPosition) {\n const rect = rectRef.current || sliderRef.current.getBoundingClientRect();\n const input = [0, rect.height];\n const output = isSlidingFromBottom ? [max, min] : [min, max];\n const value = linearScale(input, output);\n rectRef.current = rect;\n return value(pointerPosition - rect.top);\n }\n return /* @__PURE__ */ jsx(\n SliderOrientationProvider,\n {\n scope: props.__scopeSlider,\n startEdge: isSlidingFromBottom ? \"bottom\" : \"top\",\n endEdge: isSlidingFromBottom ? \"top\" : \"bottom\",\n size: \"height\",\n direction: isSlidingFromBottom ? 1 : -1,\n children: /* @__PURE__ */ jsx(\n SliderImpl,\n {\n \"data-orientation\": \"vertical\",\n ...sliderProps,\n ref,\n style: {\n ...sliderProps.style,\n [\"--radix-slider-thumb-transform\"]: \"translateY(50%)\"\n },\n onSlideStart: (event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideStart?.(value);\n },\n onSlideMove: (event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideMove?.(value);\n },\n onSlideEnd: () => {\n rectRef.current = void 0;\n onSlideEnd?.();\n },\n onStepKeyDown: (event) => {\n const slideDirection = isSlidingFromBottom ? \"from-bottom\" : \"from-top\";\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }\n }\n )\n }\n );\n }\n);\nvar SliderImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSlider,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onHomeKeyDown,\n onEndKeyDown,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const context = useSliderContext(SLIDER_NAME, __scopeSlider);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...sliderProps,\n ref: forwardedRef,\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Home\") {\n onHomeKeyDown(event);\n event.preventDefault();\n } else if (event.key === \"End\") {\n onEndKeyDown(event);\n event.preventDefault();\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event);\n event.preventDefault();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n const target = event.target;\n target.setPointerCapture(event.pointerId);\n event.preventDefault();\n if (context.thumbs.has(target)) {\n target.focus();\n } else {\n onSlideStart(event);\n }\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n onSlideEnd(event);\n }\n })\n }\n );\n }\n);\nvar TRACK_NAME = \"SliderTrack\";\nvar SliderTrack = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props;\n const context = useSliderContext(TRACK_NAME, __scopeSlider);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-disabled\": context.disabled ? \"\" : void 0,\n \"data-orientation\": context.orientation,\n ...trackProps,\n ref: forwardedRef\n }\n );\n }\n);\nSliderTrack.displayName = TRACK_NAME;\nvar RANGE_NAME = \"SliderRange\";\nvar SliderRange = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props;\n const context = useSliderContext(RANGE_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const valuesCount = context.values.length;\n const percentages = context.values.map(\n (value) => convertValueToPercentage(value, context.min, context.max)\n );\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;\n const offsetEnd = 100 - Math.max(...percentages);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-orientation\": context.orientation,\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...rangeProps,\n ref: composedRefs,\n style: {\n ...props.style,\n [orientation.startEdge]: offsetStart + \"%\",\n [orientation.endEdge]: offsetEnd + \"%\"\n }\n }\n );\n }\n);\nSliderRange.displayName = RANGE_NAME;\nvar THUMB_NAME = \"SliderThumb\";\nvar SliderThumb = React.forwardRef(\n (props, forwardedRef) => {\n const getItems = useCollection(props.__scopeSlider);\n const [thumb, setThumb] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const index = React.useMemo(\n () => thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1,\n [getItems, thumb]\n );\n return /* @__PURE__ */ jsx(SliderThumbImpl, { ...props, ref: composedRefs, index });\n }\n);\nvar SliderThumbImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, index, name, ...thumbProps } = props;\n const context = useSliderContext(THUMB_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);\n const [thumb, setThumb] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const isFormControl = thumb ? context.form || !!thumb.closest(\"form\") : true;\n const size = useSize(thumb);\n const value = context.values[index];\n const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);\n const label = getLabel(index, context.values.length);\n const orientationSize = size?.[orientation.size];\n const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb);\n return () => {\n context.thumbs.delete(thumb);\n };\n }\n }, [thumb, context.thumbs]);\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n style: {\n transform: \"var(--radix-slider-thumb-transform)\",\n position: \"absolute\",\n [orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`\n },\n children: [\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n role: \"slider\",\n \"aria-label\": props[\"aria-label\"] || label,\n \"aria-valuemin\": context.min,\n \"aria-valuenow\": value,\n \"aria-valuemax\": context.max,\n \"aria-orientation\": context.orientation,\n \"data-orientation\": context.orientation,\n \"data-disabled\": context.disabled ? \"\" : void 0,\n tabIndex: context.disabled ? void 0 : 0,\n ...thumbProps,\n ref: composedRefs,\n style: value === void 0 ? { display: \"none\" } : props.style,\n onFocus: composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index;\n })\n }\n ) }),\n isFormControl && /* @__PURE__ */ jsx(\n SliderBubbleInput,\n {\n name: name ?? (context.name ? context.name + (context.values.length > 1 ? \"[]\" : \"\") : void 0),\n form: context.form,\n value\n },\n index\n )\n ]\n }\n );\n }\n);\nSliderThumb.displayName = THUMB_NAME;\nvar BUBBLE_INPUT_NAME = \"RadioBubbleInput\";\nvar SliderBubbleInput = React.forwardRef(\n ({ __scopeSlider, value, ...props }, forwardedRef) => {\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, \"value\");\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"input\", { bubbles: true });\n setValue.call(input, value);\n input.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(\n Primitive.input,\n {\n style: { display: \"none\" },\n ...props,\n ref: composedRefs,\n defaultValue: value\n }\n );\n }\n);\nSliderBubbleInput.displayName = BUBBLE_INPUT_NAME;\nfunction getNextSortedValues(prevValues = [], nextValue, atIndex) {\n const nextValues = [...prevValues];\n nextValues[atIndex] = nextValue;\n return nextValues.sort((a, b) => a - b);\n}\nfunction convertValueToPercentage(value, min, max) {\n const maxSteps = max - min;\n const percentPerStep = 100 / maxSteps;\n const percentage = percentPerStep * (value - min);\n return clamp(percentage, [0, 100]);\n}\nfunction getLabel(index, totalValues) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`;\n } else if (totalValues === 2) {\n return [\"Minimum\", \"Maximum\"][index];\n } else {\n return void 0;\n }\n}\nfunction getClosestValueIndex(values, nextValue) {\n if (values.length === 1) return 0;\n const distances = values.map((value) => Math.abs(value - nextValue));\n const closestDistance = Math.min(...distances);\n return distances.indexOf(closestDistance);\n}\nfunction getThumbInBoundsOffset(width, left, direction) {\n const halfWidth = width / 2;\n const halfPercent = 50;\n const offset = linearScale([0, halfPercent], [0, halfWidth]);\n return (halfWidth - offset(left) * direction) * direction;\n}\nfunction getStepsBetweenValues(values) {\n return values.slice(0, -1).map((value, index) => values[index + 1] - value);\n}\nfunction hasMinStepsBetweenValues(values, minStepsBetweenValues) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values);\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);\n return actualMinStepsBetweenValues >= minStepsBetweenValues;\n }\n return true;\n}\nfunction linearScale(input, output) {\n return (value) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\nfunction getDecimalCount(value) {\n return (String(value).split(\".\")[1] || \"\").length;\n}\nfunction roundValue(value, decimalCount) {\n const rounder = Math.pow(10, decimalCount);\n return Math.round(value * rounder) / rounder;\n}\nvar Root = Slider;\nvar Track = SliderTrack;\nvar Range = SliderRange;\nvar Thumb = SliderThumb;\nexport {\n Range,\n Root,\n Slider,\n SliderRange,\n SliderThumb,\n SliderTrack,\n Thumb,\n Track,\n createSliderScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),\n [value, defaultValue, min, max]\n );\n\n return (\n <SliderPrimitive.Root\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n 'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n 'bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5'\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className={cn(\n 'bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: _values.length }, (_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={index}\n className=\"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50\"\n />\n ))}\n </SliderPrimitive.Root>\n );\n}\n\nexport { Slider };\n","import type { ComponentType, SVGProps } from 'react';\nimport Image from 'next/image';\nimport { Code, Rocket } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\ntype IconProps = SVGProps<SVGSVGElement> & { className?: string };\n\n/** Fallback icon for unknown editor types. */\nfunction DefaultEditorIcon(props: IconProps) {\n return <Code className={cn('h-4 w-4', props.className)} {...(props as object)} />;\n}\n\nfunction VsCodeIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/vscode.svg\"\n alt=\"VS Code\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nVsCodeIcon.displayName = 'VsCodeIcon';\n\nfunction CursorEditorIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/agents/cursor.jpeg\"\n alt=\"Cursor\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nCursorEditorIcon.displayName = 'CursorEditorIcon';\n\nfunction WindsurfIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/windsurf.svg\"\n alt=\"Windsurf\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nWindsurfIcon.displayName = 'WindsurfIcon';\n\nfunction ZedIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/zed.svg\"\n alt=\"Zed\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nZedIcon.displayName = 'ZedIcon';\n\nfunction AntigravityIcon({ className, ...props }: IconProps) {\n return <Rocket className={cn('h-4 w-4', className)} {...(props as object)} />;\n}\nAntigravityIcon.displayName = 'AntigravityIcon';\n\nconst editorTypeIconMap: Record<string, ComponentType<IconProps>> = {\n vscode: VsCodeIcon,\n cursor: CursorEditorIcon,\n windsurf: WindsurfIcon,\n zed: ZedIcon,\n antigravity: AntigravityIcon,\n};\n\n/** Resolve an editor type string to its corresponding icon component. */\nexport function getEditorTypeIcon(editorType?: string): ComponentType<IconProps> {\n if (editorType && editorType in editorTypeIconMap) {\n return editorTypeIconMap[editorType];\n }\n return DefaultEditorIcon;\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm18 15-6-6-6 6', key: '153udz' }]];\n\n/**\n * @component @name ChevronUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/chevron-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronUp = createLucideIcon('chevron-up', __iconNode);\n\nexport default ChevronUp;\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { VISUALLY_HIDDEN_STYLES } from '@radix-ui/react-visually-hidden';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\nconst SELECTION_KEYS = [' ', 'Enter'];\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select';\n\ntype ItemData = { value: string; disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n SelectItemElement,\n ItemData\n>(SELECT_NAME);\n\ntype ScopedProps<P> = P & { __scopeSelect?: Scope };\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype SelectContextValue = {\n trigger: SelectTriggerElement | null;\n onTriggerChange(node: SelectTriggerElement | null): void;\n valueNode: SelectValueElement | null;\n onValueNodeChange(node: SelectValueElement): void;\n valueNodeHasChildren: boolean;\n onValueNodeHasChildrenChange(hasChildren: boolean): void;\n contentId: string;\n value: string | undefined;\n onValueChange(value: string): void;\n open: boolean;\n required?: boolean;\n onOpenChange(open: boolean): void;\n dir: SelectProps['dir'];\n triggerPointerDownPosRef: React.MutableRefObject<{ x: number; y: number } | null>;\n disabled?: boolean;\n};\n\nconst [SelectProvider, useSelectContext] = createSelectContext<SelectContextValue>(SELECT_NAME);\n\ntype NativeOption = React.ReactElement<React.ComponentProps<'option'>>;\n\ntype SelectNativeOptionsContextValue = {\n onNativeOptionAdd(option: NativeOption): void;\n onNativeOptionRemove(option: NativeOption): void;\n};\nconst [SelectNativeOptionsProvider, useSelectNativeOptionsContext] =\n createSelectContext<SelectNativeOptionsContextValue>(SELECT_NAME);\n\ninterface ControlledClearableSelectProps {\n value: string | undefined;\n defaultValue?: never;\n onValueChange: (value: string | undefined) => void;\n}\n\ninterface ControlledUnclearableSelectProps {\n value: string;\n defaultValue?: never;\n onValueChange: (value: string) => void;\n}\n\ninterface UncontrolledSelectProps {\n value?: never;\n defaultValue?: string;\n onValueChange?: {\n (value: string): void;\n (value: string | undefined): void;\n };\n}\n\ntype SelectControlProps =\n | ControlledClearableSelectProps\n | ControlledUnclearableSelectProps\n | UncontrolledSelectProps;\n\ninterface SelectSharedProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n name?: string;\n autoComplete?: string;\n disabled?: boolean;\n required?: boolean;\n form?: string;\n}\n\n// TODO: Should improve typing somewhat, but this would be a breaking change.\n// Consider using in the next major version (along with some testing to be sure\n// it works as expected and doesn't cause problems)\ntype _FutureSelectProps = SelectSharedProps & SelectControlProps;\n\ntype SelectProps = SelectSharedProps & {\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n};\n\nconst Select: React.FC<SelectProps> = (props: ScopedProps<SelectProps>) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form,\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState<SelectTriggerElement | null>(null);\n const [valueNode, setValueNode] = React.useState<SelectValueElement | null>(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SELECT_NAME,\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange as any,\n caller: SELECT_NAME,\n });\n const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null);\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = trigger ? form || !!trigger.closest('form') : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(new Set<NativeOption>());\n\n // The native `select` only associates the correct default value if the corresponding\n // `option` is rendered as a child **at the same time** as itself.\n // Because it might take a few renders for our items to gather the information to build\n // the native `option`(s), we generate a key on the `select` to make sure React re-builds it\n // each time the options change.\n const nativeSelectKey = Array.from(nativeOptionsSet)\n .map((option) => option.props.value)\n .join(';');\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <SelectProvider\n required={required}\n scope={__scopeSelect}\n trigger={trigger}\n onTriggerChange={setTrigger}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n valueNodeHasChildren={valueNodeHasChildren}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n contentId={useId()}\n value={value}\n onValueChange={setValue}\n open={open}\n onOpenChange={setOpen}\n dir={direction}\n triggerPointerDownPosRef={triggerPointerDownPosRef}\n disabled={disabled}\n >\n <Collection.Provider scope={__scopeSelect}>\n <SelectNativeOptionsProvider\n scope={props.__scopeSelect}\n onNativeOptionAdd={React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, [])}\n onNativeOptionRemove={React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, [])}\n >\n {children}\n </SelectNativeOptionsProvider>\n </Collection.Provider>\n\n {isFormControl ? (\n <SelectBubbleInput\n key={nativeSelectKey}\n aria-hidden\n required={required}\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n disabled={disabled}\n form={form}\n >\n {value === undefined ? <option value=\"\" /> : null}\n {Array.from(nativeOptionsSet)}\n </SelectBubbleInput>\n ) : null}\n </SelectProvider>\n </PopperPrimitive.Root>\n );\n};\n\nSelect.displayName = SELECT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger';\n\ntype SelectTriggerElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface SelectTriggerProps extends PrimitiveButtonProps {}\n\nconst SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(\n (props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== undefined) {\n context.onValueChange(nextItem.value);\n }\n });\n\n const handleOpen = (pointerEvent?: React.MouseEvent | React.PointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n // reset typeahead when we open\n resetTypeahead();\n }\n\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY),\n };\n }\n };\n\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.button\n type=\"button\"\n role=\"combobox\"\n aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-required={context.required}\n aria-autocomplete=\"none\"\n dir={context.dir}\n data-state={context.open ? 'open' : 'closed'}\n disabled={isDisabled}\n data-disabled={isDisabled ? '' : undefined}\n data-placeholder={shouldShowPlaceholder(context.value) ? '' : undefined}\n {...triggerProps}\n ref={composedRefs}\n // Enable compatibility with native label or custom `Label` \"click\" for Safari:\n onClick={composeEventHandlers(triggerProps.onClick, (event) => {\n // Whilst browsers generally have no issue focusing the trigger when clicking\n // on a label, Safari seems to struggle with the fact that there's no `onClick`.\n // We force `focus` in this case. Note: this doesn't create any other side-effect\n // because we are preventing default in `onPointerDown` so effectively\n // this only runs for a label \"click\"\n event.currentTarget.focus();\n\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') {\n handleOpen(event);\n }\n })}\n onPointerDown={composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n\n // prevent implicit pointer capture\n // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click); also not for touch\n // devices because that would open the menu on scroll. (pen devices behave as touch on iOS).\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === 'mouse') {\n handleOpen(event);\n // prevent trigger from stealing focus from the active item after opening.\n event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== '';\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === ' ') return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })}\n />\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nSelectTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue';\n\ntype SelectValueElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SelectValueProps extends Omit<PrimitiveSpanProps, 'placeholder'> {\n placeholder?: React.ReactNode;\n}\n\nconst SelectValue = React.forwardRef<SelectValueElement, SelectValueProps>(\n (props: ScopedProps<SelectValueProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, children, placeholder = '', ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== undefined;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n\n return (\n <Primitive.span\n {...valueProps}\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n style={{ pointerEvents: 'none' }}\n >\n {shouldShowPlaceholder(context.value) ? <>{placeholder}</> : children}\n </Primitive.span>\n );\n }\n);\n\nSelectValue.displayName = VALUE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nconst ICON_NAME = 'SelectIcon';\n\ntype SelectIconElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectIconProps extends PrimitiveSpanProps {}\n\nconst SelectIcon = React.forwardRef<SelectIconElement, SelectIconProps>(\n (props: ScopedProps<SelectIconProps>, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return (\n <Primitive.span aria-hidden {...iconProps} ref={forwardedRef}>\n {children || '▼'}\n </Primitive.span>\n );\n }\n);\n\nSelectIcon.displayName = ICON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'SelectPortal';\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface SelectPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n}\n\nconst SelectPortal: React.FC<SelectPortalProps> = (props: ScopedProps<SelectPortalProps>) => {\n return <PortalPrimitive asChild {...props} />;\n};\n\nSelectPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent';\n\ntype SelectContentElement = SelectContentImplElement;\ninterface SelectContentProps extends SelectContentImplProps {}\n\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props: ScopedProps<SelectContentProps>, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState<DocumentFragment>();\n\n // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n\n if (!context.open) {\n const frag = fragment as Element | undefined;\n return frag\n ? ReactDOM.createPortal(\n <SelectContentProvider scope={props.__scopeSelect}>\n <Collection.Slot scope={props.__scopeSelect}>\n <div>{props.children}</div>\n </Collection.Slot>\n </SelectContentProvider>,\n frag\n )\n : null;\n }\n\n return <SelectContentImpl {...props} ref={forwardedRef} />;\n }\n);\n\nSelectContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContentImpl\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_MARGIN = 10;\n\ntype SelectContentContextValue = {\n content?: SelectContentElement | null;\n viewport?: SelectViewportElement | null;\n onViewportChange?: (node: SelectViewportElement | null) => void;\n itemRefCallback?: (node: SelectItemElement | null, value: string, disabled: boolean) => void;\n selectedItem?: SelectItemElement | null;\n onItemLeave?: () => void;\n itemTextRefCallback?: (\n node: SelectItemTextElement | null,\n value: string,\n disabled: boolean\n ) => void;\n focusSelectedItem?: () => void;\n selectedItemText?: SelectItemTextElement | null;\n position?: SelectContentProps['position'];\n isPositioned?: boolean;\n searchRef?: React.RefObject<string>;\n};\n\nconst [SelectContentProvider, useSelectContentContext] =\n createSelectContext<SelectContentContextValue>(CONTENT_NAME);\n\nconst CONTENT_IMPL_NAME = 'SelectContentImpl';\n\ntype SelectContentImplElement = SelectPopperPositionElement | SelectItemAlignedPositionElement;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\n\ntype SelectPopperPrivateProps = { onPlaced?: PopperContentProps['onPlaced'] };\n\ninterface SelectContentImplProps\n extends Omit<SelectPopperPositionProps, keyof SelectPopperPrivateProps>,\n Omit<SelectItemAlignedPositionProps, keyof SelectPopperPrivateProps> {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n\n position?: 'item-aligned' | 'popper';\n}\n\nconst Slot = createSlot('SelectContent.RemoveScroll');\n\nconst SelectContentImpl = React.forwardRef<SelectContentImplElement, SelectContentImplProps>(\n (props: ScopedProps<SelectContentImplProps>, forwardedRef) => {\n const {\n __scopeSelect,\n position = 'item-aligned',\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState<SelectContentImplElement | null>(null);\n const [viewport, setViewport] = React.useState<SelectViewportElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState<SelectItemElement | null>(null);\n const [selectedItemText, setSelectedItemText] = React.useState<SelectItemTextElement | null>(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n\n // Make sure the whole tree has focus guards as our `Select` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const focusFirst = React.useCallback(\n (candidates: Array<HTMLElement | null>) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: 'nearest' });\n // viewport might have padding so scroll to its edges when focusing first/last items.\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n\n // Since this is not dependent on layout, we want to ensure this runs at the same time as\n // other effects across components. Hence why we don't call `focusSelectedItem` inside `position`.\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n\n // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`\n // and close on `pointerup` outside.\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n\n const handlePointerMove = (event: PointerEvent) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)),\n };\n };\n const handlePointerUp = (event: PointerEvent) => {\n // If the pointer hasn't moved by a certain threshold then we prevent selecting item on `pointerup`.\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n // otherwise, if the event was outside the content, close.\n if (!content.contains(event.target as HTMLElement)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener('pointermove', handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener('pointermove', handlePointerMove);\n document.addEventListener('pointerup', handlePointerUp, { capture: true, once: true });\n }\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n document.removeEventListener('pointerup', handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener('blur', close);\n window.addEventListener('resize', close);\n return () => {\n window.removeEventListener('blur', close);\n window.removeEventListener('resize', close);\n };\n }, [onOpenChange]);\n\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (nextItem.ref.current as HTMLElement).focus());\n }\n });\n\n const itemRefCallback = React.useCallback(\n (node: SelectItemElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node: SelectItemTextElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n\n const SelectPosition = position === 'popper' ? SelectPopperPosition : SelectItemAlignedPosition;\n\n // Silently ignore props that are not supported by `SelectItemAlignedPosition`\n const popperContentProps =\n SelectPosition === SelectPopperPosition\n ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n }\n : {};\n\n return (\n <SelectContentProvider\n scope={__scopeSelect}\n content={content}\n viewport={viewport}\n onViewportChange={setViewport}\n itemRefCallback={itemRefCallback}\n selectedItem={selectedItem}\n onItemLeave={handleItemLeave}\n itemTextRefCallback={itemTextRefCallback}\n focusSelectedItem={focusSelectedItem}\n selectedItemText={selectedItemText}\n position={position}\n isPositioned={isPositioned}\n searchRef={searchRef}\n >\n <RemoveScroll as={Slot} allowPinchZoom>\n <FocusScope\n asChild\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n trapped={context.open}\n onMountAutoFocus={(event) => {\n // we prevent open autofocus because we manually focus the selected item\n event.preventDefault();\n }}\n onUnmountAutoFocus={composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n })}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n // When focus is trapped, a focusout event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={() => context.onOpenChange(false)}\n >\n <SelectPosition\n role=\"listbox\"\n id={context.contentId}\n data-state={context.open ? 'open' : 'closed'}\n dir={context.dir}\n onContextMenu={(event) => event.preventDefault()}\n {...contentProps}\n {...popperContentProps}\n onPlaced={() => setIsPositioned(true)}\n ref={composedRefs}\n style={{\n // flex layout so we can place the scroll buttons properly\n display: 'flex',\n flexDirection: 'column',\n // reset the outline by default as the content MAY get focused\n outline: 'none',\n ...contentProps.style,\n }}\n onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n\n // select should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n\n if (['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (['ArrowUp', 'End'].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if (['ArrowUp', 'ArrowDown'].includes(event.key)) {\n const currentElement = event.target as SelectItemElement;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n event.preventDefault();\n }\n })}\n />\n </DismissableLayer>\n </FocusScope>\n </RemoveScroll>\n </SelectContentProvider>\n );\n }\n);\n\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemAlignedPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_ALIGNED_POSITION_NAME = 'SelectItemAlignedPosition';\n\ntype SelectItemAlignedPositionElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps {}\n\nconst SelectItemAlignedPosition = React.forwardRef<\n SelectItemAlignedPositionElement,\n SelectItemAlignedPositionProps\n>((props: ScopedProps<SelectItemAlignedPositionProps>, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState<HTMLDivElement | null>(null);\n const [content, setContent] = React.useState<SelectItemAlignedPositionElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (\n context.trigger &&\n context.valueNode &&\n contentWrapper &&\n content &&\n viewport &&\n selectedItem &&\n selectedItemText\n ) {\n const triggerRect = context.trigger.getBoundingClientRect();\n\n // -----------------------------------------------------------------------------------------\n // Horizontal positioning\n // -----------------------------------------------------------------------------------------\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n\n if (context.dir !== 'rtl') {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.left = clampedLeft + 'px';\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.right = clampedRight + 'px';\n }\n\n // -----------------------------------------------------------------------------------------\n // Vertical positioning\n // -----------------------------------------------------------------------------------------\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n\n if (willAlignWithoutTopOverflow) {\n const isLastItem =\n items.length > 0 && selectedItem === items[items.length - 1]!.ref.current;\n contentWrapper.style.bottom = 0 + 'px';\n const viewportOffsetBottom =\n content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight +\n // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) +\n viewportOffsetBottom +\n contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + 'px';\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0]!.ref.current;\n contentWrapper.style.top = 0 + 'px';\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth +\n viewport.offsetTop +\n // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) +\n selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + 'px';\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + 'px';\n contentWrapper.style.maxHeight = availableHeight + 'px';\n // -----------------------------------------------------------------------------------------\n\n onPlaced?.();\n\n // we don't want the initial scroll position adjustment to trigger \"expand on scroll\"\n // so we explicitly turn it on only after they've registered.\n requestAnimationFrame(() => (shouldExpandOnScrollRef.current = true));\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced,\n ]);\n\n useLayoutEffect(() => position(), [position]);\n\n // copy z-index from content to wrapper\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n // When the viewport becomes scrollable at the top, the scroll up button will mount.\n // Because it is part of the normal flow, it will push down the viewport, thus throwing our\n // trigger => selectedItem alignment off by the amount the viewport was pushed down.\n // We wait for this to happen and then re-run the positining logic one more time to account for it.\n const handleScrollButtonChange = React.useCallback(\n (node: SelectScrollButtonImplElement | null) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n\n return (\n <SelectViewportProvider\n scope={__scopeSelect}\n contentWrapper={contentWrapper}\n shouldExpandOnScrollRef={shouldExpandOnScrollRef}\n onScrollButtonChange={handleScrollButtonChange}\n >\n <div\n ref={setContentWrapper}\n style={{\n display: 'flex',\n flexDirection: 'column',\n position: 'fixed',\n zIndex: contentZIndex,\n }}\n >\n <Primitive.div\n {...popperProps}\n ref={composedRefs}\n style={{\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: 'border-box',\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: '100%',\n ...popperProps.style,\n }}\n />\n </div>\n </SelectViewportProvider>\n );\n});\n\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPopperPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_POSITION_NAME = 'SelectPopperPosition';\n\ntype SelectPopperPositionElement = React.ComponentRef<typeof PopperPrimitive.Content>;\ntype PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps {}\n\nconst SelectPopperPosition = React.forwardRef<\n SelectPopperPositionElement,\n SelectPopperPositionProps\n>((props: ScopedProps<SelectPopperPositionProps>, forwardedRef) => {\n const {\n __scopeSelect,\n align = 'start',\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n\n return (\n <PopperPrimitive.Content\n {...popperScope}\n {...popperProps}\n ref={forwardedRef}\n align={align}\n collisionPadding={collisionPadding}\n style={{\n // Ensure border-box for floating-ui calculations\n boxSizing: 'border-box',\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-select-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-select-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-select-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n});\n\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\ntype SelectViewportContextValue = {\n contentWrapper?: HTMLDivElement | null;\n shouldExpandOnScrollRef?: React.RefObject<boolean>;\n onScrollButtonChange?: (node: SelectScrollButtonImplElement | null) => void;\n};\n\nconst [SelectViewportProvider, useSelectViewportContext] =\n createSelectContext<SelectViewportContextValue>(CONTENT_NAME, {});\n\nconst VIEWPORT_NAME = 'SelectViewport';\n\ntype SelectViewportElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SelectViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst SelectViewport = React.forwardRef<SelectViewportElement, SelectViewportProps>(\n (props: ScopedProps<SelectViewportProps>, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n nonce={nonce}\n />\n <Collection.Slot scope={__scopeSelect}>\n <Primitive.div\n data-radix-select-viewport=\"\"\n role=\"presentation\"\n {...viewportProps}\n ref={composedRefs}\n style={{\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: 'relative',\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: 'hidden auto',\n ...viewportProps.style,\n }}\n onScroll={composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n\n contentWrapper.style.height = clampedNextHeight + 'px';\n if (contentWrapper.style.bottom === '0px') {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n // ensure the content stays pinned to the bottom\n contentWrapper.style.justifyContent = 'flex-end';\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })}\n />\n </Collection.Slot>\n </>\n );\n }\n);\n\nSelectViewport.displayName = VIEWPORT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup';\n\ntype SelectGroupContextValue = { id: string };\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME);\n\ntype SelectGroupElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectGroupProps extends PrimitiveDivProps {}\n\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId}>\n <Primitive.div role=\"group\" aria-labelledby={groupId} {...groupProps} ref={forwardedRef} />\n </SelectGroupContextProvider>\n );\n }\n);\n\nSelectGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel';\n\ntype SelectLabelElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectLabelProps extends PrimitiveDivProps {}\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return <Primitive.div id={groupContext.id} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nSelectLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem';\n\ntype SelectItemContextValue = {\n value: string;\n disabled: boolean;\n textId: string;\n isSelected: boolean;\n onItemTextChange(node: SelectItemTextElement | null): void;\n};\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME);\n\ntype SelectItemElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectItemProps extends PrimitiveDivProps {\n value: string;\n disabled?: boolean;\n textValue?: string;\n}\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? '');\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n\n if (value === '') {\n throw new Error(\n 'A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.'\n );\n }\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textId={textId}\n isSelected={isSelected}\n onItemTextChange={React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim());\n }, [])}\n >\n <Collection.ItemSlot\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textValue={textValue}\n >\n <Primitive.div\n role=\"option\"\n aria-labelledby={textId}\n data-highlighted={isFocused ? '' : undefined}\n // `isFocused` caveat fixes stuttering in VoiceOver\n aria-selected={isSelected && isFocused}\n data-state={isSelected ? 'checked' : 'unchecked'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n {...itemProps}\n ref={composedRefs}\n onFocus={composeEventHandlers(itemProps.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(itemProps.onBlur, () => setIsFocused(false))}\n onClick={composeEventHandlers(itemProps.onClick, () => {\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') handleSelect();\n })}\n onPointerUp={composeEventHandlers(itemProps.onPointerUp, () => {\n // Using a mouse you should be able to do pointer down, move through\n // the list, and release the pointer over the item to select it.\n if (pointerTypeRef.current === 'mouse') handleSelect();\n })}\n onPointerDown={composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n })}\n onPointerMove={composeEventHandlers(itemProps.onPointerMove, (event) => {\n // Remember pointer type when sliding over to this item from another one\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === 'mouse') {\n // even though safari doesn't support this option, it's acceptable\n // as it only means it might scroll a few pixels when using the pointer.\n event.currentTarget.focus({ preventScroll: true });\n }\n })}\n onPointerLeave={composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n })}\n onKeyDown={composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== '';\n if (isTypingAhead && event.key === ' ') return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n // prevent page scroll if using the space key to select an item\n if (event.key === ' ') event.preventDefault();\n })}\n />\n </Collection.ItemSlot>\n </SelectItemContextProvider>\n );\n }\n);\n\nSelectItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText';\n\ntype SelectItemTextElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectItemTextProps extends PrimitiveSpanProps {}\n\nconst SelectItemText = React.forwardRef<SelectItemTextElement, SelectItemTextProps>(\n (props: ScopedProps<SelectItemTextProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState<SelectItemTextElement | null>(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => (\n <option key={itemContext.value} value={itemContext.value} disabled={itemContext.disabled}>\n {textContent}\n </option>\n ),\n [itemContext.disabled, itemContext.value, textContent]\n );\n\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n\n return (\n <>\n <Primitive.span id={itemContext.textId} {...itemTextProps} ref={composedRefs} />\n\n {/* Portal the select item text into the trigger value node */}\n {itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n </>\n );\n }\n);\n\nSelectItemText.displayName = ITEM_TEXT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator';\n\ntype SelectItemIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectItemIndicatorProps extends PrimitiveSpanProps {}\n\nconst SelectItemIndicator = React.forwardRef<SelectItemIndicatorElement, SelectItemIndicatorProps>(\n (props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? (\n <Primitive.span aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';\n\ntype SelectScrollUpButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollUpButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {}\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>((props: ScopedProps<SelectScrollUpButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const canScrollUp = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollUp ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';\n\ntype SelectScrollDownButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollDownButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {}\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>((props: ScopedProps<SelectScrollDownButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n // we use Math.ceil here because if the UI is zoomed-in\n // `scrollTop` is not always reported as an integer\n const canScrollDown = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollDown ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\n\ntype SelectScrollButtonImplElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectScrollButtonImplProps extends PrimitiveDivProps {\n onAutoScroll(): void;\n}\n\nconst SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext('SelectScrollButton', __scopeSelect);\n const autoScrollTimerRef = React.useRef<number | null>(null);\n const getItems = useCollection(__scopeSelect);\n\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n\n // When the viewport becomes scrollable on either side, the relevant scroll button will mount.\n // Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)\n // the viewport, potentially causing the active item to now be partially out of view.\n // We re-run the `scrollIntoView` logic to make sure it stays within the viewport.\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: 'nearest' });\n }, [getItems]);\n\n return (\n <Primitive.div\n aria-hidden\n {...scrollIndicatorProps}\n ref={forwardedRef}\n style={{ flexShrink: 0, ...scrollIndicatorProps.style }}\n onPointerDown={composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerMove={composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerLeave={composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })}\n />\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'SelectSeparator';\n\ntype SelectSeparatorElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectSeparatorProps extends PrimitiveDivProps {}\n\nconst SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n (props: ScopedProps<SelectSeparatorProps>, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return <Primitive.div aria-hidden {...separatorProps} ref={forwardedRef} />;\n }\n);\n\nSelectSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'SelectArrow';\n\ntype SelectArrowElement = React.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface SelectArrowProps extends PopperArrowProps {}\n\nconst SelectArrow = React.forwardRef<SelectArrowElement, SelectArrowProps>(\n (props: ScopedProps<SelectArrowProps>, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === 'popper' ? (\n <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nSelectArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'SelectBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.select>;\ninterface SwitchBubbleInputProps extends InputProps {}\n\nconst SelectBubbleInput = React.forwardRef<HTMLSelectElement, SwitchBubbleInputProps>(\n ({ __scopeSelect, value, ...props }: ScopedProps<SwitchBubbleInputProps>, forwardedRef) => {\n const ref = React.useRef<HTMLSelectElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const select = ref.current;\n if (!select) return;\n\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n 'value'\n ) as PropertyDescriptor;\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event('change', { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n\n /**\n * We purposefully use a `select` here to support form autofill as much as\n * possible.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programmatically and bubble to any parent form `onChange`\n * event. Adding the `value` will cause React to consider the programmatic\n * dispatch a duplicate and it will get swallowed.\n *\n * We use visually hidden styles rather than `display: \"none\"` because\n * Safari autofill won't work otherwise.\n */\n return (\n <Primitive.select\n {...props}\n style={{ ...VISUALLY_HIDDEN_STYLES, ...props.style }}\n ref={composedRefs}\n defaultValue={value}\n />\n );\n }\n);\n\nSelectBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction shouldShowPlaceholder(value?: string) {\n return value === '' || value === undefined;\n}\n\nfunction useTypeaheadSearch(onSearchChange: (search: string) => void) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef('');\n const timerRef = React.useRef(0);\n\n const handleTypeaheadSearch = React.useCallback(\n (key: string) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n // Reset `searchRef` 1 second after it was last updated\n if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n })(search);\n },\n [handleSearchChange]\n );\n\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = '';\n window.clearTimeout(timerRef.current);\n }, []);\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n return [searchRef, handleTypeaheadSearch, resetTypeahead] as const;\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in a list of items,\n * the search and the current item, and returns the next item (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through items starting with that character)\n *\n * We also reorder the items by wrapping the array around the current item.\n * This is so we always look forward from the current item, and picking the first\n * item will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current item from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current item still matches.\n */\nfunction findNextItem<T extends { textValue: string }>(\n items: T[],\n search: string,\n currentItem?: T\n) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0]! : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find((item) =>\n item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : undefined;\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map<T>((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = Select;\nconst Trigger = SelectTrigger;\nconst Value = SelectValue;\nconst Icon = SelectIcon;\nconst Portal = SelectPortal;\nconst Content = SelectContent;\nconst Viewport = SelectViewport;\nconst Group = SelectGroup;\nconst Label = SelectLabel;\nconst Item = SelectItem;\nconst ItemText = SelectItemText;\nconst ItemIndicator = SelectItemIndicator;\nconst ScrollUpButton = SelectScrollUpButton;\nconst ScrollDownButton = SelectScrollDownButton;\nconst Separator = SelectSeparator;\nconst Arrow = SelectArrow;\n\nexport {\n createSelectScope,\n //\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPortal,\n SelectContent,\n SelectViewport,\n SelectGroup,\n SelectLabel,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n SelectSeparator,\n SelectArrow,\n //\n Root,\n Trigger,\n Value,\n Icon,\n Portal,\n Content,\n Viewport,\n Group,\n Label,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpButton,\n ScrollDownButton,\n Separator,\n Arrow,\n};\nexport type {\n SelectProps,\n SelectTriggerProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectViewportProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectSeparatorProps,\n SelectArrowProps,\n};\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0', key: 'vwvbt9' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n key: '11g9vi',\n },\n ],\n];\n\n/**\n * @component @name Bell\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/bell\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Bell = createLucideIcon('bell', __iconNode);\n\nexport default Bell;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 8V4H8', key: 'hb8ula' }],\n ['rect', { width: '16', height: '12', x: '4', y: '8', rx: '2', key: 'enze0r' }],\n ['path', { d: 'M2 14h2', key: 'vft8re' }],\n ['path', { d: 'M20 14h2', key: '4cs60a' }],\n ['path', { d: 'M15 13v2', key: '1xurst' }],\n ['path', { d: 'M9 13v2', key: 'rq6x2g' }],\n];\n\n/**\n * @component @name Bot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/bot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Bot = createLucideIcon('bot', __iconNode);\n\nexport default Bot;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M14 17H5', key: 'gfn3mx' }],\n ['path', { d: 'M19 7h-9', key: '6i9tg' }],\n ['circle', { cx: '17', cy: '17', r: '3', key: '18b49y' }],\n ['circle', { cx: '7', cy: '7', r: '3', key: 'dfmy0x' }],\n];\n\n/**\n * @component @name Settings2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/settings-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Settings2 = createLucideIcon('settings-2', __iconNode);\n\nexport default Settings2;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['ellipse', { cx: '12', cy: '5', rx: '9', ry: '3', key: 'msslwz' }],\n ['path', { d: 'M3 5V19A9 3 0 0 0 21 19V5', key: '1wlel7' }],\n ['path', { d: 'M3 12A9 3 0 0 0 21 12', key: 'mv7ke4' }],\n];\n\n/**\n * @component @name Database\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/database\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Database = createLucideIcon('database', __iconNode);\n\nexport default Database;\n","import * as React from 'react';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createCollection } from '@radix-ui/react-collection';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst PAGE_KEYS = ['PageUp', 'PageDown'];\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\ntype SlideDirection = 'from-left' | 'from-right' | 'from-bottom' | 'from-top';\nconst BACK_KEYS: Record<SlideDirection, string[]> = {\n 'from-left': ['Home', 'PageDown', 'ArrowDown', 'ArrowLeft'],\n 'from-right': ['Home', 'PageDown', 'ArrowDown', 'ArrowRight'],\n 'from-bottom': ['Home', 'PageDown', 'ArrowDown', 'ArrowLeft'],\n 'from-top': ['Home', 'PageDown', 'ArrowUp', 'ArrowLeft'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Slider\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLIDER_NAME = 'Slider';\n\nconst [Collection, useCollection, createCollectionScope] =\n createCollection<SliderThumbElement>(SLIDER_NAME);\n\ntype ScopedProps<P> = P & { __scopeSlider?: Scope };\nconst [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [\n createCollectionScope,\n]);\n\ntype SliderContextValue = {\n name: string | undefined;\n disabled: boolean | undefined;\n min: number;\n max: number;\n values: number[];\n valueIndexToChangeRef: React.MutableRefObject<number>;\n thumbs: Set<SliderThumbElement>;\n orientation: SliderProps['orientation'];\n form: string | undefined;\n};\n\nconst [SliderProvider, useSliderContext] = createSliderContext<SliderContextValue>(SLIDER_NAME);\n\ntype SliderElement = SliderHorizontalElement | SliderVerticalElement;\ninterface SliderProps\n extends Omit<\n SliderHorizontalProps | SliderVerticalProps,\n keyof SliderOrientationPrivateProps | 'defaultValue'\n > {\n name?: string;\n disabled?: boolean;\n orientation?: React.AriaAttributes['aria-orientation'];\n dir?: Direction;\n min?: number;\n max?: number;\n step?: number;\n minStepsBetweenThumbs?: number;\n value?: number[];\n defaultValue?: number[];\n onValueChange?(value: number[]): void;\n onValueCommit?(value: number[]): void;\n inverted?: boolean;\n form?: string;\n}\n\nconst Slider = React.forwardRef<SliderElement, SliderProps>(\n (props: ScopedProps<SliderProps>, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = 'horizontal',\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {},\n onValueCommit = () => {},\n inverted = false,\n form,\n ...sliderProps\n } = props;\n const thumbRefs = React.useRef<SliderContextValue['thumbs']>(new Set());\n const valueIndexToChangeRef = React.useRef<number>(0);\n const isHorizontal = orientation === 'horizontal';\n const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;\n\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n onChange: (value) => {\n const thumbs = [...thumbRefs.current];\n thumbs[valueIndexToChangeRef.current]?.focus();\n onValueChange(value);\n },\n });\n const valuesBeforeSlideStartRef = React.useRef(values);\n\n function handleSlideStart(value: number) {\n const closestIndex = getClosestValueIndex(values, value);\n updateValues(value, closestIndex);\n }\n\n function handleSlideMove(value: number) {\n updateValues(value, valueIndexToChangeRef.current);\n }\n\n function handleSlideEnd() {\n const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];\n const nextValue = values[valueIndexToChangeRef.current];\n const hasChanged = nextValue !== prevValue;\n if (hasChanged) onValueCommit(values);\n }\n\n function updateValues(value: number, atIndex: number, { commit } = { commit: false }) {\n const decimalCount = getDecimalCount(step);\n const snapToStep = roundValue(Math.round((value - min) / step) * step + min, decimalCount);\n const nextValue = clamp(snapToStep, [min, max]);\n\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue);\n const hasChanged = String(nextValues) !== String(prevValues);\n if (hasChanged && commit) onValueCommit(nextValues);\n return hasChanged ? nextValues : prevValues;\n } else {\n return prevValues;\n }\n });\n }\n\n return (\n <SliderProvider\n scope={props.__scopeSlider}\n name={name}\n disabled={disabled}\n min={min}\n max={max}\n valueIndexToChangeRef={valueIndexToChangeRef}\n thumbs={thumbRefs.current}\n values={values}\n orientation={orientation}\n form={form}\n >\n <Collection.Provider scope={props.__scopeSlider}>\n <Collection.Slot scope={props.__scopeSlider}>\n <SliderOrientation\n aria-disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...sliderProps}\n ref={forwardedRef}\n onPointerDown={composeEventHandlers(sliderProps.onPointerDown, () => {\n if (!disabled) valuesBeforeSlideStartRef.current = values;\n })}\n min={min}\n max={max}\n inverted={inverted}\n onSlideStart={disabled ? undefined : handleSlideStart}\n onSlideMove={disabled ? undefined : handleSlideMove}\n onSlideEnd={disabled ? undefined : handleSlideEnd}\n onHomeKeyDown={() => !disabled && updateValues(min, 0, { commit: true })}\n onEndKeyDown={() =>\n !disabled && updateValues(max, values.length - 1, { commit: true })\n }\n onStepKeyDown={({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key);\n const isSkipKey = isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key));\n const multiplier = isSkipKey ? 10 : 1;\n const atIndex = valueIndexToChangeRef.current;\n const value = values[atIndex]!;\n const stepInDirection = step * multiplier * stepDirection;\n updateValues(value + stepInDirection, atIndex, { commit: true });\n }\n }}\n />\n </Collection.Slot>\n </Collection.Provider>\n </SliderProvider>\n );\n }\n);\n\nSlider.displayName = SLIDER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderHorizontal\n * -----------------------------------------------------------------------------------------------*/\n\ntype Side = 'top' | 'right' | 'bottom' | 'left';\n\nconst [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext<{\n startEdge: Side;\n endEdge: Side;\n size: keyof NonNullable<ReturnType<typeof useSize>>;\n direction: number;\n}>(SLIDER_NAME, {\n startEdge: 'left',\n endEdge: 'right',\n size: 'width',\n direction: 1,\n});\n\ntype SliderOrientationPrivateProps = {\n min: number;\n max: number;\n inverted: boolean;\n onSlideStart?(value: number): void;\n onSlideMove?(value: number): void;\n onSlideEnd?(): void;\n onHomeKeyDown(event: React.KeyboardEvent): void;\n onEndKeyDown(event: React.KeyboardEvent): void;\n onStepKeyDown(step: { event: React.KeyboardEvent; direction: number }): void;\n};\ninterface SliderOrientationProps\n extends Omit<SliderImplProps, keyof SliderImplPrivateProps>,\n SliderOrientationPrivateProps {}\n\ntype SliderHorizontalElement = SliderImplElement;\ninterface SliderHorizontalProps extends SliderOrientationProps {\n dir?: Direction;\n}\n\nconst SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizontalProps>(\n (props: ScopedProps<SliderHorizontalProps>, forwardedRef) => {\n const {\n min,\n max,\n dir,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const [slider, setSlider] = React.useState<SliderImplElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setSlider(node));\n const rectRef = React.useRef<DOMRect>(undefined);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === 'ltr';\n const isSlidingFromLeft = (isDirectionLTR && !inverted) || (!isDirectionLTR && inverted);\n\n function getValueFromPointer(pointerPosition: number) {\n const rect = rectRef.current || slider!.getBoundingClientRect();\n const input: [number, number] = [0, rect.width];\n const output: [number, number] = isSlidingFromLeft ? [min, max] : [max, min];\n const value = linearScale(input, output);\n\n rectRef.current = rect;\n return value(pointerPosition - rect.left);\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isSlidingFromLeft ? 'left' : 'right'}\n endEdge={isSlidingFromLeft ? 'right' : 'left'}\n direction={isSlidingFromLeft ? 1 : -1}\n size=\"width\"\n >\n <SliderImpl\n dir={direction}\n data-orientation=\"horizontal\"\n {...sliderProps}\n ref={composedRefs}\n style={{\n ...sliderProps.style,\n ['--radix-slider-thumb-transform' as any]: 'translateX(-50%)',\n }}\n onSlideStart={(event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideStart?.(value);\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideMove?.(value);\n }}\n onSlideEnd={() => {\n rectRef.current = undefined;\n onSlideEnd?.();\n }}\n onStepKeyDown={(event) => {\n const slideDirection = isSlidingFromLeft ? 'from-left' : 'from-right';\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }}\n />\n </SliderOrientationProvider>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderVertical\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderVerticalElement = SliderImplElement;\ninterface SliderVerticalProps extends SliderOrientationProps {}\n\nconst SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalProps>(\n (props: ScopedProps<SliderVerticalProps>, forwardedRef) => {\n const {\n min,\n max,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const sliderRef = React.useRef<SliderImplElement>(null);\n const ref = useComposedRefs(forwardedRef, sliderRef);\n const rectRef = React.useRef<DOMRect>(undefined);\n const isSlidingFromBottom = !inverted;\n\n function getValueFromPointer(pointerPosition: number) {\n const rect = rectRef.current || sliderRef.current!.getBoundingClientRect();\n const input: [number, number] = [0, rect.height];\n const output: [number, number] = isSlidingFromBottom ? [max, min] : [min, max];\n const value = linearScale(input, output);\n\n rectRef.current = rect;\n return value(pointerPosition - rect.top);\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isSlidingFromBottom ? 'bottom' : 'top'}\n endEdge={isSlidingFromBottom ? 'top' : 'bottom'}\n size=\"height\"\n direction={isSlidingFromBottom ? 1 : -1}\n >\n <SliderImpl\n data-orientation=\"vertical\"\n {...sliderProps}\n ref={ref}\n style={{\n ...sliderProps.style,\n ['--radix-slider-thumb-transform' as any]: 'translateY(50%)',\n }}\n onSlideStart={(event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideStart?.(value);\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideMove?.(value);\n }}\n onSlideEnd={() => {\n rectRef.current = undefined;\n onSlideEnd?.();\n }}\n onStepKeyDown={(event) => {\n const slideDirection = isSlidingFromBottom ? 'from-bottom' : 'from-top';\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }}\n />\n </SliderOrientationProvider>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderImpl\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderImplElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ntype SliderImplPrivateProps = {\n onSlideStart(event: React.PointerEvent): void;\n onSlideMove(event: React.PointerEvent): void;\n onSlideEnd(event: React.PointerEvent): void;\n onHomeKeyDown(event: React.KeyboardEvent): void;\n onEndKeyDown(event: React.KeyboardEvent): void;\n onStepKeyDown(event: React.KeyboardEvent): void;\n};\ninterface SliderImplProps extends PrimitiveDivProps, SliderImplPrivateProps {}\n\nconst SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(\n (props: ScopedProps<SliderImplProps>, forwardedRef) => {\n const {\n __scopeSlider,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onHomeKeyDown,\n onEndKeyDown,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const context = useSliderContext(SLIDER_NAME, __scopeSlider);\n\n return (\n <Primitive.span\n {...sliderProps}\n ref={forwardedRef}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Home') {\n onHomeKeyDown(event);\n // Prevent scrolling to page start\n event.preventDefault();\n } else if (event.key === 'End') {\n onEndKeyDown(event);\n // Prevent scrolling to page end\n event.preventDefault();\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event);\n // Prevent scrolling for directional key presses\n event.preventDefault();\n }\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n const target = event.target as HTMLElement;\n target.setPointerCapture(event.pointerId);\n // Prevent browser focus behaviour because we focus a thumb manually when values change.\n event.preventDefault();\n // Touch devices have a delay before focusing so won't focus if touch immediately moves\n // away from target (sliding). We want thumb to focus regardless.\n if (context.thumbs.has(target)) {\n target.focus();\n } else {\n onSlideStart(event);\n }\n })}\n onPointerMove={composeEventHandlers(props.onPointerMove, (event) => {\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);\n })}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n onSlideEnd(event);\n }\n })}\n />\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrack\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRACK_NAME = 'SliderTrack';\n\ntype SliderTrackElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SliderTrackProps extends PrimitiveSpanProps {}\n\nconst SliderTrack = React.forwardRef<SliderTrackElement, SliderTrackProps>(\n (props: ScopedProps<SliderTrackProps>, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props;\n const context = useSliderContext(TRACK_NAME, __scopeSlider);\n return (\n <Primitive.span\n data-disabled={context.disabled ? '' : undefined}\n data-orientation={context.orientation}\n {...trackProps}\n ref={forwardedRef}\n />\n );\n }\n);\n\nSliderTrack.displayName = TRACK_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderRange\n * -----------------------------------------------------------------------------------------------*/\n\nconst RANGE_NAME = 'SliderRange';\n\ntype SliderRangeElement = React.ComponentRef<typeof Primitive.span>;\ninterface SliderRangeProps extends PrimitiveSpanProps {}\n\nconst SliderRange = React.forwardRef<SliderRangeElement, SliderRangeProps>(\n (props: ScopedProps<SliderRangeProps>, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props;\n const context = useSliderContext(RANGE_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);\n const ref = React.useRef<HTMLSpanElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const valuesCount = context.values.length;\n const percentages = context.values.map((value) =>\n convertValueToPercentage(value, context.min, context.max)\n );\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;\n const offsetEnd = 100 - Math.max(...percentages);\n\n return (\n <Primitive.span\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n {...rangeProps}\n ref={composedRefs}\n style={{\n ...props.style,\n [orientation.startEdge]: offsetStart + '%',\n [orientation.endEdge]: offsetEnd + '%',\n }}\n />\n );\n }\n);\n\nSliderRange.displayName = RANGE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SliderThumb';\n\ntype SliderThumbElement = SliderThumbImplElement;\ninterface SliderThumbProps extends Omit<SliderThumbImplProps, 'index'> {}\n\nconst SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(\n (props: ScopedProps<SliderThumbProps>, forwardedRef) => {\n const getItems = useCollection(props.__scopeSlider);\n const [thumb, setThumb] = React.useState<SliderThumbImplElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const index = React.useMemo(\n () => (thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1),\n [getItems, thumb]\n );\n return <SliderThumbImpl {...props} ref={composedRefs} index={index} />;\n }\n);\n\ntype SliderThumbImplElement = React.ComponentRef<typeof Primitive.span>;\ninterface SliderThumbImplProps extends PrimitiveSpanProps {\n index: number;\n name?: string;\n}\n\nconst SliderThumbImpl = React.forwardRef<SliderThumbImplElement, SliderThumbImplProps>(\n (props: ScopedProps<SliderThumbImplProps>, forwardedRef) => {\n const { __scopeSlider, index, name, ...thumbProps } = props;\n const context = useSliderContext(THUMB_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);\n const [thumb, setThumb] = React.useState<HTMLSpanElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = thumb ? context.form || !!thumb.closest('form') : true;\n const size = useSize(thumb);\n // We cast because index could be `-1` which would return undefined\n const value = context.values[index] as number | undefined;\n const percent =\n value === undefined ? 0 : convertValueToPercentage(value, context.min, context.max);\n const label = getLabel(index, context.values.length);\n const orientationSize = size?.[orientation.size];\n const thumbInBoundsOffset = orientationSize\n ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction)\n : 0;\n\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb);\n return () => {\n context.thumbs.delete(thumb);\n };\n }\n }, [thumb, context.thumbs]);\n\n return (\n <span\n style={{\n transform: 'var(--radix-slider-thumb-transform)',\n position: 'absolute',\n [orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`,\n }}\n >\n <Collection.ItemSlot scope={props.__scopeSlider}>\n <Primitive.span\n role=\"slider\"\n aria-label={props['aria-label'] || label}\n aria-valuemin={context.min}\n aria-valuenow={value}\n aria-valuemax={context.max}\n aria-orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n tabIndex={context.disabled ? undefined : 0}\n {...thumbProps}\n ref={composedRefs}\n /**\n * There will be no value on initial render while we work out the index so we hide thumbs\n * without a value, otherwise SSR will render them in the wrong position before they\n * snap into the correct position during hydration which would be visually jarring for\n * slower connections.\n */\n style={value === undefined ? { display: 'none' } : props.style}\n onFocus={composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index;\n })}\n />\n </Collection.ItemSlot>\n\n {isFormControl && (\n <SliderBubbleInput\n key={index}\n name={\n name ??\n (context.name ? context.name + (context.values.length > 1 ? '[]' : '') : undefined)\n }\n form={context.form}\n value={value}\n />\n )}\n </span>\n );\n }\n);\n\nSliderThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'RadioBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface SliderBubbleInputProps extends InputProps {}\n\nconst SliderBubbleInput = React.forwardRef<HTMLInputElement, SliderBubbleInputProps>(\n ({ __scopeSlider, value, ...props }: ScopedProps<SliderBubbleInputProps>, forwardedRef) => {\n const ref = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevValue = usePrevious(value);\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'value') as PropertyDescriptor;\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event('input', { bubbles: true });\n setValue.call(input, value);\n input.dispatchEvent(event);\n }\n }, [prevValue, value]);\n\n /**\n * We purposefully do not use `type=\"hidden\"` here otherwise forms that\n * wrap it will not be able to access its value via the FormData API.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programmatically and bubble to any parent form `onChange` event.\n * Adding the `value` will cause React to consider the programmatic\n * dispatch a duplicate and it will get swallowed.\n */\n return (\n <Primitive.input\n style={{ display: 'none' }}\n {...props}\n ref={composedRefs}\n defaultValue={value}\n />\n );\n }\n);\n\nSliderBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getNextSortedValues(prevValues: number[] = [], nextValue: number, atIndex: number) {\n const nextValues = [...prevValues];\n nextValues[atIndex] = nextValue;\n return nextValues.sort((a, b) => a - b);\n}\n\nfunction convertValueToPercentage(value: number, min: number, max: number) {\n const maxSteps = max - min;\n const percentPerStep = 100 / maxSteps;\n const percentage = percentPerStep * (value - min);\n return clamp(percentage, [0, 100]);\n}\n\n/**\n * Returns a label for each thumb when there are two or more thumbs\n */\nfunction getLabel(index: number, totalValues: number) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`;\n } else if (totalValues === 2) {\n return ['Minimum', 'Maximum'][index];\n } else {\n return undefined;\n }\n}\n\n/**\n * Given a `values` array and a `nextValue`, determine which value in\n * the array is closest to `nextValue` and return its index.\n *\n * @example\n * // returns 1\n * getClosestValueIndex([10, 30], 25);\n */\nfunction getClosestValueIndex(values: number[], nextValue: number) {\n if (values.length === 1) return 0;\n const distances = values.map((value) => Math.abs(value - nextValue));\n const closestDistance = Math.min(...distances);\n return distances.indexOf(closestDistance);\n}\n\n/**\n * Offsets the thumb centre point while sliding to ensure it remains\n * within the bounds of the slider when reaching the edges\n */\nfunction getThumbInBoundsOffset(width: number, left: number, direction: number) {\n const halfWidth = width / 2;\n const halfPercent = 50;\n const offset = linearScale([0, halfPercent], [0, halfWidth]);\n return (halfWidth - offset(left) * direction) * direction;\n}\n\n/**\n * Gets an array of steps between each value.\n *\n * @example\n * // returns [1, 9]\n * getStepsBetweenValues([10, 11, 20]);\n */\nfunction getStepsBetweenValues(values: number[]) {\n return values.slice(0, -1).map((value, index) => values[index + 1]! - value);\n}\n\n/**\n * Verifies the minimum steps between all values is greater than or equal\n * to the expected minimum steps.\n *\n * @example\n * // returns false\n * hasMinStepsBetweenValues([1,2,3], 2);\n *\n * @example\n * // returns true\n * hasMinStepsBetweenValues([1,2,3], 1);\n */\nfunction hasMinStepsBetweenValues(values: number[], minStepsBetweenValues: number) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values);\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);\n return actualMinStepsBetweenValues >= minStepsBetweenValues;\n }\n return true;\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n\nfunction getDecimalCount(value: number) {\n return (String(value).split('.')[1] || '').length;\n}\n\nfunction roundValue(value: number, decimalCount: number) {\n const rounder = Math.pow(10, decimalCount);\n return Math.round(value * rounder) / rounder;\n}\n\nconst Root = Slider;\nconst Track = SliderTrack;\nconst Range = SliderRange;\nconst Thumb = SliderThumb;\n\nexport {\n createSliderScope,\n //\n Slider,\n SliderTrack,\n SliderRange,\n SliderThumb,\n //\n Root,\n Track,\n Range,\n Thumb,\n};\nexport type { SliderProps, SliderTrackProps, SliderRangeProps, SliderThumbProps };\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528',\n key: '1jaruq',\n },\n ],\n];\n\n/**\n * @component @name Flag\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/flag\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Flag = createLucideIcon('flag', __iconNode);\n\nexport default Flag;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2',\n key: '169zse',\n },\n ],\n];\n\n/**\n * @component @name Activity\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/activity\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Activity = createLucideIcon('activity', __iconNode);\n\nexport default Activity;\n"],"names":[],"mappings":"wDIEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,wBOoBM,EAAA,CAAA,AFTG,AESH,CAAA,CAAA,EAAA,OAAA,AAAM,EAAiB,CAAA,6BAnBA,IAAK,0BACd,CCAJ,ADAI,AEAJ,CDAA,ADAI,AEAJ,CDAA,ADAI,AEAJ,CCGQ,AFHR,ACAA,CDAA,ACAA,kBFAgC,CEAH,CFAM,CAAA,AEAD,CAAA,AFAC,CAAA,AEAD,CFAC,AEAD,OFAe,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,6CAErE,CIAF,ACAA,AJAN,ADAQ,EAAK,CAAA,ACAD,AIAN,ADAA,CHAM,AIAN,ADAA,AJAO,qEAEL,CDAA,ACAA,AFGC,AEHC,CDAF,CAAA,AEYL,cDZ0B,CCYd,AHTe,AEHD,YPNhC,IAAA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,gBYqBiB,CAAA,ADAJ,CCAI,OAAA,EAAA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AAE,EACjD,GAAS,GACT,EAAK,CAAE,aAAc,CAAS,EAChC,OAGJ,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,UAAY,uMAQf,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CACC,GAAG,mBACH,UAAU,sFAEV,CAAA,EAAA,EAAA,IAAA,EAAC,GAAA,CACC,KAAM,EACN,MAAM,WACN,YAAY,4BACZ,OAAO,sCAEP,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,CAAY,MAAM,WAAW,YAAY,6CACxC,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CACC,UAAU,4DACV,cAAY,0BAEX,MAGL,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,CAAY,MAAM,gBACjB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,gCAAgC,cAAY,wBACzD,SAIP,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,CACC,MAAO,CACL,CACE,MAAO,mBACP,KAAM,gFACR,EACA,CACE,MAAO,gBACP,KAAM,oFACR,EACD,UACF,mKAQX","ignoreList":[1,5,8,9,10,11,12,13,14,15,16]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/presentation/web/components/features/settings/timeout-slider.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-select%402.2.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_1f7b4ff668a805c08339bb4e58c413b0/node_modules/%40radix-ui/react-select/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/select.tsx","../../../../../../../src/presentation/web/app/actions/data%3A3b4cf3%20%3Ctext/javascript%3E","../../../../../../../src/presentation/web/components/features/settings/settings-page-client.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slider%401.3.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_ca43abb80e5f786fefe972afd09a8b45/node_modules/%40radix-ui/react-slider/dist/index.mjs","../../../../../../../src/presentation/web/components/ui/slider.tsx","../../../../../../../src/presentation/web/components/common/editor-type-icons.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/chevron-up.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-select%402.2.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_1f7b4ff668a805c08339bb4e58c413b0/node_modules/%40radix-ui/react-select/src/select.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/bell.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/bot.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/settings-2.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/database.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slider%401.3.6_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Breact_ca43abb80e5f786fefe972afd09a8b45/node_modules/%40radix-ui/react-slider/src/slider.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/flag.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/activity.ts"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { Slider } from '@/components/ui/slider';\n\n/** Fixed duration presets in seconds — slider snaps to these values */\nconst PRESETS = [\n 60, // 1m\n 120, // 2m\n 300, // 5m\n 600, // 10m\n 900, // 15m\n 1800, // 30m\n 2700, // 45m\n 3600, // 1h\n 7200, // 2h\n 10800, // 3h\n 14400, // 4h\n 21600, // 6h\n 28800, // 8h\n 43200, // 12h\n 86400, // 24h\n];\n\nconst SLIDER_MAX = PRESETS.length - 1;\n\n/** Find the closest preset index for a given seconds value */\nfunction secondsToIndex(seconds: number): number {\n let closest = 0;\n let minDiff = Math.abs(seconds - PRESETS[0]);\n for (let i = 1; i < PRESETS.length; i++) {\n const diff = Math.abs(seconds - PRESETS[i]);\n if (diff < minDiff) {\n minDiff = diff;\n closest = i;\n }\n }\n return closest;\n}\n\nexport interface TimeoutSliderProps {\n id: string;\n testId: string;\n /** Current value in seconds (as a string for form compatibility) */\n value: string;\n onChange: (value: string) => void;\n onBlur: () => void;\n defaultSeconds?: number;\n}\n\nfunction formatDuration(totalSeconds: number): string {\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.round((totalSeconds % 3600) / 60);\n\n if (hours === 0) return `${minutes}m`;\n if (minutes === 0) return `${hours}h`;\n return `${hours}h ${minutes}m`;\n}\n\nexport function TimeoutSlider({\n id,\n testId,\n value,\n onChange,\n onBlur,\n defaultSeconds = 1800,\n}: TimeoutSliderProps) {\n const numValue = value === '' ? defaultSeconds : parseInt(value, 10);\n const seconds = numValue || defaultSeconds;\n\n // Local index state prevents snap-back during drag — updates immediately\n // without waiting for the parent to re-render with the new value.\n const [localIndex, setLocalIndex] = useState(() => secondsToIndex(seconds));\n\n // Sync from props only when the resolved index actually differs\n // (e.g. external reset or server push). Avoids overwriting during drag.\n const propsIndex = secondsToIndex(seconds);\n if (propsIndex !== localIndex && PRESETS[localIndex] !== seconds) {\n setLocalIndex(propsIndex);\n }\n\n const handleChange = useCallback(\n ([i]: number[]) => {\n setLocalIndex(i);\n onChange(String(PRESETS[i]));\n },\n [onChange]\n );\n\n return (\n <div className=\"flex w-55 items-center gap-2\">\n <Slider\n id={id}\n data-testid={testId}\n min={0}\n max={SLIDER_MAX}\n step={1}\n value={[localIndex]}\n onValueChange={handleChange}\n onValueCommit={() => onBlur()}\n className=\"min-w-0 flex-1\"\n />\n <span className=\"text-muted-foreground shrink-0 text-right text-xs tabular-nums\">\n {formatDuration(PRESETS[localIndex])}\n </span>\n </div>\n );\n}\n","\"use client\";\n\n// src/select.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { VISUALLY_HIDDEN_STYLES } from \"@radix-ui/react-visually-hidden\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar OPEN_KEYS = [\" \", \"Enter\", \"ArrowUp\", \"ArrowDown\"];\nvar SELECTION_KEYS = [\" \", \"Enter\"];\nvar SELECT_NAME = \"Select\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);\nvar [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);\nvar [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);\nvar Select = (props) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState(null);\n const [valueNode, setValueNode] = React.useState(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SELECT_NAME\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n caller: SELECT_NAME\n });\n const triggerPointerDownPosRef = React.useRef(null);\n const isFormControl = trigger ? form || !!trigger.closest(\"form\") : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());\n const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(\";\");\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsxs(\n SelectProvider,\n {\n required,\n scope: __scopeSelect,\n trigger,\n onTriggerChange: setTrigger,\n valueNode,\n onValueNodeChange: setValueNode,\n valueNodeHasChildren,\n onValueNodeHasChildrenChange: setValueNodeHasChildren,\n contentId: useId(),\n value,\n onValueChange: setValue,\n open,\n onOpenChange: setOpen,\n dir: direction,\n triggerPointerDownPosRef,\n disabled,\n children: [\n /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n SelectNativeOptionsProvider,\n {\n scope: props.__scopeSelect,\n onNativeOptionAdd: React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, []),\n onNativeOptionRemove: React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, []),\n children\n }\n ) }),\n isFormControl ? /* @__PURE__ */ jsxs(\n SelectBubbleInput,\n {\n \"aria-hidden\": true,\n required,\n tabIndex: -1,\n name,\n autoComplete,\n value,\n onChange: (event) => setValue(event.target.value),\n disabled,\n form,\n children: [\n value === void 0 ? /* @__PURE__ */ jsx(\"option\", { value: \"\" }) : null,\n Array.from(nativeOptionsSet)\n ]\n },\n nativeSelectKey\n ) : null\n ]\n }\n ) });\n};\nSelect.displayName = SELECT_NAME;\nvar TRIGGER_NAME = \"SelectTrigger\";\nvar SelectTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef(\"touch\");\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== void 0) {\n context.onValueChange(nextItem.value);\n }\n });\n const handleOpen = (pointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n resetTypeahead();\n }\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY)\n };\n }\n };\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"combobox\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open,\n \"aria-required\": context.required,\n \"aria-autocomplete\": \"none\",\n dir: context.dir,\n \"data-state\": context.open ? \"open\" : \"closed\",\n disabled: isDisabled,\n \"data-disabled\": isDisabled ? \"\" : void 0,\n \"data-placeholder\": shouldShowPlaceholder(context.value) ? \"\" : void 0,\n ...triggerProps,\n ref: composedRefs,\n onClick: composeEventHandlers(triggerProps.onClick, (event) => {\n event.currentTarget.focus();\n if (pointerTypeRef.current !== \"mouse\") {\n handleOpen(event);\n }\n }),\n onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === \"mouse\") {\n handleOpen(event);\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== \"\";\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === \" \") return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nSelectTrigger.displayName = TRIGGER_NAME;\nvar VALUE_NAME = \"SelectValue\";\nvar SelectValue = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, children, placeholder = \"\", ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== void 0;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...valueProps,\n ref: composedRefs,\n style: { pointerEvents: \"none\" },\n children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx(Fragment, { children: placeholder }) : children\n }\n );\n }\n);\nSelectValue.displayName = VALUE_NAME;\nvar ICON_NAME = \"SelectIcon\";\nvar SelectIcon = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...iconProps, ref: forwardedRef, children: children || \"\\u25BC\" });\n }\n);\nSelectIcon.displayName = ICON_NAME;\nvar PORTAL_NAME = \"SelectPortal\";\nvar SelectPortal = (props) => {\n return /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, ...props });\n};\nSelectPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"SelectContent\";\nvar SelectContent = React.forwardRef(\n (props, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState();\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n if (!context.open) {\n const frag = fragment;\n return frag ? ReactDOM.createPortal(\n /* @__PURE__ */ jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(\"div\", { children: props.children }) }) }),\n frag\n ) : null;\n }\n return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });\n }\n);\nSelectContent.displayName = CONTENT_NAME;\nvar CONTENT_MARGIN = 10;\nvar [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME);\nvar CONTENT_IMPL_NAME = \"SelectContentImpl\";\nvar Slot = createSlot(\"SelectContent.RemoveScroll\");\nvar SelectContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n position = \"item-aligned\",\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedItemText, setSelectedItemText] = React.useState(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n useFocusGuards();\n const focusFirst = React.useCallback(\n (candidates) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: \"nearest\" });\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n const handlePointerMove = (event) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))\n };\n };\n const handlePointerUp = (event) => {\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n if (!content.contains(event.target)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener(\"pointermove\", handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener(\"pointermove\", handlePointerMove);\n document.addEventListener(\"pointerup\", handlePointerUp, { capture: true, once: true });\n }\n return () => {\n document.removeEventListener(\"pointermove\", handlePointerMove);\n document.removeEventListener(\"pointerup\", handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [onOpenChange]);\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n setTimeout(() => nextItem.ref.current.focus());\n }\n });\n const itemRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n const SelectPosition = position === \"popper\" ? SelectPopperPosition : SelectItemAlignedPosition;\n const popperContentProps = SelectPosition === SelectPopperPosition ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions\n } : {};\n return /* @__PURE__ */ jsx(\n SelectContentProvider,\n {\n scope: __scopeSelect,\n content,\n viewport,\n onViewportChange: setViewport,\n itemRefCallback,\n selectedItem,\n onItemLeave: handleItemLeave,\n itemTextRefCallback,\n focusSelectedItem,\n selectedItemText,\n position,\n isPositioned,\n searchRef,\n children: /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: context.open,\n onMountAutoFocus: (event) => {\n event.preventDefault();\n },\n onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n }),\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: true,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n SelectPosition,\n {\n role: \"listbox\",\n id: context.contentId,\n \"data-state\": context.open ? \"open\" : \"closed\",\n dir: context.dir,\n onContextMenu: (event) => event.preventDefault(),\n ...contentProps,\n ...popperContentProps,\n onPlaced: () => setIsPositioned(true),\n ref: composedRefs,\n style: {\n // flex layout so we can place the scroll buttons properly\n display: \"flex\",\n flexDirection: \"column\",\n // reset the outline by default as the content MAY get focused\n outline: \"none\",\n ...contentProps.style\n },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current);\n if ([\"ArrowUp\", \"End\"].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if ([\"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n const currentElement = event.target;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n event.preventDefault();\n }\n })\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\nvar ITEM_ALIGNED_POSITION_NAME = \"SelectItemAlignedPosition\";\nvar SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {\n const triggerRect = context.trigger.getBoundingClientRect();\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n if (context.dir !== \"rtl\") {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.left = clampedLeft + \"px\";\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.right = clampedRight + \"px\";\n }\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n if (willAlignWithoutTopOverflow) {\n const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;\n contentWrapper.style.bottom = \"0px\";\n const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + \"px\";\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;\n contentWrapper.style.top = \"0px\";\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + \"px\";\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + \"px\";\n contentWrapper.style.maxHeight = availableHeight + \"px\";\n onPlaced?.();\n requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced\n ]);\n useLayoutEffect(() => position(), [position]);\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n const handleScrollButtonChange = React.useCallback(\n (node) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n return /* @__PURE__ */ jsx(\n SelectViewportProvider,\n {\n scope: __scopeSelect,\n contentWrapper,\n shouldExpandOnScrollRef,\n onScrollButtonChange: handleScrollButtonChange,\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: setContentWrapper,\n style: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"fixed\",\n zIndex: contentZIndex\n },\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...popperProps,\n ref: composedRefs,\n style: {\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: \"border-box\",\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: \"100%\",\n ...popperProps.style\n }\n }\n )\n }\n )\n }\n );\n});\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\nvar POPPER_POSITION_NAME = \"SelectPopperPosition\";\nvar SelectPopperPosition = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeSelect,\n align = \"start\",\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n ...popperScope,\n ...popperProps,\n ref: forwardedRef,\n align,\n collisionPadding,\n style: {\n // Ensure border-box for floating-ui calculations\n boxSizing: \"border-box\",\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-select-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-select-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-select-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-select-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-select-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\nvar [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {});\nvar VIEWPORT_NAME = \"SelectViewport\";\nvar SelectViewport = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`\n },\n nonce\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-select-viewport\": \"\",\n role: \"presentation\",\n ...viewportProps,\n ref: composedRefs,\n style: {\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: \"relative\",\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: \"hidden auto\",\n ...viewportProps.style\n },\n onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n contentWrapper.style.height = clampedNextHeight + \"px\";\n if (contentWrapper.style.bottom === \"0px\") {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n contentWrapper.style.justifyContent = \"flex-end\";\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })\n }\n ) })\n ] });\n }\n);\nSelectViewport.displayName = VIEWPORT_NAME;\nvar GROUP_NAME = \"SelectGroup\";\nvar [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);\nvar SelectGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", \"aria-labelledby\": groupId, ...groupProps, ref: forwardedRef }) });\n }\n);\nSelectGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"SelectLabel\";\nvar SelectLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });\n }\n);\nSelectLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"SelectItem\";\nvar [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);\nvar SelectItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? \"\");\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef(\"touch\");\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n if (value === \"\") {\n throw new Error(\n \"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.\"\n );\n }\n return /* @__PURE__ */ jsx(\n SelectItemContextProvider,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textId,\n isSelected,\n onItemTextChange: React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? \"\").trim());\n }, []),\n children: /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textValue,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"option\",\n \"aria-labelledby\": textId,\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-selected\": isSelected && isFocused,\n \"data-state\": isSelected ? \"checked\" : \"unchecked\",\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : -1,\n ...itemProps,\n ref: composedRefs,\n onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),\n onClick: composeEventHandlers(itemProps.onClick, () => {\n if (pointerTypeRef.current !== \"mouse\") handleSelect();\n }),\n onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {\n if (pointerTypeRef.current === \"mouse\") handleSelect();\n }),\n onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n }),\n onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === \"mouse\") {\n event.currentTarget.focus({ preventScroll: true });\n }\n }),\n onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n }),\n onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== \"\";\n if (isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n if (event.key === \" \") event.preventDefault();\n })\n }\n )\n }\n )\n }\n );\n }\n);\nSelectItem.displayName = ITEM_NAME;\nvar ITEM_TEXT_NAME = \"SelectItemText\";\nvar SelectItemText = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => /* @__PURE__ */ jsx(\"option\", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),\n [itemContext.disabled, itemContext.value, textContent]\n );\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),\n itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null\n ] });\n }\n);\nSelectItemText.displayName = ITEM_TEXT_NAME;\nvar ITEM_INDICATOR_NAME = \"SelectItemIndicator\";\nvar SelectItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...itemIndicatorProps, ref: forwardedRef }) : null;\n }\n);\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SCROLL_UP_BUTTON_NAME = \"SelectScrollUpButton\";\nvar SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const canScrollUp2 = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollUp ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\nvar SCROLL_DOWN_BUTTON_NAME = \"SelectScrollDownButton\";\nvar SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollDown ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\nvar SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext(\"SelectScrollButton\", __scopeSelect);\n const autoScrollTimerRef = React.useRef(null);\n const getItems = useCollection(__scopeSelect);\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: \"nearest\" });\n }, [getItems]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-hidden\": true,\n ...scrollIndicatorProps,\n ref: forwardedRef,\n style: { flexShrink: 0, ...scrollIndicatorProps.style },\n onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })\n }\n );\n});\nvar SEPARATOR_NAME = \"SelectSeparator\";\nvar SelectSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { \"aria-hidden\": true, ...separatorProps, ref: forwardedRef });\n }\n);\nSelectSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"SelectArrow\";\nvar SelectArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === \"popper\" ? /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;\n }\n);\nSelectArrow.displayName = ARROW_NAME;\nvar BUBBLE_INPUT_NAME = \"SelectBubbleInput\";\nvar SelectBubbleInput = React.forwardRef(\n ({ __scopeSelect, value, ...props }, forwardedRef) => {\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const select = ref.current;\n if (!select) return;\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n \"value\"\n );\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"change\", { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(\n Primitive.select,\n {\n ...props,\n style: { ...VISUALLY_HIDDEN_STYLES, ...props.style },\n ref: composedRefs,\n defaultValue: value\n }\n );\n }\n);\nSelectBubbleInput.displayName = BUBBLE_INPUT_NAME;\nfunction shouldShowPlaceholder(value) {\n return value === \"\" || value === void 0;\n}\nfunction useTypeaheadSearch(onSearchChange) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef(\"\");\n const timerRef = React.useRef(0);\n const handleTypeaheadSearch = React.useCallback(\n (key) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n },\n [handleSearchChange]\n );\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = \"\";\n window.clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n return [searchRef, handleTypeaheadSearch, resetTypeahead];\n}\nfunction findNextItem(items, search, currentItem) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find(\n (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : void 0;\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root2 = Select;\nvar Trigger = SelectTrigger;\nvar Value = SelectValue;\nvar Icon = SelectIcon;\nvar Portal = SelectPortal;\nvar Content2 = SelectContent;\nvar Viewport = SelectViewport;\nvar Group = SelectGroup;\nvar Label = SelectLabel;\nvar Item = SelectItem;\nvar ItemText = SelectItemText;\nvar ItemIndicator = SelectItemIndicator;\nvar ScrollUpButton = SelectScrollUpButton;\nvar ScrollDownButton = SelectScrollDownButton;\nvar Separator = SelectSeparator;\nvar Arrow2 = SelectArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Group,\n Icon,\n Item,\n ItemIndicator,\n ItemText,\n Label,\n Portal,\n Root2 as Root,\n ScrollDownButton,\n ScrollUpButton,\n Select,\n SelectArrow,\n SelectContent,\n SelectGroup,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectItemText,\n SelectLabel,\n SelectPortal,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n SelectViewport,\n Separator,\n Trigger,\n Value,\n Viewport,\n createSelectScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","/* __next_internal_action_entry_do_not_use__ [{\"40a42248485dc9a49daf53ab9f5f907f7203ed0f81\":\"updateSettingsAction\"},\"src/presentation/web/app/actions/update-settings.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"40a42248485dc9a49daf53ab9f5f907f7203ed0f81\",callServer,void 0,findSourceMapURL,\"updateSettingsAction\");export{$$RSC_SERVER_ACTION_0 as updateSettingsAction};","'use client';\n\nimport { useState, useTransition, useRef, useEffect, useCallback } from 'react';\nimport {\n Check,\n Bot,\n Terminal,\n GitBranch,\n Activity,\n Bell,\n Flag,\n Database,\n Minus,\n Plus,\n ExternalLink,\n Settings2,\n Timer,\n} from 'lucide-react';\nimport { toast } from 'sonner';\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/components/ui/label';\nimport { Switch } from '@/components/ui/switch';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/ui/select';\nimport { updateSettingsAction } from '@/app/actions/update-settings';\nimport { type AgentType, EditorType, TerminalType } from '@shepai/core/domain/generated/output';\nimport { getEditorTypeIcon } from '@/components/common/editor-type-icons';\nimport { AgentModelPicker } from '@/components/features/settings/AgentModelPicker';\nimport { TimeoutSlider } from '@/components/features/settings/timeout-slider';\nimport type {\n Settings,\n FeatureFlags,\n NotificationPreferences,\n} from '@shepai/core/domain/generated/output';\nimport type { AvailableTerminal } from '@/app/actions/get-available-terminals';\n\nconst EDITOR_OPTIONS = [\n { value: EditorType.VsCode, label: 'VS Code' },\n { value: EditorType.Cursor, label: 'Cursor' },\n { value: EditorType.Windsurf, label: 'Windsurf' },\n { value: EditorType.Zed, label: 'Zed' },\n { value: EditorType.Antigravity, label: 'Antigravity' },\n];\n\nconst SHELL_OPTIONS = [\n { value: 'bash', label: 'Bash' },\n { value: 'zsh', label: 'Zsh' },\n { value: 'fish', label: 'Fish' },\n];\n\nconst SECTIONS = [\n { id: 'agent', label: 'Agent', icon: Bot },\n { id: 'environment', label: 'Environment', icon: Terminal },\n { id: 'workflow', label: 'Workflow', icon: GitBranch },\n { id: 'ci', label: 'CI', icon: Activity },\n { id: 'stage-timeouts', label: 'Timeouts', icon: Timer },\n { id: 'notifications', label: 'Notifications', icon: Bell },\n { id: 'feature-flags', label: 'Flags', icon: Flag },\n { id: 'database', label: 'Database', icon: Database },\n] as const;\n\nexport interface SettingsPageClientProps {\n settings: Settings;\n shepHome: string;\n dbFileSize: string;\n availableTerminals?: AvailableTerminal[];\n}\n\nfunction useSaveIndicator() {\n const [isPending, startTransition] = useTransition();\n const [showSaving, setShowSaving] = useState(false);\n const [showSaved, setShowSaved] = useState(false);\n const minTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const pendingDoneRef = useRef(false);\n\n // Show \"Saving...\" with a minimum display time of 600ms\n useEffect(() => {\n if (isPending && !showSaving) {\n setShowSaving(true);\n pendingDoneRef.current = false;\n minTimerRef.current = setTimeout(() => {\n minTimerRef.current = null;\n if (pendingDoneRef.current) {\n setShowSaving(false);\n setShowSaved(true);\n setTimeout(() => setShowSaved(false), 2000);\n }\n }, 350);\n }\n if (!isPending && showSaving) {\n pendingDoneRef.current = true;\n // If min timer already elapsed, transition now\n if (!minTimerRef.current) {\n setShowSaving(false);\n setShowSaved(true);\n setTimeout(() => setShowSaved(false), 2000);\n }\n }\n }, [isPending, showSaving]);\n\n const save = useCallback(\n (payload: Record<string, unknown>) => {\n startTransition(async () => {\n const result = await updateSettingsAction(payload);\n if (!result.success) {\n toast.error(result.error ?? 'Failed to save settings');\n }\n });\n },\n [startTransition]\n );\n\n return { showSaving, showSaved, save };\n}\n\n/* ── Reusable row components ── */\n\nfunction SettingsRow({\n label,\n description,\n htmlFor,\n children,\n}: {\n label: string;\n description?: string;\n htmlFor?: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0\">\n <div className=\"min-w-0\">\n <Label htmlFor={htmlFor} className=\"cursor-pointer text-sm font-normal whitespace-nowrap\">\n {label}\n </Label>\n {description ? (\n <p className=\"text-muted-foreground text-[11px] leading-tight\">{description}</p>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">{children}</div>\n </div>\n );\n}\n\nfunction SwitchRow({\n label,\n description,\n id,\n testId,\n checked,\n onChange,\n disabled,\n}: {\n label: string;\n description?: string;\n id: string;\n testId: string;\n checked: boolean;\n onChange: (value: boolean) => void;\n disabled?: boolean;\n}) {\n return (\n <SettingsRow label={label} description={description} htmlFor={id}>\n <Switch\n id={id}\n data-testid={testId}\n checked={checked}\n onCheckedChange={onChange}\n disabled={disabled}\n className={cn('cursor-pointer', disabled && 'cursor-not-allowed opacity-50')}\n />\n </SettingsRow>\n );\n}\n\n/* ── Section card wrapper ── */\n\nfunction SettingsSection({\n icon: Icon,\n title,\n description,\n badge,\n testId,\n children,\n}: {\n icon: React.ComponentType<{ className?: string }>;\n title: string;\n description: string;\n badge?: string;\n testId: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"bg-background rounded-lg border\" data-testid={testId}>\n <div className=\"bg-muted/30 border-b px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n <Icon className=\"text-muted-foreground h-3.5 w-3.5\" />\n <h2 className=\"text-sm font-semibold\">{title}</h2>\n {badge ? (\n <span className=\"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase\">\n {badge}\n </span>\n ) : null}\n </div>\n <p className=\"text-muted-foreground mt-0.5 text-[11px]\">{description}</p>\n </div>\n <div className=\"px-4\">{children}</div>\n </div>\n );\n}\n\nfunction NumberStepper({\n id,\n testId,\n value,\n onChange,\n onBlur,\n placeholder,\n min = 1,\n max,\n step = 1,\n suffix,\n}: {\n id: string;\n testId: string;\n value: string;\n onChange: (value: string) => void;\n onBlur: () => void;\n placeholder: string;\n min?: number;\n max?: number;\n step?: number;\n suffix?: string;\n}) {\n const numValue = value === '' ? undefined : parseInt(value, 10);\n\n const decrement = () => {\n const current = numValue ?? parseInt(placeholder, 10);\n const next = Math.max(min, current - step);\n onChange(String(next));\n };\n\n const increment = () => {\n const current = numValue ?? parseInt(placeholder, 10);\n const next = max != null ? Math.min(max, current + step) : current + step;\n onChange(String(next));\n };\n\n return (\n <div className=\"flex items-center gap-1.5\">\n <div className=\"flex items-center overflow-hidden rounded-md border\">\n <button\n type=\"button\"\n onClick={() => {\n decrement();\n }}\n onMouseUp={onBlur}\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors\"\n aria-label=\"Decrease\"\n >\n <Minus className=\"h-3 w-3\" />\n </button>\n <input\n id={id}\n data-testid={testId}\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n value={value}\n placeholder={placeholder}\n onChange={(e) => {\n const v = e.target.value.replace(/[^0-9]/g, '');\n onChange(v);\n }}\n onBlur={onBlur}\n className=\"h-8 w-14 bg-transparent text-center text-xs outline-none\"\n />\n <button\n type=\"button\"\n onClick={() => {\n increment();\n }}\n onMouseUp={onBlur}\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors\"\n aria-label=\"Increase\"\n >\n <Plus className=\"h-3 w-3\" />\n </button>\n </div>\n {suffix ? <span className=\"text-muted-foreground text-[11px]\">{suffix}</span> : null}\n </div>\n );\n}\n\nfunction SubsectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"border-b pt-3 pb-1\">\n <span className=\"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase\">\n {children}\n </span>\n </div>\n );\n}\n\nfunction SectionHint({\n children,\n links,\n}: {\n children: React.ReactNode;\n links?: { label: string; href: string }[];\n}) {\n return (\n <div className=\"hidden pt-2 lg:block\">\n <p className=\"text-muted-foreground/70 text-[11px] leading-relaxed\">{children}</p>\n {links != null && links.length > 0 ? (\n <div className=\"mt-2 flex flex-col gap-1\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-[10px] transition-colors\"\n >\n <ExternalLink className=\"h-2.5 w-2.5\" />\n {link.label}\n </a>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\n/* ── Main component ── */\n\nexport function SettingsPageClient({\n settings,\n shepHome,\n dbFileSize,\n availableTerminals,\n}: SettingsPageClientProps) {\n const { showSaving, showSaved, save } = useSaveIndicator();\n const featureFlags = settings.featureFlags ?? {\n skills: false,\n envDeploy: false,\n debug: false,\n githubImport: false,\n adoptBranch: false,\n gitRebaseSync: false,\n reactFileManager: false,\n };\n\n // Agent state\n const [agentType, setAgentType] = useState(settings.agent.type);\n\n // Environment state\n const [editor, setEditor] = useState(settings.environment.defaultEditor);\n const [shell, setShell] = useState(settings.environment.shellPreference);\n const [terminal, setTerminal] = useState(\n settings.environment.terminalPreference ?? TerminalType.System\n );\n\n // Filter to only show installed terminals\n const terminalOptions = availableTerminals\n ? availableTerminals.filter((t) => t.available)\n : [{ id: TerminalType.System, name: 'System Terminal', available: true as const }];\n\n // Workflow state\n const [openPr, setOpenPr] = useState(settings.workflow.openPrOnImplementationComplete);\n const [pushOnComplete, setPushOnComplete] = useState(\n settings.workflow.approvalGateDefaults.pushOnImplementationComplete\n );\n const [allowPrd, setAllowPrd] = useState(settings.workflow.approvalGateDefaults.allowPrd);\n const [allowPlan, setAllowPlan] = useState(settings.workflow.approvalGateDefaults.allowPlan);\n const [allowMerge, setAllowMerge] = useState(settings.workflow.approvalGateDefaults.allowMerge);\n const [enableEvidence, setEnableEvidence] = useState(settings.workflow.enableEvidence);\n const [commitEvidence, setCommitEvidence] = useState(settings.workflow.commitEvidence);\n const [ciWatchEnabled, setCiWatchEnabled] = useState(settings.workflow.ciWatchEnabled !== false);\n const [hideCiStatus, setHideCiStatus] = useState(settings.workflow.hideCiStatus !== false);\n const [ciMaxFix, setCiMaxFix] = useState(\n settings.workflow.ciMaxFixAttempts != null ? String(settings.workflow.ciMaxFixAttempts) : ''\n );\n const [ciTimeout, setCiTimeout] = useState(\n settings.workflow.ciWatchTimeoutMs != null\n ? String(Math.round(settings.workflow.ciWatchTimeoutMs / 1000))\n : ''\n );\n const [ciLogMax, setCiLogMax] = useState(\n settings.workflow.ciLogMaxChars != null ? String(settings.workflow.ciLogMaxChars) : ''\n );\n const [ciPollInterval, setCiPollInterval] = useState(\n settings.workflow.ciWatchPollIntervalSeconds != null\n ? String(settings.workflow.ciWatchPollIntervalSeconds)\n : ''\n );\n // Feature agent per-stage timeout states (stored in seconds for display, converted to ms on save)\n // Defaults: feature agent stages = 1_800_000 ms (1800s), analyze-repo = 600_000 ms (600s)\n const stageTimeoutsConfig = settings.workflow.stageTimeouts;\n const [analyzeTimeout, setAnalyzeTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.analyzeMs ?? 1_800_000) / 1000))\n );\n const [requirementsTimeout, setRequirementsTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.requirementsMs ?? 1_800_000) / 1000))\n );\n const [researchTimeout, setResearchTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.researchMs ?? 1_800_000) / 1000))\n );\n const [planTimeout, setPlanTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.planMs ?? 1_800_000) / 1000))\n );\n const [implementTimeout, setImplementTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.implementMs ?? 1_800_000) / 1000))\n );\n const [mergeTimeout, setMergeTimeout] = useState(\n String(Math.round((stageTimeoutsConfig?.mergeMs ?? 1_800_000) / 1000))\n );\n // Analyze-repo agent timeout state\n const analyzeRepoConfig = settings.workflow.analyzeRepoTimeouts;\n const [analyzeRepoTimeout, setAnalyzeRepoTimeout] = useState(\n String(Math.round((analyzeRepoConfig?.analyzeMs ?? 600_000) / 1000))\n );\n\n // Notification state\n const [inApp, setInApp] = useState(settings.notifications.inApp.enabled);\n const [events, setEvents] = useState({ ...settings.notifications.events });\n\n // Feature flags state\n const [flags, setFlags] = useState<FeatureFlags>({ ...featureFlags });\n\n // Original CI values for blur comparison\n const originalCiMaxFix =\n settings.workflow.ciMaxFixAttempts != null ? String(settings.workflow.ciMaxFixAttempts) : '';\n const originalCiTimeout =\n settings.workflow.ciWatchTimeoutMs != null\n ? String(Math.round(settings.workflow.ciWatchTimeoutMs / 1000))\n : '';\n const originalCiLogMax =\n settings.workflow.ciLogMaxChars != null ? String(settings.workflow.ciLogMaxChars) : '';\n const originalCiPollInterval =\n settings.workflow.ciWatchPollIntervalSeconds != null\n ? String(settings.workflow.ciWatchPollIntervalSeconds)\n : '';\n const originalAnalyzeTimeout =\n stageTimeoutsConfig?.analyzeMs != null\n ? String(Math.round(stageTimeoutsConfig.analyzeMs / 1000))\n : '';\n const originalRequirementsTimeout =\n stageTimeoutsConfig?.requirementsMs != null\n ? String(Math.round(stageTimeoutsConfig.requirementsMs / 1000))\n : '';\n const originalResearchTimeout =\n stageTimeoutsConfig?.researchMs != null\n ? String(Math.round(stageTimeoutsConfig.researchMs / 1000))\n : '';\n const originalPlanTimeout =\n stageTimeoutsConfig?.planMs != null\n ? String(Math.round(stageTimeoutsConfig.planMs / 1000))\n : '';\n const originalImplementTimeout =\n stageTimeoutsConfig?.implementMs != null\n ? String(Math.round(stageTimeoutsConfig.implementMs / 1000))\n : '';\n const originalMergeTimeout =\n stageTimeoutsConfig?.mergeMs != null\n ? String(Math.round(stageTimeoutsConfig.mergeMs / 1000))\n : '';\n const originalAnalyzeRepoTimeout =\n analyzeRepoConfig?.analyzeMs != null\n ? String(Math.round(analyzeRepoConfig.analyzeMs / 1000))\n : '';\n\n function parseOptionalInt(value: string): number | undefined {\n if (value === '') return undefined;\n const n = parseInt(value, 10);\n return Number.isNaN(n) || n <= 0 ? undefined : n;\n }\n\n function secondsToMs(val: string | undefined): number | undefined {\n if (val === undefined) return undefined;\n const n = parseOptionalInt(val);\n return n != null ? n * 1000 : undefined;\n }\n\n // Workflow helpers\n function buildWorkflowPayload(\n overrides: {\n openPr?: boolean;\n pushOnComplete?: boolean;\n allowPrd?: boolean;\n allowPlan?: boolean;\n allowMerge?: boolean;\n enableEvidence?: boolean;\n commitEvidence?: boolean;\n ciWatchEnabled?: boolean;\n hideCiStatus?: boolean;\n ciMaxFix?: string;\n ciTimeout?: string;\n ciLogMax?: string;\n ciPollInterval?: string;\n analyzeTimeout?: string;\n requirementsTimeout?: string;\n researchTimeout?: string;\n planTimeout?: string;\n implementTimeout?: string;\n mergeTimeout?: string;\n analyzeRepoTimeout?: string;\n } = {}\n ) {\n const timeoutSeconds = parseOptionalInt(overrides.ciTimeout ?? ciTimeout);\n return {\n workflow: {\n openPrOnImplementationComplete: overrides.openPr ?? openPr,\n approvalGateDefaults: {\n pushOnImplementationComplete: overrides.pushOnComplete ?? pushOnComplete,\n allowPrd: overrides.allowPrd ?? allowPrd,\n allowPlan: overrides.allowPlan ?? allowPlan,\n allowMerge: overrides.allowMerge ?? allowMerge,\n },\n enableEvidence: overrides.enableEvidence ?? enableEvidence,\n commitEvidence: overrides.commitEvidence ?? commitEvidence,\n ciWatchEnabled: overrides.ciWatchEnabled ?? ciWatchEnabled,\n hideCiStatus: overrides.hideCiStatus ?? hideCiStatus,\n ciMaxFixAttempts: parseOptionalInt(overrides.ciMaxFix ?? ciMaxFix),\n ciWatchTimeoutMs: timeoutSeconds != null ? timeoutSeconds * 1000 : undefined,\n ciLogMaxChars: parseOptionalInt(overrides.ciLogMax ?? ciLogMax),\n ciWatchPollIntervalSeconds: parseOptionalInt(overrides.ciPollInterval ?? ciPollInterval),\n stageTimeouts: {\n analyzeMs: secondsToMs(overrides.analyzeTimeout ?? analyzeTimeout),\n requirementsMs: secondsToMs(overrides.requirementsTimeout ?? requirementsTimeout),\n researchMs: secondsToMs(overrides.researchTimeout ?? researchTimeout),\n planMs: secondsToMs(overrides.planTimeout ?? planTimeout),\n implementMs: secondsToMs(overrides.implementTimeout ?? implementTimeout),\n mergeMs: secondsToMs(overrides.mergeTimeout ?? mergeTimeout),\n },\n analyzeRepoTimeouts: {\n analyzeMs: secondsToMs(overrides.analyzeRepoTimeout ?? analyzeRepoTimeout),\n },\n },\n };\n }\n\n // Notification helpers\n function buildNotificationPayload(\n overrides: {\n inApp?: boolean;\n events?: NotificationPreferences['events'];\n } = {}\n ) {\n return {\n notifications: {\n inApp: { enabled: overrides.inApp ?? inApp },\n events: overrides.events ?? events,\n },\n };\n }\n\n const [activeSection, setActiveSection] = useState<string>('agent');\n\n // Track which section is in view via IntersectionObserver\n useEffect(() => {\n const els = SECTIONS.map((s) => document.getElementById(`section-${s.id}`)).filter(\n Boolean\n ) as HTMLElement[];\n if (els.length === 0) return;\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setActiveSection(entry.target.id.replace('section-', ''));\n }\n }\n },\n { rootMargin: '-65px 0px -60% 0px', threshold: 0 }\n );\n\n for (const el of els) observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n const scrollToSection = useCallback((id: string) => {\n const el = document.getElementById(`section-${id}`);\n if (!el) return;\n el.scrollIntoView({ behavior: 'smooth', block: 'start' });\n // Flash highlight\n el.style.animation = 'none';\n // Force reflow\n void el.offsetHeight;\n el.style.animation = 'section-flash 1s ease-out';\n }, []);\n\n return (\n <div data-testid=\"settings-page-client\" className=\"max-w-5xl\">\n {/* Sticky header — title + save indicator + TOC in one row */}\n <div className=\"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 grid grid-cols-1 gap-x-5 pt-6 pb-4 backdrop-blur lg:grid-cols-[1fr_280px]\">\n <div className=\"flex items-center gap-2\">\n <Settings2 className=\"text-muted-foreground h-4 w-4\" />\n <h1 className=\"text-sm font-bold tracking-tight\">Settings</h1>\n <span className=\"relative h-4 w-16\">\n <span\n className={cn(\n 'text-muted-foreground absolute inset-0 flex items-center text-xs transition-opacity duration-300',\n showSaving ? 'opacity-100' : 'opacity-0'\n )}\n >\n Saving...\n </span>\n <span\n className={cn(\n 'absolute inset-0 flex items-center gap-1 text-xs text-green-600 transition-opacity duration-300',\n showSaved && !showSaving ? 'opacity-100' : 'opacity-0'\n )}\n >\n <Check className=\"h-3 w-3\" />\n Saved\n </span>\n </span>\n <nav className=\"ml-auto flex items-center gap-0.5\">\n {SECTIONS.map((s) => {\n const SectionIcon = s.icon;\n const isActive = activeSection === s.id;\n return (\n <button\n key={s.id}\n type=\"button\"\n onClick={() => scrollToSection(s.id)}\n className={cn(\n 'flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-all',\n isActive\n ? 'bg-accent text-foreground font-medium'\n : 'text-muted-foreground/60 hover:text-foreground hover:bg-accent/50'\n )}\n >\n <SectionIcon className=\"h-3 w-3\" />\n <span className=\"hidden sm:inline\">{s.label}</span>\n </button>\n );\n })}\n </nav>\n </div>\n </div>\n\n <div className=\"flex flex-col gap-3\">\n {/* ── Agent ── */}\n <div\n id=\"section-agent\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Bot}\n title=\"Agent\"\n description=\"AI coding agent and authentication\"\n testId=\"agent-settings-section\"\n >\n <SettingsRow\n label=\"Agent & Model\"\n description=\"Provider and model for all operations\"\n htmlFor=\"agent-model-picker\"\n >\n <AgentModelPicker\n initialAgentType={agentType}\n initialModel={settings.models.default}\n mode=\"settings\"\n onAgentModelChange={(newAgent) => setAgentType(newAgent as AgentType)}\n className=\"w-55\"\n />\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Agent system',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/architecture/agent-system.md',\n },\n {\n label: 'Adding agents',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/development/adding-agents.md',\n },\n {\n label: 'Configuration guide',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md',\n },\n ]}\n >\n Choose which AI coding agent powers your features. Each agent supports different models\n and capabilities. Authentication is resolved automatically via your active session.\n </SectionHint>\n </div>\n\n {/* ── Environment ── */}\n <div\n id=\"section-environment\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Terminal}\n title=\"Environment\"\n description=\"Editor, shell, and terminal preferences\"\n testId=\"environment-settings-section\"\n >\n <SettingsRow\n label=\"Default Editor\"\n description=\"Editor launched for file operations\"\n htmlFor=\"default-editor\"\n >\n <Select\n value={editor}\n onValueChange={(v) => {\n setEditor(v as EditorType);\n save({\n environment: {\n defaultEditor: v as EditorType,\n shellPreference: shell,\n terminalPreference: terminal,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"default-editor\"\n data-testid=\"editor-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {EDITOR_OPTIONS.map((opt) => {\n const Icon = getEditorTypeIcon(opt.value);\n return (\n <SelectItem key={opt.value} value={opt.value}>\n <span className=\"flex items-center gap-2 text-xs\">\n <Icon className=\"h-4 w-4 shrink-0\" />\n {opt.label}\n </span>\n </SelectItem>\n );\n })}\n </SelectContent>\n </Select>\n </SettingsRow>\n <SettingsRow\n label=\"Shell\"\n description=\"Default shell for generated scripts\"\n htmlFor=\"shell-preference\"\n >\n <Select\n value={shell}\n onValueChange={(v) => {\n setShell(v);\n save({\n environment: {\n defaultEditor: editor,\n shellPreference: v,\n terminalPreference: terminal,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"shell-preference\"\n data-testid=\"shell-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {SHELL_OPTIONS.map((opt) => (\n <SelectItem key={opt.value} value={opt.value}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n <SettingsRow\n label=\"Terminal\"\n description=\"Terminal emulator for shell sessions\"\n htmlFor=\"terminal-preference\"\n >\n <Select\n value={terminal}\n onValueChange={(v) => {\n setTerminal(v as TerminalType);\n save({\n environment: {\n defaultEditor: editor,\n shellPreference: shell,\n terminalPreference: v as TerminalType,\n },\n });\n }}\n >\n <SelectTrigger\n id=\"terminal-preference\"\n data-testid=\"terminal-select\"\n className=\"w-55 cursor-pointer text-xs\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {terminalOptions.map((opt) => (\n <SelectItem key={opt.id} value={opt.id}>\n {opt.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Configuration guide',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/guides/configuration.md',\n },\n ]}\n >\n Your preferred editor opens files for review. The shell setting controls generated\n scripts. The terminal emulator is launched when opening shell sessions from the web UI.\n </SectionHint>\n </div>\n\n {/* ── Workflow ── */}\n <div\n id=\"section-workflow\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={GitBranch}\n title=\"Workflow\"\n description=\"Automation behavior after implementation\"\n testId=\"workflow-settings-section\"\n >\n <SubsectionLabel>Approve</SubsectionLabel>\n <SwitchRow\n label=\"Auto-approve PRD\"\n description=\"Skip manual review of requirements\"\n id=\"allow-prd\"\n testId=\"switch-allow-prd\"\n checked={allowPrd}\n onChange={(v) => {\n setAllowPrd(v);\n save(buildWorkflowPayload({ allowPrd: v }));\n }}\n />\n <SwitchRow\n label=\"Auto-approve Plan\"\n description=\"Skip manual review of implementation plan\"\n id=\"allow-plan\"\n testId=\"switch-allow-plan\"\n checked={allowPlan}\n onChange={(v) => {\n setAllowPlan(v);\n save(buildWorkflowPayload({ allowPlan: v }));\n }}\n />\n <SwitchRow\n label=\"Auto-approve Merge\"\n description=\"Merge without manual review\"\n id=\"allow-merge\"\n testId=\"switch-allow-merge\"\n checked={allowMerge}\n onChange={(v) => {\n setAllowMerge(v);\n save(buildWorkflowPayload({ allowMerge: v }));\n }}\n />\n <SubsectionLabel>Evidence</SubsectionLabel>\n <SwitchRow\n label=\"Collect evidence\"\n description=\"Capture screenshots and artifacts after implementation\"\n id=\"enable-evidence\"\n testId=\"switch-enable-evidence\"\n checked={enableEvidence}\n onChange={(v) => {\n setEnableEvidence(v);\n if (!v) {\n setCommitEvidence(false);\n save(buildWorkflowPayload({ enableEvidence: v, commitEvidence: false }));\n } else {\n save(buildWorkflowPayload({ enableEvidence: v }));\n }\n }}\n />\n <SwitchRow\n label=\"Add evidence to PR\"\n description=\"Include evidence in the pull request body\"\n id=\"commit-evidence\"\n testId=\"switch-commit-evidence\"\n checked={commitEvidence}\n disabled={!enableEvidence || !openPr}\n onChange={(v) => {\n setCommitEvidence(v);\n save(buildWorkflowPayload({ commitEvidence: v }));\n }}\n />\n <SubsectionLabel>Git</SubsectionLabel>\n <SwitchRow\n label=\"Push on complete\"\n description=\"Push to remote when implementation finishes\"\n id=\"push-on-complete\"\n testId=\"switch-push-on-complete\"\n checked={pushOnComplete}\n onChange={(v) => {\n setPushOnComplete(v);\n save(buildWorkflowPayload({ pushOnComplete: v }));\n }}\n />\n <SwitchRow\n label=\"Open PR on complete\"\n description=\"Create a pull request when done\"\n id=\"open-pr\"\n testId=\"switch-open-pr\"\n checked={openPr}\n onChange={(v) => {\n setOpenPr(v);\n if (!v) {\n setCommitEvidence(false);\n save(buildWorkflowPayload({ openPr: v, commitEvidence: false }));\n } else {\n save(buildWorkflowPayload({ openPr: v }));\n }\n }}\n />\n <SwitchRow\n label=\"Watch CI after push\"\n description=\"Monitor CI and auto-fix failures. Disable to avoid rate limits.\"\n id=\"ci-watch-enabled\"\n testId=\"switch-ci-watch-enabled\"\n checked={ciWatchEnabled}\n onChange={(v) => {\n setCiWatchEnabled(v);\n save(buildWorkflowPayload({ ciWatchEnabled: v }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Approval gates',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/016-hitl-approval-gates/spec.yaml',\n },\n {\n label: 'Push & PR flags',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/037-feature-pr-push-flags/spec.yaml',\n },\n ]}\n >\n Control how autonomous each feature run is. Auto-approve skips the human review pause at\n each phase. Push and PR options control what happens after successful implementation.\n </SectionHint>\n </div>\n\n {/* ── CI ── */}\n <div\n id=\"section-ci\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Activity}\n title=\"Continuous Integration\"\n description=\"Limits and timeouts for CI monitoring\"\n testId=\"ci-settings-section\"\n >\n <SettingsRow\n label=\"Max fix attempts\"\n description=\"Agent retries on failing CI\"\n htmlFor=\"ci-max-fix\"\n >\n <NumberStepper\n id=\"ci-max-fix\"\n testId=\"ci-max-fix-input\"\n placeholder=\"3\"\n value={ciMaxFix}\n onChange={setCiMaxFix}\n onBlur={() => {\n if (ciMaxFix !== originalCiMaxFix) save(buildWorkflowPayload({ ciMaxFix }));\n }}\n min={1}\n max={10}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Watch timeout\"\n description=\"Max wait for CI completion\"\n htmlFor=\"ci-timeout\"\n >\n <NumberStepper\n id=\"ci-timeout\"\n testId=\"ci-timeout-input\"\n placeholder=\"300\"\n value={ciTimeout}\n onChange={setCiTimeout}\n onBlur={() => {\n if (ciTimeout !== originalCiTimeout) save(buildWorkflowPayload({ ciTimeout }));\n }}\n min={30}\n step={30}\n suffix=\"sec\"\n />\n </SettingsRow>\n <SettingsRow\n label=\"Max log size\"\n description=\"Truncate CI logs beyond this limit\"\n htmlFor=\"ci-log-max\"\n >\n <NumberStepper\n id=\"ci-log-max\"\n testId=\"ci-log-max-input\"\n placeholder=\"50000\"\n value={ciLogMax}\n onChange={setCiLogMax}\n onBlur={() => {\n if (ciLogMax !== originalCiLogMax) save(buildWorkflowPayload({ ciLogMax }));\n }}\n min={1000}\n step={5000}\n suffix=\"chars\"\n />\n </SettingsRow>\n <SettingsRow\n label=\"Poll interval\"\n description=\"How often to check GitHub for CI status updates\"\n htmlFor=\"ci-poll-interval\"\n >\n <NumberStepper\n id=\"ci-poll-interval\"\n testId=\"ci-poll-interval-input\"\n placeholder=\"30\"\n value={ciPollInterval}\n onChange={setCiPollInterval}\n onBlur={() => {\n if (ciPollInterval !== originalCiPollInterval)\n save(buildWorkflowPayload({ ciPollInterval }));\n }}\n min={5}\n step={5}\n suffix=\"sec\"\n />\n </SettingsRow>\n <SwitchRow\n label=\"Hide CI status\"\n description=\"Hide CI status badges from feature drawer and merge review\"\n id=\"hide-ci-status\"\n testId=\"switch-hide-ci-status\"\n checked={hideCiStatus}\n onChange={(v) => {\n setHideCiStatus(v);\n save(buildWorkflowPayload({ hideCiStatus: v }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'CI/CD pipeline',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/development/cicd.md',\n },\n {\n label: 'CI security gates',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/003-cicd-security-gates/spec.md',\n },\n ]}\n >\n When a feature completes, the agent can watch CI and auto-fix failures. These limits\n prevent runaway retries and control how much log output is sent to the agent for\n analysis.\n </SectionHint>\n </div>\n\n {/* ── Stage Timeouts ── */}\n <div\n id=\"section-stage-timeouts\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Timer}\n title=\"Stage Timeouts\"\n description=\"Maximum execution time per agent stage\"\n testId=\"stage-timeouts-settings-section\"\n >\n <SubsectionLabel>Feature Agent</SubsectionLabel>\n <SettingsRow\n label=\"Analyze\"\n description=\"Repository analysis timeout\"\n htmlFor=\"timeout-analyze\"\n >\n <TimeoutSlider\n id=\"timeout-analyze\"\n testId=\"timeout-analyze-input\"\n value={analyzeTimeout}\n onChange={setAnalyzeTimeout}\n onBlur={() => {\n if (analyzeTimeout !== originalAnalyzeTimeout)\n save(buildWorkflowPayload({ analyzeTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Requirements\"\n description=\"Requirements gathering timeout\"\n htmlFor=\"timeout-requirements\"\n >\n <TimeoutSlider\n id=\"timeout-requirements\"\n testId=\"timeout-requirements-input\"\n value={requirementsTimeout}\n onChange={setRequirementsTimeout}\n onBlur={() => {\n if (requirementsTimeout !== originalRequirementsTimeout)\n save(buildWorkflowPayload({ requirementsTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Research\"\n description=\"Technical research timeout\"\n htmlFor=\"timeout-research\"\n >\n <TimeoutSlider\n id=\"timeout-research\"\n testId=\"timeout-research-input\"\n value={researchTimeout}\n onChange={setResearchTimeout}\n onBlur={() => {\n if (researchTimeout !== originalResearchTimeout)\n save(buildWorkflowPayload({ researchTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Plan\"\n description=\"Implementation planning timeout\"\n htmlFor=\"timeout-plan\"\n >\n <TimeoutSlider\n id=\"timeout-plan\"\n testId=\"timeout-plan-input\"\n value={planTimeout}\n onChange={setPlanTimeout}\n onBlur={() => {\n if (planTimeout !== originalPlanTimeout)\n save(buildWorkflowPayload({ planTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Implement\"\n description=\"Code implementation timeout\"\n htmlFor=\"timeout-implement\"\n >\n <TimeoutSlider\n id=\"timeout-implement\"\n testId=\"timeout-implement-input\"\n value={implementTimeout}\n onChange={setImplementTimeout}\n onBlur={() => {\n if (implementTimeout !== originalImplementTimeout)\n save(buildWorkflowPayload({ implementTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SettingsRow\n label=\"Merge\"\n description=\"PR creation and merge timeout\"\n htmlFor=\"timeout-merge\"\n >\n <TimeoutSlider\n id=\"timeout-merge\"\n testId=\"timeout-merge-input\"\n value={mergeTimeout}\n onChange={setMergeTimeout}\n onBlur={() => {\n if (mergeTimeout !== originalMergeTimeout)\n save(buildWorkflowPayload({ mergeTimeout }));\n }}\n defaultSeconds={1800}\n />\n </SettingsRow>\n <SubsectionLabel>Analyze Repository Agent</SubsectionLabel>\n <SettingsRow\n label=\"Analyze\"\n description=\"Repository analysis timeout\"\n htmlFor=\"timeout-analyze-repo\"\n >\n <TimeoutSlider\n id=\"timeout-analyze-repo\"\n testId=\"timeout-analyze-repo-input\"\n value={analyzeRepoTimeout}\n onChange={setAnalyzeRepoTimeout}\n onBlur={() => {\n if (analyzeRepoTimeout !== originalAnalyzeRepoTimeout)\n save(buildWorkflowPayload({ analyzeRepoTimeout }));\n }}\n defaultSeconds={600}\n />\n </SettingsRow>\n </SettingsSection>\n <SectionHint>\n Each agent has independently configurable stage timeouts. When a stage exceeds its\n timeout, the agent is terminated. Longer timeouts are useful for complex\n implementations. Feature agent defaults to 30 minutes per stage. Analyze repository\n agent defaults to 10 minutes.\n </SectionHint>\n </div>\n\n {/* ── Notifications ── */}\n <div\n id=\"section-notifications\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Bell}\n title=\"Notifications\"\n description=\"How and when you get notified\"\n testId=\"notification-settings-section\"\n >\n <SubsectionLabel>Channels</SubsectionLabel>\n <SwitchRow\n label=\"In-app\"\n description=\"Notifications inside the Shep UI\"\n id=\"notif-in-app\"\n testId=\"switch-in-app\"\n checked={inApp}\n onChange={(v) => {\n setInApp(v);\n save(buildNotificationPayload({ inApp: v }));\n }}\n />\n\n <SubsectionLabel>Agent Events</SubsectionLabel>\n <SwitchRow\n label=\"Agent started\"\n id=\"notif-event-agentStarted\"\n testId=\"switch-event-agentStarted\"\n checked={events.agentStarted}\n onChange={(v) => {\n const newEvents = { ...events, agentStarted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Phase completed\"\n id=\"notif-event-phaseCompleted\"\n testId=\"switch-event-phaseCompleted\"\n checked={events.phaseCompleted}\n onChange={(v) => {\n const newEvents = { ...events, phaseCompleted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Waiting approval\"\n id=\"notif-event-waitingApproval\"\n testId=\"switch-event-waitingApproval\"\n checked={events.waitingApproval}\n onChange={(v) => {\n const newEvents = { ...events, waitingApproval: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Agent completed\"\n id=\"notif-event-agentCompleted\"\n testId=\"switch-event-agentCompleted\"\n checked={events.agentCompleted}\n onChange={(v) => {\n const newEvents = { ...events, agentCompleted: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Agent failed\"\n id=\"notif-event-agentFailed\"\n testId=\"switch-event-agentFailed\"\n checked={events.agentFailed}\n onChange={(v) => {\n const newEvents = { ...events, agentFailed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n\n <SubsectionLabel>Pull Request Events</SubsectionLabel>\n <SwitchRow\n label=\"PR merged\"\n id=\"notif-event-prMerged\"\n testId=\"switch-event-prMerged\"\n checked={events.prMerged}\n onChange={(v) => {\n const newEvents = { ...events, prMerged: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR closed\"\n id=\"notif-event-prClosed\"\n testId=\"switch-event-prClosed\"\n checked={events.prClosed}\n onChange={(v) => {\n const newEvents = { ...events, prClosed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR checks passed\"\n id=\"notif-event-prChecksPassed\"\n testId=\"switch-event-prChecksPassed\"\n checked={events.prChecksPassed}\n onChange={(v) => {\n const newEvents = { ...events, prChecksPassed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR checks failed\"\n id=\"notif-event-prChecksFailed\"\n testId=\"switch-event-prChecksFailed\"\n checked={events.prChecksFailed}\n onChange={(v) => {\n const newEvents = { ...events, prChecksFailed: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"PR blocked\"\n id=\"notif-event-prBlocked\"\n testId=\"switch-event-prBlocked\"\n checked={events.prBlocked}\n onChange={(v) => {\n const newEvents = { ...events, prBlocked: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n <SwitchRow\n label=\"Merge review ready\"\n id=\"notif-event-mergeReviewReady\"\n testId=\"switch-event-mergeReviewReady\"\n checked={events.mergeReviewReady}\n onChange={(v) => {\n const newEvents = { ...events, mergeReviewReady: v };\n setEvents(newEvents);\n save(buildNotificationPayload({ events: newEvents }));\n }}\n />\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Notification system',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/021-agent-notifications/spec.yaml',\n },\n ]}\n >\n In-app toast notifications keep you in the loop. Fine-tune which agent lifecycle events\n trigger a notification.\n </SectionHint>\n </div>\n\n {/* ── Feature Flags ── */}\n <div\n id=\"section-feature-flags\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Flag}\n title=\"Feature Flags\"\n description=\"Enable or disable experimental features\"\n badge=\"Experimental\"\n testId=\"feature-flags-settings-section\"\n >\n <SwitchRow\n label=\"Skills\"\n description=\"Enable the skills system for agent capabilities\"\n id=\"flag-skills\"\n testId=\"switch-flag-skills\"\n checked={flags.skills}\n onChange={(v) => {\n const newFlags = { ...flags, skills: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Deployments\"\n description=\"Enable environment deployment workflows\"\n id=\"flag-envDeploy\"\n testId=\"switch-flag-envDeploy\"\n checked={flags.envDeploy}\n onChange={(v) => {\n const newFlags = { ...flags, envDeploy: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Debug\"\n description=\"Show debug panels and verbose logging\"\n id=\"flag-debug\"\n testId=\"switch-flag-debug\"\n checked={flags.debug}\n onChange={(v) => {\n const newFlags = { ...flags, debug: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"GitHub Import\"\n description=\"Enable GitHub repository import in the web UI\"\n id=\"flag-githubImport\"\n testId=\"switch-flag-githubImport\"\n checked={flags.githubImport}\n onChange={(v) => {\n const newFlags = { ...flags, githubImport: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Adopt Branch\"\n description=\"Import existing branches as tracked features\"\n id=\"flag-adoptBranch\"\n testId=\"switch-flag-adoptBranch\"\n checked={flags.adoptBranch}\n onChange={(v) => {\n const newFlags = { ...flags, adoptBranch: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"Git Rebase & Sync\"\n description=\"Enable git rebase-on-main and sync-main operations\"\n id=\"flag-gitRebaseSync\"\n testId=\"switch-flag-gitRebaseSync\"\n checked={flags.gitRebaseSync}\n onChange={(v) => {\n const newFlags = { ...flags, gitRebaseSync: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n <SwitchRow\n label=\"React File Manager\"\n description=\"Use the built-in React file manager instead of the native OS folder picker\"\n id=\"flag-reactFileManager\"\n testId=\"switch-flag-reactFileManager\"\n checked={flags.reactFileManager}\n onChange={(v) => {\n const newFlags = { ...flags, reactFileManager: v };\n setFlags(newFlags);\n save({ featureFlags: newFlags });\n }}\n />\n </SettingsSection>\n <SectionHint>\n Experimental features that are still under development. Enable at your own risk — they\n may change or be removed in future versions. Debug mode adds verbose logging useful for\n troubleshooting.\n </SectionHint>\n </div>\n\n {/* ── Database ── */}\n <div\n id=\"section-database\"\n className=\"grid scroll-mt-18 grid-cols-1 gap-x-5 rounded-lg lg:grid-cols-[1fr_280px]\"\n >\n <SettingsSection\n icon={Database}\n title=\"Database\"\n description=\"Local storage information\"\n testId=\"database-settings-section\"\n >\n <SettingsRow label=\"Location\" description=\"Path to the local SQLite database\">\n <span\n className=\"text-muted-foreground max-w-50 truncate font-mono text-xs\"\n data-testid=\"shep-home-path\"\n >\n {shepHome}\n </span>\n </SettingsRow>\n <SettingsRow label=\"Size\">\n <span className=\"text-muted-foreground text-xs\" data-testid=\"db-file-size\">\n {dbFileSize}\n </span>\n </SettingsRow>\n </SettingsSection>\n <SectionHint\n links={[\n {\n label: 'Settings service',\n href: 'https://github.com/shep-ai/cli/blob/main/docs/architecture/settings-service.md',\n },\n {\n label: 'Settings spec',\n href: 'https://github.com/shep-ai/cli/blob/main/specs/005-global-settings-service/spec.md',\n },\n ]}\n >\n All settings are stored in a local SQLite database at ~/.shep/data. The database uses a\n singleton record pattern with automatic migrations on startup.\n </SectionHint>\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\n// src/slider.tsx\nimport * as React from \"react\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar PAGE_KEYS = [\"PageUp\", \"PageDown\"];\nvar ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"];\nvar BACK_KEYS = {\n \"from-left\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-right\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowRight\"],\n \"from-bottom\": [\"Home\", \"PageDown\", \"ArrowDown\", \"ArrowLeft\"],\n \"from-top\": [\"Home\", \"PageDown\", \"ArrowUp\", \"ArrowLeft\"]\n};\nvar SLIDER_NAME = \"Slider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);\nvar [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [\n createCollectionScope\n]);\nvar [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);\nvar Slider = React.forwardRef(\n (props, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = \"horizontal\",\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {\n },\n onValueCommit = () => {\n },\n inverted = false,\n form,\n ...sliderProps\n } = props;\n const thumbRefs = React.useRef(/* @__PURE__ */ new Set());\n const valueIndexToChangeRef = React.useRef(0);\n const isHorizontal = orientation === \"horizontal\";\n const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n onChange: (value2) => {\n const thumbs = [...thumbRefs.current];\n thumbs[valueIndexToChangeRef.current]?.focus();\n onValueChange(value2);\n }\n });\n const valuesBeforeSlideStartRef = React.useRef(values);\n function handleSlideStart(value2) {\n const closestIndex = getClosestValueIndex(values, value2);\n updateValues(value2, closestIndex);\n }\n function handleSlideMove(value2) {\n updateValues(value2, valueIndexToChangeRef.current);\n }\n function handleSlideEnd() {\n const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];\n const nextValue = values[valueIndexToChangeRef.current];\n const hasChanged = nextValue !== prevValue;\n if (hasChanged) onValueCommit(values);\n }\n function updateValues(value2, atIndex, { commit } = { commit: false }) {\n const decimalCount = getDecimalCount(step);\n const snapToStep = roundValue(Math.round((value2 - min) / step) * step + min, decimalCount);\n const nextValue = clamp(snapToStep, [min, max]);\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue);\n const hasChanged = String(nextValues) !== String(prevValues);\n if (hasChanged && commit) onValueCommit(nextValues);\n return hasChanged ? nextValues : prevValues;\n } else {\n return prevValues;\n }\n });\n }\n return /* @__PURE__ */ jsx(\n SliderProvider,\n {\n scope: props.__scopeSlider,\n name,\n disabled,\n min,\n max,\n valueIndexToChangeRef,\n thumbs: thumbRefs.current,\n values,\n orientation,\n form,\n children: /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(\n SliderOrientation,\n {\n \"aria-disabled\": disabled,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...sliderProps,\n ref: forwardedRef,\n onPointerDown: composeEventHandlers(sliderProps.onPointerDown, () => {\n if (!disabled) valuesBeforeSlideStartRef.current = values;\n }),\n min,\n max,\n inverted,\n onSlideStart: disabled ? void 0 : handleSlideStart,\n onSlideMove: disabled ? void 0 : handleSlideMove,\n onSlideEnd: disabled ? void 0 : handleSlideEnd,\n onHomeKeyDown: () => !disabled && updateValues(min, 0, { commit: true }),\n onEndKeyDown: () => !disabled && updateValues(max, values.length - 1, { commit: true }),\n onStepKeyDown: ({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key);\n const isSkipKey = isPageKey || event.shiftKey && ARROW_KEYS.includes(event.key);\n const multiplier = isSkipKey ? 10 : 1;\n const atIndex = valueIndexToChangeRef.current;\n const value2 = values[atIndex];\n const stepInDirection = step * multiplier * stepDirection;\n updateValues(value2 + stepInDirection, atIndex, { commit: true });\n }\n }\n }\n ) }) })\n }\n );\n }\n);\nSlider.displayName = SLIDER_NAME;\nvar [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext(SLIDER_NAME, {\n startEdge: \"left\",\n endEdge: \"right\",\n size: \"width\",\n direction: 1\n});\nvar SliderHorizontal = React.forwardRef(\n (props, forwardedRef) => {\n const {\n min,\n max,\n dir,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const [slider, setSlider] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setSlider(node));\n const rectRef = React.useRef(void 0);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === \"ltr\";\n const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;\n function getValueFromPointer(pointerPosition) {\n const rect = rectRef.current || slider.getBoundingClientRect();\n const input = [0, rect.width];\n const output = isSlidingFromLeft ? [min, max] : [max, min];\n const value = linearScale(input, output);\n rectRef.current = rect;\n return value(pointerPosition - rect.left);\n }\n return /* @__PURE__ */ jsx(\n SliderOrientationProvider,\n {\n scope: props.__scopeSlider,\n startEdge: isSlidingFromLeft ? \"left\" : \"right\",\n endEdge: isSlidingFromLeft ? \"right\" : \"left\",\n direction: isSlidingFromLeft ? 1 : -1,\n size: \"width\",\n children: /* @__PURE__ */ jsx(\n SliderImpl,\n {\n dir: direction,\n \"data-orientation\": \"horizontal\",\n ...sliderProps,\n ref: composedRefs,\n style: {\n ...sliderProps.style,\n [\"--radix-slider-thumb-transform\"]: \"translateX(-50%)\"\n },\n onSlideStart: (event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideStart?.(value);\n },\n onSlideMove: (event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideMove?.(value);\n },\n onSlideEnd: () => {\n rectRef.current = void 0;\n onSlideEnd?.();\n },\n onStepKeyDown: (event) => {\n const slideDirection = isSlidingFromLeft ? \"from-left\" : \"from-right\";\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }\n }\n )\n }\n );\n }\n);\nvar SliderVertical = React.forwardRef(\n (props, forwardedRef) => {\n const {\n min,\n max,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const sliderRef = React.useRef(null);\n const ref = useComposedRefs(forwardedRef, sliderRef);\n const rectRef = React.useRef(void 0);\n const isSlidingFromBottom = !inverted;\n function getValueFromPointer(pointerPosition) {\n const rect = rectRef.current || sliderRef.current.getBoundingClientRect();\n const input = [0, rect.height];\n const output = isSlidingFromBottom ? [max, min] : [min, max];\n const value = linearScale(input, output);\n rectRef.current = rect;\n return value(pointerPosition - rect.top);\n }\n return /* @__PURE__ */ jsx(\n SliderOrientationProvider,\n {\n scope: props.__scopeSlider,\n startEdge: isSlidingFromBottom ? \"bottom\" : \"top\",\n endEdge: isSlidingFromBottom ? \"top\" : \"bottom\",\n size: \"height\",\n direction: isSlidingFromBottom ? 1 : -1,\n children: /* @__PURE__ */ jsx(\n SliderImpl,\n {\n \"data-orientation\": \"vertical\",\n ...sliderProps,\n ref,\n style: {\n ...sliderProps.style,\n [\"--radix-slider-thumb-transform\"]: \"translateY(50%)\"\n },\n onSlideStart: (event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideStart?.(value);\n },\n onSlideMove: (event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideMove?.(value);\n },\n onSlideEnd: () => {\n rectRef.current = void 0;\n onSlideEnd?.();\n },\n onStepKeyDown: (event) => {\n const slideDirection = isSlidingFromBottom ? \"from-bottom\" : \"from-top\";\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }\n }\n )\n }\n );\n }\n);\nvar SliderImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSlider,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onHomeKeyDown,\n onEndKeyDown,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const context = useSliderContext(SLIDER_NAME, __scopeSlider);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...sliderProps,\n ref: forwardedRef,\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Home\") {\n onHomeKeyDown(event);\n event.preventDefault();\n } else if (event.key === \"End\") {\n onEndKeyDown(event);\n event.preventDefault();\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event);\n event.preventDefault();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n const target = event.target;\n target.setPointerCapture(event.pointerId);\n event.preventDefault();\n if (context.thumbs.has(target)) {\n target.focus();\n } else {\n onSlideStart(event);\n }\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n onSlideEnd(event);\n }\n })\n }\n );\n }\n);\nvar TRACK_NAME = \"SliderTrack\";\nvar SliderTrack = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props;\n const context = useSliderContext(TRACK_NAME, __scopeSlider);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-disabled\": context.disabled ? \"\" : void 0,\n \"data-orientation\": context.orientation,\n ...trackProps,\n ref: forwardedRef\n }\n );\n }\n);\nSliderTrack.displayName = TRACK_NAME;\nvar RANGE_NAME = \"SliderRange\";\nvar SliderRange = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props;\n const context = useSliderContext(RANGE_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const valuesCount = context.values.length;\n const percentages = context.values.map(\n (value) => convertValueToPercentage(value, context.min, context.max)\n );\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;\n const offsetEnd = 100 - Math.max(...percentages);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-orientation\": context.orientation,\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...rangeProps,\n ref: composedRefs,\n style: {\n ...props.style,\n [orientation.startEdge]: offsetStart + \"%\",\n [orientation.endEdge]: offsetEnd + \"%\"\n }\n }\n );\n }\n);\nSliderRange.displayName = RANGE_NAME;\nvar THUMB_NAME = \"SliderThumb\";\nvar SliderThumb = React.forwardRef(\n (props, forwardedRef) => {\n const getItems = useCollection(props.__scopeSlider);\n const [thumb, setThumb] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const index = React.useMemo(\n () => thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1,\n [getItems, thumb]\n );\n return /* @__PURE__ */ jsx(SliderThumbImpl, { ...props, ref: composedRefs, index });\n }\n);\nvar SliderThumbImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSlider, index, name, ...thumbProps } = props;\n const context = useSliderContext(THUMB_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);\n const [thumb, setThumb] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const isFormControl = thumb ? context.form || !!thumb.closest(\"form\") : true;\n const size = useSize(thumb);\n const value = context.values[index];\n const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);\n const label = getLabel(index, context.values.length);\n const orientationSize = size?.[orientation.size];\n const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb);\n return () => {\n context.thumbs.delete(thumb);\n };\n }\n }, [thumb, context.thumbs]);\n return /* @__PURE__ */ jsxs(\n \"span\",\n {\n style: {\n transform: \"var(--radix-slider-thumb-transform)\",\n position: \"absolute\",\n [orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`\n },\n children: [\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n role: \"slider\",\n \"aria-label\": props[\"aria-label\"] || label,\n \"aria-valuemin\": context.min,\n \"aria-valuenow\": value,\n \"aria-valuemax\": context.max,\n \"aria-orientation\": context.orientation,\n \"data-orientation\": context.orientation,\n \"data-disabled\": context.disabled ? \"\" : void 0,\n tabIndex: context.disabled ? void 0 : 0,\n ...thumbProps,\n ref: composedRefs,\n style: value === void 0 ? { display: \"none\" } : props.style,\n onFocus: composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index;\n })\n }\n ) }),\n isFormControl && /* @__PURE__ */ jsx(\n SliderBubbleInput,\n {\n name: name ?? (context.name ? context.name + (context.values.length > 1 ? \"[]\" : \"\") : void 0),\n form: context.form,\n value\n },\n index\n )\n ]\n }\n );\n }\n);\nSliderThumb.displayName = THUMB_NAME;\nvar BUBBLE_INPUT_NAME = \"RadioBubbleInput\";\nvar SliderBubbleInput = React.forwardRef(\n ({ __scopeSlider, value, ...props }, forwardedRef) => {\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, \"value\");\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"input\", { bubbles: true });\n setValue.call(input, value);\n input.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(\n Primitive.input,\n {\n style: { display: \"none\" },\n ...props,\n ref: composedRefs,\n defaultValue: value\n }\n );\n }\n);\nSliderBubbleInput.displayName = BUBBLE_INPUT_NAME;\nfunction getNextSortedValues(prevValues = [], nextValue, atIndex) {\n const nextValues = [...prevValues];\n nextValues[atIndex] = nextValue;\n return nextValues.sort((a, b) => a - b);\n}\nfunction convertValueToPercentage(value, min, max) {\n const maxSteps = max - min;\n const percentPerStep = 100 / maxSteps;\n const percentage = percentPerStep * (value - min);\n return clamp(percentage, [0, 100]);\n}\nfunction getLabel(index, totalValues) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`;\n } else if (totalValues === 2) {\n return [\"Minimum\", \"Maximum\"][index];\n } else {\n return void 0;\n }\n}\nfunction getClosestValueIndex(values, nextValue) {\n if (values.length === 1) return 0;\n const distances = values.map((value) => Math.abs(value - nextValue));\n const closestDistance = Math.min(...distances);\n return distances.indexOf(closestDistance);\n}\nfunction getThumbInBoundsOffset(width, left, direction) {\n const halfWidth = width / 2;\n const halfPercent = 50;\n const offset = linearScale([0, halfPercent], [0, halfWidth]);\n return (halfWidth - offset(left) * direction) * direction;\n}\nfunction getStepsBetweenValues(values) {\n return values.slice(0, -1).map((value, index) => values[index + 1] - value);\n}\nfunction hasMinStepsBetweenValues(values, minStepsBetweenValues) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values);\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);\n return actualMinStepsBetweenValues >= minStepsBetweenValues;\n }\n return true;\n}\nfunction linearScale(input, output) {\n return (value) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\nfunction getDecimalCount(value) {\n return (String(value).split(\".\")[1] || \"\").length;\n}\nfunction roundValue(value, decimalCount) {\n const rounder = Math.pow(10, decimalCount);\n return Math.round(value * rounder) / rounder;\n}\nvar Root = Slider;\nvar Track = SliderTrack;\nvar Range = SliderRange;\nvar Thumb = SliderThumb;\nexport {\n Range,\n Root,\n Slider,\n SliderRange,\n SliderThumb,\n SliderTrack,\n Thumb,\n Track,\n createSliderScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as React from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),\n [value, defaultValue, min, max]\n );\n\n return (\n <SliderPrimitive.Root\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n 'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n 'bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5'\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className={cn(\n 'bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: _values.length }, (_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={index}\n className=\"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50\"\n />\n ))}\n </SliderPrimitive.Root>\n );\n}\n\nexport { Slider };\n","import type { ComponentType, SVGProps } from 'react';\nimport Image from 'next/image';\nimport { Code, Rocket } from 'lucide-react';\nimport { cn } from '@/lib/utils';\n\ntype IconProps = SVGProps<SVGSVGElement> & { className?: string };\n\n/** Fallback icon for unknown editor types. */\nfunction DefaultEditorIcon(props: IconProps) {\n return <Code className={cn('h-4 w-4', props.className)} {...(props as object)} />;\n}\n\nfunction VsCodeIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/vscode.svg\"\n alt=\"VS Code\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nVsCodeIcon.displayName = 'VsCodeIcon';\n\nfunction CursorEditorIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/agents/cursor.jpeg\"\n alt=\"Cursor\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nCursorEditorIcon.displayName = 'CursorEditorIcon';\n\nfunction WindsurfIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/windsurf.svg\"\n alt=\"Windsurf\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nWindsurfIcon.displayName = 'WindsurfIcon';\n\nfunction ZedIcon({ className }: IconProps) {\n return (\n <Image\n src=\"/icons/editors/zed.svg\"\n alt=\"Zed\"\n width={24}\n height={24}\n className={cn('rounded-sm object-contain', className)}\n />\n );\n}\nZedIcon.displayName = 'ZedIcon';\n\nfunction AntigravityIcon({ className, ...props }: IconProps) {\n return <Rocket className={cn('h-4 w-4', className)} {...(props as object)} />;\n}\nAntigravityIcon.displayName = 'AntigravityIcon';\n\nconst editorTypeIconMap: Record<string, ComponentType<IconProps>> = {\n vscode: VsCodeIcon,\n cursor: CursorEditorIcon,\n windsurf: WindsurfIcon,\n zed: ZedIcon,\n antigravity: AntigravityIcon,\n};\n\n/** Resolve an editor type string to its corresponding icon component. */\nexport function getEditorTypeIcon(editorType?: string): ComponentType<IconProps> {\n if (editorType && editorType in editorTypeIconMap) {\n return editorTypeIconMap[editorType];\n }\n return DefaultEditorIcon;\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm18 15-6-6-6 6', key: '153udz' }]];\n\n/**\n * @component @name ChevronUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/chevron-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronUp = createLucideIcon('chevron-up', __iconNode);\n\nexport default ChevronUp;\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { VISUALLY_HIDDEN_STYLES } from '@radix-ui/react-visually-hidden';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\nconst SELECTION_KEYS = [' ', 'Enter'];\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nconst SELECT_NAME = 'Select';\n\ntype ItemData = { value: string; disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n SelectItemElement,\n ItemData\n>(SELECT_NAME);\n\ntype ScopedProps<P> = P & { __scopeSelect?: Scope };\nconst [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype SelectContextValue = {\n trigger: SelectTriggerElement | null;\n onTriggerChange(node: SelectTriggerElement | null): void;\n valueNode: SelectValueElement | null;\n onValueNodeChange(node: SelectValueElement): void;\n valueNodeHasChildren: boolean;\n onValueNodeHasChildrenChange(hasChildren: boolean): void;\n contentId: string;\n value: string | undefined;\n onValueChange(value: string): void;\n open: boolean;\n required?: boolean;\n onOpenChange(open: boolean): void;\n dir: SelectProps['dir'];\n triggerPointerDownPosRef: React.MutableRefObject<{ x: number; y: number } | null>;\n disabled?: boolean;\n};\n\nconst [SelectProvider, useSelectContext] = createSelectContext<SelectContextValue>(SELECT_NAME);\n\ntype NativeOption = React.ReactElement<React.ComponentProps<'option'>>;\n\ntype SelectNativeOptionsContextValue = {\n onNativeOptionAdd(option: NativeOption): void;\n onNativeOptionRemove(option: NativeOption): void;\n};\nconst [SelectNativeOptionsProvider, useSelectNativeOptionsContext] =\n createSelectContext<SelectNativeOptionsContextValue>(SELECT_NAME);\n\ninterface ControlledClearableSelectProps {\n value: string | undefined;\n defaultValue?: never;\n onValueChange: (value: string | undefined) => void;\n}\n\ninterface ControlledUnclearableSelectProps {\n value: string;\n defaultValue?: never;\n onValueChange: (value: string) => void;\n}\n\ninterface UncontrolledSelectProps {\n value?: never;\n defaultValue?: string;\n onValueChange?: {\n (value: string): void;\n (value: string | undefined): void;\n };\n}\n\ntype SelectControlProps =\n | ControlledClearableSelectProps\n | ControlledUnclearableSelectProps\n | UncontrolledSelectProps;\n\ninterface SelectSharedProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n name?: string;\n autoComplete?: string;\n disabled?: boolean;\n required?: boolean;\n form?: string;\n}\n\n// TODO: Should improve typing somewhat, but this would be a breaking change.\n// Consider using in the next major version (along with some testing to be sure\n// it works as expected and doesn't cause problems)\ntype _FutureSelectProps = SelectSharedProps & SelectControlProps;\n\ntype SelectProps = SelectSharedProps & {\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n};\n\nconst Select: React.FC<SelectProps> = (props: ScopedProps<SelectProps>) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form,\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState<SelectTriggerElement | null>(null);\n const [valueNode, setValueNode] = React.useState<SelectValueElement | null>(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SELECT_NAME,\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange as any,\n caller: SELECT_NAME,\n });\n const triggerPointerDownPosRef = React.useRef<{ x: number; y: number } | null>(null);\n\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = trigger ? form || !!trigger.closest('form') : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(new Set<NativeOption>());\n\n // The native `select` only associates the correct default value if the corresponding\n // `option` is rendered as a child **at the same time** as itself.\n // Because it might take a few renders for our items to gather the information to build\n // the native `option`(s), we generate a key on the `select` to make sure React re-builds it\n // each time the options change.\n const nativeSelectKey = Array.from(nativeOptionsSet)\n .map((option) => option.props.value)\n .join(';');\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <SelectProvider\n required={required}\n scope={__scopeSelect}\n trigger={trigger}\n onTriggerChange={setTrigger}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n valueNodeHasChildren={valueNodeHasChildren}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n contentId={useId()}\n value={value}\n onValueChange={setValue}\n open={open}\n onOpenChange={setOpen}\n dir={direction}\n triggerPointerDownPosRef={triggerPointerDownPosRef}\n disabled={disabled}\n >\n <Collection.Provider scope={__scopeSelect}>\n <SelectNativeOptionsProvider\n scope={props.__scopeSelect}\n onNativeOptionAdd={React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, [])}\n onNativeOptionRemove={React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, [])}\n >\n {children}\n </SelectNativeOptionsProvider>\n </Collection.Provider>\n\n {isFormControl ? (\n <SelectBubbleInput\n key={nativeSelectKey}\n aria-hidden\n required={required}\n tabIndex={-1}\n name={name}\n autoComplete={autoComplete}\n value={value}\n // enable form autofill\n onChange={(event) => setValue(event.target.value)}\n disabled={disabled}\n form={form}\n >\n {value === undefined ? <option value=\"\" /> : null}\n {Array.from(nativeOptionsSet)}\n </SelectBubbleInput>\n ) : null}\n </SelectProvider>\n </PopperPrimitive.Root>\n );\n};\n\nSelect.displayName = SELECT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger';\n\ntype SelectTriggerElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface SelectTriggerProps extends PrimitiveButtonProps {}\n\nconst SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(\n (props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== undefined) {\n context.onValueChange(nextItem.value);\n }\n });\n\n const handleOpen = (pointerEvent?: React.MouseEvent | React.PointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n // reset typeahead when we open\n resetTypeahead();\n }\n\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY),\n };\n }\n };\n\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.button\n type=\"button\"\n role=\"combobox\"\n aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-required={context.required}\n aria-autocomplete=\"none\"\n dir={context.dir}\n data-state={context.open ? 'open' : 'closed'}\n disabled={isDisabled}\n data-disabled={isDisabled ? '' : undefined}\n data-placeholder={shouldShowPlaceholder(context.value) ? '' : undefined}\n {...triggerProps}\n ref={composedRefs}\n // Enable compatibility with native label or custom `Label` \"click\" for Safari:\n onClick={composeEventHandlers(triggerProps.onClick, (event) => {\n // Whilst browsers generally have no issue focusing the trigger when clicking\n // on a label, Safari seems to struggle with the fact that there's no `onClick`.\n // We force `focus` in this case. Note: this doesn't create any other side-effect\n // because we are preventing default in `onPointerDown` so effectively\n // this only runs for a label \"click\"\n event.currentTarget.focus();\n\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') {\n handleOpen(event);\n }\n })}\n onPointerDown={composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n\n // prevent implicit pointer capture\n // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click); also not for touch\n // devices because that would open the menu on scroll. (pen devices behave as touch on iOS).\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === 'mouse') {\n handleOpen(event);\n // prevent trigger from stealing focus from the active item after opening.\n event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== '';\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === ' ') return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })}\n />\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nSelectTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue';\n\ntype SelectValueElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SelectValueProps extends Omit<PrimitiveSpanProps, 'placeholder'> {\n placeholder?: React.ReactNode;\n}\n\nconst SelectValue = React.forwardRef<SelectValueElement, SelectValueProps>(\n (props: ScopedProps<SelectValueProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, children, placeholder = '', ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== undefined;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n\n return (\n <Primitive.span\n {...valueProps}\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n style={{ pointerEvents: 'none' }}\n >\n {shouldShowPlaceholder(context.value) ? <>{placeholder}</> : children}\n </Primitive.span>\n );\n }\n);\n\nSelectValue.displayName = VALUE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nconst ICON_NAME = 'SelectIcon';\n\ntype SelectIconElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectIconProps extends PrimitiveSpanProps {}\n\nconst SelectIcon = React.forwardRef<SelectIconElement, SelectIconProps>(\n (props: ScopedProps<SelectIconProps>, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return (\n <Primitive.span aria-hidden {...iconProps} ref={forwardedRef}>\n {children || '▼'}\n </Primitive.span>\n );\n }\n);\n\nSelectIcon.displayName = ICON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'SelectPortal';\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface SelectPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n}\n\nconst SelectPortal: React.FC<SelectPortalProps> = (props: ScopedProps<SelectPortalProps>) => {\n return <PortalPrimitive asChild {...props} />;\n};\n\nSelectPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent';\n\ntype SelectContentElement = SelectContentImplElement;\ninterface SelectContentProps extends SelectContentImplProps {}\n\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props: ScopedProps<SelectContentProps>, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState<DocumentFragment>();\n\n // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n\n if (!context.open) {\n const frag = fragment as Element | undefined;\n return frag\n ? ReactDOM.createPortal(\n <SelectContentProvider scope={props.__scopeSelect}>\n <Collection.Slot scope={props.__scopeSelect}>\n <div>{props.children}</div>\n </Collection.Slot>\n </SelectContentProvider>,\n frag\n )\n : null;\n }\n\n return <SelectContentImpl {...props} ref={forwardedRef} />;\n }\n);\n\nSelectContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContentImpl\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_MARGIN = 10;\n\ntype SelectContentContextValue = {\n content?: SelectContentElement | null;\n viewport?: SelectViewportElement | null;\n onViewportChange?: (node: SelectViewportElement | null) => void;\n itemRefCallback?: (node: SelectItemElement | null, value: string, disabled: boolean) => void;\n selectedItem?: SelectItemElement | null;\n onItemLeave?: () => void;\n itemTextRefCallback?: (\n node: SelectItemTextElement | null,\n value: string,\n disabled: boolean\n ) => void;\n focusSelectedItem?: () => void;\n selectedItemText?: SelectItemTextElement | null;\n position?: SelectContentProps['position'];\n isPositioned?: boolean;\n searchRef?: React.RefObject<string>;\n};\n\nconst [SelectContentProvider, useSelectContentContext] =\n createSelectContext<SelectContentContextValue>(CONTENT_NAME);\n\nconst CONTENT_IMPL_NAME = 'SelectContentImpl';\n\ntype SelectContentImplElement = SelectPopperPositionElement | SelectItemAlignedPositionElement;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\n\ntype SelectPopperPrivateProps = { onPlaced?: PopperContentProps['onPlaced'] };\n\ninterface SelectContentImplProps\n extends Omit<SelectPopperPositionProps, keyof SelectPopperPrivateProps>,\n Omit<SelectItemAlignedPositionProps, keyof SelectPopperPrivateProps> {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n\n position?: 'item-aligned' | 'popper';\n}\n\nconst Slot = createSlot('SelectContent.RemoveScroll');\n\nconst SelectContentImpl = React.forwardRef<SelectContentImplElement, SelectContentImplProps>(\n (props: ScopedProps<SelectContentImplProps>, forwardedRef) => {\n const {\n __scopeSelect,\n position = 'item-aligned',\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState<SelectContentImplElement | null>(null);\n const [viewport, setViewport] = React.useState<SelectViewportElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState<SelectItemElement | null>(null);\n const [selectedItemText, setSelectedItemText] = React.useState<SelectItemTextElement | null>(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n\n // Make sure the whole tree has focus guards as our `Select` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const focusFirst = React.useCallback(\n (candidates: Array<HTMLElement | null>) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: 'nearest' });\n // viewport might have padding so scroll to its edges when focusing first/last items.\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n\n // Since this is not dependent on layout, we want to ensure this runs at the same time as\n // other effects across components. Hence why we don't call `focusSelectedItem` inside `position`.\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n\n // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`\n // and close on `pointerup` outside.\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n\n const handlePointerMove = (event: PointerEvent) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)),\n };\n };\n const handlePointerUp = (event: PointerEvent) => {\n // If the pointer hasn't moved by a certain threshold then we prevent selecting item on `pointerup`.\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n // otherwise, if the event was outside the content, close.\n if (!content.contains(event.target as HTMLElement)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener('pointermove', handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener('pointermove', handlePointerMove);\n document.addEventListener('pointerup', handlePointerUp, { capture: true, once: true });\n }\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n document.removeEventListener('pointerup', handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener('blur', close);\n window.addEventListener('resize', close);\n return () => {\n window.removeEventListener('blur', close);\n window.removeEventListener('resize', close);\n };\n }, [onOpenChange]);\n\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (nextItem.ref.current as HTMLElement).focus());\n }\n });\n\n const itemRefCallback = React.useCallback(\n (node: SelectItemElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node: SelectItemTextElement | null, value: string, disabled: boolean) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== undefined && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n\n const SelectPosition = position === 'popper' ? SelectPopperPosition : SelectItemAlignedPosition;\n\n // Silently ignore props that are not supported by `SelectItemAlignedPosition`\n const popperContentProps =\n SelectPosition === SelectPopperPosition\n ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n }\n : {};\n\n return (\n <SelectContentProvider\n scope={__scopeSelect}\n content={content}\n viewport={viewport}\n onViewportChange={setViewport}\n itemRefCallback={itemRefCallback}\n selectedItem={selectedItem}\n onItemLeave={handleItemLeave}\n itemTextRefCallback={itemTextRefCallback}\n focusSelectedItem={focusSelectedItem}\n selectedItemText={selectedItemText}\n position={position}\n isPositioned={isPositioned}\n searchRef={searchRef}\n >\n <RemoveScroll as={Slot} allowPinchZoom>\n <FocusScope\n asChild\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n trapped={context.open}\n onMountAutoFocus={(event) => {\n // we prevent open autofocus because we manually focus the selected item\n event.preventDefault();\n }}\n onUnmountAutoFocus={composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n })}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n // When focus is trapped, a focusout event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={() => context.onOpenChange(false)}\n >\n <SelectPosition\n role=\"listbox\"\n id={context.contentId}\n data-state={context.open ? 'open' : 'closed'}\n dir={context.dir}\n onContextMenu={(event) => event.preventDefault()}\n {...contentProps}\n {...popperContentProps}\n onPlaced={() => setIsPositioned(true)}\n ref={composedRefs}\n style={{\n // flex layout so we can place the scroll buttons properly\n display: 'flex',\n flexDirection: 'column',\n // reset the outline by default as the content MAY get focused\n outline: 'none',\n ...contentProps.style,\n }}\n onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n\n // select should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n\n if (['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (['ArrowUp', 'End'].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if (['ArrowUp', 'ArrowDown'].includes(event.key)) {\n const currentElement = event.target as SelectItemElement;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n\n event.preventDefault();\n }\n })}\n />\n </DismissableLayer>\n </FocusScope>\n </RemoveScroll>\n </SelectContentProvider>\n );\n }\n);\n\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemAlignedPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_ALIGNED_POSITION_NAME = 'SelectItemAlignedPosition';\n\ntype SelectItemAlignedPositionElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectItemAlignedPositionProps extends PrimitiveDivProps, SelectPopperPrivateProps {}\n\nconst SelectItemAlignedPosition = React.forwardRef<\n SelectItemAlignedPositionElement,\n SelectItemAlignedPositionProps\n>((props: ScopedProps<SelectItemAlignedPositionProps>, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState<HTMLDivElement | null>(null);\n const [content, setContent] = React.useState<SelectItemAlignedPositionElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (\n context.trigger &&\n context.valueNode &&\n contentWrapper &&\n content &&\n viewport &&\n selectedItem &&\n selectedItemText\n ) {\n const triggerRect = context.trigger.getBoundingClientRect();\n\n // -----------------------------------------------------------------------------------------\n // Horizontal positioning\n // -----------------------------------------------------------------------------------------\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n\n if (context.dir !== 'rtl') {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.left = clampedLeft + 'px';\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth),\n ]);\n\n contentWrapper.style.minWidth = minContentWidth + 'px';\n contentWrapper.style.right = clampedRight + 'px';\n }\n\n // -----------------------------------------------------------------------------------------\n // Vertical positioning\n // -----------------------------------------------------------------------------------------\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n\n if (willAlignWithoutTopOverflow) {\n const isLastItem =\n items.length > 0 && selectedItem === items[items.length - 1]!.ref.current;\n contentWrapper.style.bottom = 0 + 'px';\n const viewportOffsetBottom =\n content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight +\n // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) +\n viewportOffsetBottom +\n contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + 'px';\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0]!.ref.current;\n contentWrapper.style.top = 0 + 'px';\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth +\n viewport.offsetTop +\n // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) +\n selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + 'px';\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + 'px';\n contentWrapper.style.maxHeight = availableHeight + 'px';\n // -----------------------------------------------------------------------------------------\n\n onPlaced?.();\n\n // we don't want the initial scroll position adjustment to trigger \"expand on scroll\"\n // so we explicitly turn it on only after they've registered.\n requestAnimationFrame(() => (shouldExpandOnScrollRef.current = true));\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced,\n ]);\n\n useLayoutEffect(() => position(), [position]);\n\n // copy z-index from content to wrapper\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n // When the viewport becomes scrollable at the top, the scroll up button will mount.\n // Because it is part of the normal flow, it will push down the viewport, thus throwing our\n // trigger => selectedItem alignment off by the amount the viewport was pushed down.\n // We wait for this to happen and then re-run the positining logic one more time to account for it.\n const handleScrollButtonChange = React.useCallback(\n (node: SelectScrollButtonImplElement | null) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n\n return (\n <SelectViewportProvider\n scope={__scopeSelect}\n contentWrapper={contentWrapper}\n shouldExpandOnScrollRef={shouldExpandOnScrollRef}\n onScrollButtonChange={handleScrollButtonChange}\n >\n <div\n ref={setContentWrapper}\n style={{\n display: 'flex',\n flexDirection: 'column',\n position: 'fixed',\n zIndex: contentZIndex,\n }}\n >\n <Primitive.div\n {...popperProps}\n ref={composedRefs}\n style={{\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: 'border-box',\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: '100%',\n ...popperProps.style,\n }}\n />\n </div>\n </SelectViewportProvider>\n );\n});\n\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectPopperPosition\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_POSITION_NAME = 'SelectPopperPosition';\n\ntype SelectPopperPositionElement = React.ComponentRef<typeof PopperPrimitive.Content>;\ntype PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface SelectPopperPositionProps extends PopperContentProps, SelectPopperPrivateProps {}\n\nconst SelectPopperPosition = React.forwardRef<\n SelectPopperPositionElement,\n SelectPopperPositionProps\n>((props: ScopedProps<SelectPopperPositionProps>, forwardedRef) => {\n const {\n __scopeSelect,\n align = 'start',\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n\n return (\n <PopperPrimitive.Content\n {...popperScope}\n {...popperProps}\n ref={forwardedRef}\n align={align}\n collisionPadding={collisionPadding}\n style={{\n // Ensure border-box for floating-ui calculations\n boxSizing: 'border-box',\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-select-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-select-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-select-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n});\n\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectViewport\n * -----------------------------------------------------------------------------------------------*/\n\ntype SelectViewportContextValue = {\n contentWrapper?: HTMLDivElement | null;\n shouldExpandOnScrollRef?: React.RefObject<boolean>;\n onScrollButtonChange?: (node: SelectScrollButtonImplElement | null) => void;\n};\n\nconst [SelectViewportProvider, useSelectViewportContext] =\n createSelectContext<SelectViewportContextValue>(CONTENT_NAME, {});\n\nconst VIEWPORT_NAME = 'SelectViewport';\n\ntype SelectViewportElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SelectViewportProps extends PrimitiveDivProps {\n nonce?: string;\n}\n\nconst SelectViewport = React.forwardRef<SelectViewportElement, SelectViewportProps>(\n (props: ScopedProps<SelectViewportProps>, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return (\n <>\n {/* Hide scrollbars cross-browser and enable momentum scroll for touch devices */}\n <style\n dangerouslySetInnerHTML={{\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`,\n }}\n nonce={nonce}\n />\n <Collection.Slot scope={__scopeSelect}>\n <Primitive.div\n data-radix-select-viewport=\"\"\n role=\"presentation\"\n {...viewportProps}\n ref={composedRefs}\n style={{\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: 'relative',\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: 'hidden auto',\n ...viewportProps.style,\n }}\n onScroll={composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n\n contentWrapper.style.height = clampedNextHeight + 'px';\n if (contentWrapper.style.bottom === '0px') {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n // ensure the content stays pinned to the bottom\n contentWrapper.style.justifyContent = 'flex-end';\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })}\n />\n </Collection.Slot>\n </>\n );\n }\n);\n\nSelectViewport.displayName = VIEWPORT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup';\n\ntype SelectGroupContextValue = { id: string };\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME);\n\ntype SelectGroupElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectGroupProps extends PrimitiveDivProps {}\n\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId}>\n <Primitive.div role=\"group\" aria-labelledby={groupId} {...groupProps} ref={forwardedRef} />\n </SelectGroupContextProvider>\n );\n }\n);\n\nSelectGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel';\n\ntype SelectLabelElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectLabelProps extends PrimitiveDivProps {}\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return <Primitive.div id={groupContext.id} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nSelectLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem';\n\ntype SelectItemContextValue = {\n value: string;\n disabled: boolean;\n textId: string;\n isSelected: boolean;\n onItemTextChange(node: SelectItemTextElement | null): void;\n};\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME);\n\ntype SelectItemElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectItemProps extends PrimitiveDivProps {\n value: string;\n disabled?: boolean;\n textValue?: string;\n}\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? '');\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) =>\n contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef<React.PointerEvent['pointerType']>('touch');\n\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n\n if (value === '') {\n throw new Error(\n 'A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.'\n );\n }\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textId={textId}\n isSelected={isSelected}\n onItemTextChange={React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? '').trim());\n }, [])}\n >\n <Collection.ItemSlot\n scope={__scopeSelect}\n value={value}\n disabled={disabled}\n textValue={textValue}\n >\n <Primitive.div\n role=\"option\"\n aria-labelledby={textId}\n data-highlighted={isFocused ? '' : undefined}\n // `isFocused` caveat fixes stuttering in VoiceOver\n aria-selected={isSelected && isFocused}\n data-state={isSelected ? 'checked' : 'unchecked'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n {...itemProps}\n ref={composedRefs}\n onFocus={composeEventHandlers(itemProps.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(itemProps.onBlur, () => setIsFocused(false))}\n onClick={composeEventHandlers(itemProps.onClick, () => {\n // Open on click when using a touch or pen device\n if (pointerTypeRef.current !== 'mouse') handleSelect();\n })}\n onPointerUp={composeEventHandlers(itemProps.onPointerUp, () => {\n // Using a mouse you should be able to do pointer down, move through\n // the list, and release the pointer over the item to select it.\n if (pointerTypeRef.current === 'mouse') handleSelect();\n })}\n onPointerDown={composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n })}\n onPointerMove={composeEventHandlers(itemProps.onPointerMove, (event) => {\n // Remember pointer type when sliding over to this item from another one\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === 'mouse') {\n // even though safari doesn't support this option, it's acceptable\n // as it only means it might scroll a few pixels when using the pointer.\n event.currentTarget.focus({ preventScroll: true });\n }\n })}\n onPointerLeave={composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n })}\n onKeyDown={composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== '';\n if (isTypingAhead && event.key === ' ') return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n // prevent page scroll if using the space key to select an item\n if (event.key === ' ') event.preventDefault();\n })}\n />\n </Collection.ItemSlot>\n </SelectItemContextProvider>\n );\n }\n);\n\nSelectItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText';\n\ntype SelectItemTextElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectItemTextProps extends PrimitiveSpanProps {}\n\nconst SelectItemText = React.forwardRef<SelectItemTextElement, SelectItemTextProps>(\n (props: ScopedProps<SelectItemTextProps>, forwardedRef) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState<SelectItemTextElement | null>(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => (\n <option key={itemContext.value} value={itemContext.value} disabled={itemContext.disabled}>\n {textContent}\n </option>\n ),\n [itemContext.disabled, itemContext.value, textContent]\n );\n\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n\n return (\n <>\n <Primitive.span id={itemContext.textId} {...itemTextProps} ref={composedRefs} />\n\n {/* Portal the select item text into the trigger value node */}\n {itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode)\n : null}\n </>\n );\n }\n);\n\nSelectItemText.displayName = ITEM_TEXT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator';\n\ntype SelectItemIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ninterface SelectItemIndicatorProps extends PrimitiveSpanProps {}\n\nconst SelectItemIndicator = React.forwardRef<SelectItemIndicatorElement, SelectItemIndicatorProps>(\n (props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? (\n <Primitive.span aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollUpButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';\n\ntype SelectScrollUpButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollUpButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {}\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>((props: ScopedProps<SelectScrollUpButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const canScrollUp = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollUp ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectScrollDownButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';\n\ntype SelectScrollDownButtonElement = SelectScrollButtonImplElement;\ninterface SelectScrollDownButtonProps extends Omit<SelectScrollButtonImplProps, 'onAutoScroll'> {}\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>((props: ScopedProps<SelectScrollDownButtonProps>, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n const viewport = contentContext.viewport;\n function handleScroll() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n // we use Math.ceil here because if the UI is zoomed-in\n // `scrollTop` is not always reported as an integer\n const canScrollDown = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown);\n }\n handleScroll();\n viewport.addEventListener('scroll', handleScroll);\n return () => viewport.removeEventListener('scroll', handleScroll);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n\n return canScrollDown ? (\n <SelectScrollButtonImpl\n {...props}\n ref={composedRefs}\n onAutoScroll={() => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }}\n />\n ) : null;\n});\n\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\n\ntype SelectScrollButtonImplElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectScrollButtonImplProps extends PrimitiveDivProps {\n onAutoScroll(): void;\n}\n\nconst SelectScrollButtonImpl = React.forwardRef<\n SelectScrollButtonImplElement,\n SelectScrollButtonImplProps\n>((props: ScopedProps<SelectScrollButtonImplProps>, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext('SelectScrollButton', __scopeSelect);\n const autoScrollTimerRef = React.useRef<number | null>(null);\n const getItems = useCollection(__scopeSelect);\n\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n\n // When the viewport becomes scrollable on either side, the relevant scroll button will mount.\n // Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)\n // the viewport, potentially causing the active item to now be partially out of view.\n // We re-run the `scrollIntoView` logic to make sure it stays within the viewport.\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: 'nearest' });\n }, [getItems]);\n\n return (\n <Primitive.div\n aria-hidden\n {...scrollIndicatorProps}\n ref={forwardedRef}\n style={{ flexShrink: 0, ...scrollIndicatorProps.style }}\n onPointerDown={composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerMove={composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n })}\n onPointerLeave={composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })}\n />\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'SelectSeparator';\n\ntype SelectSeparatorElement = React.ComponentRef<typeof Primitive.div>;\ninterface SelectSeparatorProps extends PrimitiveDivProps {}\n\nconst SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n (props: ScopedProps<SelectSeparatorProps>, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return <Primitive.div aria-hidden {...separatorProps} ref={forwardedRef} />;\n }\n);\n\nSelectSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'SelectArrow';\n\ntype SelectArrowElement = React.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface SelectArrowProps extends PopperArrowProps {}\n\nconst SelectArrow = React.forwardRef<SelectArrowElement, SelectArrowProps>(\n (props: ScopedProps<SelectArrowProps>, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === 'popper' ? (\n <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n ) : null;\n }\n);\n\nSelectArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SelectBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'SelectBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.select>;\ninterface SwitchBubbleInputProps extends InputProps {}\n\nconst SelectBubbleInput = React.forwardRef<HTMLSelectElement, SwitchBubbleInputProps>(\n ({ __scopeSelect, value, ...props }: ScopedProps<SwitchBubbleInputProps>, forwardedRef) => {\n const ref = React.useRef<HTMLSelectElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const select = ref.current;\n if (!select) return;\n\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n 'value'\n ) as PropertyDescriptor;\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event('change', { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n\n /**\n * We purposefully use a `select` here to support form autofill as much as\n * possible.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programmatically and bubble to any parent form `onChange`\n * event. Adding the `value` will cause React to consider the programmatic\n * dispatch a duplicate and it will get swallowed.\n *\n * We use visually hidden styles rather than `display: \"none\"` because\n * Safari autofill won't work otherwise.\n */\n return (\n <Primitive.select\n {...props}\n style={{ ...VISUALLY_HIDDEN_STYLES, ...props.style }}\n ref={composedRefs}\n defaultValue={value}\n />\n );\n }\n);\n\nSelectBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction shouldShowPlaceholder(value?: string) {\n return value === '' || value === undefined;\n}\n\nfunction useTypeaheadSearch(onSearchChange: (search: string) => void) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef('');\n const timerRef = React.useRef(0);\n\n const handleTypeaheadSearch = React.useCallback(\n (key: string) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n // Reset `searchRef` 1 second after it was last updated\n if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n })(search);\n },\n [handleSearchChange]\n );\n\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = '';\n window.clearTimeout(timerRef.current);\n }, []);\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n return [searchRef, handleTypeaheadSearch, resetTypeahead] as const;\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in a list of items,\n * the search and the current item, and returns the next item (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through items starting with that character)\n *\n * We also reorder the items by wrapping the array around the current item.\n * This is so we always look forward from the current item, and picking the first\n * item will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current item from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current item still matches.\n */\nfunction findNextItem<T extends { textValue: string }>(\n items: T[],\n search: string,\n currentItem?: T\n) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0]! : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find((item) =>\n item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : undefined;\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map<T>((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = Select;\nconst Trigger = SelectTrigger;\nconst Value = SelectValue;\nconst Icon = SelectIcon;\nconst Portal = SelectPortal;\nconst Content = SelectContent;\nconst Viewport = SelectViewport;\nconst Group = SelectGroup;\nconst Label = SelectLabel;\nconst Item = SelectItem;\nconst ItemText = SelectItemText;\nconst ItemIndicator = SelectItemIndicator;\nconst ScrollUpButton = SelectScrollUpButton;\nconst ScrollDownButton = SelectScrollDownButton;\nconst Separator = SelectSeparator;\nconst Arrow = SelectArrow;\n\nexport {\n createSelectScope,\n //\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPortal,\n SelectContent,\n SelectViewport,\n SelectGroup,\n SelectLabel,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n SelectSeparator,\n SelectArrow,\n //\n Root,\n Trigger,\n Value,\n Icon,\n Portal,\n Content,\n Viewport,\n Group,\n Label,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpButton,\n ScrollDownButton,\n Separator,\n Arrow,\n};\nexport type {\n SelectProps,\n SelectTriggerProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectViewportProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectSeparatorProps,\n SelectArrowProps,\n};\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0', key: 'vwvbt9' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n key: '11g9vi',\n },\n ],\n];\n\n/**\n * @component @name Bell\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/bell\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Bell = createLucideIcon('bell', __iconNode);\n\nexport default Bell;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 8V4H8', key: 'hb8ula' }],\n ['rect', { width: '16', height: '12', x: '4', y: '8', rx: '2', key: 'enze0r' }],\n ['path', { d: 'M2 14h2', key: 'vft8re' }],\n ['path', { d: 'M20 14h2', key: '4cs60a' }],\n ['path', { d: 'M15 13v2', key: '1xurst' }],\n ['path', { d: 'M9 13v2', key: 'rq6x2g' }],\n];\n\n/**\n * @component @name Bot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/bot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Bot = createLucideIcon('bot', __iconNode);\n\nexport default Bot;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M14 17H5', key: 'gfn3mx' }],\n ['path', { d: 'M19 7h-9', key: '6i9tg' }],\n ['circle', { cx: '17', cy: '17', r: '3', key: '18b49y' }],\n ['circle', { cx: '7', cy: '7', r: '3', key: 'dfmy0x' }],\n];\n\n/**\n * @component @name Settings2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/settings-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Settings2 = createLucideIcon('settings-2', __iconNode);\n\nexport default Settings2;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['ellipse', { cx: '12', cy: '5', rx: '9', ry: '3', key: 'msslwz' }],\n ['path', { d: 'M3 5V19A9 3 0 0 0 21 19V5', key: '1wlel7' }],\n ['path', { d: 'M3 12A9 3 0 0 0 21 12', key: 'mv7ke4' }],\n];\n\n/**\n * @component @name Database\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/database\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Database = createLucideIcon('database', __iconNode);\n\nexport default Database;\n","import * as React from 'react';\nimport { clamp } from '@radix-ui/number';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { usePrevious } from '@radix-ui/react-use-previous';\nimport { useSize } from '@radix-ui/react-use-size';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { createCollection } from '@radix-ui/react-collection';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst PAGE_KEYS = ['PageUp', 'PageDown'];\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\ntype SlideDirection = 'from-left' | 'from-right' | 'from-bottom' | 'from-top';\nconst BACK_KEYS: Record<SlideDirection, string[]> = {\n 'from-left': ['Home', 'PageDown', 'ArrowDown', 'ArrowLeft'],\n 'from-right': ['Home', 'PageDown', 'ArrowDown', 'ArrowRight'],\n 'from-bottom': ['Home', 'PageDown', 'ArrowDown', 'ArrowLeft'],\n 'from-top': ['Home', 'PageDown', 'ArrowUp', 'ArrowLeft'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Slider\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLIDER_NAME = 'Slider';\n\nconst [Collection, useCollection, createCollectionScope] =\n createCollection<SliderThumbElement>(SLIDER_NAME);\n\ntype ScopedProps<P> = P & { __scopeSlider?: Scope };\nconst [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [\n createCollectionScope,\n]);\n\ntype SliderContextValue = {\n name: string | undefined;\n disabled: boolean | undefined;\n min: number;\n max: number;\n values: number[];\n valueIndexToChangeRef: React.MutableRefObject<number>;\n thumbs: Set<SliderThumbElement>;\n orientation: SliderProps['orientation'];\n form: string | undefined;\n};\n\nconst [SliderProvider, useSliderContext] = createSliderContext<SliderContextValue>(SLIDER_NAME);\n\ntype SliderElement = SliderHorizontalElement | SliderVerticalElement;\ninterface SliderProps\n extends Omit<\n SliderHorizontalProps | SliderVerticalProps,\n keyof SliderOrientationPrivateProps | 'defaultValue'\n > {\n name?: string;\n disabled?: boolean;\n orientation?: React.AriaAttributes['aria-orientation'];\n dir?: Direction;\n min?: number;\n max?: number;\n step?: number;\n minStepsBetweenThumbs?: number;\n value?: number[];\n defaultValue?: number[];\n onValueChange?(value: number[]): void;\n onValueCommit?(value: number[]): void;\n inverted?: boolean;\n form?: string;\n}\n\nconst Slider = React.forwardRef<SliderElement, SliderProps>(\n (props: ScopedProps<SliderProps>, forwardedRef) => {\n const {\n name,\n min = 0,\n max = 100,\n step = 1,\n orientation = 'horizontal',\n disabled = false,\n minStepsBetweenThumbs = 0,\n defaultValue = [min],\n value,\n onValueChange = () => {},\n onValueCommit = () => {},\n inverted = false,\n form,\n ...sliderProps\n } = props;\n const thumbRefs = React.useRef<SliderContextValue['thumbs']>(new Set());\n const valueIndexToChangeRef = React.useRef<number>(0);\n const isHorizontal = orientation === 'horizontal';\n const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;\n\n const [values = [], setValues] = useControllableState({\n prop: value,\n defaultProp: defaultValue,\n onChange: (value) => {\n const thumbs = [...thumbRefs.current];\n thumbs[valueIndexToChangeRef.current]?.focus();\n onValueChange(value);\n },\n });\n const valuesBeforeSlideStartRef = React.useRef(values);\n\n function handleSlideStart(value: number) {\n const closestIndex = getClosestValueIndex(values, value);\n updateValues(value, closestIndex);\n }\n\n function handleSlideMove(value: number) {\n updateValues(value, valueIndexToChangeRef.current);\n }\n\n function handleSlideEnd() {\n const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];\n const nextValue = values[valueIndexToChangeRef.current];\n const hasChanged = nextValue !== prevValue;\n if (hasChanged) onValueCommit(values);\n }\n\n function updateValues(value: number, atIndex: number, { commit } = { commit: false }) {\n const decimalCount = getDecimalCount(step);\n const snapToStep = roundValue(Math.round((value - min) / step) * step + min, decimalCount);\n const nextValue = clamp(snapToStep, [min, max]);\n\n setValues((prevValues = []) => {\n const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);\n if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {\n valueIndexToChangeRef.current = nextValues.indexOf(nextValue);\n const hasChanged = String(nextValues) !== String(prevValues);\n if (hasChanged && commit) onValueCommit(nextValues);\n return hasChanged ? nextValues : prevValues;\n } else {\n return prevValues;\n }\n });\n }\n\n return (\n <SliderProvider\n scope={props.__scopeSlider}\n name={name}\n disabled={disabled}\n min={min}\n max={max}\n valueIndexToChangeRef={valueIndexToChangeRef}\n thumbs={thumbRefs.current}\n values={values}\n orientation={orientation}\n form={form}\n >\n <Collection.Provider scope={props.__scopeSlider}>\n <Collection.Slot scope={props.__scopeSlider}>\n <SliderOrientation\n aria-disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...sliderProps}\n ref={forwardedRef}\n onPointerDown={composeEventHandlers(sliderProps.onPointerDown, () => {\n if (!disabled) valuesBeforeSlideStartRef.current = values;\n })}\n min={min}\n max={max}\n inverted={inverted}\n onSlideStart={disabled ? undefined : handleSlideStart}\n onSlideMove={disabled ? undefined : handleSlideMove}\n onSlideEnd={disabled ? undefined : handleSlideEnd}\n onHomeKeyDown={() => !disabled && updateValues(min, 0, { commit: true })}\n onEndKeyDown={() =>\n !disabled && updateValues(max, values.length - 1, { commit: true })\n }\n onStepKeyDown={({ event, direction: stepDirection }) => {\n if (!disabled) {\n const isPageKey = PAGE_KEYS.includes(event.key);\n const isSkipKey = isPageKey || (event.shiftKey && ARROW_KEYS.includes(event.key));\n const multiplier = isSkipKey ? 10 : 1;\n const atIndex = valueIndexToChangeRef.current;\n const value = values[atIndex]!;\n const stepInDirection = step * multiplier * stepDirection;\n updateValues(value + stepInDirection, atIndex, { commit: true });\n }\n }}\n />\n </Collection.Slot>\n </Collection.Provider>\n </SliderProvider>\n );\n }\n);\n\nSlider.displayName = SLIDER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderHorizontal\n * -----------------------------------------------------------------------------------------------*/\n\ntype Side = 'top' | 'right' | 'bottom' | 'left';\n\nconst [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext<{\n startEdge: Side;\n endEdge: Side;\n size: keyof NonNullable<ReturnType<typeof useSize>>;\n direction: number;\n}>(SLIDER_NAME, {\n startEdge: 'left',\n endEdge: 'right',\n size: 'width',\n direction: 1,\n});\n\ntype SliderOrientationPrivateProps = {\n min: number;\n max: number;\n inverted: boolean;\n onSlideStart?(value: number): void;\n onSlideMove?(value: number): void;\n onSlideEnd?(): void;\n onHomeKeyDown(event: React.KeyboardEvent): void;\n onEndKeyDown(event: React.KeyboardEvent): void;\n onStepKeyDown(step: { event: React.KeyboardEvent; direction: number }): void;\n};\ninterface SliderOrientationProps\n extends Omit<SliderImplProps, keyof SliderImplPrivateProps>,\n SliderOrientationPrivateProps {}\n\ntype SliderHorizontalElement = SliderImplElement;\ninterface SliderHorizontalProps extends SliderOrientationProps {\n dir?: Direction;\n}\n\nconst SliderHorizontal = React.forwardRef<SliderHorizontalElement, SliderHorizontalProps>(\n (props: ScopedProps<SliderHorizontalProps>, forwardedRef) => {\n const {\n min,\n max,\n dir,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const [slider, setSlider] = React.useState<SliderImplElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setSlider(node));\n const rectRef = React.useRef<DOMRect>(undefined);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === 'ltr';\n const isSlidingFromLeft = (isDirectionLTR && !inverted) || (!isDirectionLTR && inverted);\n\n function getValueFromPointer(pointerPosition: number) {\n const rect = rectRef.current || slider!.getBoundingClientRect();\n const input: [number, number] = [0, rect.width];\n const output: [number, number] = isSlidingFromLeft ? [min, max] : [max, min];\n const value = linearScale(input, output);\n\n rectRef.current = rect;\n return value(pointerPosition - rect.left);\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isSlidingFromLeft ? 'left' : 'right'}\n endEdge={isSlidingFromLeft ? 'right' : 'left'}\n direction={isSlidingFromLeft ? 1 : -1}\n size=\"width\"\n >\n <SliderImpl\n dir={direction}\n data-orientation=\"horizontal\"\n {...sliderProps}\n ref={composedRefs}\n style={{\n ...sliderProps.style,\n ['--radix-slider-thumb-transform' as any]: 'translateX(-50%)',\n }}\n onSlideStart={(event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideStart?.(value);\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.clientX);\n onSlideMove?.(value);\n }}\n onSlideEnd={() => {\n rectRef.current = undefined;\n onSlideEnd?.();\n }}\n onStepKeyDown={(event) => {\n const slideDirection = isSlidingFromLeft ? 'from-left' : 'from-right';\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }}\n />\n </SliderOrientationProvider>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderVertical\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderVerticalElement = SliderImplElement;\ninterface SliderVerticalProps extends SliderOrientationProps {}\n\nconst SliderVertical = React.forwardRef<SliderVerticalElement, SliderVerticalProps>(\n (props: ScopedProps<SliderVerticalProps>, forwardedRef) => {\n const {\n min,\n max,\n inverted,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const sliderRef = React.useRef<SliderImplElement>(null);\n const ref = useComposedRefs(forwardedRef, sliderRef);\n const rectRef = React.useRef<DOMRect>(undefined);\n const isSlidingFromBottom = !inverted;\n\n function getValueFromPointer(pointerPosition: number) {\n const rect = rectRef.current || sliderRef.current!.getBoundingClientRect();\n const input: [number, number] = [0, rect.height];\n const output: [number, number] = isSlidingFromBottom ? [max, min] : [min, max];\n const value = linearScale(input, output);\n\n rectRef.current = rect;\n return value(pointerPosition - rect.top);\n }\n\n return (\n <SliderOrientationProvider\n scope={props.__scopeSlider}\n startEdge={isSlidingFromBottom ? 'bottom' : 'top'}\n endEdge={isSlidingFromBottom ? 'top' : 'bottom'}\n size=\"height\"\n direction={isSlidingFromBottom ? 1 : -1}\n >\n <SliderImpl\n data-orientation=\"vertical\"\n {...sliderProps}\n ref={ref}\n style={{\n ...sliderProps.style,\n ['--radix-slider-thumb-transform' as any]: 'translateY(50%)',\n }}\n onSlideStart={(event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideStart?.(value);\n }}\n onSlideMove={(event) => {\n const value = getValueFromPointer(event.clientY);\n onSlideMove?.(value);\n }}\n onSlideEnd={() => {\n rectRef.current = undefined;\n onSlideEnd?.();\n }}\n onStepKeyDown={(event) => {\n const slideDirection = isSlidingFromBottom ? 'from-bottom' : 'from-top';\n const isBackKey = BACK_KEYS[slideDirection].includes(event.key);\n onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });\n }}\n />\n </SliderOrientationProvider>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderImpl\n * -----------------------------------------------------------------------------------------------*/\n\ntype SliderImplElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ntype SliderImplPrivateProps = {\n onSlideStart(event: React.PointerEvent): void;\n onSlideMove(event: React.PointerEvent): void;\n onSlideEnd(event: React.PointerEvent): void;\n onHomeKeyDown(event: React.KeyboardEvent): void;\n onEndKeyDown(event: React.KeyboardEvent): void;\n onStepKeyDown(event: React.KeyboardEvent): void;\n};\ninterface SliderImplProps extends PrimitiveDivProps, SliderImplPrivateProps {}\n\nconst SliderImpl = React.forwardRef<SliderImplElement, SliderImplProps>(\n (props: ScopedProps<SliderImplProps>, forwardedRef) => {\n const {\n __scopeSlider,\n onSlideStart,\n onSlideMove,\n onSlideEnd,\n onHomeKeyDown,\n onEndKeyDown,\n onStepKeyDown,\n ...sliderProps\n } = props;\n const context = useSliderContext(SLIDER_NAME, __scopeSlider);\n\n return (\n <Primitive.span\n {...sliderProps}\n ref={forwardedRef}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Home') {\n onHomeKeyDown(event);\n // Prevent scrolling to page start\n event.preventDefault();\n } else if (event.key === 'End') {\n onEndKeyDown(event);\n // Prevent scrolling to page end\n event.preventDefault();\n } else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event);\n // Prevent scrolling for directional key presses\n event.preventDefault();\n }\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n const target = event.target as HTMLElement;\n target.setPointerCapture(event.pointerId);\n // Prevent browser focus behaviour because we focus a thumb manually when values change.\n event.preventDefault();\n // Touch devices have a delay before focusing so won't focus if touch immediately moves\n // away from target (sliding). We want thumb to focus regardless.\n if (context.thumbs.has(target)) {\n target.focus();\n } else {\n onSlideStart(event);\n }\n })}\n onPointerMove={composeEventHandlers(props.onPointerMove, (event) => {\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);\n })}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n const target = event.target as HTMLElement;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n onSlideEnd(event);\n }\n })}\n />\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * SliderTrack\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRACK_NAME = 'SliderTrack';\n\ntype SliderTrackElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface SliderTrackProps extends PrimitiveSpanProps {}\n\nconst SliderTrack = React.forwardRef<SliderTrackElement, SliderTrackProps>(\n (props: ScopedProps<SliderTrackProps>, forwardedRef) => {\n const { __scopeSlider, ...trackProps } = props;\n const context = useSliderContext(TRACK_NAME, __scopeSlider);\n return (\n <Primitive.span\n data-disabled={context.disabled ? '' : undefined}\n data-orientation={context.orientation}\n {...trackProps}\n ref={forwardedRef}\n />\n );\n }\n);\n\nSliderTrack.displayName = TRACK_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderRange\n * -----------------------------------------------------------------------------------------------*/\n\nconst RANGE_NAME = 'SliderRange';\n\ntype SliderRangeElement = React.ComponentRef<typeof Primitive.span>;\ninterface SliderRangeProps extends PrimitiveSpanProps {}\n\nconst SliderRange = React.forwardRef<SliderRangeElement, SliderRangeProps>(\n (props: ScopedProps<SliderRangeProps>, forwardedRef) => {\n const { __scopeSlider, ...rangeProps } = props;\n const context = useSliderContext(RANGE_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);\n const ref = React.useRef<HTMLSpanElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const valuesCount = context.values.length;\n const percentages = context.values.map((value) =>\n convertValueToPercentage(value, context.min, context.max)\n );\n const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;\n const offsetEnd = 100 - Math.max(...percentages);\n\n return (\n <Primitive.span\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n {...rangeProps}\n ref={composedRefs}\n style={{\n ...props.style,\n [orientation.startEdge]: offsetStart + '%',\n [orientation.endEdge]: offsetEnd + '%',\n }}\n />\n );\n }\n);\n\nSliderRange.displayName = RANGE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SliderThumb';\n\ntype SliderThumbElement = SliderThumbImplElement;\ninterface SliderThumbProps extends Omit<SliderThumbImplProps, 'index'> {}\n\nconst SliderThumb = React.forwardRef<SliderThumbElement, SliderThumbProps>(\n (props: ScopedProps<SliderThumbProps>, forwardedRef) => {\n const getItems = useCollection(props.__scopeSlider);\n const [thumb, setThumb] = React.useState<SliderThumbImplElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n const index = React.useMemo(\n () => (thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1),\n [getItems, thumb]\n );\n return <SliderThumbImpl {...props} ref={composedRefs} index={index} />;\n }\n);\n\ntype SliderThumbImplElement = React.ComponentRef<typeof Primitive.span>;\ninterface SliderThumbImplProps extends PrimitiveSpanProps {\n index: number;\n name?: string;\n}\n\nconst SliderThumbImpl = React.forwardRef<SliderThumbImplElement, SliderThumbImplProps>(\n (props: ScopedProps<SliderThumbImplProps>, forwardedRef) => {\n const { __scopeSlider, index, name, ...thumbProps } = props;\n const context = useSliderContext(THUMB_NAME, __scopeSlider);\n const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);\n const [thumb, setThumb] = React.useState<HTMLSpanElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = thumb ? context.form || !!thumb.closest('form') : true;\n const size = useSize(thumb);\n // We cast because index could be `-1` which would return undefined\n const value = context.values[index] as number | undefined;\n const percent =\n value === undefined ? 0 : convertValueToPercentage(value, context.min, context.max);\n const label = getLabel(index, context.values.length);\n const orientationSize = size?.[orientation.size];\n const thumbInBoundsOffset = orientationSize\n ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction)\n : 0;\n\n React.useEffect(() => {\n if (thumb) {\n context.thumbs.add(thumb);\n return () => {\n context.thumbs.delete(thumb);\n };\n }\n }, [thumb, context.thumbs]);\n\n return (\n <span\n style={{\n transform: 'var(--radix-slider-thumb-transform)',\n position: 'absolute',\n [orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`,\n }}\n >\n <Collection.ItemSlot scope={props.__scopeSlider}>\n <Primitive.span\n role=\"slider\"\n aria-label={props['aria-label'] || label}\n aria-valuemin={context.min}\n aria-valuenow={value}\n aria-valuemax={context.max}\n aria-orientation={context.orientation}\n data-orientation={context.orientation}\n data-disabled={context.disabled ? '' : undefined}\n tabIndex={context.disabled ? undefined : 0}\n {...thumbProps}\n ref={composedRefs}\n /**\n * There will be no value on initial render while we work out the index so we hide thumbs\n * without a value, otherwise SSR will render them in the wrong position before they\n * snap into the correct position during hydration which would be visually jarring for\n * slower connections.\n */\n style={value === undefined ? { display: 'none' } : props.style}\n onFocus={composeEventHandlers(props.onFocus, () => {\n context.valueIndexToChangeRef.current = index;\n })}\n />\n </Collection.ItemSlot>\n\n {isFormControl && (\n <SliderBubbleInput\n key={index}\n name={\n name ??\n (context.name ? context.name + (context.values.length > 1 ? '[]' : '') : undefined)\n }\n form={context.form}\n value={value}\n />\n )}\n </span>\n );\n }\n);\n\nSliderThumb.displayName = THUMB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * SliderBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst BUBBLE_INPUT_NAME = 'RadioBubbleInput';\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;\ninterface SliderBubbleInputProps extends InputProps {}\n\nconst SliderBubbleInput = React.forwardRef<HTMLInputElement, SliderBubbleInputProps>(\n ({ __scopeSlider, value, ...props }: ScopedProps<SliderBubbleInputProps>, forwardedRef) => {\n const ref = React.useRef<HTMLInputElement>(null);\n const composedRefs = useComposedRefs(ref, forwardedRef);\n const prevValue = usePrevious(value);\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current;\n if (!input) return;\n\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'value') as PropertyDescriptor;\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event('input', { bubbles: true });\n setValue.call(input, value);\n input.dispatchEvent(event);\n }\n }, [prevValue, value]);\n\n /**\n * We purposefully do not use `type=\"hidden\"` here otherwise forms that\n * wrap it will not be able to access its value via the FormData API.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programmatically and bubble to any parent form `onChange` event.\n * Adding the `value` will cause React to consider the programmatic\n * dispatch a duplicate and it will get swallowed.\n */\n return (\n <Primitive.input\n style={{ display: 'none' }}\n {...props}\n ref={composedRefs}\n defaultValue={value}\n />\n );\n }\n);\n\nSliderBubbleInput.displayName = BUBBLE_INPUT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getNextSortedValues(prevValues: number[] = [], nextValue: number, atIndex: number) {\n const nextValues = [...prevValues];\n nextValues[atIndex] = nextValue;\n return nextValues.sort((a, b) => a - b);\n}\n\nfunction convertValueToPercentage(value: number, min: number, max: number) {\n const maxSteps = max - min;\n const percentPerStep = 100 / maxSteps;\n const percentage = percentPerStep * (value - min);\n return clamp(percentage, [0, 100]);\n}\n\n/**\n * Returns a label for each thumb when there are two or more thumbs\n */\nfunction getLabel(index: number, totalValues: number) {\n if (totalValues > 2) {\n return `Value ${index + 1} of ${totalValues}`;\n } else if (totalValues === 2) {\n return ['Minimum', 'Maximum'][index];\n } else {\n return undefined;\n }\n}\n\n/**\n * Given a `values` array and a `nextValue`, determine which value in\n * the array is closest to `nextValue` and return its index.\n *\n * @example\n * // returns 1\n * getClosestValueIndex([10, 30], 25);\n */\nfunction getClosestValueIndex(values: number[], nextValue: number) {\n if (values.length === 1) return 0;\n const distances = values.map((value) => Math.abs(value - nextValue));\n const closestDistance = Math.min(...distances);\n return distances.indexOf(closestDistance);\n}\n\n/**\n * Offsets the thumb centre point while sliding to ensure it remains\n * within the bounds of the slider when reaching the edges\n */\nfunction getThumbInBoundsOffset(width: number, left: number, direction: number) {\n const halfWidth = width / 2;\n const halfPercent = 50;\n const offset = linearScale([0, halfPercent], [0, halfWidth]);\n return (halfWidth - offset(left) * direction) * direction;\n}\n\n/**\n * Gets an array of steps between each value.\n *\n * @example\n * // returns [1, 9]\n * getStepsBetweenValues([10, 11, 20]);\n */\nfunction getStepsBetweenValues(values: number[]) {\n return values.slice(0, -1).map((value, index) => values[index + 1]! - value);\n}\n\n/**\n * Verifies the minimum steps between all values is greater than or equal\n * to the expected minimum steps.\n *\n * @example\n * // returns false\n * hasMinStepsBetweenValues([1,2,3], 2);\n *\n * @example\n * // returns true\n * hasMinStepsBetweenValues([1,2,3], 1);\n */\nfunction hasMinStepsBetweenValues(values: number[], minStepsBetweenValues: number) {\n if (minStepsBetweenValues > 0) {\n const stepsBetweenValues = getStepsBetweenValues(values);\n const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);\n return actualMinStepsBetweenValues >= minStepsBetweenValues;\n }\n return true;\n}\n\n// https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction linearScale(input: readonly [number, number], output: readonly [number, number]) {\n return (value: number) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\n\nfunction getDecimalCount(value: number) {\n return (String(value).split('.')[1] || '').length;\n}\n\nfunction roundValue(value: number, decimalCount: number) {\n const rounder = Math.pow(10, decimalCount);\n return Math.round(value * rounder) / rounder;\n}\n\nconst Root = Slider;\nconst Track = SliderTrack;\nconst Range = SliderRange;\nconst Thumb = SliderThumb;\n\nexport {\n createSliderScope,\n //\n Slider,\n SliderTrack,\n SliderRange,\n SliderThumb,\n //\n Root,\n Track,\n Range,\n Thumb,\n};\nexport type { SliderProps, SliderTrackProps, SliderRangeProps, SliderThumbProps };\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528',\n key: '1jaruq',\n },\n ],\n];\n\n/**\n * @component @name Flag\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/flag\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Flag = createLucideIcon('flag', __iconNode);\n\nexport default Flag;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2',\n key: '169zse',\n },\n ],\n];\n\n/**\n * @component @name Activity\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/activity\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Activity = createLucideIcon('activity', __iconNode);\n\nexport default Activity;\n"],"names":[],"mappings":"wDIEA,EAAA,EAAA,CAA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