tokentracker-cli 0.2.23
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/LICENSE +21 -0
- package/README.md +136 -0
- package/README.old.md +324 -0
- package/README.zh-CN.md +440 -0
- package/bin/tracker.js +28 -0
- package/dashboard/dist/apple-touch-icon.png +0 -0
- package/dashboard/dist/assets/AsciiBox-vyDhXYY5.js +1 -0
- package/dashboard/dist/assets/DashboardPage-CrplxZFL.js +12 -0
- package/dashboard/dist/assets/LandingExtras-DlrtqIDj.js +1 -0
- package/dashboard/dist/assets/LeaderboardPage-Czwkjje0.js +1 -0
- package/dashboard/dist/assets/LeaderboardProfilePage-C4rorru6.js +1 -0
- package/dashboard/dist/assets/MatrixRain-bGmRmuOW.js +1 -0
- package/dashboard/dist/assets/MatrixShell-BfOGBm5o.js +1 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-400-normal-BPBWmzPh.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-400-normal-Ce5q_31Z.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-500-normal-CJBLNVQT.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-500-normal-mNhfPmgl.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-700-normal-DH5Q319x.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-700-normal-VCNRadI3.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-900-normal-BKC3PZkM.woff +0 -0
- package/dashboard/dist/assets/geist-mono-cyrillic-900-normal-DdrQ8KBw.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-400-normal-CoULgQGM.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-400-normal-LC9RFr9I.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-500-normal-D3o2eNa9.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-500-normal-DOxI7kZ4.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-700-normal-D6izGJRP.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-700-normal-QGw08Lff.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-900-normal-CmoKXrdK.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-900-normal-Cu5MFKsu.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-400-normal-Cgks_Qgx.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-400-normal-CxNRRMGd.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-500-normal-CQcGuCNt.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-500-normal-diTenJ8L.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-700-normal-BX9f1BHp.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-700-normal-YOllDaLV.woff2 +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-900-normal-Br6WNUGb.woff +0 -0
- package/dashboard/dist/assets/geist-mono-latin-ext-900-normal-CrmBTzU2.woff2 +0 -0
- package/dashboard/dist/assets/index-BeoRn2gJ.js +2 -0
- package/dashboard/dist/assets/main-BYPG1_bI.js +2056 -0
- package/dashboard/dist/assets/main-hwTpulbk.css +1 -0
- package/dashboard/dist/favicon-16.png +0 -0
- package/dashboard/dist/favicon-32.png +0 -0
- package/dashboard/dist/favicon.ico +0 -0
- package/dashboard/dist/feed.xml +18 -0
- package/dashboard/dist/icon-192.png +0 -0
- package/dashboard/dist/icon-512.png +0 -0
- package/dashboard/dist/icon.svg +1 -0
- package/dashboard/dist/index.html +181 -0
- package/dashboard/dist/landing-dashboard.jpg +0 -0
- package/dashboard/dist/llms.txt +25 -0
- package/dashboard/dist/og-image.jpg +0 -0
- package/dashboard/dist/robots.txt +7 -0
- package/dashboard/dist/share-dashboard.jpg +0 -0
- package/dashboard/dist/share.html +118 -0
- package/dashboard/dist/sitemap.xml +13 -0
- package/dashboard/dist/social-preview.png +0 -0
- package/dashboard/dist/wrapped-2025.html +60 -0
- package/dashboard/dist/wrapped-2025.png +0 -0
- package/node_modules/@insforge/sdk/LICENSE +201 -0
- package/node_modules/@insforge/sdk/README.md +259 -0
- package/node_modules/@insforge/sdk/dist/index.d.mts +854 -0
- package/node_modules/@insforge/sdk/dist/index.d.ts +854 -0
- package/node_modules/@insforge/sdk/dist/index.js +1823 -0
- package/node_modules/@insforge/sdk/dist/index.js.map +1 -0
- package/node_modules/@insforge/sdk/dist/index.mjs +1784 -0
- package/node_modules/@insforge/sdk/dist/index.mjs.map +1 -0
- package/node_modules/@insforge/sdk/package.json +68 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts +583 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js +111 -0
- package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts +188 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.js +48 -0
- package/node_modules/@insforge/shared-schemas/dist/ai.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts +1127 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js +277 -0
- package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts +187 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.js +105 -0
- package/node_modules/@insforge/shared-schemas/dist/auth.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts +144 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js +41 -0
- package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts +1627 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js +209 -0
- package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts +263 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.js +89 -0
- package/node_modules/@insforge/shared-schemas/dist/database.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts +4 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.js +22 -0
- package/node_modules/@insforge/shared-schemas/dist/docs.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts +34 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js +24 -0
- package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts +39 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js +18 -0
- package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts +34 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.js +14 -0
- package/node_modules/@insforge/shared-schemas/dist/functions.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/index.d.ts +19 -0
- package/node_modules/@insforge/shared-schemas/dist/index.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/index.js +19 -0
- package/node_modules/@insforge/shared-schemas/dist/index.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts +237 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js +41 -0
- package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts +79 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.js +31 -0
- package/node_modules/@insforge/shared-schemas/dist/logs.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts +940 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js +50 -0
- package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts +395 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js +73 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts +269 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js +109 -0
- package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts +166 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js +49 -0
- package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts +39 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts.map +1 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.js +15 -0
- package/node_modules/@insforge/shared-schemas/dist/storage.schema.js.map +1 -0
- package/node_modules/@insforge/shared-schemas/package.json +31 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/@supabase/node-fetch/LICENSE.md +22 -0
- package/node_modules/@supabase/node-fetch/README.md +633 -0
- package/node_modules/@supabase/node-fetch/browser.js +22 -0
- package/node_modules/@supabase/node-fetch/lib/index.es.js +1778 -0
- package/node_modules/@supabase/node-fetch/lib/index.js +1787 -0
- package/node_modules/@supabase/node-fetch/lib/index.mjs +1776 -0
- package/node_modules/@supabase/node-fetch/package.json +80 -0
- package/node_modules/@supabase/postgrest-js/LICENSE +21 -0
- package/node_modules/@supabase/postgrest-js/README.md +56 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts +71 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js +222 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts +74 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js +121 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts +17 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js +18 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts +108 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js +381 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts +117 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js +251 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts +157 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js +226 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts +4 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js +6 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts +19 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.js +28 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/index.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts +261 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js +5 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts +157 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts +31 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts +264 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts +106 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.js +3 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/types.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts +2 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.js +5 -0
- package/node_modules/@supabase/postgrest-js/dist/cjs/version.js.map +1 -0
- package/node_modules/@supabase/postgrest-js/dist/esm/wrapper.mjs +28 -0
- package/node_modules/@supabase/postgrest-js/package.json +75 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +300 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +192 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +18 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +604 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +437 -0
- package/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +368 -0
- package/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
- package/node_modules/@supabase/postgrest-js/src/index.ts +35 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +469 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +503 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +115 -0
- package/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +602 -0
- package/node_modules/@supabase/postgrest-js/src/types.ts +201 -0
- package/node_modules/@supabase/postgrest-js/src/version.ts +1 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +60 -0
- package/node_modules/debug/src/browser.js +271 -0
- package/node_modules/debug/src/common.js +274 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +2968 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +910 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +882 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +903 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4908 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +88 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +321 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +55 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/esm/index.js +311 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +90 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +316 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +58 -0
- package/node_modules/tr46/.npmignore +4 -0
- package/node_modules/tr46/index.js +193 -0
- package/node_modules/tr46/lib/.gitkeep +0 -0
- package/node_modules/tr46/lib/mappingTable.json +1 -0
- package/node_modules/tr46/package.json +31 -0
- package/node_modules/webidl-conversions/LICENSE.md +12 -0
- package/node_modules/webidl-conversions/README.md +53 -0
- package/node_modules/webidl-conversions/lib/index.js +189 -0
- package/node_modules/webidl-conversions/package.json +23 -0
- package/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/node_modules/whatwg-url/README.md +67 -0
- package/node_modules/whatwg-url/lib/URL-impl.js +200 -0
- package/node_modules/whatwg-url/lib/URL.js +196 -0
- package/node_modules/whatwg-url/lib/public-api.js +11 -0
- package/node_modules/whatwg-url/lib/url-state-machine.js +1297 -0
- package/node_modules/whatwg-url/lib/utils.js +20 -0
- package/node_modules/whatwg-url/package.json +32 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +12 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +514 -0
- package/node_modules/ws/lib/receiver.js +704 -0
- package/node_modules/ws/lib/sender.js +497 -0
- package/node_modules/ws/lib/stream.js +159 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +130 -0
- package/node_modules/ws/lib/websocket-server.js +540 -0
- package/node_modules/ws/lib/websocket.js +1338 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +58 -0
- package/src/cli.js +83 -0
- package/src/commands/activate-if-needed.js +41 -0
- package/src/commands/diagnostics.js +38 -0
- package/src/commands/doctor.js +96 -0
- package/src/commands/init.js +975 -0
- package/src/commands/serve.js +200 -0
- package/src/commands/status.js +215 -0
- package/src/commands/sync.js +783 -0
- package/src/commands/uninstall.js +167 -0
- package/src/lib/activation-check.js +341 -0
- package/src/lib/browser-auth.js +177 -0
- package/src/lib/claude-config.js +190 -0
- package/src/lib/cli-ui.js +179 -0
- package/src/lib/codex-config.js +350 -0
- package/src/lib/debug-flags.js +7 -0
- package/src/lib/diagnostics.js +216 -0
- package/src/lib/doctor.js +351 -0
- package/src/lib/fs.js +77 -0
- package/src/lib/gemini-config.js +288 -0
- package/src/lib/init-flow.js +42 -0
- package/src/lib/insforge-client.js +79 -0
- package/src/lib/insforge.js +29 -0
- package/src/lib/local-api.js +511 -0
- package/src/lib/openclaw-hook.js +420 -0
- package/src/lib/openclaw-session-plugin.js +520 -0
- package/src/lib/opencode-config.js +99 -0
- package/src/lib/opencode-usage-audit.js +205 -0
- package/src/lib/progress.js +76 -0
- package/src/lib/project-usage-purge.js +106 -0
- package/src/lib/prompt.js +24 -0
- package/src/lib/rollout.js +2472 -0
- package/src/lib/runtime-config.js +132 -0
- package/src/lib/static-server.js +59 -0
- package/src/lib/subscriptions.js +319 -0
- package/src/lib/tracker-paths.js +15 -0
- package/src/lib/upload-throttle.js +148 -0
- package/src/lib/uploader.js +224 -0
- package/src/lib/vibeusage-api.js +243 -0
- package/src/lib/vibeusage-public-repo.js +105 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{r as h,u as Mn,i as Wf,a as Rt,g as Kf,b as Jt,c as Qt,d as ot,e as Or,f as Yn,h as js,j as mi,k as zt,t as Ze,l as P,T as Hf,m as g,n as Pe,o as pi,p as Tl,q as kl,s as ie,N as Cl,v as El,w as gi,x as pt,y as Al,E as gn,z as yi,A as Gf,B as Dn,C as Do,D as Yf,F as Pl,G as Vs,H as Rl,I as zf,J as At,K as er,L as qf,M as tr,O as No,P as Xf,Q as Zf,R as Ml,S as Jf,U as Qf,V as eh,W as th,X as Dl,Y as Nl,Z as nh,_ as sh,$ as rh,a0 as ih,a1 as oh,a2 as ah,a3 as lh,a4 as ch,a5 as ht,a6 as uh,a7 as dh,a8 as nr}from"./main-BYPG1_bI.js";import{g as fh,a as bi,b as hh,c as mh,d as ph,e as sr,f as gh,A as yh,r as bh,h as jo,i as xh,j as vh,t as wh,s as Sh}from"./AsciiBox-vyDhXYY5.js";const Th="data-base-ui-click-trigger",kh={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Ch=[];function jl(e){h.useEffect(e,Ch)}const dn=0;class qt{static create(){return new qt}currentId=dn;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dn,n()},t)}isStarted(){return this.currentId!==dn}clear=()=>{this.currentId!==dn&&(clearTimeout(this.currentId),this.currentId=dn)};disposeEffect=()=>this.clear}function ps(){const e=Mn(qt.create).current;return jl(e.disposeEffect),e}function Nn(e){return e?.ownerDocument||document}const en=typeof navigator<"u",rr=Rh(),Vl=Dh(),Ll=Mh(),Eh=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Il=rr.platform==="MacIntel"&&rr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(rr.platform),Ah=en&&/apple/i.test(navigator.vendor),Br=en&&/android/i.test(Vl)||/android/i.test(Ll);en&&Vl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ph=Ll.includes("jsdom/");function Rh(){if(!en)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Mh(){if(!en)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Dh(){if(!en)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const $r="data-base-ui-focusable",Fl="active",_l="selected",Nh="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Bt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function we(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Wf(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ge(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function jh(e){return e.matches("html,body")}function Le(e){return e?.ownerDocument||document}function Vh(e){return Rt(e)&&e.matches(Nh)}function Vo(e){return e?e.getAttribute("role")==="combobox"&&Vh(e):!1}function Ur(e){return e?e.hasAttribute($r)?e:e.querySelector(`[${$r}]`)||e:null}function Gt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Gt(e,r.id,n)])}function Lo(e,t){let n=[],s=e.find(r=>r.id===t)?.parentId;for(;s;){const r=e.find(i=>i.id===s);s=r?.parentId,r&&(n=n.concat(r))}return n}function Lh(e){e.preventDefault(),e.stopPropagation()}function Ih(e){return"nativeEvent"in e}function Fh(e){return e.mozInputSource===0&&e.isTrusted?!0:Br&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _h(e){return Ph?!1:!Br&&e.width===0&&e.height===0||Br&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Oh(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var Bh=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],gs=Bh.join(","),Ol=typeof Element>"u",Xt=Ol?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ys=!Ol&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},bs=function(t,n){var s;n===void 0&&(n=!0);var r=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),i=r===""||r==="true",o=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):bs(t.parentNode));return o},$h=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},Bl=function(t,n,s){if(bs(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(gs));return n&&Xt.call(t,gs)&&r.unshift(t),r=r.filter(s),r},xs=function(t,n,s){for(var r=[],i=Array.from(t);i.length;){var o=i.shift();if(!bs(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=xs(l,!0,s);s.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else{var u=Xt.call(o,gs);u&&s.filter(o)&&(n||!t.includes(o))&&r.push(o);var d=o.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(o),f=!bs(d,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(o));if(d&&f){var p=xs(d===!0?o.children:d.children,!0,s);s.flatten?r.push.apply(r,p):r.push({scopeParent:o,candidates:p})}else i.unshift.apply(i,o.children)}}return r},$l=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ul=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$h(t))&&!$l(t)?0:t.tabIndex},Uh=function(t,n){var s=Ul(t);return s<0&&n&&!$l(t)?0:s},Wh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Wl=function(t){return t.tagName==="INPUT"},Kh=function(t){return Wl(t)&&t.type==="hidden"},Hh=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},Gh=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},Yh=function(t){if(!t.name)return!0;var n=t.form||ys(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=s(window.CSS.escape(t.name));else try{r=s(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=Gh(r,t.form);return!i||i===t},zh=function(t){return Wl(t)&&t.type==="radio"},qh=function(t){return zh(t)&&!Yh(t)},Xh=function(t){var n,s=t&&ys(t),r=(n=s)===null||n===void 0?void 0:n.host,i=!1;if(s&&s!==t){var o,a,l;for(i=!!((o=r)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&r;){var c,u,d;s=ys(r),r=(c=s)===null||c===void 0?void 0:c.host,i=!!((u=r)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(r))}}return i},Io=function(t){var n=t.getBoundingClientRect(),s=n.width,r=n.height;return s===0&&r===0},Zh=function(t,n){var s=n.displayCheck,r=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var o=Xt.call(t,"details>summary:first-of-type"),a=o?t.parentElement:t;if(Xt.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof r=="function"){for(var l=t;t;){var c=t.parentElement,u=ys(t);if(c&&!c.shadowRoot&&r(c)===!0)return Io(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=l}if(Xh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return Io(t);return!1},Jh=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var r=n.children.item(s);if(r.tagName==="LEGEND")return Xt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Wr=function(t,n){return!(n.disabled||Kh(n)||Zh(n,t)||Hh(n)||Jh(n))},Kr=function(t,n){return!(qh(n)||Ul(n)<0||!Wr(t,n))},Qh=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Kl=function(t){var n=[],s=[];return t.forEach(function(r,i){var o=!!r.scopeParent,a=o?r.scopeParent:r,l=Uh(a,o),c=o?Kl(r.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):s.push({documentOrder:i,tabIndex:l,item:r,isScope:o,content:c})}),s.sort(Wh).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Ls=function(t,n){n=n||{};var s;return n.getShadowRoot?s=xs([t],n.includeContainer,{filter:Kr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Qh}):s=Bl(t,n.includeContainer,Kr.bind(null,n)),Kl(s)},em=function(t,n){n=n||{};var s;return n.getShadowRoot?s=xs([t],n.includeContainer,{filter:Wr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=Bl(t,n.includeContainer,Wr.bind(null,n)),s},Hl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Xt.call(t,gs)===!1?!1:Kr(n,t)};const jn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Gl(e,t){const n=Ls(e,jn()),s=n.length;if(s===0)return;const r=Bt(Le(e)),i=n.indexOf(r),o=i===-1?t===1?0:s-1:i+t;return n[o]}function Yl(e){return Gl(Le(e).body,1)||e}function zl(e){return Gl(Le(e).body,-1)||e}function yn(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!we(n,s)}function tm(e){Ls(e,jn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Fo(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function nm({baseUrl:e,accessToken:t,guestAllowed:n=!1,weeks:s=52,weekStartsOn:r="sun",cacheKey:i,timeZone:o,tzOffsetMinutes:a,now:l}={}){const c=h.useMemo(()=>Kf({weeks:s,weekStartsOn:r,now:l}),[l,s,r]),[u,d]=h.useState([]),[f,p]=h.useState(null),[m,y]=h.useState("edge"),[b,x]=h.useState(!1),[w,v]=h.useState(null),k=Jt(),S=Qt(t),R=!n,N=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),C=h.useMemo(()=>{if(!i)return null;const $=js({timeZone:o,offsetMinutes:a});return`vibeusage.heatmap.${i}.${s}.${r}.${$}`},[i,o,a,s,r]),I=h.useCallback(()=>{if(!C||typeof window>"u")return null;try{const $=window.localStorage.getItem(C);if(!$)return null;const j=JSON.parse($);return!j||!j.heatmap?null:j}catch{return null}},[C]),A=h.useCallback($=>{if(!(!C||typeof window>"u"))try{window.localStorage.setItem(C,JSON.stringify($))}catch{}},[C]),M=h.useCallback(()=>{if(!(!C||typeof window>"u"))try{window.localStorage.removeItem(C)}catch{}},[C]),U=h.useCallback(async()=>{const $=await ot(t);if(!(!$&&!k&&!N)){x(!0),v(null);try{try{const D=await fh({baseUrl:e,accessToken:$,weeks:s,to:c.to,weekStartsOn:r,timeZone:o,tzOffsetMinutes:a}),_=Array.isArray(D?.weeks)?D.weeks:[];if(!_.length&&R){const X=I();if(X?.heatmap){p(X.heatmap),d(X.daily||[]),y("cache");return}}if(!_.some(X=>(Array.isArray(X)?X:[]).some(se=>se&&Number.isFinite(Number(se.level))))&&_.length){const X=[];for(const H of _)for(const Q of Array.isArray(H)?H:[])Q?.day&&X.push({day:Q.day,total_tokens:Q.total_tokens??Q.value??0,billable_total_tokens:Q.billable_total_tokens??Q.value??Q.total_tokens??0});const se=Or({dailyRows:X,weeks:s,to:D?.to||c.to,weekStartsOn:r});d(X),p({...se,week_starts_on:r,active_days:X.filter(H=>Number(H?.billable_total_tokens??H?.total_tokens)>0).length,streak_days:Yn({dailyRows:X,to:D?.to||c.to})}),y("client"),R?A({heatmap:{...se,week_starts_on:r,active_days:X.filter(H=>Number(H?.billable_total_tokens??H?.total_tokens)>0).length,streak_days:Yn({dailyRows:X,to:D?.to||c.to})},daily:X,fetchedAt:new Date().toISOString()}):M();return}p(D||null),d([]),y("edge"),D&&R?A({heatmap:D,daily:[],fetchedAt:new Date().toISOString()}):R||M();return}catch(D){const _=D,z=_?.status??_?.statusCode;if(z===401||z===403)throw D}const j=await bi({baseUrl:e,accessToken:$,from:c.from,to:c.to,timeZone:o,tzOffsetMinutes:a}),W=Array.isArray(j?.data)?j.data:[];d(W);const pe=Or({dailyRows:W,weeks:s,to:c.to,weekStartsOn:r});p({...pe,week_starts_on:r,active_days:W.filter(D=>Number(D?.billable_total_tokens??D?.total_tokens)>0).length,streak_days:Yn({dailyRows:W,to:c.to})}),y("client"),R?A({heatmap:{...pe,week_starts_on:r,active_days:W.filter(D=>Number(D?.billable_total_tokens??D?.total_tokens)>0).length,streak_days:Yn({dailyRows:W,to:c.to})},daily:W,fetchedAt:new Date().toISOString()}):M()}catch(j){if(R){const W=I();if(W?.heatmap)p(W.heatmap),d(W.daily||[]),y("cache"),v(null);else{const pe=j;v(pe?.message||String(pe)),d([]),p(null),y("edge")}}else{const W=j;v(W?.message||String(W)),d([]),p(null),y("edge")}}finally{x(!1)}}},[t,e,k,n,R,c.from,c.to,I,S,o,a,r,s,M,A,N]);return h.useEffect(()=>{if(!S&&!n&&!k&&!N){d([]),x(!1),v(null),p(null),y("edge");return}if(!R)M(),d([]),v(null),p(null),y("edge");else{const $=I();$?.heatmap&&(p($.heatmap),d($.daily||[]),y("cache"))}U()},[t,k,I,U,S,n,R,M,N]),{range:c,daily:u,heatmap:f,source:k?"mock":m==="client"?"edge":m,loading:b,error:w,refresh:U}}function sm({baseUrl:e,accessToken:t,limit:n=3,from:s,to:r,source:i,timeZone:o,tzOffsetMinutes:a}={}){const[l,c]=h.useState([]),[u,d]=h.useState(!1),[f,p]=h.useState(null),m=Jt(),y=Qt(t),b=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=h.useCallback(async()=>{const w=await ot(t);if(!w&&!m&&!b){c([]),p(null),d(!1);return}d(!0),p(null);try{const v=await hh({baseUrl:e,accessToken:w,limit:n,from:s,to:r,source:i,timeZone:o,tzOffsetMinutes:a});c(Array.isArray(v?.entries)?v.entries:[])}catch(v){const k=v?.message||String(v);p(k),c([])}finally{d(!1)}},[t,e,s,n,m,i,o,r,a,b]);return h.useEffect(()=>{if(!y&&!m&&!b){c([]),p(null),d(!1);return}x()},[m,x,y,b]),{entries:l,loading:u,error:f,refresh:x}}const rm=24;function im({baseUrl:e,accessToken:t,guestAllowed:n=!1,period:s,from:r,to:i,months:o=rm,cacheKey:a,timeZone:l,tzOffsetMinutes:c,now:u,sharedRows:d,sharedRange:f}={}){const[p,m]=h.useState([]),[y,b]=h.useState(()=>({from:r,to:i})),[x,w]=h.useState("edge"),[v,k]=h.useState(null),[S,R]=h.useState(!1),[N,C]=h.useState(null),I=Jt(),A=Qt(t),M=!n,U=Array.isArray(d),V=f?.from||r,$=f?.to||i,j=h.useMemo(()=>s==="day"?"hourly":s==="total"?"monthly":"daily",[s]),W=(()=>{if(!a)return null;const H=om(e)||"default",Q=js({timeZone:l,offsetMinutes:c});if(j==="hourly")return`vibeusage.trend.${a}.${H}.hourly.${i||r||"day"}.${Q}`;if(j==="monthly")return`vibeusage.trend.${a}.${H}.monthly.${o}.${i||"today"}.${Q}`;const ee=`${r||""}.${i||""}`;return`vibeusage.trend.${a}.${H}.daily.${ee}.${Q}`})(),pe=h.useCallback(()=>{if(!W||typeof window>"u")return null;try{const H=window.localStorage.getItem(W);if(!H)return null;const Q=JSON.parse(H);return!Q||!Array.isArray(Q.rows)?null:Q}catch{return null}},[W]),D=h.useCallback(H=>{if(!(!W||typeof window>"u"))try{window.localStorage.setItem(W,JSON.stringify(H))}catch{}},[W]),_=h.useCallback(()=>{if(!(!W||typeof window>"u"))try{window.localStorage.removeItem(W)}catch{}},[W]),z=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),X=h.useCallback(async()=>{if(U){m(Array.isArray(d)?d:[]),b({from:V,to:$}),w("shared"),k(null),R(!1),C(null);return}const H=await ot(t);if(!(!H&&!I&&!z)){R(!0),C(null);try{let Q;j==="hourly"?Q=await mh({baseUrl:e,accessToken:H,day:i||r,timeZone:l,tzOffsetMinutes:c}):j==="monthly"?Q=await ph({baseUrl:e,accessToken:H,months:o,to:i,timeZone:l,tzOffsetMinutes:c}):Q=await bi({baseUrl:e,accessToken:H,from:r,to:i,timeZone:l,tzOffsetMinutes:c});const ee=Q?.from||r||Q?.day||null,de=Q?.to||i||Q?.day||null;let be=Array.isArray(Q?.data)?Q.data:[];j==="daily"?be=or(be,ee||r,de||i,{timeZone:l,offsetMinutes:c,now:u}):j==="hourly"?be=ar(be,{timeZone:l,offsetMinutes:c,now:u}):j==="monthly"&&(be=lr(be,{timeZone:l,offsetMinutes:c,now:u}));const Ne=new Date().toISOString();m(be),b({from:ee,to:de}),w("edge"),k(Ne),M?D({rows:be,from:ee,to:de,mode:j,fetchedAt:Ne}):_()}catch(Q){if(M){const ee=pe();if(ee?.rows){let de=j==="daily"?or(ee.rows||[],ee.from||r,ee.to||i,{timeZone:l,offsetMinutes:c,now:u}):Array.isArray(ee.rows)?ee.rows:[];j==="hourly"?de=ar(de,{timeZone:l,offsetMinutes:c,now:u}):j==="monthly"&&(de=lr(de,{timeZone:l,offsetMinutes:c,now:u})),m(de),b({from:ee.from||r,to:ee.to||i}),w("cache"),k(ee.fetchedAt||null),C(null)}else{m([]),b({from:r,to:i}),w("edge"),k(null);const de=Q;C(de?.message||String(de))}}else{m([]),b({from:r,to:i}),w("edge"),k(null);const ee=Q;C(ee?.message||String(ee))}}finally{R(!1)}}},[t,e,r,I,n,M,j,o,pe,A,U,V,d,$,l,i,c,u,_,D,z]);h.useEffect(()=>{if(U){m(Array.isArray(d)?d:[]),b({from:V,to:$}),w("shared"),k(null),R(!1),C(null);return}if(!A&&!n&&!I&&!z){m([]),b({from:r,to:i}),C(null),R(!1),w("edge"),k(null);return}if(!M)_(),m([]),b({from:r,to:i}),C(null),w("edge"),k(null);else{const H=pe();if(H?.rows){let Q=j==="daily"?or(H.rows||[],H.from||r,H.to||i,{timeZone:l,offsetMinutes:c,now:u}):Array.isArray(H.rows)?H.rows:[];j==="hourly"?Q=ar(Q,{timeZone:l,offsetMinutes:c,now:u}):j==="monthly"&&(Q=lr(Q,{timeZone:l,offsetMinutes:c,now:u})),m(Q),b({from:H.from||r,to:H.to||i}),w("cache"),k(H.fetchedAt||null)}}X()},[t,I,pe,X,U,V,d,$,A,n,M,_,z]);const se=I?"mock":x;return{rows:p,from:y.from||r,to:y.to||i,source:se,fetchedAt:v,loading:S,error:N,refresh:X}}function om(e){try{return new URL(e).host}catch{return null}}function ir(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const s=Number(n[0]),r=Number(n[1])-1,i=Number(n[2]);if(!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(i))return null;const o=new Date(Date.UTC(s,r,i));return Number.isFinite(o.getTime())&&zt(o)===t?o:null}function am(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function or(e,t,n,{timeZone:s,offsetMinutes:r,now:i}={}){const o=ir(t),a=ir(n);if(!o||!a||a<o)return Array.isArray(e)?e:[];const l=i instanceof Date&&Number.isFinite(i.getTime())?i:new Date,c=mi({timeZone:s,offsetMinutes:r,date:l}),u=ir(c),d=u?u.getTime():l.getTime(),f=new Map;for(const m of e||[])m?.day&&f.set(m.day,m);const p=[];for(let m=o;m<=a;m=am(m,1)){const y=zt(m),b=f.get(y),x=m.getTime()>d;if(b){p.push({...b,missing:!1,future:x});continue}p.push({day:y,total_tokens:null,billable_total_tokens:null,input_tokens:null,cached_input_tokens:null,output_tokens:null,reasoning_output_tokens:null,missing:!x,future:x})}return p}function ar(e,{timeZone:t,offsetMinutes:n,now:s}={}){if(!Array.isArray(e))return[];const r=ql({timeZone:t,offsetMinutes:n,now:s});return r?e.map(i=>{const o=i?.hour||i?.label||"",a=lm(o);if(!a)return{...i,future:!1};const l=a.dayNum>r.dayNum||a.dayNum===r.dayNum&&a.slot>r.slot;return{...i,future:l}}):e}function lr(e,{timeZone:t,offsetMinutes:n,now:s}={}){if(!Array.isArray(e))return[];const r=ql({timeZone:t,offsetMinutes:n,now:s});return r?e.map(i=>{const o=i?.month||i?.label||"",a=cm(o);if(!a)return{...i,future:!1};const l=a.year>r.year||a.year===r.year&&a.month>r.month;return{...i,future:l}}):e}function ql({timeZone:e,offsetMinutes:t,now:n}={}){const s=n instanceof Date&&Number.isFinite(n.getTime())?n:new Date;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const f=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(s).reduce((w,v)=>(v.type&&v.value&&(w[v.type]=v.value),w),{}),p=Number(f.year),m=Number(f.month),y=Number(f.day),b=Number(f.hour),x=Number(f.minute);if(Number.isFinite(p)&&Number.isFinite(m)&&Number.isFinite(y)&&Number.isFinite(b)&&Number.isFinite(x)){const w=b*2+(x>=30?1:0);return{year:p,month:m,day:y,hour:b,minute:x,dayNum:p*1e4+m*100+y,slot:w}}}catch{}if(Number.isFinite(t)){const u=new Date(s.getTime()+t*60*1e3),d=u.getUTCFullYear(),f=u.getUTCMonth()+1,p=u.getUTCDate(),m=u.getUTCHours(),y=u.getUTCMinutes(),b=m*2+(y>=30?1:0);return{year:d,month:f,day:p,hour:m,minute:y,dayNum:d*1e4+f*100+p,slot:b}}const r=s.getFullYear(),i=s.getMonth()+1,o=s.getDate(),a=s.getHours(),l=s.getMinutes(),c=a*2+(l>=30?1:0);return{year:r,month:i,day:o,hour:a,minute:l,dayNum:r*1e4+i*100+o,slot:c}}function lm(e){if(!e)return null;const t=String(e).trim(),[n,s]=t.split("T");if(!n||!s)return null;const r=n.split("-");if(r.length!==3)return null;const i=Number(r[0]),o=Number(r[1]),a=Number(r[2]);if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(a))return null;const l=s.split(":"),c=Number(l[0]),u=Number(l[1]);if(!Number.isFinite(c)||c<0||c>23||!Number.isFinite(u)||u<0||u>59)return null;const d=c*2+(u>=30?1:0);return{dayNum:i*1e4+o*100+a,slot:d}}function cm(e){if(!e)return null;const n=String(e).trim().split("-");if(n.length!==2)return null;const s=Number(n[0]),r=Number(n[1]);return!Number.isFinite(s)||!Number.isFinite(r)||r<1||r>12?null:{year:s,month:r}}function _o({baseUrl:e,accessToken:t,guestAllowed:n=!1,from:s,to:r,includeDaily:i=!0,cacheKey:o,timeZone:a,tzOffsetMinutes:l,now:c}={}){const[u,d]=h.useState([]),[f,p]=h.useState(null),[m,y]=h.useState(null),[b,x]=h.useState("edge"),[w,v]=h.useState(null),[k,S]=h.useState(!1),[R,N]=h.useState(null),C=Jt(),I=Qt(t),A=!n,M=(()=>{if(!o)return null;const D=um(e)||"default",_=i?"daily":"summary",z=js({timeZone:a,offsetMinutes:l});return`vibeusage.usage.${o}.${D}.${s}.${r}.${_}.${z}`})(),U=h.useCallback(()=>{if(!M||typeof window>"u")return null;try{const D=window.localStorage.getItem(M);if(!D)return null;const _=JSON.parse(D);return!_||!_.summary?null:_}catch{return null}},[M]),V=h.useCallback(D=>{if(!(!M||typeof window>"u"))try{window.localStorage.setItem(M,JSON.stringify(D))}catch{}},[M]),$=h.useCallback(()=>{if(!(!M||typeof window>"u"))try{window.localStorage.removeItem(M)}catch{}},[M]),j=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),W=h.useCallback(async()=>{const D=await ot(t);if(!(!D&&!C&&!j)){S(!0),N(null);try{let _=null,z=null;if(i){const[ee,de]=await Promise.allSettled([bi({baseUrl:e,accessToken:D,from:s,to:r,timeZone:a,tzOffsetMinutes:l}),sr({baseUrl:e,accessToken:D,from:s,to:r,timeZone:a,tzOffsetMinutes:l,rolling:!0})]);if(ee.status==="rejected")throw ee.reason;_=ee.value,z=de.status==="fulfilled"?de.value:null}else z=await sr({baseUrl:e,accessToken:D,from:s,to:r,timeZone:a,tzOffsetMinutes:l,rolling:!0});let X=i&&Array.isArray(_?.data)?_.data:[];i&&(X=ur(X,s,r,{timeZone:a,offsetMinutes:l,now:c}));let se=z?.totals||_?.summary?.totals||null,H=z?.rolling||_?.summary?.rolling||null;if(i&&!se&&!z)try{const ee=await sr({baseUrl:e,accessToken:D,from:s,to:r,timeZone:a,tzOffsetMinutes:l,rolling:!0});se=ee?.totals||null,H=ee?.rolling||H}catch{}const Q=new Date().toISOString();d(X),p(se),y(H),x("edge"),v(Q),se&&A?V({summary:se,rolling:H,daily:X,from:s,to:r,includeDaily:i,fetchedAt:Q}):A||$()}catch(_){if(A){const z=U();if(z?.summary){p(z.summary),y(z.rolling||null);const X=Array.isArray(z.daily)?z.daily:[],se=i?ur(X,z.from||s,z.to||r,{timeZone:a,offsetMinutes:l,now:c}):X;d(se),x("cache"),v(z.fetchedAt||null),N(null)}else{const X=_;N(X?.message||String(X)),d([]),p(null),y(null),x("edge"),v(null)}}else{const z=_;N(z?.message||String(z)),d([]),p(null),y(null),x("edge"),v(null)}}finally{S(!1)}}},[t,e,s,i,C,n,A,c,U,I,a,r,l,$,V,j]);return h.useEffect(()=>{const D=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");if(!I&&!n&&!C&&!D){d([]),p(null),y(null),N(null),S(!1),x("edge"),v(null);return}if(!A)$(),d([]),p(null),y(null),N(null),x("edge"),v(null);else{const _=U();if(_?.summary){p(_.summary),y(_.rolling||null);const z=Array.isArray(_.daily)?_.daily:[],X=i?ur(z,_.from||s,_.to||r,{timeZone:a,offsetMinutes:l,now:c}):z;d(X),x("cache"),v(_.fetchedAt||null)}}W()},[t,C,U,W,I,n,A,$,j]),{daily:u,summary:f,rolling:m,source:C?"mock":b,fetchedAt:w,loading:k,error:R,refresh:W}}function um(e){try{return new URL(e).host}catch{return null}}function cr(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const s=Number(n[0]),r=Number(n[1])-1,i=Number(n[2]);if(!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(i))return null;const o=new Date(Date.UTC(s,r,i));return Number.isFinite(o.getTime())&&zt(o)===t?o:null}function dm(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function ur(e,t,n,{timeZone:s,offsetMinutes:r,now:i}={}){const o=cr(t),a=cr(n);if(!o||!a||a<o)return Array.isArray(e)?e:[];const l=i instanceof Date&&Number.isFinite(i.getTime())?i:new Date,c=mi({timeZone:s,offsetMinutes:r,date:l}),u=cr(c),d=u?u.getTime():l.getTime(),f=new Map;for(const m of e||[])m?.day&&f.set(m.day,m);const p=[];for(let m=o;m<=a;m=dm(m,1)){const y=zt(m),b=f.get(y),x=m.getTime()>d;if(b){p.push({...b,missing:!1,future:x});continue}p.push({day:y,total_tokens:null,billable_total_tokens:null,input_tokens:null,cached_input_tokens:null,output_tokens:null,reasoning_output_tokens:null,missing:!x,future:x})}return p}function fm({baseUrl:e,accessToken:t,guestAllowed:n=!1,from:s,to:r,cacheKey:i,timeZone:o,tzOffsetMinutes:a}={}){const[l,c]=h.useState(null),[u,d]=h.useState("edge"),[f,p]=h.useState(!1),[m,y]=h.useState(null),b=Jt(),x=Qt(t),w=!n,v=h.useMemo(()=>{if(!i)return null;const A=hm(e)||"default",M=js({timeZone:o,offsetMinutes:a});return`vibeusage.modelBreakdown.${i}.${A}.${s}.${r}.${M}`},[e,i,s,o,r,a]),k=h.useCallback(()=>{if(!v||typeof window>"u")return null;try{const A=window.localStorage.getItem(v);if(!A)return null;const M=JSON.parse(A);return!M||!M.breakdown?null:M}catch{return null}},[v]),S=h.useCallback(A=>{if(!(!v||typeof window>"u"))try{window.localStorage.setItem(v,JSON.stringify(A))}catch{}},[v]),R=h.useCallback(()=>{if(!(!v||typeof window>"u"))try{window.localStorage.removeItem(v)}catch{}},[v]),N=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),C=h.useCallback(async()=>{const A=await ot(t);if(!(!A&&!b&&!N)){p(!0),y(null);try{const M=await gh({baseUrl:e,accessToken:A,from:s,to:r,timeZone:o,tzOffsetMinutes:a});c(M||null),d("edge"),M&&w?S({breakdown:M,fetchedAt:new Date().toISOString()}):w||R()}catch(M){if(w){const U=k();if(U?.breakdown)c(U.breakdown),d("cache"),y(null);else{c(null),d("edge");const V=M;y(V?.message||String(V))}}else{c(null),d("edge");const U=M;y(U?.message||String(U))}}finally{p(!1)}}},[t,e,s,b,n,w,k,o,r,x,a,R,S,N]);return h.useEffect(()=>{if(!x&&!n&&!b&&!N){c(null),d("edge"),y(null),p(!1);return}if(!w)R(),c(null),d("edge"),y(null);else{const A=k();A?.breakdown&&(c(A.breakdown),d("cache"))}C()},[t,b,k,C,x,n,w,R,N]),{breakdown:l,source:b?"mock":u,loading:f,error:m,refresh:C}}function hm(e){try{return new URL(e).host}catch{return null}}const Xl=new Set(["day","hour","month"]);function mm(e){return Xl.has(e)}function Oo(e){if(e==null)return null;const t=String(e).trim();if(!/^[0-9]+$/.test(t))return null;const n=t.replace(/^0+/,"");return n.length===0?"0":n}function pm(e,t){const n=Oo(e),s=Oo(t);if(n&&s)return n.length!==s.length?n.length<s.length?-1:1:n===s?0:n<s?-1:1;const r=Ze(e),i=Ze(t);return r==null&&i==null?0:r==null?1:i==null?-1:r===i?0:r<i?-1:1}function gm(e,t){const n=typeof e=="string"?e:String(e||""),s=typeof t=="string"?t:String(t||"");return n===s?0:n<s?-1:1}function ym(e){if(!e)return null;const n=String(e).trim().match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!n)return null;const s=Number(n[1]),r=Number(n[2]),i=Number(n[3]);if(!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(i))return null;const o=new Date(Date.UTC(s,r-1,i));return!Number.isFinite(o.getTime())||o.getUTCFullYear()!==s||o.getUTCMonth()+1!==r||o.getUTCDate()!==i?null:o.getTime()}function bm(e){if(!e)return null;const n=String(e).trim().match(/^(\d{4})-(\d{2})$/);if(!n)return null;const s=Number(n[1]),r=Number(n[2]);if(!Number.isFinite(s)||!Number.isFinite(r)||r<1||r>12)return null;const i=new Date(Date.UTC(s,r-1,1));return Number.isFinite(i.getTime())?i.getTime():null}function xm(e){if(!e)return null;const n=String(e).trim().match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?Z?$/);if(!n)return null;const s=Number(n[1]),r=Number(n[2]),i=Number(n[3]),o=Number(n[4]),a=Number(n[5]),l=Number(n[6]||0);if(!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(a)||!Number.isFinite(l)||r<1||r>12||i<1||i>31||o<0||o>23||a<0||a>59||l<0||l>59)return null;const c=new Date(Date.UTC(s,r-1,i,o,a,l));return Number.isFinite(c.getTime())?c.getTime():null}function vm(e,t,n){const s=n==="hour"?xm:n==="month"?bm:ym,r=s(e),i=s(t);return r!=null&&i!=null?r===i?0:r<i?-1:1:gm(e,t)}function Zl(e,{key:t,dir:n}){const s=n==="asc"?1:-1,r=Array.isArray(e)?e:[],i=Xl.has(t)?(a,l)=>vm(a,l,t):pm,o=a=>t==="total_tokens"&&a?.billable_total_tokens!=null?a.billable_total_tokens:a?.[t];return r.map((a,l)=>({row:a,index:l})).sort((a,l)=>{const c=o(a.row),u=o(l.row),d=c==null,f=u==null;if(d&&f)return a.index-l.index;if(d)return 1;if(f)return-1;const p=i(c,u);return p!==0?p*s:a.index-l.index}).map(a=>a.row)}const wm=[{key:"day",label:P("daily.sort.date.label"),title:P("daily.sort.date.title")},{key:"total_tokens",label:P("daily.sort.total.label"),title:P("daily.sort.total.title")},{key:"input_tokens",label:P("daily.sort.input.label"),title:P("daily.sort.input.title")},{key:"output_tokens",label:P("daily.sort.output.label"),title:P("daily.sort.output.title")},{key:"cached_input_tokens",label:P("daily.sort.cached.label"),title:P("daily.sort.cached.title")},{key:"reasoning_output_tokens",label:P("daily.sort.reasoning.label"),title:P("daily.sort.reasoning.title")}];function Bo(e){const t=mm(e)?e:"day";return wm.map((n,s)=>s===0?{...n,key:t}:n)}function $o(e,{key:t,dir:n}){return Zl(e,{key:t,dir:n})}const vs=12,Sm=["total_tokens","billable_total_tokens","input_tokens","cached_input_tokens","output_tokens","reasoning_output_tokens"];function Tm(e){if(typeof e=="bigint")return e!==0n;if(typeof e=="number")return Number.isFinite(e)&&e!==0;if(e==null)return!1;const t=String(e).trim();if(!t||!/^-?\d+$/.test(t))return!1;const n=t.startsWith("-")?t.slice(1):t;return/[1-9]/.test(n)}function km(e){return Sm.some(t=>Tm(e?.[t]))}function Cm(e){const t=Array.isArray(e)?e:[];if(!t.length)return[];const n=Zl(t,{key:"month",dir:"asc"}),s=n.findIndex(r=>r?.month&&km(r));return s===-1?t:n.slice(s)}function Em(e,t,n=vs){const s=Array.isArray(e)?e:[],r=Number.isFinite(n)&&n>0?n:vs,o=(Number.isFinite(t)&&t>=0?Math.floor(t):0)*r;return s.slice(o,o+r)}function Am({publicMode:e,screenshotMode:t,forceInstall:n,accessEnabled:s,heatmapLoading:r,activeDays:i,hasActiveDeviceToken:o}={}){return e||t?!1:n?!0:s&&!r&&i===0&&!o}function Jl(e){if(typeof e!="string")return null;const t=e.trim();return t?t.toLowerCase():null}function Pm(e){const t=Jl(e?.model_id);return t||null}function Ql(e,t){return e?.model?String(e.model):t}function Rm(e,{copyFn:t}={}){const n=typeof t=="function"?t:a=>a,r=(Array.isArray(e?.sources)?e.sources:[]).map(a=>{const l=Ze(a?.totals?.billable_total_tokens??a?.totals?.total_tokens)??0,c=Ze(a?.totals?.total_cost_usd)??0;return{source:a?.source,totalTokens:Number.isFinite(l)?l:0,totalCost:Number.isFinite(c)?c:0,models:Array.isArray(a?.models)?a.models:[]}}).filter(a=>a.totalTokens>0);if(!r.length)return[];const i=r.reduce((a,l)=>a+l.totalTokens,0),o=typeof e?.pricing?.pricing_mode=="string"?e.pricing.pricing_mode.toUpperCase():null;return r.slice().sort((a,l)=>l.totalTokens-a.totalTokens).map(a=>{const l=a.source?String(a.source).toUpperCase():n("shared.placeholder.short"),c=i>0?a.totalTokens/i*100:0,u=Number.isFinite(c)?c.toFixed(1):"0.0",d=a.models.map(f=>{const p=Ze(f?.totals?.billable_total_tokens??f?.totals?.total_tokens)??0;if(!Number.isFinite(p)||p<=0)return null;const m=a.totalTokens>0?Math.round(p/a.totalTokens*1e3)/10:0,y=Ql(f,n("shared.placeholder.short"));return{id:Pm(f),name:y,share:m,usage:p,calc:o}}).filter(Boolean);return{label:l,totalPercent:String(u),usd:a.totalCost,usage:a.totalTokens,models:d}})}function Mm(e,{limit:t=3,copyFn:n}={}){const s=typeof n=="function"?n:f=>f,r=Array.isArray(e?.sources)?e.sources:[];if(!r.length)return[];const i=new Map,o=new Map,a=new Map;let l=0;for(const f of r){const p=Array.isArray(f?.models)?f.models:[];for(const m of p){const y=Ze(m?.totals?.billable_total_tokens)??0;if(!Number.isFinite(y)||y<=0)continue;l+=y;const b=Ql(m,s("shared.placeholder.short")),x=Jl(b);if(!x)continue;i.set(x,(i.get(x)||0)+y);const w=a.get(x)||0;y>=w&&(a.set(x,y),o.set(x,b))}}if(!i.size)return[];const c=Array.from(i.values()).reduce((f,p)=>f+p,0),u=l>0?l:c,d=Number.isFinite(t)?Math.max(0,Math.floor(t)):3;return Array.from(i.entries()).map(([f,p])=>{const m=u>0?(p/u*100).toFixed(1):"0.0";return{id:f,name:o.get(f)||s("shared.placeholder.short"),tokens:p,percent:String(m)}}).sort((f,p)=>p.tokens!==f.tokens?p.tokens-f.tokens:String(f.name).localeCompare(String(p.name))).slice(0,d)}function xi(){const e=h.useContext(Hf);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}const Ct=12,fn=3,dr=26,Dm=["#ecfdf5","#a7f3d0","#6ee7b7","#34d399","#10b981"],Nm=["#064e3b","#065f46","#059669","#10b981","#34d399"],jm=[P("heatmap.month.jan"),P("heatmap.month.feb"),P("heatmap.month.mar"),P("heatmap.month.apr"),P("heatmap.month.may"),P("heatmap.month.jun"),P("heatmap.month.jul"),P("heatmap.month.aug"),P("heatmap.month.sep"),P("heatmap.month.oct"),P("heatmap.month.nov"),P("heatmap.month.dec")];function Vm(e){if(typeof e=="bigint")return e.toLocaleString();if(typeof e=="number")return Number.isFinite(e)?Math.round(e).toLocaleString():"0";if(typeof e=="string"){const t=Number(e);return Number.isFinite(t)?Math.round(t).toLocaleString():e}return"0"}function Lm(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3])));return Number.isFinite(n.getTime())?n:null}function ec(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function Im(e,t){return Math.floor((Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))/864e5)}function Fm(e,t){const n=t==="mon"?1:0,s=e.getUTCDay();return ec(e,-((s-n+7)%7))}function _m(e,t,n){if(!e)return[];const s=Lm(t)||new Date,r=[];for(let c=11;c>=0;c-=1)r.push(new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth()-c,1)));const i=Fm(s,n),o=ec(i,-(e-1)*7),a=[],l=new Set;for(const c of r){const u=Math.floor(Im(o,c)/7);u<0||u>=e||l.has(u)||(l.add(u),a.push({label:jm[c.getUTCMonth()],index:u}))}return a}function Om({heatmap:e,timeZoneLabel:t,timeZoneShortLabel:n,hideLegend:s=!1}){const{resolvedTheme:r}=xi(),o=r==="dark"?Nm:Dm,a=h.useRef(null);h.useEffect(()=>{const m=a.current;m&&(m.scrollLeft=m.scrollWidth)},[e?.weeks]);const l=e?.week_starts_on==="mon"?"mon":"sun",c=h.useMemo(()=>{const m=Array.isArray(e?.weeks)?e.weeks:[];if(!m.length)return{weeks:[]};const y=[];for(const b of m)for(const x of Array.isArray(b)?b:[])x?.day&&y.push({day:x.day,total_tokens:x.total_tokens??x.value??0,billable_total_tokens:x.billable_total_tokens??x.value??x.total_tokens??0});return Or({dailyRows:y,weeks:Math.max(52,m.length),to:e?.to,weekStartsOn:l})},[e?.to,e?.weeks,l]),u=c?.weeks||[],d=l==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(m=>P(`heatmap.day.${m.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(m=>P(`heatmap.day.${m.toLowerCase()}`)),f=h.useMemo(()=>_m(u.length,c?.to,l),[c?.to,u.length,l]);if(!u.length)return g.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:P("heatmap.empty")});const p=dr+u.length*Ct+Math.max(0,u.length-1)*fn;return g.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[g.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[g.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:P("heatmap.title")}),g.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-400",children:n||P("heatmap.legend.utc")})]}),g.jsx("div",{ref:a,className:"overflow-x-auto overflow-y-hidden heatmap-scroll-thin",children:g.jsxs("div",{style:{minWidth:p},children:[g.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:`${dr}px repeat(${u.length}, ${Ct}px)`,columnGap:fn},children:[g.jsx("span",{}),f.map(m=>g.jsx("span",{style:{gridColumnStart:m.index+2},className:"whitespace-nowrap",children:m.label},`${m.label}-${m.index}`))]}),g.jsxs("div",{className:"grid",style:{gridTemplateColumns:`${dr}px repeat(${u.length}, ${Ct}px)`,columnGap:fn},children:[g.jsx("div",{className:"grid text-[10px] text-oai-gray-400 dark:text-oai-gray-400 sticky left-0 bg-white dark:bg-oai-gray-900 pr-2",style:{gridTemplateRows:`repeat(7, ${Ct}px)`,rowGap:fn},children:d.map(m=>g.jsx("span",{className:"leading-none",children:m},m))}),g.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${Ct}px)`,gap:fn},children:u.map((m,y)=>(Array.isArray(m)?m:[]).map((b,x)=>{if(!b)return null;const w=b.day||`e-${y}-${x}`,v=Number(b.level)||0,k=o[v]||o[0],S=t||n||P("heatmap.legend.utc");return g.jsx("span",{title:P("heatmap.tooltip",{day:b.day,value:Vm(b.value),unit:P("heatmap.unit.tokens"),tz:S}),className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10",style:{width:Ct,height:Ct,background:k}},w)}))})]})]})}),!s&&g.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:P("heatmap.legend.less")}),g.jsx("div",{className:"flex gap-0.5",children:o.map((m,y)=>g.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:m}},y))}),g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:P("heatmap.legend.more")})]})]})}const Bm={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},tc={...Bm,position:"fixed",top:0,left:0};function zn(e){const t=Mn($m,e).current;return t.next=e,Pe(t.effect),t}function $m(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ws=Symbol("NOT_FOUND");function Um(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wm(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Km(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var Uo=e=>Array.isArray(e)?e:[e];function Hm(e){const t=Array.isArray(e[0])?e[0]:e;return Km(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Gm(e,t){const n=[],{length:s}=e;for(let r=0;r<s;r++)n.push(e[r].apply(null,t));return n}function Ym(e){let t;return{get(n){return t&&e(t.key,n)?t.value:ws},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function zm(e,t){let n=[];function s(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return ws}function r(a,l){s(a)===ws&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function i(){return n}function o(){n=[]}return{get:s,put:r,getEntries:i,clear:o}}var qm=(e,t)=>e===t;function Xm(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:r}=n;for(let i=0;i<r;i++)if(!e(n[i],s[i]))return!1;return!0}}function Zm(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=qm,maxSize:r=1,resultEqualityCheck:i}=n,o=Xm(s);let a=0;const l=r<=1?Ym(o):zm(r,o);function c(){let u=l.get(arguments);if(u===ws){if(u=e.apply(null,arguments),a++,i){const f=l.getEntries().find(p=>i(p.value,u));f&&(u=f.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var Jm=class{constructor(e){this.value=e}deref(){return this.value}},Qm=typeof WeakRef<"u"?WeakRef:Jm,ep=0,Wo=1;function qn(){return{s:ep,v:void 0,o:null,p:null}}function nc(e,t={}){let n=qn();const{resultEqualityCheck:s}=t;let r,i=0;function o(){let a=n;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const y=m.get(p);y===void 0?(a=qn(),m.set(p,a)):a=y}else{let m=a.p;m===null&&(a.p=m=new Map);const y=m.get(p);y===void 0?(a=qn(),m.set(p,a)):a=y}}const c=a;let u;if(a.s===Wo)u=a.v;else if(u=e.apply(null,arguments),i++,s){const d=r?.deref?.()??r;d!=null&&s(d,u)&&(u=d,i!==0&&i--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Qm(u):u}return c.s=Wo,c.v=u,u}return o.clearCache=()=>{n=qn(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function sc(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...r)=>{let i=0,o=0,a,l={},c=r.pop();typeof c=="object"&&(l=c,c=r.pop()),Um(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:p=nc,argsMemoizeOptions:m=[]}=u,y=Uo(f),b=Uo(m),x=Hm(r),w=d(function(){return i++,c.apply(null,arguments)},...y),v=p(function(){o++;const S=Gm(x,arguments);return a=w.apply(null,S),a},...b);return Object.assign(v,{resultFunc:c,memoizedResultFunc:w,dependencies:x,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:p})};return Object.assign(s,{withTypes:()=>s}),s}var tp=sc(nc),np=Object.assign((e,t=tp)=>{Wm(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(i=>e[i]);return t(s,(...i)=>i.reduce((o,a,l)=>(o[n[l]]=a,o),{}))},{withTypes:()=>np});sc({memoize:Zm,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const oe=(e,t,n,s,r,i,...o)=>{if(o.length>0)throw new Error(pi(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var fr={exports:{}},hr={};var Ko;function sp(){if(Ko)return hr;Ko=1;var e=Tl();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(d,f){var p=f(),m=s({inst:{value:p,getSnapshot:f}}),y=m[0].inst,b=m[1];return i(function(){y.value=p,y.getSnapshot=f,l(y)&&b({inst:y})},[d,p,f]),r(function(){return l(y)&&b({inst:y}),d(function(){l(y)&&b({inst:y})})},[d]),o(p),p}function l(d){var f=d.getSnapshot;d=d.value;try{var p=f();return!n(d,p)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return hr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,hr}var Ho;function rc(){return Ho||(Ho=1,fr.exports=sp()),fr.exports}var rp=rc(),mr={exports:{}},pr={};var Go;function ip(){if(Go)return pr;Go=1;var e=Tl(),t=rc();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return pr.useSyncExternalStoreWithSelector=function(c,u,d,f,p){var m=i(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function x(R){if(!w){if(w=!0,v=R,R=f(R),p!==void 0&&y.hasValue){var N=y.value;if(p(N,R))return k=N}return k=R}if(N=k,s(v,R))return N;var C=f(R);return p!==void 0&&p(N,C)?(v=R,N):(v=R,k=C)}var w=!1,v,k,S=d===void 0?null:d;return[function(){return x(u())},S===null?void 0:function(){return x(S())}]},[u,d,f,p]);var b=r(c,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=b},[b]),l(b),b},pr}var Yo;function op(){return Yo||(Yo=1,mr.exports=ip()),mr.exports}var ap=op();const lp=kl(19),cp=lp?dp:fp;function up(e,t,n,s,r){return cp(e,t,n,s,r)}function dp(e,t,n,s,r){const i=h.useCallback(()=>t(e.getSnapshot(),n,s,r),[e,t,n,s,r]);return rp.useSyncExternalStore(e.subscribe,i,i)}function fp(e,t,n,s,r){return ap.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,s,r))}class bn{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){bn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||bn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};bn.prototype.setState.call(this,t)}}class ic extends bn{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){h.useDebugValue(t),Pe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;Pe(()=>(s.state[t]!==n&&s.set(t,n),()=>{s.set(t,void 0)}),[s,t,n])}useSyncedValues(t){const n=this,s=Object.values(t);Pe(()=>{n.update(t)},[n,...s])}useControlledProp(t,n,s){h.useDebugValue(t);const r=this,i=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,i),!i&&!Object.is(this.state[t],s)&&super.setState({...this.state,[t]:s})),Pe(()=>{i&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,s,i])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(t,n,s,r)=>{const i=this.selectors[t];return i(this.state,n,s,r)};useState=(t,n,s,r)=>{h.useDebugValue(t);const i=this.selectors[t];return up(this,i,n,s,r)};useContextCallback(t,n){h.useDebugValue(t);const s=ie(n??Cl);this.context[t]=s}useStateSetter(t){const n=h.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let r=s(this.state);return n(r,r,this),this.subscribe(i=>{const o=s(i);if(!Object.is(r,o)){const a=r;r=o,n(o,a,this)}})}}const Xn=null;class hp{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Zn=new hp;class rt{static create(){return new rt}static request(t){return Zn.request(t)}static cancel(t){return Zn.cancel(t)}currentId=Xn;request(t){this.cancel(),this.currentId=Zn.request(()=>{this.currentId=Xn,t()})}cancel=()=>{this.currentId!==Xn&&(Zn.cancel(this.currentId),this.currentId=Xn)};disposeEffect=()=>this.cancel}function oc(){const e=Mn(rt.create).current;return jl(e.disposeEffect),e}function mp(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const pp=h.createContext(null),gp=h.createContext(null),ac=()=>h.useContext(pp)?.id||null,lc=e=>{const t=h.useContext(gp);return e??t};function Ss(e){return`data-base-ui-${e}`}const Ts=h.forwardRef(function(t,n){const[s,r]=h.useState();Pe(()=>{Ah&&r("button")},[]);const i={tabIndex:0,role:s};return g.jsx("span",{...t,ref:n,style:tc,"aria-hidden":s?void 0:!0,...i,"data-base-ui-focus-guard":""})});let zo=0;function gr(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:r=!1}=t;s&&cancelAnimationFrame(zo);const i=()=>e?.focus({preventScroll:n});r?i():zo=requestAnimationFrame(i)}const Yt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function qo(e){return e==="inert"?Yt.inert:e==="aria-hidden"?Yt["aria-hidden"]:Yt.none}let Jn=new WeakSet,Qn={},yr=0;const cc=e=>e&&(e.host||cc(e.parentNode)),yp=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=cc(n);return e.contains(s)?s:null}).filter(n=>n!=null);function bp(e,t,n,s){const r="data-base-ui-inert",i=s?"inert":n?"aria-hidden":null,o=yp(t,e),a=new Set,l=new Set(o),c=[];Qn[r]||(Qn[r]=new WeakMap);const u=Qn[r];o.forEach(d),f(t),a.clear();function d(p){!p||a.has(p)||(a.add(p),p.parentNode&&d(p.parentNode))}function f(p){!p||l.has(p)||[].forEach.call(p.children,m=>{if(El(m)!=="script")if(a.has(m))f(m);else{const y=i?m.getAttribute(i):null,b=y!==null&&y!=="false",x=qo(i),w=(x.get(m)||0)+1,v=(u.get(m)||0)+1;x.set(m,w),u.set(m,v),c.push(m),w===1&&b&&Jn.add(m),v===1&&m.setAttribute(r,""),!b&&i&&m.setAttribute(i,i==="inert"?"":"true")}})}return yr+=1,()=>{c.forEach(p=>{const m=qo(i),b=(m.get(p)||0)-1,x=(u.get(p)||0)-1;m.set(p,b),u.set(p,x),b||(!Jn.has(p)&&i&&p.removeAttribute(i),Jn.delete(p)),x||p.removeAttribute(r)}),yr-=1,yr||(Yt.inert=new WeakMap,Yt["aria-hidden"]=new WeakMap,Yt.none=new WeakMap,Jn=new WeakSet,Qn={})}}function xp(e,t=!1,n=!1){const s=Le(e[0]).body;return bp(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const uc=h.createContext(null),dc=()=>h.useContext(uc),vp=Ss("portal");function wp(e={}){const{ref:t,container:n,componentProps:s=gn,elementProps:r,elementState:i}=e,o=yi(),l=dc()?.portalNode,[c,u]=h.useState(null),[d,f]=h.useState(null),p=ie(x=>{x!==null&&f(x)}),m=h.useRef(null);Pe(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}if(o==null)return;const x=(n&&(Gf(n)?n:n.current))??l??document.body;if(x==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==x&&(m.current=x,f(null),u(x))},[n,l,o]);const y=Dn("div",s,{ref:[t,p],state:i,props:[{id:o,[vp]:""},r]});return{portalNode:d,portalSubtree:c&&y?gi.createPortal(y,c):null}}const Sp=h.forwardRef(function(t,n){const{children:s,container:r,className:i,render:o,renderGuards:a,...l}=t,{portalNode:c,portalSubtree:u}=wp({container:r,ref:n,componentProps:t,elementProps:l}),d=h.useRef(null),f=h.useRef(null),p=h.useRef(null),m=h.useRef(null),[y,b]=h.useState(null),x=y?.modal,w=y?.open,v=typeof a=="boolean"?a:!!y&&!y.modal&&y.open&&!!c;h.useEffect(()=>{if(!c||x)return;function S(R){c&&R.relatedTarget&&yn(R)&&(R.type==="focusin"?Fo:tm)(c)}return c.addEventListener("focusin",S,!0),c.addEventListener("focusout",S,!0),()=>{c.removeEventListener("focusin",S,!0),c.removeEventListener("focusout",S,!0)}},[c,x]),h.useEffect(()=>{!c||w||Fo(c)},[w,c]);const k=h.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:b}),[c]);return g.jsxs(h.Fragment,{children:[u,g.jsxs(uc.Provider,{value:k,children:[v&&c&&g.jsx(Ts,{"data-type":"outside",ref:d,onFocus:S=>{if(yn(S,c))p.current?.focus();else{const R=y?y.domReference:null;zl(R)?.focus()}}}),v&&c&&g.jsx("span",{"aria-owns":c.id,style:kh}),c&&gi.createPortal(s,c),v&&c&&g.jsx(Ts,{"data-type":"outside",ref:f,onFocus:S=>{if(yn(S,c))m.current?.focus();else{const R=y?y.domReference:null;Yl(R)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,pt(Al,S.nativeEvent))}}})]})]})});function mt(e){return e==null?e:"current"in e?e.current:e}function Tp(e,t){const n=Vs(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Xo=20;let xt=[];function vi(){xt=xt.filter(e=>e.isConnected)}function kp(e){vi(),e&&El(e)!=="body"&&(xt.push(e),xt.length>Xo&&(xt=xt.slice(-Xo)))}function br(){return vi(),xt[xt.length-1]}function Cp(e){if(!e)return null;const t=jn();return Hl(e,t)?e:Ls(e,t)[0]||e}function Ep(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Rl(e).display!=="none"}function Zo(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=jn(),r=em(e,n).filter(o=>{const a=o.getAttribute("data-tabindex")||"";return Hl(o,n)||o.hasAttribute("data-tabindex")&&!a.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ap(e){const{context:t,children:n,disabled:s=!1,order:r=["content"],initialFocus:i=!0,returnFocus:o=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:y}=e,b="rootStore"in t?t.rootStore:t,x=b.useState("open"),w=b.useState("domReferenceElement"),v=b.useState("floatingElement"),{events:k,dataRef:S}=b.context,R=ie(()=>S.current.floatingContext?.nodeId),N=ie(d),C=i===!1,I=Vo(w)&&C,A=zn(r),M=zn(i),U=zn(o),V=zn(u),$=lc(y),j=dc(),W=h.useRef(null),pe=h.useRef(null),D=h.useRef(!1),_=h.useRef(!1),z=h.useRef(!1),X=h.useRef(-1),se=h.useRef(""),H=h.useRef(""),Q=h.useRef(null),ee=h.useRef(null),de=Do(Q,m,j?.beforeInsideRef),be=Do(ee,j?.afterInsideRef),Ne=ps(),Oe=ps(),Qe=oc(),et=j!=null,E=Ur(v),te=ie((L=E)=>L?Ls(L,jn()):[]),G=ie(L=>{const J=te(L);return A.current.map(()=>J).filter(Boolean).flat()});h.useEffect(()=>{if(s||!l)return;function L(Z){Z.key==="Tab"&&we(E,Bt(Le(E)))&&te().length===0&&!I&&Lh(Z)}const J=Le(E);return J.addEventListener("keydown",L),()=>{J.removeEventListener("keydown",L)}},[s,w,E,l,A,I,te,G]),h.useEffect(()=>{if(s||!v)return;function L(J){const Z=qe(J),ue=te().indexOf(Z);ue!==-1&&(X.current=ue)}return v.addEventListener("focusin",L),()=>{v.removeEventListener("focusin",L)}},[s,v,te]),h.useEffect(()=>{if(s||!x)return;const L=Le(E);function J(){z.current=!1}function Z(ue){const K=qe(ue),Y=we(v,K)||we(w,K)||we(j?.portalNode,K);z.current=!Y,H.current=ue.pointerType||"keyboard"}function ne(){H.current="keyboard"}return L.addEventListener("pointerdown",Z,!0),L.addEventListener("pointerup",J,!0),L.addEventListener("pointercancel",J,!0),L.addEventListener("keydown",ne,!0),()=>{L.removeEventListener("pointerdown",Z,!0),L.removeEventListener("pointerup",J,!0),L.removeEventListener("pointercancel",J,!0),L.removeEventListener("keydown",ne,!0)}},[s,v,w,E,x,j]),h.useEffect(()=>{if(s||!c)return;function L(){_.current=!0,Oe.start(0,()=>{_.current=!1})}function J(K){const Y=K.relatedTarget,Ee=K.currentTarget,he=qe(K);queueMicrotask(()=>{const je=R(),Ve=b.context.triggerElements,ct=Y?.hasAttribute(Ss("focus-guard"))&&[Q.current,ee.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,mt(p),mt(f)].includes(Y),ve=!(we(w,Y)||we(v,Y)||we(Y,v)||we(j?.portalNode,Y)||Y!=null&&Ve.hasElement(Y)||Ve.hasMatchingElement(re=>we(re,Y))||ct||$&&(Gt($.nodesRef.current,je).find(re=>we(re.context?.elements.floating,Y)||we(re.context?.elements.domReference,Y))||Lo($.nodesRef.current,je).find(re=>[re.context?.elements.floating,Ur(re.context?.elements.floating)].includes(Y)||re.context?.elements.domReference===Y)));if(Ee===w&&E&&Zo(E,A),a&&Ee!==w&&!Ep(he)&&Bt(Le(E))===Le(E).body){if(Rt(E)&&(E.focus(),a==="popup")){Qe.request(()=>{E.focus()});return}const re=X.current,Re=te(),Ie=Re[re]||Re[Re.length-1]||E;Rt(Ie)&&Ie.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(I||!l)&&Y&&ve&&!_.current&&(I||Y!==br())&&(D.current=!0,b.setOpen(!1,pt(Al,K)))})}function Z(){z.current||(S.current.insideReactTree=!0,Ne.start(0,()=>{S.current.insideReactTree=!1}))}const ne=Rt(w)?w:null,ue=[];if(!(!v&&!ne))return ne&&(ne.addEventListener("focusout",J),ne.addEventListener("pointerdown",L),ue.push(()=>{ne.removeEventListener("focusout",J),ne.removeEventListener("pointerdown",L)})),v&&(v.addEventListener("focusout",J),j&&(v.addEventListener("focusout",Z,!0),ue.push(()=>{v.removeEventListener("focusout",Z,!0)})),ue.push(()=>{v.removeEventListener("focusout",J)})),()=>{ue.forEach(K=>{K()})}},[s,w,v,E,l,$,j,b,c,a,te,I,R,A,S,Ne,Oe,Qe,f,p]),h.useEffect(()=>{if(s||!v||!x)return;const L=Array.from(j?.portalNode?.querySelectorAll(`[${Ss("portal")}]`)||[]),Z=($?Lo($.nodesRef.current,R()):[]).find(K=>Vo(K.context?.elements.domReference||null))?.context?.elements.domReference,ne=[v,Z,...L,...N(),W.current,pe.current,Q.current,ee.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,mt(p),mt(f),I?w:null].filter(K=>K!=null),ue=xp(ne,l||I);return()=>{ue()}},[x,s,w,v,l,A,j,I,$,R,N,f,p]),Pe(()=>{if(!x||s||!Rt(E))return;const L=Le(E),J=Bt(L);queueMicrotask(()=>{const Z=G(E),ne=M.current,ue=typeof ne=="function"?ne(V.current||""):ne;if(ue===void 0||ue===!1)return;let K;ue===!0||ue===null?K=Z[0]||E:K=mt(ue),K=K||Z[0]||E,!we(E,J)&&gr(K,{preventScroll:K===E})})},[s,x,E,C,G,M,V]),Pe(()=>{if(s||!E)return;const L=Le(E),J=Bt(L);kp(J);function Z(K){if(K.open||(se.current=Tp(K.nativeEvent,H.current)),K.reason===Yf&&K.nativeEvent.type==="mouseleave"&&(D.current=!0),K.reason===Pl)if(K.nested)D.current=!1;else if(Fh(K.nativeEvent)||_h(K.nativeEvent))D.current=!1;else{let Y=!1;document.createElement("div").focus({get preventScroll(){return Y=!0,!1}}),Y?D.current=!1:D.current=!0}}k.on("openchange",Z);const ne=L.createElement("span");ne.setAttribute("tabindex","-1"),ne.setAttribute("aria-hidden","true"),Object.assign(ne.style,tc),et&&w&&w.insertAdjacentElement("afterend",ne);function ue(){const K=U.current;let Y=typeof K=="function"?K(se.current):K;if(Y===void 0||Y===!1)return null;if(Y===null&&(Y=!0),typeof Y=="boolean"){const he=w||br();return he&&he.isConnected?he:ne}const Ee=w||br()||ne;return mt(Y)||Ee}return()=>{k.off("openchange",Z);const K=Bt(L),Y=we(v,K)||$&&Gt($.nodesRef.current,R(),!1).some(he=>we(he.context?.elements.floating,K)),Ee=ue();queueMicrotask(()=>{const he=Cp(Ee),je=typeof U.current!="boolean";U.current&&!D.current&&Rt(he)&&(!(!je&&he!==K&&K!==L.body)||Y)&&he.focus({preventScroll:!0}),ne.remove()})}},[s,v,E,U,S,k,$,et,w,R]),h.useEffect(()=>{queueMicrotask(()=>{D.current=!1})},[s]),h.useEffect(()=>{if(s||!x)return;function L(Z){qe(Z)?.closest(`[${Th}]`)&&(_.current=!0)}const J=Le(E);return J.addEventListener("pointerdown",L,!0),()=>{J.removeEventListener("pointerdown",L,!0)}},[s,x,E]),Pe(()=>{if(!s&&j)return j.setFocusManagerState({modal:l,closeOnFocusOut:c,open:x,onOpenChange:b.setOpen,domReference:w}),()=>{j.setFocusManagerState(null)}},[s,j,l,x,b,c,w]),Pe(()=>{if(!(s||!E))return Zo(E,A),()=>{queueMicrotask(vi)}},[s,E,A]);const xe=!s&&(l?!I:!0)&&(et||l);return g.jsxs(h.Fragment,{children:[xe&&g.jsx(Ts,{"data-type":"inside",ref:de,onFocus:L=>{if(l){const J=G();gr(J[J.length-1])}else j?.portalNode&&(D.current=!1,yn(L,j.portalNode)?Yl(w)?.focus():mt(p??j.beforeOutsideRef)?.focus())}}),n,xe&&g.jsx(Ts,{"data-type":"inside",ref:be,onFocus:L=>{l?gr(G()[0]):j?.portalNode&&(c&&(D.current=!0),yn(L,j.portalNode)?zl(w)?.focus():mt(f??j.afterOutsideRef)?.focus())}})]})}const Pp={intentional:"onClick",sloppy:"onPointerDown"};function Rp(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Mp(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingElement"),i=n.useState("referenceElement"),o=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:c=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f="sloppy",referencePress:p=!1,referencePressEvent:m="sloppy",ancestorScroll:y=!1,bubbles:b,externalTree:x}=t,w=lc(x),v=ie(typeof d=="function"?d:()=>!1),k=typeof d=="function"?v:d,S=h.useRef(!1),{escapeKey:R,outsidePress:N}=Rp(b),C=h.useRef(null),I=ps(),A=ps(),M=ie(()=>{A.clear(),l.current.insideReactTree=!1}),U=h.useRef(!1),V=h.useRef(""),$=ie(E=>{V.current=E.pointerType}),j=ie(()=>{const E=V.current,te=E==="pen"||!E?"mouse":E,G=typeof f=="function"?f():f;return typeof G=="string"?G:G[te]}),W=ie(E=>{if(!s||!c||!u||E.key!=="Escape"||U.current)return;const te=l.current.floatingContext?.nodeId,G=w?Gt(w.nodesRef.current,te):[];if(!R&&G.length>0){let J=!0;if(G.forEach(Z=>{Z.context?.open&&!Z.context.dataRef.current.__escapeKeyBubbles&&(J=!1)}),!J)return}const xe=Ih(E)?E.nativeEvent:E,L=pt(zf,xe);n.setOpen(!1,L),!R&&!L.isPropagationAllowed&&E.stopPropagation()}),pe=ie(E=>{const te=j();return te==="intentional"&&E.type!=="click"||te==="sloppy"&&E.type==="click"}),D=ie(()=>{l.current.insideReactTree=!0,A.start(0,M)}),_=ie((E,te=!1)=>{if(pe(E)){M();return}if(l.current.insideReactTree){M();return}if(j()==="intentional"&&te||typeof k=="function"&&!k(E))return;const G=qe(E),xe=`[${Ss("inert")}]`,L=Le(n.select("floatingElement")).querySelectorAll(xe),J=n.context.triggerElements;if(G&&(J.hasElement(G)||J.hasMatchingElement(Y=>we(Y,G))))return;let Z=At(G)?G:null;for(;Z&&!er(Z);){const Y=qf(Z);if(er(Y)||!At(Y))break;Z=Y}if(L.length&&At(G)&&!jh(G)&&!we(G,n.select("floatingElement"))&&Array.from(L).every(Y=>!we(Z,Y)))return;if(Rt(G)&&!("touches"in E)){const Y=er(G),Ee=Rl(G),he=/auto|scroll/,je=Y||he.test(Ee.overflowX),Ve=Y||he.test(Ee.overflowY),ct=je&&G.clientWidth>0&&G.scrollWidth>G.clientWidth,ve=Ve&&G.clientHeight>0&&G.scrollHeight>G.clientHeight,re=Ee.direction==="rtl",Re=ve&&(re?E.offsetX<=G.offsetWidth-G.clientWidth:E.offsetX>G.clientWidth),Ie=ct&&E.offsetY>G.clientHeight;if(Re||Ie)return}const ne=l.current.floatingContext?.nodeId,ue=w&&Gt(w.nodesRef.current,ne).some(Y=>Ge(E,Y.context?.elements.floating));if(Ge(E,n.select("floatingElement"))||Ge(E,n.select("domReferenceElement"))||ue)return;const K=w?Gt(w.nodesRef.current,ne):[];if(K.length>0){let Y=!0;if(K.forEach(Ee=>{Ee.context?.open&&!Ee.context.dataRef.current.__outsidePressBubbles&&(Y=!1)}),!Y)return}n.setOpen(!1,pt(Pl,E)),M()}),z=ie(E=>{j()!=="sloppy"||E.pointerType==="touch"||!n.select("open")||!c||Ge(E,n.select("floatingElement"))||Ge(E,n.select("domReferenceElement"))||_(E)}),X=ie(E=>{if(j()!=="sloppy"||!n.select("open")||!c||Ge(E,n.select("floatingElement"))||Ge(E,n.select("domReferenceElement")))return;const te=E.touches[0];te&&(C.current={startTime:Date.now(),startX:te.clientX,startY:te.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},I.start(1e3,()=>{C.current&&(C.current.dismissOnTouchEnd=!1,C.current.dismissOnMouseDown=!1)}))}),se=ie(E=>{const te=qe(E);function G(){X(E),te?.removeEventListener(E.type,G)}te?.addEventListener(E.type,G)}),H=ie(E=>{const te=S.current;if(S.current=!1,I.clear(),E.type==="mousedown"&&C.current&&!C.current.dismissOnMouseDown)return;const G=qe(E);function xe(){E.type==="pointerdown"?z(E):_(E,te),G?.removeEventListener(E.type,xe)}G?.addEventListener(E.type,xe)}),Q=ie(E=>{if(j()!=="sloppy"||!C.current||Ge(E,n.select("floatingElement"))||Ge(E,n.select("domReferenceElement")))return;const te=E.touches[0];if(!te)return;const G=Math.abs(te.clientX-C.current.startX),xe=Math.abs(te.clientY-C.current.startY),L=Math.sqrt(G*G+xe*xe);L>5&&(C.current.dismissOnTouchEnd=!0),L>10&&(_(E),I.clear(),C.current=null)}),ee=ie(E=>{const te=qe(E);function G(){Q(E),te?.removeEventListener(E.type,G)}te?.addEventListener(E.type,G)}),de=ie(E=>{j()!=="sloppy"||!C.current||Ge(E,n.select("floatingElement"))||Ge(E,n.select("domReferenceElement"))||(C.current.dismissOnTouchEnd&&_(E),I.clear(),C.current=null)}),be=ie(E=>{const te=qe(E);function G(){de(E),te?.removeEventListener(E.type,G)}te?.addEventListener(E.type,G)});h.useEffect(()=>{if(!s||!c)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=N;const E=new qt;function te(Z){n.setOpen(!1,pt(Zf,Z))}function G(){E.clear(),U.current=!0}function xe(){E.start(Xf()?5:0,()=>{U.current=!1})}const L=Le(r);L.addEventListener("pointerdown",$,!0),u&&(L.addEventListener("keydown",W),L.addEventListener("compositionstart",G),L.addEventListener("compositionend",xe)),k&&(L.addEventListener("click",H,!0),L.addEventListener("pointerdown",H,!0),L.addEventListener("touchstart",se,!0),L.addEventListener("touchmove",ee,!0),L.addEventListener("touchend",be,!0),L.addEventListener("mousedown",H,!0));let J=[];return y&&(At(o)&&(J=tr(o)),At(r)&&(J=J.concat(tr(r))),!At(i)&&i&&i.contextElement&&(J=J.concat(tr(i.contextElement)))),J=J.filter(Z=>Z!==L.defaultView?.visualViewport),J.forEach(Z=>{Z.addEventListener("scroll",te,{passive:!0})}),()=>{L.removeEventListener("pointerdown",$,!0),u&&(L.removeEventListener("keydown",W),L.removeEventListener("compositionstart",G),L.removeEventListener("compositionend",xe)),k&&(L.removeEventListener("click",H,!0),L.removeEventListener("pointerdown",H,!0),L.removeEventListener("touchstart",se,!0),L.removeEventListener("touchmove",ee,!0),L.removeEventListener("touchend",be,!0),L.removeEventListener("mousedown",H,!0)),J.forEach(Z=>{Z.removeEventListener("scroll",te)}),E.clear(),S.current=!1}},[l,r,i,o,u,k,s,a,y,c,R,N,W,_,H,z,se,ee,be,$,n]),h.useEffect(M,[k,M]);const Ne=h.useMemo(()=>({onKeyDown:W,...p&&{[Pp[m]]:E=>{n.setOpen(!1,pt(No,E.nativeEvent))},...m!=="intentional"&&{onClick(E){n.setOpen(!1,pt(No,E.nativeEvent))}}}}),[W,n,p,m]),Oe=ie(E=>{const te=qe(E.nativeEvent);!we(n.select("floatingElement"),te)||E.button!==0||(S.current=!0)}),Qe=ie(E=>{!s||!c||E.button!==0||(S.current=!0)}),et=h.useMemo(()=>({onKeyDown:W,onPointerDown:Oe,onMouseDown:Oe,onMouseUp:Oe,onClickCapture:D,onMouseDownCapture(E){D(),Qe(E)},onPointerDownCapture(E){D(),Qe(E)},onMouseUpCapture:D,onTouchEndCapture:D,onTouchMoveCapture:D}),[W,Oe,D,Qe]);return h.useMemo(()=>c?{reference:Ne,floating:et,trigger:Ne}:{},[c,Ne,et])}const Dp={open:oe(e=>e.open),domReferenceElement:oe(e=>e.domReferenceElement),referenceElement:oe(e=>e.positionReference??e.referenceElement),floatingElement:oe(e=>e.floatingElement),floatingId:oe(e=>e.floatingId)};class fc extends ic{constructor(t){const{nested:n,noEmit:s,onOpenChange:r,triggerElements:i,...o}=t;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:mp(),nested:n,noEmit:s,triggerElements:i},Dp)}setOpen=(t,n)=>{if((!t||!this.state.open||Oh(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function Np(e,t=!1,n=!1){const[s,r]=h.useState(e&&t?"idle":void 0),[i,o]=h.useState(e);return e&&!i&&(o(!0),r("starting")),!e&&i&&s!=="ending"&&!n&&r("ending"),!e&&!i&&s==="ending"&&r(void 0),Pe(()=>{if(!e&&i&&s!=="ending"&&n){const a=rt.request(()=>{r("ending")});return()=>{rt.cancel(a)}}},[e,i,s,n]),Pe(()=>{if(!e||t)return;const a=rt.request(()=>{r(void 0)});return()=>{rt.cancel(a)}},[t,e]),Pe(()=>{if(!e||!t)return;e&&i&&s!=="idle"&&r("starting");const a=rt.request(()=>{r("idle")});return()=>{rt.cancel(a)}},[t,e,i,r,s]),h.useMemo(()=>({mounted:i,setMounted:o,transitionStatus:s}),[i,s])}let kn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const jp={[kn.startingStyle]:""},Vp={[kn.endingStyle]:""},wi={transitionStatus(e){return e==="starting"?jp:e==="ending"?Vp:null}};function Lp(e,t=!1,n=!0){const s=oc();return ie((r,i=null)=>{s.cancel();function o(){gi.flushSync(r)}const a=mt(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let c=function(){const d=kn.startingStyle;if(!l.hasAttribute(d)){s.request(u);return}const f=new MutationObserver(()=>{l.hasAttribute(d)||(f.disconnect(),u())});f.observe(l,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>f.disconnect(),{once:!0})},u=function(){Promise.all(l.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||o()}).catch(()=>{const d=l.getAnimations();if(n){if(i?.aborted)return;o()}else d.length>0&&d.some(f=>f.pending||f.playState!=="finished")&&u()})};if(t){c();return}s.request(u)}})}function hc(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,i=ie(r),o=Lp(s,n,!1);h.useEffect(()=>{if(!t)return;const a=new AbortController;return o(i,a.signal),()=>{a.abort()}},[t,n,i,o])}function Ip(e){const t=e.useState("open");Pe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,r]=n.value;e.update({activeTriggerId:s,activeTriggerElement:r})}}},[t,e])}function Fp(e,t,n){const{mounted:s,setMounted:r,transitionStatus:i}=Np(e);t.useSyncedValues({mounted:s,transitionStatus:i});const o=ie(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return hc({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:i}}class mc{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function _p(){return new fc({open:!1,floatingElement:null,referenceElement:null,triggerElements:new mc,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Op(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:_p(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:gn,inactiveTriggerProps:gn,popupProps:gn}}const Bp={open:oe(e=>e.open),mounted:oe(e=>e.mounted),transitionStatus:oe(e=>e.transitionStatus),floatingRootContext:oe(e=>e.floatingRootContext),preventUnmountingOnClose:oe(e=>e.preventUnmountingOnClose),payload:oe(e=>e.payload),activeTriggerId:oe(e=>e.activeTriggerId),activeTriggerElement:oe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:oe((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:oe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:oe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:oe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:oe(e=>e.popupProps),popupElement:oe(e=>e.popupElement),positionerElement:oe(e=>e.positionerElement)};function $p(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:r}=e,i=yi(),o=ac()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(s?"popupElement":"positionerElement"),u=t.context.triggerElements,d=Mn(()=>new fc({open:a,referenceElement:l,floatingElement:c,triggerElements:u,onOpenChange:r,floatingId:i,nested:o,noEmit:n})).current;return Pe(()=>{const f={open:a,floatingId:i,referenceElement:l,floatingElement:c};At(l)&&(f.domReferenceElement=l),d.state.positionReference===d.state.referenceElement&&(f.positionReference=l),d.update(f)},[a,i,l,c,d]),d.context.onOpenChange=r,d.context.nested=o,d.context.noEmit=n,d}function Up(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),s=e.map(c=>c?.item),r=e.map(c=>c?.trigger),i=h.useCallback(c=>es(c,e,"reference"),t),o=h.useCallback(c=>es(c,e,"floating"),n),a=h.useCallback(c=>es(c,e,"item"),s),l=h.useCallback(c=>es(c,e,"trigger"),r);return h.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:a,getTriggerProps:l}),[i,o,a,l])}function es(e,t,n){const s=new Map,r=n==="item",i={};n==="floating"&&(i.tabIndex=-1,i[$r]="");for(const o in e)r&&e&&(o===Fl||o===_l)||(i[o]=e[o]);for(let o=0;o<t.length;o+=1){let a;const l=t[o]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&Jo(i,a,r,s)}return Jo(i,e,r,s),i}function Jo(e,t,n,s){for(const r in t){const i=t[r];n&&(r===Fl||r===_l)||(r.startsWith("on")?(s.has(r)||s.set(r,[]),typeof i=="function"&&(s.get(r)?.push(i),e[r]=(...o)=>s.get(r)?.map(a=>a(...o)).find(a=>a!==void 0))):e[r]=i)}}const Wp=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Kp(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingId"),i=n.useState("domReferenceElement"),o=n.useState("floatingElement"),{enabled:a=!0,role:l="dialog"}=t,c=yi(),u=i?.id||c,d=h.useMemo(()=>Ur(o)?.id||r,[o,r]),f=Wp.get(l)??l,m=ac()!=null,y=h.useMemo(()=>f==="tooltip"||l==="label"?gn:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&m&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[f,m,l]),b=h.useMemo(()=>f==="tooltip"||l==="label"?{[`aria-${l==="label"?"labelledby":"describedby"}`]:s?d:void 0}:{...y,"aria-expanded":s?"true":"false","aria-controls":s?d:void 0,...f==="menu"&&{id:u}},[f,d,s,u,l,y]),x=h.useMemo(()=>{const v={id:d,...f&&{role:f}};return f==="tooltip"||l==="label"?v:{...v,...f==="menu"&&{"aria-labelledby":u}}},[f,d,u,l]),w=h.useCallback(({active:v,selected:k})=>{const S={role:"option",...v&&{id:`${d}-fui-option`}};switch(l){case"select":case"combobox":return{...S,"aria-selected":k}}return{}},[d,l]);return h.useMemo(()=>a?{reference:b,floating:x,item:w,trigger:y}:{},[a,b,x,y,w])}function Hp(e){const t=h.useRef(""),n=h.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:h.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Gp(e){const[t,n]=h.useState(null),s=ie((a,l)=>{e||n(l||(Il?"touch":""))}),r=h.useCallback(()=>{n(null)},[]),{onClick:i,onPointerDown:o}=Hp(s);return h.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:i,onPointerDown:o}}),[t,r,i,o])}let Xe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=kn.startingStyle]="startingStyle",e[e.endingStyle=kn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({});const Yp={[Xe.open]:""},zp={[Xe.closed]:""},qp={[Xe.anchorHidden]:""},Si={open(e){return e?Yp:zp},anchorHidden(e){return e?qp:null}};function Xp(e){return kl(19)?e:e?"true":void 0}let Qo={},ea={},ta="";function Zp(e){if(typeof document>"u")return!1;const t=Nn(e);return Vs(t).innerWidth-t.documentElement.clientWidth>0}function Jp(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=Nn(e).documentElement,r={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY};s.style.scrollbarGutter="stable",s.style.overflowY="scroll";const i=s.offsetWidth;s.style.overflowY="hidden";const o=s.offsetWidth;return Object.assign(s.style,r),i===o}function Qp(e){const t=Nn(e),n=t.documentElement,s=t.body,r=Ml(n)?n:s,i=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=i}}function eg(e){const t=Nn(e),n=t.documentElement,s=t.body,r=Vs(n);let i=0,o=0,a=!1;const l=rt.create();if(Eh&&(r.visualViewport?.scale??1)!==1)return()=>{};function c(){const f=r.getComputedStyle(n),p=r.getComputedStyle(s),b=(f.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,o=n.scrollLeft,Qo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ta=n.style.scrollBehavior,ea={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,v=f.overflowY==="scroll"||p.overflowY==="scroll",k=f.overflowX==="scroll"||p.overflowX==="scroll",S=Math.max(0,r.innerWidth-s.clientWidth),R=Math.max(0,r.innerHeight-s.clientHeight),N=parseFloat(p.marginTop)+parseFloat(p.marginBottom),C=parseFloat(p.marginLeft)+parseFloat(p.marginRight),I=Ml(n)?n:s;if(a=Jp(e),a){n.style.scrollbarGutter=b,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(x||v)&&(n.style.overflowY="scroll"),(w||k)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:N||R?`calc(100dvh - ${N+R}px)`:"100dvh",width:C||S?`calc(100vw - ${C+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=i,s.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Qo),Object.assign(s.style,ea),a||(n.scrollTop=i,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ta)}function d(){u(),l.request(c)}return c(),r.addEventListener("resize",d),()=>{l.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",d)}}class tg{lockCount=0;restore=null;timeoutLock=qt.create();timeoutUnlock=qt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=Nn(t).documentElement,r=Vs(s).getComputedStyle(s).overflowY;if(r==="hidden"||r==="clip"){this.restore=Cl;return}const i=Il||!Zp(t);this.restore=i?Qp(t):eg(t)}}const ng=new tg;function sg(e=!0,t=null){Pe(()=>{if(e)return ng.acquire(t)},[e,t])}const rg=h.forwardRef(function(t,n){const{cutout:s,...r}=t;let i;if(s){const o=s?.getBoundingClientRect();i=`polygon(
|
|
2
|
+
0% 0%,
|
|
3
|
+
100% 0%,
|
|
4
|
+
100% 100%,
|
|
5
|
+
0% 100%,
|
|
6
|
+
0% 0%,
|
|
7
|
+
${o.left}px ${o.top}px,
|
|
8
|
+
${o.left}px ${o.bottom}px,
|
|
9
|
+
${o.right}px ${o.bottom}px,
|
|
10
|
+
${o.right}px ${o.top}px,
|
|
11
|
+
${o.left}px ${o.top}px
|
|
12
|
+
)`}return g.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),pc="ArrowUp",gc="ArrowDown",yc="ArrowLeft",bc="ArrowRight",xc="Home",vc="End",ig=new Set([yc,bc]),og=new Set([pc,gc]),ag=new Set([...ig,...og]);[...ag];const lg=new Set([pc,gc,yc,bc,xc,vc]),wc=h.createContext({});function Ti(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const cg=typeof window<"u",Sc=cg?h.useLayoutEffect:h.useEffect,ki=h.createContext(null);function Ci(e,t){e.indexOf(t)===-1&&e.push(t)}function ks(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const lt=(e,t,n)=>n>t?t:n<e?e:n;let Ei=()=>{};const wt={},Tc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function kc(e){return typeof e=="object"&&e!==null}const Cc=e=>/^0[^.\s]+$/u.test(e);function Ec(e){let t;return()=>(t===void 0&&(t=e()),t)}const $e=e=>e,ug=(e,t)=>n=>t(e(n)),Vn=(...e)=>e.reduce(ug),Cn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class Ai{constructor(){this.subscriptions=[]}add(t){return Ci(this.subscriptions,t),()=>ks(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=e=>e*1e3,Be=e=>e/1e3;function Ac(e,t){return t?e*(1e3/t):0}const Pc=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,dg=1e-7,fg=12;function hg(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Pc(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>dg&&++a<fg);return o}function Ln(e,t,n,s){if(e===t&&n===s)return $e;const r=i=>hg(i,0,1,e,n);return i=>i===0||i===1?i:Pc(r(i),t,s)}const Rc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mc=e=>t=>1-e(1-t),Dc=Ln(.33,1.53,.69,.99),Pi=Mc(Dc),Nc=Rc(Pi),jc=e=>e>=1?1:(e*=2)<1?.5*Pi(e):.5*(2-Math.pow(2,-10*(e-1))),Ri=e=>1-Math.sin(Math.acos(e)),Vc=Mc(Ri),Lc=Rc(Ri),mg=Ln(.42,0,1,1),pg=Ln(0,0,.58,1),Ic=Ln(.42,0,.58,1),gg=e=>Array.isArray(e)&&typeof e[0]!="number",Fc=e=>Array.isArray(e)&&typeof e[0]=="number",yg={linear:$e,easeIn:mg,easeInOut:Ic,easeOut:pg,circIn:Ri,circInOut:Lc,circOut:Vc,backIn:Pi,backInOut:Nc,backOut:Dc,anticipate:jc},bg=e=>typeof e=="string",na=e=>{if(Fc(e)){Ei(e.length===4);const[t,n,s,r]=e;return Ln(t,n,s,r)}else if(bg(e))return yg[e];return e},ts=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xg(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&r?n:s;return d&&o.add(u),m.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,r){i=!0;return}r=!0;const d=n;n=s,s=d,n.forEach(l),n.clear(),r=!1,i&&(i=!1,c.process(u))}};return c}const vg=40;function _c(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=ts.reduce((v,k)=>(v[k]=xg(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,y=()=>{const v=wt.useManualTiming,k=v?r.timestamp:performance.now();n=!1,v||(r.delta=s?1e3/60:Math.max(Math.min(k-r.timestamp,vg),1)),r.timestamp=k,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),p.process(r),m.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},b=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:ts.reduce((v,k)=>{const S=o[k];return v[k]=(R,N=!1,C=!1)=>(n||b(),S.schedule(R,N,C)),v},{}),cancel:v=>{for(let k=0;k<ts.length;k++)o[ts[k]].cancel(v)},state:r,steps:o}}const{schedule:ae,cancel:gt,state:Ae,steps:xr}=_c(typeof requestAnimationFrame<"u"?requestAnimationFrame:$e,!0);let os;function wg(){os=void 0}const Me={now:()=>(os===void 0&&Me.set(Ae.isProcessing||wt.useManualTiming?Ae.timestamp:performance.now()),os),set:e=>{os=e,queueMicrotask(wg)}},Oc=e=>t=>typeof t=="string"&&t.startsWith(e),Bc=Oc("--"),Sg=Oc("var(--"),Mi=e=>Sg(e)?Tg.test(e.split("/*")[0].trim()):!1,Tg=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function sa(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const tn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},En={...tn,transform:e=>lt(0,1,e)},ns={...tn,default:1},xn=e=>Math.round(e*1e5)/1e5,Di=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kg(e){return e==null}const Cg=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ni=(e,t)=>n=>!!(typeof n=="string"&&Cg.test(n)&&n.startsWith(e)||t&&!kg(n)&&Object.prototype.hasOwnProperty.call(n,t)),$c=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(Di);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Eg=e=>lt(0,255,e),vr={...tn,transform:e=>Math.round(Eg(e))},Mt={test:Ni("rgb","red"),parse:$c("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+vr.transform(e)+", "+vr.transform(t)+", "+vr.transform(n)+", "+xn(En.transform(s))+")"};function Ag(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Hr={test:Ni("#"),parse:Ag,transform:Mt.transform},In=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),bt=In("deg"),at=In("%"),B=In("px"),Pg=In("vh"),Rg=In("vw"),ra={...at,parse:e=>at.parse(e)/100,transform:e=>at.transform(e*100)},Ut={test:Ni("hsl","hue"),parse:$c("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+at.transform(xn(t))+", "+at.transform(xn(n))+", "+xn(En.transform(s))+")"},Se={test:e=>Mt.test(e)||Hr.test(e)||Ut.test(e),parse:e=>Mt.test(e)?Mt.parse(e):Ut.test(e)?Ut.parse(e):Hr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Mt.transform(e):Ut.transform(e),getAnimatableNone:e=>{const t=Se.parse(e);return t.alpha=0,Se.transform(t)}},Mg=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Dg(e){return isNaN(e)&&typeof e=="string"&&(e.match(Di)?.length||0)+(e.match(Mg)?.length||0)>0}const Uc="number",Wc="color",Ng="var",jg="var(",ia="${}",Vg=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zt(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(Vg,l=>(Se.test(l)?(s.color.push(i),r.push(Wc),n.push(Se.parse(l))):l.startsWith(jg)?(s.var.push(i),r.push(Ng),n.push(l)):(s.number.push(i),r.push(Uc),n.push(parseFloat(l))),++i,ia)).split(ia);return{values:n,split:a,indexes:s,types:r}}function Lg(e){return Zt(e).values}function Kc({split:e,types:t}){const n=e.length;return s=>{let r="";for(let i=0;i<n;i++)if(r+=e[i],s[i]!==void 0){const o=t[i];o===Uc?r+=xn(s[i]):o===Wc?r+=Se.transform(s[i]):r+=s[i]}return r}}function Ig(e){return Kc(Zt(e))}const Fg=e=>typeof e=="number"?0:Se.test(e)?Se.getAnimatableNone(e):e,_g=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:Fg(e);function Og(e){const t=Zt(e);return Kc(t)(t.values.map((s,r)=>_g(s,t.split[r])))}const Je={test:Dg,parse:Lg,createTransformer:Ig,getAnimatableNone:Og};function wr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Bg({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=wr(l,a,e+1/3),i=wr(l,a,e),o=wr(l,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Cs(e,t){return n=>n>0?t:e}const fe=(e,t,n)=>e+(t-e)*n,Sr=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},$g=[Hr,Mt,Ut],Ug=e=>$g.find(t=>t.test(e));function oa(e){const t=Ug(e);if(!t)return!1;let n=t.parse(e);return t===Ut&&(n=Bg(n)),n}const aa=(e,t)=>{const n=oa(e),s=oa(t);if(!n||!s)return Cs(e,t);const r={...n};return i=>(r.red=Sr(n.red,s.red,i),r.green=Sr(n.green,s.green,i),r.blue=Sr(n.blue,s.blue,i),r.alpha=fe(n.alpha,s.alpha,i),Mt.transform(r))},Gr=new Set(["none","hidden"]);function Wg(e,t){return Gr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Kg(e,t){return n=>fe(e,t,n)}function ji(e){return typeof e=="number"?Kg:typeof e=="string"?Mi(e)?Cs:Se.test(e)?aa:Yg:Array.isArray(e)?Hc:typeof e=="object"?Se.test(e)?aa:Hg:Cs}function Hc(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>ji(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function Hg(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=ji(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Gg(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const Yg=(e,t)=>{const n=Je.createTransformer(t),s=Zt(e),r=Zt(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Gr.has(e)&&!r.values.length||Gr.has(t)&&!s.values.length?Wg(e,t):Vn(Hc(Gg(s,r),r.values),n):Cs(e,t)};function Gc(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?fe(e,t,n):ji(e)(e,t)}const zg=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ae.update(t,n),stop:()=>gt(t),now:()=>Ae.isProcessing?Ae.timestamp:Me.now()}},Yc=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Es=2e4;function Vi(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Es;)t+=n,s=e.next(t);return t>=Es?1/0:t}function qg(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Vi(s),Es);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:Be(r)}}const ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Yr(e,t){return e*Math.sqrt(1-t*t)}const Xg=12;function Zg(e,t,n){let s=n;for(let r=1;r<Xg;r++)s=s-e(s)/t(s);return s}const Tr=.001;function Jg({duration:e=ye.duration,bounce:t=ye.bounce,velocity:n=ye.velocity,mass:s=ye.mass}){let r,i,o=1-t;o=lt(ye.minDamping,ye.maxDamping,o),e=lt(ye.minDuration,ye.maxDuration,Be(e)),o<1?(r=c=>{const u=c*o,d=u*e,f=u-n,p=Yr(c,o),m=Math.exp(-d);return Tr-f/p*m},i=c=>{const d=c*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-d),y=Yr(Math.pow(c,2),o);return(-r(c)+Tr>0?-1:1)*((f-p)*m)/y}):(r=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Tr+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=Zg(r,i,a);if(e=_e(e),isNaN(l))return{stiffness:ye.stiffness,damping:ye.damping,duration:e};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:e}}}const Qg=["duration","bounce"],ey=["stiffness","damping","mass"];function la(e,t){return t.some(n=>e[n]!==void 0)}function ty(e){let t={velocity:ye.velocity,stiffness:ye.stiffness,damping:ye.damping,mass:ye.mass,isResolvedFromDuration:!1,...e};if(!la(e,ey)&&la(e,Qg))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*lt(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ye.mass,stiffness:r,damping:i}}else{const n=Jg({...e,velocity:0});t={...t,...n,mass:ye.mass},t.isResolvedFromDuration=!0}return t}function As(e=ye.visualDuration,t=ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ty({...n,velocity:-Be(n.velocity||0)}),m=f||0,y=c/(2*Math.sqrt(l*u)),b=o-i,x=Be(Math.sqrt(l/u)),w=Math.abs(b)<5;s||(s=w?ye.restSpeed.granular:ye.restSpeed.default),r||(r=w?ye.restDelta.granular:ye.restDelta.default);let v,k,S,R,N,C;if(y<1)S=Yr(x,y),R=(m+y*x*b)/S,v=A=>{const M=Math.exp(-y*x*A);return o-M*(R*Math.sin(S*A)+b*Math.cos(S*A))},N=y*x*R+b*S,C=y*x*b-R*S,k=A=>Math.exp(-y*x*A)*(N*Math.sin(S*A)+C*Math.cos(S*A));else if(y===1){v=M=>o-Math.exp(-x*M)*(b+(m+x*b)*M);const A=m+x*b;k=M=>Math.exp(-x*M)*(x*A*M-m)}else{const A=x*Math.sqrt(y*y-1);v=$=>{const j=Math.exp(-y*x*$),W=Math.min(A*$,300);return o-j*((m+y*x*b)*Math.sinh(W)+A*b*Math.cosh(W))/A};const M=(m+y*x*b)/A,U=y*x*M-b*A,V=y*x*b-M*A;k=$=>{const j=Math.exp(-y*x*$),W=Math.min(A*$,300);return j*(U*Math.sinh(W)+V*Math.cosh(W))}}const I={calculatedDuration:p&&d||null,velocity:A=>_e(k(A)),next:A=>{if(!p&&y<1){const U=Math.exp(-y*x*A),V=Math.sin(S*A),$=Math.cos(S*A),j=o-U*(R*V+b*$),W=_e(U*(N*V+C*$));return a.done=Math.abs(W)<=s&&Math.abs(o-j)<=r,a.value=a.done?o:j,a}const M=v(A);if(p)a.done=A>=d;else{const U=_e(k(A));a.done=Math.abs(U)<=s&&Math.abs(o-M)<=r}return a.value=a.done?o:M,a},toString:()=>{const A=Math.min(Vi(I),Es),M=Yc(U=>I.next(A*U).value,A,30);return A+"ms "+M},toTransition:()=>{}};return I}As.applyToOptions=e=>{const t=qg(e,100,As);return e.ease=t.ease,e.duration=_e(t.duration),e.type="keyframes",e};const ny=5;function zc(e,t,n){const s=Math.max(t-ny,0);return Ac(n-e(s),t-s)}function zr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=C=>a!==void 0&&C<a||l!==void 0&&C>l,m=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l;let y=n*t;const b=d+y,x=o===void 0?b:o(b);x!==b&&(y=x-d);const w=C=>-y*Math.exp(-C/s),v=C=>x+w(C),k=C=>{const I=w(C),A=v(C);f.done=Math.abs(I)<=c,f.value=f.done?x:A};let S,R;const N=C=>{p(f.value)&&(S=C,R=As({keyframes:[f.value,m(f.value)],velocity:zc(v,C,f.value),damping:r,stiffness:i,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:C=>{let I=!1;return!R&&S===void 0&&(I=!0,k(C),N(C)),S!==void 0&&C>=S?R.next(C-S):(!I&&k(C),f)}}}function sy(e,t,n){const s=[],r=n||wt.mix||Gc,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||$e:t;a=Vn(l,a)}s.push(a)}return s}function qc(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(Ei(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=sy(t,s,r),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Cn(e[d],e[d+1],u);return a[d](f)};return n?u=>c(lt(e[0],e[i-1],u)):c}function ry(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Cn(0,t,s);e.push(fe(n,1,r))}}function iy(e){const t=[0];return ry(t,e.length-1),t}function oy(e,t){return e.map(n=>n*t)}function ay(e,t){return e.map(()=>t||Ic).splice(0,e.length-1)}function vn({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=gg(s)?s.map(na):na(s),i={done:!1,value:t[0]},o=oy(n&&n.length===t.length?n:iy(t),e),a=qc(o,t,{ease:Array.isArray(r)?r:ay(t,r)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const ly=e=>e!==null;function Is(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(ly),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const cy={decay:zr,inertia:zr,tween:vn,keyframes:vn,spring:As};function Xc(e){typeof e.type=="string"&&(e.type=cy[e.type])}class Li{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const uy=e=>e/100;class An extends Li{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Me.now()&&this.tick(Me.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Xc(t);const{type:n=vn,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||vn;l!==vn&&typeof a[0]!="number"&&(this.mixKeyframes=Vn(uy,Gc(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Vi(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:p,type:m,onUpdate:y,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-c*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>r;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,k=s;if(d){const C=Math.min(this.currentTime,r)/a;let I=Math.floor(C),A=C%1;!A&&C>=1&&(A=1),A===1&&I--,I=Math.min(I,d+1),I%2&&(f==="reverse"?(A=1-A,p&&(A-=p/a)):f==="mirror"&&(k=o)),v=lt(0,1,A)*a}let S;w?(this.delayState.value=u[0],S=this.delayState):S=k.next(v),i&&!w&&(S.value=i(S.value));let{done:R}=S;!w&&l!==null&&(R=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return N&&m!==zr&&(S.value=Is(u,this.options,b,this.speed)),y&&y(S.value),N&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Be(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Be(t)}get time(){return Be(this.currentTime)}set time(t){t=_e(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return zc(s=>this.generator.next(s).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Me.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Be(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=zg,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Me.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function dy(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Dt=e=>e*180/Math.PI,qr=e=>{const t=Dt(Math.atan2(e[1],e[0]));return Xr(t)},fy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:qr,rotateZ:qr,skewX:e=>Dt(Math.atan(e[1])),skewY:e=>Dt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Xr=e=>(e=e%360,e<0&&(e+=360),e),ca=qr,ua=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),da=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),hy={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ua,scaleY:da,scale:e=>(ua(e)+da(e))/2,rotateX:e=>Xr(Dt(Math.atan2(e[6],e[5]))),rotateY:e=>Xr(Dt(Math.atan2(-e[2],e[0]))),rotateZ:ca,rotate:ca,skewX:e=>Dt(Math.atan(e[4])),skewY:e=>Dt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Zr(e){return e.includes("scale")?1:0}function Jr(e,t){if(!e||e==="none")return Zr(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=hy,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=fy,r=a}if(!r)return Zr(t);const i=s[t],o=r[1].split(",").map(py);return typeof i=="function"?i(o):o[i]}const my=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Jr(n,t)};function py(e){return parseFloat(e.trim())}const nn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sn=new Set(nn),fa=e=>e===tn||e===B,gy=new Set(["x","y","z"]),yy=nn.filter(e=>!gy.has(e));function by(e){const t=[];return yy.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const vt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:s})=>{const r=e.max-e.min;return s==="border-box"?r:r-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:s})=>{const r=e.max-e.min;return s==="border-box"?r:r-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Jr(t,"x"),y:(e,{transform:t})=>Jr(t,"y")};vt.translateX=vt.x;vt.translateY=vt.y;const Nt=new Set;let Qr=!1,ei=!1,ti=!1;function Zc(){if(ei){const e=Array.from(Nt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=by(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{s.getValue(i)?.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ei=!1,Qr=!1,Nt.forEach(e=>e.complete(ti)),Nt.clear()}function Jc(){Nt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ei=!0)})}function xy(){ti=!0,Jc(),Zc(),ti=!1}class Ii{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Nt.add(this),Qr||(Qr=!0,ae.read(Jc),ae.resolveKeyframes(Zc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r?.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}dy(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Nt.delete(this)}cancel(){this.state==="scheduled"&&(Nt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const vy=e=>e.startsWith("--");function Qc(e,t,n){vy(t)?e.style.setProperty(t,n):e.style[t]=n}const wy={};function eu(e,t){const n=Ec(e);return()=>wy[t]??n()}const Sy=eu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),tu=eu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pn=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,ha={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function nu(e,t){if(e)return typeof e=="function"?tu()?Yc(e,t):"ease-out":Fc(e)?pn(e):Array.isArray(e)?e.map(n=>nu(n,t)||ha.easeOut):ha[e]}function Ty(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=nu(a,r);Array.isArray(d)&&(u.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(u,f)}function su(e){return typeof e=="function"&&"applyToOptions"in e}function ky({type:e,...t}){return su(e)&&tu()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ru extends Li{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Ei(typeof t.type!="string");const c=ky(t);this.animation=Ty(n,s,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Is(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Qc(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Be(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Be(t)}get time(){return Be(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_e(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:s,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Sy()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),$e):r(this)}}const iu={anticipate:jc,backInOut:Nc,circInOut:Lc};function Cy(e){return e in iu}function Ey(e){typeof e.ease=="string"&&Cy(e.ease)&&(e.ease=iu[e.ease])}const kr=10;class Ay extends ru{constructor(t){Ey(t),Xc(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new An({...o,autoplay:!1}),l=Math.max(kr,Me.now()-this.startTime),c=lt(0,kr,l-kr),u=a.sample(l).value,{name:d}=this.options;i&&d&&Qc(i,d,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const ma=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Je.test(e)||e==="0")&&!e.startsWith("url("));function Py(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ry(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ma(r,t),a=ma(i,t);return!o||!a?!1:Py(e)||(n==="spring"||su(n))&&s}function ni(e){e.duration=0,e.type="keyframes"}const ou=new Set(["opacity","clipPath","filter","transform"]),My=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Dy(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&My.test(e[t]))return!0;return!1}const Ny=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),jy=Ec(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Vy(e){const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o,keyframes:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return jy()&&n&&(ou.has(n)||Ny.has(n)&&Dy(a))&&(n!=="transform"||!u)&&!c&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Ly=40;class Iy extends Li{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Me.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...d},p=u?.KeyframeResolver||Ii;this.keyframeResolver=new p(a,(m,y,b)=>this.onKeyframesResolved(m,y,f,!b),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=Me.now();let d=!0;Ry(t,i,o,a)||(d=!1,(wt.instantAnimations||!l)&&u?.(Is(t,s,n)),t[0]=t[t.length-1],ni(s),s.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Ly?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},m=d&&!c&&Vy(p),y=p.motionValue?.owner?.current;let b;if(m)try{b=new Ay({...p,element:y})}catch{b=new An(p)}else b=new An(p);b.finished.then(()=>{this.notifyFinished()}).catch($e),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),xy()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function au(e,t,n,s=0,r=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}const Fy=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _y(e){const t=Fy.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}function lu(e,t,n=1){const[s,r]=_y(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Tc(o)?parseFloat(o):o}return Mi(r)?lu(r,t,n+1):r}const Oy={type:"spring",stiffness:500,damping:25,restSpeed:10},By=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$y={type:"keyframes",duration:.8},Uy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Wy=(e,{keyframes:t})=>t.length>2?$y:sn.has(e)?e.startsWith("scale")?By(t[1]):Oy:Uy;function cu(e,t){if(e?.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function Fi(e,t){const n=e?.[t]??e?.default??e;return n!==e?cu(n,e):n}const Ky=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Hy(e){for(const t in e)if(!Ky.has(t))return!0;return!1}const _i=(e,t,n,s={},r,i)=>o=>{const a=Fi(s,e)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-_e(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};Hy(a)||Object.assign(u,Wy(e,u)),u.duration&&(u.duration=_e(u.duration)),u.repeatDelay&&(u.repeatDelay=_e(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ni(u),u.delay===0&&(d=!0)),(wt.instantAnimations||wt.skipAnimations||r?.shouldSkipAnimations)&&(d=!0,ni(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=Is(u.keyframes,a);if(f!==void 0){ae.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new An(u):new Iy(u)};function pa(e){const t=[{},{}];return e?.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Oi(e,t,n,s){if(typeof t=="function"){const[r,i]=pa(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=pa(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function jt(e,t,n){const s=e.getProps();return Oi(s,t,n!==void 0?n:s.custom,e)}const uu=new Set(["width","height","top","left","right","bottom",...nn]),ga=30,Gy=e=>!isNaN(parseFloat(e)),wn={current:void 0};class Yy{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const r=Me.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Gy(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ai);const s=this.events[t].add(n);return t==="change"?()=>{s(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return wn.current&&wn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ga)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ga);return Ac(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(e,t){return new Yy(e,t)}const si=e=>Array.isArray(e);function zy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vt(n))}function qy(e){return si(e)?e[e.length-1]||0:e}function Xy(e,t){const n=jt(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=qy(i[o]);zy(e,o,a)}}const Ce=e=>!!(e&&e.getVelocity);function Zy(e){return!!(Ce(e)&&e.add)}function ri(e,t){const n=e.getValue("willChange");if(Zy(n))return n.add(t);if(!n&&wt.WillChange){const s=new wt.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Bi(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Jy="framerAppearId",du="data-"+Bi(Jy);function fu(e){return e.props[du]}function Qy({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function hu(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?cu(i,l):l;const c=i?.reduceMotion;s&&(i=s);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in a){const p=e.getValue(f,e.latestValues[f]??null),m=a[f];if(m===void 0||d&&Qy(d,f))continue;const y={delay:n,...Fi(i||{},f)},b=p.get();if(b!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===b&&!y.velocity){ae.update(()=>p.set(m));continue}let x=!1;if(window.MotionHandoffAnimation){const k=fu(e);if(k){const S=window.MotionHandoffAnimation(k,f,ae);S!==null&&(y.startTime=S,x=!0)}}ri(e,f);const w=c??e.shouldReduceMotion;p.start(_i(f,p,m,w&&uu.has(f)?{type:!1}:y,e,x));const v=p.animation;v&&u.push(v)}if(o){const f=()=>ae.update(()=>{o&&Xy(e,o)});u.length?Promise.all(u).then(f):f()}return u}function ii(e,t,n={}){const s=jt(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(hu(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=r;return eb(e,t,l,c,u,d,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function eb(e,t,n=0,s=0,r=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(ii(l,t,{...o,delay:n+(typeof s=="function"?0:s)+au(e.variantChildren,l,s,r,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function tb(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>ii(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=ii(e,t,n);else{const r=typeof t=="function"?jt(e,t,n.custom):t;s=Promise.all(hu(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const nb={test:e=>e==="auto",parse:e=>e},mu=e=>t=>t.test(e),pu=[tn,B,at,bt,Rg,Pg,nb],ya=e=>pu.find(mu(e));function sb(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Cc(e):!0}const rb=new Set(["brightness","contrast","saturate","opacity"]);function ib(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Di)||[];if(!s)return e;const r=n.replace(s,"");let i=rb.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const ob=/\b([a-z-]*)\(.*?\)/gu,oi={...Je,getAnimatableNone:e=>{const t=e.match(ob);return t?t.map(ib).join(" "):e}},ai={...Je,getAnimatableNone:e=>{const t=Je.parse(e);return Je.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},ba={...tn,transform:Math.round},ab={rotate:bt,rotateX:bt,rotateY:bt,rotateZ:bt,scale:ns,scaleX:ns,scaleY:ns,scaleZ:ns,skew:bt,skewX:bt,skewY:bt,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:En,originX:ra,originY:ra,originZ:B},$i={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...ab,zIndex:ba,fillOpacity:En,strokeOpacity:En,numOctaves:ba},lb={...$i,color:Se,backgroundColor:Se,outlineColor:Se,fill:Se,stroke:Se,borderColor:Se,borderTopColor:Se,borderRightColor:Se,borderBottomColor:Se,borderLeftColor:Se,filter:oi,WebkitFilter:oi,mask:ai,WebkitMask:ai},gu=e=>lb[e],cb=new Set([oi,ai]);function yu(e,t){let n=gu(e);return cb.has(n)||(n=Je),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ub=new Set(["auto","none","0"]);function db(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!ub.has(i)&&Zt(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=yu(n,r)}class fb extends Ii{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let d=t[u];if(typeof d=="string"&&(d=d.trim(),Mi(d))){const f=lu(d,n.current);f!==void 0&&(t[u]=f),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!uu.has(s)||t.length!==2)return;const[r,i]=t,o=ya(r),a=ya(i),l=sa(r),c=sa(i);if(l!==c&&vt[s]){this.needsMeasurement=!0;return}if(o!==a)if(fa(o)&&fa(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else vt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||sb(t[r]))&&s.push(r);s.length&&db(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vt[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=vt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function bu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=n?.[e]??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const xu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function hb(e){return kc(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Ui}=_c(queueMicrotask,!1),ze={x:!1,y:!1};function vu(){return ze.x||ze.y}function mb(e){return e==="x"||e==="y"?ze[e]?null:(ze[e]=!0,()=>{ze[e]=!1}):ze.x||ze.y?null:(ze.x=ze.y=!0,()=>{ze.x=ze.y=!1})}function wu(e,t){const n=bu(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function pb(e){return!(e.pointerType==="touch"||vu())}function gb(e,t,n={}){const[s,r,i]=wu(e,n);return s.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},d=b=>{c&&(c(b),c=void 0),u()},f=b=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,d(b))},p=()=>{a=!0,window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",f,r)},m=b=>{if(b.pointerType!=="touch"){if(a){l=!0;return}d(b)}},y=b=>{if(!pb(b))return;l=!1;const x=t(o,b);typeof x=="function"&&(c=x,o.addEventListener("pointerleave",m,r))};o.addEventListener("pointerenter",y,r),o.addEventListener("pointerdown",p,r)}),i}const Su=(e,t)=>t?e===t?!0:Su(e,t.parentElement):!1,Wi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bb(e){return yb.has(e.tagName)||e.isContentEditable===!0}const xb=new Set(["INPUT","SELECT","TEXTAREA"]);function vb(e){return xb.has(e.tagName)||e.isContentEditable===!0}const as=new WeakSet;function xa(e){return t=>{t.key==="Enter"&&e(t)}}function Cr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wb=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=xa(()=>{if(as.has(n))return;Cr(n,"down");const r=xa(()=>{Cr(n,"up")}),i=()=>Cr(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function va(e){return Wi(e)&&!vu()}const wa=new WeakSet;function Sb(e,t,n={}){const[s,r,i]=wu(e,n),o=a=>{const l=a.currentTarget;if(!va(a)||wa.has(a))return;as.add(l),n.stopPropagation&&wa.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),as.has(l)&&as.delete(l),va(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||Su(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),hb(a)&&(a.addEventListener("focus",c=>wb(c,r)),!bb(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Ki(e){return kc(e)&&"ownerSVGElement"in e}const ls=new WeakMap;let cs;const Tu=(e,t,n)=>(s,r)=>r&&r[0]?r[0][e+"Size"]:Ki(s)&&"getBBox"in s?s.getBBox()[t]:s[n],Tb=Tu("inline","width","offsetWidth"),kb=Tu("block","height","offsetHeight");function Cb({target:e,borderBoxSize:t}){ls.get(e)?.forEach(n=>{n(e,{get width(){return Tb(e,t)},get height(){return kb(e,t)}})})}function Eb(e){e.forEach(Cb)}function Ab(){typeof ResizeObserver>"u"||(cs=new ResizeObserver(Eb))}function Pb(e,t){cs||Ab();const n=bu(e);return n.forEach(s=>{let r=ls.get(s);r||(r=new Set,ls.set(s,r)),r.add(t),cs?.observe(s)}),()=>{n.forEach(s=>{const r=ls.get(s);r?.delete(t),r?.size||cs?.unobserve(s)})}}const us=new Set;let Wt;function Rb(){Wt=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};us.forEach(t=>t(e))},window.addEventListener("resize",Wt)}function Mb(e){return us.add(e),Wt||Rb(),()=>{us.delete(e),!us.size&&typeof Wt=="function"&&(window.removeEventListener("resize",Wt),Wt=void 0)}}function Sa(e,t){return typeof e=="function"?Mb(e):Pb(e,t)}function Db(e){return Ki(e)&&e.tagName==="svg"}function Nb(...e){const t=!Array.isArray(e[0]),n=t?0:-1,s=e[0+n],r=e[1+n],i=e[2+n],o=e[3+n],a=qc(r,i,o);return t?a(s):a}function jb(e,t,n={}){const s=e.get();let r=null,i=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,l=()=>{r&&(r.stop(),r=null),e.animation=void 0},c=()=>{const d=Ta(e.get()),f=Ta(i);if(d===f){l();return}const p=r?r.getGeneratorVelocity():e.getVelocity();l(),r=new An({keyframes:[d,f],velocity:p,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},u=()=>{c(),e.animation=r??void 0,e.events.animationStart?.notify(),r?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((d,f)=>{i=d,o=p=>f(Er(p,a)),ae.postRender(u)},l),Ce(t)){let d=n.skipInitialAnimation===!0;const f=t.on("change",m=>{d?(d=!1,e.jump(Er(m,a),!1)):e.set(Er(m,a))}),p=e.on("destroy",f);return()=>{f(),p()}}return l}function Er(e,t){return t?e+t:e}function Ta(e){return typeof e=="number"?e:parseFloat(e)}const Vb=[...pu,Se,Je],Lb=e=>Vb.find(mu(e)),ka=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kt=()=>({x:ka(),y:ka()}),Ca=()=>({min:0,max:0}),ke=()=>({x:Ca(),y:Ca()}),Ib=new WeakMap;function Fs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pn(e){return typeof e=="string"||Array.isArray(e)}const Hi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gi=["initial",...Hi];function _s(e){return Fs(e.animate)||Gi.some(t=>Pn(e[t]))}function ku(e){return!!(_s(e)||e.variants)}function Fb(e,t,n){for(const s in t){const r=t[s],i=n[s];if(Ce(r))e.addValue(s,r);else if(Ce(i))e.addValue(s,Vt(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,Vt(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Ps={current:null},Yi={current:!1},_b=typeof window<"u";function Cu(){if(Yi.current=!0,!!_b)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ps.current=e.matches;e.addEventListener("change",t),t()}else Ps.current=!1}const Ea=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Rs={};function Eu(e){Rs=e}function Ob(){return Rs}class Bb{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ii,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Me.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ae.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=_s(n),this.isVariantNode=ku(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];c[p]!==void 0&&Ce(m)&&m.set(c[p])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,Ib.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Yi.current||Cu(),this.shouldReduceMotion=Ps.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),gt(this.notifyUpdate),gt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&ou.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,d=new ru({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:_e(u)}),f=o(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const s=sn.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ae.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Rs){const n=Rs[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ke()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ea.length;s++){const r=Ea[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Fb(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Vt(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Tc(s)||Cc(s))?s=parseFloat(s):!Lb(s)&&Je.test(n)&&(s=yu(t,n)),this.setBaseTarget(t,Ce(s)?s.get():s)),Ce(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const i=Oi(this.props,n,this.presenceContext?.custom);i&&(s=i[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Ce(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ai),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ui.render(this.render)}}class Au extends Bb{constructor(){super(...arguments),this.KeyframeResolver=fb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class St{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Pu({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function $b({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ub(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Ar(e){return e===void 0||e===1}function li({scale:e,scaleX:t,scaleY:n}){return!Ar(e)||!Ar(t)||!Ar(n)}function Pt(e){return li(e)||Ru(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ru(e){return Aa(e.x)||Aa(e.y)}function Aa(e){return e&&e!=="0%"}function Ms(e,t,n){const s=e-n,r=t*s;return n+r}function Pa(e,t,n,s,r){return r!==void 0&&(e=Ms(e,r,s)),Ms(e,n,s)+t}function ci(e,t=0,n=1,s,r){e.min=Pa(e.min,t,n,s,r),e.max=Pa(e.max,t,n,s,r)}function Mu(e,{x:t,y:n}){ci(e.x,t.translate,t.scale,t.originPoint),ci(e.y,n.translate,n.scale,n.originPoint)}const Ra=.999999999999,Ma=1.0000000000001;function Wb(e,t,n,s=!1){const r=n.length;if(!r)return;t.x=t.y=1;let i,o;for(let a=0;a<r;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(it(e.x,-i.scroll.offset.x),it(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Mu(e,o)),s&&Pt(i.latestValues)&&ds(e,i.latestValues,i.layout?.layoutBox))}t.x<Ma&&t.x>Ra&&(t.x=1),t.y<Ma&&t.y>Ra&&(t.y=1)}function it(e,t){e.min+=t,e.max+=t}function Da(e,t,n,s,r=.5){const i=fe(e.min,e.max,r);ci(e,t,n,i,s)}function Na(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ds(e,t,n){const s=n??e;Da(e.x,Na(t.x,s.x),t.scaleX,t.scale,t.originX),Da(e.y,Na(t.y,s.y),t.scaleY,t.scale,t.originY)}function Du(e,t){return Pu(Ub(e.getBoundingClientRect(),t))}function Kb(e,t,n){const s=Du(e,n),{scroll:r}=t;return r&&(it(s.x,r.offset.x),it(s.y,r.offset.y)),s}const Hb={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gb=nn.length;function Yb(e,t,n){let s="",r=!0;for(let i=0;i<Gb;i++){const o=nn[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=xu(a,$i[o]);if(!l){r=!1;const u=Hb[o]||o;s+=`${u}(${c}) `}n&&(t[o]=c)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function zi(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(sn.has(l)){o=!0;continue}else if(Bc(l)){r[l]=c;continue}else{const u=xu(c,$i[l]);l.startsWith("origin")?(a=!0,i[l]=u):s[l]=u}}if(t.transform||(o||n?s.transform=Yb(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;s.transformOrigin=`${l} ${c} ${u}`}}function Nu(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r?.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function ja(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const hn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=ja(e,t.target.x),s=ja(e,t.target.y);return`${n}% ${s}%`}},zb={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=Je.parse(e);if(r.length>5)return s;const i=Je.createTransformer(e),o=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;r[0+o]/=a,r[1+o]/=l;const c=fe(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),i(r)}},ui={borderRadius:{...hn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hn,borderTopRightRadius:hn,borderBottomLeftRadius:hn,borderBottomRightRadius:hn,boxShadow:zb};function ju(e,{layout:t,layoutId:n}){return sn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ui[e]||e==="opacity")}function qi(e,t,n){const s=e.style,r=t?.style,i={};if(!s)return i;for(const o in s)(Ce(s[o])||r&&Ce(r[o])||ju(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=s[o]);return i}function qb(e){return window.getComputedStyle(e)}class Xb extends Au{constructor(){super(...arguments),this.type="html",this.renderInstance=Nu}readValueFromInstance(t,n){if(sn.has(n))return this.projection?.isProjecting?Zr(n):my(t,n);{const s=qb(t),r=(Bc(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Du(t,n)}build(t,n,s){zi(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return qi(t,n,s)}}const Zb={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jb={offset:"strokeDashoffset",array:"strokeDasharray"};function Qb(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?Zb:Jb;e[i.offset]=`${-s}`,e[i.array]=`${t} ${n}`}const e0=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Vu(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(zi(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(const p of e0)d[p]!==void 0&&(f[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Qb(d,r,i,o,!1)}const Lu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Iu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function t0(e,t,n,s){Nu(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Lu.has(r)?r:Bi(r),t.attrs[r])}function Fu(e,t,n){const s=qi(e,t,n);for(const r in e)if(Ce(e[r])||Ce(t[r])){const i=nn.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}class n0 extends Au{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ke}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(sn.has(n)){const s=gu(n);return s&&s.default||0}return n=Lu.has(n)?n:Bi(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Fu(t,n,s)}build(t,n,s){Vu(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){t0(t,n,s,r)}mount(t){this.isSVGTag=Iu(t.tagName),super.mount(t)}}const s0=Gi.length;function _u(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?_u(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<s0;n++){const s=Gi[n],r=e.props[s];(Pn(r)||r===!1)&&(t[s]=r)}return t}function Ou(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const r0=[...Hi].reverse(),i0=Hi.length;function o0(e){return t=>Promise.all(t.map(({animation:n,options:s})=>tb(e,n,s)))}function a0(e){let t=o0(e),n=Va(),s=!0,r=!1;const i=c=>(u,d)=>{const f=jt(e,d,c==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:p,transitionEnd:m,...y}=f;u={...u,...y,...m}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=_u(e.parent)||{},f=[],p=new Set;let m={},y=1/0;for(let x=0;x<i0;x++){const w=r0[x],v=n[w],k=u[w]!==void 0?u[w]:d[w],S=Pn(k),R=w===c?v.isActive:null;R===!1&&(y=x);let N=k===d[w]&&k!==u[w]&&S;if(N&&(s||r)&&e.manuallyAnimateOnMount&&(N=!1),v.protectedKeys={...m},!v.isActive&&R===null||!k&&!v.prevProp||Fs(k)||typeof k=="boolean")continue;if(w==="exit"&&v.isActive&&R!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const C=l0(v.prevProp,k);let I=C||w===c&&v.isActive&&!N&&S||x>y&&S,A=!1;const M=Array.isArray(k)?k:[k];let U=M.reduce(i(w),{});R===!1&&(U={});const{prevResolvedValues:V={}}=v,$={...V,...U},j=D=>{I=!0,p.has(D)&&(A=!0,p.delete(D)),v.needsAnimating[D]=!0;const _=e.getValue(D);_&&(_.liveStyle=!1)};for(const D in $){const _=U[D],z=V[D];if(m.hasOwnProperty(D))continue;let X=!1;si(_)&&si(z)?X=!Ou(_,z):X=_!==z,X?_!=null?j(D):p.add(D):_!==void 0&&p.has(D)?j(D):v.protectedKeys[D]=!0}v.prevProp=k,v.prevResolvedValues=U,v.isActive&&(m={...m,...U}),(s||r)&&e.blockInitialAnimation&&(I=!1);const W=N&&C;I&&(!W||A)&&f.push(...M.map(D=>{const _={type:w};if(typeof D=="string"&&(s||r)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,X=jt(z,D);if(z.enteringChildren&&X){const{delayChildren:se}=X.transition||{};_.delay=au(z.enteringChildren,e,se)}}return{animation:D,options:_}}))}if(p.size){const x={};if(typeof u.initial!="boolean"){const w=jt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(x.transition=w.transition)}p.forEach(w=>{const v=e.getBaseTarget(w),k=e.getValue(w);k&&(k.liveStyle=!0),x[w]=v??null}),f.push({animation:x})}let b=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,r=!1,b?t(f):Promise.resolve()}function l(c,u){if(n[c].isActive===u)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(c,u)),n[c].isActive=u;const d=a(c);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Va(),r=!0}}}function l0(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ou(t,e):!1}function Et(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Va(){return{animate:Et(!0),whileInView:Et(),whileHover:Et(),whileTap:Et(),whileDrag:Et(),whileFocus:Et(),exit:Et()}}function di(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){di(e.x,t.x),di(e.y,t.y)}function La(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Bu=1e-4,c0=1-Bu,u0=1+Bu,$u=.01,d0=0-$u,f0=0+$u;function De(e){return e.max-e.min}function h0(e,t,n){return Math.abs(e-t)<=n}function Ia(e,t,n,s=.5){e.origin=s,e.originPoint=fe(t.min,t.max,e.origin),e.scale=De(n)/De(t),e.translate=fe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=c0&&e.scale<=u0||isNaN(e.scale))&&(e.scale=1),(e.translate>=d0&&e.translate<=f0||isNaN(e.translate))&&(e.translate=0)}function Sn(e,t,n,s){Ia(e.x,t.x,n.x,s?s.originX:void 0),Ia(e.y,t.y,n.y,s?s.originY:void 0)}function Fa(e,t,n,s=0){const r=s?fe(n.min,n.max,s):n.min;e.min=r+t.min,e.max=e.min+De(t)}function m0(e,t,n,s){Fa(e.x,t.x,n.x,s?.x),Fa(e.y,t.y,n.y,s?.y)}function _a(e,t,n,s=0){const r=s?fe(n.min,n.max,s):n.min;e.min=t.min-r,e.max=e.min+De(t)}function Ds(e,t,n,s){_a(e.x,t.x,n.x,s?.x),_a(e.y,t.y,n.y,s?.y)}function Oa(e,t,n,s,r){return e-=t,e=Ms(e,1/n,s),r!==void 0&&(e=Ms(e,1/r,s)),e}function p0(e,t=0,n=1,s=.5,r,i=e,o=e){if(at.test(t)&&(t=parseFloat(t),t=fe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=fe(i.min,i.max,s);e===i&&(a-=t),e.min=Oa(e.min,t,n,a,r),e.max=Oa(e.max,t,n,a,r)}function Ba(e,t,[n,s,r],i,o){p0(e,t[n],t[s],t[r],t.scale,i,o)}const g0=["x","scaleX","originX"],y0=["y","scaleY","originY"];function $a(e,t,n,s){Ba(e.x,t,g0,n?n.x:void 0,s?s.x:void 0),Ba(e.y,t,y0,n?n.y:void 0,s?s.y:void 0)}function Ua(e){return e.translate===0&&e.scale===1}function Uu(e){return Ua(e.x)&&Ua(e.y)}function Wa(e,t){return e.min===t.min&&e.max===t.max}function b0(e,t){return Wa(e.x,t.x)&&Wa(e.y,t.y)}function Ka(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wu(e,t){return Ka(e.x,t.x)&&Ka(e.y,t.y)}function Ha(e){return De(e.x)/De(e.y)}function Ga(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function st(e){return[e("x"),e("y")]}function x0(e,t,n){let s="";const r=e.x.translate/t.x,i=e.y.translate/t.y,o=n?.z||0;if((r||i||o)&&(s=`translate3d(${r}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),d&&(s+=`rotateX(${d}deg) `),f&&(s+=`rotateY(${f}deg) `),p&&(s+=`skewX(${p}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Ku=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],v0=Ku.length,Ya=e=>typeof e=="string"?parseFloat(e):e,za=e=>typeof e=="number"||B.test(e);function w0(e,t,n,s,r,i){r?(e.opacity=fe(0,n.opacity??1,S0(s)),e.opacityExit=fe(t.opacity??1,0,T0(s))):i&&(e.opacity=fe(t.opacity??1,n.opacity??1,s));for(let o=0;o<v0;o++){const a=Ku[o];let l=qa(t,a),c=qa(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||za(l)===za(c)?(e[a]=Math.max(fe(Ya(l),Ya(c),s),0),(at.test(c)||at.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=fe(t.rotate||0,n.rotate||0,s))}function qa(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const S0=Hu(0,.5,Vc),T0=Hu(.5,.95,$e);function Hu(e,t,n){return s=>s<e?0:s>t?1:n(Cn(e,t,s))}function k0(e,t,n){const s=Ce(e)?e:Vt(e);return s.start(_i("",s,t,n)),s.animation}function Rn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const C0=(e,t)=>e.depth-t.depth;class E0{constructor(){this.children=[],this.isDirty=!1}add(t){Ci(this.children,t),this.isDirty=!0}remove(t){ks(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(C0),this.isDirty=!1,this.children.forEach(t)}}function A0(e,t){const n=Me.now(),s=({timestamp:r})=>{const i=r-n;i>=t&&(gt(s),e(i-t))};return ae.setup(s,!0),()=>gt(s)}function fs(e){return Ce(e)?e.get():e}class P0{constructor(){this.members=[]}add(t){Ci(this.members,t);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===t||s===this.lead||s===this.prevLead)continue;const r=s.instance;(!r||r.isConnected===!1)&&!s.snapshot&&(ks(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(ks(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:i}=t.options;(r===void 0||r!==i)&&(t.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const hs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Pr=["","X","Y","Z"],R0=1e3;let M0=0;function Rr(e,t,n,s){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),s&&(s[e]=0))}function Gu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=fu(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ae,!(r||i))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Gu(s)}function Yu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(o={},a=t?.()){this.id=M0++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(j0),this.nodes.forEach(O0),this.nodes.forEach(B0),this.nodes.forEach(V0)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new E0)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ai),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Ki(o)&&!Db(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;ae.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=A0(f,250),hs.hasAnimatedSinceResize&&(hs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ja)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||H0,{onLayoutAnimationStart:y,onLayoutAnimationComplete:b}=c.getProps(),x=!this.targetLayout||!Wu(this.targetLayout,p),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Fi(m,"layout"),onPlay:y,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,w)}else d||Ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($0),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(I0),this.nodes.forEach(Xa);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Za);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(F0),this.nodes.forEach(_0),this.nodes.forEach(D0),this.nodes.forEach(N0)):this.nodes.forEach(Za),this.clearAllSnapshots();const a=Me.now();Ae.delta=lt(0,1e3/60,a-Ae.timestamp),Ae.timestamp=a,Ae.isProcessing=!0,xr.update.process(Ae),xr.preRender.process(Ae),xr.render.process(Ae),Ae.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ui.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(L0),this.sharedNodes.forEach(U0)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ae.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!De(this.snapshot.measuredBox.x)&&!De(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ke()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Uu(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||Pt(this.latestValues)||u)&&(r(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),G0(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return ke();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Y0))){const{scroll:c}=this.root;c&&(it(a.x,c.offset.x),it(a.y,c.offset.y))}return a}removeElementScroll(o){const a=ke();if(Ye(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&Ye(a,o),it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}applyTransform(o,a=!1,l){const c=l||ke();Ye(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(it(c.x,-d.scroll.offset.x),it(c.y,-d.scroll.offset.y)),Pt(d.latestValues)&&ds(c,d.latestValues,d.layout?.layoutBox)}return Pt(this.latestValues)&&ds(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(o){const a=ke();Ye(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!Pt(c.latestValues))continue;let u;c.instance&&(li(c.latestValues)&&c.updateSnapshot(),u=ke(),Ye(u,c.measurePageBox())),$a(a,c.latestValues,c.snapshot?.layoutBox,u)}return Pt(this.latestValues)&&$a(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ae.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=Ae.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ke(),this.targetWithTransforms=ke()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),m0(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ye(this.target,this.layout.layoutBox),Mu(this.target,this.targetDelta)):Ye(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||li(this.parent.latestValues)||Ru(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ke(),this.relativeTargetOrigin=ke(),Ds(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),Ye(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ae.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Ye(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Wb(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ke());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(La(this.prevProjectionDelta.x,this.projectionDelta.x),La(this.prevProjectionDelta.y,this.projectionDelta.y)),Sn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Ga(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ga(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kt(),this.projectionDelta=Kt(),this.projectionDeltaWithTransform=Kt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Kt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=ke(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,y=p!==m,b=this.getStack(),x=!b||b.members.length<=1,w=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(K0));this.animationProgress=0;let v;this.mixTargetDelta=k=>{const S=k/1e3;Qa(d.x,o.x,S),Qa(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ds(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),W0(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&b0(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=ke()),Ye(v,this.relativeTarget)),y&&(this.animationValues=u,w0(u,c,this.latestValues,S,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(gt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{hs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Vt(0)),this.motionValue.jump(0,!1),this.currentAnimation=k0(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(R0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&zu(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ke();const d=De(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=De(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Ye(a,l),ds(a,u),Sn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new P0),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Rr("z",o,c,this.animationValues);for(let u=0;u<Pr.length;u++)Rr(`rotate${Pr[u]}`,o,c,this.animationValues),Rr(`skew${Pr[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=fs(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=fs(a?.pointerEvents)||""),this.hasProjected&&!Pt(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=x0(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in ui){if(u[m]===void 0)continue;const{correct:y,applyTo:b,isCSSVariable:x}=ui[m],w=d==="none"?u[m]:y(u[m],c);if(b){const v=b.length;for(let k=0;k<v;k++)o[b[k]]=w}else x?this.options.visualElement.renderState.vars[m]=w:o[m]=w}this.options.layoutId&&(o.pointerEvents=c===this?fs(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Xa),this.root.sharedNodes.clear()}}}function D0(e){e.updateLayout()}function N0(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:r}=e.options,i=t.source!==e.layout.source;if(r==="size")st(u=>{const d=i?t.measuredBox[u]:t.layoutBox[u],f=De(d);d.min=n[u].min,d.max=d.min+f});else if(r==="x"||r==="y"){const u=r==="x"?"y":"x";di(i?t.measuredBox[u]:t.layoutBox[u],n[u])}else zu(r,t.layoutBox,n)&&st(u=>{const d=i?t.measuredBox[u]:t.layoutBox[u],f=De(n[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});const o=Kt();Sn(o,n,t.layoutBox);const a=Kt();i?Sn(a,e.applyTransform(s,!0),t.measuredBox):Sn(a,n,t.layoutBox);const l=!Uu(o);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const p=e.options.layoutAnchor||void 0,m=ke();Ds(m,t.layoutBox,d.layoutBox,p);const y=ke();Ds(y,n,f.layoutBox,p),Wu(m,y)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function j0(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function V0(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function L0(e){e.clearSnapshot()}function Xa(e){e.clearMeasurements()}function I0(e){e.isLayoutDirty=!0,e.updateLayout()}function Za(e){e.isLayoutDirty=!1}function F0(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function _0(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ja(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function O0(e){e.resolveTargetDelta()}function B0(e){e.calcProjection()}function $0(e){e.resetSkewAndRotation()}function U0(e){e.removeLeadSnapshot()}function Qa(e,t,n){e.translate=fe(t.translate,0,n),e.scale=fe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function el(e,t,n,s){e.min=fe(t.min,n.min,s),e.max=fe(t.max,n.max,s)}function W0(e,t,n,s){el(e.x,t.x,n.x,s),el(e.y,t.y,n.y,s)}function K0(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const H0={duration:.45,ease:[.4,0,.1,1]},tl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nl=tl("applewebkit/")&&!tl("chrome/")?Math.round:$e;function sl(e){e.min=nl(e.min),e.max=nl(e.max)}function G0(e){sl(e.x),sl(e.y)}function zu(e,t,n){return e==="position"||e==="preserve-aspect"&&!h0(Ha(t),Ha(n),.2)}function Y0(e){return e!==e.root&&e.scroll?.wasRoot}const z0=Yu({attachResizeListener:(e,t)=>Rn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Mr={current:void 0},qu=Yu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Mr.current){const e=new z0({});e.mount(window),e.setOptions({layoutScroll:!0}),Mr.current=e}return Mr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Os=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function q0(e=!0){const t=h.useContext(ki);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,i=h.useId();h.useEffect(()=>{if(e)return r(i)},[e]);const o=h.useCallback(()=>e&&s&&s(i),[i,s,e]);return!n&&s?[!1,o]:[!0]}const Xu=h.createContext({strict:!1}),rl={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let il=!1;function X0(){if(il)return;const e={};for(const t in rl)e[t]={isEnabled:n=>rl[t].some(s=>!!n[s])};Eu(e),il=!0}function Zu(){return X0(),Ob()}function Z0(e){const t=Zu();for(const n in e)t[n]={...t[n],...e[n]};Eu(t)}const J0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ns(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||J0.has(e)}let Ju=e=>!Ns(e);function Q0(e){typeof e=="function"&&(Ju=t=>t.startsWith("on")?!Ns(t):e(t))}try{Q0(require("@emotion/is-prop-valid").default)}catch{}function ex(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||Ce(e[r])||(Ju(r)||n===!0&&Ns(r)||!t&&!Ns(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const Bs=h.createContext({});function tx(e,t){if(_s(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Pn(n)?n:void 0,animate:Pn(s)?s:void 0}}return e.inherit!==!1?t:{}}function nx(e){const{initial:t,animate:n}=tx(e,h.useContext(Bs));return h.useMemo(()=>({initial:t,animate:n}),[ol(t),ol(n)])}function ol(e){return Array.isArray(e)?e.join(" "):e}const Xi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qu(e,t,n){for(const s in t)!Ce(t[s])&&!ju(s,n)&&(e[s]=t[s])}function sx({transformTemplate:e},t){return h.useMemo(()=>{const n=Xi();return zi(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rx(e,t){const n=e.style||{},s={};return Qu(s,n,e),Object.assign(s,sx(e,t)),s}function ix(e,t){const n={},s=rx(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const ed=()=>({...Xi(),attrs:{}});function ox(e,t,n,s){const r=h.useMemo(()=>{const i=ed();return Vu(i,t,Iu(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Qu(i,e.style,e),r.style={...i,...r.style}}return r}const ax=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zi(e){return typeof e!="string"||e.includes("-")?!1:!!(ax.indexOf(e)>-1||/[A-Z]/u.test(e))}function lx(e,t,n,{latestValues:s},r,i=!1,o){const l=(o??Zi(e)?ox:ix)(t,s,r,e),c=ex(t,typeof e=="string",i),u=e!==h.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=h.useMemo(()=>Ce(d)?d.get():d,[d]);return h.createElement(e,{...u,children:f})}function cx({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:ux(n,s,r,e),renderState:t()}}function ux(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=fs(i[f]);let{initial:o,animate:a}=e;const l=_s(e),c=ku(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!Fs(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=Oi(e,f[p]);if(m){const{transitionEnd:y,transition:b,...x}=m;for(const w in x){let v=x[w];if(Array.isArray(v)){const k=u?v.length-1:0;v=v[k]}v!==null&&(r[w]=v)}for(const w in y)r[w]=y[w]}}}return r}const td=e=>(t,n)=>{const s=h.useContext(Bs),r=h.useContext(ki),i=()=>cx(e,t,s,r);return n?i():Ti(i)},dx=td({scrapeMotionValuesFromProps:qi,createRenderState:Xi}),fx=td({scrapeMotionValuesFromProps:Fu,createRenderState:ed}),hx=Symbol.for("motionComponentSymbol");function mx(e,t,n){const s=h.useRef(n);h.useInsertionEffect(()=>{s.current=n});const r=h.useRef(null);return h.useCallback(i=>{i&&e.onMount?.(i);const o=s.current;if(typeof o=="function")if(i){const a=o(i);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i);t&&(i?t.mount(i):t.unmount())},[t])}const nd=h.createContext({});function $t(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function px(e,t,n,s,r,i){const{visualElement:o}=h.useContext(Bs),a=h.useContext(Xu),l=h.useContext(ki),c=h.useContext(Os),u=c.reducedMotion,d=c.skipAnimations,f=h.useRef(null),p=h.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:i}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,y=h.useContext(nd);m&&!m.projection&&r&&(m.type==="html"||m.type==="svg")&&gx(f.current,n,r,y);const b=h.useRef(!1);h.useInsertionEffect(()=>{m&&b.current&&m.update(n,l)});const x=n[du],w=h.useRef(!!x&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return Sc(()=>{p.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),h.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),w.current=!1),m.enteringChildren=void 0)}),m}function gx(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sd(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&$t(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function sd(e){if(e)return e.options.allowProjection!==!1?e.projection:sd(e.parent)}function Dr(e,{forwardMotionProps:t=!1,type:n}={},s,r){s&&Z0(s);const i=n?n==="svg":Zi(e),o=i?fx:dx;function a(c,u){let d;const f={...h.useContext(Os),...c,layoutId:yx(c)},{isStatic:p}=f,m=nx(c),y=o(c,p);if(!p&&typeof window<"u"){bx();const b=xx(f);d=b.MeasureLayout,m.visualElement=px(e,y,f,r,b.ProjectionNode,i)}return g.jsxs(Bs.Provider,{value:m,children:[d&&m.visualElement?g.jsx(d,{visualElement:m.visualElement,...f}):null,lx(e,c,mx(y,m.visualElement,u),y,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(a);return l[hx]=e,l}function yx({layoutId:e}){const t=h.useContext(wc).id;return t&&e!==void 0?t+"-"+e:e}function bx(e,t){h.useContext(Xu).strict}function xx(e){const t=Zu(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function vx(e,t){if(typeof Proxy>"u")return Dr;const n=new Map,s=(i,o)=>Dr(i,o,e,t),r=(i,o)=>s(i,o);return new Proxy(r,{get:(i,o)=>o==="create"?s:(n.has(o)||n.set(o,Dr(o,void 0,e,t)),n.get(o))})}const wx=(e,t)=>t.isSVG??Zi(e)?new n0(t):new Xb(t,{allowProjection:e!==h.Fragment});class Sx extends St{constructor(t){super(t),t.animationState||(t.animationState=a0(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Fs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Tx=0;class kx extends St{constructor(){super(...arguments),this.id=Tx++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;if(t&&s===!1){if(this.isExitComplete){const{initial:i,custom:o}=this.node.getProps();if(typeof i=="string"){const a=jt(this.node,i,o);if(a){const{transition:l,transitionEnd:c,...u}=a;for(const d in u)this.node.getValue(d)?.jump(u[d])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Cx={animation:{Feature:Sx},exit:{Feature:kx}};function Fn(e){return{point:{x:e.pageX,y:e.pageY}}}const Ex=e=>t=>Wi(t)&&e(t,Fn(t));function Tn(e,t,n,s){return Rn(e,t,Ex(n),s)}const rd=({current:e})=>e?e.ownerDocument.defaultView:null,al=(e,t)=>Math.abs(e-t);function Ax(e,t){const n=al(e.x,t.x),s=al(e.y,t.y);return Math.sqrt(n**2+s**2)}const ll=new Set(["auto","scroll"]);class id{constructor(t,n,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ss(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Nr(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=Ax(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:b}=p,{timestamp:x}=Ae;this.history.push({...b,timestamp:x});const{onStart:w,onMove:v}=this.handlers;m||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=ss(m,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Nr(p.type==="pointercancel"?this.lastMoveEventInfo:ss(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,w),b&&b(p,w)},!Wi(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=r||window;const l=Fn(t),c=ss(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Ae;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Nr(c,this.history)),this.removeListeners=Vn(Tn(this.contextWindow,"pointermove",this.handlePointerMove),Tn(this.contextWindow,"pointerup",this.handlePointerUp),Tn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const s=getComputedStyle(n);(ll.has(s.overflowX)||ll.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const s=t===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:r.x-n.x,y:r.y-n.y};i.x===0&&i.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,r),ae.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),gt(this.updatePoint)}}function ss(e,t){return t?{point:t(e.point)}:e}function cl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nr({point:e},t){return{point:e,delta:cl(e,od(t)),offset:cl(e,Px(t)),velocity:Rx(t,.1)}}function Px(e){return e[0]}function od(e){return e[e.length-1]}function Rx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const r=od(e);for(;n>=0&&(s=e[n],!(r.timestamp-s.timestamp>_e(t)));)n--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&r.timestamp-s.timestamp>_e(t)*2&&(s=e[1]);const i=Be(r.timestamp-s.timestamp);if(i===0)return{x:0,y:0};const o={x:(r.x-s.x)/i,y:(r.y-s.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Mx(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?fe(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?fe(n,e,s.max):Math.min(e,n)),e}function ul(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Dx(e,{top:t,left:n,bottom:s,right:r}){return{x:ul(e.x,n,r),y:ul(e.y,t,s)}}function dl(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function Nx(e,t){return{x:dl(e.x,t.x),y:dl(e.y,t.y)}}function jx(e,t){let n=.5;const s=De(e),r=De(t);return r>s?n=Cn(t.min,t.max-s,e.min):s>r&&(n=Cn(e.min,e.max-r,t.min)),lt(0,1,n)}function Vx(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fi=.35;function Lx(e=fi){return e===!1?e=0:e===!0&&(e=fi),{x:fl(e,"left","right"),y:fl(e,"top","bottom")}}function fl(e,t,n){return{min:hl(e,t),max:hl(e,n)}}function hl(e,t){return typeof e=="number"?e:e[t]||0}const Ix=new WeakMap;class Fx{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ke(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{n&&this.snapToCursor(Fn(d).point),this.stopAnimation()},o=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mb(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),st(x=>{let w=this.getAxisMotionValue(x).get()||0;if(at.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const k=v.layout.layoutBox[x];k&&(w=De(k)*(parseFloat(w)/100))}}this.originPoint[x]=w}),y&&ae.update(()=>y(d,f),!1,!0),ri(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=f;if(m&&this.currentDirection===null){this.currentDirection=Ox(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),b&&ae.update(()=>b(d,f),!1,!0)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new id(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:rd(this.visualElement),element:this.visualElement.current})}stop(t,n){const s=t||this.latestPointerEvent,r=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!s)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ae.postRender(()=>a(s,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,s){const{drag:r}=this.getProps();if(!s||!rs(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=Mx(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&$t(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=Dx(s.layoutBox,t):this.constraints=!1,this.elastic=Lx(n),r!==this.constraints&&!$t(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&st(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Vx(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!$t(t))return!1;const s=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=Kb(s,r.root,this.visualElement.getTransformPagePoint());let o=Nx(r.layout.layoutBox,i);if(n){const a=n($b(o));this.hasMutatedConstraints=!!a,a&&(o=Pu(a))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=st(u=>{if(!rs(u,n,this.currentDirection))return;let d=l&&l[u]||{};(o===!0||o===u)&&(d={min:0,max:0});const f=r?200:1e6,p=r?40:1e7,m={type:"inertia",velocity:s?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return ri(this.visualElement,t),s.start(_i(t,s,0,n,this.visualElement,!1))}stopAnimation(){st(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),r=s[n];return r||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){st(n=>{const{drag:s}=this.getProps();if(!rs(n,s,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-fe(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!$t(n)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};st(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=jx({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),st(o=>{if(!rs(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(fe(l,c,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ix.set(this.visualElement,this);const t=this.visualElement.current,n=Tn(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),f=c.target,p=f!==t&&vb(f);u&&d&&!p&&this.start(c)});let s;const r=()=>{const{dragConstraints:c}=this.getProps();$t(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=_x(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ae.read(r);const a=Rn(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(st(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=fi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function ml(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function _x(e,t,n){const s=Sa(e,ml(n)),r=Sa(t,ml(n));return()=>{s(),r()}}function rs(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ox(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Bx extends St{constructor(t){super(t),this.removeGroupControls=$e,this.removeListeners=$e,this.controls=new Fx(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$e}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const jr=e=>(t,n)=>{e&&ae.update(()=>e(t,n),!1,!0)};class $x extends St{constructor(){super(...arguments),this.removePointerDownListener=$e}onPointerDown(t){this.session=new id(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rd(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:jr(t),onStart:jr(n),onMove:jr(s),onEnd:(i,o)=>{delete this.session,r&&ae.postRender(()=>r(i,o))}}}mount(){this.removePointerDownListener=Tn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Vr=!1;class Ux extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),s&&s.register&&r&&s.register(i),Vr&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),hs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:r,isPresent:i}=this.props,{projection:o}=s;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Vr=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ae.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),Ui.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=t;Vr=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ad(e){const[t,n]=q0(),s=h.useContext(wc);return g.jsx(Ux,{...e,layoutGroup:s,switchLayoutGroup:h.useContext(nd),isPresent:t,safeToRemove:n})}const Wx={pan:{Feature:$x},drag:{Feature:Bx,ProjectionNode:qu,MeasureLayout:ad}};function pl(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&ae.postRender(()=>i(t,Fn(t)))}class Kx extends St{mount(){const{current:t}=this.node;t&&(this.unmount=gb(t,(n,s)=>(pl(this.node,s,"Start"),r=>pl(this.node,r,"End"))))}unmount(){}}class Hx extends St{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vn(Rn(this.node.current,"focus",()=>this.onFocus()),Rn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gl(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&ae.postRender(()=>i(t,Fn(t)))}class Gx extends St{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Sb(t,(r,i)=>(gl(this.node,i,"Start"),(o,{success:a})=>gl(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const hi=new WeakMap,Lr=new WeakMap,Yx=e=>{const t=hi.get(e.target);t&&t(e)},zx=e=>{e.forEach(Yx)};function qx({root:e,...t}){const n=e||document;Lr.has(n)||Lr.set(n,{});const s=Lr.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(zx,{root:e,...t})),s[r]}function Xx(e,t,n){const s=qx(t);return hi.set(e,n),s.observe(e),()=>{hi.delete(e),s.unobserve(e)}}const Zx={some:0,all:1};class Jx extends St{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:Zx[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};this.stopObserver=Xx(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Qx(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Qx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ev={inView:{Feature:Jx},tap:{Feature:Gx},focus:{Feature:Hx},hover:{Feature:Kx}},tv={layout:{ProjectionNode:qu,MeasureLayout:ad}},nv={...Cx,...ev,...Wx,...tv},Fe=vx(nv,wx);function Ji(e){const t=Ti(()=>Vt(e)),{isStatic:n}=h.useContext(Os);if(n){const[,s]=h.useState(e);h.useEffect(()=>t.on("change",s),[])}return t}function ld(e,t){const n=Ji(t()),s=()=>n.set(t());return s(),Sc(()=>{const r=()=>ae.preRender(s,!1,!0),i=e.map(o=>o.on("change",r));return()=>{i.forEach(o=>o()),gt(s)}}),n}function sv(e){wn.current=[],e();const t=ld(wn.current,e);return wn.current=void 0,t}function cd(e,t,n,s){if(typeof e=="function")return sv(e);const i=typeof t=="function"?t:Nb(t,n,s),o=Array.isArray(e)?yl(e,i):yl([e],([l])=>i(l)),a=Array.isArray(e)?void 0:e.accelerate;return a&&!a.isTransformed&&typeof t!="function"&&Array.isArray(n)&&s?.clamp!==!1&&(o.accelerate={...a,times:t,keyframes:n,isTransformed:!0}),o}function yl(e,t){const n=Ti(()=>[]);return ld(e,()=>{n.length=0;const s=e.length;for(let r=0;r<s;r++)n[r]=e[r].get();return t(n)})}function rv(e,t={}){const{isStatic:n}=h.useContext(Os),s=()=>Ce(e)?e.get():e;if(n)return cd(s);const r=Ji(s());return h.useInsertionEffect(()=>jb(r,e,t),[r,JSON.stringify(t)]),r}function iv(e,t={}){return rv(e,{type:"spring",...t})}function _n(){!Yi.current&&Cu();const[e]=h.useState(Ps.current);return e}function ud({children:e,variant:t="primary",size:n="md",onClick:s,disabled:r=!1,className:i="",as:o="button",...a}){const l="inline-flex items-center justify-center font-medium transition-all duration-200 rounded-md focus:outline-none focus:ring-2 focus:ring-oai-blue/30 active:scale-[0.98] active:duration-100",c={primary:"bg-oai-black dark:bg-oai-white text-white dark:text-oai-black border border-transparent hover:bg-oai-gray-800 dark:hover:bg-oai-gray-200 active:bg-oai-gray-900 dark:active:bg-oai-gray-300 disabled:bg-oai-gray-300 dark:disabled:bg-oai-gray-700 disabled:text-oai-gray-500 dark:disabled:text-oai-gray-400 focus:ring-oai-brand/30 transition-colors duration-200",secondary:"bg-oai-white dark:bg-oai-gray-900 text-oai-black dark:text-oai-white border border-oai-gray-300 dark:border-oai-gray-700 hover:border-oai-brand hover:text-oai-brand active:bg-oai-gray-50 dark:active:bg-oai-gray-800 active:border-oai-brand-dark disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 disabled:border-oai-gray-200 dark:disabled:border-oai-gray-700 focus:ring-oai-brand/30 transition-colors duration-200",ghost:"bg-transparent text-oai-gray-600 dark:text-oai-gray-300 border border-transparent hover:text-oai-brand hover:bg-oai-brand-50/50 dark:hover:bg-oai-brand-950/30 active:bg-oai-brand-50 dark:active:bg-oai-brand-900/50 disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 focus:ring-oai-brand/30 transition-colors duration-200"},u={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},d=r?"cursor-not-allowed opacity-60":"cursor-pointer",f=`${l} ${c[t]} ${u[n]} ${d} ${i}`;return g.jsx(o,{className:f,onClick:s,disabled:r,...a,children:e})}function $s({children:e,title:t,subtitle:n,className:s="",bodyClassName:r=""}){return g.jsxs("div",{className:`rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 transition-colors duration-200 ${s}`,children:[(t||n)&&g.jsxs("div",{className:"px-5 py-4 border-b border-oai-gray-200 dark:border-oai-gray-800 transition-colors duration-200",children:[t&&g.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide transition-colors duration-200",children:t}),n&&g.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-300 mt-1 transition-colors duration-200",children:n})]}),g.jsx("div",{className:`p-5 ${r}`,children:e})]})}function ov({theme:e,onToggle:t,className:n="",size:s=36,iconSize:r=20}){const i=_n(),o=e==="dark",a=()=>{t?.(o?"light":"dark")},l={width:s,height:s,borderRadius:8,background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--oai-gray-600)",transition:"background-color 150ms ease, color 150ms ease"},c={backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},u=()=>g.jsxs("svg",{"aria-hidden":"true",width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"4"}),g.jsx("path",{d:"M12 2v2"}),g.jsx("path",{d:"M12 20v2"}),g.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),g.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),g.jsx("path",{d:"M2 12h2"}),g.jsx("path",{d:"M20 12h2"}),g.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),g.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]}),d=()=>g.jsx("svg",{"aria-hidden":"true",width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})});return i?g.jsx("button",{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:a,className:`oai-button-ghost oai-button-sm ${n}`,style:{...l,width:s,height:s,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",onMouseEnter:f=>{f.currentTarget.style.backgroundColor=c.backgroundColor,f.currentTarget.style.color=c.color},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color="var(--oai-gray-600)"},children:o?g.jsx(d,{}):g.jsx(u,{})}):g.jsx(Fe.button,{type:"button","aria-label":o?"Switch to light mode":"Switch to dark mode",onClick:a,className:`oai-button-ghost oai-button-sm ${n}`,style:{...l,width:s,height:s,padding:0},title:o?"切换到亮色模式":"切换到暗色模式",whileHover:{backgroundColor:"var(--oai-gray-100)",color:"var(--oai-black)"},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25},children:g.jsx(Fe.div,{initial:{scale:.8,opacity:0,rotate:-20},animate:{scale:1,opacity:1,rotate:0},exit:{scale:.8,opacity:0,rotate:20},transition:{type:"spring",stiffness:400,damping:25},children:o?g.jsx(d,{}):g.jsx(u,{})},o?"moon":"sun")})}function av(){return g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx("div",{className:"w-8 h-8 rounded-lg bg-oai-black dark:bg-oai-white flex items-center justify-center",children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-oai-white dark:text-oai-black",children:[g.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),g.jsx("span",{className:"text-base font-semibold text-oai-black dark:text-oai-white leading-tight",children:"Token Tracker"})]})}function lv({children:e,header:t,footer:n,className:s="",hideHeader:r=!1,hideFooter:i=!1}){const{resolvedTheme:o,toggleTheme:a}=xi();return g.jsxs("div",{className:`min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-sans flex flex-col transition-colors duration-200 ${s}`,children:[!r&&g.jsxs("header",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800 px-6 py-4 flex items-center justify-between transition-colors duration-200",children:[g.jsx(av,{}),g.jsx("div",{className:"flex-1 flex justify-center",children:t}),g.jsx(ov,{theme:o,onToggle:a})]}),g.jsx("main",{className:"flex-1 px-6 py-6",children:e}),!i&&n&&g.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-800 px-6 py-4 mt-auto transition-colors duration-200",children:n})]})}function cv({children:e,variant:t="info",size:n="md",className:s=""}){const r="inline-flex items-center font-medium",i={success:"bg-oai-brand-100 dark:bg-oai-brand-900/30 text-oai-brand-700 dark:text-oai-brand-400 rounded-full",warning:"bg-oai-amber-50 dark:bg-oai-amber-900/30 text-oai-amber-dark dark:text-oai-amber-400 rounded-full",error:"bg-red-50 dark:bg-red-900/30 text-red-600 dark:text-red-400 rounded-full",info:"bg-oai-gray-100 dark:bg-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-300 rounded-full",secondary:"bg-oai-gray-100 dark:bg-oai-gray-800 text-oai-gray-500 dark:text-oai-gray-300 rounded-md"},o={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm"},a=`${r} ${i[t]} ${o[n]} ${s}`.trim();return g.jsx("span",{className:a,children:e})}var uv={};function dv(e,t){return e==="."?{width:"0.34ch",justifyContent:"center",marginInline:"-0.04ch"}:e===","?{width:"0.08ch",justifyContent:"center",marginInline:"-0.30ch"}:{width:"0.72ch",justifyContent:"flex-start",paddingLeft:"0.04ch",height:t}}function fv({mv:e,digit:t,height:n}){const s=cd(e,r=>{const i=(r%10+10)%10,o=(10+t-i)%10;let a=o*n;return o>5&&(a-=10*n),a});return g.jsx(Fe.span,{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",y:s},children:t})}function hv(e){const t=Math.round(e),n=1e-9*Math.max(1,Math.abs(e));return Math.abs(e-t)<n?t:e}function mv(e,t){const n=e/t;return Math.floor(hv(n))}function pv(e){const t=String(e??""),n=Array.from(t),s=n.indexOf(".");let r=n.filter((a,l)=>/\d/.test(a)&&(s===-1||l<s)).length,i=0,o=!1;return n.map(a=>{if(!/\d/.test(a))return a==="."&&(o=!0),a;if(!o){const l=10**Math.max(r-1,0);return r-=1,l}return i+=1,10**-i})}function gv({place:e,value:t,height:n,digitStyle:s,shouldReduceMotion:r}){if(typeof e!="number"){const l=dv(e,n);return g.jsx("span",{"data-counter-token":"static",className:"relative inline-flex items-center justify-center",style:{height:n,...l,...s},children:e})}const i=mv(t,e),o=Ji(0),a=iv(o,{stiffness:220,damping:26,mass:.8});return h.useEffect(()=>{o.set(i)},[o,i]),r?g.jsx("span",{"data-counter-token":"digit",className:"relative inline-flex items-center justify-center overflow-hidden",style:{height:n,position:"relative",width:"0.9ch",fontVariantNumeric:"tabular-nums",...s},children:Math.abs(i)%10}):g.jsx("span",{"data-counter-token":"digit",className:"relative inline-flex overflow-hidden",style:{height:n,position:"relative",width:"0.9ch",fontVariantNumeric:"tabular-nums",...s},children:Array.from({length:10},(l,c)=>g.jsx(fv,{mv:a,digit:c,height:n},c))})}function yv({value:e,displayValue:t,fontSize:n=72,padding:s=0,places:r,gap:i=6,borderRadius:o=4,horizontalPadding:a=0,textColor:l="inherit",fontWeight:c="inherit",containerStyle:u,counterStyle:d,digitStyle:f,gradientHeight:p=14,gradientFrom:m="rgba(255,255,255,0.95)",gradientTo:y="rgba(255,255,255,0)",topGradientStyle:b,bottomGradientStyle:x}){const w=String(t??e??""),v=h.useMemo(()=>Array.isArray(r)&&r.length?r:pv(w),[r,w]),k=typeof navigator<"u"&&/jsdom/i.test(navigator.userAgent||"")||typeof process<"u"&&uv?.VITEST==="true",S=_n()||k,R=Number.isFinite(Number(e))?Math.abs(Number(e)):0,N=n+s;return S?g.jsx("span",{"data-counter-root":"true",style:{display:"inline-flex",alignItems:"center",color:l,fontSize:n,fontWeight:c,lineHeight:1,...u,...d},children:w}):g.jsxs("span",{"data-counter-root":"true",style:{position:"relative",display:"inline-block",...u},children:[g.jsx("span",{style:{fontSize:n,display:"flex",gap:i,overflow:"hidden",borderRadius:o,paddingLeft:a,paddingRight:a,lineHeight:1,color:l,fontWeight:c,...d},children:v.map((C,I)=>g.jsx(gv,{place:C,value:R,height:N,digitStyle:f,shouldReduceMotion:S},`${String(C)}-${I}`))}),g.jsxs("span",{style:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[g.jsx("span",{style:b??{height:p,background:`linear-gradient(to bottom, ${m}, ${y})`}}),g.jsx("span",{style:x??{height:p,background:`linear-gradient(to top, ${m}, ${y})`}})]})]})}const dd=h.createContext(void 0);function rn(e){const t=h.useContext(dd);if(e===!1&&t===void 0)throw new Error(pi(27));return t}const bv={...Si,...wi},xv=h.forwardRef(function(t,n){const{render:s,className:r,forceRender:i=!1,...o}=t,{store:a}=rn(),l=a.useState("open"),c=a.useState("nested"),u=a.useState("mounted"),d=a.useState("transitionStatus"),f=h.useMemo(()=>({open:l,transitionStatus:d}),[l,d]);return Dn("div",t,{state:f,ref:[a.context.backdropRef,n],stateAttributesMapping:bv,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:i||!c})}),vv=h.forwardRef(function(t,n){const{render:s,className:r,disabled:i=!1,nativeButton:o=!0,...a}=t,{store:l}=rn(),c=l.useState("open");function u(m){c&&l.setOpen(!1,pt(Qf,m.nativeEvent))}const{getButtonProps:d,buttonRef:f}=Jf({disabled:i,native:o}),p=h.useMemo(()=>({disabled:i}),[i]);return Dn("button",t,{state:p,ref:[n,f],props:[{onClick:u},a,d]})});let wv=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Sv=(function(e){return e[e.open=Xe.open]="open",e[e.closed=Xe.closed]="closed",e[e.startingStyle=Xe.startingStyle]="startingStyle",e[e.endingStyle=Xe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const fd=h.createContext(void 0);function hd(){const e=h.useContext(fd);if(e===void 0)throw new Error(pi(26));return e}const Tv={...Si,...wi,nestedDialogOpen(e){return e?{[Sv.nestedDialogOpen]:""}:null}},kv=h.forwardRef(function(t,n){const{className:s,finalFocus:r,initialFocus:i,render:o,...a}=t,{store:l}=rn(),c=l.useState("descriptionElementId"),u=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),f=l.useState("popupProps"),p=l.useState("modal"),m=l.useState("mounted"),y=l.useState("nested"),b=l.useState("nestedOpenDialogCount"),x=l.useState("open"),w=l.useState("openMethod"),v=l.useState("titleElementId"),k=l.useState("transitionStatus"),S=l.useState("role");hd(),hc({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});function R(M){return M==="touch"?l.context.popupRef.current:!0}const N=i===void 0?R:i,C=b>0,I=h.useMemo(()=>({open:x,nested:y,transitionStatus:k,nestedDialogOpen:C}),[x,y,k,C]),A=Dn("div",t,{state:I,props:[f,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:S,tabIndex:-1,hidden:!m,onKeyDown(M){lg.has(M.key)&&M.stopPropagation()},style:{[wv.nestedDialogs]:b}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:Tv});return g.jsx(Ap,{context:d,openInteractionType:w,disabled:!m,closeOnFocusOut:!u,initialFocus:N,returnFocus:r,modal:p!==!1,restoreFocus:"popup",children:A})}),Cv=h.forwardRef(function(t,n){const{keepMounted:s=!1,...r}=t,{store:i}=rn(),o=i.useState("mounted"),a=i.useState("modal"),l=i.useState("open");return o||s?g.jsx(fd.Provider,{value:s,children:g.jsxs(Sp,{ref:n,...r,children:[o&&a===!0&&g.jsx(rg,{ref:i.context.internalBackdropRef,inert:Xp(!l)}),t.children]})}):null});function Ev(e){const{store:t,parentContext:n,actionsRef:s}=e,r=t.useState("open"),i=t.useState("disablePointerDismissal"),o=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:c,reset:u}=Gp(r);Ip(t);const{forceUnmount:d}=Fp(r,t,()=>{u()}),f=ie(A=>{const M=pt(A);return M.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},M}),p=h.useCallback(()=>{t.setOpen(!1,f(eh))},[t,f]);h.useImperativeHandle(s,()=>({unmount:d,close:p}),[d,p]);const m=$p({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[y,b]=h.useState(0),x=y===0,w=Kp(m),v=Mp(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(A){if("button"in A&&A.button!==0||"touches"in A&&A.touches.length!==1)return!1;const M=qe(A);if(x&&!i){const U=M;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===U||t.context.backdropRef.current===U||we(U,a)&&!U?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:x});sg(r&&o===!0,a);const{getReferenceProps:k,getFloatingProps:S,getTriggerProps:R}=Up([w,v]);t.useContextCallback("onNestedDialogOpen",A=>{b(A+1)}),t.useContextCallback("onNestedDialogClose",()=>{b(0)}),h.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(y),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,y]);const N=h.useMemo(()=>k(c),[k,c]),C=h.useMemo(()=>R(c),[R,c]),I=h.useMemo(()=>S(),[S]);t.useSyncedValues({openMethod:l,activeTriggerProps:N,inactiveTriggerProps:C,popupProps:I,floatingRootContext:m,nestedOpenDialogCount:y})}const Av={...Bp,modal:oe(e=>e.modal),nested:oe(e=>e.nested),nestedOpenDialogCount:oe(e=>e.nestedOpenDialogCount),disablePointerDismissal:oe(e=>e.disablePointerDismissal),openMethod:oe(e=>e.openMethod),descriptionElementId:oe(e=>e.descriptionElementId),titleElementId:oe(e=>e.titleElementId),viewportElement:oe(e=>e.viewportElement),role:oe(e=>e.role)};class Pv extends ic{constructor(t){super(Rv(t),{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),triggerElements:new mc,onOpenChange:void 0,onOpenChangeComplete:void 0},Av)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const r={open:t},i=n.trigger?.id??null;(i||t)&&(r.activeTriggerId=i,r.activeTriggerElement=n.trigger??null),this.update(r)}}function Rv(e={}){return{...Op(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function Mv(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:r,onOpenChangeComplete:i,disablePointerDismissal:o=!1,modal:a=!0,actionsRef:l,handle:c,triggerId:u,defaultTriggerId:d=null}=e,f=rn(!0),p=!!f,m=Mn(()=>c?.store??new Pv({open:n??s,activeTriggerId:u!==void 0?u:d,modal:a,disablePointerDismissal:o,nested:p})).current;m.useControlledProp("open",n,s),m.useControlledProp("activeTriggerId",u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:a}),m.useContextCallback("onOpenChange",r),m.useContextCallback("onOpenChangeComplete",i);const y=m.useState("payload");Ev({store:m,actionsRef:l,parentContext:f?.store.context});const b=h.useMemo(()=>({store:m}),[m]);return g.jsx(dd.Provider,{value:b,children:typeof t=="function"?t({payload:y}):t})}let bl=(function(e){return e[e.open=Xe.open]="open",e[e.closed=Xe.closed]="closed",e[e.startingStyle=Xe.startingStyle]="startingStyle",e[e.endingStyle=Xe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Dv={...Si,...wi,nested(e){return e?{[bl.nested]:""}:null},nestedDialogOpen(e){return e?{[bl.nestedDialogOpen]:""}:null}},Nv=h.forwardRef(function(t,n){const{className:s,render:r,children:i,...o}=t,a=hd(),{store:l}=rn(),c=l.useState("open"),u=l.useState("nested"),d=l.useState("transitionStatus"),f=l.useState("nestedOpenDialogCount"),p=l.useState("mounted"),m=f>0,y=h.useMemo(()=>({open:c,nested:u,transitionStatus:d,nestedDialogOpen:m}),[c,u,d,m]);return Dn("div",t,{enabled:a||p,state:y,ref:[n,l.useStateSetter("viewportElement")],stateAttributesMapping:Dv,props:[{role:"presentation",hidden:!p,children:i},o]})});function xl(e){if(!Number.isFinite(e))return P("shared.placeholder.short");const t=Dl(e.toFixed(6));return t==="-"?P("shared.placeholder.short"):t}const jv=th.memo(function({isOpen:t,onClose:n,fleetData:s=[]}){if(!t)return null;const r=P("shared.unit.percent"),i=P("dashboard.cost_breakdown.calc_prefix"),o=P("dashboard.cost_breakdown.calc_dynamic"),a=(Array.isArray(s)?s:[]).map(u=>{const d=Ze(u?.usd),f=Number.isFinite(d)?d:0,p=Array.isArray(u?.models)?u.models:[];return{label:u?.label?String(u.label):"",usdValue:f,usdLabel:xl(f),models:p.map(m=>{const y=Ze(m?.share),b=Number.isFinite(y)?`${y}${r}`:P("shared.placeholder.short"),x=typeof m?.calc=="string"?m.calc.trim():"",w=x?x.toUpperCase():o;return{id:m?.id?String(m.id):"",name:m?.name?String(m.name):"",shareLabel:b,calcValue:w,calcRaw:x}})}}),l=a.reduce((u,d)=>u+d.usdValue,0),c=xl(l);return g.jsx(Mv,{open:t,onOpenChange:u=>{u||n?.()},children:g.jsxs(Cv,{children:[g.jsx(xv,{className:"fixed inset-0 z-[100] bg-matrix-dark/95 backdrop-blur-md","data-cost-analysis-backdrop":"true"}),g.jsx(Nv,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:g.jsx(kv,{className:"w-full max-w-2xl transform animate-in fade-in zoom-in duration-200",children:g.jsx(yh,{title:P("dashboard.cost_breakdown.title"),children:g.jsxs("div",{className:"space-y-8 py-4",children:[g.jsxs("div",{className:"text-center pb-6 border-b border-matrix-ghost",children:[g.jsx("div",{className:"text-caption text-matrix-muted uppercase mb-2 font-bold",children:P("dashboard.cost_breakdown.total_label")}),g.jsx("div",{className:"text-body font-black text-gold tracking-tight",style:{textShadow:"0 0 20px rgba(255, 215, 0, 0.4)"},children:c})]}),g.jsx("div",{className:"space-y-6 max-h-[45vh] overflow-y-auto no-scrollbar pr-2",children:a.map((u,d)=>g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex justify-between items-baseline border-b border-matrix-ghost pb-2",children:[g.jsx("span",{className:"text-body font-black text-matrix-bright uppercase tracking-widest",children:u.label}),g.jsx("span",{className:"text-body font-bold text-gold",children:u.usdLabel})]}),g.jsx("div",{className:"grid grid-cols-1 gap-1.5",children:u.models.map((f,p)=>{const m=f?.id||`${f.name}-${p}`;return g.jsxs("div",{className:"flex justify-between text-caption text-matrix-muted",children:[g.jsxs("span",{children:[f.name," (",f.shareLabel,")"]}),g.jsxs("span",{className:"opacity-40",children:[i," ",f.calcValue]})]},m)})})]},`${u.label}-${d}`))}),g.jsxs("div",{className:"pt-6 border-t border-matrix-ghost flex justify-between items-center",children:[g.jsx(vv,{className:"text-caption font-bold uppercase text-matrix-primary border border-matrix-dim px-6 py-2 hover:bg-matrix-primary hover:text-black transition-all",type:"button",children:P("dashboard.cost_breakdown.close")}),g.jsx("p",{className:"text-caption text-matrix-dim uppercase",children:P("dashboard.cost_breakdown.footer")})]})]})})})})]})})});function Vv({projectEntries:e=[],projectLimit:t=3,onProjectLimitChange:n,copy:s,hasDetailsActual:r,dailyEmptyPrefix:i,installSyncCmd:o,dailyEmptySuffix:a,detailsColumns:l,ariaSortFor:c,toggleSort:u,sortIconFor:d,pagedDetails:f,dailyBreakdownRows:p=[],dailyBreakdownColumns:m=[],dailyBreakdownAriaSortFor:y,dailyBreakdownSortIconFor:b,dailyBreakdownDateKey:x="day",detailsDateKey:w,renderDetailDate:v,renderDailyBreakdownDate:k,renderDetailCell:S,DETAILS_PAGED_PERIODS:R,period:N,detailsPageCount:C,detailsPage:I,setDetailsPage:A}){const[M,U]=h.useState("daily");return g.jsxs($s,{children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[g.jsxs("div",{role:"tablist","aria-label":"Data view",className:"flex gap-1",children:[g.jsx("button",{role:"tab","aria-selected":M==="daily",type:"button",onClick:()=>U("daily"),className:`text-xs font-medium px-3 py-1.5 rounded transition-colors ${M==="daily"?"text-oai-black dark:text-oai-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-500 dark:text-oai-gray-300 hover:text-oai-black dark:hover:text-oai-white hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/50"}`,children:s("dashboard.daily.title")}),g.jsx("button",{role:"tab","aria-selected":M==="projects",type:"button",onClick:()=>U("projects"),className:`text-xs font-medium px-3 py-1.5 rounded transition-colors ${M==="projects"?"text-oai-black dark:text-oai-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-500 dark:text-oai-gray-300 hover:text-oai-black dark:hover:text-oai-white hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/50"}`,children:s("dashboard.projects.title")})]}),M==="projects"&&g.jsxs("select",{"aria-label":"Number of projects to display",value:t,onChange:V=>n?.(Number(V.target.value)),className:"text-xs text-oai-gray-600 dark:text-oai-gray-300 bg-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-700 rounded px-2 py-1 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 focus:border-oai-brand dark:focus:border-oai-brand focus:outline-none transition-colors",children:[g.jsx("option",{value:3,children:s("dashboard.projects.limit_top_3")}),g.jsx("option",{value:6,children:s("dashboard.projects.limit_top_6")}),g.jsx("option",{value:10,children:s("dashboard.projects.limit_top_10")})]})]}),M==="projects"&&g.jsx("div",{className:"space-y-1",children:e.slice(0,t).map(V=>g.jsxs("a",{href:V?.project_ref||"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-2 rounded-lg hover:oai-bg-elevated transition-colors",children:[g.jsx("div",{className:"w-8 h-8 rounded-md oai-bg-elevated flex items-center justify-center oai-text-caption font-medium text-oai-gray-500 dark:text-oai-gray-300",children:(V?.project_key?.[0]||"?").toUpperCase()}),g.jsx("div",{className:"min-w-0 flex-1",children:g.jsx("div",{className:"oai-text-body-sm font-medium text-oai-black dark:text-oai-white truncate",children:V?.project_key||V?.project_ref?.split("/")?.pop()||"—"})}),g.jsx("div",{className:"oai-text-body-sm font-medium text-oai-black dark:text-oai-white tabular-nums",children:V?.billable_total_tokens?.toLocaleString?.()||V?.total_tokens?.toLocaleString?.()||"—"})]},V?.project_key||V?.project_ref))}),M==="daily"&&g.jsxs("div",{children:[p?.length===0?g.jsxs("div",{className:"oai-text-body-sm text-oai-gray-500 dark:text-oai-gray-300 mb-4",children:[i,g.jsx("code",{className:"mx-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 oai-bg-elevated px-1.5 py-0.5 font-mono oai-text-caption",children:o}),a]}):g.jsx("div",{className:"overflow-auto max-h-[320px] -mx-4 oai-scrollbar",children:g.jsxs("table",{className:"w-full border-collapse",children:[g.jsx("thead",{className:"sticky top-0 z-10",children:g.jsx("tr",{className:"border-b border-oai-gray-200 dark:border-oai-gray-700",children:m.map(V=>g.jsx("th",{"aria-sort":y?.(V.key)||"none",className:"text-left p-0 bg-white dark:bg-oai-gray-900",children:g.jsx("button",{type:"button",onClick:()=>u(V.key),className:"flex w-full items-center justify-start px-4 py-2 text-left oai-text-caption font-semibold text-oai-gray-600 dark:text-oai-gray-300 hover:text-oai-black dark:hover:text-oai-white transition-colors",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx("span",{children:V.label}),g.jsx("span",{className:"text-oai-gray-400 dark:text-oai-gray-400",children:b?.(V.key)||""})]})})},V.key))})}),g.jsx("tbody",{children:p.map(V=>g.jsxs("tr",{className:`border-b border-oai-gray-100 dark:border-oai-gray-800 last:border-b-0 hover:bg-oai-gray-50/50 dark:hover:bg-oai-gray-800/50 transition-colors ${V.missing?"text-oai-gray-400 dark:text-oai-gray-400":V.future?"text-oai-gray-300 dark:text-oai-gray-600":"text-oai-black dark:text-oai-white"}`,children:[g.jsx("td",{className:"px-4 py-2 oai-text-body-sm text-oai-gray-500 dark:text-oai-gray-300",children:k?k(V):v(V)}),g.jsx("td",{className:"px-4 py-2 oai-text-body-sm font-medium text-oai-black dark:text-oai-white tabular-nums",children:S(V,"total_tokens")}),g.jsx("td",{className:"px-4 py-2 oai-text-body-sm text-oai-gray-600 dark:text-oai-gray-300 tabular-nums",children:S(V,"input_tokens")}),g.jsx("td",{className:"px-4 py-2 oai-text-body-sm text-oai-gray-600 dark:text-oai-gray-300 tabular-nums",children:S(V,"output_tokens")}),g.jsx("td",{className:"px-4 py-2 oai-text-body-sm text-oai-gray-600 dark:text-oai-gray-300 tabular-nums",children:S(V,"cached_input_tokens")}),g.jsx("td",{className:"px-4 py-2 oai-text-body-sm text-oai-gray-600 dark:text-oai-gray-300 tabular-nums",children:S(V,"reasoning_output_tokens")})]},String(V?.[x]||V?.day||V?.hour||V?.month||"")))})]})}),M!=="daily"&&R.has(N)&&C>1?g.jsxs("div",{className:"mt-3 flex items-center justify-between oai-text-caption",children:[g.jsx("button",{type:"button",onClick:()=>A(V=>Math.max(0,V-1)),disabled:I===0,className:"px-3 py-1.5 text-oai-gray-600 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 rounded-md disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s("details.pagination.prev")}),g.jsxs("span",{className:"oai-text-muted",children:[I+1," / ",C]}),g.jsx("button",{type:"button",onClick:()=>A(V=>Math.min(C-1,V+1)),disabled:I+1>=C,className:"px-3 py-1.5 text-oai-gray-600 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 rounded-md disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s("details.pagination.next")})]}):null]})]})}function Ht({children:e,delay:t=0,duration:n=.4,y:s=20,className:r="",once:i=!0}){return _n()?g.jsx("div",{className:r,children:e}):g.jsx(Fe.div,{initial:{opacity:0,y:s},animate:{opacity:1,y:0},transition:{duration:n,delay:t,ease:[.25,.1,.25,1]},className:r,children:e})}function ms(e){return typeof e!="string"?"":e.trim()}function vl(e){const t=ms(e);return t?t.split(/[_\-\s]+/).filter(Boolean).map(n=>n.slice(0,1).toUpperCase()+n.slice(1).toLowerCase()).join(" "):""}function Lv(e){if(!Array.isArray(e))return[];const t=new Map;for(const n of e){if(!n||typeof n!="object")continue;const s=ms(n.tool),r=ms(n.planType)||ms(n.plan_type);if(!s||!r)continue;const i=vl(s)||s,o=vl(r)||r;t.set(`${s.toLowerCase()}::${r.toLowerCase()}`,{tool:i,plan:o})}return Array.from(t.values())}function Iv({rankLabel:e,streakDays:t,subscriptions:n=[],rolling:s,topModels:r=[],className:i=""}){const o=P("shared.placeholder.short"),a=P("shared.unit.percent"),l=e??P("identity_card.rank_placeholder"),c=Number.isFinite(Number(t))?Number(t):0,u=c?P("identity_card.streak_value",{days:c}):P("identity_card.rank_placeholder"),d=Lv(n),f={thousandSuffix:P("shared.unit.thousand_abbrev"),millionSuffix:P("shared.unit.million_abbrev"),billionSuffix:P("shared.unit.billion_abbrev")},p=y=>{if(y==null)return o;const b=Nl(y,f);return b==="-"?o:b},m=r.slice(0,3);return g.jsx(Ht,{delay:.1,children:g.jsxs($s,{className:`h-full ${i}`,children:[g.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[g.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-2 bg-oai-gray-50 dark:bg-oai-gray-800 rounded-lg",children:[g.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white tabular-nums",children:p(s?.last_7d?.totals?.billable_total_tokens)}),g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:"7d"})]}),g.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-2 bg-oai-gray-50 dark:bg-oai-gray-800 rounded-lg",children:[g.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white tabular-nums",children:p(s?.last_30d?.totals?.billable_total_tokens)}),g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:"30d"})]}),g.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-2 bg-oai-gray-50 dark:bg-oai-gray-800 rounded-lg",children:[g.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white tabular-nums",children:p(s?.last_30d?.avg_per_active_day)}),g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:"avg"})]}),g.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-2 bg-oai-gray-50 dark:bg-oai-gray-800 rounded-lg",children:[g.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white tabular-nums",children:p(s?.last_30d?.totals?.conversation_count)}),g.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:"convs"})]})]}),m.length>0&&g.jsx("div",{className:"mt-4 pt-3 border-t border-oai-gray-100 dark:border-oai-gray-800",children:m.map((y,b)=>{const x=y?.name?String(y.name):o,w=y?.percent?String(y.percent):"",v=b===m.length-1,k=b+1;return g.jsxs("div",{className:`flex items-center py-2 ${v?"":"border-b border-oai-gray-50 dark:border-oai-gray-800"}`,children:[g.jsx("span",{className:"w-5 h-5 flex items-center justify-center rounded-full bg-oai-gray-100 dark:bg-oai-gray-800 text-[10px] font-semibold text-oai-gray-500 dark:text-oai-gray-300 flex-shrink-0",children:k}),g.jsx("span",{className:"flex-1 text-sm text-oai-gray-700 dark:text-oai-gray-300 truncate px-2.5",title:x,children:x}),g.jsxs("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white tabular-nums flex-shrink-0",children:[w,a]})]},y.id||x)})}),d.length>0&&g.jsx("div",{className:"mt-3 pt-3 border-t border-oai-gray-100 dark:border-oai-gray-800 flex flex-wrap gap-1.5",children:d.map((y,b)=>g.jsxs(cv,{variant:"secondary",size:"sm",children:[y.tool," ",y.plan]},`${y.tool}:${y.plan}:${b}`))}),g.jsxs("div",{className:"mt-4 pt-3 border-t border-oai-gray-100 dark:border-oai-gray-800 flex items-center justify-between text-xs text-oai-gray-400 dark:text-oai-gray-400",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{children:P("identity_card.rank_label")}),g.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-300 tabular-nums",children:l})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{children:P("identity_card.streak_label")}),g.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-300 tabular-nums",children:u})]})]})]})})}function Fv(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?{key:t,label:t.toUpperCase()}:{key:t.key,label:t.label||String(t.key).toUpperCase()}):[]}function _v(e){if(typeof e!="string")return null;const t=e.replace(/,/g,"").match(/-?\d+(?:\.\d+)?/);if(!t)return null;const n=Number(t[0]);return Number.isFinite(n)?n:null}const Ov={CODEX:"#10b981",CLAUDE:"#8b5cf6",OPENCODE:"#f59e0b",GEMINI:"#3b82f6"};function Ir(e,t){const n=e?.toUpperCase?.()||"";return Ov[n]||`hsl(${150+t*40}, 60%, 45%)`}function Bv({loading:e,onClick:t}){const n=_n();return g.jsx(ud,{variant:"secondary",size:"sm",disabled:e,onClick:t,"aria-label":"Refresh data",className:"w-8 p-0",children:g.jsx(Fe.span,{"aria-hidden":"true",animate:e?{rotate:360}:{rotate:0},transition:e&&!n?{duration:1,repeat:1/0,ease:"linear"}:{duration:.3},style:{display:"inline-block"},children:"↻"})})}function $v({period:e,periods:t,onPeriodChange:n,summaryValue:s,summaryLabel:r,summaryCostValue:i,onCostInfo:o,fleetData:a=[],onRefresh:l,loading:c,className:u=""}){const d=Fv(t),f=_v(String(s??"")),p=f!=null,[m,y]=h.useState(null),{resolvedTheme:b}=xi(),x=b==="dark",w=x?"rgba(10,10,10,0.98)":"rgba(255,255,255,0.96)",v=x?"rgba(10,10,10,0)":"rgba(255,255,255,0)",k=a.filter(S=>S.models?.length>0);return g.jsx(Ht,{delay:.2,children:g.jsxs($s,{className:u,children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6",children:[g.jsx("div",{role:"tablist","aria-label":"Time period",className:"flex gap-1",children:d.map(S=>g.jsx("button",{role:"tab","aria-selected":e===S.key,type:"button",className:`text-xs font-medium px-3 py-1.5 rounded-md transition-colors ${e===S.key?"text-oai-black dark:text-oai-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-500 dark:text-oai-gray-300 hover:text-oai-black dark:hover:text-oai-white hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800"}`,onClick:()=>n?.(S.key),children:S.label},S.key))}),l&&g.jsx(Bv,{loading:c,onClick:l})]}),g.jsxs("div",{className:"text-center mb-8",children:[g.jsx("div",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wider mb-3",children:r}),g.jsx("div",{className:"text-6xl md:text-7xl font-bold text-oai-black dark:text-oai-white tracking-tight tabular-nums",children:p?g.jsx(yv,{value:f,displayValue:s,fontSize:72,padding:6,gap:1,textColor:"var(--oai-black, #111827)",fontWeight:700,gradientHeight:x?0:8,gradientFrom:w,gradientTo:v,counterStyle:{paddingLeft:0,paddingRight:0,gap:0},digitStyle:{width:"0.88ch"}}):s}),i&&g.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4",children:[g.jsx("span",{className:"text-xl font-bold text-oai-brand",children:i}),o&&g.jsx("button",{type:"button",onClick:o,className:"w-8 h-8 rounded-full bg-oai-gray-100 dark:bg-oai-gray-800 text-oai-gray-500 dark:text-oai-gray-300 hover:bg-oai-brand hover:text-white text-xs transition-colors","aria-label":"View cost breakdown",children:"?"})]})]}),k.length>0&&g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{role:"img","aria-label":`Provider distribution: ${k.map(S=>`${S.label} ${S.totalPercent}%`).join(", ")}`,className:"h-1.5 w-full bg-oai-gray-100 dark:bg-oai-gray-800 rounded-full overflow-hidden flex",children:k.map((S,R)=>{const N=Ir(S.label,R);return g.jsx(Fe.div,{initial:{width:0},animate:{width:`${S.totalPercent}%`},transition:{duration:.6,delay:.3+R*.1},className:"h-full",style:{backgroundColor:N},title:`${S.label}: ${S.totalPercent}%`},S.label)})}),g.jsx("div",{className:"flex flex-wrap gap-3",children:k.map((S,R)=>{const N=Ir(S.label,R),C=m===S.label;return g.jsxs("button",{"aria-expanded":C,"aria-controls":`provider-details-${S.label}`,"aria-label":`${S.label}: ${S.totalPercent}%. Click to ${C?"collapse":"expand"} details`,onClick:()=>y(C?null:S.label),className:`flex-1 min-w-[140px] text-left p-3 rounded-lg border transition-colors duration-200 ${C?"border-oai-gray-300 dark:border-oai-gray-600 bg-oai-gray-50 dark:bg-oai-gray-800":"border-oai-gray-200 dark:border-oai-gray-700 hover:border-oai-gray-300 dark:hover:border-oai-gray-600"}`,children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:N}}),g.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:S.label})]}),g.jsxs("div",{className:"text-lg font-semibold text-oai-black dark:text-oai-white tabular-nums",children:[S.totalPercent,"%"]}),g.jsxs("div",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:[S.models.length," models"]})]},S.label)})}),m&&g.jsx("div",{id:`provider-details-${m}`,role:"region","aria-label":`${m} model details`,className:"border border-oai-gray-200 dark:border-oai-gray-700 rounded-lg p-4 bg-oai-gray-50/30 dark:bg-oai-gray-800/30 overflow-hidden",children:k.filter(S=>S.label===m).map(S=>{const R=Ir(S.label,0),N=[...S.models].sort((C,I)=>(I.share||0)-(C.share||0));return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[g.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:R}}),g.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:S.label}),g.jsxs("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-400",children:[S.totalPercent,"%"]})]}),g.jsx("div",{className:"space-y-2",children:N.map(C=>g.jsx("div",{className:"flex items-center gap-3",children:g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[g.jsx("span",{className:"text-sm text-oai-gray-700 dark:text-oai-gray-300 truncate",children:C.name}),g.jsxs("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white tabular-nums shrink-0",children:[C.share,"%"]})]}),g.jsx("div",{className:"h-1 bg-oai-gray-200 dark:bg-oai-gray-700 rounded-full overflow-hidden",children:g.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${C.share}%`,backgroundColor:R,opacity:.7}})})]})},C.id||C.name))})]},S.label)})})]})]})})}function wl(e,t){if(!Array.isArray(e)||e.length===0)return 0;if(e.length===1)return e[0];const n=(e.length-1)*t,s=Math.floor(n),r=Math.ceil(n);if(s===r)return e[s];const i=n-s;return e[s]+(e[r]-e[s])*i}function Uv(e){const t=Array.isArray(e)?e.filter(r=>Number.isFinite(r)&&r>0).sort((r,i)=>r-i):[];if(t.length===0)return{rawMax:0,effectiveMax:1,clippedValues:Array.isArray(e)?e.map(()=>0):[]};const n=t.at(-1)??0;let s=n;if(t.length>=4){const r=wl(t,.25),i=wl(t,.75),o=Math.max(i-r,0),a=i+o*1.5;n>a&&(s=Math.max(a,i,1))}return{rawMax:n,effectiveMax:Math.max(s,1),clippedValues:Array.isArray(e)?e.map(r=>!Number.isFinite(r)||r<=0?0:Math.min(r,Math.max(s,1))):[]}}function Wv({value:e,displayValue:t,scale:n,index:s,row:r,totalBars:i}){const o=_n(),a=n.effectiveMax>0?t/n.effectiveMax*100:0,l=`${Math.max(a,2)}%`,c=r?.missing,u=r?.future,d=i<=7?"6px":i<=14?"4px":"3px";return g.jsx(Fe.div,{className:"group relative flex-1 self-stretch",initial:{opacity:0,scaleY:0},animate:{opacity:1,scaleY:1},transition:{duration:o?0:.3,delay:o?0:s*.02,ease:[.25,.1,.25,1]},style:{originY:1},children:g.jsxs("div",{className:"absolute inset-x-0 bottom-0",style:{height:l},children:[g.jsx("div",{"data-trend-bar":"true",className:"h-full w-full cursor-pointer transition-all duration-200 group-hover:brightness-110",style:{minHeight:e>0?"4px":"2px",opacity:c||u?.2:1,borderRadius:`${d} ${d} 0 0`,background:e>0?"#10b981":"var(--oai-gray-100)"},title:`${e.toLocaleString()}`}),g.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-oai-black text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-20",children:e.toLocaleString()})]})})}function Kv({rows:e,from:t,to:n,period:s,timeZoneLabel:r,showTimeZoneLabel:i=!0,className:o=""}){const a=Array.isArray(e)&&e.length?e:[],l=a.map(u=>{if(u?.missing||u?.future)return 0;const d=u?.billable_total_tokens??u?.total_tokens??u?.value;if(d==null)return 0;const f=Number(d);return Number.isFinite(f)?f:0}),c=Uv(l);return g.jsxs("div",{className:`rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5 ${o}`,children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:P("trend.monitor.label")}),i&&r&&g.jsx("p",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-400 mt-0.5",children:r})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute inset-0 flex flex-col justify-between pointer-events-none",children:[0,25,50,75,100].map(u=>g.jsx("div",{className:"w-full border-t border-oai-gray-100 dark:border-oai-gray-800",style:{top:`${100-u}%`}},u))}),g.jsx("div",{className:"h-40 flex items-end gap-1 relative z-0",children:l.length>0?l.map((u,d)=>g.jsx(Wv,{value:u,displayValue:c.clippedValues[d]??0,scale:c,index:d,row:a[d],totalBars:l.length},d)):g.jsx("div",{className:"flex-1 h-full flex items-center justify-center",children:g.jsx("p",{className:"text-sm text-oai-gray-400 dark:text-oai-gray-400",children:"No data yet"})})})]}),t&&n&&g.jsxs("div",{className:"flex justify-between text-xs text-oai-gray-500 dark:text-oai-gray-300 font-medium pt-2 border-t border-oai-gray-100 dark:border-oai-gray-800",children:[g.jsx("span",{children:t}),g.jsx("span",{children:n})]})]})]})}function Hv(e){const{copy:t,screenshotMode:n,publicViewInvalid:s,publicViewInvalidTitle:r,publicViewInvalidBody:i,showExpiredGate:o,showAuthGate:a,screenshotTitleLine1:l,screenshotTitleLine2:c,identityDisplayName:u,identityStartDate:d,activeDays:f,identitySubscriptions:p,identityScrambleDurationMs:m,projectUsageEntries:y,projectUsageLimit:b,setProjectUsageLimit:x,topModels:w,signedIn:v,publicMode:k,shouldShowInstall:S,installPrompt:R,handleCopyInstall:N,installCopied:C,installInitCmdDisplay:I,publicViewTitle:A,handleTogglePublicView:M,publicViewBusy:U,publicViewEnabled:V,publicViewCopyButtonLabel:$,handleCopyPublicView:j,trendRowsForDisplay:W,trendFromForDisplay:pe,trendToForDisplay:D,period:_,trendTimeZoneLabel:z,activityHeatmapBlock:X,isCapturing:se,handleShareToX:H,screenshotTwitterButton:Q,screenshotTwitterHint:ee,periodsForDisplay:de,setSelectedPeriod:be,summaryLabel:Ne,summaryValue:Oe,summaryCostValue:Qe,rollingUsage:et,costInfoEnabled:E,openCostModal:te,costModalOpen:G,closeCostModal:xe,allowBreakdownToggle:L,refreshAll:J,usageLoadingState:Z,fleetData:ne,hasDetailsActual:ue,dailyEmptyPrefix:K,installSyncCmd:Y,dailyEmptySuffix:Ee,detailsColumns:he,ariaSortFor:je,toggleSort:Ve,sortIconFor:ct,pagedDetails:ve,dailyBreakdownRows:re,dailyBreakdownColumns:Re,dailyBreakdownAriaSortFor:Ie,dailyBreakdownSortIconFor:Us,dailyBreakdownDateKey:Ws,detailsDateKey:le,renderDetailDate:On,renderDailyBreakdownDate:tt,renderDetailCell:nt,DETAILS_PAGED_PERIODS:Bn,detailsPageCount:on,detailsPage:Ks,setDetailsPage:Hs}=e;return g.jsxs(g.Fragment,{children:[g.jsxs(lv,{hideHeader:n,header:null,footer:n?null:null,className:n?"screenshot-mode":"",children:[s?g.jsx("div",{className:"mb-6",children:g.jsx($s,{title:r,className:"border-oai-gray-200 dark:border-oai-gray-800",children:g.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-300 mt-0",children:i})})}):null,o||a?null:g.jsx(g.Fragment,{children:g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-4",children:[g.jsxs("div",{className:"lg:col-span-4 flex flex-col gap-4 min-w-0",children:[n?g.jsx("div",{className:"flex items-start justify-between gap-4",children:g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-3xl md:text-4xl font-semibold text-oai-black dark:text-oai-white tracking-tight leading-none",children:l}),g.jsx("span",{className:"text-2xl md:text-3xl font-semibold text-oai-black dark:text-oai-white tracking-tight leading-none",children:c})]})}):null,g.jsx(Iv,{title:t("dashboard.identity.title"),subtitle:t("dashboard.identity.subtitle"),rankLabel:d??t("identity_card.rank_placeholder"),streakDays:f,subscriptions:p,rolling:et,topModels:w}),S?g.jsx(Ht,{delay:.25,children:g.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-3",children:[g.jsx("div",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-300 mb-1.5",children:R}),g.jsxs(Fe.button,{onClick:N,whileHover:{scale:1.01},whileTap:{scale:.99},className:"w-full flex items-center justify-between px-3 py-2 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 rounded-lg transition-colors",children:[g.jsx("code",{className:"text-xs font-mono text-oai-gray-700 dark:text-oai-gray-300",children:I}),g.jsx(Fe.span,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"text-xs text-oai-brand",children:C?"Copied ✓":"Copy"},C?"copied":"copy")]})]})}):null,!n&&v&&!k?g.jsx(Ht,{delay:.3,children:g.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-3 flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Fe.button,{type:"button",onClick:M,disabled:U,whileTap:{scale:.95},className:`relative inline-flex h-4 w-7 items-center px-0.5 transition-colors rounded-full ${V?"bg-oai-brand":"bg-oai-gray-300 dark:bg-oai-gray-600"} disabled:opacity-50`,children:g.jsx(Fe.span,{initial:!1,animate:{x:V?12:0},transition:{type:"spring",stiffness:500,damping:30},className:"inline-block h-3 w-3 bg-white rounded-full"})}),g.jsx(Fe.span,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"text-xs text-oai-gray-600 dark:text-oai-gray-300",children:V?"Public":"Private"},V?"public":"private")]}),g.jsx(Fe.button,{onClick:j,disabled:!V||U,whileHover:{scale:V?1.05:1},whileTap:{scale:V?.95:1},className:"text-xs text-oai-brand hover:text-oai-brand-dark disabled:text-oai-gray-300 dark:disabled:text-oai-gray-600 transition-colors",children:$})]})}):null,X&&g.jsx(Ht,{delay:.4,children:X}),n?null:g.jsx(Kv,{rows:W,from:pe,to:D,period:_,timeZoneLabel:z,showTimeZoneLabel:!1}),n?g.jsxs("div",{className:"mt-4 flex flex-col items-center gap-2","data-screenshot-exclude":"true",style:se?{display:"none"}:void 0,children:[g.jsx(ud,{type:"button",onClick:H,variant:"primary",size:"lg",disabled:se,children:Q}),g.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-300",children:ee})]}):null]}),g.jsxs("div",{className:"lg:col-span-8 flex flex-col gap-4 min-w-0",children:[g.jsx($v,{period:_,periods:de,onPeriodChange:be,summaryLabel:Ne,summaryValue:Oe,summaryCostValue:Qe,onCostInfo:E?te:null,fleetData:ne,onRefresh:n?null:J,loading:Z}),n?null:g.jsx(Ht,{delay:.5,children:g.jsx(Vv,{projectEntries:y,projectLimit:b,onProjectLimitChange:x,copy:t,hasDetailsActual:ue,dailyEmptyPrefix:K,installSyncCmd:Y,dailyEmptySuffix:Ee,detailsColumns:he,ariaSortFor:je,toggleSort:Ve,sortIconFor:ct,pagedDetails:ve,dailyBreakdownRows:re,dailyBreakdownColumns:Re,dailyBreakdownAriaSortFor:Ie,dailyBreakdownSortIconFor:Us,dailyBreakdownDateKey:Ws,detailsDateKey:le,renderDetailDate:On,renderDailyBreakdownDate:tt,renderDetailCell:nt,DETAILS_PAGED_PERIODS:Bn,period:_,detailsPageCount:on,detailsPage:Ks,setDetailsPage:Hs})})]})]})})]}),g.jsx(jv,{isOpen:G,onClose:xe,fleetData:ne})]})}const Gv=["day","week","month","total"],Fr=new Set(["day","hour","month"]),mn=new Set(["day","total"]);function _r(e,t){if(typeof t=="number"&&t>0)return!0;if(typeof e=="bigint")return e>0n;if(typeof e=="number")return Number.isFinite(e)&&e>0;if(typeof e=="string"){const n=e.trim();if(!n)return!1;if(/^[0-9]+$/.test(n))try{return BigInt(n)>0n}catch{return!1}const s=Number(n);return Number.isFinite(s)&&s>0}return!1}function is(e){return e?e?.billable_total_tokens??e?.total_tokens:null}function Sl(e){return e?e?.billable_total_tokens??e?.value??e?.total_tokens:null}function Yv(e){if(typeof e!="string"||!e)return null;const t=e.split("-");if(t.length!==3)return null;const n=Number(t[0]),s=Number(t[1])-1,r=Number(t[2]);if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(r))return null;const i=new Date(Date.UTC(n,s,r));return Number.isFinite(i.getTime())?i:null}function zv(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function qv(e){return e?e==="www.tokentracker.cc":!1}function Xv(){if(typeof window>"u")return!1;const e=new URLSearchParams(window.location.search),t=String(e.get("force_install")||"").toLowerCase();return t!=="1"&&t!=="true"?!1:!qv(window.location.hostname)}function nw({baseUrl:e,auth:t,signedIn:n,sessionSoftExpired:s,signOut:r,publicMode:i=!1,publicToken:o=null,signInUrl:a="/sign-in",signUpUrl:l="/sign-up"}){const[c,u]=h.useState(!1),[d,f]=h.useState(null),[p,m]=h.useState(null),[y,b]=h.useState(!1),[x,w]=h.useState(null),[v,k]=h.useState(0),[S,R]=h.useState(0),[N,C]=h.useState(!1),[I,A]=h.useState(null),[M,U]=h.useState(!1),[V,$]=h.useState(!1),[j,W]=h.useState(!1),[pe,D]=h.useState(null),[_,z]=h.useState(null),[X,se]=h.useState(null),[H,Q]=h.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(max-width: 640px)").matches),ee=h.useMemo(()=>typeof window>"u"?!1:nh(window.location.search),[]),de=h.useMemo(()=>Xv(),[]),[be,Ne]=h.useState(!1),Oe=2200,[Qe,et]=h.useState(!0),[E,te]=h.useState(!1),[G,xe]=h.useState(!1),[L,J]=h.useState(!1),Z=Jt(),ne=n&&!s,ue=h.useMemo(()=>ne&&(typeof t=="function"||typeof t=="string"||t&&typeof t=="object")?t:null,[t,ne]),K=ne?ue:null,Y=i?sh(o):K,Ee=n||Z||i,he=ne&&Qt(K),je=n&&s&&!i;h.useEffect(()=>{if(!n||Z){f(null),m(null),b(!1),w(null);return}if(i)return;if(!he){f(null),m(null),b(!1),w(null);return}let T=!0;const O=()=>{f(null),m(null),b(!1),w(null)};return b(!0),w(null),(async()=>{let F=null;try{F=await ot(K)}catch{F=null}if(T){if(!F){O();return}try{const q=await bh({baseUrl:e,accessToken:F});if(!T)return;f(typeof q?.link_code=="string"?q.link_code:null),m(typeof q?.expires_at=="string"?q.expires_at:null)}catch(q){if(!T)return;f(null),m(null),w(q?.message||"Failed to load link code")}finally{if(!T)return;b(!1)}}})(),()=>{T=!1}},[e,Z,n,i,he,K,S]),h.useEffect(()=>{if(!n||Z||i){C(!1),A(null),U(!1),$(!1),W(!1);return}if(!he){C(!1),A(null),U(!1),$(!1),W(!1);return}let T=!0;return U(!0),(async()=>{let O=null;try{O=await ot(K)}catch{O=null}if(T){if(!O){C(!1),A(null),U(!1);return}try{const F=await jo({baseUrl:e,accessToken:O});if(!T)return;const q=!!F?.enabled;C(q),A(F?.share_token||null)}catch{if(!T)return;C(!1),A(null)}finally{if(!T)return;U(!1)}}})(),()=>{T=!1}},[e,Z,n,i,he,K]),h.useEffect(()=>{if(!i){D(null),z(null);return}if(!o){D(null),z(null);return}D(null),z(null);let T=!0;return xh({baseUrl:e,accessToken:o}).then(O=>{T&&(D(typeof O?.display_name=="string"?O.display_name:null),z(typeof O?.avatar_url=="string"?O.avatar_url:null))}).catch(()=>{T&&(D(null),z(null))}),()=>{T=!1}},[e,i,o]);const Ve=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");h.useEffect(()=>{if(!Ve&&(!n||Z||i)){se(null);return}if(!Ve&&!he){se(null);return}let T=!0;return(async()=>{let O=null;try{O=await ot(K)}catch{O=null}if(T){if(!O&&!Ve){se(null);return}try{const F=await vh({baseUrl:e,accessToken:O});if(!T)return;se(F&&typeof F=="object"?F:null)}catch{if(!T)return;se(null)}}})(),()=>{T=!1}},[he,e,K,Z,i,n]);const ct=h.useMemo(()=>{if(!p)return!1;const T=Date.parse(p);if(!Number.isFinite(T))return!1;const O=v||Date.now();return T<=O},[p,v]);h.useEffect(()=>{!n||Z||i||!p||!ct||y||(f(null),m(null),w(null),R(T=>T+1))},[ct,p,y,Z,n]),h.useEffect(()=>{if(!p||i)return;const T=Date.parse(p);if(!Number.isFinite(T))return;const O=Date.now();if(k(O),T<=O)return;const F=window.setTimeout(()=>k(Date.now()),T-O),q=()=>{typeof document>"u"||document.visibilityState==="visible"&&k(Date.now())};return typeof document<"u"&&document.addEventListener("visibilitychange",q),window.addEventListener("focus",q),()=>{window.clearTimeout(F),typeof document<"u"&&document.removeEventListener("visibilitychange",q),window.removeEventListener("focus",q)}},[p]),h.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const T=window.matchMedia("(max-width: 640px)"),O=()=>Q(T.matches);return O(),T.addEventListener?(T.addEventListener("change",O),()=>T.removeEventListener("change",O)):(T.addListener(O),()=>T.removeListener(O))},[]);const ve=h.useMemo(()=>rh(),[]),re=h.useMemo(()=>ih(),[]),Re=h.useMemo(()=>oh(),[]),Ie=i?null:t?.userId||t?.email||"default",[Us,Ws]=h.useState("month"),le=ee?"total":Us,On=h.useMemo(()=>ah(le,{timeZone:ve,offsetMinutes:re,now:Re}),[Re,le,ve,re]),tt=On.from,nt=On.to,Bn=h.useMemo(()=>lh({timeZone:ve,offsetMinutes:re}),[ve,re]),on=h.useMemo(()=>ch({timeZone:ve,offsetMinutes:re}),[ve,re]),Ks=h.useMemo(()=>`Local time (${on})`,[on]),Hs=ve,Qi=re,eo=Bn,an=h.useMemo(()=>mi({timeZone:ve,offsetMinutes:re,date:Re||new Date}),[Re,ve,re]),to=h.useMemo(()=>{const T=Yv(an)||new Date,O=zv(T,-29);return{from:zt(O),to:zt(T)}},[an]),{daily:yt,summary:Ue,rolling:md,source:no,loading:pd,error:We,refresh:so}=_o({baseUrl:e,accessToken:Y,guestAllowed:je,from:tt,to:nt,includeDaily:le!=="total",cacheKey:Ie,timeZone:ve,tzOffsetMinutes:re,now:Re}),{daily:ro,loading:gd,refresh:io}=_o({baseUrl:e,accessToken:Y,guestAllowed:je,from:to.from,to:to.to,includeDaily:!0,cacheKey:Ie?`${Ie}.daily-breakdown`:"daily-breakdown",timeZone:ve,tzOffsetMinutes:re,now:Re}),{breakdown:Tt,loading:yd,refresh:oo}=fm({baseUrl:e,accessToken:Y,guestAllowed:je,from:tt,to:nt,cacheKey:Ie,timeZone:ve,tzOffsetMinutes:re}),[ao,bd]=h.useState(3),{entries:xd,loading:vd,refresh:lo}=sm({baseUrl:e,accessToken:Y,limit:ao,from:tt,to:nt,timeZone:ve,tzOffsetMinutes:re}),co=le==="week"||le==="month",$n=le==="week"||le==="month",uo=h.useMemo(()=>yt.filter(T=>T?.future?!1:!T?.day||!an?!0:String(T.day)<=String(an)),[yt,an]),{rows:ut,from:wd,to:Sd,loading:Td,refresh:fo}=im({baseUrl:e,accessToken:Y,guestAllowed:je,period:le,from:tt,to:nt,months:24,cacheKey:Ie,timeZone:Hs,tzOffsetMinutes:Qi,now:Re,sharedRows:co?yt:null,sharedRange:co?{from:tt,to:nt}:null}),{daily:Lt,heatmap:dt,loading:ho,refresh:mo}=nm({baseUrl:e,accessToken:Y,guestAllowed:je,weeks:52,cacheKey:Ie,timeZone:ve,tzOffsetMinutes:re,now:Re}),Ke=h.useMemo(()=>le==="day"?"hour":le==="total"?"month":"day",[le]),kd=h.useMemo(()=>Bo(Ke),[Ke]),Un="day",Cd=h.useMemo(()=>Bo(Un),[]),[He,po]=h.useState(()=>({key:"day",dir:"desc"}));h.useEffect(()=>{po(T=>!Fr.has(T.key)||T.key===Ke?T:{key:Ke,dir:T.dir})},[Ke]);const It=h.useMemo(()=>Fr.has(He.key)&&He.key!==Ke?{...He,key:Ke}:He,[Ke,He]),Wn=h.useMemo(()=>{if(le==="day")return Array.isArray(ut)?ut.filter(F=>F?.hour&&!F?.future):[];if(le==="total"){const F=Array.isArray(ut)?ut.filter(q=>q?.month&&!q?.future):[];return Cm(F)}const T=uo;return!T.some(F=>!F?.missing&&!F?.future)&&yt.length>0?yt.filter(F=>!F?.future).slice(-30).filter(F=>F?.day):T},[le,ut,uo,yt]),ln=h.useMemo(()=>$o(Wn,It),[Wn,It]),Ed=h.useMemo(()=>Wn.some(T=>!T?.missing&&!T?.future),[Wn]),Gs=h.useMemo(()=>{if(!mn.has(le))return 1;const T=Math.ceil(ln.length/vs);return T>0?T:1},[le,ln.length]),[Ys,Kn]=h.useState(0);h.useEffect(()=>{if(!mn.has(le)){Kn(0);return}Kn(T=>Math.min(T,Gs-1))},[Gs,le]),h.useEffect(()=>{mn.has(le)&&Kn(0)},[le,He.dir,He.key]);const Ad=h.useMemo(()=>mn.has(le)?Em(ln,Ys,vs):ln,[Ys,le,ln]),go=h.useMemo(()=>ro.filter(T=>!T?.future&&T?.day).slice(-30),[ro]),Ft=h.useMemo(()=>Fr.has(He.key)?{...He,key:Un}:He,[He]),Pd=h.useMemo(()=>$o(go,Ft),[go,Ft]),Rd=h.useMemo(()=>$n?yt:le==="day"?Array.isArray(ut)?ut.filter(T=>T?.hour):[]:ut,[yt,le,ut,$n]),Md=$n?tt:wd,Dd=$n?nt:Sd;function Nd(T,O){return T?.future?"—":T?.missing?P("shared.status.unsynced"):O==="total_tokens"?ht(is(T)):ht(T?.[O])}function jd(T){const O=T?.[Ke];if(O==null)return"";const F=String(O);if(Ke==="hour"){const[q,me]=F.split("T");if(q&&me)return`${q} ${me.slice(0,5)}`}return F}function Vd(T){const O=T?.[Un];return O==null?"":String(O)}function Ld(T){po(O=>O.key===T?{key:T,dir:O.dir==="asc"?"desc":"asc"}:{key:T,dir:"desc"})}function Id(T){return It.key!==T?"none":It.dir==="asc"?"ascending":"descending"}function Fd(T){return It.key!==T?"":It.dir==="asc"?"▲":"▼"}function _d(T){return Ft.key!==T?"none":Ft.dir==="asc"?"ascending":"descending"}function Od(T){return Ft.key!==T?"":Ft.dir==="asc"?"▲":"▼"}const yo=h.useMemo(()=>{if(!n&&!Z&&!i&&!Ve)return 0;const T=Number(dt?.active_days);if(Number.isFinite(T))return T;let O=0;const F=new Set,q=(ce,ge,Te)=>{typeof ce!="string"||!ce||F.has(ce)||_r(ge,Te)&&(F.add(ce),O+=1)};if(Array.isArray(Lt))for(const ce of Lt)q(ce?.day,is(ce));const me=Array.isArray(dt?.weeks)?dt.weeks:[];for(const ce of me)for(const ge of Array.isArray(ce)?ce:[]){const Te=Sl(ge);q(ge?.day,Te,ge?.level)}return O},[n,Z,dt?.active_days,dt?.weeks,Lt]),bo=h.useCallback(async()=>{await Promise.all([so(),mo(),fo(),oo(),lo(),io()])},[io,mo,oo,lo,fo,so]),Bd=h.useCallback(async()=>{J(!0);try{Ve&&await wh(),await bo()}catch(T){console.error("[DashboardPage] Refresh failed:",T)}finally{J(!1)}},[Ve,bo]),$d=L||pd||gd||ho||Td||yd||vd,Ud=h.useMemo(()=>P("shared.data_source",{source:String(no||"edge").toUpperCase()}),[no]),Wd=h.useMemo(()=>{if(!i||!We)return!1;if((typeof We=="object"&&We?We?.status??We?.statusCode:null)===401)return!0;const O=typeof We=="string"?We:String(We?.message||We||"");return/unauthorized|invalid|token|revoked|401/i.test(O)},[i,We]),Hn=h.useMemo(()=>typeof t?.name!="string"?"":t.name.trim(),[t?.name]),xo=h.useMemo(()=>typeof pe!="string"?"":pe.trim(),[pe]),vo=h.useMemo(()=>!Hn||Hn.includes("@")?P("dashboard.identity.fallback"):Hn,[Hn]),wo=h.useMemo(()=>vo.replace(/[^a-zA-Z0-9._-]/g,"_"),[vo]),Kd=h.useMemo(()=>i?xo||P("dashboard.identity.fallback"):wo,[wo,xo,i]),Hd=h.useMemo(()=>{let T=null;const O=q=>{typeof q!="string"||!q||(!T||q<T)&&(T=q)};if(Array.isArray(Lt))for(const q of Lt)q?.day&&_r(is(q))&&O(q.day);const F=Array.isArray(dt?.weeks)?dt.weeks:[];for(const q of F)for(const me of Array.isArray(q)?q:[]){if(!me?.day)continue;const ce=Sl(me),ge=me?.level;_r(ce,ge)&&O(me.day)}return T},[dt?.weeks,Lt]),Gd=h.useMemo(()=>i?[]:(Array.isArray(X?.subscriptions?.items)?X.subscriptions.items:[]).map(F=>{const q=typeof F?.tool=="string"?F.tool.trim():"",ce=(typeof F?.plan_type=="string"?F.plan_type:typeof F?.planType=="string"?F.planType:"").trim();return!q||!ce?null:{tool:q,planType:ce,provider:typeof F?.provider=="string"?F.provider.trim():"",product:typeof F?.product=="string"?F.product.trim():"",rateLimitTier:typeof F?.rate_limit_tier=="string"?F.rate_limit_tier.trim():typeof F?.rateLimitTier=="string"?F.rateLimitTier.trim():""}}).filter(Boolean).slice(0,6),[i,X]),Yd=g.jsx(Om,{heatmap:dt,timeZoneLabel:Bn,timeZoneShortLabel:on,hideLegend:ee,defaultToLatestMonth:ee}),zd=h.useMemo(()=>`${tt}..${nt}`,[tt,le,nt]),qd=P("usage.summary.total"),_t=is(Ue),So=P("shared.unit.thousand_abbrev"),To=P("shared.unit.million_abbrev"),ko=P("shared.unit.billion_abbrev"),Gn=Ze(_t),Co=H&&Gn!=null&&Math.abs(Gn)>=1e9,Xd=h.useMemo(()=>Co?Nl(Gn,{thousandSuffix:So,millionSuffix:To,billionSuffix:ko,decimals:1}):ht(_t),[ko,To,_t,Gn,So,Co]),Zd=P("dashboard.core_index.collapse_label"),Jd=P("dashboard.core_index.expand_label"),Qd=P("dashboard.core_index.collapse_aria"),ef=P("dashboard.core_index.expand_aria"),tf=!ee,nf=P("dashboard.screenshot.title_line1"),sf=P("dashboard.screenshot.title_line2"),rf=P("dashboard.screenshot.twitter_label"),of=P("dashboard.screenshot.twitter_button"),af=P("dashboard.screenshot.twitter_hint"),Ot=P("shared.placeholder.short"),zs=h.useMemo(()=>{const T=Array.isArray(Tt?.sources)?Tt.sources:[];let O=null,F=0;for(const ge of T){const Te=Ze(ge?.totals?.billable_total_tokens??ge?.totals?.total_tokens);!Number.isFinite(Te)||Te<=0||Te>F&&(F=Te,O=ge)}let q=Ot,me=Ot,ce="0.0";if(O&&F>0){q=O?.source?String(O.source).toUpperCase():Ot;const ge=Array.isArray(O?.models)?O.models:[];let Te=0;for(const ft of ge){const un=Ze(ft?.totals?.billable_total_tokens??ft?.totals?.total_tokens);!Number.isFinite(un)||un<=0||un>Te&&(Te=un,me=ft?.model?String(ft.model):Ot)}Te>0&&(ce=(Te/F*100).toFixed(1))}return{agentName:q,modelName:me,modelPercent:ce}},[Tt,Ot]),Eo=ht(_t),Ao=P("dashboard.screenshot.twitter_text",{total_tokens:Eo==="-"?Ot:Eo,agent_name:zs.agentName,model_name:zs.modelName,model_percent:zs.modelPercent}),qs=h.useMemo(()=>{if(typeof window>"u")return"";const T=new URL("https://twitter.com/intent/tweet");return T.searchParams.set("text",Ao),T.toString()},[Ao]),Po=h.useCallback(async()=>{if(typeof window>"u")return null;const T=async()=>{const ge=performance.now();for(;performance.now()-ge<2e3;){const Te=document.querySelector("[data-heatmap-scroll='true']");if(!Te||Te.dataset.latestMonthReady==="true")return;await new Promise(ft=>requestAnimationFrame(ft))}},O=document.querySelector("#root")||document.body,F=document.documentElement,{scrollWidth:q,scrollHeight:me}=document.documentElement;F?.classList.add("screenshot-capture"),document.body?.classList.add("screenshot-capture"),await new Promise(ce=>requestAnimationFrame(ce)),await T();try{const{toBlob:ce,toPng:ge}=await uh(async()=>{const{toBlob:kt,toPng:Uf}=await import("./index-BeoRn2gJ.js");return{toBlob:kt,toPng:Uf}},[]),Te=await ce(O,{backgroundColor:"#050505",pixelRatio:2,cacheBust:!0,width:q,height:me,style:{width:`${q}px`,height:`${me}px`},filter:kt=>!(kt instanceof HTMLElement)||kt.dataset?.screenshotExclude!=="true"});if(Te)return Te;const ft=await ge(O,{backgroundColor:"#050505",pixelRatio:2,cacheBust:!0,width:q,height:me,style:{width:`${q}px`,height:`${me}px`},filter:kt=>!(kt instanceof HTMLElement)||kt.dataset?.screenshotExclude!=="true"});return ft?await(await fetch(ft)).blob():null}finally{F?.classList.remove("screenshot-capture"),document.body?.classList.remove("screenshot-capture")}},[]),lf=h.useCallback(async()=>{if(typeof window>"u"||be)return;Ne(!0);const T=navigator?.userAgent||"",O=/iP(hone|od|ad)/i.test(T),F=/Safari/i.test(T)&&!/Chrome|Chromium|Edg|OPR|CriOS|FxiOS/i.test(T),q=typeof navigator<"u"&&!!navigator.clipboard?.write&&typeof window<"u"&&!!window.ClipboardItem;let ce=!q||O||F;try{const ge=await Po();ge&&q&&(typeof document<"u"&&!document.hasFocus()&&window.focus?.(),ce=await dh(ge))}catch(ge){console.error("Failed to capture screenshot",ge)}finally{if(Ne(!1),!ce){console.warn("Failed to write screenshot to clipboard.");return}qs&&(window.location.href=qs)}},[Po,be,qs]),cf=h.useMemo(()=>ee?[]:Gv,[ee]),uf=h.useMemo(()=>[{label:P("usage.metric.total"),value:ht(_t),valueClassName:"text-white"},{label:P("usage.metric.input"),value:ht(Ue?.input_tokens)},{label:P("usage.metric.output"),value:ht(Ue?.output_tokens)},{label:P("usage.metric.cached_input"),value:ht(Ue?.cached_input_tokens)},{label:P("usage.metric.reasoning_output"),value:ht(Ue?.reasoning_output_tokens)}],[Ue?.cached_input_tokens,Ue?.input_tokens,Ue?.output_tokens,Ue?.reasoning_output_tokens,_t]),Xs=h.useMemo(()=>{const T=Dl(Ue?.total_cost_usd);return!T||T==="-"||T.startsWith("$")?T:`$${T}`},[Ue?.total_cost_usd]),Ro=h.useMemo(()=>Rm(Tt,{copyFn:P}),[Tt]),df=h.useMemo(()=>Mm(Tt,{limit:3,copyFn:P}),[Tt]),ff=h.useCallback(()=>u(!0),[]),hf=h.useCallback(()=>u(!1),[]),mf=Xs&&Xs!=="-"&&Ro.length>0,cn=P("dashboard.install.cmd.init"),Zs=ct?null:d,Js=Zs?P("dashboard.install.cmd.init_link_code",{link_code:Zs}):cn,pf=cn,gf=P("dashboard.install.cmd.sync"),yf=Zs?P("dashboard.install.copy"):P("dashboard.install.copy_base"),bf=P("dashboard.install.copied");P("dashboard.session_expired.copy_label"),P("dashboard.session_expired.copied");const xf=!!(X?.install?.has_active_device_token??X?.install?.hasActiveDeviceToken),vf=Am({publicMode:i,screenshotMode:ee,forceInstall:de,accessEnabled:Ee,heatmapLoading:ho,activeDays:yo,hasActiveDeviceToken:xf}),wf=P("dashboard.install.prompt"),Sf=P("dashboard.public_view.title"),Tf=P("dashboard.public_view.status.enabled"),kf=P("dashboard.public_view.status.disabled"),Cf=P("dashboard.public_view.action.copy"),Ef=P("dashboard.public_view.action.copied"),Af=P("dashboard.public_view.action.enable"),Pf=P("dashboard.public_view.action.disable"),Rf=P("dashboard.public_view.invalid.title"),Mf=P("dashboard.public_view.invalid.body"),Df=M||V,Nf=N?Tf:kf,Mo=h.useMemo(()=>!I||typeof window>"u"?"":new URL(`/share/${I}`,window.location.origin).toString(),[I]),jf=j?Ef:Cf,Vf=N?Pf:Af,Lf=h.useCallback(async()=>{!Js||!await nr(Js)||(te(!0),window.setTimeout(()=>te(!1),2e3))},[Js]);h.useCallback(async()=>{!cn||!await nr(cn)||(xe(!0),window.setTimeout(()=>xe(!1),2e3))},[cn]);const If=h.useCallback(async()=>{if(V||!N)return;let T=Mo;if(!T){$(!0);try{const F=await ot(K);if(!F){$(!1);return}const q=await jo({baseUrl:e,accessToken:F}),me=typeof q?.share_token=="string"?q.share_token:null;A(me),me&&typeof window<"u"&&(T=new URL(`/share/${me}`,window.location.origin).toString())}catch{}finally{$(!1)}}!T||!await nr(T)||(W(!0),window.setTimeout(()=>W(!1),2e3))},[K,e,V,N,Mo]),Ff=h.useCallback(async()=>{if(!V){W(!1),$(!0);try{const T=await ot(K);if(!T){$(!1);return}const F=await Sh({baseUrl:e,accessToken:T,enabled:!N}),q=!!F?.enabled;C(q),A(F?.share_token||null)}catch{}finally{$(!1)}}},[K,e,V,N]),Qs=h.useMemo(()=>P("dashboard.daily.empty",{cmd:"{{cmd}}"}),[]),[_f,Of]=h.useMemo(()=>{const T=Qs.split("{{cmd}}");return T.length===1?[Qs,""]:[T[0],T.slice(1).join("{{cmd}}")]},[Qs]),Bf=s&&!i,$f=!n&&!Z&&!s&&!Ve&&!i;return g.jsx(Hv,{copy:P,screenshotMode:ee,publicViewInvalid:Wd,publicViewInvalidTitle:Rf,publicViewInvalidBody:Mf,showExpiredGate:Bf,showAuthGate:$f,screenshotTitleLine1:nf,screenshotTitleLine2:sf,identityDisplayName:Kd,identityStartDate:Hd,activeDays:yo,identitySubscriptions:Gd,identityScrambleDurationMs:Oe,projectUsageEntries:xd,projectUsageLimit:ao,setProjectUsageLimit:bd,topModels:df,signedIn:n,publicMode:i,shouldShowInstall:vf,installPrompt:wf,handleCopyInstall:Lf,installCopied:E,installCopiedLabel:bf,installCopyLabel:yf,installInitCmdDisplay:pf,linkCodeLoading:y,linkCodeError:x,publicViewTitle:Sf,handleTogglePublicView:Ff,publicViewBusy:Df,publicViewEnabled:N,publicViewToggleLabel:Vf,publicViewStatusLabel:Nf,publicViewCopyButtonLabel:jf,handleCopyPublicView:If,trendRowsForDisplay:Rd,trendFromForDisplay:Md,trendToForDisplay:Dd,period:le,trendTimeZoneLabel:eo,activityHeatmapBlock:Yd,isCapturing:be,handleShareToX:lf,screenshotTwitterLabel:rf,screenshotTwitterButton:of,screenshotTwitterHint:af,periodsForDisplay:cf,setSelectedPeriod:Ws,metricsRows:uf,summaryLabel:qd,summaryValue:Xd,summaryCostValue:Xs,rollingUsage:md,costInfoEnabled:mf,openCostModal:ff,allowBreakdownToggle:tf,coreIndexCollapsed:Qe,setCoreIndexCollapsed:et,coreIndexCollapseLabel:Zd,coreIndexExpandLabel:Jd,coreIndexCollapseAria:Qd,coreIndexExpandAria:ef,refreshAll:Bd,usageLoadingState:$d,usageError:We,rangeLabel:zd,timeZoneRangeLabel:Ks,usageSourceLabel:Ud,fleetData:Ro,hasDetailsActual:Ed,dailyEmptyPrefix:_f,installSyncCmd:gf,dailyEmptySuffix:Of,detailsColumns:kd,ariaSortFor:Id,toggleSort:Ld,sortIconFor:Fd,pagedDetails:Ad,dailyBreakdownRows:Pd,dailyBreakdownColumns:Cd,dailyBreakdownAriaSortFor:_d,dailyBreakdownSortIconFor:Od,dailyBreakdownDateKey:Un,detailsDateKey:Ke,renderDetailDate:jd,renderDailyBreakdownDate:Vd,renderDetailCell:Nd,DETAILS_PAGED_PERIODS:mn,detailsPageCount:Gs,detailsPage:Ys,setDetailsPage:Kn,costModalOpen:c,closeCostModal:hf})}export{nw as DashboardPage};
|