@tempoxyz/id 0.0.0-pr-187.sha-eed04d3

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.
Files changed (712) hide show
  1. package/README.md +81 -0
  2. package/dist/App.d.ts +20 -0
  3. package/dist/App.d.ts.map +1 -0
  4. package/dist/App.js +26 -0
  5. package/dist/App.js.map +1 -0
  6. package/dist/app/client/.assetsignore +2 -0
  7. package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
  8. package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
  9. package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
  10. package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
  11. package/dist/app/client/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
  12. package/dist/app/client/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
  13. package/dist/app/client/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
  14. package/dist/app/client/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
  15. package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
  16. package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
  17. package/dist/app/client/assets/ccip-Cq1mMiVl.js +1 -0
  18. package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
  19. package/dist/app/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  20. package/dist/app/client/assets/index-B7YJVP00.css +1 -0
  21. package/dist/app/client/assets/index-UXTxXCLk.js +55 -0
  22. package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
  23. package/dist/app/client/assets/reset-co-CHrff.css +1 -0
  24. package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
  25. package/dist/app/db/auth.d.ts +3207 -0
  26. package/dist/app/db/auth.d.ts.map +1 -0
  27. package/dist/app/db/auth.js +330 -0
  28. package/dist/app/db/auth.js.map +1 -0
  29. package/dist/app/db/schema.d.ts +932 -0
  30. package/dist/app/db/schema.d.ts.map +1 -0
  31. package/dist/app/db/schema.js +171 -0
  32. package/dist/app/db/schema.js.map +1 -0
  33. package/dist/app/server/.vite/manifest.json +489 -0
  34. package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
  35. package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
  36. package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
  37. package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
  38. package/dist/app/server/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
  39. package/dist/app/server/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
  40. package/dist/app/server/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
  41. package/dist/app/server/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
  42. package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
  43. package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
  44. package/dist/app/server/assets/_tanstack-start-manifest_v-DjQNeRZp.js +1 -0
  45. package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
  46. package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
  47. package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js +31 -0
  48. package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js.map +1 -0
  49. package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
  50. package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
  51. package/dist/app/server/assets/call-UQamaCKN.js +32 -0
  52. package/dist/app/server/assets/call-UQamaCKN.js.map +1 -0
  53. package/dist/app/server/assets/ccip-CbNKFO4n.js +2 -0
  54. package/dist/app/server/assets/ccip-CbNKFO4n.js.map +1 -0
  55. package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
  56. package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
  57. package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
  58. package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
  59. package/dist/app/server/assets/cookie-CS900nSP.css +1 -0
  60. package/dist/app/server/assets/cookie-Cce9CrIP.js +10 -0
  61. package/dist/app/server/assets/cookie-Cce9CrIP.js.map +1 -0
  62. package/dist/app/server/assets/core-B1HCXUmx.js +56 -0
  63. package/dist/app/server/assets/core-B1HCXUmx.js.map +1 -0
  64. package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
  65. package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
  66. package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js +2 -0
  67. package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js.map +1 -0
  68. package/dist/app/server/assets/dist-BxSwugSY.js +1 -0
  69. package/dist/app/server/assets/dist-CZGFhmQd.js +2 -0
  70. package/dist/app/server/assets/dist-CZGFhmQd.js.map +1 -0
  71. package/dist/app/server/assets/dist-Dg3PQqiW.js +15 -0
  72. package/dist/app/server/assets/dist-Dg3PQqiW.js.map +1 -0
  73. package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js +2 -0
  74. package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js.map +1 -0
  75. package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
  76. package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
  77. package/dist/app/server/assets/factory-ipHlJXZY.js +5 -0
  78. package/dist/app/server/assets/factory-ipHlJXZY.js.map +1 -0
  79. package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
  80. package/dist/app/server/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  81. package/dist/app/server/assets/get-id-field-B0x109VU.js +6 -0
  82. package/dist/app/server/assets/get-id-field-B0x109VU.js.map +1 -0
  83. package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js +2 -0
  84. package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js.map +1 -0
  85. package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js +2 -0
  86. package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js.map +1 -0
  87. package/dist/app/server/assets/kysely-adapter-MkHAI9Jk.js +1 -0
  88. package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
  89. package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
  90. package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
  91. package/dist/app/server/assets/reset-co-CHrff.css +1 -0
  92. package/dist/app/server/assets/rolldown-runtime-B0Z9INg1.js +1 -0
  93. package/dist/app/server/assets/router-CcbyBCI4.css +1 -0
  94. package/dist/app/server/assets/router-xjZtEeaI.js +7 -0
  95. package/dist/app/server/assets/router-xjZtEeaI.js.map +1 -0
  96. package/dist/app/server/assets/schema-check-Cf7QOZZD.js +9 -0
  97. package/dist/app/server/assets/schema-check-Cf7QOZZD.js.map +1 -0
  98. package/dist/app/server/assets/schemas-C2lCYmR5.js +2 -0
  99. package/dist/app/server/assets/schemas-C2lCYmR5.js.map +1 -0
  100. package/dist/app/server/assets/secp256k1-buM5g4AL.js +2 -0
  101. package/dist/app/server/assets/secp256k1-buM5g4AL.js.map +1 -0
  102. package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
  103. package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
  104. package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
  105. package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
  106. package/dist/app/server/assets/standard-json-Cg1N07hM.js +2 -0
  107. package/dist/app/server/assets/standard-json-Cg1N07hM.js.map +1 -0
  108. package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
  109. package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
  110. package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
  111. package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
  112. package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
  113. package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
  114. package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
  115. package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
  116. package/dist/app/server/assets/start-C63VetBp.js +2 -0
  117. package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
  118. package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js +2 -0
  119. package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js.map +1 -0
  120. package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
  121. package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
  122. package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
  123. package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
  124. package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js +2 -0
  125. package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js.map +1 -0
  126. package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js +2 -0
  127. package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js.map +1 -0
  128. package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
  129. package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js +2 -0
  130. package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js.map +1 -0
  131. package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js +2 -0
  132. package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js.map +1 -0
  133. package/dist/app/server/index.js +574 -0
  134. package/dist/app/server/index.js.map +1 -0
  135. package/dist/app/server/wrangler.json +1 -0
  136. package/dist/cli/Admin.d.ts +38 -0
  137. package/dist/cli/Admin.d.ts.map +1 -0
  138. package/dist/cli/Admin.js +62 -0
  139. package/dist/cli/Admin.js.map +1 -0
  140. package/dist/cli/Apps.d.ts +9 -0
  141. package/dist/cli/Apps.d.ts.map +1 -0
  142. package/dist/cli/Apps.js +36 -0
  143. package/dist/cli/Apps.js.map +1 -0
  144. package/dist/cli/Cli.d.ts +14 -0
  145. package/dist/cli/Cli.d.ts.map +1 -0
  146. package/dist/cli/Cli.js +27 -0
  147. package/dist/cli/Cli.js.map +1 -0
  148. package/dist/cli/Project.d.ts +20 -0
  149. package/dist/cli/Project.d.ts.map +1 -0
  150. package/dist/cli/Project.js +88 -0
  151. package/dist/cli/Project.js.map +1 -0
  152. package/dist/cli/Realms.d.ts +24 -0
  153. package/dist/cli/Realms.d.ts.map +1 -0
  154. package/dist/cli/Realms.js +49 -0
  155. package/dist/cli/Realms.js.map +1 -0
  156. package/dist/cli/Session.d.ts +85 -0
  157. package/dist/cli/Session.d.ts.map +1 -0
  158. package/dist/cli/Session.js +178 -0
  159. package/dist/cli/Session.js.map +1 -0
  160. package/dist/cli/User.d.ts +29 -0
  161. package/dist/cli/User.d.ts.map +1 -0
  162. package/dist/cli/User.js +39 -0
  163. package/dist/cli/User.js.map +1 -0
  164. package/dist/cli/V1.d.ts +35 -0
  165. package/dist/cli/V1.d.ts.map +1 -0
  166. package/dist/cli/V1.js +41 -0
  167. package/dist/cli/V1.js.map +1 -0
  168. package/dist/cli/bin.d.ts +3 -0
  169. package/dist/cli/bin.d.ts.map +1 -0
  170. package/dist/cli/bin.js +46 -0
  171. package/dist/cli/bin.js.map +1 -0
  172. package/dist/cli/commands/admin/apps/create.d.ts +23 -0
  173. package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
  174. package/dist/cli/commands/admin/apps/create.js +89 -0
  175. package/dist/cli/commands/admin/apps/create.js.map +1 -0
  176. package/dist/cli/commands/admin/apps/delete.d.ts +14 -0
  177. package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
  178. package/dist/cli/commands/admin/apps/delete.js +41 -0
  179. package/dist/cli/commands/admin/apps/delete.js.map +1 -0
  180. package/dist/cli/commands/admin/apps/index.d.ts +5 -0
  181. package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
  182. package/dist/cli/commands/admin/apps/index.js +14 -0
  183. package/dist/cli/commands/admin/apps/index.js.map +1 -0
  184. package/dist/cli/commands/admin/apps/list.d.ts +9 -0
  185. package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
  186. package/dist/cli/commands/admin/apps/list.js +26 -0
  187. package/dist/cli/commands/admin/apps/list.js.map +1 -0
  188. package/dist/cli/commands/admin/apps/rotate-secret.d.ts +16 -0
  189. package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
  190. package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
  191. package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
  192. package/dist/cli/commands/admin/apps/update.d.ts +20 -0
  193. package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
  194. package/dist/cli/commands/admin/apps/update.js +76 -0
  195. package/dist/cli/commands/admin/apps/update.js.map +1 -0
  196. package/dist/cli/commands/admin/index.d.ts +5 -0
  197. package/dist/cli/commands/admin/index.d.ts.map +1 -0
  198. package/dist/cli/commands/admin/index.js +13 -0
  199. package/dist/cli/commands/admin/index.js.map +1 -0
  200. package/dist/cli/commands/admin/migrate.d.ts +9 -0
  201. package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
  202. package/dist/cli/commands/admin/migrate.js +17 -0
  203. package/dist/cli/commands/admin/migrate.js.map +1 -0
  204. package/dist/cli/commands/admin/realms/add.d.ts +12 -0
  205. package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
  206. package/dist/cli/commands/admin/realms/add.js +42 -0
  207. package/dist/cli/commands/admin/realms/add.js.map +1 -0
  208. package/dist/cli/commands/admin/realms/index.d.ts +5 -0
  209. package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
  210. package/dist/cli/commands/admin/realms/index.js +13 -0
  211. package/dist/cli/commands/admin/realms/index.js.map +1 -0
  212. package/dist/cli/commands/admin/realms/list.d.ts +13 -0
  213. package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
  214. package/dist/cli/commands/admin/realms/list.js +36 -0
  215. package/dist/cli/commands/admin/realms/list.js.map +1 -0
  216. package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
  217. package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
  218. package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
  219. package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
  220. package/dist/cli/commands/admin/realms/passkeys/set.d.ts +16 -0
  221. package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
  222. package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
  223. package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
  224. package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
  225. package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
  226. package/dist/cli/commands/admin/realms/privy/index.js +13 -0
  227. package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
  228. package/dist/cli/commands/admin/realms/privy/set.d.ts +18 -0
  229. package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
  230. package/dist/cli/commands/admin/realms/privy/set.js +66 -0
  231. package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
  232. package/dist/cli/commands/admin/realms/remove.d.ts +11 -0
  233. package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
  234. package/dist/cli/commands/admin/realms/remove.js +35 -0
  235. package/dist/cli/commands/admin/realms/remove.js.map +1 -0
  236. package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +15 -0
  237. package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
  238. package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
  239. package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
  240. package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +15 -0
  241. package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
  242. package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
  243. package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
  244. package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
  245. package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
  246. package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
  247. package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
  248. package/dist/cli/commands/admin/realms/set.d.ts +16 -0
  249. package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
  250. package/dist/cli/commands/admin/realms/set.js +46 -0
  251. package/dist/cli/commands/admin/realms/set.js.map +1 -0
  252. package/dist/cli/commands/admin/rotate-key.d.ts +15 -0
  253. package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
  254. package/dist/cli/commands/admin/rotate-key.js +46 -0
  255. package/dist/cli/commands/admin/rotate-key.js.map +1 -0
  256. package/dist/cli/commands/init.d.ts +11 -0
  257. package/dist/cli/commands/init.d.ts.map +1 -0
  258. package/dist/cli/commands/init.js +34 -0
  259. package/dist/cli/commands/init.js.map +1 -0
  260. package/dist/cli/commands/login.d.ts +12 -0
  261. package/dist/cli/commands/login.d.ts.map +1 -0
  262. package/dist/cli/commands/login.js +29 -0
  263. package/dist/cli/commands/login.js.map +1 -0
  264. package/dist/cli/commands/logout.d.ts +8 -0
  265. package/dist/cli/commands/logout.d.ts.map +1 -0
  266. package/dist/cli/commands/logout.js +19 -0
  267. package/dist/cli/commands/logout.js.map +1 -0
  268. package/dist/cli/commands/whoami.d.ts +12 -0
  269. package/dist/cli/commands/whoami.d.ts.map +1 -0
  270. package/dist/cli/commands/whoami.js +24 -0
  271. package/dist/cli/commands/whoami.js.map +1 -0
  272. package/dist/client/Actions.d.ts +101 -0
  273. package/dist/client/Actions.d.ts.map +1 -0
  274. package/dist/client/Actions.js +90 -0
  275. package/dist/client/Actions.js.map +1 -0
  276. package/dist/client/Auth.d.ts +161 -0
  277. package/dist/client/Auth.d.ts.map +1 -0
  278. package/dist/client/Auth.js +113 -0
  279. package/dist/client/Auth.js.map +1 -0
  280. package/dist/client/Authorization.d.ts +29 -0
  281. package/dist/client/Authorization.d.ts.map +1 -0
  282. package/dist/client/Authorization.js +12 -0
  283. package/dist/client/Authorization.js.map +1 -0
  284. package/dist/client/Decorator.d.ts +170 -0
  285. package/dist/client/Decorator.d.ts.map +1 -0
  286. package/dist/client/Decorator.js +227 -0
  287. package/dist/client/Decorator.js.map +1 -0
  288. package/dist/client/Key.d.ts +85 -0
  289. package/dist/client/Key.d.ts.map +1 -0
  290. package/dist/client/Key.js +83 -0
  291. package/dist/client/Key.js.map +1 -0
  292. package/dist/client/Pending.d.ts +39 -0
  293. package/dist/client/Pending.d.ts.map +1 -0
  294. package/dist/client/Pending.js +12 -0
  295. package/dist/client/Pending.js.map +1 -0
  296. package/dist/client/Permissions.d.ts +34 -0
  297. package/dist/client/Permissions.d.ts.map +1 -0
  298. package/dist/client/Permissions.js +16 -0
  299. package/dist/client/Permissions.js.map +1 -0
  300. package/dist/client/Provider.d.ts +16 -0
  301. package/dist/client/Provider.d.ts.map +1 -0
  302. package/dist/client/Provider.js +12 -0
  303. package/dist/client/Provider.js.map +1 -0
  304. package/dist/client/Step.d.ts +21 -0
  305. package/dist/client/Step.d.ts.map +1 -0
  306. package/dist/client/Step.js +16 -0
  307. package/dist/client/Step.js.map +1 -0
  308. package/dist/client/Storage.d.ts +27 -0
  309. package/dist/client/Storage.d.ts.map +1 -0
  310. package/dist/client/Storage.js +16 -0
  311. package/dist/client/Storage.js.map +1 -0
  312. package/dist/client/TempoAccount.d.ts +40 -0
  313. package/dist/client/TempoAccount.d.ts.map +1 -0
  314. package/dist/client/TempoAccount.js +16 -0
  315. package/dist/client/TempoAccount.js.map +1 -0
  316. package/dist/client/Tokens.d.ts +25 -0
  317. package/dist/client/Tokens.d.ts.map +1 -0
  318. package/dist/client/Tokens.js +12 -0
  319. package/dist/client/Tokens.js.map +1 -0
  320. package/dist/client/User.d.ts +21 -0
  321. package/dist/client/User.d.ts.map +1 -0
  322. package/dist/client/User.js +12 -0
  323. package/dist/client/User.js.map +1 -0
  324. package/dist/client/actions/account.d.ts +25 -0
  325. package/dist/client/actions/account.d.ts.map +1 -0
  326. package/dist/client/actions/account.js +34 -0
  327. package/dist/client/actions/account.js.map +1 -0
  328. package/dist/client/actions/device.d.ts +53 -0
  329. package/dist/client/actions/device.d.ts.map +1 -0
  330. package/dist/client/actions/device.js +79 -0
  331. package/dist/client/actions/device.js.map +1 -0
  332. package/dist/client/actions/email.d.ts +84 -0
  333. package/dist/client/actions/email.d.ts.map +1 -0
  334. package/dist/client/actions/email.js +63 -0
  335. package/dist/client/actions/email.js.map +1 -0
  336. package/dist/client/actions/oauth.d.ts +115 -0
  337. package/dist/client/actions/oauth.d.ts.map +1 -0
  338. package/dist/client/actions/oauth.js +105 -0
  339. package/dist/client/actions/oauth.js.map +1 -0
  340. package/dist/client/actions/passkey.d.ts +88 -0
  341. package/dist/client/actions/passkey.d.ts.map +1 -0
  342. package/dist/client/actions/passkey.js +60 -0
  343. package/dist/client/actions/passkey.js.map +1 -0
  344. package/dist/client/actions/provider.d.ts +49 -0
  345. package/dist/client/actions/provider.d.ts.map +1 -0
  346. package/dist/client/actions/provider.js +34 -0
  347. package/dist/client/actions/provider.js.map +1 -0
  348. package/dist/client/actions/realm.d.ts +24 -0
  349. package/dist/client/actions/realm.d.ts.map +1 -0
  350. package/dist/client/actions/realm.js +15 -0
  351. package/dist/client/actions/realm.js.map +1 -0
  352. package/dist/client/actions/redirect.d.ts +153 -0
  353. package/dist/client/actions/redirect.d.ts.map +1 -0
  354. package/dist/client/actions/redirect.js +236 -0
  355. package/dist/client/actions/redirect.js.map +1 -0
  356. package/dist/client/internal/accessKey.d.ts +21 -0
  357. package/dist/client/internal/accessKey.d.ts.map +1 -0
  358. package/dist/client/internal/accessKey.js +38 -0
  359. package/dist/client/internal/accessKey.js.map +1 -0
  360. package/dist/client/internal/account.d.ts +14 -0
  361. package/dist/client/internal/account.d.ts.map +1 -0
  362. package/dist/client/internal/account.js +3 -0
  363. package/dist/client/internal/account.js.map +1 -0
  364. package/dist/client/internal/api.d.ts +106 -0
  365. package/dist/client/internal/api.d.ts.map +1 -0
  366. package/dist/client/internal/api.js +129 -0
  367. package/dist/client/internal/api.js.map +1 -0
  368. package/dist/client/internal/headless.d.ts +33 -0
  369. package/dist/client/internal/headless.d.ts.map +1 -0
  370. package/dist/client/internal/headless.js +46 -0
  371. package/dist/client/internal/headless.js.map +1 -0
  372. package/dist/client/internal/indexedDb.d.ts +9 -0
  373. package/dist/client/internal/indexedDb.d.ts.map +1 -0
  374. package/dist/client/internal/indexedDb.js +32 -0
  375. package/dist/client/internal/indexedDb.js.map +1 -0
  376. package/dist/client/internal/request.d.ts +58 -0
  377. package/dist/client/internal/request.d.ts.map +1 -0
  378. package/dist/client/internal/request.js +45 -0
  379. package/dist/client/internal/request.js.map +1 -0
  380. package/dist/client/internal/store.d.ts +12 -0
  381. package/dist/client/internal/store.d.ts.map +1 -0
  382. package/dist/client/internal/store.js +15 -0
  383. package/dist/client/internal/store.js.map +1 -0
  384. package/dist/client.d.ts +20 -0
  385. package/dist/client.d.ts.map +1 -0
  386. package/dist/client.js +20 -0
  387. package/dist/client.js.map +1 -0
  388. package/dist/index.d.ts +7 -0
  389. package/dist/index.d.ts.map +1 -0
  390. package/dist/index.js +7 -0
  391. package/dist/index.js.map +1 -0
  392. package/dist/internal/Apps.d.ts +3051 -0
  393. package/dist/internal/Apps.d.ts.map +1 -0
  394. package/dist/internal/Apps.js +472 -0
  395. package/dist/internal/Apps.js.map +1 -0
  396. package/dist/internal/Auth.d.ts +4058 -0
  397. package/dist/internal/Auth.d.ts.map +1 -0
  398. package/dist/internal/Auth.js +137 -0
  399. package/dist/internal/Auth.js.map +1 -0
  400. package/dist/internal/Authorize.d.ts +532 -0
  401. package/dist/internal/Authorize.d.ts.map +1 -0
  402. package/dist/internal/Authorize.js +326 -0
  403. package/dist/internal/Authorize.js.map +1 -0
  404. package/dist/internal/Device.d.ts +371 -0
  405. package/dist/internal/Device.d.ts.map +1 -0
  406. package/dist/internal/Device.js +271 -0
  407. package/dist/internal/Device.js.map +1 -0
  408. package/dist/internal/Env.d.ts +57 -0
  409. package/dist/internal/Env.d.ts.map +1 -0
  410. package/dist/internal/Env.js +2 -0
  411. package/dist/internal/Env.js.map +1 -0
  412. package/dist/internal/ErrorResponse.d.ts +609 -0
  413. package/dist/internal/ErrorResponse.d.ts.map +1 -0
  414. package/dist/internal/ErrorResponse.js +679 -0
  415. package/dist/internal/ErrorResponse.js.map +1 -0
  416. package/dist/internal/Id.d.ts +10 -0
  417. package/dist/internal/Id.d.ts.map +1 -0
  418. package/dist/internal/Id.js +34 -0
  419. package/dist/internal/Id.js.map +1 -0
  420. package/dist/internal/KeyAuthorization.d.ts +1456 -0
  421. package/dist/internal/KeyAuthorization.d.ts.map +1 -0
  422. package/dist/internal/KeyAuthorization.js +1030 -0
  423. package/dist/internal/KeyAuthorization.js.map +1 -0
  424. package/dist/internal/Limits.d.ts +65 -0
  425. package/dist/internal/Limits.d.ts.map +1 -0
  426. package/dist/internal/Limits.js +35 -0
  427. package/dist/internal/Limits.js.map +1 -0
  428. package/dist/internal/Log.d.ts +49 -0
  429. package/dist/internal/Log.d.ts.map +1 -0
  430. package/dist/internal/Log.js +101 -0
  431. package/dist/internal/Log.js.map +1 -0
  432. package/dist/internal/LogLine.d.ts +33 -0
  433. package/dist/internal/LogLine.d.ts.map +1 -0
  434. package/dist/internal/LogLine.js +56 -0
  435. package/dist/internal/LogLine.js.map +1 -0
  436. package/dist/internal/Migrations.d.ts +19 -0
  437. package/dist/internal/Migrations.d.ts.map +1 -0
  438. package/dist/internal/Migrations.js +57 -0
  439. package/dist/internal/Migrations.js.map +1 -0
  440. package/dist/internal/Owner.d.ts +146 -0
  441. package/dist/internal/Owner.d.ts.map +1 -0
  442. package/dist/internal/Owner.js +65 -0
  443. package/dist/internal/Owner.js.map +1 -0
  444. package/dist/internal/Passkey.d.ts +528 -0
  445. package/dist/internal/Passkey.d.ts.map +1 -0
  446. package/dist/internal/Passkey.js +658 -0
  447. package/dist/internal/Passkey.js.map +1 -0
  448. package/dist/internal/PendingKey.d.ts +49 -0
  449. package/dist/internal/PendingKey.d.ts.map +1 -0
  450. package/dist/internal/PendingKey.js +58 -0
  451. package/dist/internal/PendingKey.js.map +1 -0
  452. package/dist/internal/Privy.d.ts +105 -0
  453. package/dist/internal/Privy.d.ts.map +1 -0
  454. package/dist/internal/Privy.js +224 -0
  455. package/dist/internal/Privy.js.map +1 -0
  456. package/dist/internal/RateLimit.d.ts +190 -0
  457. package/dist/internal/RateLimit.d.ts.map +1 -0
  458. package/dist/internal/RateLimit.js +148 -0
  459. package/dist/internal/RateLimit.js.map +1 -0
  460. package/dist/internal/Realm.d.ts +281 -0
  461. package/dist/internal/Realm.d.ts.map +1 -0
  462. package/dist/internal/Realm.js +477 -0
  463. package/dist/internal/Realm.js.map +1 -0
  464. package/dist/internal/RequestId.d.ts +16 -0
  465. package/dist/internal/RequestId.d.ts.map +1 -0
  466. package/dist/internal/RequestId.js +78 -0
  467. package/dist/internal/RequestId.js.map +1 -0
  468. package/dist/internal/SigningKey.d.ts +115 -0
  469. package/dist/internal/SigningKey.d.ts.map +1 -0
  470. package/dist/internal/SigningKey.js +197 -0
  471. package/dist/internal/SigningKey.js.map +1 -0
  472. package/dist/internal/TestInbox.d.ts +42 -0
  473. package/dist/internal/TestInbox.d.ts.map +1 -0
  474. package/dist/internal/TestInbox.js +20 -0
  475. package/dist/internal/TestInbox.js.map +1 -0
  476. package/dist/internal/Timing.d.ts +51 -0
  477. package/dist/internal/Timing.d.ts.map +1 -0
  478. package/dist/internal/Timing.js +103 -0
  479. package/dist/internal/Timing.js.map +1 -0
  480. package/dist/internal/Validation.d.ts +52 -0
  481. package/dist/internal/Validation.d.ts.map +1 -0
  482. package/dist/internal/Validation.js +22 -0
  483. package/dist/internal/Validation.js.map +1 -0
  484. package/dist/internal/Wallet.d.ts +37 -0
  485. package/dist/internal/Wallet.d.ts.map +1 -0
  486. package/dist/internal/Wallet.js +43 -0
  487. package/dist/internal/Wallet.js.map +1 -0
  488. package/dist/worker.d.ts +12 -0
  489. package/dist/worker.d.ts.map +1 -0
  490. package/dist/worker.js +12 -0
  491. package/dist/worker.js.map +1 -0
  492. package/package.json +82 -0
  493. package/src/Api.ts +151 -0
  494. package/src/App.ts +56 -0
  495. package/src/api/account.ts +311 -0
  496. package/src/api/authenticate.ts +1290 -0
  497. package/src/api/authorize.ts +1030 -0
  498. package/src/api/device.ts +874 -0
  499. package/src/api/health.ts +72 -0
  500. package/src/api/lib/AccountStep.ts +335 -0
  501. package/src/api/lib/Auth.ts +134 -0
  502. package/src/api/lib/Consent.ts +339 -0
  503. package/src/api/lib/Cors.ts +107 -0
  504. package/src/api/lib/Database.ts +10 -0
  505. package/src/api/lib/DeviceRequest.ts +265 -0
  506. package/src/api/lib/FirstAccount.ts +90 -0
  507. package/src/api/lib/KeySigner.ts +393 -0
  508. package/src/api/lib/PasskeyLink.ts +162 -0
  509. package/src/api/lib/Session.ts +34 -0
  510. package/src/api/lib/SignInConsent.ts +316 -0
  511. package/src/api/oauth.ts +1282 -0
  512. package/src/api/provider.ts +441 -0
  513. package/src/app/components/Button.tsx +128 -0
  514. package/src/app/components/CodeInput.tsx +186 -0
  515. package/src/app/components/ErrorMessage.tsx +66 -0
  516. package/src/app/components/Grant.tsx +323 -0
  517. package/src/app/components/Input.tsx +48 -0
  518. package/src/app/components/Tooltip.tsx +45 -0
  519. package/src/app/components/icons/BRLA.png +0 -0
  520. package/src/app/components/icons/BRZ.svg +1 -0
  521. package/src/app/components/icons/CHFAU.png +0 -0
  522. package/src/app/components/icons/DLUSD.png +0 -0
  523. package/src/app/components/icons/EURAU.svg +1 -0
  524. package/src/app/components/icons/EURC.e.svg +1 -0
  525. package/src/app/components/icons/GBPA.svg +4 -0
  526. package/src/app/components/icons/GUSD.svg +1 -0
  527. package/src/app/components/icons/MACH.svg +4 -0
  528. package/src/app/components/icons/OUSD.svg +5 -0
  529. package/src/app/components/icons/PRIME.svg +14 -0
  530. package/src/app/components/icons/SBC.svg +1 -0
  531. package/src/app/components/icons/SEKAU.svg +5 -0
  532. package/src/app/components/icons/USD1.svg +30 -0
  533. package/src/app/components/icons/USDB.svg +11 -0
  534. package/src/app/components/icons/USDC.e.svg +1 -0
  535. package/src/app/components/icons/USDT0.svg +1 -0
  536. package/src/app/components/icons/USDY.svg +16 -0
  537. package/src/app/components/icons/USDe.svg +1 -0
  538. package/src/app/components/icons/YLDS.svg +3 -0
  539. package/src/app/components/icons/alphaUSD.svg +1 -0
  540. package/src/app/components/icons/betaUSD.svg +1 -0
  541. package/src/app/components/icons/cUSD.svg +1 -0
  542. package/src/app/components/icons/cbBTC.svg +1 -0
  543. package/src/app/components/icons/frxUSD.svg +1 -0
  544. package/src/app/components/icons/goUSD.svg +5 -0
  545. package/src/app/components/icons/iUSD.svg +1 -0
  546. package/src/app/components/icons/pathUSD.svg +25 -0
  547. package/src/app/components/icons/rUSD.svg +1 -0
  548. package/src/app/components/icons/reUSD.svg +1 -0
  549. package/src/app/components/icons/sUSDe.svg +1 -0
  550. package/src/app/components/icons/siUSD.svg +1 -0
  551. package/src/app/components/icons/stcUSD.svg +1 -0
  552. package/src/app/components/icons/syrupUSDC.svg +5 -0
  553. package/src/app/components/icons/thetaUSD.svg +1 -0
  554. package/src/app/components/icons/wYLDS.svg +10 -0
  555. package/src/app/components/icons/wsrUSD.svg +1 -0
  556. package/src/app/components/logos/OUSD.dark.svg +17 -0
  557. package/src/app/components/logos/OUSD.light.svg +17 -0
  558. package/src/app/crons/cleanup.ts +42 -0
  559. package/src/app/db/auth.ts +416 -0
  560. package/src/app/db/migrations/0000_better_auth.sql +53 -0
  561. package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
  562. package/src/app/db/migrations/0002_device_code.sql +17 -0
  563. package/src/app/db/migrations/0003_realms.sql +27 -0
  564. package/src/app/db/migrations/0004_default_realm.sql +2 -0
  565. package/src/app/db/migrations/0005_passkeys.sql +30 -0
  566. package/src/app/db/migrations/0006_first_accounts.sql +9 -0
  567. package/src/app/db/migrations/0007_pending_keys.sql +13 -0
  568. package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
  569. package/src/app/db/migrations/0009_device_requests.sql +8 -0
  570. package/src/app/db/migrations/0010_device_keys.sql +4 -0
  571. package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
  572. package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
  573. package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
  574. package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
  575. package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
  576. package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
  577. package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
  578. package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
  579. package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
  580. package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
  581. package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
  582. package/src/app/db/migrations/meta/_journal.json +83 -0
  583. package/src/app/db/schema.ts +218 -0
  584. package/src/app/env.ts +49 -0
  585. package/src/app/lib/Client.ts +82 -0
  586. package/src/app/lib/Loader.ts +24 -0
  587. package/src/app/package.json +8 -0
  588. package/src/app/routeTree.gen.ts +198 -0
  589. package/src/app/router.tsx +48 -0
  590. package/src/app/routes/[_].flows.tsx +3001 -0
  591. package/src/app/routes/__root.tsx +91 -0
  592. package/src/app/routes/authorize.tsx +197 -0
  593. package/src/app/routes/choose-account.tsx +111 -0
  594. package/src/app/routes/deposit.tsx +105 -0
  595. package/src/app/routes/device.tsx +227 -0
  596. package/src/app/routes/index.tsx +115 -0
  597. package/src/app/routes/login.tsx +506 -0
  598. package/src/app/screens/Account.tsx +347 -0
  599. package/src/app/screens/Approval.tsx +276 -0
  600. package/src/app/screens/ChooseAccount.tsx +240 -0
  601. package/src/app/screens/Deposit.tsx +762 -0
  602. package/src/app/screens/DeviceApproval.tsx +480 -0
  603. package/src/app/screens/SignIn.tsx +362 -0
  604. package/src/app/screens/chains/base.svg +3 -0
  605. package/src/app/screens/chains/ethereum.svg +11 -0
  606. package/src/app/screens/chains/solana.svg +4 -0
  607. package/src/app/screens/chains/tempo.svg +4 -0
  608. package/src/app/server.ts +204 -0
  609. package/src/app/vite.config.ts +95 -0
  610. package/src/app/void.config.ts +29 -0
  611. package/src/app/zyzz.config.ts +274 -0
  612. package/src/cli/Admin.ts +73 -0
  613. package/src/cli/Apps.ts +29 -0
  614. package/src/cli/Cli.ts +42 -0
  615. package/src/cli/Project.ts +117 -0
  616. package/src/cli/Realms.ts +50 -0
  617. package/src/cli/Session.ts +239 -0
  618. package/src/cli/User.ts +45 -0
  619. package/src/cli/V1.ts +57 -0
  620. package/src/cli/bin.ts +44 -0
  621. package/src/cli/commands/admin/apps/create.ts +101 -0
  622. package/src/cli/commands/admin/apps/delete.ts +38 -0
  623. package/src/cli/commands/admin/apps/index.ts +15 -0
  624. package/src/cli/commands/admin/apps/list.ts +25 -0
  625. package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
  626. package/src/cli/commands/admin/apps/update.ts +86 -0
  627. package/src/cli/commands/admin/index.ts +14 -0
  628. package/src/cli/commands/admin/migrate.ts +16 -0
  629. package/src/cli/commands/admin/realms/add.ts +40 -0
  630. package/src/cli/commands/admin/realms/index.ts +14 -0
  631. package/src/cli/commands/admin/realms/list.ts +38 -0
  632. package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
  633. package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
  634. package/src/cli/commands/admin/realms/privy/index.ts +14 -0
  635. package/src/cli/commands/admin/realms/privy/set.ts +69 -0
  636. package/src/cli/commands/admin/realms/remove.ts +33 -0
  637. package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
  638. package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
  639. package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
  640. package/src/cli/commands/admin/realms/set.ts +46 -0
  641. package/src/cli/commands/admin/rotate-key.ts +47 -0
  642. package/src/cli/commands/init.ts +42 -0
  643. package/src/cli/commands/login.ts +32 -0
  644. package/src/cli/commands/logout.ts +19 -0
  645. package/src/cli/commands/whoami.ts +23 -0
  646. package/src/client/Actions.ts +168 -0
  647. package/src/client/Auth.ts +285 -0
  648. package/src/client/Authorization.ts +34 -0
  649. package/src/client/Decorator.ts +410 -0
  650. package/src/client/Key.ts +140 -0
  651. package/src/client/Pending.ts +46 -0
  652. package/src/client/Permissions.ts +39 -0
  653. package/src/client/Provider.ts +18 -0
  654. package/src/client/Step.ts +24 -0
  655. package/src/client/Storage.ts +29 -0
  656. package/src/client/TempoAccount.ts +42 -0
  657. package/src/client/Tokens.ts +27 -0
  658. package/src/client/User.ts +23 -0
  659. package/src/client/actions/account.ts +57 -0
  660. package/src/client/actions/device.ts +151 -0
  661. package/src/client/actions/email.ts +141 -0
  662. package/src/client/actions/oauth.ts +182 -0
  663. package/src/client/actions/passkey.ts +141 -0
  664. package/src/client/actions/provider.ts +70 -0
  665. package/src/client/actions/realm.ts +36 -0
  666. package/src/client/actions/redirect.ts +408 -0
  667. package/src/client/internal/accessKey.ts +54 -0
  668. package/src/client/internal/account.ts +15 -0
  669. package/src/client/internal/api.ts +224 -0
  670. package/src/client/internal/headless.ts +77 -0
  671. package/src/client/internal/indexedDb.ts +44 -0
  672. package/src/client/internal/request.ts +71 -0
  673. package/src/client/internal/store.ts +20 -0
  674. package/src/client.ts +19 -0
  675. package/src/index.ts +6 -0
  676. package/src/internal/Apps.ts +718 -0
  677. package/src/internal/Auth.ts +203 -0
  678. package/src/internal/Authorize.ts +424 -0
  679. package/src/internal/Balance.ts +168 -0
  680. package/src/internal/BodyLimit.ts +36 -0
  681. package/src/internal/Chain.ts +16 -0
  682. package/src/internal/Device.ts +469 -0
  683. package/src/internal/Env.ts +58 -0
  684. package/src/internal/ErrorResponse.ts +854 -0
  685. package/src/internal/Id.ts +41 -0
  686. package/src/internal/KeyAuthorization.ts +1339 -0
  687. package/src/internal/Limits.ts +39 -0
  688. package/src/internal/Log.ts +178 -0
  689. package/src/internal/LogLine.ts +87 -0
  690. package/src/internal/Logout.ts +336 -0
  691. package/src/internal/Migrations.ts +86 -0
  692. package/src/internal/OpenApi.ts +300 -0
  693. package/src/internal/Owner.ts +211 -0
  694. package/src/internal/Passkey.ts +1052 -0
  695. package/src/internal/PendingKey.ts +104 -0
  696. package/src/internal/Privy.ts +402 -0
  697. package/src/internal/Provider.ts +125 -0
  698. package/src/internal/RateLimit.ts +259 -0
  699. package/src/internal/Realm.ts +768 -0
  700. package/src/internal/RequestId.ts +118 -0
  701. package/src/internal/SignInGrant.ts +168 -0
  702. package/src/internal/SigningKey.ts +286 -0
  703. package/src/internal/TempoAccount.ts +342 -0
  704. package/src/internal/TestInbox.ts +51 -0
  705. package/src/internal/Timing.ts +158 -0
  706. package/src/internal/Validation.ts +52 -0
  707. package/src/internal/Wallet.ts +62 -0
  708. package/src/internal/owners/Passkey.ts +72 -0
  709. package/src/internal/owners/Privy.ts +81 -0
  710. package/src/internal/owners/Secp256k1.ts +143 -0
  711. package/src/types/app.d.ts +19 -0
  712. package/src/worker.ts +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-xjZtEeaI.js","names":["redirect","hasOwn","deepEqual","replaceEqualDeep","deepEqual","functionalUpdate","Route","deepEqual","Fragment","deepEqual","Fragment","getStartContext","getGlobalStartContext","context","contextAfterGlobalMiddlewares","Error","isServer","noop","noop","getDefaultState","noop","noop","MutationObserver","noop","MutationObserver","noop","serialize","getGlobalStartContext","DetailedError","hc","createContext","useContext","fetcher","fetch","origin","Context","Client","undefined","create","App","message","error","data","detail","error_description","reason","use","client","Error","createContext","create","message","useContext","create","Scheme.classes","create","from","Html.from","create","Props.create","overrides","Html.from","create","Scheme.classes","Html.from","__zyzzAppearance.root","__zyzzAppearance.create","__zyzzSelection.create","Route","reset","useState","Client.create","Client.Context","router_redirect","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","styles","_Fragment","Spinner","__zyzzRecipe.create","ForwardRef","forwardRef","styles","_Fragment","Alert","__zyzzRecipe.create","noop","_formatErrorMessage","EMPTY","platform","platform.os.android","platform.env.jsdom","getComputedStyle","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","ARROW_DOWN","TransitionStatusDataAttributes.startingStyle","TransitionStatusDataAttributes.endingStyle","popupOpen","pressed","CommonTriggerDataAttributes.popupOpen","CommonTriggerDataAttributes.pressed","CommonPopupDataAttributes.open","CommonPopupDataAttributes.closed","CommonPopupDataAttributes.anchorHidden","popupOpen","CommonTriggerDataAttributes.popupOpen","TooltipTriggerDataAttributes.triggerDisabled","platform.env.jsdom","REASONS.none","React","platform.screenReader.voiceOver","platform.engine.webkit","clamp","getComputedStyle","getComputedStyle","useId","useId","ownerWindow","REASONS.focusOut","platform.engine.webkit","REASONS.triggerPress","outsidePress","REASONS.triggerPress","escapeKey","REASONS.escapeKey","platform.engine.webkit","getComputedStyle","REASONS.outsidePress","TransitionStatusDataAttributes.startingStyle","useId","REASONS.triggerHover","REASONS.none","useSyncExternalStore","useSyncExternalStoreWithSelector","selectors","useSyncExternalStore","useId","platform.os.mac","platform.engine.webkit","REASONS.triggerFocus","isClickLikeOpenEvent","isClickLikeOpenEventShared","REASONS.triggerHover","isInsideEnabledTrigger","isClickLikeOpenEvent","isClickLikeOpenEventShared","REASONS.triggerHover","isInsideEnabledTrigger","platform.engine.webkit","ARROW_LEFT","ARROW_RIGHT","ARROW_DOWN","ARROW_UP","REASONS.listNavigation","REASONS.focusOut","computePosition","flip","offset","shift","clamp","limitShift","size","getScale","offset","offset$1","shift","shift$1","flip","flip$1","size","size$1","limitShift","limitShift$1","useLayoutEffect","selectors","REASONS.triggerPress","disabled","REASONS.disabled","REASONS.imperativeAction","useId","_formatErrorMessage","REASONS.triggerHover","TooltipTriggerDataAttributes.triggerDisabled","_formatErrorMessage","_formatErrorMessage","usePosition","clamp","transformOrigin","CommonPositionerCssVars.availableWidth","CommonPositionerCssVars.availableHeight","shift","floatingShift","ownerWindow","anchorWidth","anchorHeight","CommonPositionerCssVars.anchorWidth","CommonPositionerCssVars.anchorHeight","CommonPositionerCssVars.transformOrigin","Base.Root","Base.Trigger","Base.Portal","Base.Positioner","Base.Popup","styles","styles","format","Fingerprint","Cloud","LogOut","ArrowDownToLine","__zyzzRecipe.create","Route","Page","Client.create","Client.reason","Client.message","Client.use","styles","Authentication.deserializeOptions","Authentication.sign","Authentication.serializeResponse","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","__import_glob__0_0_","__import_glob__0_1_","__import_glob__0_2_","__import_glob__0_3_","__import_glob__0_4_","__import_glob__0_5_","__import_glob__0_6_","__import_glob__0_7_","__import_glob__0_8_","__import_glob__0_9_","__import_glob__0_10_","__import_glob__0_11_","__import_glob__0_12_","__import_glob__0_13_","__import_glob__0_14_","__import_glob__0_15_","__import_glob__0_16_","__import_glob__0_17_","__import_glob__0_18_","__import_glob__0_19_","__import_glob__0_20_","__import_glob__0_21_","__import_glob__0_22_","__import_glob__0_23_","__import_glob__0_24_","__import_glob__0_25_","__import_glob__0_26_","__import_glob__0_27_","__import_glob__0_28_","__import_glob__0_29_","__import_glob__0_30_","__import_glob__0_31_","__import_glob__0_32_","__import_glob__0_33_","__import_glob__0_34_","__import_glob__0_35_","__import_glob__0_36_","__import_glob__1_0_","__import_glob__1_1_","useId","styles","format","Info","styles","Globe","BadgeCheck","refusals","CeremonyError","Route","Page","Client.create","Client.reason","Client.use","Authentication.sign","styles","message","Client.message","names","ForwardRef","forwardRef","styles","Fingerprint","Cloud","Spinner","ChevronRight","Route","Page","Client.create","Client.reason","Client.message","Client.use","styles","_formatErrorMessage","FieldControlDataAttributes.valid","FieldControlDataAttributes.invalid","_formatErrorMessage","arrayItems","platform.os.ios","REASONS.imperativeAction","REASONS.none","ownerWindow","platform.env.jsdom","_formatErrorMessage","ownerWindow","CommonTriggerDataAttributes.popupOpen","CommonTriggerDataAttributes.pressed","stateAttributesMapping","SelectTriggerDataAttributes.popupSide","REASONS.none","REASONS.cancelOpen","stateAttributesMapping","_formatErrorMessage","ownerWindow","platform.engine.webkit","platform.os.ios","REASONS.none","_formatErrorMessage","ownerWindow","SelectPositionerCssVars.transformOrigin","platform.engine.webkit","REASONS.windowResize","floatingPlatform","_formatErrorMessage","REASONS.itemPress","_jsxs","_jsx","QrCode.create","_Fragment","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","tempo","base","ethereum","solana","usdc","usdt","pathUsd","styles","ArrowLeft","_Fragment","Apple","ChevronRight","useState","Check","Copy","Select.Root","Select.Label","Select.Trigger","Select.Value","Select.Icon","ChevronDown","Select.Portal","Select.Positioner","Select.Popup","Select.List","Select.Item","Select.ItemText","Select.ItemIndicator","__zyzzRecipe.create","Route","Page","Client.create","Client.reason","Client.message","styles","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","ForwardRef","forwardRef","useState","useRef","styles","Fragment","useId","_Fragment","styles","TriangleAlert","BadgeCheck","Check","LaptopMinimal","MapPin","Clock","Network","CeremonyError","Route","Page","Client.create","Client.message","Client.use","useState","Client.reason","Authentication.sign","message","styles","names","forwardRef","styles","__zyzzRecipe.create","useId","styles","BadgeCheck","Google","Fingerprint","Route","Page","Client.create","Client.use","useState","useRef","Authentication.sign","styles","reason","Client.reason","Client.message","ChevronRight","__zyzzRecipe.create","IndexRouteImport","rootRouteImport","AuthorizeRouteImport","ChooseAccountRouteImport","DepositRouteImport","DeviceRouteImport","LoginRouteImport","Char91_Char93FlowsRouteImport","__toESM","require_with_selector","trimPathRight","createNonReactiveReadonlyStore","cleanPath","getUrlScheme","require_react","redirect$1","require_react_dom","getStartContext","hasOwn$1","deepEqual$1","escapeHtml","removeTrailingSlash","functionalUpdate$1","isDangerousProtocol","createNonReactiveMutableStore","invariant","rootRouteId","Outlet","_getAssetMatches","useHydrated","appendUniqueUserTags","getAssetCrossOrigin","require_shim","getScriptPreloadAttrs","resolveManifestCssLink","schema","trimPathLeft","deserializeOptions","serialize$1","matchContext","useRouter","require_jsx_runtime","dummyMatchContext","serializeResponse","RouterCore","sign$1","getSsrBodyScriptParts","assetMatches","matches","routeScripts","manifestScripts","match","script","attrs","routeScriptAttrs","manifest","asset","composeSsrBodyScripts","initialHydrationScripts","BaseRoute","originalIndex","options","isRoot","path","customId","id","fullPath","children","lazyFn","opts","BaseRootRoute","retainSearchParams","resultSearch","next","search","keys","copy","removed","meta","explicit","key","stringKey","createReactiveSystem","link","prevDep","sub","dep","nextDep","version","prevSub","newLink","unlink","nextSub","unwatched","propagate","stack","flags","isValidLink","notify","subSubs","checkDirty","checkDepth","dirty","update","subs","shallowPropagate","firstSub","hasMultipleSubs","checkLink","queuedEffects","atom","effect","purgeDeps","queuedEffectsLength","depsTail","import_react","useMatch","router","nearestRouteId","routeId","matchStore","useLoaderData","useLoaderDeps","rest","select","useParams","params","useSearch","useNavigate","_defaultOpts","useRouteContext","import_jsx_runtime","resolveExternalLink","scheme","to","protocolAllowlist","resolveIsActive","currentPath","location","basepath","nextPath","activeOptions","isHydrated","useLinkProps","getServerLinkProps","forwardedRef","host","STATIC_EMPTY_OBJECT","STATIC_ACTIVE_OBJECT","ROUTER_OPTION_KEYS","collectElementProps","props","applyLinkState","stateProps","isActive","activeProps","inactiveProps","href","linkDisabled","target","stateStyle","style","stateClassName","className","directExternalLink","hrefOption","getHrefOption","disabled","externalLink","Link","linkProps","ref","areLinkPropsEqual","extraKeys","prev","_key","Route$8","createRoute","RootRoute","createRootRoute","createFileRoute","route","getStoreFactory","fn","createRouter","Router","noopScriptHandler","setScriptAttrs","value","Asset","innerHTML","Script","dataScript","normSrc","el","typeAttr","nonceAttr","sType","sNonce","preventScriptHoist","buildTagsFromMatches","routeMeta","resultMeta","metaByAttribute","title","i","metas","j","m","json","attribute","nonce","constructedLinks","manifestCssTags","resolvedLink","assetCrossOrigin","preloadLinks","preload","styles","headScripts","tags","useTags","HeadContent","tag","Scripts","renderScripts","parts","scriptWithHoist","scripts","getGlobalStartContext","context","QueryClientContext","useQueryClient","client","queryClient","QueryClientProvider","defaultTimeoutProvider","callback","delay","timeoutId","intervalId","timeoutManager","#provider","provider","systemSetTimeoutZero","isServer$1","noop$2","functionalUpdate","updater","input","isValidTimeout","timeUntilStale","updatedAt","staleTime","resolveQueryValue","query","matchQuery","filters","queryKey","exact","hashQueryKeyByOptions","partialMatchKey","type","stale","fetchStatus","predicate","matchMutation","mutationKey","mutation","hashKey","status","isPlainObject","val","result","a","b","bKeys","hasOwn","replaceEqualDeep","depth","array","isPlainArray","aSize","bItems","bSize","equalItems","aItem","bItem","v","shallowEqualObjects","hasObjectPrototype","o","objectPrototype","ctor","prot","sleep","resolve","timeout","replaceData","prevData","data","addToEnd","newItems","items","item","max","addToStart","skipToken","ensureQueryFn","fetchOptions","shouldThrowError","throwOnError","addConsumeAwareSignal","consumed","signal","object","getSignal","onCancelled","isServerFn","isServer","Subscribable","listener","focusManager","#setup","onFocus","#cleanup","setup","focused","#focused","isFocused","defaultScheduler","createNotifyManager","queue","transactions","notifyFn","batchNotifyFn","scheduleFn","schedule","flush","originalQueue","args","notifyManager","onlineManager","onlineListener","onOnline","offlineListener","#online","online","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","createRetryer","isRetryCancelled","continueFn","promiseResolve","promiseReject","promise","reject","isResolved","cancel","error","cancelOptions","config","cancelRetry","continueRetry","canContinue","canStart","pause","continueResolve","run","promiseOrValue","initialPromise","retry","retryDelay","shouldRetry","Removable","#gcTimeout","newGcTime","infiniteQueryBehavior","direction","oldPages","oldPageParams","currentPage","fetchFn","cancelled","addSignalProperty","queryFn","fetchPage","param","queryFnContext","previous","page","addTo","maxPages","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pages","lastIndex","pageParams","Query","#abortSignalConsumed","#defaultOptions","#client","#cache","#initialState","getDefaultState$1","#queryType","#retryer","defaultState","successState","newData","#dispatch","observer","x","index","abortController","#revertState","retryer","reducer","action","state","fetchState","newState","dataUpdatedAt","hasData","initialDataUpdatedAt","Mutation","#mutationCache","#observers","getDefaultState","onContinue","mutationFnContext","variables","restored","isPaused","MutationCache","#mutations","#scopes","#mutationId","scope","scopeFor","scopedMutations","firstPendingMutation","defaultedFilters","event","pausedMutations","MutationObserver$1","#updateResult","prevOptions","#currentMutation","#notify","#currentResult","#mutateOptions","onMutateResult","QueryCache","#queries","queryHash","queries","QueryClient","#queryCache","#queryDefaults","#mutationDefaults","#mountCount","#unsubscribeFocus","#unsubscribeOnline","defaultedOptions","cachedData","queryCache","matched","queriesToRefetch","defaultedCancelOptions","promises","queryData","defaults","queryDefault","useMutation","onStoreChange","mutate","reset_default","nullBodyResponses","fetchRP","_fetchRes","fetchRes","detectResponseType","DetailedError","message","jsonRegex","_contentType","response","contentType","mergePath","base","replaceUrlParam","k","reg","urlString","buildSearchParams","searchParams","v2","replaceUrlProtocol","protocol","removeIndexString","isObject","deepMerge","source","merged","parseResponse","createProxy","appendQueryParams","queryString","url","ClientRequestImpl","method","form","methodUpperCase","headerValues","opt","cookies","\"Cookie\"","headers","setBody","hc","proxyCallback","buildSearchParamsOption","lastParts","last","baseUrl","normalizedUrl","webSocketUrl","targetUrl","queryParams","req","reqOptions","baseHeaders","reqHeaders","fetcher","origin","Context","create$5","message$3","reason","use","classes","create$4","catalog","serialize","entries","root","schemes","get","set","colorScheme","element","selection","scopeClass","record","character","create$3","overrides","external","inline","vars","from$1","declarations","property","name","letter","from","create$2","axes","axis","entry","selected","create$1","defaultSet","field","html","\"defaultVars\"","Route$7","Root","Document","chain","redirect","document","ForwardRef$20","titleId","ForwardRef$19","ForwardRef$18","ForwardRef$17","ForwardRef$16","Button","styles$18","content","loading","prefix","\"axes\"","\"size\"","\"variant\"","\"defaults\"","\"className\"","ForwardRef$15","ErrorMessage","styles$17","\"align\"","UNINITIALIZED","useRefWithInit","init","initArg","hooks","currentInstance","getInstance","register","hook","fastComponent","FastComponent","instance","createInstance","fastComponentRef","NOOP","EMPTY_ARRAY","EMPTY_OBJECT","useIsoLayoutEffect","createFormatErrorMessage","code","arg","formatErrorMessage","TooltipRootContext","useTooltipRootContext","optional","useOnMount","EMPTY$1","Timeout","useTimeout","readRawData","platform$1","lowerUserAgent","userAgent","lowerPlatform","ios","maxTouchPoints","ANDROID_STRING","android","mac","apple","webkit","voiceOver","jsdom","stopEvent","isReactEvent","isVirtualClick","isVirtualPointerEvent","isMouseLikePointerType","values","strict","pointerType","isClickLikeEvent","hasWindow","getNodeName","isNode","node","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","isOverflowElement","getComputedStyle$1","overflow","overflowY","overflowX","display","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","css","elementOrCss","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","getNearestOverflowAncestor","parentNode","getOverflowAncestors","list","traverseIframes","scrollableAncestor","isBody","win","frameElement","getFrameElement","activeElement","doc","contains","parent","child","rootNode","closest","current","selector","getTarget","FOCUSABLE_ATTRIBUTE","TYPEABLE_SELECTOR","ARROW_LEFT$1","ARROW_RIGHT$1","ARROW_UP$1","ARROW_DOWN$1","startingStyle","endingStyle","STARTING_HOOK","ENDING_HOOK","transitionStatusMapping","open","closed","anchorHidden","popupOpen$2","pressed$1","TRIGGER_HOOK","PRESSABLE_TRIGGER_HOOK","POPUP_OPEN_HOOK","POPUP_CLOSED_HOOK","ANCHOR_HIDDEN_HOOK","triggerOpenStateMapping","pressableTriggerOpenStateMapping","popupStateMapping","popupTransitionStateMapping","triggerDisabled","isTargetInsideEnabledTrigger","targetElement","triggerElements","trigger","isEventTargetWithin","eventAgain","isRootElement","isTypeableElement","isInteractiveElement","isTypeableCombobox","matchesFocusVisible","getFloatingFocusElement","floatingElement","resolveValue","getDelay","prop","getRestMs","isClickLikeOpenEvent","interactedInside","openEventType","isHoverOpenEvent","createChangeEventDetails","canceled","allowPropagation","custom","customProperties","none","triggerPress","triggerHover","triggerFocus","outsidePress","itemPress","focusOut","escapeKey","listNavigation","cancelOpen","imperativeAction","windowResize","FloatingDelayGroupContext","resetDelayRef","initialDelayRef","useDelayGroup","floatingId","store","isInstantPhase","setIsInstantPhase","openRef","unset","currentContextRef","currentIdRef","timeoutMs","closingId","delayRef","prevContext","prevId","hasProvider","addEventListener","mergeCleanups","cleanups","cleanup","useMergedRefs","forkRef","createForkRef","didChange","c","d","useMergedRefsN","didChangeN","refs","newRefs","cleanupCallbacks","refCleanup","cleanupCallback","useValueAsRef","latest","createLatestRef","SafeReact","useInsertionEffect","useSafeInsertionEffect","useStableCallback","stable","createStableCallback","assertNotCalled","EMPTY","scheduler","currentCallbacks","currentCallbacksCount","timestamp","AnimationFrame","useAnimationFrame","ownerDocument","visuallyHiddenBase","visuallyHidden","visuallyHiddenInput","FocusGuard","role","setRole","restProps","min","round","floor","createCoords","oppositeSideMap","clamp$1","start","end","evaluate","getSide","placement","getAlignment","getOppositeAxis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rtl","alignment","alignmentAxis","length","mainAlignmentSide","rects","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","y","width","height","isIndexOutOfListBounds","getMinListIndex","findNonDisabledListIndex","listRef","getMaxListIndex","getNextListIndex","step","currentIndex","wrapped","loopFocus","decrement","minIndex","maxIndex","outside","allowEscape","startingIndex","amount","isListIndexDisabled","disabledIndices","isElementVisible","isHiddenByStyles","CANDIDATE_SELECTOR","getParentElement","assignedSlot","getDetailsSummary","details","isWithinOpenDetailsSummary","summary","isFocusableCandidate","nodeName","isFocusableElement","isAncestor","isSlot","isVisibleInTabbableTree","getTabIndex","tabIndex","getNamedRadioInput","isTabbableRadio","checkedRadio","candidates","radio","candidate","getComposedChildren","container","assignedElements","appendCandidates","appendMatchingElements","isTabbable","focusable","tabbable","getTabbableIn","len","active","dir","getNextTabbable","referenceElement","getPreviousTabbable","isOutsideEvent","containerElement","relatedTarget","disableFocusInside","enableFocusInside","elements","tabindex","getNodeChildren","nodes","onlyOpenChildren","getNodeAncestors","allAncestors","currentParentId","createAttribute","rafId","enqueueFocus","exec","shouldFocus","sync","currentRafId","markerName","ariaHiddenCounterMap","uncontrolledElementsSet","markerCounterMap","lockCount","unwrapHost","correctElements","targets","correctedTarget","buildKeepSet","keep","collectOutsideElements","walk","keepElements","applyAttributeToOthers","avoidElements","body","uncorrectedAvoidElements","markerTargets","mark","hiddenElements","markedElements","ariaHidden","ariaLiveElements","controlElements","attr","alreadyHidden","counterValue","markerValue","markOthers","useForcedRerendering","setState","globalId","useGlobalId","defaultId","forceRerender","idOverride","maybeReactUseId","useId$3","reactId","majorVersion","isReactVersionAtLeast","reactVersionToCheck","getReactElementRef","reactElement","propsWithRef","mergeObjects","getStateAttributesProps","customMapping","customProps","resolveClassName","resolveStyle","EMPTY_PROPS","mergeProps","e","createInitialMergedProps","mergeInto","mergePropsN","isPropsGetter","inputProps","copyInitialProps","mutablyMergeInto","copiedProps","propName","propValue","isEventHandler","wrapEventHandler","externalProps","mergedProps","externalPropValue","mergeClassNames","mergeEventHandlers","code0","code1","code2","theirHandler","ourHandler","isSyntheticEvent","baseUIEvent","makeEventPreventable","handler","theirClassName","ourClassName","useRenderElement","renderProp","componentProps","unwrapLazyRenderProp","outProps","useRenderElementProps","evaluateRenderProp","classNameProp","styleProp","enabled","stateAttributesMapping","resolvedProps","resolveRenderFunctionProps","REACT_LAZY_TYPE","render","unwrapped","renderTag","Tag","DISABLED_TRANSITIONS_STYLE","DROPDOWN_COLLISION_AVOIDANCE","POPUP_COLLISION_AVOIDANCE","ownerVisuallyHidden","import_react_dom","PortalContext","usePortalContext","useFloatingPortalNode","containerProp","uniqueId","parentPortalNode","setContainerElement","portalNode","setPortalNode","setPortalNodeRef","containerRef","resolvedContainer","portalElement","elementProps","portalSubtree","FloatingPortal","portalNodeId","beforeOutsideRef","afterOutsideRef","beforeInsideRef","afterInsideRef","focusManagerState","setFocusManagerState","focusInsideDisabledRef","modal","shouldRenderGuards","portalContextValue","portalOwnerRole","createEventEmitter","map","FloatingNodeContext","FloatingTreeContext","useFloatingParentNodeId","useFloatingTree","contextTree","externalTree","resolveRef","maybeRef","getEventType","lastInteractionType","LIST_LIMIT","previouslyFocusedElements","clearDisconnectedPreviouslyFocusedElements","addPreviouslyFocusedElement","getPreviouslyFocusedElement","getFirstTabbableElement","handleTabIndex","floatingFocusElement","tabbableContent","dataTabIndex","FloatingFocusManager","domReference","floating","getNodeId","dataRef","ignoreInitialFocus","initialFocus","isUntrappedTypeableCombobox","initialFocusRef","returnFocusRef","returnFocus","explicitReturnFocusRef","explicitReturnFocus","openInteractionTypeRef","openInteractionType","tree","portalContext","preventReturnFocusRef","isPointerDownRef","pointerDownOutsideRef","lastFocusedTabbableRef","closeTypeRef","lastInteractionTypeRef","beforeGuardRef","afterGuardRef","mergedBeforeGuardRef","beforeContentFocusGuardRef","mergedAfterGuardRef","blurTimeout","pointerDownTimeout","restoreFocusFrame","isInsidePortal","getTabbableContent","getResolvedInsideElements","getInsideElements","onKeyDown","clearPointerDownOutside","onPointerDown","insideElements","pointerTargetInside","closeOnFocusOut","handlePointerDown","handleFocusIn","handleFocusOutside","currentTarget","nodeId","triggers","isRelatedFocusGuard","previousFocusableElement","nextFocusableElement","movedToUnrelatedNode","restoreFocus","prevTabbable","nodeToFocus","markInsideReactTree","domReferenceElement","portalNodes","rootAncestorComboboxDomReference","ariaHiddenCleanup","markerCleanup","previouslyFocusedElement","initialFocusValueOrFn","resolvedInitialFocus","focusableElements","getDefaultFocusElement","elToFocus","hadFocusInside","openEvent","openedByVirtualPress","currentActiveElement","pendingReturnFocusRef","elementFocusedBeforeOpen","preferPreviousFocus","onOpenChangeLocal","isPreventScrollSupported","events","getReturnElement","returnFocusValueOrFn","resolvedReturnFocusValue","closeType","referenceReturnElement","previousReturnElement","defaultReturnElement","activeEl","isFocusInsideFloatingTree","returnElement","job","tabbableReturnElement","hasExplicitReturnFocus","focusOptions","els","useClick","eventOption","pointerTypeRef","frame","touchOpenTimeout","reference","setOpenWithTouchDelay","nativeEvent","nextOpen","touchOpenDelay","getNextOpen","hasClickedOnInactiveTrigger","toggle","stickIfOpen","ignoreMouse","isTypeable","eventCurrentTarget","createVirtualElement","offsetX","offsetY","isAutoUpdateEvent","domElement","domRect","isXAxis","isYAxis","canTrackCursorOnAutoUpdate","isMouseBasedEvent","useClientPoint","initialRef","cleanupListenerRef","setPointerType","reactive","setReactive","resetReference","setReference","newX","newY","handleReferenceEnterOrMove","openCheck","cleanupListener","handleMouseMove","setPointerTypeRef","alwaysFalse","normalizeProp","normalizable","useDismiss","escapeKey$1","outsidePressProp","outsidePressFn","outsidePress$1","outsidePressEnabled","getOutsidePressEventProp","outsidePressEvent","escapeKeyBubbles","outsidePressBubbles","bubbles","pressStartedInsideRef","pressStartPreventedRef","suppressNextOutsideClickRef","sawPressWhileOpenRef","isComposingRef","currentPointerTypeRef","touchStateRef","cancelDismissOnEndTimeout","clearInsideReactTreeTimeout","compositionTimeout","clearInsideReactTree","hasBlockingChild","bubbleKey","isEventWithinOwnElements","closeOnReferencePress","referencePress","closeOnEscapeKeyDown","native","eventDetails","markPressStartedInsideReactTree","markInsidePressStartPrevented","handleOpenChange","preventedPressSuppressionTimeout","handleCompositionStart","handleCompositionEnd","suppressImmediateOutsideClickAfterPreventedStart","resetPressStartState","getOutsidePressEvent","computedType","outsidePressEventValue","resolved","shouldIgnoreEvent","computedOutsidePressEvent","isEventWithinFloatingTree","targetIsInsideChildren","closeOnPressOutside","inertSelector","targetRoot","markers","targetRootAncestor","nextParent","marker","lastTraversableNode","scrollRe","isScrollableX","isScrollableY","canScrollX","canScrollY","isRTL","pressedVerticalScrollbar","pressedHorizontalScrollbar","handleTouchStart","touch","addTargetEventListenerOnce","unsubscribe","handleTouchStartCapture","closeOnPressOutsideCapture","targetEvent","handlePressEndCapture","pressStartedInsideDefaultPrevented","handleTouchMove","deltaX","deltaY","distance","handleTouchMoveCapture","handleTouchEnd","handleTouchEndCapture","useSyncedFloatingRootContext","popupStore","treatPopupAsFloatingElement","onOpenChange","valuesToSync","nested","useTransitionStatus","transitionStatus","setTransitionStatus","enableIdleState","mounted","setMounted","animateInitialOpen","deferEndingState","getFiniteAnimations","timing","animation","pendingCallbacks","flushBeforePaint","callbacks","useAnimationsFinished","elementOrRef","resolvedElement","done","batch","fnToExecute","waitForStartingStyleRemoved","startingStyleAttribute","attributeObserver","useOpenChangeComplete","onCompleteParam","parameters","onComplete","runOnceAnimationsFinish","useUnmountAfterClose","setPreventUnmountOnCloseParam","setPreventUnmountOnClose","preventUnmountingOnClose","preventUnmountOnClose","mountedRef","pendingUnmountRef","rerender","unmount","onUnmount","forceUnmount","FOCUSABLE_POPUP_PROPS","usePopupRootStore","createStore","PopupHandleAttachment","handle","syncTriggerCount","triggerCount","useTriggerRegistration","registrationRef","registration","registeredStore","createPopupOpenState","triggerId","activeTriggerId","activeTriggerElement","attachPreventUnmountOnClose","applyPopupOpenChange","isHover","isFocusOpen","isDismissClose","shouldPreventUnmountOnClose","changeState","popupOpenState","updatedState","useTriggerDataForwarding","isMountedByThisTrigger","baseRegisterTrigger","applyTriggerData","changes","stateUpdates","registerTrigger","triggerElementRef","useImplicitActiveTrigger","resolvedActiveTriggerIdRef","currentActiveTriggerId","lostActiveTriggerId","triggerElement","iteratorResult","implicitTriggerId","implicitTriggerElement","closeOnActiveTriggerUnmount","useOpenStateTransitions","usePopupInteractionProps","statePart","PopupTriggerMap","registered","import_shim","import_with_selector","useStoreImplementation","useStoreFast","useStoreLegacy","useStore","a1","a2","a3","useStoreR19","getSelection","stores","unsubscribes","Store","currentTick","ReactStore","selectors","isControlled","controlled","stableFunction","selectFn","prevValue","nextValue","nextState","oldValue","selectors$2","FloatingRootStore","initialState","syncOnly","newOpen","createInitialPopupStoreState","activeTriggerIdSelector","openSelector","popupIdSelector","triggerOwnsOpenPopup","triggerOwnsOpenPopupOrIsOnlyTrigger","popupStoreSelectors","usePopupHandleStore","subscribe","getSnapshot","useFloatingRootContext","isMacSafari","useFocus","blockFocusRef","blockedReferenceRef","keyboardModalityRef","onBlur","currentDomReference","resetBlockedFocus","focusTarget","movedFromOtherEnabledTrigger","movedToFocusGuard","HoverInteraction","pointerEventsMutationOwnerByScopeElement","clearSafePolygonPointerEventsMutation","scopeElement","applySafePolygonPointerEventsMutation","existingOwner","useHoverInteractionSharedState","useHoverFloatingInteraction","closeDelayProp","nodeIdProp","parentId","childClosedTimeout","isClickLikeOpenEvent$2","isHoverOpen","clearPointerEvents","floatingEl","parentFloating","cachedScopeElement","parentScopeElement","hasParentChildren","closeWithDelay","closeDelay","close","handleInteractInside","onFloatingMouseEnter","onNodeClosed","onFloatingMouseLeave","currentNodeId","EMPTY_REF","useHoverReferenceInteraction","shouldOpenProp","isHoverCloseActiveRef","handleCloseRef","handleClose","restMsRef","restMs","enabledRef","shouldOpenRef","isClosingRef","isClosing","isClickLikeOpenEvent$1","checkShouldOpen","isOverInactiveTrigger","allTriggers","cleanupMouseMoveHandler","isActiveTrigger","runElseBranch","onMouseEnter","mouseOnly","restMsValue","openDelay","eventTarget","triggerNode","isOverInactive","isOpen","isInClosingTransition","isHoverCloseTransition","isReenteringSameTriggerDuringCloseTransition","isRestOnlyDelay","shouldOpenImmediately","shouldOpen","onMouseLeave","handleCloseContextBase","getHandleCloseContext","currentTrigger","onMouseOut","staleOpenGuard","guardStaleOpen","move","setPointerRef","currentOpen","latestOpen","isStationaryWebKitPointer","doSwitch","orientation","vertical","horizontal","isMainOrientationKey","isMainOrientationToEndKey","isCrossOrientationOpenKey","isCrossOrientationCloseKey","grid","useListNavigation","onNavigateProp","navigateGrid","isGrid","typeableComboboxReference","floatingFocusElementRef","focusItemOnOpenRef","focusItemOnOpen","indexRef","selectedIndex","keyRef","isPointerModalityRef","onNavigate","previousMountedRef","previousOpenRef","forceSyncFocusRef","forceScrollIntoViewRef","cancelQueuedFocusRef","disabledIndicesRef","latestOpenRef","selectedIndexRef","resetOnPointerLeaveRef","resetOnPointerLeave","focusFrame","waitForListPopulatedFrame","focusItem","runFocus","virtual","initialItem","forceScrollIntoView","waitedItem","activeIndex","runs","waitForListPopulated","triggerOrientation","treeContainsActiveEl","hasActiveIndex","syncCurrentTarget","getParentOrientation","parentOrientation","getMinEnabledIndex","commonOnKeyDown","nestedReturnFocusRef","focusedElement","focusItemOnHover","floatingFocusEl","ariaActiveDescendantProp","openOnNavigationKeyDown","checkVirtualMouse","checkVirtualPointer","isArrowKey","isParentCrossOpenKey","isMainKey","isNavigationKey","openOnArrowKeyDown","isParentMainKey","useTypeahead","onMatchProp","onTypingProp","onTyping","stringRef","prevIndexRef","matchIndexRef","getElement","elementsRef","isItemAvailable","getMatchingIndex","normalizedStartIndex","startIndex","lowerString","string","offset","listContent","isNewSession","text","resetMs","currentDomReferenceElement","currentFloatingElement","sharedProps","CURSOR_SPEED_THRESHOLD","CURSOR_SPEED_THRESHOLD_SQUARED","POLYGON_BUFFER","hasIntersectingEdge","yi","pointY","yj","pointX","xj","xi","isPointInQuadrilateral","isInsideValue","x1","y1","x2","y2","x3","y3","x4","y4","isInsideRect","isInsideAxisAlignedRect","safePolygon","hasLanded","lastX","lastY","lastCursorTime","isCursorMovingSlowly","currentTime","elapsedTime","nextX","nextY","distanceSquared","thresholdSquared","onClose","isLeave","isOverFloatingEl","isOverReferenceEl","hasOpenChildNode","closeIfNoOpenChild","refRect","cursorLeaveFromRight","cursorLeaveFromBottom","isFloatingWider","isFloatingTaller","left","right","top","bottom","isInsideTroughRect","clientX","clientY","isInsidePolygon","cursorXOffset","cursorPointOneX","cursorPointTwoX","cursorPointY","commonYLeft","commonYRight","cursorYOffset","cursorPointOneY","cursorPointTwoY","cursorPointX","commonXTop","commonXBottom","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","paddingObject","altBoundary","elementContext","clippingClientRect","platform","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition$1","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","middleware","currentMiddleware","reset","flip$2","_middlewareData$arrow","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","detectOverflowOptions","initialSideAxis","initialPlacement","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","fallbackAxisSideDirection","placements","overflows","overflowsData","sides","nextIndex","nextPlacement","resetPlacement","fallbackStrategy","currentSideAxis","acc","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","crossAxis","mainAxis","offset$2","diffCoords","shift$2","mainAxisCoord","crossAxisCoord","clampCoord","coord","limitedCoords","limiter","limitShift$2","rawOffset","computedOffset","limitMin","limitMax","isOriginSide","size$2","heightSide","widthSide","maximumClippingHeight","maximumClippingWidth","overflowAvailableHeight","overflowAvailableWidth","shiftData","noShift","availableHeight","availableWidth","apply","nextDimensions","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale$1","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","getWindowScrollBarX","leftScroll","getHTMLOffset","htmlRect","documentElement","scroll","convertOffsetParentRelativeRectToViewportRelativeRect","strategy","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","SCROLLBAR_MAX","getViewportRect","rootBoundary","isLayoutViewport","visualViewport","layoutRelativeClientCoords","bodyStyles","bodyMarginInline","reservedWidth","gutter","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","getClippingElementAncestors","cachedResult","cache","lastKeptComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","lastPosition","ancestor","getClippingRect","clippingAncestors","boundary","firstRect","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","rectsAreEqual","observeMove","io","_io","refresh","skip","threshold","elementRectForRootMargin","onMove","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","handleResize","ancestorResize","autoUpdate","referenceEl","ancestors","ancestorScroll","cleanupIo","layoutShift","reobserveFrame","resizeObserver","elementResize","firstEntry","_resizeObserver","animationFrame","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","shift$1","flip$1","size$1","limitShift$1","computePosition","mergedOptions","platformWithCache","deepEqual","getDPR","roundByDPR","dpr","useLatestRef","useFloating","externalReference","externalFloating","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","referenceRef","setFloating","floatingRef","hasWhileElementsMounted","whileElementsMounted","whileElementsMountedRef","platformRef","fullData","isMountedRef","floatingStyles","initialStyles","transform","deps","shift","limitShift","flip","size","selectors$1","TooltipStore","createInitialState","createInitialContext","TooltipRoot","disabled$1","openProp","triggerIdProp","defaultTriggerIdProp","defaultOpen","onOpenChangeComplete","openState","payload","instantType","lastOpenChangeReason","previousInstantTypeRef","actionsRef","shouldRenderInteractions","trackCursorAxis","TooltipInteractions","floatingRootContext","dismiss","clientPoint","triggerProps","useBaseUiId","TooltipProviderContext","useTooltipProviderContext","TOOLTIP_TRIGGER_IDENTIFIER","getTargetElement","TooltipTrigger","disabledProp","idProp","rootContext","thisTriggerId","isTriggerActive","isOpenedByThisTrigger","closeDelayWithDefault","providerDelay","hoverInteraction","rootDisabled","disabledRef","disableHoverablePopup","isNestedTriggerHoveredRef","nestedTriggerOpenTimeout","getOpenDelay","activeIdRef","isEnabledNestedTriggerTarget","triggerEl","nearestTrigger","detectNestedTriggerHover","nestedTriggerHovered","hoverProps","focusProps","handleNestedTriggerHover","wasNestedTriggerHovered","targetInsideTrigger","rootTriggerProps","closeOnClick","TooltipPortalContext","useTooltipPortalContext","FloatingPortalLite","TooltipPortal","portalProps","keepMounted","TooltipPositionerContext","useTooltipPositionerContext","useBaseUIFloating","positionReference","setPositionReferenceRaw","domReferenceRef","storeElements","position","setPositionReference","computedPositionReference","n","DirectionContext","useDirection","baseArrow","arrowDimensions","minProp","maxProp","clientProp","endDiff","startDiff","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","center","shouldAddOffset","alignmentOffset","arrow","hide","DEFAULT_SIDES","anchorWidth","anchorHeight","transformOrigin$1","AVAILABLE_WIDTH_VAR","AVAILABLE_HEIGHT_VAR","getLogicalSide","isLogicalSideParam","sideParam","isRtl","renderedSide","getOffsetData","useAnchorPositioning","useAnchorPositioningWithHook","collisionPaddingParam","inlineMiddleware","shift$3","collisionAvoidanceSide","collisionAvoidance","collisionAvoidanceAlign","collisionAvoidanceFallbackAxisSide","shiftCrossAxis","shiftRootBoundary","anchorFn","anchor","anchorFnCallback","anchorDep","anchorValueRef","mountPlacement","setMountPlacement","lockAlign","lazyFlip","mountSide","mountAlign","placementAlign","align","collisionPadding","biasTop","biasBottom","biasLeft","biasRight","commonCollisionProps","collisionBoundary","arrowRef","sideOffsetRef","sideOffset","alignOffsetRef","alignOffset","sideOffsetDep","alignOffsetDep","alignAxis","shiftDisabled","crossAxisShiftEnabled","sticky","flipMiddleware","shiftMiddleware","limitData","arrowSize","offsetAmount","floatingStyle","anchorWidth$1","anchorHeight$1","arrowPadding","renderedPlacement","renderedAlign","arrowEl","sideOffsetValue","crossOrigin","sideOrigin","adaptiveOrigin","autoUpdateOptions","disableAnchorTracking","originalFloatingStyles","useFloatingHook","positionMethod","resolvedPosition","isPositioned","sideX","sideY","registeredPositionReferenceRef","anchorValue","resolvedAnchor","finalAnchor","isRef","logicalRenderedSide","arrowStyles","arrowUncentered","getDisabledMountTransitionStyles","usePositioner","inert","TooltipPositioner","positioning","TooltipPopup","popupProps","floatingContext","setPopupElement","inertValue","usePreviousValue","Tooltip","styles$16","Account","Title","Subtitle","styles$15","accounts","only","format$2","DepositLink","kind","address","balance","Route$6","Page$6","session","user","account","owner","signOut","styles$14","sign","deserialized","ForwardRef$14","ForwardRef$13","BRLA_default","BRZ_default","CHFAU_default","DLUSD_default","EURAU_default","EURC_e_default","GBPA_default","GUSD_default","MACH_default","OUSD_default","PRIME_default","SBC_default","SEKAU_default","USD1_default","USDB_default","USDC_e_default","USDT0_default","USDY_default","USDe_default","YLDS_default","alphaUSD_default","betaUSD_default","cUSD_default","cbBTC_default","frxUSD_default","goUSD_default","iUSD_default","pathUSD_default","rUSD_default","reUSD_default","sUSDe_default","siUSD_default","stcUSD_default","syrupUSDC_default","thetaUSD_default","wYLDS_default","wsrUSD_default","OUSD_dark_default","OUSD_light_default","ForwardRef$12","icons","file","logos","symbol","Grant","Heading","periodic","limits","limit","styles$13","format$1","every","label","token","logo","icon","until","expiry","decimal","relative","spans","units","unit","seconds","period","count","remaining","Approval","pending","refusal","styles$12","refusals$1","InvalidRequest","CeremonyError$2","Route$5","Page$5","searchStr","forwarded","consent","decided","assertion","signed","styles$11","message$2","names$2","ForwardRef$11","ChooseAccount","realms","styles$10","format","Route$4","Page$4","selecting","styles$9","useOnFirstRender","isElementDisabled","useControlled","defaultProp","valueState","setValue","newValue","SelectRootContext","SelectFloatingContext","useSelectRootContext","useSelectFloatingContext","valid","invalid","DEFAULT_VALIDITY_STATE","DEFAULT_FIELD_ROOT_STATE","fieldValidityMapping","DEFAULT_FIELD_ROOT_CONTEXT","FieldRootContext","useFieldRootContext","useRegisterFieldControl","sourceRef","registerFieldControl","getFormValueOverride","controlRef","LabelableContext","useLabelableContext","useLabelableId","controlSourceRef","hasRegisteredRef","hadExplicitIdRef","unregisterControlId","registerControlId","nextId","resetControlId","controlId","areArraysEqual","array1","array2","itemComparer","defaultItemEquality","itemValue","selectedValue","compareItemEquality","comparer","isSelectedValueDirty","currentValue","initialValue","initialItemValue","selectedValueIncludes","selectedValues","findItemIndex","itemValues","createSelectionMatcher","findSelectionIndex","multiple","resolveSelectedIndex","registry","removeItem","serializeValue","isGroup","isGroupedItems","flattenLeafItems","group","hasNullItemLabel","arrayItems","stringifyAsLabel","itemToStringLabel","stringifyAsValue","itemToStringValue","resolveSelectedLabel","fallback","flatItems","resolveMultipleLabels","storeValue","selectedItem","FormContext","useFormContext","useValueChanged","valueRef","onChangeCallback","onChange","useEnhancedClickHandler","lastClickInteractionTypeRef","useOpenMethodTriggerProps","setOpenMethod","interactionType","onClick","useOpenInteractionType","openMethod","previousOpen","clamp","getMaxScrollOffset","scrollSize","normalizeScrollOffset","clamped","startDistance","endDistance","withinStartTolerance","withinEndTolerance","SelectRoot","valueProp","nameProp","fieldName","fieldDisabled","generatedId","setValueUnwrapped","defaultValue","setOpenUnwrapped","labelsRef","popupRef","scrollHandlerRef","scrollArrowsMountedCountRef","valuesRef","typingRef","firstItemTextRef","selectedItemTextRef","selectionRef","alignItemWithTriggerActiveRef","initialValueRef","interactionTypeProps","handleUnmount","positionerElement","previousOpenMethod","renderedOpenMethod","serializedValue","fieldStringValue","hasSelectedValue","setFilled","isItemEqualToValue","clearErrors","setDirty","validityData","validation","setOpen","openEventDetails","setTouched","setFocused","validationMode","onValueChange","handleScrollArrowVisibility","maxScrollTop","scroller","scrollTop","shouldShowUp","shouldShowDown","click","nextActiveIndex","highlightItemOnHover","typeahead","readOnly","typing","mergedTriggerProps","itemProps","itemRoot","inputRef","hiddenInputName","hiddenInputs","currentSerializedValue","handleChange","nextValueLower","matchingIndex","renderedLabel","matchingValue","required","useRegisteredLabelId","setLabelId","currentId","useLabel","setLabelIdProp","focusControlProp","contextControlId","setContextLabelId","nextLabelId","resolvedControlId","fallbackControlId","focusControl","controlElement","getControlById","focusElementWithVisible","handleInteraction","getDefaultLabelId","resolveAriaLabelledBy","fieldLabelId","localLabelId","SelectLabel","elementPropsWithoutId","fieldRootContext","rootId","labelProps","resolvedLabelId","useSetFieldFocused","setFieldFocused","focusOwnerRef","onFocusedChange","focusTargetRef","BOUNDARY_OFFSET","isMouseWithinBounds","bounds","getPseudoElementBounds","elementRect","beforeStyles","afterStyles","beforeWidth","beforeHeight","afterWidth","afterHeight","totalWidth","totalHeight","widthDiff","heightDiff","CompositeRootContext","useCompositeRootContext","useFocusableWhenDisabled","tabIndexProp","isFocusableComposite","composite","focusableWhenDisabled","isNonFocusableComposite","additionalProps","isNativeButton","dispatchClickWithModifiers","sourceEvent","useButton","compositeProp","elementRef","compositeRootContext","isCompositeItem","focusableWhenDisabledProps","updateDisabled","isButtonElement","externalOnClick","externalOnMouseDown","externalOnKeyUp","externalOnKeyDown","externalOnPointerDown","otherExternalProps","isCurrentTarget","isButton","isLink","isValidLinkElement","shouldClick","isEnterKey","isSpaceKey","isTextNavigationRole","elem","popupSide","SELECTED_DELAY","stateAttributesMapping$2","SelectTrigger","fieldState","selectDisabled","listElement","popupSideValue","selectLabelId","ariaLabelledBy","positionerRef","triggerRef","nativeButton","setTriggerElement","timeoutFocus","timeoutMouseDown","selectedDelayTimeout","handleMouseUp","mouseUpTarget","mouseEvent","getButtonProps","buttonRef","stateAttributesMapping$1","SelectValue","childrenProp","shouldCheckNullItemLabel","placeholder","hasNullLabel","SelectIcon","SelectPortal","forceMount","CompositeListContext","useCompositeListContext","CompositeList","onMapChangeProp","onMapChange","setMapTick","listeners","createListeners","createMap","nextIndexRef","isDirtyRef","itemsRef","mutationObserverRef","scheduleMapUpdate","tick","unregister","syncRefs","nextMap","observe","sortedNodes","mutationObserver","hasMovedNode","previousConnectedNode","sortByDocumentPosition","roots","getCommonAncestor","automaticNodes","getCompositeListSnapshot","previousItems","changed","previousItem","subscribeMapChange","contextValue","reservedIndices","automaticItems","nextAutomaticIndex","firstNode","lastNode","SelectPositionerContext","useSelectPositionerContext","InternalBackdrop","otherProps","clipPath","cutout","clearStyles","originalStyles","LIST_FUNCTIONAL_STYLES","originalHtmlStyles","originalBodyStyles","originalHtmlScrollBehavior","getViewportScroller","isPageScrollLocked","hasInsetScrollbars","supportsStableScrollbarGutter","scrollContainer","originalScrollContainerOverflowY","originalHtmlStyleGutter","before","after","preventScrollOverlayScrollbars","elementToLock","originalElementToLockStyles","preventScrollInsetScrollbars","scrollLeft","updateGutterOnly","resizeFrame","lockScroll","htmlStyles","scrollbarGutterValue","hasConstantOverflowY","hasConstantOverflowX","scrollbarWidth","scrollbarHeight","marginY","marginX","unsubscribeResize","SCROLL_LOCKER","hasOverlayScrollbars","useScrollLock","VIEWPORT_WIDTH_TOLERANCE_PX","useAnchoredPopupScrollLock","touchOpenShouldLockScroll","setTouchOpenShouldLockScroll","touchOpen","viewportWidth","popupWidth","FIXED","SelectPositioner","scrollUpArrowRef","scrollDownArrowRef","controlledAlignItemWithTrigger","setControlledAlignItemWithTrigger","alignItemWithTrigger","alignItemWithTriggerActive","positionerStyles","prevMapSizeRef","prevSize","initialSelectedValue","selectedItemValue","stylesToClear","DISABLE_SCROLLBAR_CLASS_NAME","styleDisableScrollbar","ToolbarRootContext","useToolbarRootContext","COMPOSITE_KEYS","CSPContext","DEFAULT_CSP_CONTEXT_VALUE","useCSPContext","transformOrigin","SelectPopup","insideToolbar","reachedMaxHeightRef","initialPlacedRef","originalPositionerStylesRef","scrollArrowFrame","handleScroll","isTopPositioned","isBottomPositioned","getScale","currentHeight","normalizeSize","marginTop","marginBottom","maxPopupHeight","getMaxPopupHeight","maxAvailableHeight","getMaxScrollTop","nextScrollTop","setHeight","diff","nextHeight","heightDelta","nextPositionerHeight","popupElement","restoreTransformStyles","unsetTransformStyles","textElement","valueElement","popupStyles","triggerRect","normalizeRect","positionerRect","triggerHeight","scrollHeight","borderBottom","minHeight","viewportHeight","availableSpaceBeneathTrigger","textRect","alignedLeft","valueRect","valueCenterFromTriggerTop","idealHeight","maxHeight","maxRight","fallbackToAlignPopupToTrigger","isPinchZoomed","initialHeight","topOffset","popupTop","popupHeight","textCenterY","clampedY","defaultProps","disableStyleElements","finalFocus","maxHeightStyle","TRANSFORM_STYLE_RESETS","originalValue","SelectList","hasScrollArrows","useCompositeListItem","externalIndex","internalIndex","setInternalIndex","guess","newIndex","componentRef","previousNode","metadata","textRef","SelectItemContext","useSelectItemContext","SelectItem","listItem","highlighted","selectedByFocus","itemRef","claims","allowMouseSelectionRef","commitSelection","resetDragMovement","isMouseClick","clickPointerType","isVirtualMouseClick","isInvalidMouseClick","disallowSelectedMouseUp","disallowUnselectedMouseUp","ItemIndicator","indicatorRef","SelectItemIndicator","SelectItemText","chCodes","assertNumber","validateVersion","ver","bin","dec","pad","mod","fillArr","popcnt","interleaveBytes","maxLen","totalLen","block","blocks","idx","best","bestScore","score","alphabet","char","digits","transpose32","masks","stage","s","i0","i1","t","bitMask","rangeMask","Bitmap","lines","rows","line","row","p","wi","mask","w","h","startWord","x0","endWord","startBit","endBit","ry","rowBase","y0","words","yPos","Py","xPos","bitX","bitsPerWord","bit","cb","word","defWord","valWord","res","border","out","src","srcStride","srcValue","srcRow","dstX","dstWord","dstBit","srcWord","srcBit","w0","w1","sVal","dstMask","valBits","cur","dst","dstStride","dstValue","dstDefined","dstTail","tmpV","tmpD","by","bx","r","defined","dstY","dstPos","curMask","factor","fullWords","tailMask","patterns","patternLen","window","bitEnd","runLen","runValue","base0","base1","validLast","boxes","a0","eqV","n0","eqH0","n1","eqH1","nl","first","second","cc","whiteBG","darkBG","pathData","prevPoint","point","optimize","relM","bH","u16le","dims","bytes","fullChunks","isRGB","ECMode","Encoding","BYTES","WORDS_PER_BLOCK","ECC_BLOCKS","info","interval","ecc","maskIdx","numBlocks","blockLen","shortBlocks","PATTERNS","GF","exp","log","p_poly","poly","degree","coefficient","coefficients","scalar","smaller","larger","sumDiff","lengthDiff","divisor","elm","g","rLast","tLast","R","rLastLast","tLastLast","q","dltInverse","degreeDiff","sigmaTildeAtZero","inverse","RS","eccWords","pol","syndrome","hasError","evl","monomial","errorLocator","errorEvaluator","locations","pos","xiInverse","denominator","interleave","rs","eccBlocks","resBlocks","resECC","total","isShort","drawTemplate","finder","alignPos","bits","getBit","test","zigzag","tpl","pattern","xOffset","detectType","str","utf8ToBytes","encode","encoded","dataLen","utf8","encoder","capacity","drawQR","need","mkPattern","finderPattern","lightPattern","P1","P2","penalty","bm","transposed","adjacent","box","darkPixels","darkPercent","dark","drawQRBest","bestMask","validateECC","ec","validateEncoding","enc","validateMask","encodeQR","encoding","err","output","create","errorCorrection","Cuer","arena","hasArena","qrcode","ecl","edgeSize","finderSize","arenaSize","Finder","Inner","outerX","cellSize","outerY","innerX","innerY","fill","radius","innerClassName","Cells","inset_","edgeLength","topLeftFinder","finderLength","topRightFinder","bottomLeftFinder","inset","innerSize","cx","cy","Arena","ForwardRef$10","ForwardRef$9","ForwardRef$8","ForwardRef$7","ForwardRef$6","base_default","ethereum_default","solana_default","tempo_default","networks","stablecoins","Deposit","styles$8","Header","Receive","MethodRow","network","setStatus","coin","\"available\"","Route$3","Page$3","shown","found","styles$7","ForwardRef$5","ForwardRef$4","ForwardRef$3","ForwardRef$2","ForwardRef$1","CodeInput","edited","setEdited","nudging","setNudging","characters","clean","refused","styles$6","separator","verified","DeviceApproval","app","description","styles$5","date","refusals","CeremonyError$1","Route$2","Page$2","returnTo","pathname","fetching","setFetching","onError","approve","deny","message$1","submitCode","styles$4","names$1","ForwardRef","Input","styles$3","SignIn","styles$2","email","autofillInterval","autofillLifetime","CeremonyError","Route$1","Page$1","methods","setLink","autofill","passkey","ceremony","oauthQuery","resend","sendCode","send","verify","linked","mediation","publicKey","request","allowCredentials","controller","abort","deadline","check","timer","applyPasskey","reconnect","submitEmail","linkFailed","continueTo","verifiedDelay","signInWithGoogle","oauth_query","signInWithPasskey","sendAgain","changeEmail","startOver","failed","styles$1","reason$1","names","Route","Page","sections","section","flow","Description","Arrow","External","part","AppScreen","AppButton","AppEmailField","AppSignIn","AppEmail","AppCode","AppSignedIn","noop","prevent","unavailable","approval","signInRequest","keyedEntry","chooseAccount","deviceApproval","deviceRequest","loginEntry","loginExit","signIn","redirectEntry","appSignInEdge","tokenExit","\"tone\"","\"kind\"","rootRouteChildren","routeTree","getRouter","parseSearch","stringifySearch"],"sources":["../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/link.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/bodyScripts.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/route.js","../../../../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.js","../../../../../node_modules/.pnpm/@tanstack+store@0.11.2/node_modules/@tanstack/store/dist/alien.js","../../../../../node_modules/.pnpm/@tanstack+store@0.11.2/node_modules/@tanstack/store/dist/atom.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useMatch.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useLoaderData.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useParams.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useSearch.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useNavigate.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useRouteContext.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/link.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/route.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/fileRoute.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/routerStores.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/router.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/Asset.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/headContentUtils.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/HeadContent.js","../../../../../node_modules/.pnpm/@tanstack+react-router@1.170.41_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/Scripts.js","../../../../../node_modules/.pnpm/@tanstack+start-client-core@1.170.34/node_modules/@tanstack/start-client-core/dist/esm/getGlobalStartContext.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.104.1_react@19.3.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/utils.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/retryer.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/removable.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/query.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.104.1/node_modules/@tanstack/query-core/build/modern/queryClient.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.104.1_react@19.3.0/node_modules/@tanstack/react-query/build/modern/useMutation.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/reset.css?url","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/client/fetch-result-please.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/client/utils.js","../../../../../node_modules/.pnpm/hono@4.13.13/node_modules/hono/dist/client/client.js","../../../lib/Client.ts","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/internal/Scheme.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/Appearance.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/Props.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/Html.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/CompositionHtml.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/Recipe.js","../../../../../node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/runtime/Selection.js","../../../zyzz.config.ts","../../../routes/__root.tsx","../../../lib/Loader.ts","../../../components/Button.tsx","../../../components/ErrorMessage.tsx","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useRefWithInit.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/fastHooks.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/empty.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/formatErrorMessage.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useOnMount.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useTimeout.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/shared.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/os.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/engine.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/screen-reader.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/platform/env.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs","../../../../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/shadowDom.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popupStateMapping.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/reason-parts.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/addEventListener.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/mergeCleanups.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useMergedRefs.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useValueAsRef.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/safeReact.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useStableCallback.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useAnimationFrame.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/owner.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/visuallyHidden.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/FocusGuard.mjs","../../../../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/enqueueFocus.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/markOthers.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useForcedRerendering.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useId.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/reactVersion.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/getReactElementRef.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/mergeObjects.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/resolveClassName.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/resolveStyle.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/merge-props/mergeProps.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useRenderElement.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/constants.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/resolveRef.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useTransitionStatus.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/useStore.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/Store.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/store/ReactStore.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/store.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs","../../../../../node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../../../node_modules/.pnpm/@floating-ui+react-dom@2.1.9_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useBaseUiId.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/hideMiddleware.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/usePositioner.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/inertValue.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/usePreviousValue.mjs","../../../components/Tooltip.tsx","../../../screens/Account.tsx","../../../routes/index.tsx","../../../../../node_modules/.pnpm/webauthx@0.1.2_typescript@7.0.2_zod@4.6.7/node_modules/webauthx/dist/client/Authentication.js","../../../components/icons/BRLA.png?url","../../../components/icons/BRZ.svg?url","../../../components/icons/CHFAU.png?url","../../../components/icons/DLUSD.png?url","../../../components/icons/EURAU.svg?url","../../../components/icons/EURC.e.svg?url","../../../components/icons/GBPA.svg?url","../../../components/icons/GUSD.svg?url","../../../components/icons/MACH.svg?url","../../../components/icons/OUSD.svg?url","../../../components/icons/PRIME.svg?url","../../../components/icons/SBC.svg?url","../../../components/icons/SEKAU.svg?url","../../../components/icons/USD1.svg?url","../../../components/icons/USDB.svg?url","../../../components/icons/USDC.e.svg?url","../../../components/icons/USDT0.svg?url","../../../components/icons/USDY.svg?url","../../../components/icons/USDe.svg?url","../../../components/icons/YLDS.svg?url","../../../components/icons/alphaUSD.svg?url","../../../components/icons/betaUSD.svg?url","../../../components/icons/cUSD.svg?url","../../../components/icons/cbBTC.svg?url","../../../components/icons/frxUSD.svg?url","../../../components/icons/goUSD.svg?url","../../../components/icons/iUSD.svg?url","../../../components/icons/pathUSD.svg?url","../../../components/icons/rUSD.svg?url","../../../components/icons/reUSD.svg?url","../../../components/icons/sUSDe.svg?url","../../../components/icons/siUSD.svg?url","../../../components/icons/stcUSD.svg?url","../../../components/icons/syrupUSDC.svg?url","../../../components/icons/thetaUSD.svg?url","../../../components/icons/wYLDS.svg?url","../../../components/icons/wsrUSD.svg?url","../../../components/logos/OUSD.dark.svg?url","../../../components/logos/OUSD.light.svg?url","../../../components/Grant.tsx","../../../screens/Approval.tsx","../../../routes/authorize.tsx","../../../screens/ChooseAccount.tsx","../../../routes/choose-account.tsx","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useOnFirstRender.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/isElementDisabled.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useControlled.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/root/SelectRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-constants/constants.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/areArraysEqual.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/itemEquality.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/serializeValue.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/resolveValueLabel.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/store.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/form-context/FormContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/useValueChanged.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/clamp.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/scrollEdges.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/root/SelectRoot.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/label/SelectLabel.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-root-context/useSetFieldFocused.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/use-button/useButton.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/trigger/SelectTriggerDataAttributes.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/value/SelectValue.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/icon/SelectIcon.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/portal/SelectPortal.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/InternalBackdrop.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/popup/utils.mjs","../../../../../node_modules/.pnpm/@base-ui+utils@0.5.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/utils/useScrollLock.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/positioner/SelectPositioner.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/styles.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/composite.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/positioner/SelectPositionerCssVars.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/popup/SelectPopup.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/list/SelectList.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/item/SelectItemContext.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/item/SelectItem.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/ItemIndicator.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs","../../../../../node_modules/.pnpm/@base-ui+react@1.9.0_@types+react@19.3.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/select/item-text/SelectItemText.mjs","../../../../../node_modules/.pnpm/qr@0.5.5/node_modules/qr/index.js","../../../../../node_modules/.pnpm/cuer@0.0.3_react-dom@19.3.0_react@19.3.0__react@19.3.0_typescript@7.0.2/node_modules/cuer/_dist/QrCode.js","../../../../../node_modules/.pnpm/cuer@0.0.3_react-dom@19.3.0_react@19.3.0__react@19.3.0_typescript@7.0.2/node_modules/cuer/_dist/Cuer.js","../../../screens/chains/base.svg?url","../../../screens/chains/ethereum.svg?url","../../../screens/chains/solana.svg?url","../../../screens/chains/tempo.svg?url","../../../screens/Deposit.tsx","../../../routes/deposit.tsx","../../../components/CodeInput.tsx","../../../screens/DeviceApproval.tsx","../../../routes/device.tsx","../../../components/Input.tsx","../../../screens/SignIn.tsx","../../../routes/login.tsx","../../../routes/[_].flows.tsx","../../../routeTree.gen.ts","../../../router.tsx"],"sourcesContent":["//#region src/link.ts\nconst preloadWarning = \"Error preloading route! ☝️\";\n//#endregion\nexport { preloadWarning };\n\n//# sourceMappingURL=link.js.map","import { _getAssetMatches } from \"../load-client.js\";\n//#region src/ssr/bodyScripts.ts\nfunction getSsrBodyScriptParts(matches, manifest, nonce, routeScriptAttrs) {\n\tconst assetMatches = _getAssetMatches(matches);\n\tconst routeScripts = [];\n\tconst manifestScripts = [];\n\tfor (const match of assetMatches) for (const script of Array.isArray(match.scripts) ? match.scripts : []) {\n\t\tif (!script) continue;\n\t\tconst { children, ...attrs } = script;\n\t\trouteScripts.push({\n\t\t\ttag: \"script\",\n\t\t\tattrs: {\n\t\t\t\t...attrs,\n\t\t\t\t...routeScriptAttrs,\n\t\t\t\tnonce\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t}\n\tif (manifest) for (const match of assetMatches) for (const asset of manifest.routes[match.routeId]?.scripts ?? []) manifestScripts.push({\n\t\ttag: \"script\",\n\t\tattrs: {\n\t\t\t...asset.attrs,\n\t\t\tnonce\n\t\t},\n\t\tchildren: asset.children\n\t});\n\treturn [routeScripts, manifestScripts];\n}\nfunction composeSsrBodyScripts([routeScripts, manifestScripts], initialHydrationScripts) {\n\tif (!initialHydrationScripts) return [...routeScripts, ...manifestScripts];\n\treturn [\n\t\t...initialHydrationScripts.before,\n\t\t...routeScripts,\n\t\t...manifestScripts,\n\t\tinitialHydrationScripts.boundary\n\t];\n}\n//#endregion\nexport { composeSsrBodyScripts, getSsrBodyScriptParts };\n\n//# sourceMappingURL=bodyScripts.js.map","import { invariant } from \"./invariant.js\";\nimport { cleanPath, trimPathLeft, trimPathRight } from \"./path.js\";\nimport { notFound } from \"./not-found.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { redirect } from \"./redirect.js\";\n//#region src/route.ts\nvar BaseRoute = class {\n\tget to() {\n\t\treturn this._to;\n\t}\n\tget id() {\n\t\treturn this._id;\n\t}\n\tget path() {\n\t\treturn this._path;\n\t}\n\tget fullPath() {\n\t\treturn this._fullPath;\n\t}\n\tconstructor(options) {\n\t\tthis.init = (originalIndex) => {\n\t\t\tthis.originalIndex = originalIndex;\n\t\t\tthis._branch = void 0;\n\t\t\tconst options = this.options;\n\t\t\tconst isRoot = !options?.path && !options?.id;\n\t\t\tthis.parentRoute = this.options.getParentRoute?.();\n\t\t\tif (isRoot) this._path = rootRouteId;\n\t\t\telse if (!this.parentRoute) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);\n\t\t\t\tinvariant();\n\t\t\t}\n\t\t\tlet path = isRoot ? rootRouteId : options?.path;\n\t\t\tif (path && path !== \"/\") path = trimPathLeft(path);\n\t\t\tconst customId = options?.id || path;\n\t\t\tconst id = isRoot ? rootRouteId : cleanPath((this.parentRoute.id === \"__root__\" ? \"\" : this.parentRoute.id) + \"/\" + (customId ?? \"\"));\n\t\t\tif (path === \"__root__\") path = \"/\";\n\t\t\tconst fullPath = id === \"__root__\" ? \"/\" : path === void 0 ? this.parentRoute.fullPath : cleanPath(this.parentRoute.fullPath + \"/\" + path);\n\t\t\tthis._path = path;\n\t\t\tthis._id = id;\n\t\t\tthis._fullPath = fullPath;\n\t\t\tthis._to = trimPathRight(fullPath);\n\t\t};\n\t\tthis.addChildren = (children) => {\n\t\t\treturn this._addFileChildren(children);\n\t\t};\n\t\tthis._addFileChildren = (children) => {\n\t\t\tif (Array.isArray(children)) this.children = children;\n\t\t\tif (typeof children === \"object\" && children !== null) this.children = Object.values(children);\n\t\t\treturn this;\n\t\t};\n\t\tthis._addFileTypes = () => {\n\t\t\treturn this;\n\t\t};\n\t\tthis.updateLoader = (options) => {\n\t\t\tObject.assign(this.options, options);\n\t\t\treturn this;\n\t\t};\n\t\tthis.update = (options) => {\n\t\t\tObject.assign(this.options, options);\n\t\t\treturn this;\n\t\t};\n\t\tthis.lazy = (lazyFn) => {\n\t\t\tthis.lazyFn = lazyFn;\n\t\t\treturn this;\n\t\t};\n\t\tthis.redirect = (opts) => redirect({\n\t\t\tfrom: this.fullPath,\n\t\t\t...opts\n\t\t});\n\t\tthis.options = options || {};\n\t\tthis.isRoot = !options?.getParentRoute;\n\t\tif (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`);\n\t}\n};\nvar BaseRouteApi = class {\n\tconstructor({ id }) {\n\t\tthis.notFound = (opts) => {\n\t\t\treturn notFound({\n\t\t\t\trouteId: this.id,\n\t\t\t\t...opts\n\t\t\t});\n\t\t};\n\t\tthis.redirect = (opts) => redirect({\n\t\t\tfrom: this.id,\n\t\t\t...opts\n\t\t});\n\t\tthis.id = id;\n\t}\n};\nvar BaseRootRoute = class extends BaseRoute {\n\tconstructor(options) {\n\t\tsuper(options);\n\t}\n};\n//#endregion\nexport { BaseRootRoute, BaseRoute, BaseRouteApi };\n\n//# sourceMappingURL=route.js.map","import { deepEqual, hasOwn } from \"./utils.js\";\n//#region src/searchMiddleware.ts\n/**\n* Retain specified search params across navigations.\n*\n* If `keys` is `true`, retain all current params. Otherwise, copy only the\n* listed keys from the current search into the next search.\n*\n* @param keys `true` to retain all, or a list of keys to retain.\n* @returns A search middleware suitable for route `search.middlewares`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/retainSearchParamsFunction\n*/\nfunction retainSearchParams(keys) {\n\treturn ({ search, next }) => {\n\t\tconst { search: resultSearch, meta } = next(search, true);\n\t\tif (keys === true) {\n\t\t\tconst copy = {\n\t\t\t\t...search,\n\t\t\t\t...resultSearch\n\t\t\t};\n\t\t\tconst removed = meta.removed;\n\t\t\tconst explicit = meta.explicit;\n\t\t\tfor (const key of removed?.keys() || []) if (explicit && hasOwn.call(explicit, key) || deepEqual(search[key], removed.get(key))) delete copy[key];\n\t\t\tfor (const key of meta.removedAny || []) delete copy[key];\n\t\t\tfor (const key of meta.defaulted?.keys() || []) if (key in search && !meta.removedAny?.has(key) && !(meta.removed?.has(key) && (explicit && hasOwn.call(explicit, key) || deepEqual(search[key], meta.removed.get(key))))) copy[key] = search[key];\n\t\t\treturn copy;\n\t\t}\n\t\tconst copy = { ...resultSearch };\n\t\tconst explicit = meta.explicit;\n\t\tfor (const key of keys) {\n\t\t\tconst stringKey = key;\n\t\t\tif (!(meta.removedAny?.has(stringKey) || meta.removed?.has(stringKey) && (explicit && hasOwn.call(explicit, stringKey) || deepEqual(search[key], meta.removed.get(stringKey)))) && (!(key in copy) || key in search && meta.defaulted?.has(stringKey) && deepEqual(copy[key], meta.defaulted.get(stringKey)))) copy[key] = search[key];\n\t\t}\n\t\treturn copy;\n\t};\n}\n/**\n* Remove optional or default-valued search params from navigations.\n*\n* - Pass `true` (only if there are no required search params) to strip all.\n* - Pass an array to always remove those optional keys.\n* - Pass an object of default values; keys equal (deeply) to the defaults are removed.\n*\n* @returns A search middleware suitable for route `search.middlewares`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/stripSearchParamsFunction\n*/\nfunction stripSearchParams(input) {\n\treturn (({ search, next, meta }) => {\n\t\tif (input === true) {\n\t\t\tObject.keys(search).forEach((key) => {\n\t\t\t\tif (meta) (meta.removedAny ||= /* @__PURE__ */ new Set()).add(key);\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\tconst result = { ...next(search) };\n\t\tif (Array.isArray(input)) input.forEach((key) => {\n\t\t\tdelete result[key];\n\t\t\tif (meta) (meta.removedAny ||= /* @__PURE__ */ new Set()).add(key);\n\t\t});\n\t\telse Object.entries(input).forEach(([key, value]) => {\n\t\t\tif (deepEqual(result[key], value)) {\n\t\t\t\tdelete result[key];\n\t\t\t\tif (meta) (meta.removed ||= /* @__PURE__ */ new Map()).set(key, value);\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t});\n}\n//#endregion\nexport { retainSearchParams, stripSearchParams };\n\n//# sourceMappingURL=searchMiddleware.js.map","//#region src/alien.ts\nconst NONE = 0;\nconst MUTABLE = 1;\nconst WATCHING = 2;\nconst RECURSED_CHECK = 4;\nconst RECURSED = 8;\nconst DIRTY = 16;\nconst PENDING = 32;\n/* @__NO_SIDE_EFFECTS__ */\nfunction createReactiveSystem({ update, notify, unwatched }) {\n\treturn {\n\t\tlink,\n\t\tunlink,\n\t\tpropagate,\n\t\tcheckDirty,\n\t\tshallowPropagate\n\t};\n\tfunction link(dep, sub, version) {\n\t\tconst prevDep = sub.depsTail;\n\t\tif (prevDep !== void 0 && prevDep.dep === dep) return;\n\t\tconst nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n\t\tif (nextDep !== void 0 && nextDep.dep === dep) {\n\t\t\tnextDep.version = version;\n\t\t\tsub.depsTail = nextDep;\n\t\t\treturn;\n\t\t}\n\t\tconst prevSub = dep.subsTail;\n\t\tif (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;\n\t\tconst newLink = sub.depsTail = dep.subsTail = {\n\t\t\tversion,\n\t\t\tdep,\n\t\t\tsub,\n\t\t\tprevDep,\n\t\t\tnextDep,\n\t\t\tprevSub,\n\t\t\tnextSub: void 0\n\t\t};\n\t\tif (nextDep !== void 0) nextDep.prevDep = newLink;\n\t\tif (prevDep !== void 0) prevDep.nextDep = newLink;\n\t\telse sub.deps = newLink;\n\t\tif (prevSub !== void 0) prevSub.nextSub = newLink;\n\t\telse dep.subs = newLink;\n\t}\n\tfunction unlink(link, sub = link.sub) {\n\t\tconst dep = link.dep;\n\t\tconst prevDep = link.prevDep;\n\t\tconst nextDep = link.nextDep;\n\t\tconst nextSub = link.nextSub;\n\t\tconst prevSub = link.prevSub;\n\t\tif (nextDep !== void 0) nextDep.prevDep = prevDep;\n\t\telse sub.depsTail = prevDep;\n\t\tif (prevDep !== void 0) prevDep.nextDep = nextDep;\n\t\telse sub.deps = nextDep;\n\t\tif (nextSub !== void 0) nextSub.prevSub = prevSub;\n\t\telse dep.subsTail = prevSub;\n\t\tif (prevSub !== void 0) prevSub.nextSub = nextSub;\n\t\telse if ((dep.subs = nextSub) === void 0) unwatched(dep);\n\t\treturn nextDep;\n\t}\n\tfunction propagate(link) {\n\t\tlet next = link.nextSub;\n\t\tlet stack;\n\t\ttop: do {\n\t\t\tconst sub = link.sub;\n\t\t\tlet flags = sub.flags;\n\t\t\tif (!(flags & 60)) sub.flags = flags | 32;\n\t\t\telse if (!(flags & (4 | 8))) flags = 0;\n\t\t\telse if (!(flags & 4)) sub.flags = flags & ~8 | 32;\n\t\t\telse if (!(flags & (16 | 32)) && isValidLink(link, sub)) {\n\t\t\t\tsub.flags = flags | (8 | 32);\n\t\t\t\tflags &= 1;\n\t\t\t} else flags = 0;\n\t\t\tif (flags & 2) notify(sub);\n\t\t\tif (flags & 1) {\n\t\t\t\tconst subSubs = sub.subs;\n\t\t\t\tif (subSubs !== void 0) {\n\t\t\t\t\tconst nextSub = (link = subSubs).nextSub;\n\t\t\t\t\tif (nextSub !== void 0) {\n\t\t\t\t\t\tstack = {\n\t\t\t\t\t\t\tvalue: next,\n\t\t\t\t\t\t\tprev: stack\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnext = nextSub;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((link = next) !== void 0) {\n\t\t\t\tnext = link.nextSub;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twhile (stack !== void 0) {\n\t\t\t\tlink = stack.value;\n\t\t\t\tstack = stack.prev;\n\t\t\t\tif (link !== void 0) {\n\t\t\t\t\tnext = link.nextSub;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t} while (true);\n\t}\n\tfunction checkDirty(link, sub) {\n\t\tlet stack;\n\t\tlet checkDepth = 0;\n\t\tlet dirty = false;\n\t\ttop: do {\n\t\t\tconst dep = link.dep;\n\t\t\tconst flags = dep.flags;\n\t\t\tif (sub.flags & 16) dirty = true;\n\t\t\telse if ((flags & (1 | 16)) === (1 | 16)) {\n\t\t\t\tif (update(dep)) {\n\t\t\t\t\tconst subs = dep.subs;\n\t\t\t\t\tif (subs.nextSub !== void 0) shallowPropagate(subs);\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t} else if ((flags & (1 | 32)) === (1 | 32)) {\n\t\t\t\tif (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {\n\t\t\t\t\tvalue: link,\n\t\t\t\t\tprev: stack\n\t\t\t\t};\n\t\t\t\tlink = dep.deps;\n\t\t\t\tsub = dep;\n\t\t\t\t++checkDepth;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!dirty) {\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (checkDepth--) {\n\t\t\t\tconst firstSub = sub.subs;\n\t\t\t\tconst hasMultipleSubs = firstSub.nextSub !== void 0;\n\t\t\t\tif (hasMultipleSubs) {\n\t\t\t\t\tlink = stack.value;\n\t\t\t\t\tstack = stack.prev;\n\t\t\t\t} else link = firstSub;\n\t\t\t\tif (dirty) {\n\t\t\t\t\tif (update(sub)) {\n\t\t\t\t\t\tif (hasMultipleSubs) shallowPropagate(firstSub);\n\t\t\t\t\t\tsub = link.sub;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdirty = false;\n\t\t\t\t} else sub.flags &= ~32;\n\t\t\t\tsub = link.sub;\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dirty;\n\t\t} while (true);\n\t}\n\tfunction shallowPropagate(link) {\n\t\tdo {\n\t\t\tconst sub = link.sub;\n\t\t\tconst flags = sub.flags;\n\t\t\tif ((flags & (32 | 16)) === 32) {\n\t\t\t\tsub.flags = flags | 16;\n\t\t\t\tif ((flags & (2 | 4)) === 2) notify(sub);\n\t\t\t}\n\t\t} while ((link = link.nextSub) !== void 0);\n\t}\n\tfunction isValidLink(checkLink, sub) {\n\t\tlet link = sub.depsTail;\n\t\twhile (link !== void 0) {\n\t\t\tif (link === checkLink) return true;\n\t\t\tlink = link.prevDep;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n//#endregion\nexport { createReactiveSystem };\n//# sourceMappingURL=alien.js.map","import { createReactiveSystem } from \"./alien.js\";\n\n//#region src/atom.ts\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n\tconst isObserver = typeof nextHandler === \"object\";\n\tconst self = isObserver ? nextHandler : void 0;\n\treturn {\n\t\tnext: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n\t\terror: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n\t\tcomplete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n\t};\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({\n\tupdate(atom) {\n\t\treturn atom._update();\n\t},\n\tnotify(effect) {\n\t\tqueuedEffects[queuedEffectsLength++] = effect;\n\t\teffect.flags &= ~2;\n\t},\n\tunwatched(atom) {\n\t\tif (atom.depsTail !== void 0) {\n\t\t\tatom.depsTail = void 0;\n\t\t\tatom.flags = 1 | 16;\n\t\t\tpurgeDeps(atom);\n\t\t}\n\t}\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n\ttry {\n\t\t++batchDepth;\n\t\tfn();\n\t} finally {\n\t\tif (!--batchDepth) flush();\n\t}\n}\nfunction purgeDeps(sub) {\n\tconst depsTail = sub.depsTail;\n\tlet dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n\twhile (dep !== void 0) dep = unlink(dep, sub);\n}\nfunction flush() {\n\tif (batchDepth > 0) return;\n\twhile (notifyIndex < queuedEffectsLength) {\n\t\tconst effect = queuedEffects[notifyIndex];\n\t\tqueuedEffects[notifyIndex++] = void 0;\n\t\teffect.notify();\n\t}\n\tnotifyIndex = 0;\n\tqueuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n\tconst ref = {};\n\tconst atom = createAtom(() => {\n\t\tgetValue().then((data) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"done\",\n\t\t\t\tdata\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { status: \"pending\" };\n\t}, options);\n\tref.current = atom;\n\treturn atom;\n}\nfunction createAtom(valueOrFn, options) {\n\tconst isComputed = typeof valueOrFn === \"function\";\n\tconst getter = valueOrFn;\n\tconst atom = {\n\t\t_snapshot: isComputed ? void 0 : valueOrFn,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tflags: isComputed ? 0 : 1,\n\t\tget() {\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t},\n\t\tsubscribe(observerOrFn) {\n\t\t\tconst obs = toObserver(observerOrFn);\n\t\t\tconst observed = { current: false };\n\t\t\tconst e = effect(() => {\n\t\t\t\tatom.get();\n\t\t\t\tif (!observed.current) observed.current = true;\n\t\t\t\telse {\n\t\t\t\t\tactiveSub = void 0;\n\t\t\t\t\tobs.next?.(atom._snapshot);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn { unsubscribe: () => {\n\t\t\t\te.stop();\n\t\t\t} };\n\t\t},\n\t\t_update(getValue) {\n\t\t\tconst prevSub = activeSub;\n\t\t\tconst compare = options?.compare ?? Object.is;\n\t\t\tif (isComputed) {\n\t\t\t\tactiveSub = atom;\n\t\t\t\t++cycle;\n\t\t\t\tatom.depsTail = void 0;\n\t\t\t} else if (getValue === void 0) return false;\n\t\t\tif (isComputed) atom.flags = 1 | 4;\n\t\t\ttry {\n\t\t\t\tconst oldValue = atom._snapshot;\n\t\t\t\tconst newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n\t\t\t\tif (oldValue === void 0 || !compare(oldValue, newValue)) {\n\t\t\t\t\tatom._snapshot = newValue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tactiveSub = prevSub;\n\t\t\t\tif (isComputed) atom.flags &= ~4;\n\t\t\t\tpurgeDeps(atom);\n\t\t\t}\n\t\t}\n\t};\n\tif (isComputed) {\n\t\tatom.flags = 1 | 16;\n\t\tatom.get = function() {\n\t\t\tconst flags = atom.flags;\n\t\t\tif (flags & 16 || flags & 32 && checkDirty(atom.deps, atom)) {\n\t\t\t\tif (atom._update()) {\n\t\t\t\t\tconst subs = atom.subs;\n\t\t\t\t\tif (subs !== void 0) shallowPropagate(subs);\n\t\t\t\t}\n\t\t\t} else if (flags & 32) atom.flags = flags & ~32;\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t};\n\t} else atom.set = function(valueOrFn) {\n\t\tif (atom._update(valueOrFn)) {\n\t\t\tconst subs = atom.subs;\n\t\t\tif (subs !== void 0) {\n\t\t\t\tpropagate(subs);\n\t\t\t\tshallowPropagate(subs);\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\t};\n\treturn atom;\n}\nfunction effect(fn) {\n\tconst run = () => {\n\t\tconst prevSub = activeSub;\n\t\tactiveSub = effectObj;\n\t\t++cycle;\n\t\teffectObj.depsTail = void 0;\n\t\teffectObj.flags = 2 | 4;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tactiveSub = prevSub;\n\t\t\teffectObj.flags &= ~4;\n\t\t\tpurgeDeps(effectObj);\n\t\t}\n\t};\n\tconst effectObj = {\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tflags: 2 | 4,\n\t\tnotify() {\n\t\t\tconst flags = this.flags;\n\t\t\tif (flags & 16 || flags & 32 && checkDirty(this.deps, this)) run();\n\t\t\telse this.flags = 2;\n\t\t},\n\t\tstop() {\n\t\t\tthis.flags = 0;\n\t\t\tthis.depsTail = void 0;\n\t\t\tpurgeDeps(this);\n\t\t}\n\t};\n\trun();\n\treturn effectObj;\n}\n\n//#endregion\nexport { batch, createAsyncAtom, createAtom, flush, toObserver };\n//# sourceMappingURL=atom.js.map","\"use client\";\nimport { dummyMatchContext, matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { invariant, replaceEqualDeep } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/useMatch.tsx\nvar dummyMatch = {};\nfunction useStructuralSharing(opts, router) {\n\tconst previousResult = React$1.useRef();\n\treturn (slice) => {\n\t\tconst selected = opts?.select ? opts.select(slice) : slice;\n\t\tif (opts?.structuralSharing ?? router.options.defaultStructuralSharing) return previousResult.current = replaceEqualDeep(previousResult.current, selected);\n\t\treturn selected;\n\t};\n}\n/**\n* Read and select the nearest or targeted route match.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook\n*/\nfunction useMatch(opts) {\n\tconst router = useRouter();\n\tconst nearestRouteId = React$1.useContext(opts.from ? dummyMatchContext : matchContext);\n\tconst routeId = opts.from ?? nearestRouteId;\n\tconst matchStore = router.stores.getMatchStore(routeId);\n\tif (isServer ?? router.isServer) {\n\t\tconst match = matchStore.get();\n\t\tif (!match) {\n\t\t\tif (opts.shouldThrow ?? true) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : \"a nearest match!\"}`);\n\t\t\t\tinvariant();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\treturn opts.select ? opts.select(match) : match;\n\t}\n\tconst selector = useStructuralSharing(opts, router);\n\tconst matchSelection = useSelector(matchStore, (match) => match ? selector(match) : dummyMatch);\n\tif (matchSelection !== dummyMatch) return matchSelection;\n\tif (opts.shouldThrow ?? true) {\n\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : \"a nearest match!\"}`);\n\t\tinvariant();\n\t}\n}\n//#endregion\nexport { useMatch, useStructuralSharing };\n\n//# sourceMappingURL=useMatch.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useLoaderData.tsx\n/**\n* Read and select the current route's loader data with type‑safety.\n*\n* Options:\n* - `from`/`strict`: Choose which route's data to read and strictness\n* - `select`: Map the loader data to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The loader data (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook\n*/\nfunction useLoaderData(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tstrict: opts.strict,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tselect: (match) => {\n\t\t\treturn opts.select ? opts.select(match.loaderData) : match.loaderData;\n\t\t}\n\t});\n}\n//#endregion\nexport { useLoaderData };\n\n//# sourceMappingURL=useLoaderData.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useLoaderDeps.tsx\n/**\n* Read and select the current route's loader dependencies object.\n*\n* Options:\n* - `from`: Choose which route's loader deps to read\n* - `select`: Map the deps to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The loader deps (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook\n*/\nfunction useLoaderDeps(opts) {\n\tconst { select, ...rest } = opts;\n\treturn useMatch({\n\t\t...rest,\n\t\tselect: (match) => {\n\t\t\treturn select ? select(match.loaderDeps) : match.loaderDeps;\n\t\t}\n\t});\n}\n//#endregion\nexport { useLoaderDeps };\n\n//# sourceMappingURL=useLoaderDeps.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useParams.tsx\n/**\n* Access the current route's path parameters with type-safety.\n*\n* Options:\n* - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n* - `select`: Project the params object to a derived value for memoized renders\n* - `structuralSharing`: Enable structural sharing for stable references\n* - `shouldThrow`: Throw if the route is not found in strict contexts\n*\n* @returns The params object (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n*/\nfunction useParams(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tshouldThrow: opts.shouldThrow,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tstrict: opts.strict,\n\t\tselect: (match) => {\n\t\t\tconst params = opts.strict === false ? match.params : match._strictParams;\n\t\t\treturn opts.select ? opts.select(params) : params;\n\t\t}\n\t});\n}\n//#endregion\nexport { useParams };\n\n//# sourceMappingURL=useParams.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useSearch.tsx\n/**\n* Read and select the current route's search parameters with type-safety.\n*\n* Options:\n* - `from`/`strict`: Control which route's search is read and how strictly it's typed\n* - `select`: Map the search object to a derived value for render optimization\n* - `structuralSharing`: Enable structural sharing for stable references\n* - `shouldThrow`: Throw when the route is not found (strict contexts)\n*\n* @returns The search object (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n*/\nfunction useSearch(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tstrict: opts.strict,\n\t\tshouldThrow: opts.shouldThrow,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tselect: (match) => {\n\t\t\treturn opts.select ? opts.select(match.search) : match.search;\n\t\t}\n\t});\n}\n//#endregion\nexport { useSearch };\n\n//# sourceMappingURL=useSearch.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport * as React$1 from \"react\";\n//#region src/useNavigate.tsx\n/**\n* Imperative navigation hook.\n*\n* Returns a stable `navigate(options)` function to change the current location\n* programmatically. Prefer the `Link` component for user-initiated navigation,\n* and use this hook from effects, callbacks, or handlers where imperative\n* navigation is required.\n*\n* Options:\n* - `from`: Optional route base used to resolve relative `to` paths.\n*\n* @returns A function that accepts `NavigateOptions`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook\n*/\nfunction useNavigate(_defaultOpts) {\n\tconst router = useRouter();\n\treturn React$1.useCallback((options) => {\n\t\treturn router.navigate({\n\t\t\t...options,\n\t\t\tfrom: options.from ?? _defaultOpts?.from\n\t\t});\n\t}, [_defaultOpts?.from, router]);\n}\n/**\n* Component that triggers a navigation when rendered. Navigation executes\n* in an effect after mount/update.\n*\n* Props are the same as `NavigateOptions` used by `navigate()`.\n*\n* @returns null\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent\n*/\nfunction Navigate(props) {\n\tconst router = useRouter();\n\tconst navigate = useNavigate();\n\tconst previousPropsRef = React$1.useRef(null);\n\tuseLayoutEffect(() => {\n\t\tif (previousPropsRef.current !== props) {\n\t\t\tnavigate(props);\n\t\t\tpreviousPropsRef.current = props;\n\t\t}\n\t}, [\n\t\trouter,\n\t\tprops,\n\t\tnavigate\n\t]);\n\treturn null;\n}\n//#endregion\nexport { Navigate, useNavigate };\n\n//# sourceMappingURL=useNavigate.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useRouteContext.ts\nfunction useRouteContext(opts) {\n\treturn useMatch({\n\t\t...opts,\n\t\tselect: (match) => opts.select ? opts.select(match.context) : match.context\n\t});\n}\n//#endregion\nexport { useRouteContext };\n\n//# sourceMappingURL=useRouteContext.js.map","\"use client\";\nimport { useHydrated } from \"./ClientOnly.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { deepEqual, functionalUpdate, getUrlScheme, isDangerousProtocol, preloadWarning, removeTrailingSlash } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/link.tsx\nfunction useStableValues(...values) {\n\tconst ref = React$1.useRef(values);\n\tconst stable = ref.current;\n\tvalues.forEach((value, index) => {\n\t\tif (!deepEqual(stable[index], value, false, true)) stable[index] = value;\n\t});\n\treturn ref.current;\n}\nfunction preloadLink(router, options) {\n\trouter.preloadRoute(options).catch((err) => {\n\t\tconsole.warn(err);\n\t\tconsole.warn(preloadWarning);\n\t});\n}\nvar LINK_SELECTOR_OPTIONS = { compare: (a, b) => a[0] === b[0] && a[1] === b[1] };\nfunction resolveExternalLink(to, protocolAllowlist) {\n\tconst scheme = typeof to === \"string\" && getUrlScheme(to);\n\tif (!scheme) return;\n\tif (!protocolAllowlist.has(scheme)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\treturn null;\n\t}\n\treturn to;\n}\nfunction resolveIsActive(location, next, activeOptions, basepath, isHydrated) {\n\tconst currentPath = removeTrailingSlash(location.pathname, basepath);\n\tconst nextPath = removeTrailingSlash(next.pathname, basepath);\n\tif (activeOptions?.exact ? currentPath !== nextPath : !(currentPath.startsWith(nextPath) && (currentPath.length === nextPath.length || currentPath[nextPath.length] === \"/\"))) return false;\n\tif (activeOptions?.includeSearch ?? true) {\n\t\tif (!deepEqual(location.search, next.search, !activeOptions?.exact, activeOptions?.explicitUndefined)) return false;\n\t}\n\tif (activeOptions?.includeHash) return isHydrated && location.hash === next.hash;\n\treturn true;\n}\nfunction useLinkProps(options, forwardedRef, host) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) return getServerLinkProps(router, options, forwardedRef, host);\n\tconst innerRef = React$1.useRef(null);\n\tconst mergedRef = React$1.useCallback((element) => {\n\t\tinnerRef.current = element;\n\t\tif (typeof forwardedRef === \"function\") return forwardedRef(element);\n\t\tif (forwardedRef) forwardedRef.current = element;\n\t}, [forwardedRef]);\n\tconst { activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, hashScrollIntoView, replace, startTransition, resetScroll, viewTransition, ignoreBlocker, disabled, target, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart } = options;\n\tconst isHydrated = useHydrated(!!activeOptions?.includeHash);\n\tconst [stableSearch, stableParams, stableActiveOptions] = useStableValues(options.search, options.params, activeOptions);\n\tconst [_options, dest] = React$1.useMemo(() => [options, { ...options }], [\n\t\trouter,\n\t\toptions.from,\n\t\toptions._fromLocation,\n\t\toptions.hash,\n\t\toptions.to,\n\t\tstableSearch,\n\t\tstableParams,\n\t\toptions.state,\n\t\toptions.mask,\n\t\toptions.unsafeRelative\n\t]);\n\tconst selectLinkState = React$1.useMemo(() => {\n\t\tconst directExternalLink = resolveExternalLink(to, router.protocolAllowlist);\n\t\tif (directExternalLink !== void 0) {\n\t\t\tconst state = [directExternalLink ?? void 0];\n\t\t\treturn () => state;\n\t\t}\n\t\tlet inactive;\n\t\tlet active;\n\t\treturn (location) => {\n\t\t\tif (!_options._fromLocation) dest._fromLocation = location;\n\t\t\tconst next = router.buildLocation(dest);\n\t\t\tconst href = getHrefOption(next, router, disabled);\n\t\t\tif (!inactive || inactive[0] !== href) {\n\t\t\t\tinactive = [href, !(disabled || href && !getUrlScheme(href)) && void 0];\n\t\t\t\tactive = [href, true];\n\t\t\t}\n\t\t\treturn inactive[1] !== void 0 && resolveIsActive(location, next, stableActiveOptions, router.basepath, isHydrated) ? active : inactive;\n\t\t};\n\t}, [\n\t\tstableActiveOptions,\n\t\tdisabled,\n\t\tisHydrated,\n\t\t_options,\n\t\tdest,\n\t\trouter,\n\t\tto\n\t]);\n\tconst [href, isActive] = useSelector(router.stores.location, selectLinkState, LINK_SELECTOR_OPTIONS);\n\tconst externalLink = isActive === void 0 && href;\n\tconst linkDisabled = disabled || href === void 0;\n\tconst hasRenderFetched = React$1.useRef(false);\n\tconst preload = options.reloadDocument || externalLink || linkDisabled ? false : userPreload ?? router.options.defaultPreload;\n\tconst preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;\n\tconst enqueuePreload = React$1.useCallback((e) => {\n\t\tconst isIntersecting = e?.isIntersecting;\n\t\tif (!(isIntersecting ?? preload === \"intent\")) {\n\t\t\tif (isIntersecting === false) cancelPreload(innerRef);\n\t\t\treturn;\n\t\t}\n\t\tif (!preloadDelay) {\n\t\t\tpreloadLink(router, _options);\n\t\t\treturn;\n\t\t}\n\t\tif (timeoutMap.has(innerRef)) return;\n\t\ttimeoutMap.set(innerRef, setTimeout(() => {\n\t\t\ttimeoutMap.delete(innerRef);\n\t\t\tpreloadLink(router, _options);\n\t\t}, preloadDelay));\n\t}, [\n\t\trouter,\n\t\t_options,\n\t\tinnerRef,\n\t\tpreload,\n\t\tpreloadDelay\n\t]);\n\tReact$1.useEffect(() => {\n\t\tif (!preload) return;\n\t\tif (preload === \"render\" && !hasRenderFetched.current) {\n\t\t\thasRenderFetched.current = true;\n\t\t\tpreloadLink(router, _options);\n\t\t}\n\t\tlet active = true;\n\t\tlet observer;\n\t\tif (preload === \"viewport\" && innerRef.current && typeof IntersectionObserver === \"function\") {\n\t\t\tobserver = new IntersectionObserver((entries) => {\n\t\t\t\tif (active) enqueuePreload(entries.pop());\n\t\t\t}, { rootMargin: \"100px\" });\n\t\t\tobserver.observe(innerRef.current);\n\t\t}\n\t\treturn () => {\n\t\t\tactive = false;\n\t\t\tobserver?.disconnect();\n\t\t\tcancelPreload(innerRef);\n\t\t};\n\t}, [\n\t\trouter,\n\t\t_options,\n\t\tpreload,\n\t\tenqueuePreload,\n\t\tinnerRef\n\t]);\n\tconst props = collectElementProps(options, host);\n\tprops.ref = forwardedRef ? mergedRef : innerRef;\n\tif (externalLink) {\n\t\tprops.href = externalLink;\n\t\treturn props;\n\t}\n\tconst handleClick = (e) => {\n\t\tconst effectiveTarget = target ?? e.currentTarget.getAttribute(\"target\");\n\t\tif (!linkDisabled && !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === \"_self\") && e.button === 0) {\n\t\t\te.preventDefault();\n\t\t\trouter.navigate({\n\t\t\t\t..._options,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tstartTransition,\n\t\t\t\tviewTransition,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t}\n\t};\n\tconst handleTouchStart = () => {\n\t\tif (preload === \"intent\") preloadLink(router, _options);\n\t};\n\tconst handleLeave = () => {\n\t\tif (preload === \"intent\") cancelPreload(innerRef);\n\t};\n\tprops.onClick = composeHandlers(onClick, handleClick);\n\tprops.onBlur = composeHandlers(onBlur, handleLeave);\n\tprops.onFocus = composeHandlers(onFocus, enqueuePreload);\n\tprops.onMouseEnter = composeHandlers(onMouseEnter, enqueuePreload);\n\tprops.onMouseLeave = composeHandlers(onMouseLeave, handleLeave);\n\tprops.onTouchStart = composeHandlers(onTouchStart, handleTouchStart);\n\treturn applyLinkState(props, options, isActive, href, linkDisabled, host);\n}\nvar STATIC_EMPTY_OBJECT = {};\nvar STATIC_ACTIVE_OBJECT = { className: \"active\" };\nvar ROUTER_OPTION_KEYS = /* @__PURE__ */ new Set([\n\t\"to\",\n\t\"params\",\n\t\"search\",\n\t\"hash\",\n\t\"state\",\n\t\"mask\",\n\t\"from\",\n\t\"unsafeRelative\",\n\t\"_fromLocation\",\n\t\"reloadDocument\",\n\t\"preload\",\n\t\"preloadDelay\",\n\t\"preloadIntentProximity\",\n\t\"hashScrollIntoView\",\n\t\"replace\",\n\t\"startTransition\",\n\t\"resetScroll\",\n\t\"viewTransition\",\n\t\"ignoreBlocker\",\n\t\"activeProps\",\n\t\"inactiveProps\",\n\t\"activeOptions\",\n\t\"_asChild\"\n]);\nfunction collectElementProps(options, host) {\n\tconst props = {};\n\tfor (const key in options) {\n\t\tif (ROUTER_OPTION_KEYS.has(key) || key === \"type\" && host !== void 0 || key === \"disabled\" && host === \"a\") continue;\n\t\tprops[key] = options[key];\n\t}\n\treturn props;\n}\nfunction applyLinkState(props, options, isActive, href, linkDisabled, host) {\n\tconst { activeProps, inactiveProps, className, style, target } = options;\n\tconst stateProps = functionalUpdate(isActive ? activeProps : inactiveProps, {}) ?? (isActive ? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT);\n\tObject.assign(props, stateProps);\n\tprops.href = href;\n\tif (host !== \"a\") props.disabled = linkDisabled;\n\tprops.target = target;\n\tconst stateStyle = stateProps.style;\n\tif (style || stateStyle) props.style = style && stateStyle ? {\n\t\t...style,\n\t\t...stateStyle\n\t} : style || stateStyle;\n\tconst stateClassName = stateProps.className;\n\tif (className || stateClassName) props.className = className ? stateClassName ? `${className} ${stateClassName}` : className : stateClassName;\n\tif (linkDisabled) {\n\t\tprops.role = \"link\";\n\t\tprops[\"aria-disabled\"] = true;\n\t}\n\tif (isActive) {\n\t\tprops[\"data-status\"] = \"active\";\n\t\tprops[\"aria-current\"] = \"page\";\n\t}\n\treturn props;\n}\nfunction getServerLinkProps(router, options, forwardedRef, host) {\n\tconst { to, disabled, activeOptions } = options;\n\tconst directExternalLink = resolveExternalLink(to, router.protocolAllowlist);\n\tconst next = directExternalLink === void 0 ? router.buildLocation(options) : void 0;\n\tconst hrefOption = next ? getHrefOption(next, router, disabled) : directExternalLink ?? void 0;\n\tconst linkDisabled = disabled || !hrefOption;\n\tconst externalLink = directExternalLink ?? (hrefOption && getUrlScheme(hrefOption) ? hrefOption : void 0);\n\tconst props = collectElementProps(options, host);\n\tprops.ref = forwardedRef;\n\tif (externalLink) {\n\t\tprops.href = externalLink;\n\t\treturn props;\n\t}\n\treturn applyLinkState(props, options, !!next && !(!disabled && !hrefOption) && resolveIsActive(router.stores.location.get(), next, activeOptions, router.basepath, false), hrefOption, linkDisabled, host);\n}\nvar timeoutMap = /* @__PURE__ */ new WeakMap();\nvar cancelPreload = (eventTarget) => {\n\tclearTimeout(timeoutMap.get(eventTarget));\n\ttimeoutMap.delete(eventTarget);\n};\nvar composeHandlers = (first, second) => {\n\tif (!first) return second;\n\treturn (event) => event.defaultPrevented || (first(event), event.defaultPrevented || second(event));\n};\nfunction getHrefOption(next, router, disabled) {\n\tif (disabled) return;\n\tconst location = next.maskedLocation ?? next;\n\tconst href = location.external ? location.publicHref : router.history.createHref(location.publicHref) || \"/\";\n\tif ((location.external || href !== location.publicHref) && isDangerousProtocol(href, router.protocolAllowlist)) {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${href}`);\n\t\treturn;\n\t}\n\treturn href;\n}\n/**\n* Creates a typed Link-like component that preserves TanStack Router's\n* navigation semantics and type-safety while delegating rendering to the\n* provided host component.\n*\n* Useful for integrating design system anchors/buttons while keeping\n* router-aware props (eg. `to`, `params`, `search`, `preload`).\n*\n* @param Comp The host component to render (eg. a design-system Link/Button)\n* @returns A router-aware component with the same API as `Link`.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n*/\nfunction createLink(Comp) {\n\treturn React$1.forwardRef(function CreatedLink(props, ref) {\n\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t...props,\n\t\t\t_asChild: Comp,\n\t\t\tref\n\t\t});\n\t});\n}\n/**\n* A strongly-typed anchor component for declarative navigation.\n* Handles path, search, hash and state updates with optional route preloading\n* and active-state styling.\n*\n* Props:\n* - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n* - `preloadDelay`: Delay in ms before preloading on focus, hover, or viewport entry\n* - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n* - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n* - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n* - `ignoreBlocker`: Bypass registered blockers\n*\n* @returns An anchor-like element that navigates without full page reloads.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n*/\nvar Link = React$1.memo(React$1.forwardRef((props, ref) => {\n\tconst host = props._asChild || \"a\";\n\tconst linkProps = useLinkProps(props, ref, host);\n\tconst children = typeof props.children === \"function\" ? props.children({ isActive: linkProps[\"data-status\"] === \"active\" }) : props.children;\n\treturn React$1.createElement(host, linkProps, children);\n}), areLinkPropsEqual);\nfunction areLinkPropsEqual(prev, next) {\n\tlet extraKeys = 0;\n\tfor (const key in next) {\n\t\textraKeys++;\n\t\tif (prev[key] === next[key]) continue;\n\t\tif (!ROUTER_OPTION_KEYS.has(key) || !deepEqual(prev[key], next[key], false, true)) return false;\n\t}\n\tfor (const _key in prev) extraKeys--;\n\treturn extraKeys === 0;\n}\n/**\n* Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n* Accepts a literal options object and returns it typed for later spreading.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\nvar linkOptions = (options) => {\n\treturn options;\n};\n/**\n* Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n* Use to validate and reuse navigation options across your app.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\n//#endregion\nexport { Link, createLink, linkOptions, useLinkProps };\n\n//# sourceMappingURL=link.js.map","import { useRouter } from \"./useRouter.js\";\nimport { useMatch } from \"./useMatch.js\";\nimport { useLoaderData } from \"./useLoaderData.js\";\nimport { useLoaderDeps } from \"./useLoaderDeps.js\";\nimport { useParams } from \"./useParams.js\";\nimport { useSearch } from \"./useSearch.js\";\nimport { useNavigate } from \"./useNavigate.js\";\nimport { useRouteContext } from \"./useRouteContext.js\";\nimport { Link } from \"./link.js\";\nimport { BaseRootRoute, BaseRoute, BaseRouteApi, notFound } from \"@tanstack/router-core\";\nimport React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/route.tsx\n/**\n* Returns a route-specific API that exposes type-safe hooks pre-bound\n* to a single route ID. Useful for consuming a route's APIs from files\n* where the route object isn't directly imported (e.g. code-split files).\n*\n* @param id Route ID string literal for the target route.\n* @returns A `RouteApi` instance bound to the given route ID.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction\n*/\nfunction getRouteApi(id) {\n\treturn new RouteApi({ id });\n}\nvar RouteApi = class extends BaseRouteApi {\n\t/**\n\t* @deprecated Use the `getRouteApi` function instead.\n\t*/\n\tconstructor({ id }) {\n\t\tsuper({ id });\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstrict: false\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstrict: false\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: useRouter().routesById[this.id].fullPath });\n\t\t};\n\t\tthis.notFound = (opts) => {\n\t\t\treturn notFound({\n\t\t\t\trouteId: this.id,\n\t\t\t\t...opts\n\t\t\t});\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\tconst fullPath = useRouter().routesById[this.id].fullPath;\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\nvar Route = class extends BaseRoute {\n\t/**\n\t* @deprecated Use the `createRoute` function instead.\n\t*/\n\tconstructor(options) {\n\t\tsuper(options);\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: this.fullPath });\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: this.fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\n/**\n* Creates a non-root Route instance for code-based routing.\n*\n* Use this to define a route that will be composed into a route tree\n* (typically via a parent route's `addChildren`). If you're using file-based\n* routing, prefer `createFileRoute`.\n*\n* @param options Route options (path, component, loader, context, etc.).\n* @returns A Route instance to be attached to the route tree.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction\n*/\nfunction createRoute(options) {\n\treturn new Route(options);\n}\n/**\n* Creates a root route factory that requires a router context type.\n*\n* Use when your root route expects `context` to be provided to `createRouter`.\n* The returned function behaves like `createRootRoute` but enforces a context type.\n*\n* @returns A factory function to configure and return a root route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction\n*/\nfunction createRootRouteWithContext() {\n\treturn (options) => {\n\t\treturn createRootRoute(options);\n\t};\n}\n/**\n* @deprecated Use the `createRootRouteWithContext` function instead.\n*/\nvar rootRouteWithContext = createRootRouteWithContext;\nvar RootRoute = class extends BaseRootRoute {\n\t/**\n\t* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n\t*/\n\tconstructor(options) {\n\t\tsuper(options);\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: this.fullPath });\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: this.fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\n/**\n* Creates a root Route instance used to build your route tree.\n*\n* Typically paired with `createRouter({ routeTree })`. If you need to require\n* a typed router context, use `createRootRouteWithContext` instead.\n*\n* @param options Root route options (component, error, pending, etc.).\n* @returns A root route instance.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction\n*/\nfunction createRootRoute(options) {\n\treturn new RootRoute(options);\n}\nfunction createRouteMask(opts) {\n\treturn opts;\n}\nvar NotFoundRoute = class extends Route {\n\tconstructor(options) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tid: \"404\"\n\t\t});\n\t}\n};\n//#endregion\nexport { NotFoundRoute, RootRoute, Route, RouteApi, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, getRouteApi, rootRouteWithContext };\n\n//# sourceMappingURL=route.js.map","import { useRouter } from \"./useRouter.js\";\nimport { useMatch } from \"./useMatch.js\";\nimport { useLoaderData } from \"./useLoaderData.js\";\nimport { useLoaderDeps } from \"./useLoaderDeps.js\";\nimport { useParams } from \"./useParams.js\";\nimport { useSearch } from \"./useSearch.js\";\nimport { useNavigate } from \"./useNavigate.js\";\nimport { useRouteContext } from \"./useRouteContext.js\";\nimport { createRoute } from \"./route.js\";\n//#region src/fileRoute.ts\n/**\n* Creates a file-based Route factory for a given path.\n*\n* Used by TanStack Router's file-based routing to associate a file with a\n* route. The returned function accepts standard route options. In normal usage\n* the `path` string is inserted and maintained by the `tsr` generator.\n*\n* @param path File path literal for the route (usually auto-generated).\n* @returns A function that accepts Route options and returns a Route instance.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction\n*/\nfunction createFileRoute(path) {\n\treturn (options) => {\n\t\tconst route = createRoute(options);\n\t\troute.isRoot = false;\n\t\treturn route;\n\t};\n}\n/** \n@deprecated It's no longer recommended to use the `FileRoute` class directly.\nInstead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\nvar FileRoute = class {\n\tconstructor(path, _opts) {\n\t\tthis.path = path;\n\t\tthis.createRoute = (options) => {\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tif (!this.silent) console.warn(\"Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.\");\n\t\t\t}\n\t\t\tconst route = createRoute(options);\n\t\t\troute.isRoot = false;\n\t\t\treturn route;\n\t\t};\n\t\tthis.silent = _opts?.silent;\n\t}\n};\n/**\n@deprecated It's recommended not to split loaders into separate files.\nInstead, place the loader function in the main route file via `createFileRoute`.\n*/\nfunction FileRouteLoader(_path) {\n\tif (process.env.NODE_ENV !== \"production\") console.warn(`Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the main route file, inside the \\`createFileRoute('/path/to/file')(options)\\` options`);\n\treturn (loaderFn) => loaderFn;\n}\nvar LazyRoute = class {\n\tconstructor(opts) {\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.options.id\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: useRouter().routesById[this.options.id].fullPath });\n\t\t};\n\t\tthis.options = opts;\n\t}\n};\n/**\n* Creates a lazily-configurable code-based route stub by ID.\n*\n* Use this for code-splitting with code-based routes. The returned function\n* accepts only non-critical route options like `component`, `pendingComponent`,\n* `errorComponent`, and `notFoundComponent` which are applied when the route\n* is matched.\n*\n* @param id Route ID string literal to associate with the lazy route.\n* @returns A function that accepts lazy route options and returns a `LazyRoute`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction\n*/\nfunction createLazyRoute(id) {\n\treturn (opts) => {\n\t\treturn new LazyRoute({\n\t\t\tid,\n\t\t\t...opts\n\t\t});\n\t};\n}\n/**\n* Creates a lazily-configurable file-based route stub by file path.\n*\n* Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).\n* The returned function accepts only non-critical route options like\n* `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.\n*\n* @param id File path literal for the route file.\n* @returns A function that accepts lazy route options and returns a `LazyRoute`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction\n*/\nfunction createLazyFileRoute(id) {\n\tif (typeof id === \"object\") return new LazyRoute(id);\n\treturn (opts) => new LazyRoute({\n\t\tid,\n\t\t...opts\n\t});\n}\n//#endregion\nexport { FileRoute, FileRouteLoader, LazyRoute, createFileRoute, createLazyFileRoute, createLazyRoute };\n\n//# sourceMappingURL=fileRoute.js.map","import { createNonReactiveMutableStore, createNonReactiveReadonlyStore } from \"@tanstack/router-core\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { batch, createAtom } from \"@tanstack/react-store\";\n//#region src/routerStores.ts\nvar getStoreFactory = (opts) => {\n\tif (isServer ?? opts.isServer) return {\n\t\tcreateMutableStore: createNonReactiveMutableStore,\n\t\tcreateReadonlyStore: createNonReactiveReadonlyStore,\n\t\tbatch: (fn) => fn()\n\t};\n\treturn {\n\t\tcreateMutableStore: createAtom,\n\t\tcreateReadonlyStore: createAtom,\n\t\tbatch\n\t};\n};\n//#endregion\nexport { getStoreFactory };\n\n//# sourceMappingURL=routerStores.js.map","import { getStoreFactory } from \"./routerStores.js\";\nimport { RouterCore } from \"@tanstack/router-core\";\n//#region src/router.ts\n/**\n* Creates a new Router instance for React.\n*\n* Pass the returned router to `RouterProvider` to enable routing.\n* Notable options: `routeTree` (your route definitions) and `context`\n* (required if the root route was created with `createRootRouteWithContext`).\n*\n* @param options Router options used to configure the router.\n* @returns A Router instance to be provided to `RouterProvider`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n*/\nvar createRouter = (options) => {\n\treturn new Router(options);\n};\nvar Router = class extends RouterCore {\n\tconstructor(options) {\n\t\tsuper(options, getStoreFactory);\n\t}\n};\n//#endregion\nexport { Router, createRouter };\n\n//# sourceMappingURL=router.js.map","\"use client\";\nimport { useHydrated } from \"./ClientOnly.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/Asset.tsx\nvar INLINE_CSS_HYDRATION_ATTR = \"data-tsr-inline-css\";\nvar noopScriptHandler = () => {};\nfunction setScriptAttrs(script, attrs) {\n\tif (!attrs) return;\n\tfor (const [key, value] of Object.entries(attrs)) if (key !== \"suppressHydrationWarning\" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === \"boolean\" ? \"\" : String(value));\n}\nfunction Asset(asset) {\n\tconst { attrs, children, nonce, preventScriptHoist } = asset;\n\tconst innerHTML = React$1.useMemo(() => children === void 0 ? void 0 : { __html: children }, [children]);\n\tswitch (asset.tag) {\n\t\tcase \"title\": return /* @__PURE__ */ jsx(\"title\", {\n\t\t\t...attrs,\n\t\t\tsuppressHydrationWarning: true,\n\t\t\tchildren\n\t\t});\n\t\tcase \"meta\": return /* @__PURE__ */ jsx(\"meta\", {\n\t\t\t...attrs,\n\t\t\tsuppressHydrationWarning: true\n\t\t});\n\t\tcase \"link\": return /* @__PURE__ */ jsx(\"link\", {\n\t\t\t...attrs,\n\t\t\tprecedence: attrs?.precedence ?? (attrs?.rel === \"stylesheet\" ? \"default\" : void 0),\n\t\t\tnonce,\n\t\t\tsuppressHydrationWarning: true\n\t\t});\n\t\tcase \"style\":\n\t\t\tif (asset.inlineCss && (process.env.TSS_INLINE_CSS_ENABLED === \"true\" || process.env.TSS_INLINE_CSS_ENABLED === void 0 && isServer)) return /* @__PURE__ */ jsx(InlineCssStyle, {\n\t\t\t\tattrs,\n\t\t\t\tnonce,\n\t\t\t\tchildren\n\t\t\t});\n\t\t\treturn /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\t...attrs,\n\t\t\t\tdangerouslySetInnerHTML: innerHTML,\n\t\t\t\tnonce\n\t\t\t});\n\t\tcase \"script\": return /* @__PURE__ */ jsx(Script, {\n\t\t\tattrs,\n\t\t\tpreventScriptHoist,\n\t\t\tchildren\n\t\t});\n\t\tdefault: return null;\n\t}\n}\nfunction InlineCssStyle({ attrs, children, nonce }) {\n\tconst isInlineCssPlaceholder = children === void 0;\n\tconst [hydratedInlineCss] = React$1.useState(() => {\n\t\tif (!isInlineCssPlaceholder || typeof document === \"undefined\") return;\n\t\treturn document.querySelector(`style[${INLINE_CSS_HYDRATION_ATTR}]`)?.textContent ?? void 0;\n\t});\n\tconst html = isInlineCssPlaceholder ? hydratedInlineCss ?? \"\" : children ?? \"\";\n\tconst innerHTML = React$1.useMemo(() => ({ __html: html }), [html]);\n\treturn /* @__PURE__ */ jsx(\"style\", {\n\t\t...attrs,\n\t\t[INLINE_CSS_HYDRATION_ATTR]: \"\",\n\t\tdangerouslySetInnerHTML: innerHTML,\n\t\tnonce,\n\t\tsuppressHydrationWarning: true\n\t});\n}\nfunction Script({ attrs, children, preventScriptHoist }) {\n\tconst router = useRouter();\n\tconst hydrated = useHydrated();\n\tconst innerHTML = React$1.useMemo(() => children === void 0 ? void 0 : { __html: children }, [children]);\n\tconst dataScript = typeof attrs?.type === \"string\" && attrs.type !== \"\" && attrs.type !== \"text/javascript\" && attrs.type !== \"module\";\n\tif (process.env.NODE_ENV !== \"production\" && attrs?.src && typeof children === \"string\" && children.trim().length) console.warn(\"[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`.\");\n\tReact$1.useEffect(() => {\n\t\tif (dataScript) return;\n\t\tif (attrs?.src) {\n\t\t\tconst link = document.createElement(\"a\");\n\t\t\tlink.href = attrs.src;\n\t\t\tconst normSrc = link.href;\n\t\t\tfor (const el of document.scripts) if (el.src === normSrc) return;\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tsetScriptAttrs(script, attrs);\n\t\t\tdocument.head.appendChild(script);\n\t\t\treturn () => script.remove();\n\t\t}\n\t\tif (typeof children === \"string\") {\n\t\t\tconst typeAttr = typeof attrs?.type === \"string\" ? attrs.type : \"text/javascript\";\n\t\t\tconst nonceAttr = typeof attrs?.nonce === \"string\" ? attrs.nonce : void 0;\n\t\t\tfor (const el of document.scripts) {\n\t\t\t\tif (el.hasAttribute(\"src\")) continue;\n\t\t\t\tconst sType = el.getAttribute(\"type\") ?? \"text/javascript\";\n\t\t\t\tconst sNonce = el.getAttribute(\"nonce\") ?? void 0;\n\t\t\t\tif (el.textContent === children && sType === typeAttr && sNonce === nonceAttr) return;\n\t\t\t}\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.textContent = children;\n\t\t\tsetScriptAttrs(script, attrs);\n\t\t\tdocument.head.appendChild(script);\n\t\t\treturn () => script.remove();\n\t\t}\n\t}, [\n\t\tattrs,\n\t\tchildren,\n\t\tdataScript\n\t]);\n\tif (isServer ?? router.isServer) {\n\t\tif (attrs?.src) {\n\t\t\tif (!preventScriptHoist) return /* @__PURE__ */ jsx(\"script\", {\n\t\t\t\t...attrs,\n\t\t\t\tsuppressHydrationWarning: true\n\t\t\t});\n\t\t\treturn /* @__PURE__ */ jsx(\"script\", {\n\t\t\t\t...attrs,\n\t\t\t\tonLoad: noopScriptHandler,\n\t\t\t\tsuppressHydrationWarning: true\n\t\t\t});\n\t\t}\n\t\tif (typeof children === \"string\") return /* @__PURE__ */ jsx(\"script\", {\n\t\t\t...attrs,\n\t\t\tdangerouslySetInnerHTML: innerHTML,\n\t\t\tsuppressHydrationWarning: true\n\t\t});\n\t\treturn null;\n\t}\n\tif (dataScript && typeof children === \"string\") return /* @__PURE__ */ jsx(\"script\", {\n\t\t...attrs,\n\t\tsuppressHydrationWarning: true,\n\t\tdangerouslySetInnerHTML: innerHTML\n\t});\n\tif (!hydrated) {\n\t\tif (attrs?.src) return /* @__PURE__ */ jsx(\"script\", {\n\t\t\t...attrs,\n\t\t\tsuppressHydrationWarning: true\n\t\t});\n\t\tif (typeof children === \"string\") return /* @__PURE__ */ jsx(\"script\", {\n\t\t\t...attrs,\n\t\t\tdangerouslySetInnerHTML: innerHTML,\n\t\t\tsuppressHydrationWarning: true\n\t\t});\n\t}\n\treturn null;\n}\n//#endregion\nexport { Asset };\n\n//# sourceMappingURL=Asset.js.map","import { useRouter } from \"./useRouter.js\";\nimport { _getAssetMatches, appendUniqueUserTags, deepEqual, escapeHtml, getAssetCrossOrigin, getScriptPreloadAttrs, resolveManifestCssLink } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/headContentUtils.tsx\nfunction buildTagsFromMatches(router, nonce, matches, assetCrossOrigin) {\n\tmatches = _getAssetMatches(matches);\n\tconst routeMeta = matches.map((match) => match.meta).filter((meta) => meta !== void 0);\n\tconst resultMeta = [];\n\tconst metaByAttribute = {};\n\tlet title;\n\tfor (let i = routeMeta.length - 1; i >= 0; i--) {\n\t\tconst metas = routeMeta[i];\n\t\tfor (let j = metas.length - 1; j >= 0; j--) {\n\t\t\tconst m = metas[j];\n\t\t\tif (!m) continue;\n\t\t\tif (m.title) {\n\t\t\t\tif (!title) title = {\n\t\t\t\t\ttag: \"title\",\n\t\t\t\t\tchildren: m.title\n\t\t\t\t};\n\t\t\t} else if (\"script:ld+json\" in m) try {\n\t\t\t\tconst json = JSON.stringify(m[\"script:ld+json\"]);\n\t\t\t\tresultMeta.push({\n\t\t\t\t\ttag: \"script\",\n\t\t\t\t\tattrs: { type: \"application/ld+json\" },\n\t\t\t\t\tchildren: escapeHtml(json)\n\t\t\t\t});\n\t\t\t} catch {}\n\t\t\telse {\n\t\t\t\tconst attribute = m.name ?? m.property;\n\t\t\t\tif (attribute) if (metaByAttribute[attribute]) continue;\n\t\t\t\telse metaByAttribute[attribute] = true;\n\t\t\t\tresultMeta.push({\n\t\t\t\t\ttag: \"meta\",\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\t...m,\n\t\t\t\t\t\tnonce\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\tif (title) resultMeta.push(title);\n\tif (nonce) resultMeta.push({\n\t\ttag: \"meta\",\n\t\tattrs: {\n\t\t\tproperty: \"csp-nonce\",\n\t\t\tcontent: nonce\n\t\t}\n\t});\n\tresultMeta.reverse();\n\tconst constructedLinks = matches.flatMap((match) => match.links ?? []).filter((link) => link !== void 0).map((link) => ({\n\t\ttag: \"link\",\n\t\tattrs: {\n\t\t\t...link,\n\t\t\tnonce\n\t\t}\n\t}));\n\tconst manifest = router.ssr?.manifest;\n\tconst manifestCssTags = [];\n\tif (manifest) {\n\t\tmatches.forEach((match) => {\n\t\t\t(manifest.routes[match.routeId]?.css)?.forEach((link) => {\n\t\t\t\tconst resolvedLink = resolveManifestCssLink(link);\n\t\t\t\tmanifestCssTags.push({\n\t\t\t\t\ttag: \"link\",\n\t\t\t\t\tattrs: {\n\t\t\t\t\t\trel: \"stylesheet\",\n\t\t\t\t\t\t...resolvedLink,\n\t\t\t\t\t\tcrossOrigin: getAssetCrossOrigin(assetCrossOrigin, \"stylesheet\") ?? resolvedLink.crossOrigin,\n\t\t\t\t\t\tsuppressHydrationWarning: true,\n\t\t\t\t\t\tnonce\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t\tif (manifest.inlineStyle) manifestCssTags.push({\n\t\t\ttag: \"style\",\n\t\t\tattrs: {\n\t\t\t\t...manifest.inlineStyle.attrs,\n\t\t\t\tnonce\n\t\t\t},\n\t\t\tchildren: manifest.inlineStyle.children,\n\t\t\tinlineCss: true\n\t\t});\n\t}\n\tconst preloadLinks = [];\n\tif (manifest) matches.forEach((match) => {\n\t\tmanifest.routes[match.routeId]?.preloads?.forEach((preload) => {\n\t\t\tpreloadLinks.push({\n\t\t\t\ttag: \"link\",\n\t\t\t\tattrs: {\n\t\t\t\t\t...getScriptPreloadAttrs(manifest, preload, assetCrossOrigin),\n\t\t\t\t\tnonce\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n\tconst styles = matches.flatMap((match) => match.styles ?? []).filter((style) => style !== void 0).map(({ children, ...attrs }) => ({\n\t\ttag: \"style\",\n\t\tattrs: {\n\t\t\t...attrs,\n\t\t\tnonce\n\t\t},\n\t\tchildren\n\t}));\n\tconst headScripts = matches.flatMap((match) => match.headScripts ?? []).filter((script) => script !== void 0).map(({ children, ...script }) => ({\n\t\ttag: \"script\",\n\t\tattrs: {\n\t\t\t...script,\n\t\t\tnonce\n\t\t},\n\t\tchildren\n\t}));\n\tconst tags = [];\n\tappendUniqueUserTags(tags, resultMeta);\n\ttags.push(...preloadLinks);\n\tappendUniqueUserTags(tags, constructedLinks);\n\ttags.push(...manifestCssTags);\n\tappendUniqueUserTags(tags, styles);\n\tappendUniqueUserTags(tags, headScripts);\n\treturn tags;\n}\n/**\n* Build the head/link/meta/script tags from the renderable presented prefix.\n* Used internally by `HeadContent`.\n*/\nvar useTags = (assetCrossOrigin) => {\n\tconst router = useRouter();\n\tconst nonce = router.options.ssr?.nonce;\n\tif (isServer ?? router.isServer) return buildTagsFromMatches(router, nonce, router.stores.matches.get(), assetCrossOrigin);\n\tconst selectTags = React$1.useCallback((matches) => buildTagsFromMatches(router, nonce, matches, assetCrossOrigin), [\n\t\tassetCrossOrigin,\n\t\tnonce,\n\t\trouter\n\t]);\n\treturn useSelector(router.stores.matches, selectTags, { compare: deepEqual });\n};\n//#endregion\nexport { useTags };\n\n//# sourceMappingURL=headContentUtils.js.map","\"use client\";\nimport { useRouter } from \"./useRouter.js\";\nimport { Asset } from \"./Asset.js\";\nimport { useTags } from \"./headContentUtils.js\";\nimport { createElement } from \"react\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\n//#region src/HeadContent.tsx\n/**\n* Render route-managed head tags (title, meta, links, styles, head scripts).\n* Place inside the document head of your app shell.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management\n*/\nfunction HeadContent(props) {\n\tconst tags = useTags(props.assetCrossOrigin);\n\tconst nonce = useRouter().options.ssr?.nonce;\n\treturn /* @__PURE__ */ jsx(Fragment, { children: tags.map((tag) => /* @__PURE__ */ createElement(Asset, {\n\t\t...tag,\n\t\tkey: `tsr-meta-${JSON.stringify(tag)}`,\n\t\tnonce\n\t})) });\n}\n//#endregion\nexport { HeadContent };\n\n//# sourceMappingURL=HeadContent.js.map","import { useRouter } from \"./useRouter.js\";\nimport { Asset } from \"./Asset.js\";\nimport { composeSsrBodyScripts, deepEqual, getSsrBodyScriptParts } from \"@tanstack/router-core\";\nimport { createElement } from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nimport { useSelector } from \"@tanstack/react-store\";\n//#region src/Scripts.tsx\nvar routeScriptAttrs = { suppressHydrationWarning: true };\n/**\n* Render body script tags collected from route matches and SSR manifests.\n* During streaming SSR, `<Scripts>` marks where late hydration scripts may\n* begin to be inserted.\n*/\nvar Scripts = () => {\n\tconst router = useRouter();\n\tconst nonce = router.options.ssr?.nonce;\n\tconst getParts = (matches) => {\n\t\tconst parts = getSsrBodyScriptParts(matches, router.ssr?.manifest, nonce, routeScriptAttrs);\n\t\tfor (const script of parts[1]) if (typeof script.attrs?.src === \"string\") {\n\t\t\tconst scriptWithHoist = script;\n\t\t\tscriptWithHoist.preventScriptHoist = true;\n\t\t}\n\t\treturn parts;\n\t};\n\tconst getScripts = (matches) => {\n\t\treturn composeSsrBodyScripts(getParts(matches));\n\t};\n\tif (isServer ?? router.isServer) return renderScripts(composeSsrBodyScripts(getParts(router.stores.matches.get()), router.serverSsr?.takeInitialHydrationScriptTags()));\n\treturn renderScripts(useSelector(router.stores.matches, getScripts, { compare: deepEqual }));\n};\nfunction renderScripts(scripts) {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: scripts.map((asset, i) => /* @__PURE__ */ createElement(Asset, {\n\t\t...asset,\n\t\tkey: `tsr-scripts-${asset.tag}-${i}`\n\t})) });\n}\n//#endregion\nexport { Scripts };\n\n//# sourceMappingURL=Scripts.js.map","import { createIsomorphicFn } from \"@tanstack/start-fn-stubs\";\nimport { getStartContext } from \"@tanstack/start-storage-context\";\n//#region src/getGlobalStartContext.ts\nvar getGlobalStartContext = createIsomorphicFn().client(() => void 0).server(() => {\n\tconst context = getStartContext().contextAfterGlobalMiddlewares;\n\tif (!context) throw new Error(`Global context not set yet, you are calling getGlobalStartContext() before the global middlewares are applied.`);\n\treturn context;\n});\n//#endregion\nexport { getGlobalStartContext };\n\n//# sourceMappingURL=getGlobalStartContext.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/QueryClientProvider.tsx\n/**\n* The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it.\n*/\nconst QueryClientContext = React.createContext(void 0);\n/**\n* The `useQueryClient` hook returns the current `QueryClient` instance.\n*\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns The current `QueryClient` instance.\n* @throws If no `queryClient` argument is passed and no `QueryClientProvider` is found in the component tree.\n*/\nconst useQueryClient = (queryClient) => {\n\tconst client = React.useContext(QueryClientContext);\n\tif (queryClient) return queryClient;\n\tif (!client) throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n\treturn client;\n};\n/**\n* Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also\n* calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to\n* focus/online events (resuming any paused mutations and refetching as needed when the app regains focus or\n* comes back online).\n*\n* @returns The provided `children`, wrapped so they can read the `QueryClient` via `useQueryClient`.\n*\n* @example\n* ```tsx\n* import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\n*\n* const queryClient = new QueryClient()\n*\n* function App() {\n* return <QueryClientProvider client={queryClient}>...</QueryClientProvider>\n* }\n* ```\n*/\nconst QueryClientProvider = ({ client, children }) => {\n\tReact.useEffect(() => {\n\t\tclient.mount();\n\t\treturn () => {\n\t\t\tclient.unmount();\n\t\t};\n\t}, [client]);\n\treturn /* @__PURE__ */ jsx(QueryClientContext.Provider, {\n\t\tvalue: client,\n\t\tchildren\n\t});\n};\n//#endregion\nexport { QueryClientContext, QueryClientProvider, useQueryClient };\n\n//# sourceMappingURL=QueryClientProvider.js.map","//#region src/timeoutManager.ts\nconst defaultTimeoutProvider = {\n\tsetTimeout: (callback, delay) => setTimeout(callback, delay),\n\tclearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\tsetInterval: (callback, delay) => setInterval(callback, delay),\n\tclearInterval: (intervalId) => clearInterval(intervalId)\n};\n/**\n* Allows customization of how timeouts are created.\n*\n* @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n* and `gcTime`. The default TimeoutManager provider uses the platform's global\n* `setTimeout` implementation, which is known to have scalability issues with\n* thousands of timeouts on the event loop.\n*\n* If you hit this limitation, consider providing a custom TimeoutProvider that\n* coalesces timeouts.\n*/\nvar TimeoutManager = class {\n\t#provider = defaultTimeoutProvider;\n\t#providerCalled = false;\n\t/**\n\t* `setTimeoutProvider` can be used to set a custom implementation of the\n\t* `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions,\n\t* called a `TimeoutProvider`.\n\t*\n\t* This may be useful if you notice event loop performance issues with\n\t* thousands of queries. A custom TimeoutProvider could also support timer\n\t* delays longer than the global `setTimeout` maximum delay value of about\n\t* 24 days.\n\t*\n\t* It is important to call `setTimeoutProvider` before creating a\n\t* QueryClient or queries, so that the same provider is used consistently\n\t* for all timers in the application, since different TimeoutProviders\n\t* cannot cancel each others' timers.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager, QueryClient } from '@tanstack/query-core'\n\t* import { CustomTimeoutProvider } from './CustomTimeoutProvider'\n\t*\n\t* timeoutManager.setTimeoutProvider(new CustomTimeoutProvider())\n\t*\n\t* export const queryClient = new QueryClient()\n\t* ```\n\t*/\n\tsetTimeoutProvider(provider) {\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {\n\t\t\t\tprevious: this.#provider,\n\t\t\t\tprovider\n\t\t\t});\n\t\t}\n\t\tthis.#provider = provider;\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = false;\n\t}\n\t/**\n\t* `setTimeout` schedules a callback to run after approximately `delay`\n\t* milliseconds, like the global `setTimeout` function. The callback can be\n\t* canceled with `clearTimeout`.\n\t*\n\t* It returns a timer ID, which may be a number or an object that can be\n\t* coerced to a number via `Symbol.toPrimitive`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* const timeoutIdNumber: number = Number(timeoutId)\n\t* ```\n\t*/\n\tsetTimeout(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setTimeout(callback, delay);\n\t}\n\t/**\n\t* `clearTimeout` cancels a timeout callback scheduled with `setTimeout`,\n\t* like the global `clearTimeout` function. It should be called with a\n\t* timer ID returned by `setTimeout`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearTimeout(timeoutId)\n\t* ```\n\t*/\n\tclearTimeout(timeoutId) {\n\t\tthis.#provider.clearTimeout(timeoutId);\n\t}\n\t/**\n\t* `setInterval` schedules a callback to be called approximately every\n\t* `delay` milliseconds, like the global `setInterval` function.\n\t*\n\t* Like `setTimeout`, it returns a timer ID, which may be a number or an\n\t* object that can be coerced to a number via `Symbol.toPrimitive`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t* ```\n\t*/\n\tsetInterval(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setInterval(callback, delay);\n\t}\n\t/**\n\t* `clearInterval` can be used to cancel an interval, like the global\n\t* `clearInterval` function. It should be called with an interval ID\n\t* returned by `setInterval`.\n\t*\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearInterval(intervalId)\n\t* ```\n\t*/\n\tclearInterval(intervalId) {\n\t\tthis.#provider.clearInterval(intervalId);\n\t}\n};\n/**\n* Singleton instance of {@link TimeoutManager}, used throughout TanStack Query to schedule and cancel timers.\n*/\nconst timeoutManager = new TimeoutManager();\n/**\n* In many cases code wants to delay to the next event loop tick; this is not\n* mediated by {@link timeoutManager}.\n*\n* This function is provided to make auditing the `tanstack/query-core` for\n* incorrect use of system `setTimeout` easier.\n*/\nfunction systemSetTimeoutZero(callback) {\n\tsetTimeout(callback, 0);\n}\n//#endregion\nexport { TimeoutManager, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };\n\n//# sourceMappingURL=timeoutManager.js.map","import { timeoutManager } from \"./timeoutManager.js\";\n//#region src/utils.ts\n/** @deprecated\n* use `environmentManager.isServer()` instead.\n*/\nconst isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {}\nfunction functionalUpdate(updater, input) {\n\treturn typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n\treturn typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n\treturn Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveQueryValue(value, query) {\n\treturn typeof value === \"function\" ? value(query) : value;\n}\n/**\n* Checks whether a query matches the given {@link QueryFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n*\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n*\n* const matchingQueries = queryCache\n* .getAll()\n* .filter((query) => matchQuery({ queryKey: ['posts'] }, query))\n* ```\n*/\nfunction matchQuery(filters, query) {\n\tconst { type = \"all\", exact, fetchStatus, predicate, queryKey, stale } = filters;\n\tif (queryKey) {\n\t\tif (exact) {\n\t\t\tif (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;\n\t\t} else if (!partialMatchKey(query.queryKey, queryKey)) return false;\n\t}\n\tif (type !== \"all\") {\n\t\tconst isActive = query.isActive();\n\t\tif (type === \"active\" && !isActive) return false;\n\t\tif (type === \"inactive\" && isActive) return false;\n\t}\n\tif (typeof stale === \"boolean\" && query.isStale() !== stale) return false;\n\tif (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;\n\tif (predicate && !predicate(query)) return false;\n\treturn true;\n}\n/**\n* Checks whether a mutation matches the given {@link MutationFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n* If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match.\n*\n* @example\n* ```ts\n* const mutationCache = queryClient.getMutationCache()\n*\n* const matchingMutations = mutationCache\n* .getAll()\n* .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation))\n* ```\n*/\nfunction matchMutation(filters, mutation) {\n\tconst { exact, status, predicate, mutationKey } = filters;\n\tif (mutationKey) {\n\t\tif (!mutation.options.mutationKey) return false;\n\t\tif (exact) {\n\t\t\tif (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;\n\t\t} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;\n\t}\n\tif (status && mutation.state.status !== status) return false;\n\tif (predicate && !predicate(mutation)) return false;\n\treturn true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n\treturn (options?.queryKeyHashFn || hashKey)(queryKey);\n}\n/**\n* Default query & mutation keys hash function.\n* Hashes the value into a stable hash.\n*\n* @example\n* ```ts\n* // Object keys are sorted, so key order doesn't affect the hash:\n* hashKey(['todos', { page: 1, filter: 'done' }]) // === '[\"todos\",{\"filter\":\"done\",\"page\":1}]'\n* ```\n*/\nfunction hashKey(queryKey) {\n\treturn JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n\t\tresult[key] = val[key];\n\t\treturn result;\n\t}, {}) : val);\n}\nfunction partialMatchKey(a, b) {\n\tif (a === b) return true;\n\tif (typeof a !== typeof b) return false;\n\tif (a && b && typeof a === \"object\" && typeof b === \"object\") {\n\t\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\t\tif (b.length > a.length) return false;\n\t\t\tfor (let i = 0; i < b.length; i++) if (!partialMatchKey(a[i], b[i])) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst bKeys = Object.keys(b);\n\t\tfor (const key of bKeys) if (!partialMatchKey(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\nconst hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n\tif (a === b) return a;\n\tif (depth > 500) return b;\n\tconst array = isPlainArray(a) && isPlainArray(b);\n\tif (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n\tconst aSize = (array ? a : Object.keys(a)).length;\n\tconst bItems = array ? b : Object.keys(b);\n\tconst bSize = bItems.length;\n\tconst copy = array ? new Array(bSize) : {};\n\tlet equalItems = 0;\n\tfor (let i = 0; i < bSize; i++) {\n\t\tconst key = array ? i : bItems[i];\n\t\tconst aItem = a[key];\n\t\tconst bItem = b[key];\n\t\tif (aItem === bItem) {\n\t\t\tcopy[key] = aItem;\n\t\t\tif (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n\t\t\tcopy[key] = bItem;\n\t\t\tcontinue;\n\t\t}\n\t\tconst v = replaceEqualDeep(aItem, bItem, depth + 1);\n\t\tcopy[key] = v;\n\t\tif (v === aItem) equalItems++;\n\t}\n\treturn aSize === bSize && equalItems === aSize ? a : copy;\n}\n/**\n* Shallow compare objects.\n*/\nfunction shallowEqualObjects(a, b) {\n\tif (!b || Object.keys(a).length !== Object.keys(b).length) return false;\n\tfor (const key in a) if (a[key] !== b[key]) return false;\n\treturn true;\n}\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n\tif (!hasObjectPrototype(o)) return false;\n\tconst objectPrototype = Object.getPrototypeOf(o);\n\tconst ctor = objectPrototype?.constructor;\n\tif (ctor === void 0) return true;\n\tif (typeof ctor !== \"function\") return false;\n\tconst prot = ctor.prototype;\n\tif (!hasObjectPrototype(prot)) return false;\n\tif (!prot.hasOwnProperty(\"isPrototypeOf\")) return false;\n\tif (objectPrototype !== Object.prototype) return false;\n\treturn true;\n}\nfunction hasObjectPrototype(o) {\n\treturn Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n\treturn new Promise((resolve) => {\n\t\ttimeoutManager.setTimeout(resolve, timeout);\n\t});\n}\nfunction replaceData(prevData, data, options) {\n\tif (typeof options.structuralSharing === \"function\") return options.structuralSharing(prevData, data);\n\telse if (options.structuralSharing !== false) {\n\t\tif (process.env.NODE_ENV !== \"production\") try {\n\t\t\treturn replaceEqualDeep(prevData, data);\n\t\t} catch (error) {\n\t\t\tconsole.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`);\n\t\t\tthrow error;\n\t\t}\n\t\treturn replaceEqualDeep(prevData, data);\n\t}\n\treturn data;\n}\n/**\n* Intended to be passed as a query's `placeholderData` option, for example\n* `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new\n* query key is fetching, it keeps displaying the previously fetched data until the new data arrives.\n*\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['posts', page],\n* queryFn: () => fetchPosts(page),\n* placeholderData: keepPreviousData,\n* })\n* ```\n*/\nfunction keepPreviousData(previousData) {\n\treturn previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n\tconst newItems = [...items, item];\n\treturn max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n\tconst newItems = [item, ...items];\n\treturn max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\n/**\n* Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent\n* to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`,\n* a query disabled via `skipToken` cannot be triggered with `refetch`.\n*\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['post', postId],\n* queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n* })\n* ```\n*/\nconst skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (options.queryFn === skipToken) console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`);\n\t}\n\tif (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;\n\tif (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));\n\treturn options.queryFn;\n}\n/**\n* Resolves a `throwOnError` option to a boolean.\n* If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller,\n* additional context such as the query or mutation) and its result is returned, allowing the throwing\n* behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined`\n* resolves to `false`).\n*\n* @example\n* ```ts\n* const throwOnError =\n* query.state.error && typeof options.throwOnError === 'function'\n* ? shouldThrowError(options.throwOnError, [query.state.error, query])\n* : options.throwOnError\n* ```\n*/\nfunction shouldThrowError(throwOnError, params) {\n\tif (typeof throwOnError === \"function\") return throwOnError(...params);\n\treturn !!throwOnError;\n}\nfunction addConsumeAwareSignal(object, getSignal, onCancelled) {\n\tlet consumed = false;\n\tlet signal;\n\tObject.defineProperty(object, \"signal\", {\n\t\tenumerable: true,\n\t\tget: () => {\n\t\t\tsignal ??= getSignal();\n\t\t\tif (consumed) return signal;\n\t\t\tconsumed = true;\n\t\t\tif (signal.aborted) onCancelled();\n\t\t\telse signal.addEventListener(\"abort\", onCancelled, { once: true });\n\t\t\treturn signal;\n\t\t}\n\t});\n\treturn object;\n}\n//#endregion\nexport { addConsumeAwareSignal, addToEnd, addToStart, ensureQueryFn, functionalUpdate, hashKey, hashQueryKeyByOptions, isPlainArray, isPlainObject, isServer, isValidTimeout, keepPreviousData, matchMutation, matchQuery, noop, partialMatchKey, replaceData, replaceEqualDeep, resolveQueryValue, shallowEqualObjects, shouldThrowError, skipToken, sleep, timeUntilStale };\n\n//# sourceMappingURL=utils.js.map","import { isServer as isServer$1 } from \"./utils.js\";\n//#region src/environmentManager.ts\nlet isServerFn = () => isServer$1;\n/**\n* Returns whether the current runtime should be treated as a server environment.\n*/\nconst isServer = () => isServerFn();\n/**\n* Manages how TanStack Query detects whether the current runtime should be treated as\n* server-side, which disables scheduling refetch timers and changes the default `retry` count\n* and `gcTime`. By default, the detection treats a missing `window` (or the presence of a\n* `Deno` global) as server.\n*\n* Override this for runtimes where that default detection would give the wrong answer — for\n* example, a Service Worker, where `window` is undefined even though the environment should\n* behave like a client.\n*\n* @example\n* ```ts\n* import { environmentManager } from '@tanstack/query-core'\n*\n* environmentManager.setIsServer(() => false)\n* ```\n*/\nconst environmentManager = {\n\tisServer,\n\t/**\n\t* Overrides the server check globally.\n\t*/\n\tsetIsServer(isServerValue) {\n\t\tisServerFn = isServerValue;\n\t}\n};\n//#endregion\nexport { environmentManager, isServer };\n\n//# sourceMappingURL=environmentManager.js.map","//#region src/subscribable.ts\n/**\n* The base class behind everything in Query that you can subscribe to: `QueryCache`, `MutationCache`,\n* the observers, and the `FocusManager`/`OnlineManager` behind `focusManager` and `onlineManager`.\n* Subclasses decide what a listener receives and when it is called.\n*/\nvar Subscribable = class {\n\tconstructor() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t}\n\t/**\n\t* Registers a listener to be called on every update this object notifies about. Returns a function\n\t* that removes the listener again — call it to stop listening. The base class never drops a listener\n\t* on its own, though some subclasses clear all of theirs in `destroy()`.\n\t* @param listener - Called on each update, with whatever the subclass passes to its subscribers.\n\t* @example\n\t* ```ts\n\t* const unsubscribe = subscribable.subscribe(() => {\n\t* // react to the update\n\t* })\n\t*\n\t* unsubscribe()\n\t* ```\n\t*/\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\tthis.onSubscribe();\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t\tthis.onUnsubscribe();\n\t\t};\n\t}\n\t/**\n\t* Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.\n\t*/\n\thasListeners() {\n\t\treturn this.listeners.size > 0;\n\t}\n\tonSubscribe() {}\n\tonUnsubscribe() {}\n};\n//#endregion\nexport { Subscribable };\n\n//# sourceMappingURL=subscribable.js.map","import { Subscribable } from \"./subscribable.js\";\n//#region src/focusManager.ts\n/**\n* The `FocusManager` manages the focus state within TanStack Query.\n*\n* It can be used to change the default event listeners or to manually change the focus state.\n*/\nvar FocusManager = class extends Subscribable {\n\t#focused;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onFocus) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst listener = () => onFocus();\n\t\t\t\twindow.addEventListener(\"visibilitychange\", listener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"visibilitychange\", listener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the focus state. The provided `setup` function\n\t* receives a `setFocused` callback: call it with a `boolean` to manually\n\t* set the focus state, or with no arguments to re-evaluate the current\n\t* focus state and notify subscribers.\n\t*\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* focusManager.setEventListener((handleFocus) => {\n\t* const listener = () => handleFocus()\n\t* // Listen to visibilitychange\n\t* if (typeof window !== 'undefined' && window.addEventListener) {\n\t* window.addEventListener('visibilitychange', listener, false)\n\t* }\n\t*\n\t* return () => {\n\t* // Be sure to unsubscribe if a new handler is set\n\t* window.removeEventListener('visibilitychange', listener)\n\t* }\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup((focused) => {\n\t\t\tif (typeof focused === \"boolean\") this.setFocused(focused);\n\t\t\telse this.onFocus();\n\t\t});\n\t}\n\t/**\n\t* `setFocused` can be used to manually set the focus state. Set `undefined`\n\t* to fall back to the default focus check.\n\t*\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* // Set focused\n\t* focusManager.setFocused(true)\n\t*\n\t* // Set unfocused\n\t* focusManager.setFocused(false)\n\t*\n\t* // Fallback to the default focus check\n\t* focusManager.setFocused(undefined)\n\t* ```\n\t*/\n\tsetFocused(focused) {\n\t\tif (this.#focused !== focused) {\n\t\t\tthis.#focused = focused;\n\t\t\tthis.onFocus();\n\t\t}\n\t}\n\t/**\n\t* `onFocus` notifies all subscribed listeners with the current focus state.\n\t*/\n\tonFocus() {\n\t\tconst isFocused = this.isFocused();\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistener(isFocused);\n\t\t});\n\t}\n\t/**\n\t* `isFocused` can be used to get the current focus state.\n\t*/\n\tisFocused() {\n\t\tif (typeof this.#focused === \"boolean\") return this.#focused;\n\t\treturn globalThis.document?.visibilityState !== \"hidden\";\n\t}\n};\n/**\n* Singleton instance of {@link FocusManager}, used to manage and observe the focus state within TanStack Query.\n*/\nconst focusManager = new FocusManager();\n//#endregion\nexport { FocusManager, focusManager };\n\n//# sourceMappingURL=focusManager.js.map","import { systemSetTimeoutZero } from \"./timeoutManager.js\";\n//#region src/notifyManager.ts\n/**\n* Default scheduling function used by the notify manager.\n* Schedules the callback with the system's `setTimeout(callback, 0)`.\n*/\nconst defaultScheduler = systemSetTimeoutZero;\nfunction createNotifyManager() {\n\tlet queue = [];\n\tlet transactions = 0;\n\tlet notifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet batchNotifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet scheduleFn = defaultScheduler;\n\tconst schedule = (callback) => {\n\t\tif (transactions) queue.push(callback);\n\t\telse scheduleFn(() => {\n\t\t\tnotifyFn(callback);\n\t\t});\n\t};\n\tconst flush = () => {\n\t\tconst originalQueue = queue;\n\t\tqueue = [];\n\t\tif (originalQueue.length) scheduleFn(() => {\n\t\t\tbatchNotifyFn(() => {\n\t\t\t\toriginalQueue.forEach((callback) => {\n\t\t\t\t\tnotifyFn(callback);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\t/**\n\t\t* Batches all updates scheduled inside the passed callback.\n\t\t* This is mainly used internally to optimize query client updating.\n\t\t* Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n\t\t* The return value of `callback` is passed through.\n\t\t*/\n\t\tbatch: (callback) => {\n\t\t\tlet result;\n\t\t\ttransactions++;\n\t\t\ttry {\n\t\t\t\tresult = callback();\n\t\t\t} finally {\n\t\t\t\ttransactions--;\n\t\t\t\tif (!transactions) flush();\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t/**\n\t\t* All calls to the wrapped function will be batched.\n\t\t*/\n\t\tbatchCalls: (callback) => {\n\t\t\treturn (...args) => {\n\t\t\t\tschedule(() => {\n\t\t\t\t\tcallback(...args);\n\t\t\t\t});\n\t\t\t};\n\t\t},\n\t\t/**\n\t\t* Schedules a function to be run on the next batch.\n\t\t* By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n\t\t*/\n\t\tschedule,\n\t\t/**\n\t\t* Use this method to set a custom notify function.\n\t\t* This can be used to for example wrap notifications with `React.act` while running tests.\n\t\t*/\n\t\tsetNotifyFunction: (fn) => {\n\t\t\tnotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Use this method to set a custom function to batch notifications together into a single tick.\n\t\t* Framework adapters use this to plug in their own batching primitive, so that a single query\n\t\t* update only triggers one re-render instead of one per subscriber.\n\t\t*\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t* import { batch } from 'solid-js'\n\t\t*\n\t\t* notifyManager.setBatchNotifyFunction(batch)\n\t\t* ```\n\t\t*/\n\t\tsetBatchNotifyFunction: (fn) => {\n\t\t\tbatchNotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Configures a custom callback that schedules when the next batch runs.\n\t\t* The default behavior is `setTimeout(callback, 0)`.\n\t\t*\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t*\n\t\t* // Schedule batches in the next microtask\n\t\t* notifyManager.setScheduler(queueMicrotask)\n\t\t*\n\t\t* // Schedule batches before the next frame is rendered\n\t\t* notifyManager.setScheduler(requestAnimationFrame)\n\t\t*\n\t\t* // Schedule batches some time in the future\n\t\t* notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n\t\t* ```\n\t\t*/\n\t\tsetScheduler: (fn) => {\n\t\t\tscheduleFn = fn;\n\t\t}\n\t};\n}\n/**\n* Handles scheduling and batching callbacks in TanStack Query.\n*/\nconst notifyManager = createNotifyManager();\n//#endregion\nexport { createNotifyManager, defaultScheduler, notifyManager };\n\n//# sourceMappingURL=notifyManager.js.map","import { Subscribable } from \"./subscribable.js\";\n//#region src/onlineManager.ts\n/**\n* The `OnlineManager` manages the online state within TanStack Query. It can\n* be used to change the default event listeners or to manually change the\n* online state.\n*\n* By default, the `onlineManager` assumes an active network connection, and\n* listens to the `online` and `offline` events on the `window` object to\n* detect changes.\n*/\nvar OnlineManager = class extends Subscribable {\n\t#online = true;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onOnline) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst onlineListener = () => onOnline(true);\n\t\t\t\tconst offlineListener = () => onOnline(false);\n\t\t\t\twindow.addEventListener(\"online\", onlineListener, false);\n\t\t\t\twindow.addEventListener(\"offline\", offlineListener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"online\", onlineListener);\n\t\t\t\t\twindow.removeEventListener(\"offline\", offlineListener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the online state. The provided `setup` function\n\t* receives a `setOnline` callback that should be called with a `boolean`\n\t* whenever the online state changes.\n\t*\n\t* @example\n\t* ```ts\n\t* import NetInfo from '@react-native-community/netinfo'\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* onlineManager.setEventListener((setOnline) => {\n\t* return NetInfo.addEventListener((state) => {\n\t* setOnline(!!state.isConnected)\n\t* })\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup(this.setOnline.bind(this));\n\t}\n\t/**\n\t* `setOnline` can be used to manually set the online state.\n\t*\n\t* @example\n\t* ```ts\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* // Set to online\n\t* onlineManager.setOnline(true)\n\t*\n\t* // Set to offline\n\t* onlineManager.setOnline(false)\n\t* ```\n\t*/\n\tsetOnline(online) {\n\t\tif (this.#online !== online) {\n\t\t\tthis.#online = online;\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(online);\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* `isOnline` can be used to get the current online state.\n\t*/\n\tisOnline() {\n\t\treturn this.#online;\n\t}\n};\n/**\n* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.\n*/\nconst onlineManager = new OnlineManager();\n//#endregion\nexport { OnlineManager, onlineManager };\n\n//# sourceMappingURL=onlineManager.js.map","import { noop, sleep } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\n//#region src/retryer.ts\nfunction defaultRetryDelay(failureCount) {\n\treturn Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n\treturn (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\n/**\n* The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via\n* `query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch\n* started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead\n* resolve with the promise of the fetch that triggered the cancellation.\n* @example\n* ```ts\n* query.cancel()\n*\n* try {\n* await query.promise\n* } catch (error) {\n* if (error instanceof CancelledError) {\n* // the fetch was cancelled, e.g. via `query.cancel()`\n* }\n* }\n* ```\n*/\nvar CancelledError = class extends Error {\n\tconstructor(options) {\n\t\tsuper(\"CancelledError\");\n\t\tthis.revert = options?.revert;\n\t\tthis.silent = options?.silent;\n\t}\n};\n/**\n* @deprecated Use instanceof `CancelledError` instead.\n*/\nfunction isCancelledError(value) {\n\treturn value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n\tlet isRetryCancelled = false;\n\tlet failureCount = 0;\n\tlet continueFn;\n\tlet status = \"pending\";\n\tlet promiseResolve;\n\tlet promiseReject;\n\tconst promise = new Promise((resolve, reject) => {\n\t\tpromiseResolve = resolve;\n\t\tpromiseReject = reject;\n\t});\n\tpromise.catch(noop);\n\tconst isResolved = () => status !== \"pending\";\n\tconst cancel = (cancelOptions) => {\n\t\tif (!isResolved()) {\n\t\t\tconst error = new CancelledError(cancelOptions);\n\t\t\treject(error);\n\t\t\tconfig.onCancel?.(error);\n\t\t}\n\t};\n\tconst cancelRetry = () => {\n\t\tisRetryCancelled = true;\n\t};\n\tconst continueRetry = () => {\n\t\tisRetryCancelled = false;\n\t};\n\tconst canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n\tconst canStart = () => canFetch(config.networkMode) && config.canRun();\n\tconst resolve = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"resolved\";\n\t\t\tpromiseResolve(value);\n\t\t}\n\t};\n\tconst reject = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"rejected\";\n\t\t\tpromiseReject(value);\n\t\t}\n\t};\n\tconst pause = () => {\n\t\treturn new Promise((continueResolve) => {\n\t\t\tcontinueFn = (value) => {\n\t\t\t\tif (isResolved() || canContinue()) continueResolve(value);\n\t\t\t};\n\t\t\tconfig.onPause?.();\n\t\t}).then(() => {\n\t\t\tcontinueFn = void 0;\n\t\t\tif (!isResolved()) config.onContinue?.();\n\t\t});\n\t};\n\tconst run = () => {\n\t\tif (isResolved()) return;\n\t\tlet promiseOrValue;\n\t\tconst initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n\t\ttry {\n\t\t\tpromiseOrValue = initialPromise ?? config.fn();\n\t\t} catch (error) {\n\t\t\tpromiseOrValue = Promise.reject(error);\n\t\t}\n\t\tPromise.resolve(promiseOrValue).then(resolve).catch((error) => {\n\t\t\tif (isResolved()) return;\n\t\t\tconst retry = config.retry ?? (isServer() ? 0 : 3);\n\t\t\tconst retryDelay = config.retryDelay ?? defaultRetryDelay;\n\t\t\tconst delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n\t\t\tconst shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n\t\t\tif (isRetryCancelled || !shouldRetry) {\n\t\t\t\treject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfailureCount++;\n\t\t\tconfig.onFail?.(failureCount, error);\n\t\t\tsleep(delay).then(() => {\n\t\t\t\treturn canContinue() ? void 0 : pause();\n\t\t\t}).then(() => {\n\t\t\t\tif (isRetryCancelled) reject(error);\n\t\t\t\telse run();\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\tpromise,\n\t\tstatus: () => status,\n\t\tcancel,\n\t\tcontinue: () => {\n\t\t\tcontinueFn?.();\n\t\t\treturn promise;\n\t\t},\n\t\tcancelRetry,\n\t\tcontinueRetry,\n\t\tcanStart,\n\t\tstart: () => {\n\t\t\tif (canStart()) run();\n\t\t\telse pause().then(run);\n\t\t\treturn promise;\n\t\t}\n\t};\n}\n//#endregion\nexport { CancelledError, canFetch, createRetryer, isCancelledError };\n\n//# sourceMappingURL=retryer.js.map","import { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout } from \"./utils.js\";\nimport { isServer } from \"./environmentManager.js\";\n//#region src/removable.ts\n/**\n* The base class for cache entries that are garbage collected once nothing is using them —\n* `Query` and `Mutation` both extend it. `gcTime` controls how long an unused entry is kept.\n*/\nvar Removable = class {\n\t#gcTimeout;\n\t/**\n\t* Clears the pending garbage collection timeout, so the entry is no longer scheduled for removal.\n\t* A subclass may override this to release what it holds on to as well — `Query` also cancels any\n\t* in-flight fetch.\n\t*/\n\tdestroy() {\n\t\tthis.clearGcTimeout();\n\t}\n\tscheduleGc() {\n\t\tthis.clearGcTimeout();\n\t\tif (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {\n\t\t\tthis.optionalRemove();\n\t\t}, this.gcTime);\n\t}\n\tupdateGcTime(newGcTime) {\n\t\tthis.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer() ? Infinity : 3e5));\n\t}\n\tclearGcTimeout() {\n\t\tif (this.#gcTimeout !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#gcTimeout);\n\t\t\tthis.#gcTimeout = void 0;\n\t\t}\n\t}\n};\n//#endregion\nexport { Removable };\n\n//# sourceMappingURL=removable.js.map","import { addConsumeAwareSignal, addToEnd, addToStart, ensureQueryFn } from \"./utils.js\";\n//#region src/infiniteQueryBehavior.ts\nfunction infiniteQueryBehavior(pages) {\n\treturn { onFetch: (context, query) => {\n\t\tconst options = context.options;\n\t\tconst direction = context.fetchOptions?.meta?.fetchMore?.direction;\n\t\tconst oldPages = context.state.data?.pages || [];\n\t\tconst oldPageParams = context.state.data?.pageParams || [];\n\t\tlet result = {\n\t\t\tpages: [],\n\t\t\tpageParams: []\n\t\t};\n\t\tlet currentPage = 0;\n\t\tconst fetchFn = async () => {\n\t\t\tlet cancelled = false;\n\t\t\tconst addSignalProperty = (object) => {\n\t\t\t\taddConsumeAwareSignal(object, () => context.signal, () => cancelled = true);\n\t\t\t};\n\t\t\tconst queryFn = ensureQueryFn(context.options, context.fetchOptions);\n\t\t\tconst fetchPage = async (data, param, previous) => {\n\t\t\t\tif (cancelled) return Promise.reject(context.signal.reason);\n\t\t\t\tif (param == null && data.pages.length) return Promise.resolve(data);\n\t\t\t\tconst createQueryFnContext = () => {\n\t\t\t\t\tconst queryFnContext = {\n\t\t\t\t\t\tclient: context.client,\n\t\t\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\t\t\tpageParam: param,\n\t\t\t\t\t\tdirection: previous ? \"backward\" : \"forward\",\n\t\t\t\t\t\tmeta: context.options.meta\n\t\t\t\t\t};\n\t\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\t\treturn queryFnContext;\n\t\t\t\t};\n\t\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\t\tconst page = await queryFn(queryFnContext);\n\t\t\t\tconst { maxPages } = context.options;\n\t\t\t\tconst addTo = previous ? addToStart : addToEnd;\n\t\t\t\treturn {\n\t\t\t\t\tpages: addTo(data.pages, page, maxPages),\n\t\t\t\t\tpageParams: addTo(data.pageParams, param, maxPages)\n\t\t\t\t};\n\t\t\t};\n\t\t\tif (direction && oldPages.length) {\n\t\t\t\tconst previous = direction === \"backward\";\n\t\t\t\tconst pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n\t\t\t\tconst oldData = {\n\t\t\t\t\tpages: oldPages,\n\t\t\t\t\tpageParams: oldPageParams\n\t\t\t\t};\n\t\t\t\tresult = await fetchPage(oldData, pageParamFn(options, oldData), previous);\n\t\t\t} else {\n\t\t\t\tconst remainingPages = pages ?? oldPages.length;\n\t\t\t\tdo {\n\t\t\t\t\tconst param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);\n\t\t\t\t\tif (currentPage > 0 && param == null) break;\n\t\t\t\t\tresult = await fetchPage(result, param);\n\t\t\t\t\tcurrentPage++;\n\t\t\t\t} while (currentPage < remainingPages);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\tif (context.options.persister) context.fetchFn = () => {\n\t\t\treturn context.options.persister?.(fetchFn, {\n\t\t\t\tclient: context.client,\n\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\tmeta: context.options.meta,\n\t\t\t\tsignal: context.signal\n\t\t\t}, query);\n\t\t};\n\t\telse context.fetchFn = fetchFn;\n\t} };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n\tconst lastIndex = pages.length - 1;\n\treturn pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n\treturn pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\n/**\n* Checks if there is a next page.\n*/\nfunction hasNextPage(options, data) {\n\tif (!data) return false;\n\treturn getNextPageParam(options, data) != null;\n}\n/**\n* Checks if there is a previous page.\n*/\nfunction hasPreviousPage(options, data) {\n\tif (!data || !options.getPreviousPageParam) return false;\n\treturn getPreviousPageParam(options, data) != null;\n}\n//#endregion\nexport { hasNextPage, hasPreviousPage, infiniteQueryBehavior };\n\n//# sourceMappingURL=infiniteQueryBehavior.js.map","import { ensureQueryFn, noop, replaceData, resolveQueryValue, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\n//#region src/query.ts\n/**\n* Represents a single cached query. A `Query` holds the query's key, options,\n* state (data/error/status), and the observers currently subscribed to it.\n*\n* Instances are created and managed internally by `QueryCache`; application\n* code typically interacts with queries indirectly through `QueryClient` or\n* a framework hook like `useQuery`. Direct access to a `Query` instance is\n* possible via `queryCache.find()`/`findAll()` for inspecting cache state.\n*\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n* const query = queryCache.find({ queryKey: ['posts'] })\n*\n* if (query) {\n* console.log(query.state.dataUpdatedAt)\n* }\n* ```\n*/\nvar Query = class extends Removable {\n\t#queryType;\n\t#initialState;\n\t#revertState;\n\t#cache;\n\t#client;\n\t#retryer;\n\t#defaultOptions;\n\t#abortSignalConsumed;\n\tconstructor(config) {\n\t\tsuper();\n\t\tthis.#abortSignalConsumed = false;\n\t\tthis.#defaultOptions = config.defaultOptions;\n\t\tthis.setOptions(config.options);\n\t\tthis.observers = [];\n\t\tthis.#client = config.client;\n\t\tthis.#cache = this.#client.getQueryCache();\n\t\tthis.queryKey = config.queryKey;\n\t\tthis.queryHash = config.queryHash;\n\t\tthis.#initialState = getDefaultState(this.options);\n\t\tthis.state = config.state ?? this.#initialState;\n\t\tthis.scheduleGc();\n\t}\n\t/**\n\t* The `meta` object passed in the query's options, if any.\n\t*/\n\tget meta() {\n\t\treturn this.options.meta;\n\t}\n\t/** @internal */\n\tget queryType() {\n\t\treturn this.#queryType;\n\t}\n\t/**\n\t* The promise for the currently in-flight fetch, if the query is fetching.\n\t* `undefined` when the query is not fetching.\n\t*/\n\tget promise() {\n\t\treturn this.#retryer?.promise;\n\t}\n\t/** @internal */\n\tsetOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.#defaultOptions,\n\t\t\t...options\n\t\t};\n\t\tif (options?._type) this.#queryType = options._type;\n\t\tthis.updateGcTime(this.options.gcTime);\n\t\tif (this.state && this.state.data === void 0) {\n\t\t\tconst defaultState = getDefaultState(this.options);\n\t\t\tif (defaultState.data !== void 0) {\n\t\t\t\tthis.setState(successState(defaultState.data, defaultState.dataUpdatedAt));\n\t\t\t\tthis.#initialState = defaultState;\n\t\t\t}\n\t\t}\n\t}\n\toptionalRemove() {\n\t\tif (!this.observers.length && this.state.fetchStatus === \"idle\") this.#cache.remove(this);\n\t}\n\t/** @internal */\n\tsetData(newData, options) {\n\t\tconst data = replaceData(this.state.data, newData, this.options);\n\t\tthis.#dispatch({\n\t\t\tdata,\n\t\t\ttype: \"success\",\n\t\t\tdataUpdatedAt: options?.updatedAt,\n\t\t\tmanual: options?.manual\n\t\t});\n\t\treturn data;\n\t}\n\t/**\n\t* Merges the given partial state directly into this query's state, notifying observers. Used\n\t* by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a\n\t* user manually trigger a loading/error state or edit the cached data.\n\t*/\n\tsetState(state) {\n\t\tthis.#dispatch({\n\t\t\ttype: \"setState\",\n\t\t\tstate\n\t\t});\n\t}\n\t/**\n\t* Cancels the query's currently in-flight fetch, if any.\n\t* - Returns a promise that resolves once the cancellation has settled.\n\t* - If no fetch is in progress, resolves immediately.\n\t*\n\t* @example\n\t* ```ts\n\t* await query.cancel()\n\t* ```\n\t*/\n\tcancel(options) {\n\t\tconst promise = this.#retryer?.promise;\n\t\tthis.#retryer?.cancel(options);\n\t\treturn promise ? promise.then(noop).catch(noop) : Promise.resolve();\n\t}\n\t/**\n\t* Clears the query's garbage collection timeout and silently cancels any\n\t* in-flight fetch. Called by `QueryCache` when the query is removed from\n\t* the cache.\n\t*\n\t* @see {@link Query#cancel}\n\t*/\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.cancel({ silent: true });\n\t}\n\t/** @internal */\n\tget resetState() {\n\t\treturn this.#initialState;\n\t}\n\t/**\n\t* Resets the query back to its initial state (the state it had when it was\n\t* first created, e.g. any `initialData`), destroying it first to cancel any\n\t* in-flight fetch.\n\t*/\n\treset() {\n\t\tthis.destroy();\n\t\tthis.setState(this.resetState);\n\t}\n\t/**\n\t* Returns `true` if the query has at least one observer for which `enabled`\n\t* does not resolve to `false`.\n\t*/\n\tisActive() {\n\t\treturn this.observers.some((observer) => resolveQueryValue(observer.options.enabled, this) !== false);\n\t}\n\t/**\n\t* Returns `true` if the query is disabled, meaning it will not fetch\n\t* automatically.\n\t* - If the query has observers, it is disabled when none of them are active\n\t* (see `isActive`).\n\t* - If the query has no observers, it is disabled when its `queryFn` is\n\t* `skipToken` or it has never been fetched.\n\t*/\n\tisDisabled() {\n\t\tif (this.getObserversCount() > 0) return !this.isActive();\n\t\treturn this.options.queryFn === skipToken || !this.isFetched();\n\t}\n\t/**\n\t* Returns `true` if the query has been fetched, i.e. it has resolved with\n\t* either data or an error at least once.\n\t*/\n\tisFetched() {\n\t\treturn this.state.dataUpdateCount + this.state.errorUpdateCount > 0;\n\t}\n\t/**\n\t* Returns `true` if the query has at least one observer configured with\n\t* `staleTime: 'static'`, meaning it is treated as never stale.\n\t*/\n\tisStatic() {\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => resolveQueryValue(observer.options.staleTime, this) === \"static\");\n\t\treturn false;\n\t}\n\t/**\n\t* Returns `true` if the query is stale.\n\t* - If the query has observers, defers to whether any observer's current\n\t* result reports `isStale` (which accounts for each observer's own\n\t* `staleTime` and `enabled` state).\n\t* - If the query has no observers, it is considered stale when it has no\n\t* data or has been invalidated.\n\t*\n\t* @see {@link Query#isStaleByTime}\n\t* @example\n\t* ```ts\n\t* if (query.isStale()) {\n\t* // refetch or otherwise treat the cached data as outdated\n\t* }\n\t* ```\n\t*/\n\tisStale() {\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);\n\t\treturn this.state.data === void 0 || this.state.isInvalidated;\n\t}\n\t/**\n\t* Returns `true` if the query's data is stale relative to the given\n\t* `staleTime` (defaults to `0`).\n\t* - A query with no data is always stale.\n\t* - `staleTime: 'static'` is never stale.\n\t* - An invalidated query is always stale.\n\t* - Otherwise, staleness is based on elapsed time since `dataUpdatedAt`.\n\t*\n\t* @see {@link Query#isStale}\n\t* @example\n\t* ```ts\n\t* const isStale = query.isStaleByTime(1000 * 60)\n\t* ```\n\t*/\n\tisStaleByTime(staleTime = 0) {\n\t\tif (this.state.data === void 0) return true;\n\t\tif (staleTime === \"static\") return false;\n\t\tif (this.state.isInvalidated) return true;\n\t\treturn !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n\t}\n\t/** @internal */\n\tonFocus() {\n\t\tthis.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/** @internal */\n\tonOnline() {\n\t\tthis.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/** @internal */\n\taddObserver(observer) {\n\t\tif (!this.observers.includes(observer)) {\n\t\t\tthis.observers.push(observer);\n\t\t\tthis.clearGcTimeout();\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerAdded\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/** @internal */\n\tremoveObserver(observer) {\n\t\tconst index = this.observers.indexOf(observer);\n\t\tif (index !== -1) {\n\t\t\tthis.observers.splice(index, 1);\n\t\t\tif (!this.observers.length) {\n\t\t\t\tif (this.#retryer) {\n\t\t\t\t\tif (this.#abortSignalConsumed || this.state.fetchStatus === \"paused\" && this.state.status === \"pending\") this.#retryer.cancel({ revert: true });\n\t\t\t\t\telse this.#retryer.cancelRetry();\n\t\t\t\t}\n\t\t\t\tthis.scheduleGc();\n\t\t\t}\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerRemoved\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Returns the number of observers currently subscribed to this query.\n\t*\n\t* @example\n\t* ```ts\n\t* if (query.getObserversCount() === 0) {\n\t* // no component is currently watching this query\n\t* }\n\t* ```\n\t*/\n\tgetObserversCount() {\n\t\treturn this.observers.length;\n\t}\n\t/**\n\t* Marks the query as invalidated, unless it is already invalidated. This\n\t* updates `state.isInvalidated` and notifies observers, but does not by\n\t* itself trigger a refetch.\n\t*\n\t* @example\n\t* ```ts\n\t* query.invalidate()\n\t* ```\n\t*/\n\tinvalidate() {\n\t\tif (!this.state.isInvalidated) this.#dispatch({ type: \"invalidate\" });\n\t}\n\t/**\n\t* Fetches the query, i.e. runs its `queryFn` (through any configured\n\t* retryer/behavior) and updates the query's state with the result.\n\t* - If a fetch is already in flight, returns its promise instead of\n\t* starting a new one, unless `fetchOptions.cancelRefetch` is set and the\n\t* query already has data, in which case the current fetch is silently\n\t* cancelled first.\n\t* - If `options` is passed, it replaces the query's current options\n\t* before fetching.\n\t*/\n\tasync fetch(options, fetchOptions) {\n\t\tif (this.state.fetchStatus !== \"idle\" && this.#retryer?.status() !== \"rejected\") {\n\t\t\tif (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });\n\t\t\telse if (this.#retryer) {\n\t\t\t\tthis.#retryer.continueRetry();\n\t\t\t\treturn this.#retryer.promise;\n\t\t\t}\n\t\t}\n\t\tif (options) this.setOptions(options);\n\t\tif (!this.options.queryFn) {\n\t\t\tconst observer = this.observers.find((x) => x.options.queryFn);\n\t\t\tif (observer) this.setOptions(observer.options);\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!Array.isArray(this.options.queryKey)) console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);\n\t\t}\n\t\tconst abortController = new AbortController();\n\t\tconst addSignalProperty = (object) => {\n\t\t\tObject.defineProperty(object, \"signal\", {\n\t\t\t\tenumerable: true,\n\t\t\t\tget: () => {\n\t\t\t\t\tthis.#abortSignalConsumed = true;\n\t\t\t\t\treturn abortController.signal;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst fetchFn = () => {\n\t\t\tconst queryFn = ensureQueryFn(this.options, fetchOptions);\n\t\t\tconst createQueryFnContext = () => {\n\t\t\t\tconst queryFnContext = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\t\tmeta: this.meta\n\t\t\t\t};\n\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\treturn queryFnContext;\n\t\t\t};\n\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\tthis.#abortSignalConsumed = false;\n\t\t\tif (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);\n\t\t\treturn queryFn(queryFnContext);\n\t\t};\n\t\tconst createFetchContext = () => {\n\t\t\tconst context = {\n\t\t\t\tfetchOptions,\n\t\t\t\toptions: this.options,\n\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\tclient: this.#client,\n\t\t\t\tstate: this.state,\n\t\t\t\tfetchFn\n\t\t\t};\n\t\t\taddSignalProperty(context);\n\t\t\treturn context;\n\t\t};\n\t\tconst context = createFetchContext();\n\t\t(this.#queryType === \"infinite\" ? infiniteQueryBehavior(this.options.pages) : this.options.behavior)?.onFetch(context, this);\n\t\tthis.#revertState = this.state;\n\t\tif (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({\n\t\t\ttype: \"fetch\",\n\t\t\tmeta: context.fetchOptions?.meta\n\t\t});\n\t\tconst retryer = this.#retryer = createRetryer({\n\t\t\tinitialPromise: fetchOptions?.initialPromise,\n\t\t\tfn: context.fetchFn,\n\t\t\tonCancel: (error) => {\n\t\t\t\tif (error instanceof CancelledError && error.revert) this.setState({\n\t\t\t\t\t...this.#revertState,\n\t\t\t\t\tfetchStatus: \"idle\"\n\t\t\t\t});\n\t\t\t\tabortController.abort();\n\t\t\t},\n\t\t\tonFail: (failureCount, error) => {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"failed\",\n\t\t\t\t\tfailureCount,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t},\n\t\t\tonPause: () => {\n\t\t\t\tthis.#dispatch({ type: \"pause\" });\n\t\t\t},\n\t\t\tonContinue: () => {\n\t\t\t\tthis.#dispatch({ type: \"continue\" });\n\t\t\t},\n\t\t\tretry: context.options.retry,\n\t\t\tretryDelay: context.options.retryDelay,\n\t\t\tnetworkMode: context.options.networkMode,\n\t\t\tcanRun: () => true\n\t\t});\n\t\ttry {\n\t\t\tconst data = await retryer.start();\n\t\t\tif (data === void 0) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);\n\t\t\t\tthrow new Error(`${this.queryHash} data is undefined`);\n\t\t\t}\n\t\t\tthis.setData(data);\n\t\t\tthis.#cache.config.onSuccess?.(data, this);\n\t\t\tthis.#cache.config.onSettled?.(data, this.state.error, this);\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\tif (error instanceof CancelledError) {\n\t\t\t\tif (error.silent) return this.#retryer.promise;\n\t\t\t\telse if (error.revert) {\n\t\t\t\t\tif (this.state.data === void 0) throw error;\n\t\t\t\t\treturn this.state.data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"error\",\n\t\t\t\terror\n\t\t\t});\n\t\t\tthis.#cache.config.onError?.(error, this);\n\t\t\tthis.#cache.config.onSettled?.(this.state.data, error, this);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.#retryer === retryer) this.#retryer = void 0;\n\t\t\tthis.scheduleGc();\n\t\t}\n\t}\n\t#dispatch(action) {\n\t\tconst reducer = (state) => {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase \"failed\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchFailureCount: action.failureCount,\n\t\t\t\t\tfetchFailureReason: action.error\n\t\t\t\t};\n\t\t\t\tcase \"pause\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"paused\"\n\t\t\t\t};\n\t\t\t\tcase \"continue\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"fetching\"\n\t\t\t\t};\n\t\t\t\tcase \"fetch\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...fetchState(state.data, this.options),\n\t\t\t\t\tfetchMeta: action.meta ?? null\n\t\t\t\t};\n\t\t\t\tcase \"success\":\n\t\t\t\t\tconst newState = {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\t...successState(action.data, action.dataUpdatedAt),\n\t\t\t\t\t\tdataUpdateCount: state.dataUpdateCount + 1,\n\t\t\t\t\t\t...!action.manual && {\n\t\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\t\tfetchFailureCount: 0,\n\t\t\t\t\t\t\tfetchFailureReason: null\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis.#revertState = action.manual ? newState : void 0;\n\t\t\t\t\treturn newState;\n\t\t\t\tcase \"error\":\n\t\t\t\t\tconst error = action.error;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorUpdateCount: state.errorUpdateCount + 1,\n\t\t\t\t\t\terrorUpdatedAt: Date.now(),\n\t\t\t\t\t\tfetchFailureCount: state.fetchFailureCount + 1,\n\t\t\t\t\t\tfetchFailureReason: error,\n\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\tisInvalidated: true\n\t\t\t\t\t};\n\t\t\t\tcase \"invalidate\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisInvalidated: true\n\t\t\t\t};\n\t\t\t\tcase \"setState\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...action.state\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\tthis.state = reducer(this.state);\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.observers.slice().forEach((observer) => {\n\t\t\t\tobserver.onQueryUpdate();\n\t\t\t});\n\t\t\tthis.#cache.notify({\n\t\t\t\tquery: this,\n\t\t\t\ttype: \"updated\",\n\t\t\t\taction\n\t\t\t});\n\t\t});\n\t}\n};\nfunction fetchState(data, options) {\n\treturn {\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n\t\t...data === void 0 && {\n\t\t\terror: null,\n\t\t\tstatus: \"pending\"\n\t\t}\n\t};\n}\nfunction successState(data, dataUpdatedAt) {\n\treturn {\n\t\tdata,\n\t\tdataUpdatedAt: dataUpdatedAt ?? Date.now(),\n\t\terror: null,\n\t\tisInvalidated: false,\n\t\tstatus: \"success\"\n\t};\n}\nfunction getDefaultState(options) {\n\tconst data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n\tconst hasData = data !== void 0;\n\tconst initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n\treturn {\n\t\tdata,\n\t\tdataUpdateCount: 0,\n\t\tdataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n\t\terror: null,\n\t\terrorUpdateCount: 0,\n\t\terrorUpdatedAt: 0,\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchMeta: null,\n\t\tisInvalidated: false,\n\t\tstatus: hasData ? \"success\" : \"pending\",\n\t\tfetchStatus: \"idle\"\n\t};\n}\n//#endregion\nexport { Query, fetchState };\n\n//# sourceMappingURL=query.js.map","import { notifyManager } from \"./notifyManager.js\";\nimport { createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\n//#region src/mutation.ts\n/**\n* Represents a single mutation attempt. A `Mutation` holds the mutation's\n* options, state (data/error/status), and the `MutationObserver`s currently\n* subscribed to it.\n*\n* Instances are created and managed internally by `MutationCache`; application\n* code typically interacts with mutations indirectly through `QueryClient` or\n* a framework hook like `useMutation`. Direct access to a `Mutation` instance\n* is possible via `mutationCache.find()`/`getAll()` for inspecting cache state.\n*\n* @example\n* ```ts\n* const mutationCache = queryClient.getMutationCache()\n*\n* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n* ```\n*/\nvar Mutation = class extends Removable {\n\t#client;\n\t#observers;\n\t#mutationCache;\n\t#retryer;\n\tconstructor(config) {\n\t\tsuper();\n\t\tthis.#client = config.client;\n\t\tthis.mutationId = config.mutationId;\n\t\tthis.#mutationCache = config.mutationCache;\n\t\tthis.#observers = [];\n\t\tthis.state = config.state || getDefaultState();\n\t\tthis.setOptions(config.options);\n\t\tthis.scheduleGc();\n\t}\n\t/** @internal */\n\tsetOptions(options) {\n\t\tthis.options = options;\n\t\tthis.updateGcTime(this.options.gcTime);\n\t}\n\t/**\n\t* The `meta` object passed in the mutation's options, if any.\n\t*/\n\tget meta() {\n\t\treturn this.options.meta;\n\t}\n\t/** @internal */\n\taddObserver(observer) {\n\t\tif (!this.#observers.includes(observer)) {\n\t\t\tthis.#observers.push(observer);\n\t\t\tthis.clearGcTimeout();\n\t\t\tthis.#mutationCache.notify({\n\t\t\t\ttype: \"observerAdded\",\n\t\t\t\tmutation: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/** @internal */\n\tremoveObserver(observer) {\n\t\tthis.#observers = this.#observers.filter((x) => x !== observer);\n\t\tthis.scheduleGc();\n\t\tthis.#mutationCache.notify({\n\t\t\ttype: \"observerRemoved\",\n\t\t\tmutation: this,\n\t\t\tobserver\n\t\t});\n\t}\n\toptionalRemove() {\n\t\tif (!this.#observers.length) {\n\t\t\tif (this.state.status === \"pending\") this.scheduleGc();\n\t\t\telse this.#mutationCache.remove(this);\n\t\t}\n\t}\n\t/**\n\t* Resumes a mutation that is currently paused or was restored from a\n\t* dehydrated, still-`pending` state.\n\t*\n\t* - If this mutation has an active retryer (it paused mid-attempt, e.g. due\n\t* to the network mode or scope-based queuing), its retryer is resumed.\n\t* - Otherwise, if the mutation's status is still `pending` (e.g. it was\n\t* dehydrated while an attempt was in flight and never got a retryer in\n\t* this instance), `execute` is called again with the last known variables.\n\t* - Otherwise the mutation has already settled and this resolves immediately\n\t* without running anything again.\n\t*\n\t* @example\n\t* ```ts\n\t* // typically driven by reconnect handling, e.g. queryClient.resumePausedMutations()\n\t* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n\t* await mutation?.continue()\n\t* ```\n\t*\n\t* @see {@link Mutation#execute}\n\t*/\n\tcontinue() {\n\t\treturn this.#retryer?.continue() ?? (this.state.status === \"pending\" ? this.execute(this.state.variables) : Promise.resolve());\n\t}\n\t/**\n\t* Runs the mutation function for the given variables through a retryer, and\n\t* drives the mutation's state and lifecycle callbacks through to settlement.\n\t*\n\t* If this mutation's state is already `pending` when `execute` is called\n\t* (i.e. it was restored, still in-flight, from a dehydrated state), the\n\t* `onMutate` step is skipped and a `continue` action is dispatched to\n\t* unpause it; otherwise a `pending` action is dispatched first, then the\n\t* mutation cache's `onMutate` and the mutation's own `onMutate` option are\n\t* awaited in that order, and the resulting context is stored.\n\t*\n\t* The mutation function is then run (subject to `retry`/`retryDelay`/\n\t* `networkMode`, and to the mutation cache's scope-based serialization).\n\t* On success, the cache's `onSuccess`/`onSettled` callbacks run before the\n\t* mutation's own `onSuccess`/`onSettled` options, a `success` action is\n\t* dispatched, and the resolved data is returned. On failure, the same\n\t* cache-then-option ordering is used for `onError`/`onSettled`, but each of\n\t* those four callbacks is individually caught so that a throwing callback\n\t* cannot mask the original error; an `error` action is then dispatched and\n\t* the original error is re-thrown.\n\t*\n\t* @example\n\t* ```ts\n\t* // Called internally by `MutationObserver.mutate` and `Mutation.continue` —\n\t* // applications normally trigger mutations through those, not this method.\n\t* const data = await mutation.execute(variables)\n\t* ```\n\t*\n\t* @see {@link Mutation#continue}\n\t*/\n\tasync execute(variables) {\n\t\tconst onContinue = () => {\n\t\t\tthis.#dispatch({ type: \"continue\" });\n\t\t};\n\t\tconst mutationFnContext = {\n\t\t\tclient: this.#client,\n\t\t\tmeta: this.options.meta,\n\t\t\tmutationKey: this.options.mutationKey\n\t\t};\n\t\tconst retryer = this.#retryer = createRetryer({\n\t\t\tfn: () => {\n\t\t\t\tif (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error(\"No mutationFn found\"));\n\t\t\t\treturn this.options.mutationFn(variables, mutationFnContext);\n\t\t\t},\n\t\t\tonFail: (failureCount, error) => {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"failed\",\n\t\t\t\t\tfailureCount,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t},\n\t\t\tonPause: () => {\n\t\t\t\tthis.#dispatch({ type: \"pause\" });\n\t\t\t},\n\t\t\tonContinue,\n\t\t\tretry: this.options.retry ?? 0,\n\t\t\tretryDelay: this.options.retryDelay,\n\t\t\tnetworkMode: this.options.networkMode,\n\t\t\tcanRun: () => this.#mutationCache.canRun(this)\n\t\t});\n\t\tconst restored = this.state.status === \"pending\";\n\t\tconst isPaused = !retryer.canStart();\n\t\ttry {\n\t\t\tif (restored) onContinue();\n\t\t\telse {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"pending\",\n\t\t\t\t\tvariables,\n\t\t\t\t\tisPaused\n\t\t\t\t});\n\t\t\t\tif (this.#mutationCache.config.onMutate) await this.#mutationCache.config.onMutate(variables, this, mutationFnContext);\n\t\t\t\tconst context = await this.options.onMutate?.(variables, mutationFnContext);\n\t\t\t\tif (context !== this.state.context) this.#dispatch({\n\t\t\t\t\ttype: \"pending\",\n\t\t\t\t\tcontext,\n\t\t\t\t\tvariables,\n\t\t\t\t\tisPaused\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = await retryer.start();\n\t\t\tawait this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);\n\t\t\tawait this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);\n\t\t\tawait this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);\n\t\t\tawait this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"success\",\n\t\t\t\tdata\n\t\t\t});\n\t\t\treturn data;\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait this.#mutationCache.config.onError?.(error, variables, this.state.context, this, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.options.onError?.(error, variables, this.state.context, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);\n\t\t\t} catch (e) {\n\t\t\t\tPromise.reject(e);\n\t\t\t}\n\t\t\tthis.#dispatch({\n\t\t\t\ttype: \"error\",\n\t\t\t\terror\n\t\t\t});\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.#retryer === retryer) this.#retryer = void 0;\n\t\t\tthis.#mutationCache.runNext(this);\n\t\t}\n\t}\n\t#dispatch(action) {\n\t\tconst reducer = (state) => {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase \"failed\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfailureCount: action.failureCount,\n\t\t\t\t\tfailureReason: action.error\n\t\t\t\t};\n\t\t\t\tcase \"pause\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisPaused: true\n\t\t\t\t};\n\t\t\t\tcase \"continue\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisPaused: false\n\t\t\t\t};\n\t\t\t\tcase \"pending\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tcontext: action.context,\n\t\t\t\t\tdata: void 0,\n\t\t\t\t\tfailureCount: 0,\n\t\t\t\t\tfailureReason: null,\n\t\t\t\t\terror: null,\n\t\t\t\t\tisPaused: action.isPaused,\n\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\tvariables: action.variables,\n\t\t\t\t\tsubmittedAt: Date.now()\n\t\t\t\t};\n\t\t\t\tcase \"success\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tdata: action.data,\n\t\t\t\t\tfailureCount: 0,\n\t\t\t\t\tfailureReason: null,\n\t\t\t\t\terror: null,\n\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\tisPaused: false\n\t\t\t\t};\n\t\t\t\tcase \"error\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tdata: void 0,\n\t\t\t\t\terror: action.error,\n\t\t\t\t\tfailureCount: state.failureCount + 1,\n\t\t\t\t\tfailureReason: action.error,\n\t\t\t\t\tisPaused: false,\n\t\t\t\t\tstatus: \"error\"\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\tthis.state = reducer(this.state);\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.#observers.forEach((observer) => {\n\t\t\t\tobserver.onMutationUpdate(action);\n\t\t\t});\n\t\t\tthis.#mutationCache.notify({\n\t\t\t\tmutation: this,\n\t\t\t\ttype: \"updated\",\n\t\t\t\taction\n\t\t\t});\n\t\t});\n\t}\n};\nfunction getDefaultState() {\n\treturn {\n\t\tcontext: void 0,\n\t\tdata: void 0,\n\t\terror: null,\n\t\tfailureCount: 0,\n\t\tfailureReason: null,\n\t\tisPaused: false,\n\t\tstatus: \"idle\",\n\t\tvariables: void 0,\n\t\tsubmittedAt: 0\n\t};\n}\n//#endregion\nexport { Mutation, getDefaultState };\n\n//# sourceMappingURL=mutation.js.map","import { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\n//#region src/mutationCache.ts\n/**\n* The `MutationCache` is the storage for mutations.\n*\n* Normally, you will not interact with the `MutationCache` directly and instead use a\n* `QueryClient`. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as mutations being added, removed, or updated.\n*\n* @example\n* ```ts\n* const unsubscribe = mutationCache.subscribe((event) => {\n* console.log(event.type, event.mutation)\n* })\n* ```\n*/\nvar MutationCache = class extends Subscribable {\n\t#mutations;\n\t#scopes;\n\t#mutationId;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#mutations = /* @__PURE__ */ new Set();\n\t\tthis.#scopes = /* @__PURE__ */ new Map();\n\t\tthis.#mutationId = 0;\n\t}\n\t/** @internal */\n\tbuild(client, options, state) {\n\t\tconst mutation = new Mutation({\n\t\t\tclient,\n\t\t\tmutationCache: this,\n\t\t\tmutationId: ++this.#mutationId,\n\t\t\toptions: client.defaultMutationOptions(options),\n\t\t\tstate\n\t\t});\n\t\tthis.add(mutation);\n\t\treturn mutation;\n\t}\n\t/** @internal */\n\tadd(mutation) {\n\t\tthis.#mutations.add(mutation);\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\tif (scopedMutations) scopedMutations.push(mutation);\n\t\t\telse this.#scopes.set(scope, [mutation]);\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"added\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tremove(mutation) {\n\t\tif (this.#mutations.delete(mutation)) {\n\t\t\tconst scope = scopeFor(mutation);\n\t\t\tif (typeof scope === \"string\") {\n\t\t\t\tconst scopedMutations = this.#scopes.get(scope);\n\t\t\t\tif (scopedMutations) {\n\t\t\t\t\tif (scopedMutations.length > 1) {\n\t\t\t\t\t\tconst index = scopedMutations.indexOf(mutation);\n\t\t\t\t\t\tif (index !== -1) scopedMutations.splice(index, 1);\n\t\t\t\t\t} else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.notify({\n\t\t\ttype: \"removed\",\n\t\t\tmutation\n\t\t});\n\t}\n\t/** @internal */\n\tcanRun(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") {\n\t\t\tconst firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === \"pending\");\n\t\t\treturn !firstPendingMutation || firstPendingMutation === mutation;\n\t\t} else return true;\n\t}\n\t/** @internal */\n\trunNext(mutation) {\n\t\tconst scope = scopeFor(mutation);\n\t\tif (typeof scope === \"string\") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();\n\t\telse return Promise.resolve();\n\t}\n\t/**\n\t* Removes all mutations from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* mutationCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.#mutations.forEach((mutation) => {\n\t\t\t\tthis.notify({\n\t\t\t\t\ttype: \"removed\",\n\t\t\t\t\tmutation\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.#mutations.clear();\n\t\t\tthis.#scopes.clear();\n\t\t});\n\t}\n\t/**\n\t* Returns all mutations within the cache.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn Array.from(this.#mutations);\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing mutation instance from\n\t* the cache. If the mutation does not exist, `undefined` is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a mutation in rare scenarios.\n\t*\n\t* @see {@link MutationCache#findAll}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutation = mutationCache.find({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing mutation instances from the\n\t* cache that match the given filters. If no mutations match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about mutations in rare scenarios.\n\t*\n\t* @see {@link MutationCache#find}\n\t* @example\n\t* ```ts\n\t* const mutationCache = queryClient.getMutationCache()\n\t*\n\t* const mutations = mutationCache.findAll({ mutationKey: ['addPost'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\treturn this.getAll().filter((mutation) => matchMutation(filters, mutation));\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tresumePausedMutations() {\n\t\tconst pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n\t\treturn notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));\n\t}\n};\nfunction scopeFor(mutation) {\n\treturn mutation.options.scope?.id;\n}\n//#endregion\nexport { MutationCache };\n\n//# sourceMappingURL=mutationCache.js.map","import { hashKey, shallowEqualObjects } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { getDefaultState } from \"./mutation.js\";\n//#region src/mutationObserver.ts\n/**\n* Observes a single mutation and derives a `MutationObserverResult` from it.\n* A framework hook like `useMutation` creates one `MutationObserver` per hook\n* call, keeps it stable across re-renders, calls `setOptions` when the options\n* passed to the hook change, subscribes to it to re-render on updates, and\n* reads `getCurrentResult()` for the value to return. Calling `mutate()`\n* builds a new underlying `Mutation` in the `MutationCache` and executes it.\n*\n* @example\n* ```ts\n* const observer = new MutationObserver(queryClient, {\n* mutationFn: (variables: { title: string }) => addPost(variables),\n* })\n* ```\n*/\nvar MutationObserver = class extends Subscribable {\n\t#client;\n\t#currentResult = void 0;\n\t#currentMutation;\n\t#mutateOptions;\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.#client = client;\n\t\tthis.setOptions(options);\n\t\tthis.bindMethods();\n\t\tthis.#updateResult();\n\t}\n\tbindMethods() {\n\t\tthis.mutate = this.mutate.bind(this);\n\t\tthis.reset = this.reset.bind(this);\n\t}\n\t/**\n\t* Updates the observer's options.\n\t*\n\t* If the new `mutationKey` differs from the previous one (and both were\n\t* defined), the observer is reset, detaching it from the mutation it was\n\t* observing. Otherwise, if the currently observed mutation is still\n\t* `pending`, its options are updated in place as well.\n\t*\n\t* @example\n\t* ```ts\n\t* observer.setOptions({\n\t* mutationFn: (variables: { title: string }) => addPost(variables),\n\t* onSuccess: (data) => console.log(data),\n\t* })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tthis.options = this.#client.defaultMutationOptions(options);\n\t\tif (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tmutation: this.#currentMutation,\n\t\t\tobserver: this\n\t\t});\n\t\tif (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();\n\t\telse if (this.#currentMutation?.state.status === \"pending\") this.#currentMutation.setOptions(this.options);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1 && this.#currentMutation) {\n\t\t\tthis.#currentMutation.addObserver(this);\n\t\t\tthis.#updateResult();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.#currentMutation?.removeObserver(this);\n\t}\n\t/** @internal */\n\tonMutationUpdate(action) {\n\t\tthis.#updateResult();\n\t\tthis.#notify(action);\n\t}\n\t/**\n\t* Returns the observer's current result, derived from the observed\n\t* mutation's state (or the default, `idle` state if no mutation has been\n\t* built yet, e.g. before the first `mutate()` call or after `reset()`).\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Detaches the observer from the mutation it is currently observing (if\n\t* any) and resets the observed result back to its default, `idle` state.\n\t*\n\t* This does not cancel an in-flight mutation; the mutation itself keeps\n\t* running to completion and its own callbacks still fire, but this\n\t* observer stops reflecting its state and a subsequent `mutate()` call\n\t* will build a brand new mutation.\n\t*\n\t* @example\n\t* ```ts\n\t* observer.reset()\n\t* ```\n\t*\n\t* @see {@link MutationObserver#mutate}\n\t*/\n\treset() {\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = void 0;\n\t\tthis.#updateResult();\n\t\tthis.#notify();\n\t}\n\t/**\n\t* Builds a new `Mutation` in the `MutationCache` using the observer's\n\t* current options, detaches this observer from any previously observed\n\t* mutation, attaches it to the new one, and executes it with the given\n\t* variables.\n\t*\n\t* The optional per-call `options` (`onSuccess`/`onError`/`onSettled`) are\n\t* invoked once the mutation settles, in addition to any callbacks defined\n\t* on the observer's own options.\n\t*\n\t* @example\n\t* ```ts\n\t* await observer.mutate(\n\t* { title: 'New post' },\n\t* { onSuccess: (data) => console.log(data) },\n\t* )\n\t* ```\n\t*/\n\tmutate(variables, options) {\n\t\tthis.#mutateOptions = options;\n\t\tthis.#currentMutation?.removeObserver(this);\n\t\tthis.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n\t\tthis.#currentMutation.addObserver(this);\n\t\treturn this.#currentMutation.execute(variables);\n\t}\n\t#updateResult() {\n\t\tconst state = this.#currentMutation?.state ?? getDefaultState();\n\t\tthis.#currentResult = {\n\t\t\t...state,\n\t\t\tisPending: state.status === \"pending\",\n\t\t\tisSuccess: state.status === \"success\",\n\t\t\tisError: state.status === \"error\",\n\t\t\tisIdle: state.status === \"idle\",\n\t\t\tmutate: this.mutate,\n\t\t\treset: this.reset\n\t\t};\n\t}\n\t#notify(action) {\n\t\tnotifyManager.batch(() => {\n\t\t\tif (this.#mutateOptions && this.hasListeners()) {\n\t\t\t\tconst variables = this.#currentResult.variables;\n\t\t\t\tconst onMutateResult = this.#currentResult.context;\n\t\t\t\tconst context = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tmeta: this.options.meta,\n\t\t\t\t\tmutationKey: this.options.mutationKey\n\t\t\t\t};\n\t\t\t\tif (action?.type === \"success\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.#mutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.#mutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t} else if (action?.type === \"error\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.#mutateOptions.onError?.(action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.#mutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tPromise.reject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t});\n\t}\n};\n//#endregion\nexport { MutationObserver };\n\n//# sourceMappingURL=mutationObserver.js.map","import { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Query } from \"./query.js\";\n//#region src/queryCache.ts\n/**\n* The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta\n* information, and state of the queries it contains.\n*\n* Normally, you will not interact with the `QueryCache` directly and instead use a `QueryClient`\n* for a specific cache. You can subscribe to it (inherited from `Subscribable`) to be informed of\n* safe/known updates to the cache, such as queries being added, removed, or updated — updates made\n* outside of the cache's own tracked mechanisms (e.g. mutating a query's state object directly) do\n* not notify subscribers.\n*\n* @example\n* ```ts\n* const unsubscribe = queryCache.subscribe((event) => {\n* console.log(event.type, event.query)\n* })\n* ```\n*/\nvar QueryCache = class extends Subscribable {\n\t#queries;\n\tconstructor(config = {}) {\n\t\tsuper();\n\t\tthis.config = config;\n\t\tthis.#queries = /* @__PURE__ */ new Map();\n\t}\n\t/**\n\t* Returns the existing `Query` instance for the given options' `queryKey`/`queryHash`, or\n\t* builds and adds a new one to the cache if none exists yet. Used by framework adapters and\n\t* plugins (e.g. broadcast/persistence) that need to get-or-create a `Query` directly, bypassing\n\t* the reactive `QueryObserver` machinery.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.build(queryClient, {\n\t* queryKey: ['posts'],\n\t* queryFn: fetchPosts,\n\t* })\n\t* ```\n\t*/\n\tbuild(client, options, state) {\n\t\tconst queryKey = options.queryKey;\n\t\tconst queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n\t\tlet query = this.get(queryHash);\n\t\tif (!query) {\n\t\t\tquery = new Query({\n\t\t\t\tclient,\n\t\t\t\tqueryKey,\n\t\t\t\tqueryHash,\n\t\t\t\toptions: client.defaultQueryOptions(options),\n\t\t\t\tstate,\n\t\t\t\tdefaultOptions: client.getQueryDefaults(queryKey)\n\t\t\t});\n\t\t\tthis.add(query);\n\t\t}\n\t\treturn query;\n\t}\n\t/** @internal */\n\tadd(query) {\n\t\tif (!this.#queries.has(query.queryHash)) {\n\t\t\tthis.#queries.set(query.queryHash, query);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"added\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Destroys the given `Query` and removes it from the cache, notifying subscribers with a\n\t* `'removed'` event. A no-op if the query is no longer the one currently stored under its hash\n\t* (e.g. it was already replaced). Used by plugins (e.g. the broadcast client) that mirror\n\t* removals across `QueryCache` instances.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t*\n\t* if (query) {\n\t* queryCache.remove(query)\n\t* }\n\t* ```\n\t*/\n\tremove(query) {\n\t\tif (this.#queries.get(query.queryHash) === query) {\n\t\t\tquery.destroy();\n\t\t\tthis.#queries.delete(query.queryHash);\n\t\t\tthis.notify({\n\t\t\t\ttype: \"removed\",\n\t\t\t\tquery\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Removes all queries from the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* queryCache.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tthis.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none\n\t* exists. Unlike {@link QueryCache#find}, this looks up by the already-computed hash rather\n\t* than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash\n\t* to look up directly.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queryHash = hashKey(['posts'])\n\t*\n\t* const query = queryCache.get(queryHash)\n\t* ```\n\t*/\n\tget(queryHash) {\n\t\treturn this.#queries.get(queryHash);\n\t}\n\t/**\n\t* Returns all queries within the cache.\n\t*\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.getAll()\n\t* ```\n\t*/\n\tgetAll() {\n\t\treturn [...this.#queries.values()];\n\t}\n\t/**\n\t* A slightly more advanced method that can be used to get an existing query instance from the\n\t* cache. This instance not only contains all the state for the query, but all of the instances,\n\t* and underlying guts of the query as well. If the query does not exist, `undefined` is\n\t* returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about a query in rare scenarios (e.g. looking at `query.state.dataUpdatedAt` to\n\t* decide whether a query is fresh enough to be used as an initial value).\n\t*\n\t* @see {@link QueryCache#findAll}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const query = queryCache.find({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfind(filters) {\n\t\tconst defaultedFilters = {\n\t\t\texact: true,\n\t\t\t...filters\n\t\t};\n\t\treturn this.getAll().find((query) => matchQuery(defaultedFilters, query));\n\t}\n\t/**\n\t* An even more advanced method that can be used to get existing query instances from the cache\n\t* that partially match a query key. If no queries match, an empty array is returned.\n\t*\n\t* This is not typically needed for most applications, but can come in handy when needing more\n\t* information about queries in rare scenarios.\n\t*\n\t* @see {@link QueryCache#find}\n\t* @example\n\t* ```ts\n\t* const queryCache = queryClient.getQueryCache()\n\t*\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tfindAll(filters = {}) {\n\t\tconst queries = this.getAll();\n\t\treturn Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n\t}\n\t/** @internal */\n\tnotify(event) {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(event);\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonFocus() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onFocus();\n\t\t\t});\n\t\t});\n\t}\n\t/** @internal */\n\tonOnline() {\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.getAll().forEach((query) => {\n\t\t\t\tquery.onOnline();\n\t\t\t});\n\t\t});\n\t}\n};\n//#endregion\nexport { QueryCache };\n\n//# sourceMappingURL=queryCache.js.map","import { functionalUpdate, hashKey, hashQueryKeyByOptions, noop, partialMatchKey, resolveQueryValue, skipToken } from \"./utils.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { QueryCache } from \"./queryCache.js\";\n//#region src/queryClient.ts\n/**\n* `QueryClient` is used to interact with a cache of queries and mutations. It owns a\n* `QueryCache` and a `MutationCache` (creating default ones if none are passed in) and holds\n* the default options that are applied to queries and mutations created through it.\n*\n* @example\n* ```ts\n* const queryClient = new QueryClient({\n* defaultOptions: {\n* queries: {\n* staleTime: Infinity,\n* },\n* },\n* })\n*\n* await queryClient.query({ queryKey: ['posts'], queryFn: fetchPosts })\n* ```\n*/\nvar QueryClient = class {\n\t#queryCache;\n\t#mutationCache;\n\t#defaultOptions;\n\t#queryDefaults;\n\t#mutationDefaults;\n\t#mountCount;\n\t#unsubscribeFocus;\n\t#unsubscribeOnline;\n\tconstructor(config = {}) {\n\t\tthis.#queryCache = config.queryCache || new QueryCache();\n\t\tthis.#mutationCache = config.mutationCache || new MutationCache();\n\t\tthis.#defaultOptions = config.defaultOptions || {};\n\t\tthis.#queryDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mutationDefaults = /* @__PURE__ */ new Map();\n\t\tthis.#mountCount = 0;\n\t}\n\t/**\n\t* Called by a framework adapter's `QueryClientProvider`-equivalent when it mounts, to start\n\t* listening for focus/online events and resume paused mutations. Ref-counted via an internal\n\t* mount count, so nested or multiple providers sharing the same `QueryClient` don't tear down\n\t* the shared listeners until the last one unmounts.\n\t*/\n\tmount() {\n\t\tthis.#mountCount++;\n\t\tif (this.#mountCount !== 1) return;\n\t\tthis.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n\t\t\tif (focused) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onFocus();\n\t\t\t}\n\t\t});\n\t\tthis.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n\t\t\tif (online) {\n\t\t\t\tawait this.resumePausedMutations();\n\t\t\t\tthis.#queryCache.onOnline();\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* The inverse of {@link QueryClient#mount} — called by a framework adapter's\n\t* `QueryClientProvider`-equivalent when it unmounts. Only tears down the focus/online\n\t* listeners once the mount count returns to `0`.\n\t*/\n\tunmount() {\n\t\tthis.#mountCount--;\n\t\tif (this.#mountCount !== 0) return;\n\t\tthis.#unsubscribeFocus?.();\n\t\tthis.#unsubscribeFocus = void 0;\n\t\tthis.#unsubscribeOnline?.();\n\t\tthis.#unsubscribeOnline = void 0;\n\t}\n\t/**\n\t* Returns the number of queries in the cache that are currently fetching, optionally\n\t* matching a set of filters. This includes background-fetching, loading new pages, and\n\t* loading more infinite query results.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isFetching()) {\n\t* console.log('At least one query is fetching!')\n\t* }\n\t* ```\n\t*/\n\tisFetching(filters) {\n\t\treturn this.#queryCache.findAll({\n\t\t\t...filters,\n\t\t\tfetchStatus: \"fetching\"\n\t\t}).length;\n\t}\n\t/**\n\t* Returns the number of mutations in the cache that are currently pending, optionally\n\t* matching a set of filters.\n\t*\n\t* @example\n\t* ```ts\n\t* if (queryClient.isMutating()) {\n\t* console.log('At least one mutation is pending!')\n\t* }\n\t* ```\n\t*/\n\tisMutating(filters) {\n\t\treturn this.#mutationCache.findAll({\n\t\t\t...filters,\n\t\t\tstatus: \"pending\"\n\t\t}).length;\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve data for a QueryKey.\n\t* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n\t*\n\t* Hint: Do not use this function inside a component, because it won't receive updates.\n\t* Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n\t*\n\t* @returns The cached data for the query, or `undefined` if no query with this key has been observed yet.\n\t* @see {@link QueryClient#getQueriesData}\n\t*/\n\tgetQueryData(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state.data;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureQueryData(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst cachedData = query.state.data;\n\t\tif (cachedData === void 0) return this.fetchQuery(options);\n\t\tif (options.revalidateIfStale && query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);\n\t\treturn Promise.resolve(cachedData);\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve the cached data of multiple queries at once.\n\t* Only queries matching the given filters are returned; if none match, an empty array is\n\t* returned.\n\t*\n\t* Because the matched queries can hold data of different shapes (e.g. a broad filter can match\n\t* queries with unrelated data types), the `TQueryFnData` generic defaults to `unknown` rather\n\t* than being inferred. Passing a more specific type is a convenience for call sites that know\n\t* every matched query holds the same shape — it is not checked against the actual cache\n\t* contents.\n\t*\n\t* @returns An array of query key and data pairs. The data is `undefined` for a query with no cached data.\n\t* @see {@link QueryClient#getQueryData}\n\t* @example\n\t* ```ts\n\t* const data = queryClient.getQueriesData({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueriesData(filters) {\n\t\treturn this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n\t\t\treturn [queryKey, state.data];\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update a query's cached data. If the updater (or the value\n\t* passed) resolves to `undefined`, the cache is left untouched and no query is created;\n\t* otherwise, if the query does not exist yet, it will be created. To update multiple queries\n\t* at once by partially matching query keys, use {@link QueryClient#setQueriesData} instead.\n\t*\n\t* Updates must be performed immutably: do not mutate `oldData`, or data previously retrieved\n\t* via {@link QueryClient#getQueryData}, in place.\n\t*\n\t* @param queryKey - The query key to set data for.\n\t* @param updater - Either the new data, or a function that receives the current data (which\n\t* may be `undefined`) and returns the new data.\n\t* @param options - Set `updatedAt` to override the timestamp the written data is recorded with.\n\t* @returns The data that was written, or `undefined` if the updater returned `undefined` — in that case\n\t* the write is skipped and the cache is left unchanged.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryData(['posts'], newPosts)\n\t*\n\t* // Or, using an updater function that receives the current data:\n\t* queryClient.setQueryData(['posts'], (oldPosts) => [...oldPosts, newPost])\n\t* ```\n\t*/\n\tsetQueryData(queryKey, updater, options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions({ queryKey });\n\t\tconst prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;\n\t\tconst data = functionalUpdate(updater, prevData);\n\t\tif (data === void 0) return;\n\t\treturn this.#queryCache.build(this, defaultedOptions).setData(data, {\n\t\t\t...options,\n\t\t\tmanual: true\n\t\t});\n\t}\n\t/**\n\t* Synchronous way to immediately update the cached data of multiple queries at once, using\n\t* filters or partial query key matching. Only queries that already exist and match the given\n\t* filters are updated; no new cache entries are created. Internally this calls\n\t* {@link QueryClient#setQueryData} for each matching query.\n\t*\n\t* @returns One `[queryKey, data]` tuple per matched query, in the same shape and with the same\n\t* `undefined` case as {@link QueryClient#setQueryData}.\n\t* @example\n\t* ```ts\n\t* queryClient.setQueriesData({ queryKey: ['posts'] }, (oldPosts) =>\n\t* oldPosts ? oldPosts.filter((post) => post.id !== deletedId) : oldPosts,\n\t* )\n\t* ```\n\t*/\n\tsetQueriesData(filters, updater, options) {\n\t\treturn notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));\n\t}\n\t/**\n\t* Imperative (non-reactive) way to retrieve an existing query's state. If the query does not\n\t* exist, `undefined` is returned.\n\t*\n\t* @example\n\t* ```ts\n\t* const state = queryClient.getQueryState(['posts'])\n\t* console.log(state?.dataUpdatedAt)\n\t* ```\n\t*/\n\tgetQueryState(queryKey) {\n\t\tconst options = this.defaultQueryOptions({ queryKey });\n\t\treturn this.#queryCache.get(options.queryHash)?.state;\n\t}\n\t/**\n\t* Removes queries from the cache that match the given filters. Unlike\n\t* {@link QueryClient#invalidateQueries} or {@link QueryClient#refetchQueries}, this removes\n\t* matching queries from the cache instead of refetching them. Without filters, every query in\n\t* the cache is removed.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.removeQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tremoveQueries(filters) {\n\t\tconst queryCache = this.#queryCache;\n\t\tnotifyManager.batch(() => {\n\t\t\tqueryCache.findAll(filters).forEach((query) => {\n\t\t\t\tqueryCache.remove(query);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Resets queries matching the given filters back to their initial state (e.g. any\n\t* `initialData`), notifying subscribers rather than removing them. Active queries among the\n\t* matched set are then refetched, and the returned promise resolves once that refetch settles.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.resetQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tresetQueries(filters, options) {\n\t\tconst queryCache = this.#queryCache;\n\t\treturn notifyManager.batch(() => {\n\t\t\tconst matched = queryCache.findAll(filters);\n\t\t\tconst queriesToRefetch = new Set(matched);\n\t\t\tmatched.forEach((query) => {\n\t\t\t\tquery.reset();\n\t\t\t});\n\t\t\treturn this.refetchQueries({\n\t\t\t\ttype: \"active\",\n\t\t\t\tpredicate: (query) => queriesToRefetch.has(query)\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Cancels outgoing fetches for queries matching the given filters. Most useful when performing\n\t* optimistic updates, since any outgoing refetch that resolves afterwards would otherwise\n\t* overwrite the optimistic update. By default (`revert: true`), a cancelled query's data is\n\t* reverted to its state before the outgoing fetch started.\n\t*\n\t* The returned promise never rejects, even if individual cancellations fail.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })\n\t* ```\n\t*/\n\tcancelQueries(filters, cancelOptions = {}) {\n\t\tconst defaultedCancelOptions = {\n\t\t\trevert: true,\n\t\t\t...cancelOptions\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));\n\t\treturn Promise.all(promises).then(noop).catch(noop);\n\t}\n\t/**\n\t* Marks queries matching the given filters as invalidated. Unlike\n\t* {@link QueryClient#removeQueries}, invalidated queries stay in the cache.\n\t*\n\t* Unless `filters.refetchType` is `'none'`, matching queries are then refetched via\n\t* {@link QueryClient#refetchQueries}, using `filters.refetchType` if set, otherwise\n\t* `filters.type`, otherwise `'active'`.\n\t*\n\t* @example\n\t* ```ts\n\t* await queryClient.invalidateQueries({ queryKey: ['posts'], refetchType: 'active' })\n\t* ```\n\t*/\n\tinvalidateQueries(filters, options = {}) {\n\t\treturn notifyManager.batch(() => {\n\t\t\tthis.#queryCache.findAll(filters).forEach((query) => {\n\t\t\t\tquery.invalidate();\n\t\t\t});\n\t\t\tif (filters?.refetchType === \"none\") return Promise.resolve();\n\t\t\treturn this.refetchQueries({\n\t\t\t\t...filters,\n\t\t\t\ttype: filters?.refetchType ?? filters?.type ?? \"active\"\n\t\t\t}, options);\n\t\t});\n\t}\n\t/**\n\t* Refetches queries matching the given filters, regardless of whether they are stale. Without\n\t* filters, every query in the cache is refetched. Queries that are disabled, or static (only\n\t* have observers with a static `staleTime`), are never refetched.\n\t*\n\t* By default (`cancelRefetch: true`), a currently running fetch is cancelled before the new\n\t* one starts. The returned promise resolves once all matching queries have settled; it does\n\t* not reject on individual query failures unless `throwOnError` is set.\n\t*\n\t* @example\n\t* ```ts\n\t* // refetch all active queries partially matching a query key:\n\t* await queryClient.refetchQueries({ queryKey: ['posts'], type: 'active' })\n\t* ```\n\t*/\n\trefetchQueries(filters, options = {}) {\n\t\tconst fetchOptions = {\n\t\t\t...options,\n\t\t\tcancelRefetch: options.cancelRefetch ?? true\n\t\t};\n\t\tconst promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {\n\t\t\tlet promise = query.fetch(void 0, fetchOptions);\n\t\t\tif (!fetchOptions.throwOnError) promise = promise.catch(noop);\n\t\t\treturn query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n\t\t}));\n\t\treturn Promise.all(promises).then(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache a query, resolving with the data or throwing with\n\t* the error.\n\t*\n\t* If the query already exists in the cache and its data is not stale (per the given\n\t* `staleTime`), the cached data is returned without fetching. Otherwise, the query is fetched\n\t* and the promise resolves once the fetch settles. If a `select` function is provided, it is\n\t* applied to the data in both cases (cached or freshly fetched) before it is returned.\n\t*\n\t* Unlike a reactive observer, retries are disabled by default here (`retry: false`) unless\n\t* explicitly configured, since there is no component to catch a thrown error and retry through\n\t* re-render.\n\t*\n\t* The accepted options are `QueryObserverOptions` minus the fields that only make sense for a\n\t* reactive observer — `enabled`, `refetchInterval`, `refetchIntervalInBackground`,\n\t* `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchOnMount`, `retryOnMount`,\n\t* `notifyOnChangeProps`, `throwOnError`, `suspense`, and `placeholderData` are not part of this\n\t* method's options.\n\t*\n\t* This method replaces the deprecated `fetchQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.query({ queryKey, queryFn, staleTime: 10000 })\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tasync query(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\tconst queryData = query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? await query.fetch(defaultedOptions) : query.state.data;\n\t\tconst select = defaultedOptions.select;\n\t\tif (select) return select(queryData);\n\t\treturn queryData;\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchQuery(options) {\n\t\tconst defaultedOptions = this.defaultQueryOptions(options);\n\t\tif (defaultedOptions.retry === void 0) defaultedOptions.retry = false;\n\t\tconst query = this.#queryCache.build(this, defaultedOptions);\n\t\treturn query.isStaleByTime(resolveQueryValue(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n\t}\n\t/**\n\t* @deprecated Use queryClient.query(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchQuery(options) {\n\t\treturn this.fetchQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* Asynchronous method to fetch and cache an infinite query, resolving with an\n\t* {@link InfiniteData} object or throwing with the error.\n\t*\n\t* Behaves like {@link QueryClient#query}, accepting the same options (minus\n\t* `initialPageParam`), plus the required `initialPageParam`, and an optional `pages` /\n\t* `getNextPageParam` pair used to refetch a fixed number of pages from the start.\n\t*\n\t* This method replaces the deprecated `fetchInfiniteQuery`, and — combined with\n\t* `{ staleTime: 'static' }` — the deprecated `ensureInfiniteQueryData`.\n\t*\n\t* @example\n\t* ```ts\n\t* try {\n\t* const data = await queryClient.infiniteQuery({ queryKey, queryFn, initialPageParam: 0 })\n\t* console.log(data.pages)\n\t* } catch (error) {\n\t* console.log(error)\n\t* }\n\t* ```\n\t*/\n\tinfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.query(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. This method will be removed in the next major version.\n\t*/\n\tfetchInfiniteQuery(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.fetchQuery(options);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery(options) instead. You can swallow errors with `.catch(noop)`. This method will be removed in the next major version.\n\t*/\n\tprefetchInfiniteQuery(options) {\n\t\treturn this.fetchInfiniteQuery(options).then(noop).catch(noop);\n\t}\n\t/**\n\t* @deprecated Use queryClient.infiniteQuery({ ...options, staleTime: 'static' }) instead. This method will be removed in the next major version.\n\t*/\n\tensureInfiniteQueryData(options) {\n\t\toptions._type = \"infinite\";\n\t\treturn this.ensureQueryData(options);\n\t}\n\t/**\n\t* Resumes mutations that were paused because there was no network connection. Does nothing\n\t* (resolving immediately) if the client is currently offline.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* await queryClient.resumePausedMutations()\n\t* ```\n\t*/\n\tresumePausedMutations() {\n\t\tif (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t* Returns the query cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const queryCache = queryClient.getQueryCache()\n\t* const queries = queryCache.findAll({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tgetQueryCache() {\n\t\treturn this.#queryCache;\n\t}\n\t/**\n\t* Returns the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const mutationCache = queryClient.getMutationCache()\n\t* const mutations = mutationCache.findAll({ status: 'pending' })\n\t* ```\n\t*/\n\tgetMutationCache() {\n\t\treturn this.#mutationCache;\n\t}\n\t/**\n\t* Returns the default options that were set when creating the client, or via\n\t* {@link QueryClient#setDefaultOptions}.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* const defaultOptions = queryClient.getDefaultOptions()\n\t* ```\n\t*/\n\tgetDefaultOptions() {\n\t\treturn this.#defaultOptions;\n\t}\n\t/**\n\t* Dynamically sets the default options for this client, overwriting any previously defined\n\t* default options.\n\t*\n\t* @see {@link QueryClient#getDefaultOptions}\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.setDefaultOptions({\n\t* queries: {\n\t* staleTime: Infinity,\n\t* },\n\t* })\n\t* ```\n\t*/\n\tsetDefaultOptions(options) {\n\t\tthis.#defaultOptions = options;\n\t}\n\t/**\n\t* Sets default options for queries whose query key partially matches the given `queryKey`.\n\t*\n\t* If several registered query defaults match a given query key, they are merged together in\n\t* registration order by {@link QueryClient#getQueryDefaults}, so register defaults from the\n\t* most generic key to the least generic one — more specific defaults should be registered\n\t* after more generic ones so they take precedence.\n\t*\n\t* @example\n\t* ```ts\n\t* queryClient.setQueryDefaults(['posts'], { queryFn: fetchPosts })\n\t*\n\t* await queryClient.query({ queryKey: ['posts'] })\n\t* ```\n\t*/\n\tsetQueryDefaults(queryKey, options) {\n\t\tthis.#queryDefaults.set(hashKey(queryKey), {\n\t\t\tqueryKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for queries whose query key partially matches the\n\t* given `queryKey`, via {@link QueryClient#setQueryDefaults}. If multiple registered defaults\n\t* match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getQueryDefaults(['posts'])\n\t* ```\n\t*/\n\tgetQueryDefaults(queryKey) {\n\t\tconst defaults = [...this.#queryDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Sets default options for mutations whose mutation key partially matches the given\n\t* `mutationKey`. As with {@link QueryClient#setQueryDefaults}, the order of registration\n\t* matters when several registered defaults match the same mutation key.\n\t*\n\t* @see {@link QueryClient#getMutationDefaults}\n\t* @example\n\t* ```ts\n\t* queryClient.setMutationDefaults(['addPost'], { mutationFn: addPost })\n\t* ```\n\t*/\n\tsetMutationDefaults(mutationKey, options) {\n\t\tthis.#mutationDefaults.set(hashKey(mutationKey), {\n\t\t\tmutationKey,\n\t\t\tdefaultOptions: options\n\t\t});\n\t}\n\t/**\n\t* Returns the default options registered for mutations whose mutation key partially matches\n\t* the given `mutationKey`, via {@link QueryClient#setMutationDefaults}. If multiple registered\n\t* defaults match, they are merged together in registration order.\n\t*\n\t* @example\n\t* ```ts\n\t* const defaultOptions = queryClient.getMutationDefaults(['addPost'])\n\t* ```\n\t*/\n\tgetMutationDefaults(mutationKey) {\n\t\tconst defaults = [...this.#mutationDefaults.values()];\n\t\tconst result = {};\n\t\tdefaults.forEach((queryDefault) => {\n\t\t\tif (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);\n\t\t});\n\t\treturn result;\n\t}\n\t/**\n\t* Called by framework adapters (e.g. inside `useQuery`) to resolve the options passed by the\n\t* caller into their final, defaulted form: merging `queryClient.setQueryDefaults` for the\n\t* given `queryKey`, then the client's own `defaultOptions.queries`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultQueryOptions(options) {\n\t\tif (options._defaulted) return options;\n\t\tconst defaultedOptions = {\n\t\t\t...this.#defaultOptions.queries,\n\t\t\t...this.getQueryDefaults(options.queryKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t\tif (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n\t\tif (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n\t\tif (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n\t\tif (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = \"offlineFirst\";\n\t\tif (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;\n\t\treturn defaultedOptions;\n\t}\n\t/**\n\t* The mutation counterpart of {@link QueryClient#defaultQueryOptions}. Called by framework\n\t* adapters (e.g. inside `useMutation`) to merge `queryClient.setMutationDefaults` for the\n\t* given `mutationKey`, then the client's `defaultOptions.mutations`, then the caller's options\n\t* on top. A no-op if the options are already defaulted (`_defaulted: true`).\n\t*/\n\tdefaultMutationOptions(options) {\n\t\tif (options?._defaulted) return options;\n\t\treturn {\n\t\t\t...this.#defaultOptions.mutations,\n\t\t\t...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n\t\t\t...options,\n\t\t\t_defaulted: true\n\t\t};\n\t}\n\t/**\n\t* Clears both the query cache and the mutation cache this client is connected to.\n\t*\n\t* @example\n\t* ```ts\n\t* import { QueryClient } from '@tanstack/query-core'\n\t*\n\t* const queryClient = new QueryClient()\n\t* queryClient.clear()\n\t* ```\n\t*/\n\tclear() {\n\t\tthis.#queryCache.clear();\n\t\tthis.#mutationCache.clear();\n\t}\n};\n//#endregion\nexport { QueryClient };\n\n//# sourceMappingURL=queryClient.js.map","\"use client\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport * as React from \"react\";\nimport { MutationObserver, noop, notifyManager, shouldThrowError } from \"@tanstack/query-core\";\n//#region src/useMutation.ts\n/**\n* Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.\n* `useMutation` is the hook for that.\n*\n* @see {@link mutationOptions} to share these options across multiple `useMutation` call sites, or to look\n* the mutation up elsewhere via its `mutationKey` (e.g. with `useMutationState`).\n* @param options - The {@link UseMutationOptions} to use — everything you can pass to `useMutation`.\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns `mutate`/`mutateAsync` also accept per-call `onSuccess`/`onError`/`onSettled` callbacks as a second\n* argument, useful for triggering call-site side effects (e.g. navigation) without coupling them to the shared\n* mutation definition. Hook-level callbacks (passed to `options`) fire for every mutation; per-call callbacks\n* fire only for the latest call you've made, and only while the component is still mounted — unmounting before\n* the mutation settles removes the subscription and prevents them from firing.\n*\n* @example\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <button\n* onClick={() =>\n* addMutation.mutate('Item', {\n* onError: (error) => console.error('Failed to add item:', error),\n* })\n* }\n* >\n* Add\n* </button>\n* )\n* }\n* ```\n*\n* @example\n* Rendering the mutation's own state, rather than just firing it off:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* return (\n* <div>\n* {addMutation.isPending ? (\n* 'Adding todo...'\n* ) : (\n* <>\n* {addMutation.isError ? (\n* <div>An error occurred: {addMutation.error.message}</div>\n* ) : null}\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* </>\n* )}\n* </div>\n* )\n* }\n* ```\n*\n* @example\n* Optimistic update via `onMutate`, rolling back on `onError`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodo() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onMutate: async (newTodo) => {\n* await queryClient.cancelQueries({ queryKey: ['todos'] })\n* const previousTodos = queryClient.getQueryData<Array<string>>(['todos'])\n*\n* queryClient.setQueryData<Array<string>>(['todos'], (old) => [\n* ...(old ?? []),\n* newTodo,\n* ])\n*\n* // Passed to `onError` as `onMutateResult` if the mutation fails.\n* return { previousTodos }\n* },\n* onError: (_err, _newTodo, onMutateResult) => {\n* queryClient.setQueryData(['todos'], onMutateResult?.previousTodos)\n* },\n* onSettled: () => {\n* queryClient.invalidateQueries({ queryKey: ['todos'] })\n* },\n* })\n*\n* return (\n* <button onClick={() => addMutation.mutate('Item')}>Add</button>\n* )\n* }\n* ```\n*\n* @example\n* Callbacks passed per call to `mutate` only fire for the last call — `mutateAsync` gives you a\n* promise per call instead, so you can wait for all of them when they succeed:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* try {\n* await Promise.all(todos.map((todo) => addMutation.mutateAsync(todo)))\n* } catch (error) {\n* console.error('Failed to add todos:', error)\n* }\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n*\n* @example\n* If some of the mutations above can fail independently of the others, and you want to know which ones\n* did — rather than losing that information the moment the first one rejects — swap `Promise.all` for\n* `Promise.allSettled`:\n* ```tsx\n* import { useMutation, useQueryClient } from '@tanstack/react-query'\n*\n* function AddTodos() {\n* const queryClient = useQueryClient()\n*\n* const addMutation = useMutation({\n* mutationFn: addTodo,\n* onSuccess: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),\n* })\n*\n* async function handleAddAll(todos: Array<string>) {\n* const addResults = await Promise.allSettled(\n* todos.map((todo) => addMutation.mutateAsync(todo)),\n* )\n*\n* addResults.forEach((addResult, index) => {\n* if (addResult.status === 'rejected') {\n* console.error(`Failed to add \"${todos[index]}\":`, addResult.reason)\n* }\n* })\n* }\n*\n* return (\n* <button onClick={() => handleAddAll(['Todo 1', 'Todo 2', 'Todo 3'])}>\n* Add all\n* </button>\n* )\n* }\n* ```\n*/\nfunction useMutation(options, queryClient) {\n\tconst client = useQueryClient(queryClient);\n\tconst [observer] = React.useState(() => new MutationObserver(client, options));\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(options);\n\t}, [observer, options]);\n\tconst result = React.useSyncExternalStore(React.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tconst mutate = React.useCallback((...args) => {\n\t\tobserver.mutate(args[0], args[1]).catch(noop);\n\t}, [observer]);\n\tif (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;\n\treturn {\n\t\t...result,\n\t\tmutate,\n\t\tmutateAsync: result.mutate\n\t};\n}\n//#endregion\nexport { useMutation };\n\n//# sourceMappingURL=useMutation.js.map","import \"/home/runner/work/id/id/node_modules/.pnpm/zyzz@0.0.30_@babel+core@7.29.7_supports-color@10.2.2__@voidzero-dev+vite-plus-core@1.2._4d903293d756627f9a719df246f30dd4/node_modules/zyzz/dist/reset.css?transform-only\";export default \"__VITE_CSS_URL__2f686f6d652f72756e6e65722f776f726b2f69642f69642f6e6f64655f6d6f64756c65732f2e706e706d2f7a797a7a40302e302e33305f40626162656c2b636f726540372e32392e375f737570706f7274732d636f6c6f724031302e322e325f5f40766f69647a65726f2d6465762b766974652d706c75732d636f726540312e322e5f34643930333239336437353636323766396137313964663234366633306464342f6e6f64655f6d6f64756c65732f7a797a7a2f646973742f72657365742e6373733f7472616e73666f726d2d6f6e6c79__\"","//#region src/client/fetch-result-please.ts\n/**\n* @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Hono's custom needs.\n*\n* @link https://www.npmjs.com/package/fetch-result-please\n*/\nconst nullBodyResponses = /* @__PURE__ */ new Set([\n\t101,\n\t204,\n\t205,\n\t304\n]);\n/**\n* Smartly parses and return the consumable result from a fetch `Response`.\n*\n* Throwing a structured error if the response is not `ok`. ({@link DetailedError})\n*/\nasync function fetchRP(fetchRes) {\n\tconst _fetchRes = await fetchRes;\n\tif ((_fetchRes.body || _fetchRes._bodyInit) && !nullBodyResponses.has(_fetchRes.status)) _fetchRes._data = await _fetchRes[detectResponseType(_fetchRes)]();\n\tif (!_fetchRes.ok) throw new DetailedError(`${_fetchRes.status} ${_fetchRes.statusText}`, {\n\t\tstatusCode: _fetchRes?.status,\n\t\tdetail: {\n\t\t\tdata: _fetchRes?._data,\n\t\t\tstatusText: _fetchRes?.statusText\n\t\t}\n\t});\n\treturn _fetchRes._data;\n}\nvar DetailedError = class extends Error {\n\t/**\n\t* Additional `message` that will be logged AND returned to client\n\t*/\n\tdetail;\n\t/**\n\t* Additional `code` that will be logged AND returned to client\n\t*/\n\tcode;\n\t/**\n\t* Additional value that will be logged AND NOT returned to client\n\t*/\n\tlog;\n\t/**\n\t* Optionally set the status code to return, in a web server context\n\t*/\n\tstatusCode;\n\tconstructor(message, options = {}) {\n\t\tsuper(message);\n\t\tthis.name = \"DetailedError\";\n\t\tthis.log = options.log;\n\t\tthis.detail = options.detail;\n\t\tthis.code = options.code;\n\t\tthis.statusCode = options.statusCode;\n\t}\n};\nconst jsonRegex = /^application\\/(?:[\\w!#$%&*.^`~-]*\\+)?json(?:;.+)?$/i;\nfunction detectResponseType(response) {\n\tconst _contentType = response.headers.get(\"content-type\");\n\tif (!_contentType) return \"text\";\n\tconst contentType = _contentType.split(\";\").shift();\n\tif (jsonRegex.test(contentType)) return \"json\";\n\treturn \"text\";\n}\n//#endregion\nexport { DetailedError, fetchRP };\n","import { DetailedError, fetchRP } from \"./fetch-result-please.js\";\n//#region src/client/utils.ts\nconst mergePath = (base, path) => {\n\tbase = base.replace(/\\/+$/, \"\");\n\tbase = base + \"/\";\n\tpath = path.replace(/^\\/+/, \"\");\n\treturn base + path;\n};\nconst replaceUrlParam = (urlString, params) => {\n\tfor (const [k, v] of Object.entries(params)) {\n\t\tconst reg = new RegExp(\"/:\" + k + \"(?:{[^/]+})?\\\\??(?=/|$)\");\n\t\turlString = urlString.replace(reg, () => v ? `/${v}` : \"\");\n\t}\n\treturn urlString;\n};\nconst buildSearchParams = (query) => {\n\tconst searchParams = new URLSearchParams();\n\tfor (const [k, v] of Object.entries(query)) {\n\t\tif (v === void 0) continue;\n\t\tif (Array.isArray(v)) for (const v2 of v) {\n\t\t\tif (v2 === void 0) continue;\n\t\t\tsearchParams.append(k, v2);\n\t\t}\n\t\telse searchParams.set(k, v);\n\t}\n\treturn searchParams;\n};\nconst replaceUrlProtocol = (urlString, protocol) => {\n\tswitch (protocol) {\n\t\tcase \"ws\": return urlString.replace(/^http/, \"ws\");\n\t\tcase \"http\": return urlString.replace(/^ws/, \"http\");\n\t}\n};\nconst removeIndexString = (urlString) => {\n\tif (/^https?:\\/\\/[^\\/]+?\\/index(?=\\?|$)/.test(urlString)) return urlString.replace(/\\/index(?=\\?|$)/, \"/\");\n\treturn urlString.replace(/\\/index(?=\\?|$)/, \"\");\n};\nfunction isObject(item) {\n\treturn typeof item === \"object\" && item !== null && !Array.isArray(item);\n}\nfunction deepMerge(target, source) {\n\tif (!isObject(target) && !isObject(source)) return source;\n\tconst merged = { ...target };\n\tfor (const key in source) {\n\t\tconst value = source[key];\n\t\tif (isObject(merged[key]) && isObject(value)) merged[key] = deepMerge(merged[key], value);\n\t\telse merged[key] = value;\n\t}\n\treturn merged;\n}\n/**\n* Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference.\n*\n* Smartly parse the response data, throwing a structured error if the response is not `ok`. ({@link DetailedError})\n*\n* @example const result = await parseResponse(client.posts.$get())\n*/\nasync function parseResponse(fetchRes) {\n\treturn fetchRP(fetchRes);\n}\n//#endregion\nexport { DetailedError, buildSearchParams, deepMerge, mergePath, parseResponse, removeIndexString, replaceUrlParam, replaceUrlProtocol };\n","import { serialize } from \"../utils/cookie.js\";\nimport { buildSearchParams, deepMerge, mergePath, removeIndexString, replaceUrlParam, replaceUrlProtocol } from \"./utils.js\";\n//#region src/client/client.ts\nconst createProxy = (callback, path) => {\n\treturn new Proxy(() => {}, {\n\t\tget(_obj, key) {\n\t\t\tif (typeof key !== \"string\" || key === \"then\") return;\n\t\t\treturn createProxy(callback, [...path, key]);\n\t\t},\n\t\tapply(_1, _2, args) {\n\t\t\treturn callback({\n\t\t\t\tpath,\n\t\t\t\targs\n\t\t\t});\n\t\t}\n\t});\n};\nconst appendQueryParams = (url, searchParams) => {\n\tconst queryString = searchParams.toString();\n\treturn queryString ? `${url}?${queryString}` : url;\n};\nvar ClientRequestImpl = class {\n\turl;\n\tmethod;\n\tbuildSearchParams;\n\tqueryParams = void 0;\n\tpathParams = {};\n\trBody;\n\tcType = void 0;\n\tconstructor(url, method, options) {\n\t\tthis.url = url;\n\t\tthis.method = method;\n\t\tthis.buildSearchParams = options.buildSearchParams;\n\t}\n\tfetch = async (args, opt) => {\n\t\tif (args) {\n\t\t\tif (args.query) this.queryParams = this.buildSearchParams(args.query);\n\t\t\tif (args.form) {\n\t\t\t\tconst form = new FormData();\n\t\t\t\tfor (const [k, v] of Object.entries(args.form)) {\n\t\t\t\t\tif (v === void 0) continue;\n\t\t\t\t\tif (Array.isArray(v)) for (const v2 of v) {\n\t\t\t\t\t\tif (v2 === void 0) continue;\n\t\t\t\t\t\tform.append(k, v2);\n\t\t\t\t\t}\n\t\t\t\t\telse form.append(k, v);\n\t\t\t\t}\n\t\t\t\tthis.rBody = form;\n\t\t\t}\n\t\t\tif (args.json !== void 0) {\n\t\t\t\tthis.rBody = JSON.stringify(args.json);\n\t\t\t\tthis.cType = \"application/json\";\n\t\t\t}\n\t\t\tif (args.param) this.pathParams = args.param;\n\t\t}\n\t\tlet methodUpperCase = this.method.toUpperCase();\n\t\tconst headerValues = {\n\t\t\t...args?.header,\n\t\t\t...typeof opt?.headers === \"function\" ? await opt.headers() : opt?.headers\n\t\t};\n\t\tif (args?.cookie) {\n\t\t\tconst cookies = [];\n\t\t\tfor (const [key, value] of Object.entries(args.cookie)) {\n\t\t\t\tif (value === void 0) continue;\n\t\t\t\tcookies.push(serialize(key, value));\n\t\t\t}\n\t\t\tif (cookies.length > 0) headerValues[\"Cookie\"] = cookies.join(\"; \");\n\t\t}\n\t\tif (this.cType) headerValues[\"Content-Type\"] = this.cType;\n\t\tconst headers = new Headers();\n\t\tfor (const [key, value] of Object.entries(headerValues)) if (value !== void 0) headers.set(key, value);\n\t\tlet url = this.url;\n\t\turl = removeIndexString(url);\n\t\turl = replaceUrlParam(url, this.pathParams);\n\t\tif (this.queryParams) url = appendQueryParams(url, this.queryParams);\n\t\tmethodUpperCase = this.method.toUpperCase();\n\t\tconst setBody = !(methodUpperCase === \"GET\" || methodUpperCase === \"HEAD\");\n\t\treturn (opt?.fetch || fetch)(url, {\n\t\t\tbody: setBody ? this.rBody : void 0,\n\t\t\tmethod: methodUpperCase,\n\t\t\theaders,\n\t\t\t...opt?.init\n\t\t});\n\t};\n};\nconst hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {\n\tconst buildSearchParamsOption = options?.buildSearchParams ?? buildSearchParams;\n\tconst parts = [...opts.path];\n\tconst lastParts = parts.slice(-3).reverse();\n\tif (lastParts[0] === \"toString\") {\n\t\tif (lastParts[1] === \"name\") return lastParts[2] || \"\";\n\t\treturn proxyCallback.toString();\n\t}\n\tif (lastParts[0] === \"valueOf\") {\n\t\tif (lastParts[1] === \"name\") return lastParts[2] || \"\";\n\t\treturn proxyCallback;\n\t}\n\tlet method = \"\";\n\tif (/^\\$/.test(lastParts[0])) {\n\t\tconst last = parts.pop();\n\t\tif (last) method = last.replace(/^\\$/, \"\");\n\t}\n\tconst path = parts.join(\"/\");\n\tconst url = mergePath(baseUrl, path);\n\tif (method === \"url\" || method === \"path\") {\n\t\tlet result = removeIndexString(url);\n\t\tif (opts.args[0]) {\n\t\t\tif (opts.args[0].param) result = replaceUrlParam(result, opts.args[0].param);\n\t\t\tif (opts.args[0].query) result = appendQueryParams(result, buildSearchParamsOption(opts.args[0].query));\n\t\t}\n\t\tif (method === \"url\") return new URL(result);\n\t\treturn result.slice(baseUrl.replace(/\\/+$/, \"\").length).replace(/^\\/?/, \"/\");\n\t}\n\tif (method === \"ws\") {\n\t\tconst normalizedUrl = removeIndexString(url);\n\t\tconst webSocketUrl = replaceUrlProtocol(opts.args[0]?.param ? replaceUrlParam(normalizedUrl, opts.args[0].param) : normalizedUrl, \"ws\");\n\t\tconst targetUrl = new URL(webSocketUrl);\n\t\tconst queryParams = opts.args[0]?.query;\n\t\tif (queryParams) buildSearchParamsOption(queryParams).forEach((value, key) => {\n\t\t\ttargetUrl.searchParams.append(key, value);\n\t\t});\n\t\tconst establishWebSocket = (...args) => {\n\t\t\tif (options?.webSocket !== void 0 && typeof options.webSocket === \"function\") return options.webSocket(...args);\n\t\t\treturn new WebSocket(...args);\n\t\t};\n\t\treturn establishWebSocket(targetUrl.toString());\n\t}\n\tconst req = new ClientRequestImpl(url, method, { buildSearchParams: buildSearchParamsOption });\n\tif (method) {\n\t\toptions ??= {};\n\t\tconst reqOptions = { ...opts.args[1] };\n\t\tconst baseHeaders = options.headers;\n\t\tconst reqHeaders = reqOptions.headers;\n\t\tif (baseHeaders && reqHeaders) reqOptions.headers = async () => ({\n\t\t\t...typeof baseHeaders === \"function\" ? await baseHeaders() : baseHeaders,\n\t\t\t...typeof reqHeaders === \"function\" ? await reqHeaders() : reqHeaders\n\t\t});\n\t\tconst args = deepMerge(options, reqOptions);\n\t\treturn req.fetch(opts.args[0], args);\n\t}\n\treturn req;\n}, []);\n//#endregion\nexport { hc };\n","/**\n * Calls Tempo ID's JSON API from a page with `hc`, typed by the root app's routes. During server\n * rendering the client calls the API in process, through the request context that `server.ts`\n * passes. In the browser it fetches the page's origin. The root route creates one client for the\n * document and provides it, and pages read it with {@link use}. Loaders create their own.\n * @module\n */\nimport {\n createIsomorphicFn,\n getGlobalStartContext,\n} from '@tanstack/react-start'\nimport { DetailedError, hc } from 'hono/client'\nimport { createContext, useContext } from 'react'\nimport type { App } from '../../Api.js'\n\n/** A client for Tempo ID's JSON API. */\nexport type Client = ReturnType<typeof create>\n\n/** Returns the `fetch` that reaches the API: in process on the server, and the network in the browser. */\nconst fetcher = createIsomorphicFn()\n .server(() => getGlobalStartContext()!.fetch)\n .client(() => fetch)\n\n/** Returns the page's origin. */\nconst origin = createIsomorphicFn()\n .server(() => getGlobalStartContext()!.origin)\n .client(() => window.location.origin)\n\n/** The client that the root route provides to every page. */\nexport const Context = createContext<Client | undefined>(undefined)\n\n/**\n * Creates a client for the page request on the server, or for the page in the browser. Requests go\n * to the page's own origin, so the session cookie goes with each one.\n */\nexport function create() {\n return hc<App>(origin(), { fetch: fetcher() })\n}\n\n/**\n * Returns the message to show for `error`: the `error_description` of a refusal that `parseResponse`\n * throws, or a generic message for any other failure, such as a lost connection.\n */\nexport function message(error: unknown) {\n if (error instanceof DetailedError) {\n const data: unknown = error.detail?.data\n if (\n typeof data === 'object' &&\n data !== null &&\n 'error_description' in data &&\n typeof data.error_description === 'string'\n )\n return data.error_description\n return 'Something went wrong. Try again.'\n }\n return 'Tempo ID cannot be reached. Check the connection, and try again.'\n}\n\n/** Returns the `reason` of a refusal that `parseResponse` throws, or `undefined` for any other failure. */\nexport function reason(error: unknown) {\n if (!(error instanceof DetailedError)) return undefined\n const data: unknown = error.detail?.data\n if (\n typeof data === 'object' &&\n data !== null &&\n 'reason' in data &&\n typeof data.reason === 'string'\n )\n return data.reason\n return undefined\n}\n\n/**\n * Returns the root route's client.\n *\n * @throws {Error} When a component renders outside the root route.\n */\nexport function use() {\n const client = useContext(Context)\n if (!client) throw new Error('The client is used outside the root route.')\n return client\n}\n","/** Names the stylesheet classes that select a color scheme beside a theme scope. @module */\n/**\n * Compiled class per scheme. Carrying `color-scheme` in stylesheet rules lets\n * Lightning CSS initialize its lowered `light-dark()` helpers when a downstream\n * bundler targets browsers without native support; inline styles cannot.\n */\nexport const classes = Object.freeze({\n dark: 'z_scheme-dark',\n light: 'z_scheme-light',\n 'light dark': 'z_scheme-light-dark',\n});\n/** Selection rules emitted once beside each stylesheet's theme scopes. */\nexport const css = Object.keys(classes)\n .map((scheme) => `.${classes[scheme]}{color-scheme:${scheme};}`)\n .join('\\n');\n//# sourceMappingURL=Scheme.js.map","/** Serializes root appearance restoration and controls the live root selection from compiled scope names. @module */\nimport * as Scheme from '../internal/Scheme.js';\n/**\n * Binds an HTML-safe script factory to compiled named set classes.\n * The factory is server-safe; only its returned JavaScript accesses the DOM.\n * A saved scheme swaps the stylesheet scheme class and sets the inline `color-scheme`;\n * a saved `null` scheme removes both so a cleared selection survives reloads.\n * @param entries - Catalog names paired with compiled scope classes.\n * @param options - Storage key shared with the configuration's root controls.\n * @returns A pure script factory that never reads or writes browser state itself.\n */\nexport function create(entries, options = {}) {\n return () => {\n const catalog = serialize(entries);\n const key = serialize(options.storageKey ?? 'zyzz');\n const schemes = serialize(Object.entries(Scheme.classes));\n return `(()=>{try{const value=JSON.parse(localStorage.getItem(${key})||\"null\");if(!value||typeof value!==\"object\"||Array.isArray(value))return;const root=document.documentElement;const catalog=new Map(${catalog});if(Object.hasOwn(value,\"set\")&&typeof value.set===\"string\"&&catalog.has(value.set)){root.classList.remove(...catalog.values());root.classList.add(catalog.get(value.set))}const schemes=new Map(${schemes});if(Object.hasOwn(value,\"colorScheme\")){if(value.colorScheme===null){root.classList.remove(...schemes.values());root.style.removeProperty(\"color-scheme\")}else if(schemes.has(value.colorScheme)){root.classList.remove(...schemes.values());root.classList.add(schemes.get(value.colorScheme));root.style.colorScheme=value.colorScheme}}}catch{}})();`;\n };\n}\n/**\n * Binds root selection controls to compiled named set classes.\n * Creation touches no browser state; `get` and `set` read and write\n * `document.documentElement` and the record the initialization script restores.\n * @param entries - Catalog names paired with compiled scope classes.\n * @param options - Default set reported without a root class and the storage key.\n * @returns Controls reading the applied root selection and applying saved changes.\n * @throws {TypeError} If a named catalog receives no default or one outside its entries.\n */\nexport function root(entries, options = {}) {\n const catalog = new Map(entries);\n const key = options.storageKey ?? 'zyzz';\n const schemes = Object.entries(Scheme.classes);\n // Named catalogs always report a set, so the fallback must be one of them.\n if (catalog.size &&\n (options.defaultVars === undefined || !catalog.has(options.defaultVars)))\n throw new TypeError('defaultVars must name a catalog set.');\n function get() {\n const classes = document.documentElement.classList;\n const set = [...catalog].find(([, className]) => classes.contains(className))?.[0] ??\n options.defaultVars;\n const colorScheme = schemes.find(([, className]) => classes.contains(className))?.[0];\n return {\n ...(set === undefined ? {} : { set }),\n ...(colorScheme === undefined ? {} : { colorScheme }),\n };\n }\n function set(selection) {\n const element = document.documentElement;\n const next = { ...get(), ...selection };\n const scopeClass = next.set === undefined ? undefined : catalog.get(next.set);\n // Rejected input leaves the document and the saved record untouched.\n if (next.set !== undefined && scopeClass === undefined)\n throw new TypeError('Invalid set selection.');\n if (next.colorScheme !== undefined &&\n !Object.hasOwn(Scheme.classes, next.colorScheme))\n throw new TypeError('Invalid set selection.');\n element.classList.remove(...catalog.values(), ...schemes.map(([, className]) => className));\n if (scopeClass !== undefined)\n element.classList.add(scopeClass);\n if (next.colorScheme !== undefined) {\n element.classList.add(Scheme.classes[next.colorScheme]);\n element.style.colorScheme = next.colorScheme;\n }\n else\n element.style.removeProperty('color-scheme');\n // The record mirrors the applied root, so a cleared scheme saves as null\n // and the script removes a server-rendered scheme on the next load.\n const record = {\n ...(next.set === undefined ? {} : { set: next.set }),\n colorScheme: next.colorScheme ?? null,\n };\n try {\n localStorage.setItem(key, JSON.stringify(record));\n }\n catch {\n // Blocked storage keeps the selection for this document only.\n }\n }\n return { get, set };\n}\nfunction serialize(value) {\n return JSON.stringify(value).replace(/[<>&\\u2028\\u2029]/g, (character) => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`);\n}\n//# sourceMappingURL=Appearance.js.map","/**\n * Binds compiled classes to the web styling override contract.\n * Returns fresh props; without variable assignments, inline styles retain their identity.\n * Never generates rules or changes the supplied overrides.\n * @returns A callable accepting className, style, and vars.\n */\nexport function create({ className }) {\n return ((overrides) => {\n if (!overrides)\n return { className };\n const { className: external, style, vars } = overrides;\n const inline = vars ? { ...vars, ...style } : style;\n const merged = className && external ? `${className} ${external}` : external || className;\n return inline ? { className: merged, style: inline } : { className: merged };\n });\n}\n//# sourceMappingURL=Props.js.map","import * as Props from './Props.js';\n/**\n * Converts compiled styling props without generating CSS rules or mutating inputs.\n * Values retain explicit CSS units. Custom properties retain their spelling.\n * @param props - Applied style or theme props, including owned data attributes.\n * @returns Unescaped DOM attribute values; never insert them into HTML directly.\n */\nexport function from(props) {\n const result = { class: props.className };\n if (props.style !== undefined) {\n const declarations = [];\n for (const [property, value] of Object.entries(props.style)) {\n if (value === undefined || value === null)\n continue;\n const name = property.startsWith('--')\n ? property\n : property\n .replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)\n .replace(/^ms-/, '-ms-');\n declarations.push(`${name}:${value}`);\n }\n result.style = declarations.join(';');\n }\n for (const [name, value] of Object.entries(props))\n if (name.startsWith('data-'))\n result[name] = value;\n return result;\n}\n/**\n * Serializes styling attributes for insertion inside an HTML opening tag.\n * @param attributes - DOM attributes returned by from.\n * @returns Space-separated attributes with quoted, HTML-escaped values.\n */\nexport function serialize(attributes) {\n return Object.entries(attributes)\n .filter(([, value]) => value !== undefined)\n .map(([name, value]) => `${escape(name)}=\"${escape(value)}\"`)\n .join(' ');\n}\nfunction escape(value) {\n return value.replace(/[&<>\"'\\s]/g, (character) => {\n if (character === '&')\n return '&amp;';\n if (character === '<')\n return '&lt;';\n if (character === '>')\n return '&gt;';\n if (character === '\"')\n return '&quot;';\n if (character === \"'\")\n return '&#39;';\n return `&#${character.charCodeAt(0)};`;\n });\n}\n/** Binds compiler-generated props to native HTML attributes. */\nexport function bind(fn) {\n return (input) => from(fn(input));\n}\n/** Creates a static HTML style callable without CSS generation. */\nexport function create(options) {\n return bind(Props.create(options));\n}\n//# sourceMappingURL=Html.js.map","import * as Composition from './Composition.js';\nimport * as Html from './Html.js';\n// A package may have distinct runtime copies in dependency optimization or SSR.\n// This versioned protocol key preserves canonical props across those module graphs.\nconst input = Symbol.for('zyzz.composition.input.v1');\n/** Binds a generated React-shaped callable to composable HTML attributes. */\nexport function bind(fn) {\n // Generated callers bind the underlying callable with HTML output disabled.\n return (...args) => from(fn(...args));\n}\n/** Merges canonical props and serializes HTML once, without parsing style strings. */\nexport function create(options) {\n const compose = Composition.create(options);\n return (...entries) => from(compose(...entries.map((entry) => (entry ? entry[input] : entry))));\n}\n/** Converts props while retaining nonenumerable inputs for a surrounding composition. */\nexport function from(props) {\n return Object.defineProperty(Html.from(props), input, { value: props });\n}\n//# sourceMappingURL=CompositionHtml.js.map","import * as Html from './Html.js';\nimport * as Props from './Props.js';\n/**\n * Binds an unconditional recipe class to selection attributes and styling overrides.\n * Type checking and compilation validate authoring; this path only selects data.\n * @param options - Precompiled classes, defaults, axes, and renderer output.\n * @returns A selection callable producing fresh props without retaining inputs.\n */\nexport function create(options) {\n const props = Props.create({ className: options.className });\n // Attribute names and defaults are fixed, so calls only read the selection.\n const axes = Object.keys(options.axes).map((axis) => ({\n attribute: `data-${axis}`,\n axis,\n fallback: Object.hasOwn(options.defaults, axis)\n ? options.defaults[axis]\n : undefined,\n }));\n return (input = {}) => {\n const overrides = input;\n // Props are fresh on every call, so selection attributes extend them in place.\n const result = props(overrides);\n for (const entry of axes) {\n const selected = Object.hasOwn(input, entry.axis)\n ? input[entry.axis]\n : undefined;\n const value = (selected === undefined ? entry.fallback : selected);\n if (value !== null && value !== undefined)\n result[entry.attribute] = String(value);\n }\n return options.html ? Html.from(result) : result;\n };\n}\n//# sourceMappingURL=Recipe.js.map","/** Selects compiler-owned variable scope classes without evaluating authoring code. @module */\nimport * as Scheme from '../internal/Scheme.js';\nimport * as Html from './CompositionHtml.js';\nexport function create(entries, html = false, key = 'set', defaultSet) {\n const catalog = Object.fromEntries(entries);\n const select = (input = {}) => {\n const selected = input && typeof input === 'object'\n ? (input[key] ?? defaultSet)\n : undefined;\n if (!input ||\n typeof input !== 'object' ||\n Array.isArray(input) ||\n (!Object.hasOwn(input, key) && defaultSet === undefined) ||\n typeof selected !== 'string' ||\n !Object.hasOwn(catalog, selected) ||\n Object.keys(input).some((field) => field !== key && field !== 'colorScheme') ||\n (input.colorScheme !== undefined &&\n !['light', 'dark', 'light dark'].includes(input.colorScheme)))\n throw new TypeError('Invalid variable selection.');\n const scheme = input.colorScheme;\n const props = {\n className: scheme\n ? `${catalog[selected]} ${Scheme.classes[scheme]}`\n : catalog[selected],\n ...(scheme ? { style: { colorScheme: scheme } } : {}),\n };\n return html ? Html.from(props) : props;\n };\n return select;\n}\n//# sourceMappingURL=Selection.js.map","/**\n * Configures styling: zyzz's default tokens extended with Tempo ID's own, the Pilat and Geist Mono\n * faces their stacks name, and document styles.\n * @module\n */\nimport { defineConfig, extendVars } from 'zyzz'\nimport { vars as defaults } from 'zyzz/default'\nimport { fontFace, global, keyframes } from 'zyzz/web'\n\n/** A short sideways shake that marks a refused code. `animate.nudge` names it by its ID. */\nconst nudge = keyframes(\n {\n '0%, 100%': { transform: 'translateX(0)' },\n '20%': { transform: 'translateX(-6px)' },\n '40%': { transform: 'translateX(5px)' },\n '60%': { transform: 'translateX(-3px)' },\n '80%': { transform: 'translateX(2px)' },\n },\n { id: 'tempo-id/nudge' },\n)\n\n// The `animate.nudge` token names the keyframes as text, so nothing else reads the constant.\nvoid nudge\n\n/**\n * Tokens Tempo ID adds to the default set, or replaces in it. Add a token here rather than writing\n * a custom value. The neutrals follow Link: controls and lists are gray fills on a near-white page,\n * with few borders.\n */\nconst tokens = extendVars(\n defaults,\n {\n animate: {\n nudge:\n 'z-kid-tempo_2d_id_2f_nudge 400ms cubic-bezier(0.36, 0.07, 0.19, 0.97)',\n },\n // A code box, slightly taller than wide.\n aspect: { code: '6 / 7' },\n backgroundImage: {\n // A white sheen from the top, which gives a solid button fill depth in both schemes.\n sheen:\n 'linear-gradient(180deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0))',\n },\n color: {\n background: {\n primary: { dark: '#0f0f0f', light: '#fdfdfd' },\n surface: { dark: '#1a1a1a', light: '#ffffff' },\n },\n foreground: { dark: '#f5f5f5', light: '#1a1a1a' },\n gray: {\n // The fill of inputs, code boxes, and grouped lists.\n 100: { dark: '#1f1f1f', light: '#f5f5f5' },\n // The fill of a hovered row or control.\n 200: { dark: '#2a2a2a', light: '#ededed' },\n 400: { dark: '#2e2e2e', light: '#e5e5e5' },\n 900: { dark: '#a3a3a3', light: '#6b6b6b' },\n // The hover fill of a `foreground` button.\n 950: { dark: '#d6d6d6', light: '#333333' },\n },\n transparent: 'transparent',\n },\n fontFamily: {\n sans: 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n letterSpacing: {\n // A lone wallet's balance, which tracks tighter than its heading style.\n balance: '-0.03em',\n // The deposit screen's title.\n title: '-0.02em',\n },\n radius: { full: '9999px' },\n spacing: {\n auto: 'auto',\n // A negative inset that extends an icon control's hit area past the icon.\n bleed: '-0.75rem',\n // A smaller bleed, for an icon control beside text in a row.\n bleedSmall: '-0.375rem',\n full: '100%',\n max: 'max-content',\n // Negative insets that hang an icon control's glyph past the content edge, on phones and wider screens.\n outdent: '-1rem',\n outdentWide: '-3.5rem',\n // A negative margin that overlaps stacked token icons.\n overlap: '-0.375rem',\n // The text of the flows canvas: at most 36rem, and within the viewport less the canvas's inset.\n readable: 'min(36rem, calc(100vw - 2rem))',\n screen: '100dvh',\n },\n // The default typography names Geist as text, not as a token, so each style in use names the\n // Pilat stack again. Theme data takes only literals.\n typography: {\n button: {\n 14: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n 16: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n },\n copy: {\n // Listing a size drops its nested styles, so `copy.13` restores the default mono style.\n 13: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n mono: {\n fontFamily:\n '\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace',\n fontSize: '13px',\n fontWeight: 400,\n letterSpacing: '0px',\n lineHeight: '18px',\n },\n },\n 14: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n 16: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n strong: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n },\n },\n // Pilat's headings track at -0.015em, as in `@tempoxyz/ds`.\n heading: {\n 16: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n letterSpacing: '-0.24px',\n },\n 20: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n letterSpacing: '-0.3px',\n },\n 24: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n letterSpacing: '-0.36px',\n },\n 32: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n letterSpacing: '-0.48px',\n },\n },\n label: {\n 12: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n // The deposit address. Listing `label.12` again drops its nested styles, so this restores\n // the default mono style.\n mono: {\n fontFamily:\n '\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace',\n fontSize: '12px',\n fontWeight: 400,\n letterSpacing: '0px',\n lineHeight: '16px',\n },\n },\n 14: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n 16: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n 20: {\n fontFamily:\n 'Pilat, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"',\n },\n },\n },\n },\n { id: 'tempo-id/vars' },\n)\n\n/**\n * Tokens for a third-party app's own interface, which only the flows canvas uses, beside Tempo ID's\n * pages. A food-delivery brand's red, soft grays, and pill corners set the app's screens apart.\n */\nconst thirdParty = extendVars(\n tokens,\n {\n color: {\n background: {\n primary: { dark: '#121212', light: '#ffffff' },\n surface: { dark: '#1e1e1e', light: '#ffffff' },\n },\n blue: { 700: { dark: '#6b9bf2', light: '#4f86ec' } },\n foreground: { dark: '#f5f5f5', light: '#191919' },\n gray: {\n 100: { dark: '#2a2a2a', light: '#f5f5f5' },\n 400: { dark: '#3a3a3a', light: '#e7e7e7' },\n 900: { dark: '#b3b3b3', light: '#606060' },\n },\n red: { 700: { dark: '#ff4a2b', light: '#eb1700' } },\n },\n radius: { lg: '1.25rem', md: '1rem' },\n },\n { id: 'tempo-id/third-party' },\n)\n\n/**\n * The style helpers and tokens that pages and components use. `vars({ set: 'thirdParty' })`\n * applies the third-party tokens to a section.\n */\nexport const { appearance, script, style, variants, vars } = defineConfig({\n defaultVars: 'default',\n id: 'tempo-id',\n vars: { default: tokens, thirdParty },\n})\n\nfontFace({\n fontDisplay: 'swap',\n fontFamily: 'Pilat',\n fontStyle: 'normal',\n fontWeight: 400,\n src: 'url(\"@tempoxyz/ds/fonts/Pilat-Regular.woff2\") format(\"woff2\")',\n})\n\nfontFace({\n fontDisplay: 'swap',\n fontFamily: 'Pilat',\n fontStyle: 'normal',\n fontWeight: 500,\n src: 'url(\"@tempoxyz/ds/fonts/Pilat-Book.woff2\") format(\"woff2\")',\n})\n\nfontFace({\n fontDisplay: 'swap',\n fontFamily: 'Pilat',\n fontStyle: 'normal',\n fontWeight: 600,\n src: 'url(\"@tempoxyz/ds/fonts/Pilat-Demi.woff2\") format(\"woff2\")',\n})\n\nfontFace({\n fontDisplay: 'swap',\n fontFamily: 'Pilat',\n fontStyle: 'normal',\n fontWeight: 700,\n src: 'url(\"@tempoxyz/ds/fonts/Pilat-Bold.woff2\") format(\"woff2\")',\n})\n\nfontFace({\n fontDisplay: 'swap',\n fontFamily: 'Geist Mono',\n fontStyle: 'normal',\n fontWeight: '100 900',\n src: 'url(\"@fontsource-variable/geist-mono/files/geist-mono-latin-wght-normal.woff2\") format(\"woff2\")',\n})\n\nglobal({\n 'html, body': {\n backgroundColor: vars.color.background.primary,\n color: vars.color.foreground,\n },\n body: {\n fontFamily: vars.fontFamily.sans,\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n },\n 'button, input': { font: 'inherit' },\n 'code, pre': { fontFamily: vars.fontFamily.mono },\n html: { colorScheme: 'light dark' },\n})\n","/**\n * The document of every page: its language, the theme tokens on the root element, the head, and the\n * API and query clients that every page shares. The `chain` search parameter stays on every page\n * that the router opens.\n * @module\n */\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport {\n createRootRoute,\n HeadContent,\n Outlet,\n retainSearchParams,\n Scripts,\n} from '@tanstack/react-router'\nimport { type ReactNode, useState } from 'react'\nimport reset from 'zyzz/reset.css?url'\nimport * as Chain from '../../internal/Chain.js'\nimport * as Client from '../lib/Client.js'\nimport { script, vars } from '../zyzz.config.js'\n\nexport const Route = createRootRoute({\n component: Root,\n head: () => ({\n links: [\n { href: reset, rel: 'stylesheet' },\n // The pages have no icon, so an empty one keeps the browser from requesting `/favicon.ico`.\n { href: 'data:,', rel: 'icon' },\n ],\n meta: [\n { charSet: 'utf-8' },\n { content: 'width=device-width, initial-scale=1', name: 'viewport' },\n { title: 'Tempo ID' },\n { content: 'Sign in to Tempo.', name: 'description' },\n ],\n // Restores a saved color scheme before the first paint.\n scripts: [{ children: script() }],\n }),\n // A chosen chain stays on every page that the router opens.\n search: { middlewares: [retainSearchParams(['chain'])] },\n shellComponent: Document,\n validateSearch: (search: Record<string, unknown>): Search => {\n // The router merges each route's search over the parsed query, so an invalid value is\n // replaced, not left in place, and the retained parameter never carries it.\n const chain = Chain.schema.safeParse(search.chain)\n return { chain: chain.success ? chain.data : undefined }\n },\n})\n\n/** The search parameters that every page reads. */\ntype Search = {\n /** The chain whose balances pages show, in place of Tempo mainnet. */\n chain?: Chain.Chain | undefined\n}\n\n/** Renders the page with the clients that every page shares. */\nfunction Root() {\n // One of each for the document's lifetime, so neither holds state of another visitor.\n const [client] = useState(Client.create)\n const [queryClient] = useState(() => new QueryClient())\n\n return (\n <Client.Context value={client}>\n <QueryClientProvider client={queryClient}>\n <Outlet />\n </QueryClientProvider>\n </Client.Context>\n )\n}\n\n/** Renders the HTML document around the page. */\nfunction Document(props: Document.Props) {\n return (\n // The scheme script changes the root element's classes before React hydrates.\n <html className={vars().className} lang=\"en\" suppressHydrationWarning>\n <head>\n <HeadContent />\n </head>\n <body>\n {props.children}\n <Scripts />\n </body>\n </html>\n )\n}\n\ndeclare namespace Document {\n type Props = {\n /** The page. */\n children: ReactNode\n }\n}\n","/** Shared parts of the pages' loaders. @module */\nimport { redirect as router_redirect } from '@tanstack/react-router'\n\n/**\n * Throws a redirect to `href`, with status 302. A redirect to a path that no route serves, such as\n * `/oauth2/authorize`, or to another origin loads the document, since the router cannot render it.\n */\nexport function redirect(options: redirect.Options): never {\n const { document = false, href } = options\n throw router_redirect({\n href,\n ...(document ? { reloadDocument: true } : {}),\n statusCode: 302,\n })\n}\n\nexport declare namespace redirect {\n type Options = {\n /** Whether the browser loads `href` as a document. Defaults to `false`. */\n document?: boolean | undefined\n /** The path, or the absolute URL, that the redirect names. */\n href: string\n }\n}\n","/** Renders a button as a `<button>` or, given `to`, a router link styled as one. @module */\nimport { Link, type LinkComponentProps } from '@tanstack/react-router'\nimport type { ButtonHTMLAttributes, ReactNode } from 'react'\nimport type { Props } from 'zyzz'\nimport Spinner from '~icons/lucide/loader-circle'\nimport type { FileRouteTypes } from '../routeTree.gen.js'\nimport { style, variants } from '../zyzz.config.js'\n\n/**\n * A button in the `default`, `secondary`, or `tertiary` variant and the `medium` or `large`\n * size. `loading` disables a `<button>` and shows a spinner in place of `prefix`.\n */\nexport function Button(props: Button.Props): ReactNode {\n const { children, loading, prefix, size, variant, ...rest } = props\n const selection = styles.button({ size, variant })\n const content = (\n <>\n {loading ? <Spinner {...styles.spinner()} aria-hidden /> : prefix}\n <span {...styles.label()}>{children}</span>\n </>\n )\n\n if ('to' in rest)\n return (\n <Link {...rest} {...selection}>\n {content}\n </Link>\n )\n\n return (\n <button\n type=\"button\"\n {...rest}\n {...selection}\n aria-busy={loading || undefined}\n disabled={rest.disabled || loading}\n >\n {content}\n </button>\n )\n}\n\nexport declare namespace Button {\n /** The variant, size, and content, with a `<button>`'s attributes, or a link's when `to` is set. */\n type Props = Props.Variants<typeof styles.button> & {\n /** Button content, usually its label. */\n children: ReactNode\n /** Disables a `<button>` and replaces `prefix` with a spinner while an action runs. */\n loading?: boolean | undefined\n /** An icon shown before the label. */\n prefix?: ReactNode | undefined\n } & (\n | Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'prefix'>\n | (Omit<LinkComponentProps, 'children' | 'prefix' | 'to'> & {\n /** The page that the link opens. Renders a router link instead of a `<button>`. */\n to: FileRouteTypes['to']\n })\n )\n}\n\nnamespace styles {\n export const button = variants({\n base: {\n alignItems: 'center',\n border: '1px solid',\n borderColor: 'transparent',\n borderRadius: 'full',\n cursor: 'pointer',\n display: 'inline-flex',\n gap: 2,\n justifyContent: 'center',\n outline: 'none',\n textDecoration: 'none',\n transitionDuration: '150ms',\n transitionProperty: 'background-color, border-color, color',\n transitionTimingFunction: 'in-out',\n userSelect: 'none',\n whiteSpace: 'nowrap',\n ':disabled': { cursor: 'not-allowed' },\n // The focus ring: a 2px gap, then 2px of blue.\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n },\n defaultVariants: { size: 'large', variant: 'default' },\n variants: {\n size: {\n large: { height: 12, paddingInline: 6, typography: 'button.16' },\n medium: { height: 9, paddingInline: 4, typography: 'button.14' },\n },\n // A disabled button keeps its fill and dims its label. A loading one keeps its label, since\n // the spinner shows its state.\n variant: {\n default: {\n backgroundColor: 'foreground',\n backgroundImage: 'sheen',\n color: 'background.surface',\n ':disabled:not([aria-busy=\"true\"])': { color: 'gray.700' },\n ':hover:not(:disabled)': { backgroundColor: 'gray.950' },\n },\n secondary: {\n backgroundColor: 'background.surface',\n borderColor: 'gray.400',\n color: 'foreground',\n ':disabled:not([aria-busy=\"true\"])': { color: 'gray.700' },\n ':hover:not(:disabled)': { backgroundColor: 'gray.100' },\n },\n tertiary: {\n backgroundColor: 'transparent',\n color: 'foreground',\n ':disabled:not([aria-busy=\"true\"])': { color: 'gray.700' },\n ':hover:not(:disabled)': { backgroundColor: 'gray.100' },\n },\n },\n },\n })\n\n export const label = style({ overflow: 'hidden', textOverflow: 'ellipsis' })\n\n export const spinner = style({\n flexShrink: 0,\n height: 4,\n width: 4,\n '@media (prefers-reduced-motion: no-preference)': { animation: 'spin' },\n })\n}\n","/** Renders an inline error, which also serves as a page's live status region. @module */\nimport type { ReactNode } from 'react'\nimport Alert from '~icons/lucide/circle-alert'\nimport type { Props } from 'zyzz'\nimport { style, variants } from '../zyzz.config.js'\n\n/**\n * An error message with an alert icon, aligned to the start or the center. It always renders its\n * live region, so screen readers announce a message that appears after the page loads.\n */\nexport function ErrorMessage(props: ErrorMessage.Props): ReactNode {\n return (\n <p\n {...styles.message({ align: props.align })}\n aria-live=\"polite\"\n id={props.id}\n role=\"status\"\n >\n {props.children ? (\n <>\n <Alert {...styles.icon()} aria-hidden />\n <span>{props.children}</span>\n </>\n ) : null}\n </p>\n )\n}\n\nexport declare namespace ErrorMessage {\n /** The message, its alignment, and an `id` that controls reference. */\n type Props = Props.Variants<typeof styles.message> & {\n /** The message. Nothing shows without one. */\n children?: ReactNode | undefined\n /** Lets a control name the message with `aria-describedby`. */\n id?: string | undefined\n }\n}\n\nnamespace styles {\n export const icon = style({\n flexShrink: 0,\n height: 4,\n marginTop: 'px',\n width: 4,\n })\n\n export const message = variants({\n base: {\n alignItems: 'start',\n color: 'red.900',\n display: 'flex',\n gap: 2,\n typography: 'copy.14',\n // An empty region leaves the layout, so its parent's gap does not reserve space for it. The\n // region stays rendered, so screen readers still announce a message that appears.\n ':empty': { position: 'absolute' },\n },\n defaultVariants: { align: 'start' },\n variants: {\n align: {\n center: { justifyContent: 'center', textAlign: 'center' },\n start: {},\n },\n },\n })\n}\n","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\n\n/**\n * Wraps a component function to enable performance optimizations for internal hooks.\n *\n * **Performance Optimization:**\n * Components wrapped with `fastComponent` have access to a shared \"instance\" context that enables\n * specialized hook implementations to batch operations and reduce overhead. The wrapper creates a\n * stable instance object that persists across renders, sets it as the current context, calls\n * registered hooks before and after rendering, then clears the context. The primary benefit is\n * with `useStore`, where multiple store subscriptions within the same component are collapsed into\n * a single `useSyncExternalStore` subscription per store, significantly reducing re-render overhead.\n * This optimization is only active on React 19+; on earlier versions `useStore` falls back to a\n * separate subscription per call.\n *\n * **Requirements:**\n * - The component function should follow standard React component patterns\n * - `useStore` calls must keep a stable order and count across renders, as batched hooks are\n * matched by call index\n * - Do not rely on the instance context outside of specialized hooks\n *\n * @param fn - The component function to wrap\n * @returns A wrapped component with the same signature as the input function\n *\n * @example\n * ```tsx\n * // Wrapping a component to enable optimized useStore batching\n * export const TooltipRoot = fastComponent(function TooltipRoot(props) {\n * // These useStore calls share a single subscription\n * const open = useStore(store, (state) => state.open);\n * const disabled = useStore(store, (state) => state.disabled);\n * const value = useStore(store, (state) => state.value);\n * // ...\n * });\n * ```\n */\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\n\n/**\n * Wraps a component function with ref forwarding to enable performance optimizations for internal hooks.\n *\n * This is a convenience wrapper that combines `fastComponent` with `React.forwardRef`, enabling\n * both performance optimizations and proper ref forwarding. See `fastComponent` for details on\n * the performance benefits.\n *\n * @param fn - The component function that accepts props and a forwarded ref\n * @returns A wrapped component with ref forwarding enabled\n *\n * @example\n * ```tsx\n * // Wrapping a component with ref forwarding and optimized hooks\n * export const TooltipTrigger = fastComponentRef(function TooltipTrigger(\n * props,\n * forwardedRef\n * ) {\n * const store = useContext(TooltipContext);\n * const open = useStore(store, (state) => state.open);\n * // ... component logic with ref\n * return <button ref={forwardedRef} {...props} />;\n * });\n * ```\n */\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","export function NOOP() {}\n\n// Typed as mutable `never[]` so it is assignable to any `T[]` fallback (for example\n// `defaultValue ?? EMPTY_ARRAY` in `useControlled` callers) without widening `T`.\n// Frozen so a write through a widened alias throws instead of mutating the shared singleton.\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;","/**\n * Creates a formatErrorMessage function with a custom URL and prefix.\n * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')\n * @param prefix - The prefix for the error message (e.g., 'Base UI')\n * @returns A function that formats error messages with the given URL and prefix\n */\nexport function createFormatErrorMessage(baseUrl, prefix) {\n return function formatErrorMessage(code, ...args) {\n const url = new URL(baseUrl);\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `${prefix} error #${code}; visit ${url} for the full message.`;\n };\n}\n\n/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nconst formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');\nexport default formatErrorMessage;","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipRootContext.displayName = \"TooltipRootContext\";\nexport function useTooltipRootContext(optional) {\n const context = React.useContext(TooltipRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.' : _formatErrorMessage(72));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY } from \"./empty.mjs\";\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY_ARRAY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\nconst EMPTY = 0;\nexport class Timeout {\n static create() {\n return new Timeout();\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = EMPTY;\n fn();\n }, delay); /* Node.js types are enabled in development */\n }\n isStarted() {\n return this.currentId !== EMPTY;\n }\n clear = () => {\n if (this.currentId !== EMPTY) {\n clearTimeout(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.clear;\n };\n}\n\n/**\n * A `setTimeout` with automatic cleanup and guard.\n */\nexport function useTimeout() {\n const timeout = useRefWithInit(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","/**\n * Reads `navigator.userAgent` / `navigator.platform` (legacy but universally\n * supported) into a normalized shape. In development, prefers the modern\n * `navigator.userAgentData` API on Chromium to avoid DevTools warnings about\n * the deprecated reads; that branch is dead-code-eliminated in production\n * builds to keep the bundle small.\n *\n * Returns empty/zero values when `navigator` is undefined (SSR), so every\n * derived flag safely evaluates to `false`.\n */\nfunction readRawData() {\n if (typeof navigator === 'undefined') {\n return {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return {\n userAgent: uaData.brands.map(({\n brand,\n version\n }) => `${brand}/${version}`).join(' '),\n platform: uaData.platform ?? navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n }\n }\n return {\n userAgent: navigator.userAgent,\n platform: navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? 0\n };\n}\nconst {\n userAgent,\n platform,\n maxTouchPoints\n} = readRawData();\nexport const lowerUserAgent = userAgent.toLowerCase();\nexport const lowerPlatform = platform.toLowerCase();\nexport { maxTouchPoints };","import { lowerUserAgent, lowerPlatform, maxTouchPoints } from \"./shared.mjs\";\n\n// iPadOS 13+ reports `MacIntel` for `navigator.platform`; disambiguated via\n// `maxTouchPoints` so iPad is classified as iOS, not macOS.\n// https://github.com/mui/base-ui/issues/1309\n/** iPhone, iPad (including iPadOS 13+ reporting as macOS), iPod. */\nexport const ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === 'macintel' && maxTouchPoints > 1;\n\n/** Android phones, tablets, and embedded Android browsers. */\nconst ANDROID_STRING = 'android';\nexport const android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);\n\n/** macOS desktop. Excludes iPadOS, which reports as `MacIntel`. */\nexport const mac = !ios && lowerPlatform.startsWith('mac');\n\n/** Windows desktop. */\nexport const windows = lowerPlatform.startsWith('win');\n\n/** Linux desktop (including Chrome OS). */\nexport const linux = !android && /^(linux|chrome os)/.test(lowerPlatform);\n\n/** Any Apple OS (`mac || ios`). */\nexport const apple = mac || ios;","import { lowerUserAgent } from \"./shared.mjs\";\n\n// WebKit (Safari, all iOS browsers, GNOME Web). Distinguished from Blink by\n// the legacy `-webkit-backdrop-filter` name — Blink forked from WebKit in 2013\n// and only ships the unprefixed `backdrop-filter`.\n/** WebKit: Safari, all iOS browsers, GNOME Web. Excludes Blink. */\nexport const webkit = typeof CSS !== 'undefined' && !!CSS.supports?.('-webkit-backdrop-filter:none');\n\n// Anchored to `!webkit` so engines are mutually exclusive by construction.\n// Firefox-on-iOS uses WebKit (its UA marker is `FxiOS/`, not `Firefox/`); the\n// `!webkit` prefix also defends against future iOS-browser UA changes that\n// might inject `Firefox` into a WebKit-based UA.\n/** Gecko: Firefox. */\nexport const gecko = !webkit && lowerUserAgent.includes('firefox');\n\n// All Chromium-based browsers ship `Chrome/` or `Chromium/` in their UA — both\n// share the `chrom` prefix, so a single substring check covers Chrome, Edge,\n// Opera, Brave, etc. Chrome-on-iOS uses `CriOS/` and stays WebKit. The positive\n// UA check also makes this SSR-safe — an empty UA matches nothing.\n/** Blink: Chrome, Edge, Opera, Brave, and other Chromium-based browsers. */\nexport const blink = !webkit && lowerUserAgent.includes('chrom');","import { apple } from \"./os.mjs\";\n\n// Whether a screen reader is *actually* running cannot be detected. These flags\n// identify platforms where a specific screen reader could be active. VoiceOver\n// is the system screen reader on Apple platforms and works with every browser\n// there, so the flag is purely an OS check; engine-specific quirks (e.g. the\n// NSAccessibility virtual-cursor focus path) should be gated at the call site.\n/**\n * The user *may* be using VoiceOver — actual activation is not detectable.\n * True on any Apple platform (macOS, iOS, iPadOS).\n */\nexport const voiceOver = apple;","import { lowerUserAgent } from \"./shared.mjs\";\n\n/** Running in jsdom or HappyDOM (used by unit tests). */\nexport const jsdom = /jsdom|happydom/.test(lowerUserAgent);","import { platform } from '@base-ui/utils/platform';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (platform.os.android && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (platform.env.jsdom) {\n return false;\n }\n return !platform.os.android && event.width === 0 && event.height === 0 ||\n // Chrome synthesizes a screen reader press (TalkBack, VoiceOver, NVDA) as a 1x1 mouse\n // `pointerdown` with no pressure. TalkBack can report a pressed button, while desktop\n // mouse presses can report no pressure, so only require no pressed button off Android.\n event.type === 'pointerdown' && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' && (platform.os.android || event.buttons === 0) ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { isElement, isShadowRoot } from '@floating-ui/utils/dom';\nexport function activeElement(doc) {\n let element = doc.activeElement;\n while (element?.shadowRoot?.activeElement != null) {\n element = element.shadowRoot.activeElement;\n }\n return element;\n}\nexport function contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode?.();\n\n // First, attempt with the faster native method.\n if (parent.contains(child)) {\n return true;\n }\n\n // Then fall back to traversing out of shadow roots when needed.\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\n\n/**\n * Finds the closest matching element in the composed tree, crossing slots and shadow roots.\n * `:scope` is not supported.\n */\n\nexport function closest(node, selector) {\n let current = node;\n while (current) {\n if (isElement(current) && current.matches(selector)) {\n return current;\n }\n current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null);\n }\n return null;\n}\nexport function getTarget(event) {\n if ('composedPath' in event) {\n // The composed path is empty once the event is no longer being dispatched,\n // so fall back to `target` for handlers running after dispatch completes.\n return event.composedPath()[0] ?? event.target;\n }\n\n // TS assumes `composedPath()` always exists, but older browsers without\n // shadow DOM support still fall back to `target`.\n return event.target;\n}","export const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';\nexport const ACTIVE_KEY = 'active';\nexport const SELECTED_KEY = 'selected';\nexport const TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';","/**\n * Present when the component begins animating in.\n */\nexport const startingStyle = 'data-starting-style';\n\n/**\n * Present when the component is animating out.\n */\nexport const endingStyle = 'data-ending-style';","import * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nexport { TransitionStatusDataAttributes };\nconst STARTING_HOOK = {\n [TransitionStatusDataAttributes.startingStyle]: ''\n};\nconst ENDING_HOOK = {\n [TransitionStatusDataAttributes.endingStyle]: ''\n};\nexport const transitionStatusMapping = {\n transitionStatus(value) {\n if (value === 'starting') {\n return STARTING_HOOK;\n }\n if (value === 'ending') {\n return ENDING_HOOK;\n }\n return null;\n }\n};","import * as TransitionStatusDataAttributes from \"../internals/TransitionStatusDataAttributes.mjs\";\n\n/**\n * Present when the popup is open.\n */\nexport const open = 'data-open';\n\n/**\n * Present when the popup is closed.\n */\nexport const closed = 'data-closed';\n\n/**\n * Present when the popup begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n\n/**\n * Present when the popup is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;\n\n/**\n * Present when the anchor is hidden.\n */\nexport const anchorHidden = 'data-anchor-hidden';\n\n/**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\nexport const side = 'data-side';\n\n/**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\nexport const align = 'data-align';","/**\n * Present when the popup is open.\n */\nexport const popupOpen = 'data-popup-open';\n\n/**\n * Present when a pressable trigger is pressed.\n */\nexport const pressed = 'data-pressed';","import { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\nimport * as CommonPopupDataAttributes from \"./CommonPopupDataAttributes.mjs\";\nimport * as CommonTriggerDataAttributes from \"./CommonTriggerDataAttributes.mjs\";\nexport { CommonPopupDataAttributes, CommonTriggerDataAttributes };\nconst TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: '',\n [CommonTriggerDataAttributes.pressed]: ''\n};\nconst POPUP_OPEN_HOOK = {\n [CommonPopupDataAttributes.open]: ''\n};\nconst POPUP_CLOSED_HOOK = {\n [CommonPopupDataAttributes.closed]: ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n [CommonPopupDataAttributes.anchorHidden]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};\nexport const popupTransitionStateMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};","import { CommonTriggerDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the corresponding tooltip is open.\n */\nexport const popupOpen = CommonTriggerDataAttributes.popupOpen;\n/**\n * Present when the trigger is disabled, either by the `disabled` prop or by a parent `<Tooltip.Root>` component.\n */\nexport const triggerDisabled = 'data-trigger-disabled';","import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { activeElement, closest, contains, getTarget } from '@base-ui/utils/shadowDom';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.mjs\";\nimport * as TooltipTriggerDataAttributes from \"../../tooltip/trigger/TooltipTriggerDataAttributes.mjs\";\nexport { activeElement, closest, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute(TooltipTriggerDataAttributes.triggerDisabled);\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return closest(element, `button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || platform.env.jsdom) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}","import { isMouseLikePointerType } from \"../utils/event.mjs\";\nexport { isTargetInsideEnabledTrigger as isInsideEnabledTrigger } from \"../utils/element.mjs\";\nfunction resolveValue(value, pointerType) {\n if (pointerType != null && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function getDelay(value, prop, pointerType) {\n const result = resolveValue(value, pointerType);\n if (typeof result === 'number') {\n return result;\n }\n return result?.[prop];\n}\nexport function getRestMs(value) {\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function isClickLikeOpenEvent(openEventType, interactedInside) {\n return interactedInside || openEventType === 'click' || openEventType === 'mousedown';\n}\nexport function isHoverOpenEvent(openEventType) {\n return openEventType?.includes('mouse') && openEventType !== 'mousedown';\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/** Highlight navigation uses mouse events for hover and pointer events for leaving an item. */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const popupClose = 'popup-close';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';","'use client';\n\nimport * as React from 'react';\nimport { useTimeout, Timeout } from '@base-ui/utils/useTimeout';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { getDelay } from \"../hooks/useHoverShared.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n hasProvider: false,\n timeoutMs: 0,\n delayRef: {\n current: 0\n },\n initialDelayRef: {\n current: 0\n },\n timeout: new Timeout(),\n currentIdRef: {\n current: null\n },\n currentContextRef: {\n current: null\n }\n});\nif (process.env.NODE_ENV !== \"production\") FloatingDelayGroupContext.displayName = \"FloatingDelayGroupContext\";\nfunction resetDelayRef(delayRef, initialDelayRef) {\n delayRef.current = initialDelayRef.current;\n}\n/**\n * Experimental next version of `FloatingDelayGroup` to become the default\n * in the future. This component is not yet stable.\n * Provides context for a group of floating elements that should share a\n * `delay`. Unlike `FloatingDelayGroup`, `useDelayGroup` with this\n * component does not cause a re-render of unrelated consumers of the\n * context when the delay changes.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const delayRef = React.useRef(delay);\n const initialDelayRef = React.useRef(delay);\n const currentIdRef = React.useRef(null);\n const currentContextRef = React.useRef(null);\n const timeout = useTimeout();\n useIsoLayoutEffect(() => {\n initialDelayRef.current = delay;\n if (!currentIdRef.current) {\n delayRef.current = delay;\n return;\n }\n delayRef.current = {\n open: getDelay(delayRef.current, 'open'),\n close: getDelay(delay, 'close')\n };\n }, [delay, currentIdRef, delayRef, initialDelayRef]);\n return /*#__PURE__*/_jsx(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n hasProvider: true,\n delayRef,\n initialDelayRef,\n currentIdRef,\n timeoutMs,\n currentContextRef,\n timeout\n }), [timeoutMs, timeout]),\n children: children\n });\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function useDelayGroup(store, options = {\n open: false\n}) {\n const {\n open\n } = options;\n const floatingId = store.useState('floatingId');\n const groupContext = React.useContext(FloatingDelayGroupContext);\n const {\n currentIdRef,\n delayRef,\n timeoutMs,\n initialDelayRef,\n currentContextRef,\n hasProvider,\n timeout\n } = groupContext;\n const [isInstantPhase, setIsInstantPhase] = React.useState(false);\n const openRef = React.useRef(open);\n useIsoLayoutEffect(() => {\n openRef.current = open;\n }, [open]);\n useIsoLayoutEffect(() => {\n function unset() {\n currentContextRef.current?.setIsInstantPhase(false);\n currentIdRef.current = null;\n currentContextRef.current = null;\n delayRef.current = initialDelayRef.current;\n timeout.clear();\n }\n if (!currentIdRef.current) {\n return undefined;\n }\n if (!open && currentIdRef.current === floatingId) {\n setIsInstantPhase(false);\n if (timeoutMs) {\n const closingId = floatingId;\n timeout.start(timeoutMs, () => {\n // If another tooltip has taken over the group, skip resetting.\n if (store.select('open') || currentIdRef.current && currentIdRef.current !== closingId) {\n return;\n }\n unset();\n });\n return () => {\n if (openRef.current || currentIdRef.current !== closingId) {\n timeout.clear();\n }\n };\n }\n unset();\n }\n return undefined;\n }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return;\n }\n const prevContext = currentContextRef.current;\n const prevId = currentIdRef.current;\n\n // A new tooltip is opening, so cancel any pending timeout that would reset\n // the group's delay back to the initial value.\n timeout.clear();\n currentContextRef.current = {\n onOpenChange: store.setOpen,\n setIsInstantPhase\n };\n currentIdRef.current = floatingId;\n delayRef.current = {\n open: 0,\n close: getDelay(initialDelayRef.current, 'close')\n };\n if (prevId !== null && prevId !== floatingId) {\n setIsInstantPhase(true);\n prevContext?.setIsInstantPhase(true);\n prevContext?.onOpenChange(false, createChangeEventDetails(REASONS.none));\n } else {\n setIsInstantPhase(false);\n prevContext?.setIsInstantPhase(false);\n }\n }, [open, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);\n useIsoLayoutEffect(() => {\n return () => {\n if (currentIdRef.current === floatingId) {\n currentContextRef.current = null;\n if (!openRef.current) {\n return;\n }\n currentIdRef.current = null;\n resetDelayRef(delayRef, initialDelayRef);\n timeout.clear();\n }\n };\n }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);\n return React.useMemo(() => ({\n activeIdRef: currentIdRef,\n hasProvider,\n delayRef,\n isInstantPhase\n }), [currentIdRef, hasProvider, delayRef, isInstantPhase]);\n}","/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n // Legacy ref with no attach-time cleanup: detach by calling it with `null`.\n // It returns nothing; React 19 cleanups are handled in the branch above.\n void ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}","import * as React from 'react';\n\n/**\n * A clone of the React namespace for reading APIs that may be missing in older\n * supported React versions. Bundlers can rewrite direct `React.someNewApi`\n * reads into named imports, which breaks React 17. Reading from this cloned\n * object keeps those lookups optional.\n *\n * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\n */\nexport const SafeReact = {\n ...React\n};","'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n if (this.callbacks[index] === null) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","export { getWindow as ownerWindow } from '@floating-ui/utils/dom';\nexport function ownerDocument(node) {\n return node?.ownerDocument || document;\n}","const visuallyHiddenBase = {\n clipPath: 'inset(50%)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n border: 0,\n padding: 0,\n width: 1,\n height: 1,\n margin: -1\n};\nexport const visuallyHidden = {\n ...visuallyHiddenBase,\n position: 'fixed',\n margin: 0,\n top: 0,\n left: 0\n};\nexport const visuallyHiddenInput = {\n ...visuallyHiddenBase,\n position: 'absolute'\n};","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n // Unlike NVDA and JAWS, VoiceOver's virtual cursor triggers `onFocus` as\n // it moves — but only on focusable/role-button elements through WebKit's\n // NSAccessibility path. Setting `role=\"button\"` lets the focus trap catch\n // the cursor.\n if (platform.screenReader.voiceOver && platform.engine.webkit) {\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { floor } from '@floating-ui/utils';\nimport { getComputedStyle } from '@floating-ui/utils/dom';\nimport { stopEvent } from \"./event.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"./constants.mjs\";\nimport { closest } from \"./element.mjs\";\nexport function isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nexport function isIndexOutOfListBounds(list, index) {\n return index < 0 || index >= list.length;\n}\nexport function getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n disabledIndices\n });\n}\nexport function getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\n/**\n * The index one arrow step moves the highlight to from `currentIndex`, or `-1` when the step\n * leaves the list. `wrapped` reports a jump from one end of the list to the other.\n */\nexport function getNextListIndex(list, currentIndex, options) {\n const {\n decrement,\n loopFocus,\n allowEscape,\n disabledIndices,\n minIndex,\n maxIndex\n } = options;\n const step = () => findNonDisabledListIndex(list, {\n startingIndex: currentIndex,\n decrement,\n disabledIndices\n });\n let index;\n let wrapped = false;\n if (!loopFocus) {\n index = decrement ? Math.max(minIndex, step()) : Math.min(maxIndex, step());\n } else if (decrement ? currentIndex <= minIndex : currentIndex >= maxIndex) {\n // Escaping is only possible from inside the list: from outside it, a step enters at the far\n // end.\n const outside = decrement ? -1 : list.length;\n if (allowEscape && currentIndex !== outside) {\n index = -1;\n } else {\n index = decrement ? maxIndex : minIndex;\n wrapped = true;\n }\n } else {\n index = step();\n }\n return {\n index: isIndexOutOfListBounds(list, index) ? -1 : index,\n wrapped\n };\n}\nexport function findNonDisabledListIndex(list, {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n} = {}) {\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));\n return index;\n}\nexport function getGridNavigatedIndex(list, {\n event,\n orientation,\n loopFocus,\n onLoop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n}) {\n let nextIndex = prevIndex;\n let verticalDirection;\n if (event.key === ARROW_UP) {\n verticalDirection = 'up';\n } else if (event.key === ARROW_DOWN) {\n verticalDirection = 'down';\n }\n if (verticalDirection) {\n // -------------------------------------------------------------------------\n // Detect row structure only when handling vertical navigation. This keeps\n // the non-vertical key paths free from row inference work.\n // -------------------------------------------------------------------------\n const rows = [];\n const rowIndexMap = [];\n let hasRoleRow = false;\n let visibleItemCount = 0;\n {\n let currentRowEl = null;\n let currentRowIndex = -1;\n list.forEach((el, idx) => {\n if (el == null) {\n return;\n }\n visibleItemCount += 1;\n const rowEl = closest(el, '[role=\"row\"]');\n if (rowEl) {\n hasRoleRow = true;\n }\n if (rowEl !== currentRowEl || currentRowIndex === -1) {\n currentRowEl = rowEl;\n currentRowIndex += 1;\n rows[currentRowIndex] = [];\n }\n rows[currentRowIndex].push(idx);\n rowIndexMap[idx] = currentRowIndex;\n });\n }\n let hasDomRows = false;\n let inferredDomCols = 0;\n if (hasRoleRow) {\n for (const row of rows) {\n const rowLength = row.length;\n if (rowLength > inferredDomCols) {\n inferredDomCols = rowLength;\n }\n if (rowLength !== cols) {\n hasDomRows = true;\n }\n }\n }\n const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;\n const verticalCols = inferredDomCols || cols;\n const navigateVertically = direction => {\n if (!hasDomRows || prevIndex === -1) {\n return undefined;\n }\n const currentRow = rowIndexMap[prevIndex];\n if (currentRow == null) {\n return undefined;\n }\n const colInRow = rows[currentRow].indexOf(prevIndex);\n const step = direction === 'up' ? -1 : 1;\n for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {\n if (nextRow < 0 || nextRow >= rows.length) {\n if (!loopFocus || hasVirtualizedGaps) {\n return undefined;\n }\n nextRow = nextRow < 0 ? rows.length - 1 : 0;\n if (onLoop) {\n const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);\n const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];\n const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);\n nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;\n }\n }\n const targetRow = rows[nextRow];\n for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {\n const candidate = targetRow[col];\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n const navigateVerticallyWithInferredRows = direction => {\n if (!hasVirtualizedGaps || prevIndex === -1) {\n return undefined;\n }\n const colInRow = prevIndex % verticalCols;\n const rowStep = direction === 'up' ? -verticalCols : verticalCols;\n const lastRowStart = maxIndex - maxIndex % verticalCols;\n const rowCount = floor(maxIndex / verticalCols) + 1;\n for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {\n if (rowStart < 0 || rowStart > maxIndex) {\n if (!loopFocus) {\n return undefined;\n }\n rowStart = rowStart < 0 ? lastRowStart : 0;\n }\n const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);\n for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n if (stop) {\n stopEvent(event);\n }\n const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);\n if (verticalCandidate !== undefined) {\n nextIndex = verticalCandidate;\n } else if (prevIndex === -1) {\n nextIndex = verticalDirection === 'up' ? maxIndex : minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n amount: verticalCols,\n decrement: verticalDirection === 'up',\n disabledIndices\n });\n if (loopFocus) {\n if (verticalDirection === 'up' && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {\n const col = prevIndex % verticalCols;\n const maxCol = maxIndex % verticalCols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - verticalCols;\n }\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (verticalDirection === 'down' && prevIndex + verticalCols > maxIndex) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex % verticalCols - verticalCols,\n amount: verticalCols,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n }\n }\n if (isIndexOutOfListBounds(list, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(list, nextIndex)) {\n if (loopFocus && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nexport function createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach(({\n width,\n height\n }, index) => {\n if (width > cols) {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i += 1) {\n for (let j = 0; j < height; j += 1) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex += 1;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nexport function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) {\n return -1;\n }\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n default:\n return -1;\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nexport function getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nexport function isListIndexDisabled(list, index, disabledIndices) {\n const isExplicitlyDisabled = typeof disabledIndices === 'function' ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;\n if (isExplicitlyDisabled) {\n return true;\n }\n const element = list[index];\n if (!element) {\n return false;\n }\n if (!isElementVisible(element)) {\n return true;\n }\n\n // A natively disabled element can never receive focus, so it must always be\n // skipped, even when `disabledIndices` marks it as enabled. Only\n // `aria-disabled` items can be focusable-while-disabled.\n if (element.matches(':disabled')) {\n return true;\n }\n return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');\n}\nexport function isHiddenByStyles(styles) {\n return styles.visibility === 'hidden' || styles.visibility === 'collapse';\n}\nexport function isElementVisible(element, styles = element ? getComputedStyle(element) : null) {\n if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {\n return false;\n }\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return styles.display !== 'none' && styles.display !== 'contents';\n}","import { getComputedStyle, getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.mjs\";\nimport { isElementVisible } from \"./composite.mjs\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isAncestor = current !== element;\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (isAncestor && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {\n return false;\n }\n }\n return true;\n}\nfunction isVisibleInTabbableTree(element, isAncestor) {\n const styles = getComputedStyle(element);\n if (!isAncestor) {\n return isElementVisible(element, styles);\n }\n return styles.display !== 'none';\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nexport function getTabbableNearElement(referenceElement, direction, exclude) {\n if (!referenceElement) {\n return null;\n }\n\n // Keep the anchor's composed-tree position separate from the focusable radio candidates.\n const list = [];\n appendCandidates(ownerDocument(referenceElement).body, list);\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const candidates = list.filter(isFocusableElement);\n for (let offset = 1; offset < list.length; offset += 1) {\n const element = list[(index + direction * offset + list.length) % list.length];\n if (!contains(exclude, element) && isTabbable(element) && isTabbableRadio(element, candidates)) {\n return element;\n }\n }\n return list[index];\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","import { NOOP } from '@base-ui/utils/empty';\nlet rafId = 0;\nexport function enqueueFocus(el, options = {}) {\n const {\n preventScroll = false,\n sync = false,\n shouldFocus\n } = options;\n cancelAnimationFrame(rafId);\n function exec() {\n if (shouldFocus && !shouldFocus()) {\n return;\n }\n el?.focus({\n preventScroll\n });\n }\n if (sync) {\n exec();\n return NOOP;\n }\n const currentRafId = requestAnimationFrame(exec);\n rafId = currentRafId;\n return () => {\n if (rafId === currentRafId) {\n cancelAnimationFrame(currentRafId);\n rafId = 0;\n }\n };\n}","// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nimport { getNodeName, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nconst markerName = 'data-base-ui-inert';\nlet ariaHiddenCounterMap = new WeakMap();\nlet uncontrolledElementsSet = new WeakSet();\nlet markerCounterMap = new WeakMap();\nlet lockCount = 0;\nfunction unwrapHost(node) {\n if (!node) {\n return null;\n }\n return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);\n}\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nconst buildKeepSet = targets => {\n const keep = new Set();\n targets.forEach(target => {\n let node = target;\n while (node && !keep.has(node)) {\n keep.add(node);\n node = node.parentNode;\n }\n });\n return keep;\n};\nconst collectOutsideElements = (root, keepElements, stopElements) => {\n const outside = [];\n const walk = parent => {\n if (!parent || stopElements.has(parent)) {\n return;\n }\n Array.from(parent.children).forEach(node => {\n if (getNodeName(node) === 'script') {\n return;\n }\n if (keepElements.has(node)) {\n walk(node);\n } else {\n outside.push(node);\n }\n });\n };\n walk(root);\n return outside;\n};\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, {\n mark = true\n}) {\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)) : [];\n const hiddenElements = [];\n const markedElements = [];\n if (ariaHidden) {\n const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll('[aria-live]')));\n const controlElements = avoidElements.concat(ariaLiveElements);\n const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));\n controlTargets.forEach(node => {\n const attr = node.getAttribute('aria-hidden');\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (ariaHiddenCounterMap.get(node) || 0) + 1;\n ariaHiddenCounterMap.set(node, counterValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledElementsSet.add(node);\n }\n if (!alreadyHidden) {\n node.setAttribute('aria-hidden', 'true');\n }\n });\n }\n if (mark) {\n markerTargets.forEach(node => {\n const markerValue = (markerCounterMap.get(node) || 0) + 1;\n markerCounterMap.set(node, markerValue);\n markedElements.push(node);\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n });\n }\n lockCount += 1;\n return () => {\n hiddenElements.forEach(element => {\n const counterValue = (ariaHiddenCounterMap.get(element) || 0) - 1;\n ariaHiddenCounterMap.set(element, counterValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet.has(element)) {\n element.removeAttribute('aria-hidden');\n }\n uncontrolledElementsSet.delete(element);\n }\n });\n if (mark) {\n markedElements.forEach(element => {\n const markerValue = (markerCounterMap.get(element) || 0) - 1;\n markerCounterMap.set(element, markerValue);\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n }\n lockCount -= 1;\n if (!lockCount) {\n ariaHiddenCounterMap = new WeakMap();\n uncontrolledElementsSet = new WeakSet();\n markerCounterMap = new WeakMap();\n }\n };\n}\nexport function markOthers(avoidElements, options = {}) {\n const {\n ariaHidden = false,\n mark = true\n } = options;\n const body = ownerDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements, body, ariaHidden, {\n mark\n });\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a function that forces a rerender.\n */\nexport function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useForcedRerendering } from \"./useForcedRerendering.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const defaultId = React.useRef(undefined);\n const forceRerender = useForcedRerendering();\n const id = idOverride ?? defaultId.current;\n React.useEffect(() => {\n if (defaultId.current == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n defaultId.current = `${prefix}-${globalId}`;\n // Generate the fallback even while `idOverride` is set.\n // Removing the override then swaps in the existing id within the same commit.\n // Deferring generation would leave one commit with no id, breaking `htmlFor` and `aria-labelledby` links.\n // Only rerender when the fallback is the value being rendered.\n if (idOverride == null) {\n forceRerender();\n }\n }\n }, [idOverride, prefix, forceRerender]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @param {string | undefined} prefix prefixes the generated id when provided\n * @returns {string | undefined}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 18.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.mjs\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...inputProps(EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","import * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.mjs\";\nimport { resolveClassName } from \"../utils/resolveClassName.mjs\";\nimport { resolveStyle } from \"../utils/resolveStyle.mjs\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.mjs\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n let renderProp = componentProps.render;\n if (params.enabled !== false) {\n // A pending lazy element suspends when unwrapped, so leave it wrapped while disabled.\n renderProp = unwrapLazyRenderProp(renderProp);\n }\n const outProps = useRenderElementProps(componentProps, params, renderProp);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params, renderProp) {\n const {\n className: classNameProp,\n style: styleProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n // Called only to keep the hook order stable when disabled; the merged ref is unused.\n void useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/react/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\n\n// Workaround for https://github.com/react/react/issues/32392\n// The Flight client hands over a lazy wrapper in place of a render element created in a\n// Server Component. The wrapper exposes no `.props` or `.ref`, so it must be unwrapped\n// before those are read. This works because the toArray() logic unwraps the lazy\n// element type in\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\nexport function unwrapLazyRenderProp(render) {\n // `$$typeof` is a React internal, absent from the public element types.\n if (render?.$$typeof !== REACT_LAZY_TYPE) {\n return render;\n }\n // Keep the wrapper unless it unwraps to an element, so an invalid render prop is still\n // reported as one instead of silently falling back to the default element.\n const unwrapped = React.Children.toArray(render)[0];\n return /*#__PURE__*/React.isValidElement(unwrapped) ? unwrapped : render;\n}\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(render)) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(render, mergedProps);\n }\n // `element` is always provided when there is no `render` prop.\n return renderTag(element, props);\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n node: portalNode,\n // `id` and `render` props can override or remove the generated ID. Use the exact\n // rendered value so `aria-owns` never points at an ID absent from the DOM.\n nodeId: /*#__PURE__*/React.isValidElement(portalElement) ? portalElement.props.id : undefined,\n subtree: portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n container,\n portalOwnerRole,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n nodeId: portalNodeId,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n useIsoLayoutEffect(() => {\n if (!portalNode || open !== true || !focusInsideDisabledRef.current) {\n return;\n }\n\n // Restore tabbability before the focus manager's queued focus-on-open step runs.\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n role: portalOwnerRole,\n \"aria-owns\": portalNodeId,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","/**\n * If the provided argument is a ref object, returns its `current` value.\n * Otherwise, returns the argument itself.\n */\nexport function resolveRef(maybeRef) {\n if (maybeRef == null) {\n return maybeRef;\n }\n return 'current' in maybeRef ? maybeRef.current : maybeRef;\n}","'use client';\n\nimport * as React from 'react';\nimport { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { platform } from '@base-ui/utils/platform';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { activeElement, closest, contains, getTarget, isTypeableCombobox, getFloatingFocusElement, isTypeableElement } from \"../utils/element.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\nimport { tabbable, focusable, isOutsideEvent, isTabbable, getNextTabbable, getPreviousTabbable } from \"../utils/tabbable.mjs\";\nimport { getNodeAncestors, getNodeChildren } from \"../utils/nodes.mjs\";\nimport { isElementVisible } from \"../utils/composite.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { markOthers } from \"../utils/markOthers.mjs\";\nimport { usePortalContext } from \"./FloatingPortal.mjs\";\nimport { useFloatingTree } from \"./FloatingTree.mjs\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.mjs\";\nimport { resolveRef } from \"../../utils/resolveRef.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getEventType(event, lastInteractionType) {\n const win = ownerWindow(getTarget(event));\n if (event instanceof win.KeyboardEvent) {\n return 'keyboard';\n }\n if (event instanceof win.FocusEvent) {\n // Focus events can be caused by a preceding pointer interaction (e.g., focusout on outside press).\n // Prefer the last known pointer type if provided, else treat as keyboard.\n return lastInteractionType || 'keyboard';\n }\n if ('pointerType' in event) {\n // A trusted click without a pointerType is keyboard/AT; only synthesized\n // clicks (e.g. a test harness) pair an empty pointerType with a click count.\n return event.pointerType || (isVirtualClick(event) ? 'keyboard' : lastInteractionType || 'mouse');\n }\n if ('touches' in event) {\n return 'touch';\n }\n if (event instanceof win.MouseEvent) {\n // onClick events may not contain pointer events, and will fall through to here\n return lastInteractionType || (event.detail === 0 ? 'keyboard' : 'mouse');\n }\n return '';\n}\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(entry => {\n return entry.deref()?.isConnected;\n });\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(new WeakRef(element));\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();\n}\nfunction getFirstTabbableElement(container) {\n if (!container) {\n return null;\n }\n if (isTabbable(container)) {\n return container;\n }\n return tabbable(container)[0] || container;\n}\nfunction handleTabIndex(floatingFocusElement) {\n if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {\n return;\n }\n if (!floatingFocusElement.getAttribute('role')?.includes('dialog')) {\n return;\n }\n const focusableElements = focusable(floatingFocusElement);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n // Mark our own write so the externally-managed early-return above doesn't\n // mistake it for a user-authored `tabindex` and freeze management.\n floatingFocusElement.setAttribute('data-tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n * @internal\n */\nexport function FloatingFocusManager(props) {\n const {\n context: store,\n children,\n disabled = false,\n initialFocus = true,\n returnFocus = true,\n explicitReturnFocus,\n restoreFocus = false,\n modal = true,\n closeOnFocusOut = true,\n openInteractionType = '',\n nextFocusableElement,\n previousFocusableElement,\n beforeContentFocusGuardRef,\n externalTree,\n getInsideElements\n } = props;\n const open = store.useState('open');\n const domReference = store.useState('domReferenceElement');\n const floating = store.useState('floatingElement');\n const {\n events,\n dataRef\n } = store.context;\n const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);\n const ignoreInitialFocus = initialFocus === false;\n // A typeable combobox reference (e.g. input/textarea) with `initialFocus={false}`\n // has different focus semantics: focus is not trapped inside the floating element,\n // so in the modal case the guards are not rendered, but `aria-hidden` is still\n // applied to the outside nodes.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n const initialFocusRef = useValueAsRef(initialFocus);\n const returnFocusRef = useValueAsRef(returnFocus);\n // Read through a ref so a mid-open change can't re-run the return-focus effect, whose cleanup\n // would move focus while the floating element is still open.\n const explicitReturnFocusRef = useValueAsRef(explicitReturnFocus);\n const openInteractionTypeRef = useValueAsRef(openInteractionType);\n const openRef = useValueAsRef(open);\n const tree = useFloatingTree(externalTree);\n const portalContext = usePortalContext();\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const pointerDownOutsideRef = React.useRef(false);\n const lastFocusedTabbableRef = React.useRef(null);\n const closeTypeRef = React.useRef('');\n const lastInteractionTypeRef = React.useRef('');\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);\n const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);\n const blurTimeout = useTimeout();\n const pointerDownTimeout = useTimeout();\n const restoreFocusFrame = useAnimationFrame();\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useStableCallback((container = floatingFocusElement) => {\n return container ? tabbable(container) : [];\n });\n const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);\n\n // Prevent Tab from escaping the modal when there are no tabbable elements.\n React.useEffect(() => {\n if (disabled || !modal) {\n return undefined;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n }\n }\n const doc = ownerDocument(floatingFocusElement);\n return addEventListener(doc, 'keydown', onKeyDown);\n }, [disabled, floatingFocusElement, modal, isUntrappedTypeableCombobox, getTabbableContent]);\n\n // Track pointer/keyboard interactions to disambiguate focus and outside presses.\n React.useEffect(() => {\n if (disabled || !open) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n function clearPointerDownOutside() {\n pointerDownOutsideRef.current = false;\n }\n function onPointerDown(event) {\n const target = getTarget(event);\n const insideElements = getResolvedInsideElements();\n const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some(element => element === target || contains(element, target));\n pointerDownOutsideRef.current = !pointerTargetInside;\n lastInteractionTypeRef.current = event.pointerType || 'keyboard';\n if (closest(target, `[${CLICK_TRIGGER_IDENTIFIER}]`)) {\n isPointerDownRef.current = true;\n // Reset on the next tick so a single click on a click-trigger doesn't\n // permanently suppress focus-out closing for the lifetime of the instance.\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n }\n function onKeyDown() {\n lastInteractionTypeRef.current = 'keyboard';\n }\n return mergeCleanups(addEventListener(doc, 'pointerdown', onPointerDown, true), addEventListener(doc, 'pointerup', clearPointerDownOutside, true), addEventListener(doc, 'pointercancel', clearPointerDownOutside, true), addEventListener(doc, 'keydown', onKeyDown, true),\n // Avoid a stale `true` leaking into the next open (e.g. keep-mounted popups)\n // if the popup dismissed between pointerdown and pointerup.\n clearPointerDownOutside);\n }, [disabled, floating, domReference, floatingFocusElement, open, portalContext, pointerDownTimeout, getResolvedInsideElements]);\n\n // Close on focus out and restore focus within the floating tree when needed.\n React.useEffect(() => {\n if (disabled || !closeOnFocusOut) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusIn(event) {\n const target = getTarget(event);\n if (isTabbable(target)) {\n lastFocusedTabbableRef.current = target;\n }\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget(event);\n\n // When focus is lost to the body (e.g. on a backdrop press), record the element that\n // had focus so a confirmation dialog opened while the body is focused can return focus\n // to it. Scoped to `modal` to avoid non-modal popups polluting the shared stack.\n if (modal && relatedTarget == null && target != null && contains(floating, target)) {\n addPreviouslyFocusedElement(target);\n }\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const triggers = store.context.triggerElements;\n const insideElements = getResolvedInsideElements();\n const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement);\n }\n\n // Restore focus to the previously focused tabbable element to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !isElementVisible(target) && activeElement(doc) === doc.body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n // If explicitly requested to restore focus to the popup container, do not search\n // for the next/previous tabbable element.\n if (restoreFocus === 'popup') {\n // If the focused element is removed on pointerdown, the browser\n // tries to move focus to it right after the `.focus()` call above,\n // but because it's removed in the same tick, focus is lost instead.\n // Re-focusing asynchronously (next frame) wins that race.\n restoreFocusFrame.request(() => {\n floatingFocusElement.focus();\n });\n return;\n }\n }\n const tabbableContent = getTabbableContent();\n const prevTabbable = lastFocusedTabbableRef.current;\n const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n // For an \"untrapped\" typeable combobox (input role=combobox with\n // initialFocus=false), re-opening the popup and tabbing out should still close it even\n // when the previously focused element (e.g. the next tabbable outside the popup) is\n // focused again. Otherwise, the popup remains open on the second Tab sequence:\n // click input -> Tab (closes) -> click input -> Tab.\n // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.\n isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {\n preventReturnFocusRef.current = true;\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event));\n }\n });\n }\n function markInsideReactTree() {\n if (pointerDownOutsideRef.current) {\n return;\n }\n dataRef.current.insideReactTree = true;\n blurTimeout.start(0, () => {\n dataRef.current.insideReactTree = false;\n });\n }\n const domReferenceElement = isHTMLElement(domReference) ? domReference : null;\n if (!floating && !domReferenceElement) {\n return undefined;\n }\n return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, 'pointerdown', handlePointerDown), floating && addEventListener(floating, 'focusin', handleFocusIn), floating && addEventListener(floating, 'focusout', handleFocusOutside), floating && portalContext && addEventListener(floating, 'focusout', markInsideReactTree, true));\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Hide everything outside the floating tree from assistive tech while open.\n React.useEffect(() => {\n if (disabled || !floating || !open) {\n return undefined;\n }\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;\n const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];\n const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const ariaHiddenCleanup = markOthers(insideElements, {\n ariaHidden: modal || isUntrappedTypeableCombobox,\n mark: false\n });\n const markerInsideElements = [floating, ...portalNodes].filter(x => x != null);\n const markerCleanup = markOthers(markerInsideElements);\n return () => {\n markerCleanup();\n ariaHiddenCleanup();\n };\n }, [open, disabled, domReference, floating, modal, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Focus the initial element when the floating element opens.\n useIsoLayoutEffect(() => {\n if (!open || disabled || !isHTMLElement(floatingFocusElement)) {\n return;\n }\n closeTypeRef.current = '';\n lastInteractionTypeRef.current = '';\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const initialFocusValueOrFn = initialFocusRef.current;\n const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {\n return;\n }\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (focusAlreadyInsideFloatingEl) {\n return;\n }\n let focusableElements = null;\n const getDefaultFocusElement = () => {\n if (focusableElements == null) {\n focusableElements = getTabbableContent(floatingFocusElement);\n }\n return focusableElements[0] || floatingFocusElement;\n };\n let elToFocus;\n if (resolvedInitialFocus === true || resolvedInitialFocus === null) {\n elToFocus = getDefaultFocusElement();\n } else {\n elToFocus = resolveRef(resolvedInitialFocus);\n }\n elToFocus = elToFocus || getDefaultFocusElement();\n const hadFocusInside = contains(floatingFocusElement, activeElement(doc));\n\n // Screen readers re-sync focus to their cursor right after a synthesized press. A focus\n // that lands a frame later reads as a stray move and gets pulled back to the reference.\n const openEvent = dataRef.current.openEvent;\n const openedByVirtualPress = openEvent?.type === 'mousedown' && isVirtualClick(openEvent);\n\n // enqueueFocus returns a rAF-cancel function; we intentionally don't cancel this focus.\n void enqueueFocus(elToFocus, {\n sync: openedByVirtualPress,\n preventScroll: elToFocus === floatingFocusElement,\n shouldFocus() {\n // If the floating element has closed before this runs — e.g. tabbing out of a\n // kept-mounted popup — don't pull focus back onto the initial element after it has\n // legitimately moved elsewhere.\n if (!openRef.current) {\n return false;\n }\n if (hadFocusInside) {\n return true;\n }\n const currentActiveElement = activeElement(doc);\n const focusMovedInside = currentActiveElement !== elToFocus && contains(floatingFocusElement, currentActiveElement);\n return !focusMovedInside;\n }\n });\n });\n }, [disabled, open, floatingFocusElement, getTabbableContent, initialFocusRef, openInteractionTypeRef, openRef, dataRef]);\n\n // A return-focus queued by the effect cleanup. If the effect re-arms in the same commit, a\n // dependency changed while the popup stayed open, so the cleanup was not a close.\n const pendingReturnFocusRef = React.useRef(null);\n\n // Track return focus targets and restore focus on unmount/close.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n pendingReturnFocusRef.current = null;\n return undefined;\n }\n if (pendingReturnFocusRef.current) {\n pendingReturnFocusRef.current.cancelled = true;\n pendingReturnFocusRef.current = null;\n }\n const doc = ownerDocument(floatingFocusElement);\n const elementFocusedBeforeOpen = activeElement(doc);\n // Only an explicit `null` interaction type represents a programmatic open.\n // `undefined` is normalized to `''` by the prop default, so it never reaches\n // here as nullish and is intentionally not treated as programmatic.\n const preferPreviousFocus = openInteractionTypeRef.current == null;\n addPreviouslyFocusedElement(elementFocusedBeforeOpen);\n function onOpenChangeLocal(details) {\n if (!details.open) {\n closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);\n }\n\n // Focus guards transfer focus themselves; other close handlers may still need return focus.\n if (details.reason === REASONS.focusOut && details.triggerElement?.hasAttribute(createAttribute('focus-guard')) || details.reason === REASONS.triggerHover && details.nativeEvent.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (details.reason !== REASONS.outsidePress) {\n return;\n }\n if (details.nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {\n preventReturnFocusRef.current = false;\n } else {\n // On outside press, only return focus to the reference when the browser supports the\n // `focus({ preventScroll })` option; without it, restoring focus scrolls the page.\n // Chrome on Android and Samsung Internet still don't support `preventScroll`\n // (https://issues.chromium.org/issues/41453122), so the runtime check keeps return\n // focus disabled there to avoid the scroll jump.\n let isPreventScrollSupported = false;\n ownerDocument(floatingFocusElement).createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n function getReturnElement(closeType) {\n const returnFocusValueOrFn = returnFocusRef.current;\n let resolvedReturnFocusValue = typeof returnFocusValueOrFn === 'function' ? returnFocusValueOrFn(closeType) : returnFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedReturnFocusValue === undefined || resolvedReturnFocusValue === false) {\n return null;\n }\n if (resolvedReturnFocusValue === null) {\n resolvedReturnFocusValue = true;\n }\n const referenceReturnElement = domReference?.isConnected ? domReference : null;\n const previousReturnElement = elementFocusedBeforeOpen?.isConnected && getNodeName(elementFocusedBeforeOpen) !== 'body' ? elementFocusedBeforeOpen : null;\n let defaultReturnElement = preferPreviousFocus ? previousReturnElement || referenceReturnElement : referenceReturnElement || previousReturnElement;\n if (!defaultReturnElement) {\n defaultReturnElement = getPreviouslyFocusedElement() || null;\n }\n if (typeof resolvedReturnFocusValue === 'boolean') {\n return defaultReturnElement;\n }\n return resolveRef(resolvedReturnFocusValue) || defaultReturnElement || null;\n }\n return () => {\n events.off('openchange', onOpenChangeLocal);\n const activeEl = activeElement(doc);\n const insideElements = getResolvedInsideElements();\n const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some(element => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some(node => contains(node.context?.elements.floating, activeEl));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const returnFocusValueOrFn = returnFocusRef.current;\n const closeType = closeTypeRef.current;\n const returnElement = getReturnElement(closeType);\n const job = {\n cancelled: false\n };\n pendingReturnFocusRef.current = job;\n queueMicrotask(() => {\n if (pendingReturnFocusRef.current === job) {\n pendingReturnFocusRef.current = null;\n }\n // `returnElement` if it is tabbable, otherwise its first tabbable child,\n // otherwise `returnElement` itself (which may not be tabbable at all).\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n // Read in the cleanup on purpose: the latest `explicitReturnFocus` decides.\n const hasExplicitReturnFocus =\n // eslint-disable-next-line react-hooks/exhaustive-deps\n explicitReturnFocusRef.current ?? typeof returnFocusValueOrFn !== 'boolean';\n if (!job.cancelled && returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n !hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n const focusOptions = {\n preventScroll: true\n };\n if (closeType === 'keyboard') {\n focusOptions.focusVisible = true;\n }\n tabbableReturnElement.focus(focusOptions);\n }\n\n // A cancelled return must also clear suppression before the next close.\n preventReturnFocusRef.current = false;\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, explicitReturnFocusRef, openInteractionTypeRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);\n\n // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus\n // when the popup unmounts from the DOM.\n // By blurring it before the popup unmounts, we can prevent this behavior.\n useIsoLayoutEffect(() => {\n if (!platform.engine.webkit || open || !floating) {\n return;\n }\n const activeEl = activeElement(ownerDocument(floating));\n if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {\n return;\n }\n if (contains(floating, activeEl)) {\n activeEl.blur();\n }\n }, [open, floating]);\n\n // Synchronize the focus manager state (modal, closeOnFocusOut, open, etc.) to the\n // FloatingPortal context, which uses it to decide whether to render its own guards.\n useIsoLayoutEffect(() => {\n if (disabled || !portalContext) {\n return undefined;\n }\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange: store.setOpen,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);\n\n // Keep the floating element tabIndex in sync and clear stale focus records.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n handleTabIndex(floatingFocusElement);\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled, floatingFocusElement]);\n const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableContent();\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(els[els.length - 1]);\n } else if (portalContext?.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n } else {\n resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();\n }\n }\n }\n }), children, shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n // enqueueFocus returns a rAF-cancel function we don't need here.\n void enqueueFocus(getTabbableContent()[0]);\n } else if (portalContext?.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n } else {\n resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();\n }\n }\n }\n })]\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getTarget, isTypeableElement } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType, isVirtualPointerEvent } from \"../utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nexport function useClick(store, props = {}) {\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n stickIfOpen = true,\n touchOpenDelay = 0,\n reason = REASONS.triggerPress\n } = props;\n const dataRef = store.context.dataRef;\n const pointerTypeRef = React.useRef(undefined);\n const frame = useAnimationFrame();\n const touchOpenTimeout = useTimeout();\n const reference = React.useMemo(() => {\n function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {\n const details = createChangeEventDetails(reason, nativeEvent, target);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n }\n function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {\n const openEvent = dataRef.current.openEvent;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== currentTarget;\n if (open && hasClickedOnInactiveTrigger) {\n // Moving between triggers should always open the newly active one.\n return true;\n }\n if (!open) {\n // A closed popup should open on the next press.\n return true;\n }\n if (!toggle) {\n // Non-toggle mode never closes on a repeated trigger press.\n return true;\n }\n if (openEvent && (typeof stickIfOpen === 'function' ? stickIfOpen() : stickIfOpen)) {\n // Preserve hover/focus-opened popups until the matching click-like event closes them.\n return !isClickLikeOpenEvent(openEvent.type);\n }\n\n // Otherwise, a repeated click toggles the popup closed.\n return false;\n }\n return {\n onPointerDown(event) {\n // Screen reader activations (Android TalkBack, desktop screen readers) report a\n // mouse-like `pointerType`, but `ignoreMouse` must not drop them: hover logic cannot\n // open for a virtual press since there is no real pointer movement to wait for.\n // Virtual `touch` presses (iOS VoiceOver) keep their type so `touchOpenDelay` applies.\n pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? 'virtual' : event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n const nativeEvent = event.nativeEvent;\n const open = store.select('open');\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown');\n\n // Animations sometimes won't run on a typeable element if using a rAF.\n // Focus is always set on these elements. For touch, we may delay opening.\n // A screen reader press opens synchronously, so the popup's focus lands before the reader\n // re-syncs focus to its cursor, which would otherwise read as a stray move.\n const target = getTarget(nativeEvent);\n const isTypeable = isTypeableElement(target);\n if (isTypeable || pointerType === 'virtual') {\n // A virtual press may target a descendant of the trigger; the trigger is what opened.\n setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);\n return;\n }\n\n // Capture the currentTarget before the rAF.\n // as React sets it to null after the event handler completes.\n const eventCurrentTarget = event.currentTarget;\n\n // Wait until focus is set on the element. This is an alternative to\n // `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.\n frame.request(() => {\n setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);\n });\n },\n onClick(event) {\n if (eventOption === 'mousedown-only') {\n return;\n }\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerType) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const open = store.select('open');\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown' || openEventType === 'keydown' || openEventType === 'keyup');\n setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);\n },\n onKeyDown() {\n pointerTypeRef.current = undefined;\n }\n };\n }, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);\n return React.useMemo(() => enabled ? {\n reference\n } : EMPTY_OBJECT, [enabled, reference]);\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { getWindow } from '@floating-ui/utils/dom';\nimport { contains, getTarget } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../utils/event.mjs\";\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n const domRect = domElement?.getBoundingClientRect() || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(data.dataRef.current.openEvent?.type || '') && data.pointerType !== 'touch';\n const width = data.axis === 'y' ? domRect.width : 0;\n const height = data.axis === 'x' ? domRect.height : 0;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nexport function useClientPoint(store, props = {}) {\n const {\n enabled = true,\n axis = 'both'\n } = props;\n const open = store.useState('open');\n const floating = store.useState('floatingElement');\n const domReference = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const resetReference = useStableCallback(reference => {\n store.set('positionReference', reference);\n });\n const setReference = useStableCallback((newX, newY, referenceElement) => {\n if (initialRef.current) {\n return;\n }\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n store.set('positionReference', createVirtualElement(referenceElement ?? domReference, {\n x: newX,\n y: newY,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useStableCallback(event => {\n if (!open) {\n setReference(event.clientX, event.clientY, event.currentTarget);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReference(event.clientX, event.clientY, event.currentTarget);\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n React.useEffect(() => {\n if (!enabled) {\n resetReference(domReference);\n return undefined;\n }\n if (!openCheck) {\n return undefined;\n }\n function cleanupListener() {\n cleanupListenerRef.current?.();\n cleanupListenerRef.current = null;\n }\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n cleanupListener();\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n cleanupListenerRef.current = addEventListener(win, 'mousemove', handleMouseMove);\n } else {\n resetReference(domReference);\n }\n return cleanupListener;\n }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]);\n\n // Clear virtual cursor references when the hook unmounts. Enabled flips are handled above.\n React.useEffect(() => () => {\n store.set('positionReference', null);\n }, [store]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(event) {\n setPointerType(event.pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent, isVirtualClick } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(store, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n // A click whose press began before the floating element opened is the tail of that\n // gesture (e.g. the drag-release that opened it), not a new outside press.\n const sawPressWhileOpenRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n // Outlives effect re-runs so a pending reset can't leave `isComposingRef` stuck.\n const compositionTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element. The ref covers Safari, which fires\n // `compositionend` before `keydown`; `isComposing` covers compositions that began while closed.\n if (isComposingRef.current || native.isComposing) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n\n // A same-batch close+reopen never renders `open === false`, so only `openchange` can\n // observe that session boundary. The effect below covers controlled flips.\n React.useEffect(() => {\n function handleOpenChange(details) {\n // Only the closing half ends the session: `setOpen(true)` on an already-open\n // element (hovering an inactive trigger) must not drop a press mid-gesture.\n if (!details.open) {\n sawPressWhileOpenRef.current = false;\n }\n }\n events.on('openchange', handleOpenChange);\n return () => {\n events.off('openchange', handleOpenChange);\n };\n }, [events]);\n\n // Not cleared in the listener effect's cleanup, which can run mid-press when a dependency\n // changes. In a closed shadow root, the marker is the only inside-press signal.\n React.useEffect(() => clearInsideReactTree, [clearInsideReactTree]);\n React.useEffect(() => {\n if (!open || !enabled) {\n // Reset in the effect body, not the cleanup, which also runs when a dependency\n // changes mid-gesture.\n if (!open) {\n sawPressWhileOpenRef.current = false;\n isComposingRef.current = false;\n currentPointerTypeRef.current = '';\n touchStateRef.current = null;\n }\n return clearInsideReactTree;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const preventedPressSuppressionTimeout = new Timeout();\n const doc = ownerDocument(floatingElement);\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`. Set it here too, since closing\n // resets it while a composition can continue into the next open session.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n isComposingRef.current = true;\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // Only `click` events reach this point in intentional mode.\n if (getOutsidePressEvent() === 'intentional') {\n // Press-less clicks (keyboard, assistive technology, `element.click()`) report no\n // click count; `isVirtualClick` also catches the ones that do.\n if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {\n return;\n }\n\n // A press that starts inside and ends outside gets one suppressed\n // outside click. Run this after inside-target checks so inside clicks\n // don't consume the one-shot suppression.\n if (suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n\n // Only `pointerdown` marks a press; `mousedown` is its compatibility event, and\n // counting it would misattribute a gesture that started before open.\n if (event.type === 'pointerdown') {\n // Only a primary press can produce a `click`.\n if (event.button === 0) {\n sawPressWhileOpenRef.current = true;\n }\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n // A cancelled gesture produces no click. Not cleared on `pointerup`: the click\n // fires after it and must still find the press.\n if (event.type === 'pointercancel') {\n sawPressWhileOpenRef.current = false;\n }\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchmove', handleTouchMoveCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchend', handleTouchEndCapture, {\n capture: true,\n passive: true\n })));\n return () => {\n unsubscribe();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\n\n/**\n * Narrowed to the store members this hook uses so consumers do not need to provide\n * unrelated store capabilities.\n */\n\n/**\n * Keeps the provided FloatingRootStore in sync with the provided PopupStore.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n floatingRootContext: store,\n floatingId,\n nested,\n onOpenChange\n } = options;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const handleOpenChange = onOpenChange;\n popupStore.useSyncedValue('floatingId', floatingId);\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // Keep non-reactive context values fresh for interactions that call `store.setOpen`.\n store.context.onOpenChange = handleOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n * @param deferEndingState - a boolean that delays the `'ending'` state by a frame\n * @param animateInitialOpen - a boolean that makes an element which mounts already open still go\n * through `'starting'`. Off by default so content that was open on the first render (a\n * `defaultOpen` popup on page load, SSR'd markup) doesn't animate in.\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n // Starting at `false` while open lets the `open && !mounted` branch below run on the first\n // render, which is what produces the `'starting'` phase. React re-renders before committing, so\n // the element is still mounted in the same pass.\n const [mounted, setMounted] = React.useState(open && !animateInitialOpen);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n // Nothing to clear when the element mounted open or reopened after its exit settled.\n if (!open || enableIdleState || transitionStatus === undefined) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, transitionStatus]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}","/**\n * Excludes infinite animations, whose finished promises never resolve while they run.\n */\nexport function getFiniteAnimations(element, options) {\n return element.getAnimations(options).filter(animation => {\n const timing = animation.effect?.getTiming();\n return timing?.duration !== Infinity && timing?.iterations !== Infinity;\n });\n}","'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport { getFiniteAnimations } from \"../utils/getFiniteAnimations.mjs\";\nimport * as TransitionStatusDataAttributes from \"./TransitionStatusDataAttributes.mjs\";\nlet pendingCallbacks = null;\n\n/**\n * Runs the callback in a synchronous flush before the browser paints, so that the\n * browser doesn't paint an intermediate frame: https://github.com/mui/base-ui/issues/979\n * Callbacks that become ready within the same microtask checkpoint (e.g. multiple elements\n * whose animations finish together) are batched into a single commit:\n * https://github.com/mui/base-ui/issues/5481\n */\nfunction flushBeforePaint(fn) {\n if (!pendingCallbacks) {\n const callbacks = [];\n pendingCallbacks = callbacks;\n queueMicrotask(() => {\n pendingCallbacks = null;\n ReactDOM.flushSync(() => {\n for (const callback of callbacks) {\n callback();\n }\n });\n });\n }\n pendingCallbacks.push(fn);\n}\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * If an animation is canceled, waits for any replacement animations before executing.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param batch - Whether completions ready in the same microtask may be coalesced into a single\n * commit. A batched callback runs before earlier callbacks' React updates have committed, so only\n * opt in when the callback doesn't read state that another completion can change.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n if (!batch) {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n // Each callback gets its own commit so that later completions observe the React\n // updates caused by earlier ones.\n ReactDOM.flushSync(fnToExecute);\n return;\n }\n flushBeforePaint(() => {\n // Re-check at flush time: the signal may abort between queueing and the flush.\n if (!signal?.aborted) {\n fnToExecute();\n }\n });\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n // Discard fulfilled Animation values so unfinished animations cannot retain their targets.\n Promise.all(getFiniteAnimations(resolvedElement).map(animation => animation.finished.then(NOOP))).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }, () => {\n if (signal?.aborted) {\n return;\n }\n const currentAnimations = getFiniteAnimations(resolvedElement);\n if (currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n return;\n }\n done();\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.mjs\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n batch = false,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useForcedRerendering } from '@base-ui/utils/useForcedRerendering';\nimport { useTransitionStatus } from \"./useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"./useOpenChangeComplete.mjs\";\n/**\n * Keeps a popup mounted through its closing animation and unmounts it once the animation\n * finishes, unless the close cycle opted out through `preventUnmountOnClose`.\n * Store-agnostic: hosts sync `mounted` and `transitionStatus` wherever they need them.\n *\n * @returns `forceUnmount` unmounts the popup immediately. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback,\n * and a call while the popup is open only takes effect if a close commits in the same batch.\n */\nexport function useUnmountAfterClose(parameters) {\n const {\n open,\n ref,\n preventUnmountOnClose,\n setPreventUnmountOnClose: setPreventUnmountOnCloseParam,\n onUnmount,\n animateInitialOpen\n } = parameters;\n const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, false, false, animateInitialOpen);\n\n // Opening starts a new close cycle. Derive during render so the close-completion hook below\n // reads the value on the same pass, and clear the stored value so it doesn't leak into the next\n // close. The effect only runs when `open` changes, so an opt-out recorded while a controlled\n // close is still pending (for example in a transition) is not cleared by the render that still\n // sees `open`.\n const preventUnmountingOnClose = open ? false : preventUnmountOnClose;\n useIsoLayoutEffect(() => {\n if (open) {\n setPreventUnmountOnClose(false);\n }\n }, [open, setPreventUnmountOnClose]);\n\n // Mirrors `mounted` synchronously so repeated `forceUnmount()` calls in one batch complete\n // closing once. Resynced on every commit: `setMounted(false)` while open re-mounts on the next\n // render without changing the committed `mounted`, so a `[mounted]` dependency would leave the\n // mirror stale and block every later unmount.\n const mountedRef = React.useRef(mounted);\n const pendingUnmountRef = React.useRef(false);\n const rerender = useForcedRerendering();\n const unmount = () => {\n mountedRef.current = false;\n setMounted(false);\n onUnmount();\n };\n useIsoLayoutEffect(() => {\n mountedRef.current = mounted;\n if (pendingUnmountRef.current) {\n pendingUnmountRef.current = false;\n if (!open && mounted) {\n unmount();\n }\n }\n });\n const forceUnmount = useStableCallback(() => {\n if (!mountedRef.current) {\n return;\n }\n if (open) {\n // The rendered `open` can't tell a stale exit-animation callback after a quick reopen from a\n // close batched with this call (`close(); unmount()`). Decide once the batch commits: unmount\n // if the popup closed, otherwise drop the call rather than run the host's unmount cleanup and\n // the close completion against a live popup.\n pendingUnmountRef.current = true;\n rerender();\n return;\n }\n unmount();\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !preventUnmountingOnClose,\n open,\n ref,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n mounted,\n transitionStatus,\n preventUnmountingOnClose,\n forceUnmount\n };\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\n\n/**\n * The subset of a popup handle that a Root needs to bind its store to. Both the real handle classes\n * and any test double satisfy it.\n */\n\n/**\n * Creates and owns a popup store on behalf of a Root part. The store is created exactly once, with\n * controlled props and root state synced separately after creation. Sets up the synced floating\n * root context and returns the store.\n *\n * @param createStore Factory that builds the store. Called exactly once, receiving the floating id\n * and whether the popup is nested inside another floating element, both resolved on the first render.\n * @param treatPopupAsFloatingElement Whether the popup element is passed to Floating UI as the\n * floating element instead of the default positioner.\n */\nexport function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const store = useRefWithInit(() => createStore(floatingId, nested)).current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return store;\n}\n\n/**\n * Attaches a Root's store to a handle for this component's committed lifetime. Popup Roots render\n * it before their interactions and user children so its layout effect runs before descendant layout\n * effects. This lets descendants call the handle during the Root's initial commit without attaching\n * during render, which would leak suspended or abandoned stores. Store subscribers are notified by\n * `attachStore` in this ordinary layout phase, where React permits synchronous updates.\n *\n * Popup Roots must render this component only when a handle is present so handle-less Roots avoid\n * mounting an extra fiber and layout effect.\n */\nexport function PopupHandleAttachment({\n handle,\n store\n}) {\n useIsoLayoutEffect(() => {\n return handle.attachStore(store);\n }, [handle, store]);\n return null;\n}\nfunction syncTriggerCount(store) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n}\n\n/**\n * Returns a stable callback ref that registers/unregisters the trigger element in the store.\n *\n * Stable so a downstream ref merger that retains the callback it was first given still reaches the\n * trigger's current store. The registration is tracked as a `(store, id, element)` triple, so\n * unregistering targets the store the element was actually registered in.\n *\n * Since the callback never changes, the caller must re-run it from a layout effect keyed on\n * `[store, id]` to migrate an already-registered element. That effect is also what registers the\n * element in the first place when `id` only resolves after the first commit (React 17's `useId`\n * fallback), because the register call made while the id is still `undefined` does nothing.\n *\n * @param id Id of the trigger.\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n const registrationRef = React.useRef(null);\n return useStableCallback(element => {\n const registration = registrationRef.current;\n if (registration !== null) {\n if (registration.element === element && registration.store === store && registration.id === id) {\n // Already registered where it belongs, so the caller's migration effect is free on mount.\n return;\n }\n registrationRef.current = null;\n const registeredStore = registration.store;\n if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {\n registeredStore.context.triggerElements.delete(registration.id);\n syncTriggerCount(registeredStore);\n }\n }\n if (element !== null && id !== undefined) {\n registrationRef.current = {\n store,\n id,\n element\n };\n store.context.triggerElements.add(id, element);\n syncTriggerCount(store);\n }\n });\n}\nexport function createPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n let preventUnmountingOnClose = state.preventUnmountingOnClose;\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n let activeTriggerId = state.activeTriggerId;\n let activeTriggerElement = state.activeTriggerElement;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n activeTriggerId = triggerId;\n activeTriggerElement = trigger ?? null;\n }\n return {\n open,\n preventUnmountingOnClose,\n activeTriggerId,\n activeTriggerElement,\n // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not\n // be reassociated with a lone registered trigger later on. Controlled and default opens never\n // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a\n // controlled root may decline it and stay open, so the Root clears the flag only once the\n // popup is effectively closed.\n openedWithoutTrigger: open ? trigger == null : state.openedWithoutTrigger\n };\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n const updatedState = {\n ...options.extraState,\n ...popupOpenState\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n\n // Applies trigger-owned state (active-trigger ownership and payload) when the trigger registers.\n // Stable so payload/`stateUpdates` changes do not change the ref identity (which would needlessly\n // churn registration); it reads the latest closure values when invoked.\n const applyTriggerData = useStableCallback(element => {\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n const changes = {\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n };\n store.update(changes);\n return;\n }\n if (activeTriggerId == null && open && !store.state.openedWithoutTrigger) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work. A popup opened deliberately without a trigger\n // stays unassociated so the trigger's `payload` does not replace the programmatic one.\n const changes = {\n activeTriggerId: triggerId ?? null,\n activeTriggerElement: element,\n ...stateUpdates\n };\n store.update(changes);\n }\n });\n\n // Stable, so the merged ref on the rendered element keeps its identity for the trigger's whole\n // lifetime.\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (element) {\n applyTriggerData(element);\n }\n });\n\n // A stable ref does not re-fire on a store or id change, so migrate here instead: unregister from\n // the previous store, then register the element the trigger still renders into the current one.\n useIsoLayoutEffect(() => {\n registerTrigger(triggerElementRef.current);\n return () => registerTrigger(null);\n }, [registerTrigger, triggerElementRef, store, triggerId]);\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n const changes = {\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n };\n store.update(changes);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger, unless the open request deliberately carried no trigger\n * (`openedWithoutTrigger`). When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger id is missing from the\n * registry but the same element is still registered under a different id (e.g. the rendered trigger\n * carries its own DOM `id` that differs from Base UI's internal trigger id), the active id is\n * reassociated to the registered id instead of being treated as lost. When the active trigger\n * unregisters, the default path preserves existing ownership so non-closing popup families do not\n * silently claim a different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering a previously resolved active trigger\n * requests a close after a microtask so a same-tick replacement trigger with the same id can\n * register first. An active trigger id that has not matched a registered trigger yet is treated as\n * pending and does not request a close.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n // Distinguishes a trigger that unmounted from a new active trigger that has not hydrated yet.\n const resolvedActiveTriggerIdRef = React.useRef(null);\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n // Subscribe to the active trigger id so the reconciliation below reruns when ownership moves to\n // another trigger while the popup stays open (e.g. a focus/hover handoff between triggers).\n const activeTriggerId = store.useState('activeTriggerId');\n // Subscribe to the active trigger element so the reconciliation reruns when a pending active\n // trigger registers in a commit where the trigger count nets out unchanged (registration\n // forwards the element to the store when the registering trigger matches the active id).\n // Without this, the id would never be marked resolved and a later genuine unmount would be\n // misclassified as pending, disabling `closeOnActiveTriggerUnmount`.\n const reactiveActiveTriggerElement = store.useState('activeTriggerElement');\n useIsoLayoutEffect(() => {\n if (!open) {\n resolvedActiveTriggerIdRef.current = null;\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n // The flag is cleared only here, once the popup is effectively closed: a controlled root may\n // decline a close request and stay open, and a controlled close never reaches\n // `createPopupOpenState` at all.\n if (store.state.openedWithoutTrigger) {\n store.set('openedWithoutTrigger', false);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const currentActiveTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (currentActiveTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);\n if (!activeTriggerElement) {\n for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {\n if (triggerElement === store.state.activeTriggerElement) {\n stateUpdates.activeTriggerId = triggerId;\n stateUpdates.activeTriggerElement = triggerElement;\n resolvedActiveTriggerIdRef.current = triggerId;\n break;\n }\n }\n if (stateUpdates.activeTriggerId === undefined) {\n if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {\n lostActiveTriggerId = currentActiveTriggerId;\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = currentActiveTriggerId;\n if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n resolvedActiveTriggerIdRef.current = implicitTriggerId;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n * @param animateInitialOpen Whether a popup that mounts already open should still play its enter\n * transition. Defaults to `false`, so content that was open on the first render (a `defaultOpen`\n * popup on page load, SSR'd markup) appears without animating. Opt in for popups whose subtree\n * only mounts in response to something the user did, such as a submenu inside a menu popup.\n *\n * @returns A function to forcibly unmount the popup. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback.\n */\nexport function useOpenStateTransitions(open, store, onUnmount, animateInitialOpen) {\n const {\n mounted,\n transitionStatus,\n forceUnmount\n } = useUnmountAfterClose({\n open,\n ref: store.context.popupRef,\n preventUnmountOnClose: store.useState('preventUnmountingOnClose'),\n setPreventUnmountOnClose: preventUnmountOnClose => store.set('preventUnmountingOnClose', preventUnmountOnClose),\n animateInitialOpen,\n onUnmount() {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n }\n });\n\n // Seed the Root-owned store before parts subscribe, matching the hook's initial mounted state.\n // Otherwise, an initially open Root looks like a reopen until the layout effect syncs the store.\n useRefWithInit(() => {\n store.set('mounted', mounted);\n return null;\n });\n store.useSyncedValues({\n mounted,\n transitionStatus\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}","/**\n * Development-only reverse index of element to registered id, keyed by the owning map.\n *\n * Registration would otherwise have to scan every entry to detect an element claimed by two ids,\n * making the mount of many triggers sharing one handle quadratic. Kept module-scoped, lazily\n * initialized, and read only from `process.env.NODE_ENV` guards so production builds drop it along\n * with the checks.\n */\nlet devElementIdsByMap;\nfunction getDevElementIds(map) {\n devElementIdsByMap ??= new WeakMap();\n let elementIds = devElementIdsByMap.get(map);\n if (!elementIds) {\n elementIds = new WeakMap();\n devElementIdsByMap.set(map, elementIds);\n }\n return elementIds;\n}\n\n/**\n * Data structure to keep track of popup trigger elements by their IDs.\n *\n * Element lookups iterate the id map rather than maintaining a parallel Set. Registration is O(1),\n * while `hasElement` and `hasMatchingElement` are linear in the number of triggers.\n */\nexport class PopupTriggerMap {\n idMap = new Map();\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n if (process.env.NODE_ENV !== 'production') {\n const elementIds = getDevElementIds(this);\n const existingId = elementIds.get(element);\n if (existingId !== undefined && existingId !== id) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n\n // Reusing an id for a different element evicts the previous one, so it must lose its claim\n // on the id or a later registration under a different id would be reported as a duplicate.\n const previousElement = this.idMap.get(id);\n if (previousElement !== undefined && previousElement !== element) {\n elementIds.delete(previousElement);\n }\n elementIds.set(element, id);\n }\n this.idMap.set(id, element);\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n if (process.env.NODE_ENV !== 'production') {\n const element = this.idMap.get(id);\n if (element !== undefined) {\n devElementIdsByMap?.get(this)?.delete(element);\n }\n }\n this.idMap.delete(id);\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n for (const registered of this.idMap.values()) {\n if (registered === element) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.idMap.values()) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.idMap.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.mjs\";\nimport { register, getInstance } from \"../fastHooks.mjs\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (!Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3)\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.value = selector(store.getSnapshot(), a1, a2, a3);\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * Creates a store with the given initial state, constructing the class it is called on.\n * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that\n * class but degrades the inferred instance type to `Store`; use `new` there instead.\n */\n static create(state) {\n return new this(state);\n }\n\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n *\n * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${previouslyControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${previouslyControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\nimport { isClickLikeEvent } from \"../utils.mjs\";\nconst selectors = {\n open: state => state.open,\n transitionStatus: state => state.transitionStatus,\n domReferenceElement: state => state.domReferenceElement,\n referenceElement: state => state.positionReference ?? state.referenceElement,\n floatingElement: state => state.floatingElement,\n floatingId: state => state.floatingId\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n }),\n floatingId,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n openedWithoutTrigger: false,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nconst activeTriggerIdSelector = state => state.triggerIdProp ?? state.activeTriggerId;\nconst openSelector = state => state.openProp ?? state.open;\nconst popupIdSelector = state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n};\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: state => state.mounted,\n // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a\n // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase.\n transitionStatus: state => openSelector(state) && !state.mounted ? 'starting' : state.transitionStatus,\n floatingRootContext: state => state.floatingRootContext,\n triggerCount: state => state.triggerCount,\n preventUnmountingOnClose: state => state.preventUnmountingOnClose,\n payload: state => state.payload,\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: state => state.mounted ? state.activeTriggerElement : null,\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId,\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted,\n triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined,\n popupProps: state => state.popupProps,\n popupElement: state => state.popupElement,\n positionerElement: state => state.positionerElement\n};\n\n/**\n * Store members a detached handle-backed trigger reads or invokes for trigger registration and data\n * forwarding. `set`/`update` are included only for trigger-count and trigger-data bookkeeping; on a\n * detached (inert) store they are intentionally no-ops, so a write through them is not guaranteed to\n * be durable. Component handle-store views Pick these from their concrete store (preserving its\n * context and selectors) and add any component-specific trigger-invoked members such as `setOpen`.\n */\n\n/**\n * The subset of a popup store that trigger registration and data forwarding rely on. Narrow enough\n * that an inert store can be passed while detached.\n */","'use client';\n\nimport * as React from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from '@base-ui/utils/empty';\n/**\n * Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.\n * Detached triggers use this to follow a handle as a root attaches or detaches: while no root is\n * attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and\n * read from the live root store.\n *\n * Returns `undefined` when no handle is provided so callers can fall back to their root context.\n *\n * @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.\n */\nexport function usePopupHandleStore(handle) {\n const subscribe = React.useCallback(listener => {\n if (handle === undefined) {\n return NOOP;\n }\n return handle.subscribeStore(listener);\n }, [handle]);\n const getSnapshot = React.useCallback(() => {\n return handle === undefined ? undefined : handle.store;\n }, [handle]);\n return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);\n}","'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.mjs\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.mjs\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { platform } from '@base-ui/utils/platform';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { getWindow, isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { activeElement, contains, getTarget, isTargetInsideEnabledTrigger, isTypeableElement, matchesFocusVisible } from \"../utils/element.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nconst isMacSafari = platform.os.mac && platform.engine.webkit;\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nexport function useFocus(store, props = {}) {\n const {\n enabled = true,\n delay\n } = props;\n const {\n events,\n dataRef\n } = store.context;\n const blockFocusRef = React.useRef(false);\n // Track which reference should be blocked from re-opening after Escape/press dismissal.\n const blockedReferenceRef = React.useRef(null);\n const keyboardModalityRef = React.useRef(true);\n const timeout = useTimeout();\n React.useEffect(() => {\n const domReference = store.select('domReferenceElement');\n if (!enabled) {\n return undefined;\n }\n const win = getWindow(domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n const currentDomReference = store.select('domReferenceElement');\n if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {\n blockFocusRef.current = true;\n blockedReferenceRef.current = currentDomReference;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n function onPointerDown() {\n keyboardModalityRef.current = false;\n }\n return mergeCleanups(addEventListener(win, 'blur', onBlur), isMacSafari && addEventListener(win, 'keydown', onKeyDown, true), isMacSafari && addEventListener(win, 'pointerdown', onPointerDown, true));\n }, [store, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (details.reason === REASONS.triggerPress || details.reason === REASONS.escapeKey) {\n const referenceElement = store.select('domReferenceElement');\n if (isElement(referenceElement)) {\n blockedReferenceRef.current = referenceElement;\n blockFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [events, enabled, store]);\n const reference = React.useMemo(() => {\n function resetBlockedFocus() {\n blockFocusRef.current = false;\n blockedReferenceRef.current = null;\n }\n return {\n onMouseLeave() {\n resetBlockedFocus();\n },\n onFocus(event) {\n const focusTarget = event.currentTarget;\n if (blockFocusRef.current) {\n if (blockedReferenceRef.current === focusTarget) {\n return;\n }\n resetBlockedFocus();\n }\n const target = getTarget(event.nativeEvent);\n if (isElement(target)) {\n // Safari fails to match `:focus-visible` if focus was initially\n // outside the document.\n if (isMacSafari && !event.relatedTarget) {\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n } else if (!matchesFocusVisible(target)) {\n return;\n }\n }\n const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);\n const {\n nativeEvent,\n currentTarget\n } = event;\n if (store.select('open') && movedFromOtherEnabledTrigger || !delay) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n return;\n }\n timeout.start(delay, () => {\n if (blockFocusRef.current) {\n return;\n }\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n });\n },\n onBlur(event) {\n resetBlockedFocus();\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeout.start(0, () => {\n const domReference = store.select('domReferenceElement');\n const activeEl = activeElement(ownerDocument(domReference));\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === domReference) {\n return;\n }\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n\n // If the next focused element is one of the triggers, do not close\n // the floating element. The focus handler of that trigger will\n // handle the open state.\n const nextFocusedElement = relatedTarget ?? activeEl;\n if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerFocus, nativeEvent));\n });\n }\n };\n }, [dataRef, delay, store, timeout]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { isInteractiveElement } from \"../utils.mjs\";\nexport { isInteractiveElement };\nexport class HoverInteraction {\n pointerType = undefined;\n interactedInside = false;\n handler = undefined;\n blockMouseMove = true;\n performedPointerEventsMutation = false;\n pointerEventsScopeElement = null;\n pointerEventsReferenceElement = null;\n pointerEventsFloatingElement = null;\n restTimeoutPending = false;\n openChangeTimeout = new Timeout();\n restTimeout = new Timeout();\n handleCloseOptions = undefined;\n static create() {\n return new HoverInteraction();\n }\n dispose = () => {\n this.openChangeTimeout.clear();\n this.restTimeout.clear();\n };\n disposeEffect = () => {\n return this.dispose;\n };\n}\nconst pointerEventsMutationOwnerByScopeElement = new WeakMap();\nexport function clearSafePolygonPointerEventsMutation(instance) {\n if (!instance.performedPointerEventsMutation) {\n return;\n }\n const scopeElement = instance.pointerEventsScopeElement;\n if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {\n instance.pointerEventsScopeElement?.style.removeProperty('pointer-events');\n instance.pointerEventsReferenceElement?.style.removeProperty('pointer-events');\n instance.pointerEventsFloatingElement?.style.removeProperty('pointer-events');\n pointerEventsMutationOwnerByScopeElement.delete(scopeElement);\n }\n instance.performedPointerEventsMutation = false;\n instance.pointerEventsScopeElement = null;\n instance.pointerEventsReferenceElement = null;\n instance.pointerEventsFloatingElement = null;\n}\nexport function applySafePolygonPointerEventsMutation(instance, options) {\n const {\n scopeElement,\n referenceElement,\n floatingElement\n } = options;\n const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);\n if (existingOwner && existingOwner !== instance) {\n clearSafePolygonPointerEventsMutation(existingOwner);\n }\n clearSafePolygonPointerEventsMutation(instance);\n instance.performedPointerEventsMutation = true;\n instance.pointerEventsScopeElement = scopeElement;\n instance.pointerEventsReferenceElement = referenceElement;\n instance.pointerEventsFloatingElement = floatingElement;\n pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);\n scopeElement.style.pointerEvents = 'none';\n referenceElement.style.pointerEvents = 'auto';\n floatingElement.style.pointerEvents = 'auto';\n}\nexport function useHoverInteractionSharedState(store) {\n const data = store.context.dataRef.current;\n const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;\n if (!data.hoverInteractionState) {\n data.hoverInteractionState = instance;\n }\n useOnMount(data.hoverInteractionState.disposeEffect);\n return data.hoverInteractionState;\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { closest, contains, getTarget } from \"../utils/element.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, isInteractiveElement, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.mjs\";\nimport { getDelay, isClickLikeOpenEvent as isClickLikeOpenEventShared, isHoverOpenEvent, isInsideEnabledTrigger } from \"./useHoverShared.mjs\";\n/**\n * Provides hover interactions that should be attached to the floating element.\n */\nexport function useHoverFloatingInteraction(store, parameters = {}) {\n const {\n enabled = true,\n closeDelay: closeDelayProp = 0,\n nodeId: nodeIdProp\n } = parameters;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const {\n dataRef\n } = store.context;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const instance = useHoverInteractionSharedState(store);\n const childClosedTimeout = useTimeout();\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const isHoverOpen = useStableCallback(() => {\n return isHoverOpenEvent(dataRef.current.openEvent?.type);\n });\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n instance.pointerType = undefined;\n instance.restTimeoutPending = false;\n instance.interactedInside = false;\n clearPointerEvents();\n }\n }, [open, instance, clearPointerEvents]);\n React.useEffect(() => {\n return clearPointerEvents;\n }, [clearPointerEvents]);\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {\n const ref = domReferenceElement;\n const floatingEl = floatingElement;\n const doc = ownerDocument(floatingElement);\n const parentFloating = tree?.nodesRef.current.find(node => node.id === parentId)?.context?.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n\n // A keep-mounted submenu can appear in the tree before it opens, so a\n // cached scope or parent lookup may resolve to the submenu itself. That\n // would not shield sibling items in the parent menu.\n const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;\n const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, '[data-rootownerid]') ?? doc.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: ref,\n floatingElement: floatingEl\n });\n return () => {\n clearPointerEvents();\n };\n }\n return undefined;\n }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function hasParentChildren() {\n return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);\n }\n function closeWithDelay(event) {\n const closeDelay = getDelay(closeDelayProp, 'close', instance.pointerType);\n const close = () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n };\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, close);\n } else {\n instance.openChangeTimeout.clear();\n close();\n }\n }\n function handleInteractInside(event) {\n const target = getTarget(event);\n if (!isInteractiveElement(target)) {\n instance.interactedInside = false;\n return;\n }\n instance.interactedInside = closest(target, '[aria-haspopup]') != null;\n }\n function onFloatingMouseEnter() {\n instance.openChangeTimeout.clear();\n childClosedTimeout.clear();\n tree?.events.off('floating.closed', onNodeClosed);\n clearPointerEvents();\n }\n function onFloatingMouseLeave(event) {\n if (hasParentChildren() && tree) {\n tree.events.on('floating.closed', onNodeClosed);\n return;\n }\n if (isInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {\n // If the mouse is leaving the reference element to another trigger, don't explicitly close the popup\n // as it will be moved.\n return;\n }\n const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;\n const relatedTarget = event.relatedTarget;\n const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some(node => contains(node.context?.elements.floating, relatedTarget));\n if (isMovingIntoDescendantFloating) {\n return;\n }\n\n // If the safePolygon handler is active, let it handle the close logic.\n if (instance.handler) {\n instance.handler(event);\n return;\n }\n clearPointerEvents();\n if (isHoverOpen() && !isClickLikeOpenEvent()) {\n closeWithDelay(event);\n }\n }\n function onNodeClosed(event) {\n if (!tree || !parentId || hasParentChildren()) {\n return;\n }\n // Allow the mouseenter event to fire in case child was closed because mouse moved into parent.\n childClosedTimeout.start(0, () => {\n tree.events.off('floating.closed', onNodeClosed);\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree.events.emit('floating.closed', event);\n });\n }\n const floating = floatingElement;\n return mergeCleanups(floating && addEventListener(floating, 'mouseenter', onFloatingMouseEnter), floating && addEventListener(floating, 'mouseleave', onFloatingMouseLeave), floating && addEventListener(floating, 'pointerdown', handleInteractInside, true), () => {\n tree?.events.off('floating.closed', onNodeClosed);\n });\n }, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { contains, getTarget } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../utils/event.mjs\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.mjs\";\nimport { getDelay, getRestMs, isClickLikeOpenEvent as isClickLikeOpenEventShared, isInsideEnabledTrigger } from \"./useHoverShared.mjs\";\nconst EMPTY_REF = {\n current: null\n};\n\n/**\n * Provides hover interactions that should be attached to reference or trigger\n * elements.\n */\nexport function useHoverReferenceInteraction(store, props = {}) {\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true,\n triggerElementRef = EMPTY_REF,\n externalTree,\n isActiveTrigger = true,\n getHandleCloseContext,\n isClosing,\n shouldOpen: shouldOpenProp,\n guardStaleOpen = false\n } = props;\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const instance = useHoverInteractionSharedState(store);\n const isHoverCloseActiveRef = React.useRef(false);\n const handleCloseRef = useValueAsRef(handleClose);\n const delayRef = useValueAsRef(delay);\n const restMsRef = useValueAsRef(restMs);\n const enabledRef = useValueAsRef(enabled);\n const shouldOpenRef = useValueAsRef(shouldOpenProp);\n const isClosingRef = useValueAsRef(isClosing);\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const checkShouldOpen = useStableCallback(() => {\n return shouldOpenRef.current?.() !== false;\n });\n const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {\n const allTriggers = store.context.triggerElements;\n\n // Fast path for normal usage where handlers are attached directly to triggers.\n if (allTriggers.hasElement(currentTarget)) {\n return !currentDomReference || !contains(currentDomReference, currentTarget);\n }\n\n // Fallback for delegated/wrapper usage where currentTarget may be outside the trigger map.\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n return allTriggers.hasMatchingElement(trigger => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));\n });\n const cleanupMouseMoveHandler = useStableCallback(() => {\n if (!instance.handler) {\n return;\n }\n const doc = ownerDocument(store.select('domReferenceElement'));\n doc.removeEventListener('mousemove', instance.handler);\n instance.handler = undefined;\n });\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n if (isActiveTrigger) {\n // eslint-disable-next-line no-underscore-dangle\n instance.handleCloseOptions = handleClose?.__options;\n }\n React.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (!details.open) {\n isHoverCloseActiveRef.current = details.reason === REASONS.triggerHover;\n cleanupMouseMoveHandler();\n instance.openChangeTimeout.clear();\n instance.restTimeout.clear();\n instance.blockMouseMove = true;\n instance.restTimeoutPending = false;\n } else {\n isHoverCloseActiveRef.current = false;\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [enabled, events, instance, cleanupMouseMoveHandler]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function closeWithDelay(event, runElseBranch = true) {\n const closeDelay = getDelay(delayRef.current, 'close', instance.pointerType);\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n });\n } else if (runElseBranch) {\n instance.openChangeTimeout.clear();\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n }\n }\n const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select('domReferenceElement') : null);\n if (!isElement(trigger)) {\n return undefined;\n }\n function onMouseEnter(event) {\n instance.openChangeTimeout.clear();\n instance.blockMouseMove = false;\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n\n // Only rest delay is set; there's no fallback delay.\n // This will be handled by `onMouseMove`.\n const restMsValue = getRestMs(restMsRef.current);\n const openDelay = getDelay(delayRef.current, 'open', instance.pointerType);\n const eventTarget = getTarget(event);\n const currentTarget = event.currentTarget ?? null;\n const currentDomReference = store.select('domReferenceElement');\n let triggerNode = currentTarget;\n\n // Wrapper/delegated mode: resolve the actual trigger from the event target.\n if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {\n for (const triggerElement of store.context.triggerElements.elements()) {\n if (contains(triggerElement, eventTarget)) {\n triggerNode = triggerElement;\n break;\n }\n }\n }\n\n // Wrapper/delegated mode fallback: if the wrapper contains the active trigger,\n // treat this as re-entering that active trigger.\n if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {\n triggerNode = currentDomReference;\n }\n const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);\n const isOpen = store.select('open');\n const isInClosingTransition = isClosingRef.current?.() ?? store.select('transitionStatus') === 'ending';\n const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;\n const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;\n const isRestOnlyDelay = restMsValue > 0 && !openDelay;\n const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;\n const shouldOpen = !isOpen || isOverInactive;\n\n // Open immediately when moving between triggers while open, or during\n // a hover-driven close transition (including same-trigger re-entry).\n if (shouldOpenImmediately) {\n if (checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n return;\n }\n if (isRestOnlyDelay) {\n return;\n }\n if (openDelay) {\n instance.openChangeTimeout.start(openDelay, () => {\n if (shouldOpen && checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n });\n } else if (shouldOpen) {\n if (checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n clearPointerEvents();\n return;\n }\n cleanupMouseMoveHandler();\n const domReferenceElement = store.select('domReferenceElement');\n const doc = ownerDocument(domReferenceElement);\n instance.restTimeout.clear();\n instance.restTimeoutPending = false;\n const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();\n if (isInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {\n return;\n }\n if (handleCloseRef.current && handleCloseContextBase) {\n if (!store.select('open')) {\n instance.openChangeTimeout.clear();\n }\n const currentTrigger = triggerElementRef.current;\n instance.handler = handleCloseRef.current({\n ...handleCloseContextBase,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (enabledRef.current && !isClickLikeOpenEvent() && currentTrigger === store.select('domReferenceElement')) {\n closeWithDelay(event, true);\n }\n }\n });\n doc.addEventListener('mousemove', instance.handler);\n instance.handler(event);\n return;\n }\n const shouldClose = instance.pointerType === 'touch' ? !contains(store.select('floatingElement'), event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n\n // Backup cancellation for Chrome's dropped `mouseleave` — see `guardStaleOpen`.\n function onMouseOut(event) {\n if (contains(trigger, event.relatedTarget)) {\n return; // moved within the trigger's own subtree\n }\n instance.openChangeTimeout.clear();\n instance.restTimeout.clear();\n instance.restTimeoutPending = false;\n }\n const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, 'mouseout', onMouseOut) : undefined;\n if (move) {\n return mergeCleanups(addEventListener(trigger, 'mousemove', onMouseEnter, {\n once: true\n }), addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);\n }\n return mergeCleanups(addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave), staleOpenGuard);\n }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);\n return React.useMemo(() => {\n if (!enabled) {\n return undefined;\n }\n function setPointerRef(event) {\n instance.pointerType = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n const trigger = event.currentTarget;\n const currentDomReference = store.select('domReferenceElement');\n const currentOpen = store.select('open');\n const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {\n const floatingElement = store.select('floatingElement');\n if (floatingElement) {\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: trigger,\n floatingElement\n });\n }\n }\n const restMsValue = getRestMs(restMsRef.current);\n if (currentOpen && !isOverInactive || restMsValue === 0) {\n return;\n }\n if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {\n return;\n }\n instance.restTimeout.clear();\n function handleMouseMove() {\n instance.restTimeoutPending = false;\n\n // A delayed hover open should not override a click-like open that happened\n // while the hover delay was pending.\n if (isClickLikeOpenEvent()) {\n return;\n }\n const latestOpen = store.select('open');\n if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, nativeEvent, trigger));\n }\n }\n if (instance.pointerType === 'touch') {\n ReactDOM.flushSync(() => {\n handleMouseMove();\n });\n } else if (isOverInactive && currentOpen) {\n handleMouseMove();\n } else {\n instance.restTimeoutPending = true;\n instance.restTimeout.start(restMsValue, handleMouseMove);\n }\n }\n };\n }, [enabled, instance, isClickLikeOpenEvent, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { platform } from '@base-ui/utils/platform';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { getMaxListIndex, getMinListIndex, getNextListIndex, isIndexOutOfListBounds } from \"../utils/composite.mjs\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"../utils/constants.mjs\";\nimport { activeElement, contains, getFloatingFocusElement, getTarget, isTypeableCombobox, isTypeableElement } from \"../utils/element.mjs\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.mjs\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.mjs\";\n\n// WebKit fires zero-delta `mousemove`/`pointermove` events when the list scrolls\n// beneath a stationary pointer, moving the highlight during keyboard navigation.\n// https://github.com/mui/base-ui/issues/4002\nfunction isStationaryWebKitPointer(event) {\n return platform.engine.webkit && event.movementX === 0 && event.movementY === 0;\n}\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nexport function isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nexport function isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nexport function isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nexport function isCrossOrientationCloseKey(key, orientation, rtl, grid) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && grid) {\n return key === 'Escape';\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(store, props) {\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n triggerOrientation = orientation,\n parentOrientation,\n id,\n resetOnPointerLeave = true,\n externalTree,\n nestedReturnFocusRef,\n grid: navigateGrid\n } = props;\n const isGrid = navigateGrid != null;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && isGrid) {\n console.warn('In grid list navigation mode, the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusFrame = useAnimationFrame();\n const waitForListPopulatedFrame = useAnimationFrame();\n const focusItem = useStableCallback(() => {\n // Synchronous navigation must also supersede any deferred focus from an earlier update.\n focusFrame.cancel();\n function runFocus(item) {\n if (!virtual) {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? callback => callback() : callback => focusFrame.request(callback);\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n }\n // Explicit values can change with the opening interaction. Keep an inferred 'auto' value\n // from the trigger event, but apply a boolean before the initial highlight is synchronized.\n if (!open || focusItemOnOpen !== 'auto') {\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Reset the active index when the list is no longer open and mounted (closing or\n // unmounting). `onNavigate` is a stable callback that always forwards to the latest\n // `onNavigate` prop.\n indexRef.current = -1;\n onNavigate();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? callback => waitForListPopulatedFrame.request(callback) : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // Initially focus the first non-disabled item. `disabledIndices` is deliberately\n // omitted here so attribute-disabled items (`disabled`/`aria-disabled`) are skipped\n // on open even when the consumer passes an empty `disabledIndices` array. Passing it\n // would regress that behavior (see mui/base-ui#2604).\n // The key came from the trigger, so it is read on the trigger's orientation.\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, triggerOrientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, triggerOrientation, rtl, onNavigate, focusItem, waitForListPopulatedFrame]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n // `floatingElement` is null here (see the guard above), so resolve the owner document from an\n // in-DOM element for realm-safety (shadow DOM/iframes): the reference element, falling back to\n // the parent floating element when the reference is virtual (`domReferenceElement` is null).\n const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, domReferenceElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const getParentOrientation = useStableCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n });\n const getMinEnabledIndex = useStableCallback(() => {\n return getMinListIndex(listRef, disabledIndicesRef.current);\n });\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;\n if (isHTMLElement(returnElement)) {\n returnElement.focus();\n }\n return;\n }\n\n // The consumer owns `activeIndex` and may decline a navigation this hook proposed, such as a\n // virtual list keeping its highlight when the reference is refocused. Declining produces no\n // re-render, so reconcile here: otherwise the cursor drifts from the rendered highlight and\n // this key moves from the wrong position.\n if (activeIndex != null && activeIndex !== indexRef.current && !isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation is injected by grid-capable consumers so non-grid\n // consumers (menu, select) tree-shake the grid helpers out.\n if (navigateGrid != null) {\n const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);\n\n // The grid navigator returns the unchanged index for keys it does not handle, and\n // reporting that as a navigation would re-emit the current highlight on every keydown.\n if (index != null && index !== indexRef.current) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused. Focus can also rest on a container inside the\n // popup, such as a list that holds the `menu` role. Keys bubbling from a portaled nested\n // popup are not in this popup's DOM, so they navigate from the current index.\n const focusedElement = activeElement(event.currentTarget.ownerDocument);\n if (open && !virtual && contains(event.currentTarget, focusedElement) && !listRef.current.some(item => item != null && contains(item, focusedElement))) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n // The boundary item may already be highlighted, so `activeIndex` won't change and the\n // effect that moves focus to the highlighted item won't run.\n if (activeIndex === indexRef.current) {\n focusItem();\n }\n return;\n }\n const {\n index,\n wrapped\n } = getNextListIndex(listRef.current, currentIndex, {\n decrement: !isMainOrientationToEndKey(event.key, orientation, rtl),\n loopFocus,\n allowEscape,\n disabledIndices,\n minIndex,\n maxIndex\n });\n if (wrapped) {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n }\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick({\n currentTarget\n }) {\n // Safari. Skipped under virtual focus, which must keep real focus on the reference.\n if (!virtual) {\n currentTarget.focus({\n preventScroll: true\n });\n }\n },\n onMouseMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n const details = createChangeEventDetails(REASONS.focusOut, event.nativeEvent);\n store.setOpen(false, details);\n const returnElement = nestedReturnFocusRef?.current ?? domReferenceElement;\n if (!details.isCanceled && isHTMLElement(returnElement)) {\n returnElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove(event) {\n if (isStationaryWebKitPointer(event)) {\n return;\n }\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, typeableComboboxReference, store, open, virtual, domReferenceElement, nestedReturnFocusRef]);\n const trigger = React.useMemo(() => {\n function openOnNavigationKeyDown(event) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, currentOpen ? orientation : triggerOrientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen && (!nested || isTypeableElement(event.currentTarget))) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinEnabledIndex();\n onNavigate(event);\n if (virtual) {\n floatingFocusElementRef.current?.focus();\n }\n } else {\n openOnNavigationKeyDown(event);\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n openOnNavigationKeyDown(event);\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (event.target !== event.currentTarget) {\n return;\n }\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, focusItemOnOpen, getMinEnabledIndex, nested, onNavigate, store, openOnArrowKeyDown, orientation, triggerOrientation, getParentOrientation, rtl, selectedIndexRef, virtual, floatingFocusElementRef]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { isElementVisible, isListIndexDisabled } from \"../utils/composite.mjs\";\nimport { contains } from \"../utils/element.mjs\";\nimport { stopEvent } from \"../utils/event.mjs\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(store, props) {\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n disabledIndices,\n onTyping: onTypingProp,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const onTyping = useStableCallback(onTypingProp);\n const open = store.useState('open');\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n const onKeyDown = useStableCallback(event => {\n function getElement(index) {\n return elementsRef?.current[index];\n }\n function isItemAvailable(index) {\n const element = getElement(index);\n if (element && !isElementVisible(element) || element?.matches(':disabled')) {\n return false;\n }\n // Visibility and native disabled state are handled above; pass an empty\n // element list so `isListIndexDisabled` resolves only the explicit\n // `disabledIndices` (array/predicate) and skips its own fallbacks.\n // Consumers that don't pass `disabledIndices` keep matching every visible\n // item except native disabled elements provided through `elementsRef`.\n return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n onTyping?.(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n onTyping?.(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n onTyping?.(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too. Unavailable items are skipped while matching, so\n // they must be ignored here as well — otherwise a hidden or disabled double-letter\n // label would block rapid cycling through the available items.\n const allowRapidSuccessionOfFirstLetter = listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index, event);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n onTyping?.(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinComposite = contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinComposite) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n onTyping?.(false);\n });\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n onTyping?.(false);\n }\n }, [open, selectedIndex, timeout, onTyping]);\n const sharedProps = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference: sharedProps,\n floating: sharedProps\n } : {}, [enabled, sharedProps]);\n}","import { isElement } from '@floating-ui/utils/dom';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { contains, getTarget } from \"./utils/element.mjs\";\nimport { getNodeChildren } from \"./utils/nodes.mjs\";\n\n/* eslint-disable no-nested-ternary */\n\nconst CURSOR_SPEED_THRESHOLD = 0.1;\nconst CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;\nconst POLYGON_BUFFER = 0.5;\nfunction hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {\n return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;\n}\nfunction isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {\n let isInsideValue = false;\n if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {\n isInsideValue = !isInsideValue;\n }\n return isInsideValue;\n}\nfunction isInsideRect(pointX, pointY, rect) {\n return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;\n}\nfunction isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {\n const minX = Math.min(x1, x2);\n const maxX = Math.max(x1, x2);\n const minY = Math.min(y1, y2);\n const maxY = Math.max(y1, y2);\n return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nexport function safePolygon(options = {}) {\n const {\n blockPointerEvents = false\n } = options;\n const timeout = new Timeout();\n const fn = ({\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n }) => {\n const side = placement?.split('-')[0];\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = typeof performance !== 'undefined' ? performance.now() : 0;\n function isCursorMovingSlowly(nextX, nextY) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return false;\n }\n const deltaX = nextX - lastX;\n const deltaY = nextY - lastY;\n const distanceSquared = deltaX * deltaX + deltaY * deltaY;\n const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return distanceSquared < thresholdSquared;\n }\n function close() {\n timeout.clear();\n onClose();\n }\n return function onMouseMove(event) {\n timeout.clear();\n const domReference = elements.domReference;\n const floating = elements.floating;\n if (!domReference || !floating || side == null || x == null || y == null) {\n return undefined;\n }\n const {\n clientX,\n clientY\n } = event;\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(floating, target);\n const isOverReferenceEl = contains(domReference, target);\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return undefined;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n if (!isLeave) {\n hasLanded = true;\n return undefined;\n }\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {\n return undefined;\n }\n function hasOpenChildNode() {\n return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);\n }\n function closeIfNoOpenChild() {\n if (!hasOpenChildNode()) {\n close();\n }\n }\n\n // If any nested child is open, abort.\n if (hasOpenChildNode()) {\n return undefined;\n }\n const refRect = domReference.getBoundingClientRect();\n const rect = floating.getBoundingClientRect();\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n closeIfNoOpenChild();\n return undefined;\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let isInsideTroughRect = false;\n switch (side) {\n case 'top':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);\n break;\n case 'bottom':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);\n break;\n case 'left':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);\n break;\n case 'right':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);\n break;\n default:\n }\n if (isInsideTroughRect) {\n return undefined;\n }\n if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {\n closeIfNoOpenChild();\n return undefined;\n }\n if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {\n closeIfNoOpenChild();\n return undefined;\n }\n let isInsidePolygon = false;\n switch (side) {\n case 'top':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y + POLYGON_BUFFER + 1;\n const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'bottom':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y - POLYGON_BUFFER;\n const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'left':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x + POLYGON_BUFFER + 1;\n const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);\n break;\n }\n case 'right':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x - POLYGON_BUFFER;\n const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);\n break;\n }\n default:\n }\n if (!isInsidePolygon) {\n closeIfNoOpenChild();\n } else if (!hasLanded) {\n timeout.start(40, closeIfNoOpenChild);\n }\n return undefined;\n };\n };\n\n // eslint-disable-next-line no-underscore-dangle\n fn.__options = {\n ...options,\n blockPointerEvents\n };\n return fn;\n}","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => {\n const result = offset$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => {\n const result = shift$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => {\n const result = limitShift$1(options);\n return {\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => {\n const result = flip$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => {\n const result = size$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => {\n const result = autoPlacement$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => {\n const result = hide$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => {\n const result = inline$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => {\n const result = arrow$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","import * as React from 'react';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { NOOP } from '@base-ui/utils/empty';\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { NullStore } from \"../../utils/NullStore.mjs\";\nimport { applyPopupOpenChange, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.mjs\";\nconst selectors = {\n ...popupStoreSelectors,\n disabled: state => state.disabled,\n instantType: state => state.instantType,\n isInstantPhase: state => state.isInstantPhase,\n trackCursorAxis: state => state.trackCursorAxis,\n disableHoverablePopup: state => state.disableHoverablePopup,\n lastOpenChangeReason: state => state.openChangeReason,\n closeOnClick: state => state.closeOnClick,\n // Active and inactive trigger props are the same object, so a constant for triggers that discard\n // them keeps those triggers from re-rendering when the props change.\n appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : undefined,\n closeDelay: state => state.closeDelay,\n adaptiveOrigin: state => state.adaptiveOrigin\n};\n\n/**\n * The store view that detached handle-backed triggers read from. Both the real `TooltipStore` and\n * the inert fallback store satisfy it, so a trigger can read from whichever store the handle\n * currently exposes. Narrowed to the members a trigger actually uses — the trigger-data members plus\n * `setOpen`/`cancelPendingOpen` (called directly by the trigger) and `useSyncedValue` — so the\n * exposed surface can't bypass the open-change pipeline; on the detached fallback store every one of\n * these mutations is a no-op.\n */\n\nexport class TooltipStore extends ReactStore {\n constructor(initialState, floatingId, nested) {\n const triggerElements = new PopupTriggerMap();\n super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n applyPopupOpenChange(this, nextOpen, eventDetails, {\n extraState: {\n openChangeReason: eventDetails.reason\n }\n });\n };\n\n // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.\n cancelPendingOpen(event) {\n this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(REASONS.triggerPress, event));\n }\n}\n\n/**\n * Creates the inert fallback store used by detached handle-backed triggers while no `Tooltip.Root`\n * is attached. It preserves a tooltip-specific trigger registry in context so detached triggers can\n * register before migrating to the live root store. `setOpen`/`cancelPendingOpen` are no-ops\n * (matching the inert reads/writes of `NullStore`), so a trigger can call them from hover/click\n * handlers while detached without any effect.\n */\nexport function createNullTooltipStore() {\n const triggerElements = new PopupTriggerMap();\n const store = new NullStore(Object.freeze(createInitialState(undefined, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);\n return Object.assign(store, {\n setOpen: NOOP,\n cancelPendingOpen: NOOP\n });\n}\nfunction createInitialState(initialState, triggerElements, floatingId, nested = false) {\n const state = {\n ...createInitialPopupStoreState(triggerElements, floatingId, nested),\n disabled: false,\n instantType: undefined,\n isInstantPhase: false,\n trackCursorAxis: 'none',\n disableHoverablePopup: false,\n openChangeReason: null,\n closeOnClick: true,\n closeDelay: 0,\n adaptiveOrigin: undefined,\n ...initialState\n };\n return state;\n}\nfunction createInitialContext(triggerElements) {\n return {\n popupRef: /*#__PURE__*/React.createRef(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined,\n triggerElements\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { TooltipRootContext } from \"./TooltipRootContext.mjs\";\nimport { useClientPoint, useDismiss } from \"../../floating-ui-react/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { PopupHandleAttachment, useImplicitActiveTrigger, usePopupRootStore, useOpenStateTransitions, usePopupInteractionProps } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { TooltipStore } from \"../store/TooltipStore.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n\n/**\n * Groups all parts of the tooltip.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const TooltipRoot = fastComponent(function TooltipRoot(props) {\n const {\n disabled = false,\n defaultOpen = false,\n open: openProp,\n disableHoverablePopup = false,\n trackCursorAxis = 'none',\n actionsRef,\n onOpenChange,\n onOpenChangeComplete,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n children\n } = props;\n const store = usePopupRootStore((floatingId, nested) => new TooltipStore({\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp\n }, floatingId, nested));\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const openState = store.useState('open');\n const open = !disabled && openState;\n const activeTriggerId = store.useState('activeTriggerId');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n store.useSyncedValues({\n trackCursorAxis,\n disableHoverablePopup,\n disabled\n });\n useImplicitActiveTrigger(store, {\n closeOnActiveTriggerUnmount: true\n });\n const {\n forceUnmount,\n transitionStatus\n } = useOpenStateTransitions(open, store);\n const isInstantPhase = store.useState('isInstantPhase');\n const instantType = store.useState('instantType');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n\n // Animations should be instant in two cases:\n // 1) Opening during the provider's instant phase (adjacent tooltip opens instantly)\n // 2) Closing because another tooltip opened (reason === 'none')\n // Otherwise, allow the animation to play. In particular, do not disable animations\n // during the 'ending' phase unless it's due to a sibling opening.\n const previousInstantTypeRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (openState && disabled) {\n store.setOpen(false, createChangeEventDetails(REASONS.disabled));\n }\n }, [openState, disabled, store]);\n useIsoLayoutEffect(() => {\n if (transitionStatus === 'ending' && lastOpenChangeReason === REASONS.none || transitionStatus !== 'ending' && isInstantPhase) {\n // Capture the current instant type so we can restore it later\n // and set to 'delay' to disable animations while moving from one trigger to another\n // within a delay group.\n if (instantType !== 'delay') {\n previousInstantTypeRef.current = instantType;\n }\n store.set('instantType', 'delay');\n } else if (previousInstantTypeRef.current !== null) {\n store.set('instantType', previousInstantTypeRef.current);\n previousInstantTypeRef.current = null;\n }\n }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);\n useIsoLayoutEffect(() => {\n if (open) {\n if (activeTriggerId == null) {\n store.set('payload', undefined);\n }\n }\n }, [store, activeTriggerId, open]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: () => store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction))\n }), [forceUnmount, store]);\n const shouldRenderInteractions = open || mounted || !disabled && trackCursorAxis !== 'none';\n return /*#__PURE__*/_jsxs(TooltipRootContext.Provider, {\n value: store,\n children: [handle && /*#__PURE__*/_jsx(PopupHandleAttachment, {\n handle: handle,\n store: store\n }), shouldRenderInteractions && /*#__PURE__*/_jsx(TooltipInteractions, {\n store: store,\n disabled: disabled,\n trackCursorAxis: trackCursorAxis\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipRoot.displayName = \"TooltipRoot\";\nfunction TooltipInteractions({\n store,\n disabled,\n trackCursorAxis\n}) {\n const floatingRootContext = store.useState('floatingRootContext');\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled,\n referencePress: () => store.select('closeOnClick')\n });\n const clientPoint = useClientPoint(floatingRootContext, {\n enabled: !disabled && trackCursorAxis !== 'none',\n axis: trackCursorAxis === 'none' ? undefined : trackCursorAxis\n });\n\n // Both hooks return `trigger: reference` (same object identity), so the active and\n // inactive trigger props can never differ. `useClientPoint` has no floating-side props.\n const triggerProps = React.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);\n usePopupInteractionProps(store, {\n activeTriggerProps: triggerProps,\n inactiveTriggerProps: triggerProps,\n popupProps: dismiss.floating ?? EMPTY_OBJECT\n });\n return null;\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Holds the provider's `delay` value. `closeDelay` is handled by the delay group.\n */\nexport const TooltipProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipProviderContext.displayName = \"TooltipProviderContext\";\nexport function useTooltipProviderContext() {\n return React.useContext(TooltipProviderContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { usePopupHandleStore, useTriggerDataForwarding } from \"../../utils/popups/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useTooltipProviderContext } from \"../provider/TooltipProviderContext.mjs\";\nimport { safePolygon, useDelayGroup, useFocus, useHoverReferenceInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { closest, contains, getTarget } from \"../../floating-ui-react/utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../../floating-ui-react/utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useHoverInteractionSharedState } from \"../../floating-ui-react/hooks/useHoverInteractionSharedState.mjs\";\nimport { getDelay } from \"../../floating-ui-react/hooks/useHoverShared.mjs\";\nimport * as TooltipTriggerDataAttributes from \"./TooltipTriggerDataAttributes.mjs\";\nimport { OPEN_DELAY } from \"../utils/constants.mjs\";\nconst TOOLTIP_TRIGGER_IDENTIFIER = 'data-base-ui-tooltip-trigger';\nfunction getTargetElement(event) {\n const target = getTarget(event);\n return isElement(target) ? target : null;\n}\n\n/**\n * An element to attach the tooltip to.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipTrigger = fastComponentRef(function TooltipTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n handle,\n payload,\n disabled: disabledProp,\n delay,\n closeOnClick = true,\n closeDelay,\n id: idProp,\n ...elementProps\n } = componentProps;\n const rootContext = useTooltipRootContext(true);\n const handleStore = usePopupHandleStore(handle);\n const store = handleStore ?? rootContext;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.' : _formatErrorMessage(82));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const floatingRootContext = store.useState('floatingRootContext');\n const triggerElementRef = React.useRef(null);\n const closeDelayWithDefault = closeDelay ?? 0;\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n closeOnClick,\n closeDelay: closeDelayWithDefault\n });\n const providerDelay = useTooltipProviderContext();\n const {\n activeIdRef,\n delayRef,\n isInstantPhase,\n hasProvider\n } = useDelayGroup(floatingRootContext, {\n open: isOpenedByThisTrigger\n });\n const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);\n store.useSyncedValue('isInstantPhase', isInstantPhase);\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp ?? rootDisabled;\n const disabledRef = useValueAsRef(disabled);\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const isNestedTriggerHoveredRef = React.useRef(false);\n const nestedTriggerOpenTimeout = useTimeout();\n // Local copy so it can be cleared on mouseLeave without resetting the hover hook's own pointerType.\n const pointerTypeRef = React.useRef(undefined);\n function getOpenDelay() {\n // Adjacent tooltips open instantly while the group is active.\n if (hasProvider && activeIdRef.current != null) {\n return 0;\n }\n return delay ?? providerDelay ?? OPEN_DELAY;\n }\n function isEnabledNestedTriggerTarget(target) {\n const triggerEl = triggerElementRef.current;\n if (!triggerEl || !target) {\n return false;\n }\n const nearestTrigger = closest(target, `[${TOOLTIP_TRIGGER_IDENTIFIER}]`);\n return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);\n }\n function detectNestedTriggerHover(target) {\n const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);\n isNestedTriggerHoveredRef.current = nestedTriggerHovered;\n if (nestedTriggerHovered) {\n hoverInteraction.openChangeTimeout.clear();\n hoverInteraction.restTimeout.clear();\n hoverInteraction.restTimeoutPending = false;\n nestedTriggerOpenTimeout.clear();\n }\n return nestedTriggerHovered;\n }\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: !disabled,\n mouseOnly: true,\n move: false,\n handleClose: !disableHoverablePopup && trackCursorAxis !== 'both' ? safePolygon() : null,\n restMs: getOpenDelay,\n delay() {\n if (closeDelay == null && hasProvider) {\n return {\n close: getDelay(delayRef.current, 'close')\n };\n }\n return {\n close: closeDelayWithDefault\n };\n },\n triggerElementRef,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending',\n shouldOpen() {\n return !isNestedTriggerHoveredRef.current;\n }\n });\n const focusProps = useFocus(floatingRootContext, {\n enabled: !disabled\n }).reference;\n const handleNestedTriggerHover = event => {\n const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;\n const target = getTargetElement(event);\n const nestedTriggerHovered = detectNestedTriggerHover(target);\n const triggerEl = triggerElementRef.current;\n const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);\n\n // Only close hover-opened parents. Focus/click-like opens remain owned by\n // their original interaction and should not be clobbered by nested hover.\n if (nestedTriggerHovered && store.select('open') && store.select('lastOpenChangeReason') === REASONS.triggerHover) {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n return;\n }\n if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select('open') && triggerEl &&\n // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.\n isMouseLikePointerType(pointerTypeRef.current)) {\n const open = () => {\n if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select('open')) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerEl));\n }\n };\n const openDelay = getOpenDelay();\n\n // With `move: false`, the hover hook only listens to mouseenter/mouseleave\n // on the parent trigger. Leaving a nested child for the parent area fires\n // no event the hook can react to, so reopen locally.\n if (openDelay === 0) {\n nestedTriggerOpenTimeout.clear();\n open();\n } else {\n nestedTriggerOpenTimeout.start(openDelay, open);\n }\n }\n };\n const rootTriggerProps = store.useState('appliedTriggerProps', isMountedByThisTrigger || trackCursorAxis !== 'none');\n const state = {\n open: isOpenedByThisTrigger\n };\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, registerTrigger, triggerElementRef],\n props: [hoverProps, focusProps, rootTriggerProps, {\n onMouseOver(event) {\n handleNestedTriggerHover(event.nativeEvent);\n },\n onFocus(event) {\n if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {\n event.preventBaseUIHandler();\n }\n },\n onMouseLeave() {\n isNestedTriggerHoveredRef.current = false;\n nestedTriggerOpenTimeout.clear();\n pointerTypeRef.current = undefined;\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n store.set('closeOnClick', closeOnClick);\n if (closeOnClick && !store.select('open')) {\n store.cancelPendingOpen(event.nativeEvent);\n }\n },\n onClick(event) {\n if (closeOnClick && !store.select('open')) {\n store.cancelPendingOpen(event.nativeEvent);\n }\n },\n id: thisTriggerId,\n [TooltipTriggerDataAttributes.triggerDisabled]: disabled ? '' : undefined,\n [TOOLTIP_TRIGGER_IDENTIFIER]: disabled ? undefined : ''\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipTrigger.displayName = \"TooltipTrigger\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPortalContext.displayName = \"TooltipPortalContext\";\nexport function useTooltipPortalContext() {\n const value = React.useContext(TooltipPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Portal> is missing.' : _formatErrorMessage(70));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useFloatingPortalNode } from \"../floating-ui-react/components/FloatingPortal.mjs\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * `FloatingPortal` includes tabbable logic handling for focus management.\n * For components that don't need tabbable logic, use `FloatingPortalLite`.\n * @internal\n */\nexport const FloatingPortalLite = /*#__PURE__*/React.forwardRef(function FloatingPortalLite(componentProps, forwardedRef) {\n const {\n children,\n container,\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n if (!portalSubtree && !portalNode) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode)]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortalLite.displayName = \"FloatingPortalLite\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { TooltipPortalContext } from \"./TooltipPortalContext.mjs\";\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipPortal = /*#__PURE__*/React.forwardRef(function TooltipPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useTooltipRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(TooltipPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPortal.displayName = \"TooltipPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPositionerContext.displayName = \"TooltipPositionerContext\";\nexport function useTooltipPositionerContext() {\n const context = React.useContext(TooltipPositionerContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.' : _formatErrorMessage(71));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloating as usePosition } from '@floating-ui/react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\n/**\n * Provides data to position a floating element and context to add interactions.\n * The caller supplies the root store, which owns the reference and floating elements.\n * @see https://floating-ui.com/docs/useFloating\n */\nexport function useBaseUIFloating(options) {\n const {\n nodeId,\n externalTree,\n rootContext: store\n } = options;\n const referenceElement = store.useState('referenceElement');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const open = store.useState('open');\n const floatingId = store.useState('floatingId');\n const [positionReference, setPositionReferenceRaw] = React.useState(null);\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree(externalTree);\n const storeElements = React.useMemo(() => ({\n reference: referenceElement,\n floating: floatingElement,\n domReference: domReferenceElement\n }), [referenceElement, floatingElement, domReferenceElement]);\n const position = usePosition({\n ...options,\n elements: {\n ...storeElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n getClientRects: () => node.getClientRects(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n setPositionReferenceRaw(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReferenceElement\n }), [position.elements, domReferenceElement]);\n const context = React.useMemo(() => ({\n ...position,\n dataRef: store.context.dataRef,\n open,\n onOpenChange: store.setOpen,\n events: store.context.events,\n floatingId,\n refs,\n elements,\n nodeId,\n rootStore: store\n }), [position, refs, elements, nodeId, store, open, floatingId]);\n useIsoLayoutEffect(() => {\n if (domReferenceElement) {\n domReferenceRef.current = domReferenceElement;\n }\n }, [domReferenceElement]);\n useIsoLayoutEffect(() => {\n store.context.dataRef.current.floatingContext = context;\n const node = tree?.nodesRef.current.find(n => n.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements,\n rootStore: store\n }), [position, refs, elements, context, store]);\n}","'use client';\n\nimport * as React from 'react';\nexport const DirectionContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DirectionContext.displayName = \"DirectionContext\";\nexport function useDirection() {\n const context = React.useContext(DirectionContext);\n return context?.direction ?? 'ltr';\n}","import { clamp, evaluate, getAlignment, getAlignmentAxis, getAxisLength, getPaddingObject } from '@floating-ui/utils';\n/**\n * Fork of the original `arrow` middleware from Floating UI that always uses the floating element\n * as the arrow's offset parent.\n */\nexport const baseArrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const clientSize = elements.floating[clientProp] || rects.floating[length];\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n // eslint-disable-next-line no-nested-ternary\n const alignmentOffset = shouldAddOffset ? center < min ? center - min : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nexport const arrow = (options, deps) => {\n const {\n name,\n fn\n } = baseArrow(options);\n return {\n name,\n fn,\n options: [options, deps]\n };\n};","export const hide = {\n name: 'hide',\n async fn(state) {\n const {\n width,\n height,\n x,\n y\n } = state.rects.reference;\n const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0;\n // Mirrors Floating UI's `hide()` referenceHidden strategy. Floating UI injects\n // `detectOverflow` into the middleware platform before invoking middleware.\n const overflow = await state.platform.detectOverflow(state, {\n elementContext: 'reference'\n });\n const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;\n return {\n data: {\n referenceHidden: referenceHidden || anchorHidden\n }\n };\n }\n};","export const DEFAULT_SIDES = {\n sideX: 'left',\n sideY: 'top'\n};\n\n// Self-contained stand-in for Floating UI's `Middleware` type. Referencing the real type in\n// store state makes `tsc` declaration emit reference `Platform`/`detectOverflow` from\n// `@floating-ui/core` internals, which fails as non-portable (TS2883) in consuming builds.","/**\n * The available width between the trigger and the edge of the viewport.\n * @type {number}\n */\nexport const availableWidth = '--available-width';\n/**\n * The available height between the trigger and the edge of the viewport.\n * @type {number}\n */\nexport const availableHeight = '--available-height';\n/**\n * The anchor's width.\n * @type {number}\n */\nexport const anchorWidth = '--anchor-width';\n/**\n * The anchor's height.\n * @type {number}\n */\nexport const anchorHeight = '--anchor-height';\n/**\n * The coordinates that this element is anchored to. Used for animations and transitions.\n * @type {string}\n */\nexport const transformOrigin = '--transform-origin';\n/**\n * The width of the popup's positioner.\n * It is important to set `width` to this value when using CSS to animate size changes.\n * @type {number}\n */\nexport const positionerWidth = '--positioner-width';\n/**\n * The height of the popup's positioner.\n * It is important to set `height` to this value when using CSS to animate size changes.\n * @type {number}\n */\nexport const positionerHeight = '--positioner-height';","'use client';\n\nimport * as React from 'react';\nimport { getSide, getAlignment, getSideAxis } from '@floating-ui/utils';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { autoUpdate, flip, limitShift, offset, shift as floatingShift, size } from \"../floating-ui-react/index.mjs\";\nimport { useBaseUIFloating } from \"../floating-ui-react/hooks/useFloating.mjs\";\nimport { useDirection } from \"./direction-context/DirectionContext.mjs\";\nimport { arrow } from \"../floating-ui-react/middleware/arrow.mjs\";\nimport { hide } from \"../utils/hideMiddleware.mjs\";\nimport { DEFAULT_SIDES } from \"../utils/adaptiveOriginConstants.mjs\";\nimport * as CommonPositionerCssVars from \"../utils/CommonPositionerCssVars.mjs\";\nconst AVAILABLE_WIDTH_VAR = CommonPositionerCssVars.availableWidth;\nconst AVAILABLE_HEIGHT_VAR = CommonPositionerCssVars.availableHeight;\nfunction getLogicalSide(sideParam, renderedSide, isRtl) {\n const isLogicalSideParam = sideParam === 'inline-start' || sideParam === 'inline-end';\n const logicalRight = isRtl ? 'inline-start' : 'inline-end';\n const logicalLeft = isRtl ? 'inline-end' : 'inline-start';\n return {\n top: 'top',\n right: isLogicalSideParam ? logicalRight : 'right',\n bottom: 'bottom',\n left: isLogicalSideParam ? logicalLeft : 'left'\n }[renderedSide];\n}\nfunction getOffsetData(state, sideParam, isRtl) {\n const {\n rects,\n placement\n } = state;\n const data = {\n side: getLogicalSide(sideParam, getSide(placement), isRtl),\n align: getAlignment(placement) || 'center',\n anchor: {\n width: rects.reference.width,\n height: rects.reference.height\n },\n positioner: {\n width: rects.floating.width,\n height: rects.floating.height\n }\n };\n return data;\n}\n/**\n * Provides standardized anchor positioning behavior for floating elements. Wraps Floating UI's\n * `useFloating` hook.\n */\nexport function useAnchorPositioning(params) {\n return useAnchorPositioningWithHook(params, useBaseUIFloating);\n}\nexport function useAnchorPositioningWithHook(params, useFloatingHook) {\n const {\n // Public parameters\n anchor,\n positionMethod = 'absolute',\n side: sideParam = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n collisionBoundary,\n collisionPadding: collisionPaddingParam = 5,\n sticky = false,\n arrowPadding = 5,\n disableAnchorTracking = false,\n inline: inlineMiddleware,\n // Private parameters\n keepMounted = false,\n floatingRootContext,\n mounted,\n collisionAvoidance,\n shift,\n nodeId,\n adaptiveOrigin,\n lazyFlip = false,\n externalTree\n } = params;\n const collisionAvoidanceSide = collisionAvoidance.side || 'flip';\n const collisionAvoidanceAlign = collisionAvoidance.align || 'flip';\n const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || 'end';\n const shiftCrossAxis = shift?.crossAxis ?? false;\n const shiftRootBoundary = shift?.rootBoundary;\n const anchorFn = typeof anchor === 'function' ? anchor : undefined;\n const anchorFnCallback = useStableCallback(anchorFn);\n const anchorDep = anchorFn ? anchorFnCallback : anchor;\n const anchorValueRef = useValueAsRef(anchor);\n const mountedRef = useValueAsRef(mounted);\n const direction = useDirection();\n const isRtl = direction === 'rtl';\n const [mountPlacement, setMountPlacement] = React.useState(null);\n if (!mounted && mountPlacement !== null) {\n setMountPlacement(null);\n }\n const lockAlign = lazyFlip === 'placement';\n const mountSide = mountPlacement ? getSide(mountPlacement) : null;\n const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || 'center' : null;\n const side = mountSide || {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n 'inline-end': isRtl ? 'left' : 'right',\n 'inline-start': isRtl ? 'right' : 'left'\n }[sideParam];\n const placementAlign = mountAlign || align;\n const placement = placementAlign === 'center' ? side : `${side}-${placementAlign}`;\n let collisionPadding = collisionPaddingParam;\n if (typeof collisionPadding === 'number') {\n collisionPadding = {\n top: collisionPadding,\n right: collisionPadding,\n bottom: collisionPadding,\n left: collisionPadding\n };\n } else if (collisionPadding) {\n collisionPadding = {\n top: collisionPadding.top || 0,\n right: collisionPadding.right || 0,\n bottom: collisionPadding.bottom || 0,\n left: collisionPadding.left || 0\n };\n }\n\n // Create a bias to the preferred side.\n // On iOS, when the mobile software keyboard opens, the input is exactly centered\n // in the viewport, but this can cause it to flip to the top undesirably.\n // The bias is only applied to `flip()` so it doesn't shift the resting position\n // computed by `shift()` and `size()` away from the requested `collisionPadding`.\n const bias = 1;\n const biasTop = sideParam === 'bottom' ? bias : 0;\n const biasBottom = sideParam === 'top' ? bias : 0;\n const biasLeft = sideParam === 'right' ? bias : 0;\n const biasRight = sideParam === 'left' ? bias : 0;\n const commonCollisionProps = {\n boundary: collisionBoundary === 'clipping-ancestors' ? 'clippingAncestors' : collisionBoundary,\n padding: collisionPadding\n };\n\n // Using a ref assumes that the arrow element is always present in the DOM for the lifetime of the\n // popup. If this assumption ends up being false, we can switch to state to manage the arrow's\n // presence.\n const arrowRef = React.useRef(null);\n\n // Keep these reactive if they're not functions\n const sideOffsetRef = useValueAsRef(sideOffset);\n const alignOffsetRef = useValueAsRef(alignOffset);\n const sideOffsetDep = typeof sideOffset !== 'function' ? sideOffset : 0;\n const alignOffsetDep = typeof alignOffset !== 'function' ? alignOffset : 0;\n const middleware = [];\n if (inlineMiddleware) {\n middleware.push(inlineMiddleware);\n }\n middleware.push(offset(state => {\n const data = getOffsetData(state, sideParam, isRtl);\n const sideAxis = typeof sideOffsetRef.current === 'function' ? sideOffsetRef.current(data) : sideOffsetRef.current;\n const alignAxis = typeof alignOffsetRef.current === 'function' ? alignOffsetRef.current(data) : alignOffsetRef.current;\n return {\n mainAxis: sideAxis,\n crossAxis: alignAxis,\n alignmentAxis: alignAxis\n };\n }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));\n const shiftDisabled = collisionAvoidanceAlign === 'none' && collisionAvoidanceSide !== 'shift';\n const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === 'shift');\n const flipMiddleware = collisionAvoidanceSide === 'none' ? null : flip({\n ...commonCollisionProps,\n // Ensure the popup flips if it's been limited by its --available-height and it resizes.\n // Since the size() padding is smaller than the flip() padding, flip() will take precedence.\n padding: {\n top: collisionPadding.top + bias + biasTop,\n right: collisionPadding.right + bias + biasRight,\n bottom: collisionPadding.bottom + bias + biasBottom,\n left: collisionPadding.left + bias + biasLeft\n },\n mainAxis: !shiftCrossAxis && collisionAvoidanceSide === 'flip',\n crossAxis: collisionAvoidanceAlign === 'flip' ? 'alignment' : false,\n fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide\n });\n const shiftMiddleware = shiftDisabled ? null : floatingShift({\n ...commonCollisionProps,\n // Use the Layout Viewport to avoid shifting around when pinch-zooming.\n rootBoundary: shiftRootBoundary,\n mainAxis: collisionAvoidanceAlign !== 'none',\n crossAxis: crossAxisShiftEnabled,\n limiter: sticky || shiftCrossAxis ? undefined : limitShift(limitData => {\n if (!arrowRef.current) {\n return {};\n }\n const {\n width,\n height\n } = arrowRef.current.getBoundingClientRect();\n const sideAxis = getSideAxis(getSide(limitData.placement));\n const arrowSize = sideAxis === 'y' ? width : height;\n const offsetAmount = sideAxis === 'y' ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;\n return {\n offset: arrowSize / 2 + offsetAmount / 2\n };\n })\n }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);\n\n // https://floating-ui.com/docs/flip#combining-with-shift\n // Keyed on the alignment actually being requested, not the raw prop: a locked alignment can\n // differ from `align`, and the ordering has to match the placement that is asked for.\n if (collisionAvoidanceSide === 'shift' || collisionAvoidanceAlign === 'shift' || placementAlign === 'center') {\n middleware.push(shiftMiddleware, flipMiddleware);\n } else {\n middleware.push(flipMiddleware, shiftMiddleware);\n }\n middleware.push(size({\n ...commonCollisionProps,\n apply({\n elements: {\n floating\n },\n availableWidth,\n availableHeight,\n rects\n }) {\n if (!mountedRef.current) {\n return;\n }\n const floatingStyle = floating.style;\n floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth}px`);\n floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight}px`);\n\n // Snap anchor dimensions to device pixels to ensure the popup's visual width matches the anchor's one.\n const dpr = ownerWindow(floating).devicePixelRatio || 1;\n const {\n x,\n y,\n width,\n height\n } = rects.reference;\n const anchorWidth = (Math.round((x + width) * dpr) - Math.round(x * dpr)) / dpr;\n const anchorHeight = (Math.round((y + height) * dpr) - Math.round(y * dpr)) / dpr;\n floatingStyle.setProperty(CommonPositionerCssVars.anchorWidth, `${anchorWidth}px`);\n floatingStyle.setProperty(CommonPositionerCssVars.anchorHeight, `${anchorHeight}px`);\n }\n }), arrow(state => ({\n // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,\n // we'll create a fake element.\n element: arrowRef.current || ownerDocument(state.elements.floating).createElement('div'),\n // No padding for the fake arrow: it would displace aligned popups on narrow anchors.\n padding: arrowRef.current ? arrowPadding : 0\n }), [arrowPadding]), {\n name: 'transformOrigin',\n fn(state) {\n const {\n elements: {\n floating\n },\n middlewareData,\n placement: renderedPlacement,\n platform,\n rects,\n y\n } = state;\n const renderedSide = getSide(renderedPlacement);\n const renderedAlign = getAlignment(renderedPlacement);\n const isVertical = getSideAxis(renderedSide) === 'y';\n const arrowEl = arrowRef.current;\n const sideOffsetValue = typeof sideOffset === 'function' ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;\n\n // An aligned arrowless popup grows from its aligned edge, until a shift (beyond subpixel)\n // breaks its alignment with the anchor. Everything else grows from the arrow, real or fake.\n let crossOrigin;\n if (!arrowEl && renderedAlign && Math.abs(isVertical ? middlewareData.shift?.x || 0 : middlewareData.shift?.y || 0) <= 1) {\n // The platform direction, not `isRtl`: it must match what Floating UI placed with.\n crossOrigin = renderedAlign === 'start' === (isVertical && platform.isRTL?.(floating) === true) ? '100%' : '0%';\n } else {\n const arrowOffset = isVertical ? middlewareData.arrow?.x || 0 : middlewareData.arrow?.y || 0;\n const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0;\n crossOrigin = `${arrowOffset + arrowSize / 2}px`;\n }\n\n // Side axis: the anchor-facing edge, or the anchor's center when the popup overlaps it.\n let sideOrigin = renderedSide === 'top' || renderedSide === 'left' ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`;\n if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData.shift?.y || 0) > sideOffsetValue) {\n sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y}px`;\n }\n floating.style.setProperty(CommonPositionerCssVars.transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`);\n return {};\n }\n }, hide, adaptiveOrigin);\n useIsoLayoutEffect(() => {\n // Ensure positioning doesn't run initially for `keepMounted` elements that\n // aren't initially open.\n if (!mounted && floatingRootContext) {\n floatingRootContext.update({\n referenceElement: null,\n floatingElement: null,\n domReferenceElement: null,\n positionReference: null\n });\n }\n }, [mounted, floatingRootContext]);\n const autoUpdateOptions = React.useMemo(() => ({\n ancestorScroll: !disableAnchorTracking,\n elementResize: !disableAnchorTracking && typeof ResizeObserver !== 'undefined',\n layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== 'undefined'\n }), [disableAnchorTracking]);\n const {\n refs,\n elements,\n x,\n y,\n middlewareData,\n update,\n placement: renderedPlacement,\n context,\n isPositioned,\n floatingStyles: originalFloatingStyles\n } = useFloatingHook({\n rootContext: floatingRootContext,\n open: keepMounted ? mounted : undefined,\n placement,\n middleware,\n strategy: positionMethod,\n whileElementsMounted: keepMounted ? undefined : (...args) => autoUpdate(...args, autoUpdateOptions),\n nodeId,\n externalTree\n });\n const {\n sideX,\n sideY\n } = middlewareData.adaptiveOrigin || DEFAULT_SIDES;\n\n // Default to `fixed` when not positioned to prevent `autoFocus` scroll jumps.\n // This ensures the popup is inside the viewport initially before it gets positioned.\n const resolvedPosition = isPositioned ? positionMethod : 'fixed';\n const floatingStyles = React.useMemo(() => {\n let base;\n if (!isPositioned) {\n // Until a position for the current open is computed, ignore any coordinates retained from a\n // previous open (or from a pass that measured the hidden popup as 0x0). Rendering the\n // full-size popup at such stale coordinates can overflow the layout viewport, which makes\n // mobile Chrome zoom the page out and reflow everything the popup is anchored to.\n base = {\n position: resolvedPosition,\n top: 0,\n left: 0\n };\n } else if (adaptiveOrigin) {\n base = {\n position: resolvedPosition,\n [sideX]: x,\n [sideY]: y\n };\n } else {\n base = {\n ...originalFloatingStyles,\n position: resolvedPosition\n };\n }\n\n // Seed the available size vars so consumer `max-height: min(x, var(--available-height))` rules\n // resolve to a valid length on the first positioning pass, before `size()` writes the real\n // values. Without a fallback the unresolved `var()` invalidates the whole declaration, so the\n // popup is measured unconstrained while `flip()` picks its side, against the full content\n // height rather than the capped one. Seeded unconditionally (not only while `!isPositioned`):\n // the keys must stay present with a constant value so React's per-property style diff never\n // rewrites them after mount, preserving the px values `size()` sets imperatively. Moving them\n // into the `!isPositioned` branch makes React remove them once positioned, wiping `size()`'s\n // values and leaving the popup unconstrained.\n base[AVAILABLE_WIDTH_VAR] = '100vw';\n base[AVAILABLE_HEIGHT_VAR] = '100vh';\n if (!isPositioned) {\n base.opacity = 0;\n }\n return base;\n }, [adaptiveOrigin, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);\n const registeredPositionReferenceRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n const resolvedAnchor = typeof anchorValue === 'function' ? anchorValue() : anchorValue;\n const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;\n const finalAnchor = unwrappedElement || null;\n if (finalAnchor !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(finalAnchor);\n registeredPositionReferenceRef.current = finalAnchor;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n\n // Refs from parent components are set after useLayoutEffect runs and are available in useEffect.\n // Therefore, if the anchor is a ref, we need to update the position reference in useEffect.\n if (typeof anchorValue === 'function') {\n return;\n }\n if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(anchorValue.current);\n registeredPositionReferenceRef.current = anchorValue.current;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (keepMounted && mounted && elements.reference && elements.floating) {\n return autoUpdate(elements.reference, elements.floating, update, autoUpdateOptions);\n }\n return undefined;\n }, [keepMounted, mounted, elements, update, autoUpdateOptions]);\n const renderedSide = getSide(renderedPlacement);\n const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);\n const renderedAlign = getAlignment(renderedPlacement) || 'center';\n const anchorHidden = Boolean(middlewareData.hide?.referenceHidden);\n\n // Locks the flipped side, and the alignment too when the consumer opts in, while filtering\n // resizes the popup.\n useIsoLayoutEffect(() => {\n if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) {\n setMountPlacement(renderedPlacement);\n }\n }, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]);\n const arrowStyles = React.useMemo(() => ({\n position: 'absolute',\n top: middlewareData.arrow?.y,\n left: middlewareData.arrow?.x\n }), [middlewareData.arrow]);\n const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;\n return React.useMemo(() => ({\n positionerStyles: floatingStyles,\n arrowStyles,\n arrowRef,\n arrowUncentered,\n side: logicalRenderedSide,\n align: renderedAlign,\n physicalSide: renderedSide,\n anchorHidden,\n refs,\n context,\n isPositioned,\n update\n }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update]);\n}\nfunction isRef(param) {\n return param != null && 'current' in param;\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { DISABLED_TRANSITIONS_STYLE } from \"./constants.mjs\";\nexport function getDisabledMountTransitionStyles(transitionStatus) {\n return transitionStatus === 'starting' ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;\n}","'use client';\n\nimport { popupStateMapping } from \"./popupStateMapping.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../internals/getDisabledMountTransitionStyles.mjs\";\n/**\n * Renders the shared outer Positioner element used by popup components.\n * Applies the common role, hidden state, transition styles, state attributes, and optional inert styling.\n */\nexport function usePositioner(componentProps, state, {\n styles,\n transitionStatus,\n props,\n refs,\n hidden,\n inert = false\n}) {\n const style = {\n ...styles\n };\n if (inert) {\n style.pointerEvents = 'none';\n }\n return useRenderElement('div', componentProps, {\n state,\n ref: refs,\n props: [{\n role: 'presentation',\n hidden,\n style\n }, getDisabledMountTransitionStyles(transitionStatus), props],\n stateAttributesMapping: popupStateMapping\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { TooltipPositionerContext } from \"./TooltipPositionerContext.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { useTooltipPortalContext } from \"../portal/TooltipPortalContext.mjs\";\nimport { POPUP_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\n\n/**\n * Positions the tooltip against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipPositioner = /*#__PURE__*/React.forwardRef(function TooltipPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n positionMethod = 'absolute',\n side = 'top',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = POPUP_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const keepMounted = useTooltipPortalContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const floatingRootContext = store.useState('floatingRootContext');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const adaptiveOrigin = store.useState('adaptiveOrigin');\n const positioning = useAnchorPositioning({\n anchor,\n positionMethod,\n floatingRootContext,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n collisionBoundary,\n collisionPadding,\n sticky,\n arrowPadding,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n adaptiveOrigin\n });\n const state = React.useMemo(() => ({\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n instant: trackCursorAxis !== 'none' ? 'tracking-cursor' : instantType\n }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, store.useStateSetter('positionerElement')],\n hidden: !mounted,\n inert: !open || trackCursorAxis === 'both' || disableHoverablePopup\n });\n return /*#__PURE__*/_jsx(TooltipPositionerContext.Provider, {\n value: positioning,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPositioner.displayName = \"TooltipPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.mjs\";\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { useHoverFloatingInteraction } from \"../../floating-ui-react/index.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\n\n/**\n * A container for the tooltip contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipPopup = /*#__PURE__*/React.forwardRef(function TooltipPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const {\n side,\n align\n } = useTooltipPositionerContext();\n const open = store.useState('open');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const floatingContext = store.useState('floatingRootContext');\n const disabled = store.useState('disabled');\n const closeDelay = store.useState('closeDelay');\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n useHoverFloatingInteraction(floatingContext, {\n enabled: !disabled,\n closeDelay\n });\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n side,\n align,\n instant: instantType,\n transitionStatus\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping: popupTransitionStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPopup.displayName = \"TooltipPopup\";","import { isReactVersionAtLeast } from \"./reactVersion.mjs\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (!Object.is(value, state.current)) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}","/** Renders a hint above an element while it is hovered or focused, on Base UI's tooltip. @module */\nimport { Tooltip as Base } from '@base-ui/react/tooltip'\nimport type { ReactElement, ReactNode } from 'react'\nimport { style } from '../zyzz.config.js'\n\n/**\n * Shows `label` above `children` while it is hovered or focused. `children` is the trigger element,\n * which receives the tooltip's props and ref, so it renders a DOM element.\n */\nexport function Tooltip(props: Tooltip.Props): ReactNode {\n return (\n <Base.Root>\n <Base.Trigger delay={150} render={props.children} />\n <Base.Portal>\n <Base.Positioner sideOffset={8}>\n <Base.Popup {...styles.popup()}>{props.label}</Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n </Base.Root>\n )\n}\n\nexport declare namespace Tooltip {\n type Props = {\n /** The element the tooltip attaches to. */\n children: ReactElement\n /** The hint. */\n label: ReactNode\n }\n}\n\nnamespace styles {\n export const popup = style({\n backgroundColor: 'foreground',\n borderRadius: 'lg',\n color: 'background.primary',\n paddingBlock: 1,\n paddingInline: 2,\n transitionDuration: '150ms',\n transitionProperty: 'opacity',\n transitionTimingFunction: 'in-out',\n typography: 'label.12',\n '&[data-starting-style], &[data-ending-style]': { opacity: 0 },\n })\n}\n","/**\n * The account screen: the signed-in user, their Tempo Accounts with each balance and a deposit link,\n * and sign-out.\n * @module\n */\nimport { Link } from '@tanstack/react-router'\nimport type { ReactNode } from 'react'\nimport ArrowDownToLine from '~icons/lucide/arrow-down-to-line'\nimport Cloud from '~icons/lucide/cloud'\nimport Fingerprint from '~icons/lucide/fingerprint'\nimport LogOut from '~icons/lucide/log-out'\nimport { Button } from '../components/Button.js'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport { Tooltip } from '../components/Tooltip.js'\nimport { style, variants } from '../zyzz.config.js'\n\n/**\n * The account screen. It names the user, lists their Tempo Accounts with each balance, oldest\n * first, and offers sign-out. A lone account shows its balance large, without a list.\n */\nexport function Account(props: Account.Props): ReactNode {\n const { accounts } = props\n const Title = props.heading ?? 'h1'\n const Subtitle = props.heading === 'h4' ? 'h5' : 'h2'\n\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n <span {...styles.avatar()} aria-hidden>\n {(props.name || props.email).charAt(0).toUpperCase()}\n </span>\n <div {...styles.identity()}>\n {/* The email heads the screen when the user has no name. */}\n <Title {...styles.name()}>{props.name || props.email}</Title>\n {props.name ? <p {...styles.email()}>{props.email}</p> : null}\n </div>\n </header>\n\n {(() => {\n if (!accounts)\n return (\n <ErrorMessage align=\"center\">{props.accountError}</ErrorMessage>\n )\n if (!accounts.length)\n return (\n <p {...styles.hint()}>\n You have no wallets yet. Sign in to an app to create one.\n </p>\n )\n const only = accounts.length === 1 ? accounts[0] : undefined\n // One wallet needs no list, so its balance leads the screen.\n if (only)\n return (\n <section {...styles.single()} aria-label=\"Wallet\">\n <span {...styles.balance()} data-testid=\"balance\">\n {format(only.balance)}\n </span>\n <DepositLink entry={only} large />\n </section>\n )\n return (\n <section {...styles.accounts()}>\n <Subtitle {...styles.label()}>Wallets</Subtitle>\n <ul {...styles.list()} aria-label=\"Wallets\">\n {accounts.map((entry) => (\n <li {...styles.row()} key={entry.address}>\n {entry.owner === 'webAuthn' ? (\n <Fingerprint {...styles.owner()} aria-hidden />\n ) : (\n <Cloud {...styles.owner()} aria-hidden />\n )}\n <span {...styles.kind()}>{kind(entry)}</span>\n <span {...styles.amount()} data-testid=\"balance\">\n {format(entry.balance)}\n </span>\n <DepositLink entry={entry} />\n </li>\n ))}\n </ul>\n </section>\n )\n })()}\n\n <Button\n loading={props.signingOut}\n onClick={props.onSignOut}\n prefix={<LogOut {...styles.icon()} aria-hidden />}\n variant=\"secondary\"\n >\n Sign out\n </Button>\n <ErrorMessage align=\"center\">{props.error}</ErrorMessage>\n <p {...styles.status()} aria-live=\"polite\" role=\"status\">\n {props.signingOut ? 'Signing out.' : undefined}\n </p>\n </div>\n )\n}\n\nexport declare namespace Account {\n type Props = {\n /** Why the accounts failed to load. It shows when `accounts` is `null`. */\n accountError?: string | undefined\n /** The user's Tempo Accounts in the `default` realm, oldest first, or `null` when they failed to load. */\n accounts: readonly Entry[] | null\n /** The signed-in user's email address. */\n email: string\n /** Why the sign-out failed. */\n error?: string | undefined\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** The user's name, which heads the screen when the user has one. */\n name?: string | undefined\n /** Signs the user out. */\n onSignOut: () => void\n /** Whether the sign-out is in progress, which holds the button. */\n signingOut: boolean\n }\n\n /** One account, with its balance. */\n type Entry = {\n /** The account's address. */\n address: `0x${string}`\n /** The account's balance, or `null` when it failed to load. */\n balance: Balance | null\n /**\n * Who holds the owner key: a Privy wallet (`privy`), a key that Tempo ID holds in development\n * (`secp256k1`), or a passkey (`webAuthn`).\n */\n owner: 'privy' | 'secp256k1' | 'webAuthn'\n }\n\n /** A balance in one currency. */\n type Balance = {\n /** The amount, as a decimal string, such as `12.5`. */\n amount: string\n /** The ISO 4217 currency code, such as `USD`. */\n currency: string\n }\n}\n\n/** Links to the deposit page for one wallet, as an icon with a tooltip. */\nfunction DepositLink(props: DepositLink.Props): ReactNode {\n const { address } = props.entry\n return (\n <Tooltip label=\"Deposit\">\n <Link\n {...styles.deposit({ size: props.large ? 'large' : 'small' })}\n // The short address tells apart wallets of the same kind, which the row shows only by name.\n aria-label={`Deposit to ${kind(props.entry)} wallet ${address.slice(0, 6)}…${address.slice(-4)}`}\n search={{ address }}\n to=\"/deposit\"\n >\n <ArrowDownToLine\n {...(props.large ? styles.depositIcon() : styles.icon())}\n aria-hidden\n />\n </Link>\n </Tooltip>\n )\n}\n\ndeclare namespace DepositLink {\n type Props = {\n /** The wallet the deposit goes to. */\n entry: Account.Entry\n /** Whether the icon matches the size of a lone wallet's balance. */\n large?: boolean | undefined\n }\n}\n\n/**\n * Formats a balance in its currency, or names its failed state. The locale is fixed, so the server\n * and the browser render the same text.\n */\nfunction format(balance: Account.Entry['balance']) {\n if (!balance) return 'Unavailable'\n return new Intl.NumberFormat('en-US', {\n currency: balance.currency,\n style: 'currency',\n // A decimal string keeps every digit, which a `Number` would round.\n }).format(balance.amount as Intl.StringNumericLiteral)\n}\n\n/** Names an account by its owner. A Privy wallet is `Cloud`, since it is held for the user rather than on a device. */\nfunction kind(entry: Account.Entry) {\n return entry.owner === 'webAuthn' ? 'Passkey' : 'Cloud'\n}\n\nnamespace styles {\n export const accounts = style({ display: 'grid', gap: 2 })\n\n export const amount = style({\n fontVariantNumeric: 'tabular-nums',\n marginLeft: 'auto',\n typography: 'label.14',\n })\n\n export const avatar = style({\n alignItems: 'center',\n backgroundColor: 'foreground',\n backgroundImage: 'sheen',\n borderRadius: 'full',\n color: 'background.surface',\n display: 'flex',\n flexShrink: 0,\n height: 16,\n justifyContent: 'center',\n typography: 'heading.24',\n width: 16,\n })\n\n export const balance = style({\n fontVariantNumeric: 'tabular-nums',\n letterSpacing: 'balance',\n typography: 'heading.32',\n })\n\n export const column = style({\n display: 'grid',\n gap: 8,\n maxWidth: 'sm',\n width: 'full',\n })\n\n // Pseudo-elements make the touch target and the hover fill larger than the icon. The icon sits\n // above the fill. In a row the fill stays smaller than the hit area, so a gap stays before the\n // balance.\n export const deposit = variants({\n base: {\n borderRadius: 'full',\n color: 'gray.900',\n display: 'flex',\n flexShrink: 0,\n outline: 'none',\n position: 'relative',\n '& > svg': { position: 'relative', zIndex: 1 },\n '&::before': {\n content: '\"\"',\n inset: 'bleed',\n position: 'absolute',\n },\n '&::after': {\n borderRadius: 'full',\n content: '\"\"',\n position: 'absolute',\n },\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n ':hover': { color: 'foreground' },\n ':hover::after': { backgroundColor: 'grayAlpha.200' },\n },\n variants: {\n size: {\n large: { '&::after': { inset: 'bleed' } },\n small: { '&::after': { inset: 'bleedSmall' } },\n },\n },\n })\n\n export const depositIcon = style({ height: 6, width: 6 })\n\n export const email = style({ color: 'gray.900', typography: 'copy.16' })\n\n export const header = style({\n display: 'grid',\n gap: 3,\n justifyItems: 'center',\n textAlign: 'center',\n })\n\n export const hint = style({\n color: 'gray.900',\n textAlign: 'center',\n textWrap: 'balance',\n typography: 'copy.14',\n })\n\n export const icon = style({ height: 4, width: 4 })\n\n export const identity = style({ display: 'grid', gap: 1, minWidth: 0 })\n\n export const kind = style({\n fontWeight: 'medium',\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n typography: 'label.14',\n whiteSpace: 'nowrap',\n })\n\n export const label = style({\n color: 'gray.900',\n paddingInline: 4,\n typography: 'label.14',\n })\n\n // A gray group, as in Link's settings, whose rows need no dividers.\n export const list = style({\n backgroundColor: 'gray.100',\n borderRadius: '2xl',\n display: 'grid',\n listStyle: 'none',\n margin: 0,\n overflow: 'hidden',\n padding: 0,\n })\n\n export const name = style({\n overflowWrap: 'anywhere',\n typography: 'heading.24',\n })\n\n export const owner = style({\n color: 'gray.900',\n flexShrink: 0,\n height: 4,\n width: 4,\n })\n\n export const row = style({\n alignItems: 'center',\n display: 'flex',\n gap: 3,\n justifyContent: 'space-between',\n paddingBlock: 3,\n paddingInline: 4,\n })\n\n // The balance on the left and its deposit link on the right, inset like the list's rows.\n export const single = style({\n alignItems: 'center',\n display: 'flex',\n gap: 3,\n justifyContent: 'space-between',\n paddingInline: 4,\n })\n\n export const status = style({\n color: 'gray.900',\n textAlign: 'center',\n typography: 'copy.14',\n })\n}\n","/** The signed-in user's account: their Tempo Accounts with each balance, and sign-out. @module */\nimport { useMutation } from '@tanstack/react-query'\nimport { createFileRoute, useRouter } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport * as Chain from '../../internal/Chain.js'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { Account } from '../screens/Account.js'\nimport { style } from '../zyzz.config.js'\n\nexport const Route = createFileRoute('/')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Redirects a visitor without a session to sign-in. Otherwise returns the user's name and email,\n * and their accounts in the `default` realm, oldest first, each with its balance on the chain that\n * the `chain` search parameter names, or on Tempo mainnet, the chain that a key acts on by\n * default. The page creates no account. A spent account limit or a failed read, such as during a\n * Privy outage, returns `accounts: null` with the reason.\n */\n loader: async (match): Promise<Page.Props> => {\n const client = Client.create()\n const session = await parseResponse(client.v1.auth.session.$get())\n if (!session.user) Loader.redirect({ href: '/login' })\n const user = { email: session.user.email, name: session.user.name }\n\n const account = await parseResponse(\n client.v1.account.$get({\n query: { chain: match.deps.chain ?? 'mainnet' },\n }),\n ).catch((error: unknown) => ({ error }))\n if ('error' in account)\n return {\n ...user,\n accountError:\n Client.reason(account.error) === 'rate_limited'\n ? Client.message(account.error)\n : 'Your wallets failed to load. Reload the page to try again.',\n accounts: null,\n }\n\n // Each Tempo Account has one owner, so the guard only narrows the read.\n return {\n ...user,\n accountError: null,\n accounts: account.tempo.flatMap((entry) => {\n const owner = entry.config.owners[0]\n return owner\n ? [\n {\n address: entry.address,\n balance: 'balance' in entry ? (entry.balance ?? null) : null,\n owner: owner.type,\n },\n ]\n : []\n }),\n }\n },\n // A change of chain loads the balances again.\n loaderDeps: (match: { search: { chain?: Chain.Chain | undefined } }) => ({\n chain: match.search.chain,\n }),\n})\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const router = useRouter()\n const signOut = useMutation({\n mutationFn: () => parseResponse(client.v1.auth.logout.$post()),\n // The mutation stays pending until the sign-in page renders, so the button holds until then.\n onSuccess: () => router.navigate({ to: '/login' }),\n })\n\n return (\n <main {...styles.page()} aria-label=\"Your account\">\n <Account\n accountError={props.accountError ?? undefined}\n accounts={props.accounts}\n email={props.email}\n error={signOut.error ? Client.message(signOut.error) : undefined}\n name={props.name ?? undefined}\n onSignOut={() => signOut.mutate()}\n signingOut={signOut.isPending}\n />\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** Why the accounts failed to load, or `null` when they loaded. */\n accountError: string | null\n /** The user's Tempo Accounts in the `default` realm, oldest first, or `null` when they failed to load. */\n accounts: Account.Props['accounts']\n /** The signed-in user's email address. */\n email: string\n /** The user's name, or `null` when the user has none. */\n name: string | null\n }\n}\n\nnamespace styles {\n // Content starts at the same height as on `/deposit`, so moving between them keeps the title in place.\n export const page = style({\n alignItems: 'flex-start',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","import { Authentication } from 'ox/webauthn';\n/**\n * Signs a challenge via `navigator.credentials.get`.\n *\n * Accepts either serialized options (from the server) or pre-formed\n * options. Returns a serialized response ready to send back to the server.\n *\n * @example\n * ```ts\n * import { Authentication } from 'webauthx/client'\n *\n * // 1. Fetch serialized options from the server.\n * const options = await fetch('/auth/challenge').then((r) => r.json())\n *\n * // 2. Prompt the user to sign the challenge.\n * const response = await Authentication.sign({ options })\n *\n * // 3. Send the response back to the server for verification.\n * await fetch('/auth/verify', {\n * method: 'POST',\n * body: JSON.stringify(response),\n * })\n * ```\n */\nexport async function sign(options) {\n const response = await (() => {\n if ('options' in options) {\n const deserialized = Authentication.deserializeOptions(options.options);\n return Authentication.sign({\n ...deserialized,\n getFn: options.getFn,\n });\n }\n return Authentication.sign(options);\n })();\n return Authentication.serializeResponse(response);\n}\n//# sourceMappingURL=Authentication.js.map","export default import.meta.ROLLDOWN_FILE_URL_DUq8YoikZLXEejpNZ1KQvg","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='80'%20height='80'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='sub_brz-Brand%20assets'%3e%3cg%20id='sub_brz-Frame%2011'%3e%3cg%20id='sub_brz-Frame%2055'%3e%3cg%20id='sub_brz-Frame%2053'%3e%3cg%20id='sub_brz-Currencies'%20clip-path='url(%23sub_brz-clip0_1741_2949)'%3e%3cg%20id='sub_brz-BRZ'%3e%3cpath%20id='sub_brz-Background'%20d='M40%2080C62.0914%2080%2080%2062.0914%2080%2040C80%2017.9086%2062.0914%200%2040%200C17.9086%200%200%2017.9086%200%2040C0%2062.0914%2017.9086%2080%2040%2080Z'%20fill='url(%23sub_brz-paint0_linear_1741_2949)'/%3e%3cpath%20id='sub_brz-Inner%20Circle'%20d='M39.9998%2076.144C59.9616%2076.144%2076.1438%2059.9617%2076.1438%2040C76.1438%2020.0382%2059.9616%203.85596%2039.9998%203.85596C20.0381%203.85596%203.85583%2020.0382%203.85583%2040C3.85583%2059.9617%2020.0381%2076.144%2039.9998%2076.144Z'%20fill='%23160F29'/%3e%3cg%20id='sub_brz-Icon'%3e%3cpath%20id='sub_brz-Path%201'%20d='M40.0025%2043.5679L32.609%2050.9614L40.0025%2058.3549L47.396%2050.9614L40.0025%2043.5679Z'%20fill='white'/%3e%3cpath%20id='sub_brz-Path%202'%20d='M62.1799%2036.1719L54.7879%2028.7759L47.392%2036.1719L39.9999%2028.7759H25.2119L17.8199%2036.1719L25.2119%2043.5639L32.6079%2036.1719L39.9999%2043.5639H54.7879L62.1799%2036.1719Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='sub_brz-paint0_linear_1741_2949'%20x1='11.196'%20y1='68.804'%20x2='67.692'%20y2='12.308'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.04'%20stop-color='%23FFC100'/%3e%3cstop%20offset='1'%20stop-color='%2300C800'/%3e%3c/linearGradient%3e%3cclipPath%20id='sub_brz-clip0_1741_2949'%3e%3crect%20width='80'%20height='80'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_$oUiuAXR7gZMKRQU56HW2w","export default import.meta.ROLLDOWN_FILE_URL_6kssa3xCT2YlMpIbbRNP$Q","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='720'%20height='714'%20fill='none'%20viewBox='0%200%20720%20714'%3e%3ccircle%20cx='357'%20cy='357'%20r='357'%20fill='%23000'/%3e%3cpath%20fill='%23fff'%20d='M405.18%20357.091H457C452.59%20408.451%20417.308%20440%20363.65%20440c-55.863%200-90.778-33.751-99.598-95.015H242l4.778-25.68h14.701V304.63H242l4.778-25.679h16.539c8.82-63.1%2044.102-97.951%20101.435-97.951%2054.394%200%2087.838%2031.183%2091.146%2081.809H405.18c-3.675-23.479-17.641-38.153-40.428-38.153-26.094%200-43%2018.71-48.88%2054.295h80.487l-4.777%2025.679h-77.915v14.675h74.974l-4.777%2025.68h-67.257c5.881%2033.75%2022.051%2051.359%2047.043%2051.359%2022.786%200%2037.855-15.041%2041.53-39.253'/%3e%3cpath%20fill='url(%23a)'%20d='M357%2096.15c143.852%200%20260.465%20116.148%20260.465%20259.425h96.768C714.233%20159.197%20554.165%200%20357%200S0%20159.197%200%20355.575h96.536C96.536%20212.298%20213.148%2096.151%20357%2096.151'/%3e%3cpath%20fill='url(%23b)'%20d='M357.001%20514.313c-88.02%200-159.375-71.07-159.375-158.739H96.536c0%20143.278%20116.613%20259.425%20260.465%20259.425s260.465-116.147%20260.464-259.425H516.376c0%2087.669-71.354%20158.739-159.375%20158.739'/%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='714.233'%20x2='51.769'%20y1='355.575'%20y2='-78.929'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2330c0fe'/%3e%3cstop%20offset='1'%20stop-color='%2300ffea'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='617.466'%20x2='134.2'%20y1='614.999'%20y2='298.132'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2330c0fe'/%3e%3cstop%20offset='1'%20stop-color='%2300ffea'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2096%2096'%3e%3cg%20clip-path='url(%23a)'%3e%3cpath%20fill='%230b53bf'%20d='M48%2096c26.51%200%2048-21.49%2048-48S74.51%200%2048%200%200%2021.49%200%2048s21.49%2048%2048%2048'/%3e%3cpath%20fill='%23fff'%20stroke='%230b53bf'%20stroke-miterlimit='10'%20stroke-width='.03'%20d='M58.2%2059.43c-2.1.84-4.38%201.32-6.57%201.32-4.337%200-8.426-1.847-10.38-6.3h9.54l1.86-4.5H40.14q-.09-.93-.09-1.95c0-1.02.03-1.33.09-1.95h14.1l1.86-4.5H41.25c1.954-4.452%206.043-6.3%2010.38-6.3%202.19%200%204.47.48%206.57%201.32l1.92-4.56c-2.58-1.35-5.49-2.01-8.4-2.01-7.024%200-14.123%203.927-16.693%2011.55H30.42v4.5h3.684a22.5%2022.5%200%200%200%200%203.9H30.42v4.5h4.607C37.597%2062.075%2044.697%2066%2051.72%2066c2.91%200%205.82-.66%208.4-2.01z'/%3e%3cpath%20fill='%23fff'%20stroke='%230b53bf'%20stroke-miterlimit='10'%20stroke-width='.03'%20d='M18%2048c0-13.59%209.03-25.05%2021.36-28.77v-6.18C23.64%2016.89%2012%2031.08%2012%2048s11.64%2031.11%2027.36%2034.95v-6.18C27.03%2073.08%2018%2061.59%2018%2048Zm38.64-34.95v6.18C68.97%2022.95%2078%2034.41%2078%2048s-9.03%2025.05-21.36%2028.77v6.18C72.36%2079.11%2084%2064.92%2084%2048S72.36%2016.89%2056.64%2013.05Z'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h96v96H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='300'%20height='300'%20viewBox='0%200%20300%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='300'%20height='300'%20fill='%23000B3B'/%3e%3cpath%20d='M268%20149.993C268%20172.889%20261.479%20194.254%20250.188%20212.352C238.213%20194.5%20231.228%20173.053%20231.228%20149.993C231.228%20137.964%20228.603%20126.55%20223.9%20116.271C219.772%20107.263%20214.044%2099.1298%20207.073%2092.2405C203.19%2088.3994%20198.911%2084.9411%20194.318%2081.9475C181.564%2073.6093%20166.349%2068.7703%20150.014%2068.7703C105.203%2068.7703%2068.7725%20105.199%2068.7725%20149.993C68.7725%20194.774%20105.203%20231.216%20150%20231.216C166.336%20231.216%20181.564%20226.363%20194.305%20218.039C194.305%20218.039%20179.322%20205.231%20176.875%20168.392C165.023%20180.079%20172.802%20195.375%20149.986%20195.375C124.97%20195.375%20104.615%20175.022%20104.615%20150.007C104.615%20124.992%20124.97%20104.639%20149.986%20104.639C162.754%20104.639%20174.319%20109.942%20182.562%20118.472C190.477%20126.632%20195.357%20137.773%20195.357%20150.007C195.357%20169.978%20199.281%20189.374%20207.004%20207.636C207.018%20207.678%20207.045%20207.719%20207.045%20207.76C211.994%20219.419%20218.35%20230.3%20226.019%20240.251C221.987%20243.641%20217.735%20246.785%20213.265%20249.615C194.975%20261.261%20173.266%20268%20149.986%20268C84.8348%20267.973%2032%20215.155%2032%20149.993C32%2084.8317%2084.8348%2032%20150%2032C173.28%2032%20194.988%2038.7526%20213.279%2050.3852C217.749%2053.2284%20222%2056.3586%20226.033%2059.7486C232.212%2064.9703%20237.858%2070.8071%20242.861%2077.1906C245.485%2080.5396%20247.932%2084.0253%20250.188%2087.6339C261.479%20105.718%20268%20127.097%20268%20149.993Z'%20fill='white'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1024'%20height='1024'%20fill='none'%20viewBox='0%200%201024%201024'%3e%3cpath%20fill='%233f79ff'%20d='M512%200c282.77%200%20512%20229.23%20512%20512s-229.231%20512-512%20512S0%20794.77%200%20512%20229.23%200%20512%200m55.697%2094.262c-30.761-30.76-80.633-30.76-111.394%200L94.262%20456.303c-30.76%2030.761-30.76%2080.633%200%20111.394l362.041%20362.041c30.761%2030.759%2080.633%2030.76%20111.394%200l362.041-362.041c30.76-30.761%2030.759-80.633%200-111.394z'/%3e%3cpath%20fill='%233f79ff'%20d='M560.62%20256.32q29.982%207.47%2055.37%2024.129%2046.742%2029.484%2072.629%2082.697l-83.415%2048.18q-30.203-64.72-96.36-64.72-30.921%200-48.899%2014.382-17.258%2013.664-17.258%2035.955%200%2023.731%2019.416%2038.832%2020.135%2014.382%2076.224%2031.641%2023.011%207.191%2034.517%2011.505%2012.225%203.596%2032.36%2012.225%2020.853%207.91%2031.64%2015.101%2011.505%207.191%2025.887%2019.416t21.574%2025.168q7.91%2012.943%2012.944%2031.641%205.752%2017.977%205.752%2039.55%200%2069.753-51.056%20110.742-37.212%2030.3-91.325%2038.2V832h-93.483v-62.988q-40.898-7.781-72.63-28.338-51.056-33.798-71.91-91.325l84.854-49.619q29.484%2076.944%20115.776%2076.944%2041.707%200%2061.123-15.101%2019.415-15.1%2019.416-38.112%200-26.607-23.731-40.989-23.73-15.101-84.853-32.36-33.798-10.067-57.529-20.134-23.012-10.068-46.742-26.607-23.01-17.259-35.235-43.146-12.225-25.889-12.225-60.405%200-68.314%2048.18-108.584%2033.261-27.879%2075.506-36.795V192h93.483z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='400'%20height='400'%20viewBox='0%200%20400%20400'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='400'%20height='400'%20fill='black'/%3e%3cpath%20d='M224.58%20153.969H318V177.238H224.58V153.969ZM82%20255.876H116.461V279.145H82V255.876ZM82%20221.907H116.461V245.176H82V221.907ZM82%20187.938H116.461V211.207H82V187.938ZM82%20153.969H174.113V177.238H82V153.969ZM82%20120H116.461V143.269H82V120ZM175.42%20187.938H224.58V211.207H175.42V187.938ZM283.539%20255.876H318V279.145H283.539V255.876ZM283.539%20221.907H318V245.176H283.539V221.907ZM283.539%20187.938H318V211.207H283.539V187.938ZM283.539%20120H318V143.269H283.539V120Z'%20fill='%23EBEBEB'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='300'%20height='300'%20viewBox='0%200%20300%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M150%20300C232.843%20300%20300%20232.843%20300%20150C300%2067.1573%20232.843%200%20150%200C67.1573%200%200%2067.1573%200%20150C0%20232.843%2067.1573%20300%20150%20300Z'%20fill='%23390922'/%3e%3cpath%20d='M247.63%2081.3L220.01%2072.09C218.43%2071.56%20217.19%2070.32%20216.67%2068.74L207.46%2041.12C206.74%2038.96%20204.72%2037.5%20202.44%2037.5H97.56C95.28%2037.5%2093.26%2038.96%2092.54%2041.12L83.34%2068.74C82.81%2070.32%2081.57%2071.56%2079.99%2072.09L52.37%2081.3C50.21%2082.02%2048.75%2084.04%2048.75%2086.32V213.7C48.75%20215.98%2050.21%20218%2052.37%20218.72L79.98%20227.92C81.56%20228.45%2082.8%20229.69%2083.33%20231.26L92.54%20258.88C93.26%20261.04%2095.28%20262.5%2097.56%20262.5H202.44C204.72%20262.5%20206.74%20261.04%20207.46%20258.88L216.68%20231.25C217.21%20229.67%20218.45%20228.43%20220.03%20227.91L247.64%20218.71C249.8%20217.99%20251.26%20215.97%20251.26%20213.69V86.31C251.26%2084.03%20249.8%2082.01%20247.64%2081.29L247.63%2081.3Z'%20fill='%23F3E9E3'/%3e%3cpath%20d='M192.24%20160.47C189.93%20155.8%20186.5%20151.81%20181.94%20148.52C177.38%20145.23%20171.64%20142.32%20164.71%20139.78L147.57%20133.72C141.57%20131.76%20136.98%20129.16%20133.81%20125.93C130.63%20122.7%20129.05%20118.6%20129.05%20113.64C129.05%20109.83%20130%20106.48%20131.91%20103.6C133.81%20100.72%20136.5%2098.47%20139.96%2096.85C143.42%2095.23%20147.29%2094.43%20151.56%2094.43C158.72%2094.43%20164.72%2096.91%20169.57%20101.87C174.42%20106.83%20177.88%20113.59%20179.96%20122.13L181.69%20122.3L192.42%20105.33C189.65%20101.06%20186.01%2097.51%20181.51%2094.68C177.01%2091.85%20172.16%2089.69%20166.97%2088.19C162.95%2087.03%20158.97%2086.32%20155.02%2086.06V66.2H146.36V86.13C142.01%2086.46%20137.94%2087.19%20134.15%2088.36C128.9%2089.98%20124.34%2092.29%20120.47%2095.29C116.6%2098.29%20113.66%20101.9%20111.64%20106.11C109.62%20110.32%20108.61%20114.97%20108.61%20120.05C108.61%20125.48%20109.79%20130.29%20112.16%20134.51C114.52%20138.72%20117.93%20142.36%20122.37%20145.42C126.81%20148.48%20132.38%20151.34%20139.08%20153.99L154.66%20159.36C161.35%20161.67%20166.37%20164.76%20169.72%20168.62C173.07%20172.49%20174.74%20177.36%20174.74%20183.25C174.74%20187.87%20173.64%20191.85%20171.45%20195.2C169.26%20198.55%20166.31%20201.15%20162.62%20202.99C158.92%20204.84%20154.66%20205.76%20149.81%20205.76C144.96%20205.76%20140.17%20204.61%20135.79%20202.3C131.4%20199.99%20127.71%20196.44%20124.71%20191.65C121.71%20186.86%20119.34%20180.83%20117.61%20173.56H115.88L104.28%20191.39C106.82%20196.01%20110.4%20200.05%20115.01%20203.51C119.62%20206.97%20124.91%20209.63%20130.85%20211.47C135.79%20213.01%20140.96%20213.89%20146.35%20214.15V233.98H155.01V214.04C159.67%20213.7%20164.06%20212.9%20168.17%20211.64C173.82%20209.91%20178.7%20207.37%20182.8%20204.02C186.9%20200.67%20190.07%20196.69%20192.32%20192.07C194.57%20187.45%20195.7%20182.32%20195.7%20176.66C195.7%20170.54%20194.54%20165.15%20192.24%20160.47Z'%20fill='%23390922'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_aLISaAY6NSiJFT$6GdtrfA","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='eKgCWIOpRqD1'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20viewBox='0%200%20400%20400'%3e%3cstyle%3e@keyframes%20eKgCWIOpRqD2_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}12.5%25{transform:translate(200px,200px)%20scale(.41,.41)}25%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD3_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}8.333333%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}20.833333%25{transform:translate(200px,200px)%20scale(.41,.41)}33.333333%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD4_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}16.666667%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}29.166667%25{transform:translate(200px,200px)%20scale(.41,.41)}41.666667%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD5_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}25%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}37.5%25{transform:translate(200px,200px)%20scale(.41,.41)}50%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD6_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}33.333333%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}45.833333%25{transform:translate(200px,200px)%20scale(.41,.41)}58.333333%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD7_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}41.666667%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}54.166667%25{transform:translate(200px,200px)%20scale(.41,.41)}66.666667%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}@keyframes%20eKgCWIOpRqD8_ts__ts{0%25{transform:translate(200px,200px)%20scale(.454545,.454542)}50%25{transform:translate(200px,200px)%20scale(.454545,.454542);animation-timing-function:cubic-bezier(0,0,.58,1)}62.5%25{transform:translate(200px,200px)%20scale(.41,.41)}75%25,to{transform:translate(200px,200px)%20scale(.454545,.454545)}}%3c/style%3e%3ccircle%20r='440'%20fill='%236938ef'%20style='animation:eKgCWIOpRqD2_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='385'%20fill='%238760f2'%20style='animation:eKgCWIOpRqD3_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='330'%20fill='%23a588f5'%20style='animation:eKgCWIOpRqD4_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='275'%20fill='%23c3aff9'%20style='animation:eKgCWIOpRqD5_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='220'%20fill='%23e1d7fc'%20style='animation:eKgCWIOpRqD6_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='165'%20fill='%23fff'%20style='animation:eKgCWIOpRqD7_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3ccircle%20r='110'%20fill='%236938ef'%20style='animation:eKgCWIOpRqD8_ts__ts%202400ms%20linear%20infinite%20normal%20forwards'%20transform='translate(200%20200)scale(.45454)'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%20role='img'%20aria-labelledby='title'%3e%3ctitle%20id='title'%3eSEK%20icon%3c/title%3e%3cpath%20fill='%2305160B'%20d='M16%200c8.837%200%2016%207.163%2016%2016s-7.163%2016-16%2016S0%2024.837%200%2016%207.163%200%2016%200Zm0%203C8.82%203%203%208.82%203%2016s5.82%2013%2013%2013%2013-5.82%2013-13S23.18%203%2016%203Z'/%3e%3cpath%20fill='%2305160B'%20d='M16%206c5.523%200%2010%204.477%2010%2010s-4.477%2010-10%2010S6%2021.523%206%2016%2010.477%206%2016%206Zm-4.865%207.076c-1.368%200-2.232.696-2.232%201.736%200%201.232.984%201.512%202.072%201.792.76.2%201.088.289%201.088.72%200%20.368-.32.6-.84.6-.632%200-.944-.296-.944-.88H8.807c0%201.272.904%201.985%202.384%201.985%201.416%200%202.328-.713%202.328-1.825%200-1.248-.96-1.544-2.056-1.816-.832-.208-1.136-.328-1.136-.704%200-.32.296-.536.752-.536.552%200%20.847.288.847.792h1.441c0-1.224-.8-1.864-2.232-1.864Zm3.004%205.824h4.088v-1.16h-2.704v-1.152h2.464v-1.144h-2.464v-1.08h2.64v-1.16h-4.024V18.9Zm4.83%200h1.384v-2.624h.016l1.736%202.624h1.744l-2.224-3%202.072-2.696h-1.656l-1.672%202.455h-.016v-2.455H18.97v5.695Z'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_Msg57USEadASvSStYSdmzA","export default \"data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M25%2045C25.7075%2045%2026.4064%2044.9633%2027.095%2044.8916L26.4697%2038.9516C25.9867%2039.0018%2025.4965%2039.0276%2025.0002%2039.0276C24.5061%2039.0276%2024.0179%2039.0021%2023.537%2038.9522L22.9039%2044.8915C23.5928%2044.9632%2024.2921%2045%2025%2045Z'%20fill='%23030712'/%3e%3cpath%20d='M17.9718%2037.1424C18.8166%2037.6325%2019.7172%2038.0369%2020.6618%2038.3438L18.8173%2044.0261C17.4728%2043.5894%2016.1907%2043.0143%2014.9879%2042.3174L17.9718%2037.1424Z'%20fill='%23030712'/%3e%3cpath%20d='M13.642%2033.2331C14.2192%2034.0281%2014.8778%2034.7602%2015.6057%2035.417L11.6042%2039.8513C10.5678%2038.9158%209.62979%2037.8735%208.80758%2036.7416L13.642%2033.2331Z'%20fill='%23030712'/%3e%3cpath%20d='M11.2716%2027.8917C11.4756%2028.8653%2011.7805%2029.8019%2012.175%2030.6898L6.71509%2033.1156C6.15342%2031.8521%205.71889%2030.5195%205.42772%2029.1341L11.2716%2027.8917Z'%20fill='%23030712'/%3e%3cpath%20d='M10.9733%2024.9926H5C5%2024.946%205.00016%2024.8994%205.00048%2024.8529C5.00773%2023.846%205.08939%2022.8568%205.24022%2021.8906C6.24559%2015.4618%2010.3245%2010.0379%2015.9214%207.17448C18.6459%205.78411%2021.7314%205%2025%205C28.2783%205%2031.3724%205.78876%2034.1028%207.18685C39.6098%2010.0137%2043.6428%2015.3213%2044.7163%2021.6241C44.9024%2022.7192%2044.9996%2023.8446%2045%2024.9926H39.027C39.0226%2017.2495%2032.7443%2010.9739%2025.0002%2010.9739C17.2561%2010.9739%2010.9778%2017.2495%2010.9733%2024.9926Z'%20fill='%23030712'/%3e%3cpath%20d='M37.8265%2030.6872C38.2196%2029.8018%2038.5238%2028.8682%2038.7276%2027.8976L44.5723%2029.1336C44.2807%2030.5213%2043.8453%2031.856%2043.2823%2033.1215L37.8265%2030.6872Z'%20fill='%23030712'/%3e%3cpath%20d='M34.3965%2035.4154C35.1252%2034.7575%2035.7846%2034.0242%2036.3623%2033.2278L41.1938%2036.7396C40.3706%2037.8731%2039.4314%2038.9168%2038.3936%2039.8533L34.3965%2035.4154Z'%20fill='%23030712'/%3e%3cpath%20d='M29.3423%2038.3426C30.2859%2038.0357%2031.1855%2037.6315%2032.0294%2037.1419L35.0132%2042.3167C33.8125%2043.0125%2032.5329%2043.5869%2031.1909%2044.0234L29.3423%2038.3426Z'%20fill='%23030712'/%3e%3cpath%20d='M28.7194%2024.3156C29.4014%2024.6073%2029.9343%2025.0561%2030.3606%2025.6396C30.7869%2026.223%2031%2027.0085%2031%2027.9958C31%2029.275%2030.5524%2030.3521%2029.6998%2031.2498C28.8472%2032.1474%2027.7176%2032.7084%2026.3535%2032.9104V35H23.7105V32.8655C22.3037%2032.6187%2021.1528%2032.0352%2020.3002%2031.0927C19.4476%2030.1502%2019%2029.0281%2019%2027.7041L22.1332%2027.749C22.1758%2028.5344%2022.4742%2029.1628%2023.0284%2029.634C23.5826%2030.1053%2024.3073%2030.3297%2025.2238%2030.3297C25.9698%2030.3297%2026.5879%2030.1726%2027.0568%2029.836C27.5258%2029.4994%2027.7815%2029.0281%2027.7815%2028.4222C27.7815%2028.0183%2027.6323%2027.6817%2027.3766%2027.4348C27.1208%2027.188%2026.7371%2026.986%2026.2682%2026.8514C25.7993%2026.7167%2025.0533%2026.5372%2024.0728%2026.3128C23.0924%2026.1333%2022.2611%2025.8864%2021.6004%2025.5722C20.9183%2025.2581%2020.3854%2024.8093%2019.9591%2024.2034C19.5329%2023.5975%2019.341%2022.7896%2019.341%2021.7797C19.341%2020.5904%2019.7247%2019.5581%2020.5346%2018.7054C21.3446%2017.8526%2022.389%2017.3365%2023.7105%2017.1121V15H26.3535V17.1569C27.6323%2017.4262%2028.6554%2017.9872%2029.4654%2018.84C30.254%2019.7152%2030.659%2020.7475%2030.7016%2021.9593H27.5684C27.4831%2021.286%2027.2274%2020.7475%2026.7584%2020.3435C26.2895%2019.9396%2025.6714%2019.7152%2024.9041%2019.7152C24.1794%2019.7152%2023.6252%2019.8723%2023.1989%2020.1864C22.7726%2020.5006%2022.5595%2020.9494%2022.5595%2021.5329C22.5595%2021.9593%2022.6874%2022.2959%2022.9432%2022.5203C23.1989%2022.7447%2023.5613%2022.9467%2024.0302%2023.0813C24.4991%2023.216%2025.2238%2023.3955%2026.2043%2023.575C27.1847%2023.777%2028.0373%2024.0238%2028.7194%2024.3156Z'%20fill='%23030712'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cg%20fill='none'%3e%3ccircle%20cx='16'%20cy='16'%20r='16'%20fill='%233e73c4'/%3e%3cg%20fill='%23fff'%3e%3cpath%20d='M20.02%2018.12c0-2.12-1.28-2.85-3.84-3.15-1.83-.25-2.2-.73-2.2-1.58s.62-1.4%201.84-1.4c1.1%200%201.7.37%202%201.28a.46.46%200%200%200%20.43.3h.98a.42.42%200%200%200%20.43-.42v-.06a3.04%203.04%200%200%200-2.75-2.5V9.15c0-.24-.18-.42-.48-.48h-.92c-.24%200-.42.18-.48.48v1.4c-1.83.24-3%201.45-3%202.97%200%202%201.23%202.8%203.79%203.1%201.7.3%202.25.66%202.25%201.64%200%20.97-.85%201.63-2%201.63-1.6%200-2.14-.66-2.32-1.57-.06-.25-.25-.37-.43-.37h-1.04a.42.42%200%200%200-.42.43v.06c.24%201.51%201.22%202.6%203.23%202.91v1.46c0%20.24.18.42.48.48h.92c.24%200%20.42-.18.49-.48v-1.46c1.82-.3%203.04-1.58%203.04-3.22z'/%3e%3cpath%20d='M12.9%2024.5a9.03%209.03%200%200%201-5.43-11.66%209%209%200%200%201%205.42-5.4c.25-.12.37-.3.37-.6v-.86c0-.24-.12-.42-.37-.48-.06%200-.18%200-.24.06a10.9%2010.9%200%200%200-7.13%2013.72c1.1%203.4%203.72%206%207.13%207.1.24.12.49%200%20.55-.24.06-.06.06-.13.06-.25v-.85c0-.18-.19-.42-.37-.54m6.46-18.94c-.24-.12-.49%200-.55.24-.06.06-.06.13-.06.25v.85c0%20.24.19.48.37.6a9.03%209.03%200%200%201%205.42%2011.66%209%209%200%200%201-5.42%205.4c-.25.12-.37.3-.37.6v.86c0%20.24.12.42.37.48.06%200%20.18%200%20.24-.06a10.9%2010.9%200%200%200%207.13-13.72%2011.03%2011.03%200%200%200-7.13-7.16'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3ccircle%20cx='256'%20cy='256'%20r='256'%20fill='%2300805e'/%3e%3cpath%20fill='%23f0f0f0'%20d='M386.895%20186.535v-58.196H125.106v58.196h101.797V244.7h58.195v-58.165zM226.934%20361.061v58.197h58.164v-58.197h58.165v-116.36h-58.165v116.36zm-.001-116.36h-58.195v116.36h58.195z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3034_948)'%3e%3ccircle%20cx='16'%20cy='16'%20r='16'%20fill='%231C3966'/%3e%3cg%20clip-path='url(%23clip1_3034_948)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.8%2016C24.8%2011.1399%2020.8601%207.2%2016%207.2V4C16.8284%204%2017.6372%204.08395%2018.4184%204.2438C23.8866%205.36275%2028%2010.201%2028%2016C28%2022.6274%2022.6274%2028%2016%2028C10.7751%2028%206.33016%2024.6608%204.68282%2020H8.15953C9.6161%2022.8493%2012.5802%2024.8%2016%2024.8C20.8601%2024.8%2024.8%2020.8601%2024.8%2016ZM5.38408%2010.4C7.39607%2014.2062%2011.3951%2016.8%2016%2016.8V13.6C12.0562%2013.6%208.71825%2011.0056%207.59987%207.43042C6.71685%208.29608%205.96705%209.29714%205.38408%2010.4ZM8.95347%206.28574C9.63814%209.54935%2012.5329%2012%2016%2012C18.2091%2012%2020%2013.7909%2020%2016C20%2018.2091%2018.2091%2020%2016%2020H10.0124C11.3041%2021.9296%2013.5037%2023.2%2016%2023.2C19.9765%2023.2%2023.2%2019.9764%2023.2%2016C23.2%2012.0236%2019.9765%208.8%2016%208.8C13.7909%208.8%2012%207.00914%2012%204.8V4.68282C10.9024%205.07076%209.87812%205.61385%208.95347%206.28574Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3034_948'%3e%3crect%20width='32'%20height='32'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_3034_948'%3e%3crect%20width='24'%20height='24'%20fill='white'%20transform='translate(4%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20viewBox='0%200%20397.1%20397.1'%3e%3cpath%20d='M198.6%207.1c105.8%200%20191.5%2085.7%20191.5%20191.5%200%20105.7-85.7%20191.5-191.5%20191.5S7.1%20304.3%207.1%20198.6C7.1%2092.8%2092.8%207.1%20198.6%207.1z'%20style='fill:%23111;stroke:%23111;stroke-width:7.0536'/%3e%3cradialGradient%20id='a'%20cx='-105.949'%20cy='595.938'%20r='1'%20gradientTransform='matrix(0%20411.151%20289.409%200%20-172270.75%2043621.418)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.031'%20style='stop-color:%233a3a3a'/%3e%3cstop%20offset='1'%20style='stop-color:%231c1c1c'/%3e%3c/radialGradient%3e%3cpath%20d='M198.6%203.6c-107.7%200-195%2087.3-195%20195s87.3%20195%20195%20195%20195-87.3%20195-195-87.3-195-195-195'%20style='fill:url(%23a);fill-opacity:.7'/%3e%3clinearGradient%20id='b'%20x1='198.575'%20x2='198.575'%20y1='399.143'%20y2='1.994'%20gradientTransform='matrix(1%200%200%20-1%200%20399.143)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20style='stop-color:%23fff'/%3e%3cstop%20offset='1'%20style='stop-color:%23111'/%3e%3c/linearGradient%3e%3cpath%20d='M198.6%203.6c-107.7%200-195%2087.3-195%20195s87.3%20195%20195%20195%20195-87.3%20195-195-87.3-195-195-195z'%20style='fill:none;stroke:url(%23b);stroke-width:7.1429'/%3e%3cpath%20d='M167.4%2038.1C92.1%2052.6%2035.2%20118.9%2035.2%20198.4s56.9%20145.8%20132.2%20160.3v-15.3c-67-14.3-117.2-73.8-117.2-145s50.2-130.7%20117.2-145zm62.4%2015.4V38.2C305%2052.8%20361.7%20119%20361.7%20198.4S305%20344%20229.8%20358.6v-15.3c66.8-14.4%20116.9-73.8%20116.9-144.9S296.6%2067.9%20229.8%2053.5'%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23fff'/%3e%3cpath%20d='M221.7%20193c12.5%202.4%2022.1%207%2029%2013.7%206.9%206.6%2010.3%2015.1%2010.3%2025.4v16.3c0%2012.4-4.5%2022.4-13.4%2030-8.9%207.5-20.7%2011.2-35.2%2011.2h-5v25.9h-17.2v-25.9h-5.3c-9.6%200-18-2.1-25.4-6.4-7.3-4.4-13.1-10.5-17.2-18.3-4-8-6-17.1-6-27.5h17.2c0%2010.5%202.9%2019.1%208.6%2025.7%205.9%206.4%2013.7%209.7%2023.2%209.7h26.6q14.1%200%2022.8-6.6c5.7-4.6%208.6-10.5%208.6-17.8v-16.3c0-5.8-2.2-10.7-6.5-14.8-4.2-4.1-9.9-6.7-17.2-7.9l-43.1-7.6c-12.1-2.2-21.6-6.8-28.3-13.7-6.7-7-10.1-15.7-10.1-26.2v-13.7c0-12.4%204.3-22.2%2012.9-29.5%208.8-7.5%2020.4-11.2%2034.7-11.2h4.3V81.6h17.2v25.9h5.5c13.6%200%2024.5%204.4%2032.8%2013.2%208.3%208.6%2012.5%2020.1%2012.5%2034.3h-17.2c0-9.3-2.6-16.8-7.7-22.4q-7.65-8.4-20.4-8.4h-27.1c-9.1%200-16.4%202.2-21.8%206.6-5.4%204.2-8.1%2010-8.1%2017.3v13.7q0%208.85%206%2015c4.2%204.1%209.8%206.8%2017%208.1z'%20style='fill:%23fff'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_epdbhdyBUyD3hvxx0_dcTg","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20fill='none'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='%233e73c4'%20d='M0%2032C0%2014.327%2014.327%200%2032%200s32%2014.327%2032%2032-14.327%2032-32%2032S0%2049.673%200%2032'/%3e%3cpath%20fill='%23fff'%20d='M29.838%2045.258q-2.988%200-5.211-1.505-2.2-1.504-3.414-4.223Q20%2036.79%2020%2033.151v-.045q0-3.638%201.213-6.356%201.235-2.74%203.481-4.245Q26.941%2021%2029.973%2021a7.8%207.8%200%200%201%202.92.54%207.1%207.1%200%200%201%202.38%201.504%206.8%206.8%200%200%201%201.618%202.358h.09V21.45h3.908v17.565q0%201.55.471%202.223.472.675%201.573.674.314%200%20.629-.045.336-.045.561-.112v3.234a3.6%203.6%200%200%201-.786.18q-.472.09-1.123.09-2.09%200-3.37-.944-1.28-.965-1.706-2.897l-.09-.404h-.113q-.516%201.19-1.594%202.156a7.9%207.9%200%200%201-2.493%201.527%208.1%208.1%200%200%201-3.01.562m.36-3.46q2.043%200%203.57-1.1%201.528-1.122%202.381-3.077.855-1.954.854-4.47v-.045q0-2.493-.854-4.447-.853-1.954-2.358-3.077t-3.504-1.123q-1.909%200-3.324%201.078-1.415%201.056-2.201%203.01-.765%201.954-.764%204.582v.045q0%202.673.719%204.604.74%201.932%202.134%202.988%201.393%201.033%203.346%201.033'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20fill='none'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='%231c9ba4'%20d='M0%2032C0%2014.327%2014.327%200%2032%200s32%2014.327%2032%2032-14.327%2032-32%2032S0%2049.673%200%2032'/%3e%3cpath%20fill='%23fff'%20d='M24%2050V25.696q0-4.129%202.037-6.404Q28.092%2017%2031.78%2017q3.371%200%205.409%201.837%202.055%201.837%202.055%204.9v.035a5.5%205.5%200%200%201-.966%203.167q-.948%201.416-2.617%202.134v.28q2.617.649%203.97%202.362%201.368%201.715%201.369%204.34v.035q0%202.326-1.019%204.129a7.3%207.3%200%200%201-2.81%202.817q-1.773%201.015-4.056%201.015-1.405%200-2.547-.385a5.8%205.8%200%200%201-1.95-1.102%205.4%205.4%200%200%201-1.281-1.68h-.281V50zm8.957-8.644q1.37%200%202.476-.665a4.9%204.9%200%200%200%201.774-1.854q.666-1.173.667-2.66v-.035q0-2.607-1.633-3.954-1.635-1.348-4.724-1.348H29.97v-2.694h1.563q2.248%200%203.46-1.068%201.23-1.084%201.23-3.132v-.035q0-1.907-1.195-3.062-1.177-1.154-3.161-1.154-2.389%200-3.6%201.592t-1.212%204.724v8.819q0%201.995.737%203.464.756%201.47%202.073%202.275%201.335.787%203.09.787'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1021'%20height='1021'%20fill='none'%3e%3cg%20clip-path='url(%23a)'%3e%3cpath%20fill='%23292929'%20stroke='%23292929'%20stroke-width='10.667'%20d='M510%201015c278.904%200%20505-226.096%20505-505S788.904%205%20510%205%205%20231.096%205%20510s226.096%20505%20505%20505Z'/%3e%3cpath%20fill='%23fff'%20d='M430.37%20100v38.474l-1.365%201.012c-93.091%2019.673-176.275%2075.89-230.539%20153.497-86.596%20123.87-90.95%20288.992-10.778%20417.239%2053.723%2085.914%20141.637%20148.767%20241.317%20169.687l1.365%201.035v38.475c-104.221-19.249-198.607-80.738-260.142-166.322C62.335%20603.036%2066.336%20398.122%20180.441%20252.744c61.676-78.549%20151.19-134.483%20249.953-152.72zm159.499%20819.393v-39.651c98.504-20.402%20186.465-82.831%20239.999-167.427%2085.232-134.743%2076.949-309.371-20.99-434.983-54.146-69.441-132.318-119.399-218.844-137.801l-.141-39.51c105.445%2020.685%20200.301%2082.549%20261.718%20170.299%20101.987%20145.661%20100.339%20340.479-3.976%20484.375-61.559%2084.902-154.533%20144.414-257.766%20164.745z'/%3e%3cg%20filter='url(%23b)'%3e%3cpath%20fill='%23d1f019'%20d='M540.424%20481.574c62.733%2011.501%20118.146%2030.32%20117.623%20104.031-.523%2060.641-44.435%20104.031-113.963%20113.441v54.89H479.26v-55.413c-71.619-11.501-115.009-56.459-115.531-120.76l76.847%201.046c2.613%2035.548%2030.843%2060.118%2075.801%2060.118%2036.071%200%2062.732-15.683%2062.732-44.435%200-30.843-29.798-37.117-90.962-49.14-61.686-11.501-116.054-31.366-116.054-105.6%200-56.981%2041.299-99.326%20107.167-108.735v-55.414h64.824v55.936c65.346%2010.979%20105.599%2052.277%20106.644%20112.396h-76.847c-3.659-30.844-27.183-52.277-65.346-52.277-33.457%200-57.504%2014.114-57.504%2042.344%200%2029.798%2028.752%2036.071%2089.393%2047.572'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h1021v1021H0z'/%3e%3c/clipPath%3e%3cfilter%20id='b'%20width='307.778'%20height='491.789'%20x='357.001'%20y='275.603'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20result='hardAlpha'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset%20dy='6.728'/%3e%3cfeGaussianBlur%20stdDeviation='3.364'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20in2='BackgroundImageFix'%20result='effect1_dropShadow_215_15'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='effect1_dropShadow_215_15'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M16%2032c8.837%200%2016-7.163%2016-16S24.837%200%2016%200%200%207.163%200%2016s7.163%2016%2016%2016'/%3e%3cpath%20fill='%230052FF'%20d='M23.032%2014.02c.314-2.096-1.283-3.223-3.465-3.975l.708-2.84-1.728-.43-.69%202.765c-.454-.114-.92-.22-1.385-.326l.695-2.783L15.439%206l-.708%202.839q-.566-.127-1.104-.26l.002-.009-2.384-.595-.46%201.846s1.283.294%201.256.312c.7.175.826.638.805%201.006l-.806%203.235q.073.017.18.057l-.183-.045-1.13%204.532c-.086.212-.303.531-.793.41.018.025-1.256-.313-1.256-.313L8%2020.993l2.25.561c.418.105.828.215%201.231.318l-.715%202.872%201.727.43.708-2.84q.707.19%201.378.357l-.706%202.828%201.728.43.715-2.866c2.948.558%205.164.333%206.097-2.333.752-2.146-.037-3.385-1.588-4.192%201.13-.26%201.98-1.003%202.207-2.538m-3.95%205.538c-.533%202.147-4.148.986-5.32.695l.95-3.805c1.172.293%204.929.872%204.37%203.11m.535-5.569c-.487%201.953-3.495.96-4.47.717l.86-3.45c.975.243%204.118.696%203.61%202.733'/%3e%3cpath%20fill='%230052FF'%20fill-rule='evenodd'%20d='M16%2030.5c8.008%200%2014.5-6.492%2014.5-14.5S24.008%201.5%2016%201.5%201.5%207.992%201.5%2016%207.992%2030.5%2016%2030.5M32%2016c0%208.837-7.163%2016-16%2016S0%2024.837%200%2016%207.163%200%2016%200s16%207.163%2016%2016'%20clip-rule='evenodd'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_dJ$ULFcuzX43djbIEsCZPw","export default \"data:image/svg+xml,%3csvg%20width='240'%20height='240'%20viewBox='0%200%20240%20240'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='120'%20cy='120'%20r='120'%20fill='%2368B1F5'/%3e%3cpath%20d='M119.63%20213C119.63%20213%20191.755%20178.791%20191.755%20139.496C191.755%20109.021%20191.755%2089.2249%20191.755%2058.7498C145.968%2037.7688%2093.2984%2037.7471%2047.4999%2058.704C47.5414%2089.1943%2047.5043%20109.006%2047.5043%20139.496C47.5043%20178.791%20119.63%20213%20119.63%20213Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M132.84%2071.3319H123.541L122.424%2079.2775C122.083%2079.2694%20121.74%2079.2653%20121.396%2079.2653C105.845%2079.2653%2093.6191%2088.3812%2093.6191%20102.645C93.6191%20117.046%20105.064%20120.693%20116.219%20123.427L113.141%20145.33C107.885%20143.214%20103.236%20139.213%2099.7321%20133.746L89.1147%20142.648C93.5743%20149.974%20101.996%20155.231%20111.437%20157.452L110.134%20166.727H119.433L120.573%20158.617C120.883%20158.624%20121.193%20158.627%20121.503%20158.627C137.375%20158.627%20150.674%20149.297%20150.674%20134.175C150.674%20119.079%20138.537%20115.334%20127.026%20112.698L129.861%2092.5282C134.121%2094.4341%20137.381%2097.747%20140.056%20101.894L150.03%2093.3145C146.294%2087.4763%20139.845%2082.7117%20131.546%2080.5379L132.84%2071.3319ZM120.813%2090.7411C112.637%2090.7928%20106.918%2094.9625%20106.918%20101.251C106.918%20106.759%20110.909%20108.774%20118.021%20110.61L120.813%2090.7411ZM125.212%20125.607L122.199%20147.043C130.753%20146.96%20137.161%20142.893%20137.161%20135.569C137.161%20129.61%20132.5%20127.503%20125.212%20125.607Z'%20fill='%2368B1F5'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='404'%20height='404'%20fill='none'%20viewBox='0%200%20404%20404'%3e%3cpath%20fill='%23005e5d'%20d='M404%20202C404%2090.439%20313.562%200%20202%200S0%2090.439%200%20202s90.439%20202%20202%20202%20202-90.438%20202-202'/%3e%3cpath%20fill='url(%23a)'%20fill-rule='evenodd'%20d='M80.765%20238.772c38.828%2038.829%2091.143%2049.466%20116.848%2023.761s15.066-78.02-23.761-116.848c-38.829-38.828-91.143-49.466-116.848-23.761s-15.067%2078.019%2023.761%20116.848m20.497%205.167c34.643%2027.048%2074.644%2033.712%2089.345%2014.884s-1.466-56.019-36.108-83.067c-34.643-27.048-74.644-33.712-89.344-14.883-14.701%2018.828%201.465%2056.018%2036.107%2083.066'%20clip-rule='evenodd'/%3e%3cpath%20fill='url(%23b)'%20fill-rule='evenodd'%20d='M323.235%20166.964c-38.828-38.828-91.142-49.466-116.849-23.761-25.704%2025.705-15.066%2078.019%2023.762%20116.848s91.142%2049.465%20116.848%2023.761c25.705-25.705%2015.068-78.02-23.761-116.848m-20.091-4.773c-34.643-27.048-74.643-33.712-89.344-14.883-14.701%2018.828%201.464%2056.019%2036.107%2083.067s74.643%2033.712%2089.345%2014.883c14.701-18.828-1.465-56.019-36.108-83.067'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23f9f9f9'%20d='M211.514%2078.551h38.327l-56.427%20246.895h-38.328z'/%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='145.389'%20x2='167.255'%20y1='238.887'%20y2='274.415'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.073'%20stop-color='%23f9f9f9'/%3e%3cstop%20offset='1'%20stop-color='%23f9f9f9'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='250.485'%20x2='236.745'%20y1='185.001'%20y2='131.32'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23f9f9f9'/%3e%3cstop%20offset='1'%20stop-color='%23f9f9f9'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_cn7IAAGY294pWGc7MpElVg","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='158'%20height='158'%20fill='none'%20viewBox='0%200%20158%20158'%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M0%20.21h52.51v52.51H0zm52.51%2052.51L105.01.21h52.51v52.51zm52.5%2052.5h52.51v52.51h-52.51zM0%20157.73v-52.51l52.51-52.5v105.01z'%20clip-rule='evenodd'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%20fill='none'%20viewBox='0%200%2050%2050'%3e%3ccircle%20cx='25'%20cy='25'%20r='25'%20fill='%2397fedd'/%3e%3cpath%20fill='%23000'%20fill-rule='evenodd'%20d='M32.165%2020.898c-1.501%200-2.522.832-2.814%202.215h5.628c-.243-1.444-1.274-2.215-2.814-2.215m-.103-3.59c4.47%200%207.306%203.209%207.306%207.213l-.001%201.493-10.016-.012c.09%201.13%201.365%202.258%203.625%202.258%201.756%200%203.04-.482%203.659-.97l1.75%203.401c-1.038.614-3.237%201.439-5.82%201.439-5.32%200-8.04-3.398-8.04-7.609%200-3.982%202.955-7.213%207.537-7.213m-13.698%204.08c-.499-.067-1.62-.159-1.62%202.895l-.043%207.846h-5.163V17.598l4.739-.017v1.843c1.128-2.188%204.462-2.548%206.393-1.675v6.19c-.21.05-.593.12-.786.147-2.551.358-3.554-1.14-3.52-2.696'%20clip-rule='evenodd'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='398'%20height='398'%20fill='none'%20viewBox='0%200%20398%20398'%3e%3cpath%20fill='%23fff'%20stroke='%23111'%20stroke-width='7.054'%20d='M198.996%207.527h.007C304.75%207.527%20390.476%2093.252%20390.476%20199v.007c0%20105.747-85.726%20191.473-191.473%20191.473h-.007c-105.748%200-191.473-85.726-191.473-191.473V199C7.523%2093.252%2093.248%207.527%20198.996%207.527Z'/%3e%3cpath%20fill='url(%23a)'%20fill-opacity='.7'%20d='M199.003%204h-.007c-107.696%200-195%2087.304-195%20195v.007c0%20107.695%2087.304%20194.999%20195%20194.999h.007c107.695%200%20194.999-87.304%20194.999-194.999V199c0-107.696-87.304-195-194.999-195'/%3e%3cpath%20stroke='url(%23b)'%20stroke-width='7.143'%20d='M199.003%204h-.007c-107.696%200-195%2087.304-195%20195v.007c0%20107.695%2087.304%20194.999%20195%20194.999h.007c107.695%200%20194.999-87.304%20194.999-194.999V199c0-107.696-87.304-195-194.999-195Z'/%3e%3cpath%20fill='%23000'%20fill-rule='evenodd'%20d='M167.799%2038.559C92.491%2053.064%2035.606%20119.32%2035.606%20198.862c0%2079.541%2056.885%20145.797%20132.193%20160.302v-15.3c-66.971-14.276-117.2-73.773-117.2-145.002s50.229-130.727%20117.2-145.003zm62.401%2015.36V38.613c75.169%2014.616%20131.914%2080.805%20131.914%20160.249S305.369%20344.494%20230.2%20359.11v-15.306c66.831-14.382%20116.921-73.813%20116.921-144.942S297.031%2068.301%20230.2%2053.919'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23000'%20d='M222.118%20193.406q18.685%203.56%2028.985%2013.735%2010.3%209.92%2010.301%2025.435v16.279q0%2018.568-13.415%2030.013-13.414%2011.192-35.213%2011.192h-5.03v25.944h-17.247V290.06h-5.27q-14.373%200-25.392-6.359-11.019-6.613-17.247-18.313-5.988-11.955-5.988-27.47h17.247q0%2015.77%208.623%2025.689%208.863%209.666%2023.236%209.666h26.589q14.133%200%2022.757-6.613%208.623-6.868%208.623-17.805v-16.279q0-8.647-6.467-14.752-6.228-6.105-17.247-7.885l-43.118-7.631q-18.205-3.306-28.266-13.735t-10.061-26.198V148.64q0-18.567%2012.935-29.505%2013.174-11.191%2034.734-11.191h4.312V82h17.247v25.944h5.509q20.362%200%2032.818%2013.226%2012.456%2012.972%2012.456%2034.338h-17.247q0-13.99-7.665-22.383-7.666-8.394-20.362-8.394h-27.068q-13.655%200-21.798%206.613-8.145%206.359-8.145%2017.296v13.735q0%208.902%205.989%2015.007%206.228%206.105%2017.007%208.139z'/%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='matrix(0%20411.151%20-289.409%200%20199.418%2060.946)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.031'%20stop-color='%23fafafa'/%3e%3cstop%20offset='1'%20stop-color='%23e3e3e3'/%3e%3c/radialGradient%3e%3clinearGradient%20id='b'%20x1='198.999'%20x2='198.999'%20y1='.321'%20y2='397.686'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23f4f4f4'/%3e%3cstop%20offset='1'%20stop-color='%23bebebe'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='404'%20height='404'%20fill='none'%20viewBox='0%200%20404%20404'%3e%3cpath%20fill='%23f9f9f9'%20d='M404%20202C404%2090.439%20313.562%200%20202%200S0%2090.439%200%20202s90.439%20202%20202%20202%20202-90.438%20202-202'/%3e%3cpath%20fill='url(%23a)'%20fill-rule='evenodd'%20d='M80.765%20238.772c38.828%2038.829%2091.143%2049.466%20116.848%2023.761s15.066-78.02-23.761-116.848c-38.829-38.828-91.143-49.466-116.848-23.761s-15.067%2078.019%2023.761%20116.848m20.497%205.167c34.643%2027.048%2074.644%2033.712%2089.345%2014.884s-1.466-56.019-36.108-83.067c-34.643-27.048-74.644-33.712-89.344-14.883-14.701%2018.828%201.465%2056.018%2036.107%2083.066'%20clip-rule='evenodd'/%3e%3cpath%20fill='url(%23b)'%20fill-rule='evenodd'%20d='M323.235%20166.964c-38.828-38.828-91.142-49.466-116.849-23.761-25.704%2025.705-15.066%2078.019%2023.762%20116.848s91.142%2049.465%20116.848%2023.761c25.705-25.705%2015.068-78.02-23.761-116.848m-20.091-4.773c-34.643-27.048-74.643-33.712-89.344-14.883-14.701%2018.828%201.464%2056.019%2036.107%2083.067s74.643%2033.712%2089.345%2014.883c14.701-18.828-1.465-56.019-36.108-83.067'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23171717'%20d='M211.514%2078.551h38.327l-56.427%20246.895h-38.328z'/%3e%3cdefs%3e%3clinearGradient%20id='a'%20x1='145.389'%20x2='167.255'%20y1='238.887'%20y2='274.415'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.073'%20stop-color='%23171717'/%3e%3cstop%20offset='1'%20stop-color='%23171717'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='250.485'%20x2='236.745'%20y1='185.001'%20y2='131.32'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23171717'/%3e%3cstop%20offset='1'%20stop-color='%23171717'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1021'%20height='1021'%20fill='none'%3e%3cg%20clip-path='url(%23a)'%3e%3cpath%20fill='%23d1f019'%20stroke='%23d1f019'%20stroke-width='10.667'%20d='M510.5%201015.67c278.995%200%20505.17-226.175%20505.17-505.17S789.495%205.334%20510.5%205.334%205.334%20231.504%205.334%20510.5s226.17%20505.17%20505.166%20505.17Z'/%3e%3cpath%20fill='%23292929'%20d='M430.37%20100v38.474l-1.365%201.012c-93.091%2019.673-176.275%2075.89-230.539%20153.497-86.596%20123.87-90.95%20288.992-10.778%20417.239%2053.723%2085.914%20141.637%20148.767%20241.317%20169.687l1.365%201.035v38.475c-104.221-19.249-198.607-80.738-260.142-166.322C62.335%20603.036%2066.336%20398.122%20180.441%20252.744c61.676-78.549%20151.19-134.483%20249.953-152.72zm159.499%20819.393v-39.651c98.504-20.402%20186.465-82.831%20239.999-167.427%2085.232-134.743%2076.949-309.371-20.99-434.983-54.146-69.441-132.318-119.399-218.844-137.801l-.141-39.51c105.445%2020.685%20200.301%2082.549%20261.718%20170.299%20101.987%20145.661%20100.339%20340.479-3.976%20484.375-61.559%2084.902-154.533%20144.414-257.766%20164.745z'/%3e%3cg%20filter='url(%23b)'%3e%3cpath%20fill='%23292929'%20d='M540.424%20481.574c62.733%2011.501%20118.146%2030.32%20117.623%20104.031-.523%2060.641-44.435%20104.031-113.963%20113.441v54.89H479.26v-55.413c-71.619-11.501-115.009-56.459-115.531-120.76l76.847%201.046c2.613%2035.548%2030.843%2060.118%2075.801%2060.118%2036.071%200%2062.732-15.683%2062.732-44.435%200-30.843-29.798-37.117-90.962-49.14-61.686-11.501-116.054-31.366-116.054-105.6%200-56.981%2041.299-99.326%20107.167-108.735v-55.414h64.824v55.936c65.346%2010.979%20105.599%2052.277%20106.644%20112.396h-76.847c-3.659-30.844-27.183-52.277-65.346-52.277-33.457%200-57.504%2014.114-57.504%2042.344%200%2029.798%2028.752%2036.071%2089.393%2047.572'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h1021v1021H0z'/%3e%3c/clipPath%3e%3cfilter%20id='b'%20width='307.778'%20height='491.789'%20x='357.001'%20y='275.603'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20result='hardAlpha'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset%20dy='6.728'/%3e%3cfeGaussianBlur%20stdDeviation='3.364'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20in2='BackgroundImageFix'%20result='effect1_dropShadow_215_35'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='effect1_dropShadow_215_35'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='301'%20height='301'%20viewBox='0%200%20301%20301'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20150.05C0%2067.1808%2067.1789%200.00195312%20150.048%200.00195312V0.00195312C232.918%200.00195312%20300.096%2067.1808%20300.096%20150.05V150.05C300.096%20232.919%20232.918%20300.098%20150.048%20300.098V300.098C67.1789%20300.098%200%20232.919%200%20150.05V150.05Z'%20fill='%23FC7A4A'/%3e%3cpath%20d='M191.312%20173.807C191.312%20151.925%20178.182%20144.423%20151.924%20141.297C133.168%20138.796%20129.417%20133.795%20129.417%20125.041C129.417%20116.287%20135.669%20110.662%20148.173%20110.662C159.426%20110.662%20165.679%20114.413%20168.804%20123.791C169.43%20125.667%20171.306%20126.917%20173.181%20126.917H183.184C185.685%20126.917%20187.56%20125.041%20187.56%20122.541V121.916C185.059%20108.161%20173.806%2097.5329%20159.426%2096.283V81.2781C159.426%2078.7768%20157.551%2076.9012%20154.425%2076.2755H145.047C142.546%2076.2755%20140.67%2078.1511%20140.045%2081.2781V95.6573C121.289%2098.1586%20109.411%20110.662%20109.411%20126.293C109.411%20146.924%20121.914%20155.051%20148.173%20158.178C165.679%20161.303%20171.306%20165.055%20171.306%20175.058C171.306%20185.062%20162.552%20191.939%20150.674%20191.939C134.418%20191.939%20128.791%20185.06%20126.916%20175.682C126.291%20173.183%20124.416%20171.931%20122.54%20171.931H111.911C109.411%20171.931%20107.535%20173.807%20107.535%20176.308V176.934C110.035%20192.563%20120.039%20203.817%20140.67%20206.944V221.948C140.67%20224.448%20142.546%20226.324%20145.672%20226.949H155.05C157.551%20226.949%20159.426%20225.074%20160.052%20221.948V206.944C178.808%20203.817%20191.312%20190.687%20191.312%20173.807Z'%20fill='white'/%3e%3cpath%20d='M118.163%20239.453C69.3975%20221.948%2044.389%20167.556%2062.5208%20119.414C71.8988%2093.156%2092.5305%2073.15%20118.163%2063.772C120.665%2062.5221%20121.914%2060.6465%20121.914%2057.5195V48.7672C121.914%2046.2659%20120.665%2044.3903%20118.163%2043.7661C117.538%2043.7661%20116.288%2043.7661%20115.662%2044.3903C56.2683%2063.1463%2023.7574%20126.293%2042.5134%20185.686C53.767%20220.697%2080.6511%20247.581%20115.662%20258.835C118.163%20260.085%20120.665%20258.835%20121.289%20256.333C121.914%20255.709%20121.914%20255.083%20121.914%20253.834V245.08C121.914%20243.204%20120.039%20240.704%20118.163%20239.453ZM184.435%2044.3903C181.934%2043.1404%20179.432%2044.3903%20178.808%2046.8916C178.182%2047.5173%20178.182%2048.1415%20178.182%2049.3929V58.1452C178.182%2060.6465%20180.058%2063.1463%20181.934%2064.3977C230.699%2081.9024%20255.708%20136.295%20237.576%20184.436C228.198%20210.695%20207.566%20230.701%20181.934%20240.079C179.432%20241.329%20178.182%20243.204%20178.182%20246.331V255.083C178.182%20257.585%20179.432%20259.46%20181.934%20260.085C182.559%20260.085%20183.809%20260.085%20184.435%20259.46C243.829%20240.704%20276.34%20177.558%20257.584%20118.165C246.33%2082.5281%20218.82%2055.6439%20184.435%2044.3903Z'%20fill='white'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20fill='none'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='%23ba3b48'%20d='M0%2032C0%2014.327%2014.327%200%2032%200s32%2014.327%2032%2032-14.327%2032-32%2032S0%2049.673%200%2032'/%3e%3cpath%20fill='%23fff'%20d='M32.5%2048q-3.052%200-5.182-1.65-2.11-1.651-3.224-4.878Q23%2038.228%2023%2033.52v-.02q0-4.784%201.113-8.01t3.224-4.858Q29.467%2019%2032.5%2019t5.143%201.632q2.13%201.632%203.244%204.858Q42%2028.716%2042%2033.5v.019q0%204.709-1.113%207.953-1.094%203.227-3.224%204.877Q35.55%2048%2032.5%2048m0-2.889q2.053%200%203.397-1.275%201.362-1.276%202.015-3.846.672-2.57.672-6.453v-.075q0-3.901-.672-6.452-.653-2.57-2.015-3.846-1.344-1.275-3.397-1.275t-3.416%201.275q-1.343%201.276-2.015%203.846-.653%202.55-.653%206.452v.075q0%203.884.653%206.453.672%202.57%202.015%203.846%201.362%201.275%203.416%201.275m-6.87-10.354v-2.889h13.74v2.889z'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_ykb1zIozoJBMq4UvQnlhcQ","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23dcc5f7'%20d='M0%2012C0%205.373%205.373%200%2012%200s12%205.373%2012%2012-5.373%2012-12%2012S0%2018.627%200%2012'/%3e%3cpath%20fill='%236800d1'%20d='M10%206H6v4h4z'/%3e%3cpath%20fill='%23000'%20d='M18%2014h-4v4h4z'/%3e%3cpath%20fill='%236800d1'%20d='M18%206h-4l-4%204h8zM6%2014v4h4v-8zm7-1h11v11H13z'/%3e%3cpath%20fill='%23dcc5f7'%20d='m16.13%2021-1.592-5.6h1.296l.952%204.08.976-4.08h1.464l.984%204.072.952-4.072h1.304L20.89%2021h-1.344l-1.04-3.896L17.45%2021z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23390922;%20}%20.cls-2%20{%20fill:%20%23f3e9e3;%20}%20%3c/style%3e%3c/defs%3e%3ccircle%20class='cls-2'%20cx='150'%20cy='150'%20r='150'/%3e%3cpath%20class='cls-1'%20d='M247.63,81.3l-27.62-9.21c-1.58-.53-2.82-1.77-3.34-3.35l-9.21-27.62c-.72-2.16-2.74-3.62-5.02-3.62h-104.88c-2.28,0-4.3,1.46-5.02,3.62l-9.2,27.62c-.53,1.58-1.77,2.82-3.35,3.35l-27.62,9.21c-2.16.72-3.62,2.74-3.62,5.02v127.38c0,2.28,1.46,4.3,3.62,5.02l27.61,9.2c1.58.53,2.82,1.77,3.35,3.34l9.21,27.62c.72,2.16,2.74,3.62,5.02,3.62h104.88c2.28,0,4.3-1.46,5.02-3.62l9.22-27.63c.53-1.58,1.77-2.82,3.35-3.34l27.61-9.2c2.16-.72,3.62-2.74,3.62-5.02v-127.38c0-2.28-1.46-4.3-3.62-5.02Z'/%3e%3cpath%20class='cls-2'%20d='M192.24,160.47c-2.31-4.67-5.74-8.66-10.3-11.95-4.56-3.29-10.3-6.2-17.23-8.74l-17.14-6.06c-6-1.96-10.59-4.56-13.76-7.79-3.18-3.23-4.76-7.33-4.76-12.29,0-3.81.95-7.16,2.86-10.04,1.9-2.88,4.59-5.13,8.05-6.75,3.46-1.62,7.33-2.42,11.6-2.42,7.16,0,13.16,2.48,18.01,7.44,4.85,4.96,8.31,11.72,10.39,20.26l1.73.17,10.73-16.97c-2.77-4.27-6.41-7.82-10.91-10.65-4.5-2.83-9.35-4.99-14.54-6.49-4.02-1.16-8-1.87-11.95-2.13v-19.86h-8.66v19.93c-4.35.33-8.42,1.06-12.21,2.23-5.25,1.62-9.81,3.93-13.68,6.93-3.87,3-6.81,6.61-8.83,10.82-2.02,4.21-3.03,8.86-3.03,13.94,0,5.43,1.18,10.24,3.55,14.46,2.36,4.21,5.77,7.85,10.21,10.91,4.44,3.06,10.01,5.92,16.71,8.57l15.58,5.37c6.69,2.31,11.71,5.4,15.06,9.26,3.35,3.87,5.02,8.74,5.02,14.63,0,4.62-1.1,8.6-3.29,11.95-2.19,3.35-5.14,5.95-8.83,7.79-3.7,1.85-7.96,2.77-12.81,2.77s-9.64-1.15-14.02-3.46c-4.39-2.31-8.08-5.86-11.08-10.65-3-4.79-5.37-10.82-7.1-18.09h-1.73l-11.6,17.83c2.54,4.62,6.12,8.66,10.73,12.12,4.61,3.46,9.9,6.12,15.84,7.96,4.94,1.54,10.11,2.42,15.5,2.68v19.83h8.66v-19.94c4.66-.34,9.05-1.14,13.16-2.4,5.65-1.73,10.53-4.27,14.63-7.62,4.1-3.35,7.27-7.33,9.52-11.95,2.25-4.62,3.38-9.75,3.38-15.41,0-6.12-1.16-11.51-3.46-16.19Z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23390922;%20}%20.cls-2%20{%20fill:%20%23f3e9e3;%20}%20%3c/style%3e%3c/defs%3e%3ccircle%20class='cls-1'%20cx='150'%20cy='150'%20r='150'/%3e%3cpath%20class='cls-2'%20d='M247.63,81.3l-27.62-9.21c-1.58-.53-2.82-1.77-3.34-3.35l-9.21-27.62c-.72-2.16-2.74-3.62-5.02-3.62h-104.88c-2.28,0-4.3,1.46-5.02,3.62l-9.2,27.62c-.53,1.58-1.77,2.82-3.35,3.35l-27.62,9.21c-2.16.72-3.62,2.74-3.62,5.02v127.38c0,2.28,1.46,4.3,3.62,5.02l27.61,9.2c1.58.53,2.82,1.77,3.35,3.34l9.21,27.62c.72,2.16,2.74,3.62,5.02,3.62h104.88c2.28,0,4.3-1.46,5.02-3.62l9.22-27.63c.53-1.58,1.77-2.82,3.35-3.34l27.61-9.2c2.16-.72,3.62-2.74,3.62-5.02v-127.38c0-2.28-1.46-4.3-3.62-5.02Z'/%3e%3cpath%20class='cls-1'%20d='M192.24,160.47c-2.31-4.67-5.74-8.66-10.3-11.95-4.56-3.29-10.3-6.2-17.23-8.74l-17.14-6.06c-6-1.96-10.59-4.56-13.76-7.79-3.18-3.23-4.76-7.33-4.76-12.29,0-3.81.95-7.16,2.86-10.04,1.9-2.88,4.59-5.13,8.05-6.75,3.46-1.62,7.33-2.42,11.6-2.42,7.16,0,13.16,2.48,18.01,7.44,4.85,4.96,8.31,11.72,10.39,20.26l1.73.17,10.73-16.97c-2.77-4.27-6.41-7.82-10.91-10.65-4.5-2.83-9.35-4.99-14.54-6.49-4.02-1.16-8-1.87-11.95-2.13v-19.86h-8.66v19.93c-4.35.33-8.42,1.06-12.21,2.23-5.25,1.62-9.81,3.93-13.68,6.93-3.87,3-6.81,6.61-8.83,10.82-2.02,4.21-3.03,8.86-3.03,13.94,0,5.43,1.18,10.24,3.55,14.46,2.36,4.21,5.77,7.85,10.21,10.91,4.44,3.06,10.01,5.92,16.71,8.57l15.58,5.37c6.69,2.31,11.71,5.4,15.06,9.26,3.35,3.87,5.02,8.74,5.02,14.63,0,4.62-1.1,8.6-3.29,11.95-2.19,3.35-5.14,5.95-8.83,7.79-3.7,1.85-7.96,2.77-12.81,2.77s-9.64-1.15-14.02-3.46c-4.39-2.31-8.08-5.86-11.08-10.65-3-4.79-5.37-10.82-7.1-18.09h-1.73l-11.6,17.83c2.54,4.62,6.12,8.66,10.73,12.12,4.61,3.46,9.9,6.12,15.84,7.96,4.94,1.54,10.11,2.42,15.5,2.68v19.83h8.66v-19.94c4.66-.34,9.05-1.14,13.16-2.4,5.65-1.73,10.53-4.27,14.63-7.62,4.1-3.35,7.27-7.33,9.52-11.95,2.25-4.62,3.38-9.75,3.38-15.41,0-6.12-1.16-11.51-3.46-16.19Z'/%3e%3c/svg%3e\"","/**\n * What a key that an app requests may do, its spending limits and expiry, as the approval and device\n * screens show it.\n * @module\n */\nimport { type ReactNode, useId } from 'react'\nimport Info from '~icons/lucide/info'\nimport type * as KeyAuthorization from '../../internal/KeyAuthorization.js'\nimport { style } from '../zyzz.config.js'\nimport { Tooltip } from './Tooltip.js'\n\n/** Each listed token's icon URL, by symbol. */\nconst icons = Object.fromEntries(\n Object.entries(\n import.meta.glob<string>('./icons/*.{png,svg,webp}', {\n eager: true,\n import: 'default',\n query: '?url',\n }),\n ).map(([file, url]) => [\n file.slice('./icons/'.length, file.lastIndexOf('.')),\n url,\n ]),\n)\n\n/**\n * Logos in `logos/`, as `<symbol>.light.svg` and `<symbol>.dark.svg`, by symbol and the color\n * scheme each one stands out on. They take the place of an icon.\n */\nconst logos = Object.entries(\n import.meta.glob<string>('./logos/*.{light,dark}.{png,svg,webp}', {\n eager: true,\n import: 'default',\n query: '?url',\n }),\n).reduce<Record<string, { dark?: string; light?: string }>>(\n (result, [file, url]) => {\n const [, symbol, scheme] = file.match(\n /^\\.\\/logos\\/(.+)\\.(light|dark)\\.\\w+$/,\n )!\n result[symbol!] = { ...result[symbol!], [scheme!]: url }\n return result\n },\n {},\n)\n\n/** What the key that an app requests may do: its limits and expiry. */\nexport function Grant(props: Grant.Props): ReactNode {\n // Several grants can share a document, so each derives its own ID.\n const id = useId()\n const { expiry, limits } = props.keyAuthorization\n const Heading = props.heading ?? 'h2'\n // A one-time limit states this beside periodic ones, which would otherwise read the same.\n const periodic = limits.some((limit) => limit.period)\n return (\n <section {...styles.section()} aria-labelledby={id}>\n <Heading {...styles.heading()} id={id}>\n This app can spend up to\n </Heading>\n <ul {...styles.list()}>\n {limits.map((limit) => (\n <li\n {...styles.limit()}\n key={`${limit.currency}:${limit.period ?? 0}`}\n >\n <span>\n {(() => {\n if (limit.period)\n return `${format(limit)} ${every(limit.period)}`\n if (periodic) return `${format(limit)} in total`\n return format(limit)\n })()}\n </span>\n <span {...styles.icons()}>\n {limit.tokens.map((token) => {\n // Each token's own limit shows on its icon, since the total spans several.\n const label = `${token.symbol}: ${format({ amount: token.amount, currency: limit.currency })}`\n const logo = logos[token.symbol]\n const icon = logo?.light ?? icons[token.symbol]\n return (\n <Tooltip key={token.symbol} label={label}>\n <span {...styles.token()} tabIndex={0}>\n {icon ? (\n // The page follows the system color scheme, so the image does too.\n <picture>\n {logo?.dark ? (\n <source\n media=\"(prefers-color-scheme: dark)\"\n srcSet={logo.dark}\n />\n ) : null}\n <img\n {...styles.icon()}\n alt={label}\n height={20}\n src={icon}\n width={20}\n />\n </picture>\n ) : (\n // A token without a logo shows its initial.\n <span\n {...styles.placeholder()}\n aria-label={label}\n role=\"img\"\n >\n {token.symbol[0]}\n </span>\n )}\n </span>\n </Tooltip>\n )\n })}\n </span>\n </li>\n ))}\n </ul>\n <dl {...styles.details()}>\n <div>\n <dt {...styles.term()}>Expires</dt>{' '}\n <dd {...styles.value()}>\n {until(expiry)}{' '}\n {/* The tooltip's text never reaches the server render, so it shows the visitor's own time zone. */}\n <Tooltip\n label={new Date(expiry * 1000).toLocaleString(undefined, {\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n month: 'short',\n timeZoneName: 'short',\n year: 'numeric',\n })}\n >\n <Info\n {...styles.info()}\n aria-label=\"Expiry date\"\n role=\"img\"\n tabIndex={0}\n />\n </Tooltip>\n </dd>\n </div>\n </dl>\n </section>\n )\n}\n\nexport declare namespace Grant {\n type Props = {\n /** The level of the section's heading, one below the screen's title: `h2` by default, or `h5` on the flows canvas. */\n heading?: 'h2' | 'h5' | undefined\n /** The key that the app requests. */\n keyAuthorization: KeyAuthorization.Description\n }\n}\n\n/** Groups thousands and keeps every decimal the amount has. */\nconst decimal = new Intl.NumberFormat('en-US', { maximumFractionDigits: 20 })\n\n/** The expiry's distance from now, such as `in 7 days`. */\nconst relative = new Intl.RelativeTimeFormat('en-US', { numeric: 'always' })\n\n/** Spans an expiry reads in, largest first. Months and years are approximate. */\nconst spans = [\n ['year', 31_536_000],\n ['month', 2_592_000],\n ['week', 604_800],\n ['day', 86_400],\n ['hour', 3_600],\n ['minute', 60],\n] as const\n\n/** Units a period reads in, largest first. */\nconst units = [\n ['week', 604_800],\n ['day', 86_400],\n ['hour', 3_600],\n ['minute', 60],\n ['second', 1],\n] as const\n\n/** How often a limit resets, such as `per day` or `every 2 weeks`. */\nfunction every(period: number) {\n const [unit, seconds] = units.find((entry) => period % entry[1] === 0)!\n const count = period / seconds\n return count === 1 ? `per ${unit}` : `every ${count} ${unit}s`\n}\n\n/** A limit in its currency's format, such as `$1,000`, or with its code when Intl has no currency for it. */\nfunction format(\n limit: Pick<\n KeyAuthorization.Description['limits'][number],\n 'amount' | 'currency'\n >,\n) {\n const amount = limit.amount as Intl.StringNumericLiteral\n try {\n return new Intl.NumberFormat('en-US', {\n currency: limit.currency,\n maximumFractionDigits: 6,\n style: 'currency',\n trailingZeroDisplay: 'stripIfInteger',\n }).format(amount)\n } catch {\n // A yield-bearing token's own symbol is not a currency code.\n return `${decimal.format(amount)} ${limit.currency}`\n }\n}\n\n/**\n * How long until `expiry`, in Unix seconds, in its largest whole span, such as `in 3 months`. A\n * span counts from a minute short of it, so a key that lasts a year reads `in 1 year` while the\n * page loads.\n */\nfunction until(expiry: number) {\n const remaining = expiry - Date.now() / 1000\n const [unit, seconds] =\n spans.find((entry) => remaining + 60 >= entry[1]) ?? spans.at(-1)!\n return relative.format(Math.max(1, Math.round(remaining / seconds)), unit)\n}\n\nnamespace styles {\n // Each term and its value read as one line of text.\n export const details = style({\n display: 'grid',\n gap: 2,\n margin: 0,\n typography: 'copy.14',\n })\n\n export const heading = style({\n color: 'gray.900',\n margin: 0,\n typography: 'copy.14',\n })\n\n export const icon = style({\n borderRadius: 'full',\n display: 'block',\n height: 5,\n width: 5,\n })\n\n // Several tokens overlap, and spread apart while hovered so each symbol can show.\n export const icons = style({\n display: 'flex',\n flexShrink: 0,\n '& > span + span': { marginInlineStart: 'overlap' },\n '&:hover > span + span': { marginInlineStart: 1 },\n })\n\n export const info = style({\n color: 'gray.900',\n display: 'inline',\n height: 4,\n outline: 'none',\n verticalAlign: 'middle',\n width: 4,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const limit = style({\n alignItems: 'center',\n display: 'flex',\n gap: 2,\n })\n\n export const list = style({\n display: 'grid',\n gap: 2,\n listStyle: 'none',\n margin: 0,\n padding: 0,\n typography: 'copy.16.strong',\n })\n\n export const placeholder = style({\n alignItems: 'center',\n backgroundColor: 'background.surface',\n borderRadius: 'full',\n color: 'gray.900',\n display: 'flex',\n height: 5,\n justifyContent: 'center',\n typography: 'label.12',\n width: 5,\n })\n\n export const section = style({\n backgroundColor: 'gray.100',\n borderRadius: '2xl',\n display: 'grid',\n gap: 3,\n margin: 0,\n padding: 5,\n })\n\n export const term = style({ color: 'gray.900', display: 'inline' })\n\n // The ring matches the section's fill, so overlapping tokens stay apart.\n export const token = style({\n borderRadius: 'full',\n outline: '2px solid',\n outlineColor: 'gray.100',\n ':focus-visible': { outlineColor: 'blue.700' },\n // Under reduced motion, the tokens spread apart without a transition.\n '@media (prefers-reduced-motion: no-preference)': {\n transitionDuration: '150ms',\n transitionProperty: 'margin',\n transitionTimingFunction: 'in-out',\n },\n })\n\n export const value = style({\n display: 'inline',\n margin: 0,\n overflowWrap: 'anywhere',\n })\n}\n","/**\n * The approval screen for an app's authorization request, with the key that it requests, and the\n * screen for a request that the approval page cannot show. The layout follows the\n * approval screen of the WorkOS implementation.\n * @module\n */\nimport type { ReactNode } from 'react'\nimport BadgeCheck from '~icons/lucide/badge-check'\nimport Globe from '~icons/lucide/globe'\nimport type * as KeyAuthorization from '../../internal/KeyAuthorization.js'\nimport { Button } from '../components/Button.js'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport { Grant } from '../components/Grant.js'\nimport { Tooltip } from '../components/Tooltip.js'\nimport { style } from '../zyzz.config.js'\n\n/**\n * The approval screen. It names the app, shows the key that the app requests and any message that\n * the key signs, and approves or denies the request. A key that\n * approval cannot sign holds the approval, and the screen states why.\n */\nexport function Approval(props: Approval.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n const pending = props.approving || props.denying\n const refusal = props.refusal ?? props.keyAuthorization?.refusal\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n {/* Apps have no logos, so every app shows a globe in their place. */}\n <span {...styles.avatar()}>\n <Globe {...styles.avatarIcon()} aria-hidden />\n </span>\n <Title {...styles.title()}>Authorize this app</Title>\n <p {...styles.description()}>\n Approve to let{' '}\n <span {...styles.app()}>\n <strong>{props.app}</strong>{' '}\n <Tooltip label=\"Verified app\">\n <BadgeCheck\n {...styles.badge()}\n aria-label=\"Verified\"\n role=\"img\"\n tabIndex={0}\n />\n </Tooltip>\n </span>{' '}\n use your Tempo Account.\n </p>\n </header>\n\n <div {...styles.stack()}>\n {props.keyAuthorization ? (\n <Grant\n heading={props.heading === 'h4' ? 'h5' : 'h2'}\n keyAuthorization={props.keyAuthorization}\n />\n ) : null}\n {props.keyAuthorization?.challenge ? (\n <div {...styles.challenge()} role=\"note\">\n <p {...styles.challengeTitle()}>\n This sign-in also signs a message\n </p>\n <p {...styles.challengeText()}>\n Approve only if you started this sign-in and expect this message.\n </p>\n <pre {...styles.message()}>{props.keyAuthorization.challenge}</pre>\n </div>\n ) : null}\n <Button\n disabled={props.denying || Boolean(refusal)}\n loading={props.approving}\n onClick={props.onApprove}\n >\n Approve\n </Button>\n <Button\n disabled={props.approving}\n loading={props.denying}\n onClick={props.onDeny}\n variant=\"tertiary\"\n >\n Deny\n </Button>\n <p {...styles.note()}>\n Signed in as <strong>{props.email}</strong>. Either choice returns you\n to <strong>{props.destination}</strong>.\n </p>\n <p {...styles.status()} aria-live=\"polite\" role=\"status\">\n {pending ? `Returning to ${props.destination}.` : undefined}\n </p>\n </div>\n {/* A failed decision outranks the refusal, whose only action is the denial that failed. */}\n <ErrorMessage>\n {props.error ?? (refusal ? refusals[refusal] : undefined)}\n </ErrorMessage>\n </div>\n )\n}\n\nexport declare namespace Approval {\n type Props = {\n /** The app's display name. */\n app: string\n /** Whether the approval is in progress, which holds both buttons. */\n approving: boolean\n /** Whether the denial is in progress, which holds both buttons. */\n denying: boolean\n /** The host of the app's redirect URI, or its scheme for a native app. */\n destination: string\n /** The signed-in user's address. */\n email: string\n /** Why the decision failed. */\n error?: string | undefined\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** The key that the app requests, if any. */\n keyAuthorization?: Key | undefined\n /** Approves the request. */\n onApprove: () => void\n /** Denies the request, which returns the browser to the app with `access_denied`. */\n onDeny: () => void\n /**\n * Why approval cannot sign the key, which holds the approval. Takes the place of the key's own\n * `refusal`, such as after an approval that the API refused.\n */\n refusal?: Refusal | undefined\n }\n\n /** A key that the app requests, as the approval page shows it. */\n type Key = KeyAuthorization.Description & {\n /** The message that the key's witness binds, such as a sign-in challenge from the app. */\n challenge?: string | undefined\n /** Why approval cannot sign the key. Absent when it can. */\n refusal?: Refusal | undefined\n }\n\n /**\n * Why approval cannot sign a key: a passkey that the page cannot use owns the account, the user\n * holds no account, or the user's accounts could not be read.\n */\n type Refusal = 'no_account' | 'passkey' | 'unavailable'\n}\n\n/** The screen for an authorization request that the approval page cannot show, with the reason. */\nexport function InvalidRequest(props: InvalidRequest.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n <Title {...styles.title()}>This sign-in request is invalid</Title>\n <p {...styles.description()}>\n The app sent a request Tempo ID cannot complete. Return to the app and\n try again.\n </p>\n </header>\n </div>\n )\n}\n\nexport declare namespace InvalidRequest {\n type Props = {\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n }\n}\n\n/** Why approval cannot sign a key, as the screen states it. */\nconst refusals: Record<Approval.Refusal, string> = {\n no_account:\n 'You have no Tempo Account for this app yet, so no account can approve the key. Deny the request, create an account in the app, and try again.',\n passkey:\n 'This Tempo Account signs with a passkey that this page cannot use. Deny the request, and return to the app.',\n unavailable:\n 'Tempo ID cannot read your Tempo Account right now. Reload the page in a minute, or deny the request.',\n}\n\nnamespace styles {\n // The app's name and badge wrap as one word, so a hyphenated name never splits.\n export const app = style({ whiteSpace: 'nowrap' })\n\n export const avatar = style({\n alignItems: 'center',\n backgroundColor: 'background.surface',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: 'full',\n boxShadow: 'sm',\n color: 'gray.900',\n display: 'flex',\n height: 14,\n justifyContent: 'center',\n marginBottom: 3,\n width: 14,\n })\n\n export const avatarIcon = style({ height: 6, width: 6 })\n\n export const badge = style({\n display: 'inline',\n height: 4,\n outline: 'none',\n verticalAlign: 'middle',\n width: 4,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const challenge = style({\n backgroundColor: 'amber.100',\n borderRadius: '2xl',\n display: 'grid',\n gap: 2,\n padding: 4,\n })\n\n export const challengeText = style({\n color: 'foreground',\n typography: 'copy.14',\n })\n\n export const challengeTitle = style({\n color: 'amber.900',\n typography: 'label.14',\n })\n\n export const column = style({\n display: 'grid',\n gap: 8,\n maxWidth: 'sm',\n width: 'full',\n })\n\n export const description = style({\n color: 'gray.900',\n textWrap: 'balance',\n typography: 'copy.16',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const header = style({\n display: 'grid',\n gap: 2,\n justifyItems: 'center',\n textAlign: 'center',\n })\n\n export const message = style({\n margin: 0,\n overflowWrap: 'anywhere',\n typography: 'copy.13.mono',\n whiteSpace: 'pre-wrap',\n })\n\n export const note = style({\n color: 'gray.900',\n textAlign: 'center',\n typography: 'copy.14',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const stack = style({ display: 'grid', gap: 4 })\n\n export const status = style({\n color: 'gray.900',\n textAlign: 'center',\n typography: 'copy.14',\n })\n\n export const title = style({\n textWrap: 'balance',\n typography: 'heading.24',\n })\n}\n","/**\n * The approval page: the signed-in user approves or denies an app's authorization request, and the\n * browser returns to the app's redirect. A passkey-owned account signs the key with its passkey in\n * this browser, which takes a second request.\n * @module\n */\nimport { useMutation } from '@tanstack/react-query'\nimport { createFileRoute } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport { Authentication } from 'webauthx/client'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { Approval, InvalidRequest } from '../screens/Approval.js'\nimport { style } from '../zyzz.config.js'\n\n/** Wraps a failure of the browser's passkey ceremony, which reaches no API. */\nclass CeremonyError extends Error {\n override name = 'Page.CeremonyError'\n}\n\nexport const Route = createFileRoute('/authorize')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Sends an app's request without Better Auth's signature to `/oauth2/authorize`, which takes the\n * same query and returns the browser here signed. The request gains `response_type=code` and\n * `code_challenge_method=S256` when it names neither, since `/oauth2/authorize` requires both.\n * Sends a visitor without a session to sign-in, with the query unchanged, so the sign-in\n * continues the request. Otherwise returns the request that `GET /v1/authorize/request` reads,\n * and redirects a key that Tempo ID refuses to the app with the refusal.\n */\n loader: async (match): Promise<Page.Props> => {\n const { searchStr } = match.location\n // Better Auth reads the query with `URLSearchParams`, so the page reads it the same way, and a\n // malformed escape cannot show one request and approve another.\n const query = new URLSearchParams(searchStr)\n if (!query.get('sig')) {\n const forwarded = new URLSearchParams(query)\n if (!forwarded.has('code_challenge_method'))\n forwarded.set('code_challenge_method', 'S256')\n if (!forwarded.has('response_type'))\n forwarded.set('response_type', 'code')\n Loader.redirect({\n document: true,\n href: `/oauth2/authorize?${forwarded}`,\n })\n }\n\n const client = Client.create()\n const result = await (async () => {\n try {\n return await parseResponse(\n client.v1.authorize.request.$get({\n query: { oauth_query: query.toString() },\n }),\n )\n } catch (error) {\n if (Client.reason(error) === 'session_required')\n Loader.redirect({ href: `/login${searchStr}` })\n throw error\n }\n })()\n if ('redirect' in result)\n Loader.redirect({ document: true, href: result.redirect })\n return { request: result.request }\n },\n // The loader reads the whole query, so a change to any parameter loads the page again.\n loaderDeps: (match) => ({ search: match.search }),\n})\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const consent = useMutation({\n async mutationFn(variables: { accept: boolean }) {\n const json = {\n accept: variables.accept,\n // Approval signs for the account that the page shows.\n ...(props.request?.key?.account\n ? { account: props.request.key.account }\n : {}),\n oauth_query: window.location.search.slice(1),\n session_id: props.request?.session ?? '',\n }\n const decided = await parseResponse(\n client.v1.authorize.consent.$post({ json }),\n )\n if (!('step' in decided)) return decided\n\n // The passkey signs the key authorization's digest, which the step's options carry.\n const assertion = await Authentication.sign({\n options: { publicKey: decided.step.options.publicKey },\n }).catch((error: unknown) => {\n throw new CeremonyError('Passkey ceremony failed.', { cause: error })\n })\n const signed = await parseResponse(\n client.v1.authorize.consent.$post({\n json: { ...json, passkey: { assertion } },\n }),\n )\n if ('step' in signed)\n throw new Error('The approval requested a second passkey step.')\n return signed\n },\n // Without a session, the page's loader sends the browser to sign-in, which continues the request.\n onError: (error) => {\n if (Client.reason(error) === 'session_required') window.location.reload()\n },\n onSuccess: (data) => window.location.assign(data.redirect),\n })\n // The decision holds both buttons until the browser leaves, after the request succeeds too.\n const decided = consent.isPending || consent.isSuccess\n\n return (\n <main {...styles.page()}>\n {props.request ? (\n <Approval\n app={props.request.app}\n approving={decided && consent.variables.accept}\n denying={decided && !consent.variables.accept}\n destination={props.request.destination}\n email={props.request.email}\n error={\n consent.error &&\n Client.reason(consent.error) !== 'webauthn_required'\n ? message(consent.error)\n : undefined\n }\n keyAuthorization={props.request.key}\n onApprove={() => consent.mutate({ accept: true })}\n onDeny={() => consent.mutate({ accept: false })}\n // The API's refusal names the other flows, and the screen states the step here instead.\n refusal={\n Client.reason(consent.error) === 'webauthn_required'\n ? 'passkey'\n : undefined\n }\n />\n ) : (\n <InvalidRequest />\n )}\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /**\n * The request that the page shows, or `null` for a forged or expired query or a request without\n * a known app.\n */\n request: {\n /** The app's display name. */\n app: string\n /** The host of the app's redirect URI, or its scheme for a native app. */\n destination: string\n /** The signed-in user's address. */\n email: string\n /** The key authorization that the request carries, if any. */\n key?: Approval.Key | undefined\n /** The ID of the signed-in session, which the decision names. */\n session: string\n } | null\n }\n}\n\n/**\n * Returns the message to show for `error`. A ceremony that the user cancels, or that times out,\n * fails with a `NotAllowedError` from the browser, which the passkey library wraps in its own error.\n * A refused assertion takes a new passkey step, which the next approval starts.\n */\nfunction message(error: unknown) {\n if (Client.reason(error) === 'webauthn_rejected')\n return 'Your passkey did not sign the approval. Approve again, or deny the request.'\n if (!(error instanceof CeremonyError)) return Client.message(error)\n if (names(error).includes('NotAllowedError'))\n return 'The passkey request was canceled. Approve again, or deny the request.'\n return 'Your passkey did not sign the approval. Approve again, or deny the request.'\n}\n\n/** Returns the names of `error` and of each error in its chain of causes. */\nfunction names(error: unknown): readonly string[] {\n if (!(error instanceof Error)) return []\n return [error.name, ...names(error.cause)]\n}\n\nnamespace styles {\n export const page = style({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","/**\n * The account step: a user with more than one Tempo Account in an app's realms chooses the one the\n * app uses.\n * @module\n */\nimport type { ReactNode } from 'react'\nimport ChevronRight from '~icons/lucide/chevron-right'\nimport Cloud from '~icons/lucide/cloud'\nimport Fingerprint from '~icons/lucide/fingerprint'\nimport Spinner from '~icons/lucide/loader-circle'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport { style } from '../zyzz.config.js'\n\n/**\n * The account step. Each account is a row that chooses it, with its owner, its balance, and its\n * named realm when the accounts span several realms.\n */\nexport function ChooseAccount(props: ChooseAccount.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n const pending = props.selecting !== undefined\n // A row names its realm only when the accounts span several realms, and never the `default` realm.\n const realms = new Set(props.accounts.map((account) => account.realm))\n\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n <Title {...styles.title()}>Choose a wallet</Title>\n <p {...styles.description()}>\n <strong>{props.app}</strong> uses the account you choose. You can\n choose again after you sign out.\n </p>\n </header>\n\n <ul {...styles.accounts()} aria-label=\"Accounts\">\n {props.accounts.map((account) => (\n <li key={account.address}>\n <button\n {...styles.choice()}\n aria-busy={props.selecting === account.address || undefined}\n disabled={pending}\n onClick={() => props.onChoose(account.address)}\n type=\"button\"\n >\n <span {...styles.tile()} aria-hidden>\n {account.owner === 'webAuthn' ? (\n <Fingerprint {...styles.icon()} />\n ) : (\n <Cloud {...styles.icon()} />\n )}\n </span>\n <span {...styles.text()}>\n <span {...styles.kind()}>\n {realms.size > 1 && account.realm\n ? `${account.realm} · `\n : null}\n {account.owner === 'webAuthn' ? 'Passkey' : 'Cloud'}\n </span>\n <span {...styles.address()}>\n {`${account.address.slice(0, 6)}…${account.address.slice(-4)}`}\n </span>\n </span>\n <span {...styles.balance()} data-testid=\"balance\">\n {format(account.balance)}\n </span>\n {props.selecting === account.address ? (\n <Spinner {...styles.spinner()} aria-hidden />\n ) : (\n <ChevronRight {...styles.chevron()} aria-hidden />\n )}\n </button>\n </li>\n ))}\n </ul>\n\n <ErrorMessage align=\"center\">{props.error}</ErrorMessage>\n <p {...styles.status()} aria-live=\"polite\" role=\"status\">\n {pending ? `Continuing to ${props.app}.` : undefined}\n </p>\n </div>\n )\n}\n\nexport declare namespace ChooseAccount {\n type Props = {\n /** The accounts to choose from, oldest first. */\n accounts: readonly Account[]\n /** The app's display name. */\n app: string\n /** Why the selection failed. */\n error?: string | undefined\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** Chooses the account at `address`. */\n onChoose: (address: `0x${string}`) => void\n /** The address of the choice in progress, which holds every row. */\n selecting?: `0x${string}` | undefined\n }\n\n /** One account, as its row shows it. */\n type Account = {\n /** The account's address. */\n address: `0x${string}`\n /** The account's balance on the chain of the request's key, or `null` when it failed to load. */\n balance: Balance | null\n /**\n * Who holds the owner key: a Privy wallet (`privy`), a key that Tempo ID holds in development\n * (`secp256k1`), or a passkey (`webAuthn`).\n */\n owner: 'privy' | 'secp256k1' | 'webAuthn'\n /** The display name of the account's realm, such as `Tempo Cash`, or `null` for the `default` realm. */\n realm: string | null\n }\n\n /** A balance in one currency. */\n type Balance = {\n /** The amount, as a decimal string, such as `12.5`. */\n amount: string\n /** The ISO 4217 currency code, such as `USD`. */\n currency: string\n }\n}\n\n/**\n * Formats a balance in its currency, or names its failed state. The locale is fixed, so the server\n * and the browser render the same text.\n */\nfunction format(balance: ChooseAccount.Account['balance']) {\n if (!balance) return 'Unavailable'\n return new Intl.NumberFormat('en-US', {\n currency: balance.currency,\n style: 'currency',\n // A decimal string keeps every digit, which a `Number` would round.\n }).format(balance.amount as Intl.StringNumericLiteral)\n}\n\nnamespace styles {\n export const accounts = style({\n display: 'grid',\n gap: 2,\n listStyle: 'none',\n margin: 0,\n padding: 0,\n })\n\n export const address = style({\n color: 'gray.900',\n typography: 'copy.13.mono',\n })\n\n export const balance = style({\n flexShrink: 0,\n fontVariantNumeric: 'tabular-nums',\n typography: 'label.14',\n })\n\n export const chevron = style({ color: 'gray.700', height: 5, width: 5 })\n\n // A row that fills while hovered, with a visible focus ring.\n export const choice = style({\n alignItems: 'center',\n backgroundColor: 'transparent',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: '2xl',\n color: 'foreground',\n cursor: 'pointer',\n display: 'flex',\n gap: 3,\n outline: 'none',\n paddingBlock: 3,\n paddingInline: 4,\n textAlign: 'left',\n transitionDuration: '150ms',\n transitionProperty: 'background-color',\n transitionTimingFunction: 'in-out',\n width: 'full',\n ':disabled': { cursor: 'not-allowed' },\n ':hover:not(:disabled)': { backgroundColor: 'gray.100' },\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const column = style({\n display: 'grid',\n gap: 8,\n maxWidth: 'sm',\n width: 'full',\n })\n\n export const description = style({\n color: 'gray.900',\n textWrap: 'balance',\n typography: 'copy.16',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const header = style({\n display: 'grid',\n gap: 2,\n textAlign: 'center',\n })\n\n export const icon = style({ height: 5, width: 5 })\n\n export const kind = style({ typography: 'label.14' })\n\n export const spinner = style({\n color: 'gray.700',\n height: 5,\n width: 5,\n '@media (prefers-reduced-motion: no-preference)': { animation: 'spin' },\n })\n\n export const status = style({\n color: 'gray.900',\n textAlign: 'center',\n typography: 'copy.14',\n })\n\n export const text = style({ display: 'grid', flex: 1, gap: 1 })\n\n export const tile = style({\n alignItems: 'center',\n backgroundColor: 'gray.100',\n borderRadius: 'full',\n display: 'flex',\n flexShrink: 0,\n height: 10,\n justifyContent: 'center',\n width: 10,\n })\n\n export const title = style({\n textWrap: 'balance',\n typography: 'heading.24',\n })\n}\n","/**\n * The account step: the signed-in user chooses the Tempo Account that an app uses, and the app's\n * authorization continues.\n * @module\n */\nimport { useMutation } from '@tanstack/react-query'\nimport { createFileRoute } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { InvalidRequest } from '../screens/Approval.js'\nimport { ChooseAccount } from '../screens/ChooseAccount.js'\nimport { style } from '../zyzz.config.js'\n\nexport const Route = createFileRoute('/choose-account')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Sends a request without Better Auth's signature to `/oauth2/authorize`, and a visitor without a\n * session to sign-in, each with the query unchanged. Otherwise returns the account step that\n * `GET /v1/authorize/accounts` reads, or the refusal's message, such as for a spent account limit.\n */\n loader: async (match): Promise<Page.Props> => {\n const { searchStr } = match.location\n const query = new URLSearchParams(searchStr)\n if (!query.get('sig'))\n Loader.redirect({ document: true, href: `/oauth2/authorize${searchStr}` })\n\n const client = Client.create()\n try {\n const found = await parseResponse(\n client.v1.authorize.accounts.$get({\n query: { oauth_query: query.toString() },\n }),\n )\n return { error: null, request: found.request }\n } catch (error) {\n if (Client.reason(error) === 'session_required')\n Loader.redirect({ href: `/login${searchStr}` })\n return { error: Client.message(error), request: null }\n }\n },\n // The loader reads the whole query, so a change to any parameter loads the page again.\n loaderDeps: (match) => ({ search: match.search }),\n})\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const select = useMutation({\n mutationFn: (variables: { account: `0x${string}` }) =>\n parseResponse(\n client.v1.authorize.account.$post({\n json: {\n account: variables.account,\n oauth_query: window.location.search.slice(1),\n },\n }),\n ),\n onSuccess: (data) => window.location.assign(data.redirect),\n })\n // The choice holds every row until the browser leaves, after the request succeeds too.\n const selecting =\n select.isPending || select.isSuccess ? select.variables.account : undefined\n\n return (\n <main {...styles.page()}>\n {(() => {\n if (props.error)\n return <ErrorMessage align=\"center\">{props.error}</ErrorMessage>\n if (!props.request) return <InvalidRequest />\n return (\n <ChooseAccount\n accounts={props.request.accounts}\n app={props.request.app}\n error={select.error ? Client.message(select.error) : undefined}\n onChoose={(account) => select.mutate({ account })}\n selecting={selecting}\n />\n )\n })()}\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** Why the step failed to load, such as a spent account limit, or `null` when it loaded. */\n error: string | null\n /** The step that the page shows, or `null` for a forged or expired query or a request without a known app. */\n request: {\n /** The user's accounts in the app's realms, oldest first. */\n accounts: ChooseAccount.Props['accounts']\n /** The app's display name. */\n app: string\n } | null\n }\n}\n\nnamespace styles {\n export const page = style({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}","export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}","'use client';\n\n// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nimport { error } from \"./error.mjs\";\n\n// A defined default guarantees a defined value. Otherwise, preserve `undefined`,\n// including when callers pass an explicit generic argument.\n\nexport function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n // Wrap the default so a function value is stored as-is instead of being called as an initializer.\n const [valueState, setValue] = React.useState(() => defaultProp);\n // Keep the initial mode, but use the initial default if a controlled value disappears.\n // This preserves the defined-default overload while the mode-switch warning is emitted below.\n const value = isControlled && controlled !== undefined ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n error([`A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {\n error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [defaultProp]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}\nfunction serializeToDevModeString(input) {\n let nextId = 0;\n const seen = new WeakMap();\n try {\n const result = JSON.stringify(input, function replacer(key, value) {\n if (key === '_owner' && this != null && typeof this === 'object' && '$$typeof' in this) {\n return undefined;\n }\n if (typeof value === 'bigint') {\n return `__bigint__:${value}`;\n }\n if (value !== null && typeof value === 'object') {\n const id = seen.get(value);\n if (id !== undefined) {\n return `__object__:${id}`;\n }\n seen.set(value, nextId);\n nextId += 1;\n }\n return value;\n });\n return result ?? `__top__:${typeof input}`;\n } catch {\n return '__unserializable__';\n }\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectRootContext.displayName = \"SelectRootContext\";\nexport const SelectFloatingContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectFloatingContext.displayName = \"SelectFloatingContext\";\nexport function useSelectRootContext() {\n const store = React.useContext(SelectRootContext);\n if (store === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(60));\n }\n return store;\n}\nexport function useSelectFloatingContext() {\n const context = React.useContext(SelectFloatingContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(61));\n }\n return context;\n}","/**\n * Present when the field is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the field is in a valid state.\n */\nexport const valid = 'data-valid';\n/**\n * Present when the field is in an invalid state.\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the field has been touched.\n */\nexport const touched = 'data-touched';\n/**\n * Present when the field's value has changed.\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the field is filled.\n */\nexport const filled = 'data-filled';\n/**\n * Present when the field control is focused.\n */\nexport const focused = 'data-focused';","import * as FieldControlDataAttributes from \"../../field/control/FieldControlDataAttributes.mjs\";\nexport const DEFAULT_VALIDITY_STATE = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: null,\n valueMissing: false\n};\nexport const DEFAULT_FIELD_STATE_ATTRIBUTES = {\n valid: null,\n touched: false,\n dirty: false,\n filled: false,\n focused: false\n};\nexport const DEFAULT_FIELD_ROOT_STATE = {\n disabled: false,\n ...DEFAULT_FIELD_STATE_ATTRIBUTES\n};\nexport const fieldValidityMapping = {\n valid(value) {\n if (value === null) {\n return null;\n }\n if (value) {\n return {\n [FieldControlDataAttributes.valid]: ''\n };\n }\n return {\n [FieldControlDataAttributes.invalid]: ''\n };\n }\n};","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.mjs\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.mjs\";\nexport const DEFAULT_FIELD_ROOT_CONTEXT = {\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n setTouched: NOOP,\n setDirty: NOOP,\n setFilled: NOOP,\n setFocused: NOOP,\n focusOwnerRef: {\n current: undefined\n },\n validationMode: 'onSubmit',\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n registeredInputs: new Map(),\n registerInput: NOOP,\n getInputControl: () => null,\n commit: async () => {},\n change: NOOP\n }\n};\nexport const FieldRootContext = /*#__PURE__*/React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.mjs\";\nexport function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = useRefWithInit(() => Symbol());\n\n // Re-register without unregistering first: re-registration with the same id updates the\n // form's fields Map entry in place, while a delete + re-add would move the field to the\n // end of the Map every time its value changes.\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!enabled) {\n registerFieldControl(source, undefined);\n return;\n }\n const registration = {\n controlRef,\n getValue: getFormValueOverride,\n id,\n name,\n value\n };\n registerFieldControl(source, registration);\n }, [controlRef, enabled, getFormValueOverride, id, name, registerFieldControl, sourceRef, value]);\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [registerFieldControl, sourceRef]);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n resetControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n enabled = true\n } = params;\n const {\n controlId,\n registerControlId,\n resetControlId\n } = useLabelableContext();\n\n // Deliberately not seeded with `id`: on React 17 the seed would stick around after the\n // `id` prop is removed, leaving the control on a stale id forever.\n const defaultId = useBaseUiId();\n const controlSourceRef = useRefWithInit(() => Symbol());\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(false);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (!enabled || registerControlId === NOOP) {\n unregisterControlId();\n return undefined;\n }\n let nextId;\n if (id !== undefined) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n // An id-less replacement must claim the provider's fallback so a previously registered\n // explicit id is not retained after its control unmounts.\n resetControlId();\n return undefined;\n }\n\n // Either the control never had an explicit `id`, or React 17 has not assigned the\n // fallback id yet. Neither is worth registering.\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);\n\n // Unregistering in the layout phase, not a passive effect: a replacement control's layout\n // effect would otherwise run first and still see the outgoing control's registration.\n useIsoLayoutEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n\n // The provider's id wins until registration runs: the label renders `htmlFor` from the\n // provider's pre-registration state, so preempting it with an explicit `id` here would\n // leave the pair unassociated in server-rendered markup.\n return (enabled ? controlId : undefined) ?? id ?? defaultId;\n}","// https://github.com/mui/mui-x/blob/master/packages/x-internals/src/fastArrayCompare/fastArrayCompare.ts\n\n/**\n * Compares two arrays element-wise.\n *\n * The default comparison is `Object.is`, so `NaN` equals `NaN` and `0` does not equal `-0`.\n */\nexport function areArraysEqual(array1, array2, itemComparer = Object.is) {\n const {\n length\n } = array1;\n if (length !== array2.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!itemComparer(array1[i], array2[i])) {\n return false;\n }\n }\n return true;\n}","import { areArraysEqual } from '@base-ui/utils/areArraysEqual';\n// Compared by identity in `findSelectionIndex`; don't wrap it.\nexport const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function isSelectedValueDirty(currentValue, initialValue, comparer) {\n if (Array.isArray(currentValue) && Array.isArray(initialValue)) {\n return !areArraysEqual(currentValue, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, comparer));\n }\n return currentValue !== initialValue;\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\n\n// The default comparer is `Object.is`, so the values can be indexed instead of rescanned\n// for every item. A custom comparer may match values that don't hash alike.\nfunction createSelectionMatcher(selectedValues, comparer) {\n if (comparer !== defaultItemEquality) {\n return itemValue => selectedValueIncludes(selectedValues, itemValue, comparer);\n }\n const index = new Set(selectedValues);\n index.delete(undefined);\n // `Set` treats +0 and -0 as equal; `Object.is` does not.\n return itemValue => index.has(itemValue) && (itemValue !== 0 || selectedValues.some(v => Object.is(itemValue, v)));\n}\nexport function findSelectionIndex(itemValues, selectedValue, comparer, multiple) {\n // Only treat the value as a list in multiple mode: an array can itself be a valid\n // single-select value.\n const index = multiple && Array.isArray(selectedValue) ?\n // Anchor to the first selected item in rendered order so the index does not depend\n // on the order in which the values were added to the array.\n itemValues.findIndex(createSelectionMatcher(selectedValue, comparer)) : findItemIndex(itemValues, selectedValue, comparer);\n return index === -1 ? null : index;\n}\n\n/** Resolves the first selected index as items register or change. */\nexport function resolveSelectedIndex(index, itemValue, registry, selectedValues, comparer, currentIndex) {\n if (selectedValueIncludes(selectedValues, itemValue, comparer)) {\n // A later item only takes over once the current anchor stops being selected.\n return currentIndex != null && index > currentIndex && selectedValueIncludes(selectedValues, registry[currentIndex], comparer) ? currentIndex : index;\n }\n // The holder re-elects the anchor once it stops being selected.\n return index === currentIndex ? findSelectionIndex(registry, selectedValues, comparer, true) : currentIndex;\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}","export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isGroup(item) {\n return typeof item === 'object' && item != null && Array.isArray(item.items);\n}\nexport function isGroupedItems(items) {\n // A group must carry an actual `items` array: key presence alone would misclassify an item\n // with an unrelated or optional `items` field.\n return isGroup(items?.[0]);\n}\nexport function flattenLeafItems(items) {\n return isGroupedItems(items) ? items.flatMap(group => group.items) : items;\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n const label = Object.hasOwn(items, value) ? items[value] : undefined;\n return label ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = flattenLeafItems(arrayItems);\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}","import { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel, stringifyAsValue } from \"../internals/resolveValueLabel.mjs\";\n\n/**\n * Non-reactive values shared with the select parts. Nothing here is observable through\n * `selectors`, so writing to a ref never notifies subscribers.\n */\n\nexport const selectors = {\n id: state => state.id,\n labelId: state => state.labelId,\n modal: state => state.modal,\n multiple: state => state.multiple,\n disabled: state => state.disabled,\n readOnly: state => state.readOnly,\n required: state => state.required,\n highlightItemOnHover: state => state.highlightItemOnHover,\n items: state => state.items,\n itemToStringLabel: state => state.itemToStringLabel,\n isItemEqualToValue: state => state.isItemEqualToValue,\n value: state => state.value,\n hasSelectedValue: state => {\n const {\n value,\n multiple,\n itemToStringValue\n } = state;\n if (value == null) {\n return false;\n }\n if (multiple && Array.isArray(value)) {\n return value.length > 0;\n }\n return stringifyAsValue(value, itemToStringValue) !== '';\n },\n hasNullItemLabel: (state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n },\n open: state => state.open,\n mounted: state => state.mounted,\n forceMount: state => state.forceMount,\n transitionStatus: state => state.transitionStatus,\n openMethod: state => state.openMethod,\n activeIndex: state => state.activeIndex,\n selectedIndex: state => state.selectedIndex,\n isActive: (state, index) => state.activeIndex === index,\n isSelected: (state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const storeValue = state.value;\n if (state.multiple) {\n return Array.isArray(storeValue) && storeValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n\n // The value is the source of truth: a stale `selectedIndex` (e.g. the controlled\n // value changes while the popup is open, where the index sync is deferred) must not\n // keep a previously selected item marked as selected.\n return compareItemEquality(itemValue, storeValue, comparer);\n },\n isSelectedByFocus: (state, index) => {\n return state.selectedIndex === index;\n },\n popupProps: state => state.popupProps,\n triggerProps: state => state.triggerProps,\n itemRoot: state => state.itemRoot,\n triggerElement: state => state.triggerElement,\n positionerElement: state => state.positionerElement,\n listElement: state => state.listElement,\n popupSide: state => state.popupSide,\n scrollUpArrowVisible: state => state.scrollUpArrowVisible,\n scrollDownArrowVisible: state => state.scrollDownArrowVisible,\n hasScrollArrows: state => state.hasScrollArrows\n};","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n elementRef: {\n current: null\n },\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitCountRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nexport function useValueChanged(value, onChange) {\n const valueRef = React.useRef(value);\n const onChangeCallback = useStableCallback(onChange);\n useIsoLayoutEffect(() => {\n if (valueRef.current !== value) {\n onChangeCallback(valueRef.current);\n }\n valueRef.current = value;\n }, [value, onChangeCallback]);\n}","'use client';\n\nimport * as React from 'react';\n/**\n * Provides a cross-browser way to determine the type of the pointer used to click.\n * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.\n * Additionally, this implementation detects if the click was triggered by the keyboard.\n *\n * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.\n */\nexport function useEnhancedClickHandler(handler) {\n const lastClickInteractionTypeRef = React.useRef('');\n const handlePointerDown = React.useCallback(event => {\n if (event.defaultPrevented) {\n return;\n }\n lastClickInteractionTypeRef.current = event.pointerType;\n handler(event, event.pointerType);\n }, [handler]);\n const handleClick = React.useCallback(event => {\n // event.detail has the number of clicks performed on the element. 0 means it was triggered by the keyboard.\n if (event.detail === 0) {\n handler(event, 'keyboard');\n return;\n }\n if ('pointerType' in event) {\n // Chrome and Edge correctly use PointerEvent\n handler(event, event.pointerType);\n } else {\n handler(event, lastClickInteractionTypeRef.current);\n }\n lastClickInteractionTypeRef.current = '';\n }, [handler]);\n return {\n onClick: handleClick,\n onPointerDown: handlePointerDown\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { platform } from '@base-ui/utils/platform';\nimport { useValueChanged } from \"../internals/useValueChanged.mjs\";\nexport function useOpenMethodTriggerProps(open, setOpenMethod) {\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n const isOpen = typeof open === 'function' ? open() : open;\n if (!isOpen) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n platform.os.ios ? 'touch' : ''));\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n onClick,\n onPointerDown\n }), [onClick, onPointerDown]);\n}\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n return React.useMemo(() => ({\n openMethod,\n triggerProps\n }), [openMethod, triggerProps]);\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","import { clamp } from '@base-ui/utils/clamp';\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}","'use client';\n\nimport * as React from 'react';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { usePreviousValue } from '@base-ui/utils/usePreviousValue';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useClick, useDismiss, useFloatingRootContext, useListNavigation, useTypeahead } from \"../../floating-ui-react/index.mjs\";\nimport { SelectFloatingContext, SelectRootContext } from \"./SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { attachPreventUnmountOnClose } from \"../../utils/popups/popupStoreUtils.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { stringifyAsLabel, stringifyAsValue } from \"../../internals/resolveValueLabel.mjs\";\nimport { defaultItemEquality, findSelectionIndex, isSelectedValueDirty } from \"../../internals/itemEquality.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.mjs\";\nimport { getMaxScrollOffset, normalizeScrollOffset } from \"../../utils/scrollEdges.mjs\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { NOOP } from \"../../internals/noop.mjs\";\n\n/**\n * Groups all parts of the select.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function SelectRoot(props) {\n const {\n id,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name: nameProp,\n form,\n autoComplete,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n modal = true,\n actionsRef,\n inputRef,\n onOpenChangeComplete,\n items,\n multiple = false,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n highlightItemOnHover = true,\n children\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n setTouched,\n setFocused,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n validation,\n validationMode\n } = useFieldRootContext();\n const generatedId = useLabelableId({\n id\n });\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue,\n name: 'Select',\n state: 'value'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Select',\n state: 'open'\n });\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const scrollHandlerRef = React.useRef(null);\n const scrollArrowsMountedCountRef = React.useRef(0);\n const valueRef = React.useRef(null);\n const valuesRef = React.useRef([]);\n const typingRef = React.useRef(false);\n const firstItemTextRef = React.useRef(null);\n const selectedItemTextRef = React.useRef(null);\n const selectionRef = React.useRef({\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n });\n const alignItemWithTriggerActiveRef = React.useRef(false);\n const initialValueRef = React.useRef(value);\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n const store = useRefWithInit(() => new ReactStore({\n id: generatedId,\n labelId: undefined,\n modal,\n multiple,\n disabled,\n readOnly,\n required,\n highlightItemOnHover,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n value,\n open,\n // Seeded with the initial values of `useUnmountAfterClose`, which is called after the\n // store because its unmount cleanup writes to it. `useSyncedValues` keeps them in sync.\n mounted: open,\n transitionStatus: undefined,\n items,\n forceMount: false,\n openMethod: null,\n activeIndex: null,\n selectedIndex: null,\n popupProps: EMPTY_OBJECT,\n triggerProps: EMPTY_OBJECT,\n itemRoot: {\n props: EMPTY_OBJECT,\n multiple,\n disabled,\n readOnly,\n isItemEqualToValue\n },\n triggerElement: null,\n positionerElement: null,\n listElement: null,\n popupSide: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false,\n hasScrollArrows: false\n }, {\n setValue: NOOP,\n setOpen: NOOP,\n handleScrollArrowVisibility: NOOP,\n onOpenChangeComplete: NOOP,\n listRef,\n popupRef,\n scrollHandlerRef,\n scrollArrowsMountedCountRef,\n valueRef,\n valuesRef,\n labelsRef,\n typingRef,\n selectionRef,\n firstItemTextRef,\n selectedItemTextRef,\n alignItemWithTriggerActiveRef,\n initialValueRef\n }, selectors)).current;\n const [preventUnmountOnClose, setPreventUnmountOnClose] = React.useState(false);\n const {\n mounted,\n transitionStatus,\n forceUnmount: handleUnmount\n } = useUnmountAfterClose({\n open,\n ref: popupRef,\n preventUnmountOnClose,\n setPreventUnmountOnClose,\n onUnmount() {\n store.update({\n activeIndex: null,\n openMethod: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n onOpenChangeComplete?.(false);\n }\n });\n const activeIndex = store.useState('activeIndex');\n const selectedIndex = store.useState('selectedIndex');\n const triggerElement = store.useState('triggerElement');\n const positionerElement = store.useState('positionerElement');\n const previousOpenMethod = usePreviousValue(openMethod);\n const renderedOpenMethod = openMethod ?? previousOpenMethod;\n const serializedValue = React.useMemo(() => {\n // In multiple mode the shared input is nameless; per-value entries are submitted via\n // `hiddenInputs`. Its value is therefore irrelevant, and passing the whole array to\n // `stringifyAsValue` would invoke a user `itemToStringValue` with an array it doesn't expect.\n if (multiple) {\n return '';\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const fieldStringValue = React.useMemo(() => {\n if (multiple && Array.isArray(value)) {\n return value.map(currentValue => stringifyAsValue(currentValue, itemToStringValue));\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const controlRef = useValueAsRef(triggerElement);\n const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled, nameProp);\n\n // Mirror the `hasSelectedValue` store selector so the Field's filled state agrees with the\n // trigger/value placeholder semantics (a value serializing to `''` counts as empty).\n const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && serializedValue !== '';\n useIsoLayoutEffect(() => {\n setFilled(hasSelectedValue);\n }, [hasSelectedValue, setFilled]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n const nextIndex = findSelectionIndex(valuesRef.current, value, isItemEqualToValue, multiple);\n if (nextIndex === null) {\n selectedItemTextRef.current = null;\n }\n if (open) {\n return;\n }\n store.set('selectedIndex', nextIndex);\n }, [multiple, open, value, isItemEqualToValue, store]);\n useValueChanged(value, () => {\n clearErrors(name);\n setDirty(isSelectedValueDirty(value, validityData.initialValue, isItemEqualToValue));\n validation.change(value);\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n const openEventDetails = eventDetails;\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);\n onOpenChange?.(nextOpen, openEventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen) {\n setPreventUnmountOnClose(shouldPreventUnmountOnClose());\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n }\n });\n React.useImperativeHandle(actionsRef, () => ({\n unmount: handleUnmount,\n close: () => {\n if (store.state.open) {\n setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }\n }\n }), [handleUnmount, setOpen, store]);\n const setValue = useStableCallback((nextValue, eventDetails) => {\n onValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(nextValue);\n });\n const handleScrollArrowVisibility = useStableCallback(scroller => {\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const shouldShowUp = scrollTop > 0;\n const shouldShowDown = scrollTop < maxScrollTop;\n store.set('scrollUpArrowVisible', shouldShowUp);\n store.set('scrollDownArrowVisible', shouldShowDown);\n });\n const floatingContext = useFloatingRootContext({\n open,\n onOpenChange: setOpen,\n elements: {\n reference: triggerElement,\n floating: positionerElement\n }\n });\n\n // `readOnly` locks the value, not the interaction: the popup can be opened and browsed so the\n // user can see the available options and which one is selected. Committing a value is blocked\n // separately in `SelectItem` and in the hidden input's autofill handler.\n const click = useClick(floatingContext, {\n enabled: !disabled,\n event: 'mousedown'\n });\n const dismiss = useDismiss(floatingContext);\n const listNavigation = useListNavigation(floatingContext, {\n enabled: !disabled,\n listRef,\n activeIndex,\n selectedIndex,\n disabledIndices: EMPTY_ARRAY,\n onNavigate(nextActiveIndex) {\n // Retain the highlight while transitioning out.\n if (nextActiveIndex === null && !open) {\n return;\n }\n store.set('activeIndex', nextActiveIndex);\n },\n focusItemOnHover: highlightItemOnHover\n });\n const typeahead = useTypeahead(floatingContext, {\n // Typeahead on an open popup only moves the highlight, so it remains available while\n // `readOnly`. The closed-trigger variant commits a value instead, so it doesn't.\n enabled: !disabled && (open || !readOnly && !multiple),\n listRef: labelsRef,\n activeIndex,\n selectedIndex,\n // Skip disabled items while matching so typeahead advances to the next selectable item\n // (a click can never select a disabled item and native `<select>` skips them too). Resolve\n // the disabled state from the element via the attribute-only `isElementDisabled` so the\n // hidden, force-mounted items used for closed-trigger typeahead aren't dropped by the\n // `elementsRef`/visibility filter that `disabledIndices` deliberately sidesteps.\n disabledIndices: index => isElementDisabled(listRef.current[index]),\n onMatch(index) {\n if (open) {\n store.set('activeIndex', index);\n } else {\n setValue(valuesRef.current[index], createChangeEventDetails(REASONS.none));\n }\n },\n onTyping(typing) {\n typingRef.current = typing;\n }\n });\n\n // `Select.Trigger` applies the id itself from the store, so it's deliberately not merged here.\n const mergedTriggerProps = React.useMemo(() => mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps), [click.reference, typeahead.reference, listNavigation.reference, dismiss.reference, interactionTypeProps]);\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [typeahead.floating, listNavigation.floating, dismiss.floating]);\n const itemProps = listNavigation.item ?? EMPTY_OBJECT;\n const itemRoot = React.useMemo(() => ({\n props: itemProps,\n multiple,\n disabled,\n readOnly,\n isItemEqualToValue\n }), [itemProps, multiple, disabled, readOnly, isItemEqualToValue]);\n store.useContextCallback('setValue', setValue);\n store.useContextCallback('setOpen', setOpen);\n store.useContextCallback('handleScrollArrowVisibility', handleScrollArrowVisibility);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n\n // The prop bags must be in the store before the parts render. `useSyncedValues` writes in a\n // layout effect, after all descendants have rendered.\n useOnFirstRender(() => {\n store.update({\n popupProps,\n triggerProps: mergedTriggerProps,\n itemRoot\n });\n });\n store.useSyncedValues({\n id: generatedId,\n modal,\n multiple,\n disabled,\n readOnly,\n required,\n highlightItemOnHover,\n value,\n open,\n mounted,\n transitionStatus,\n popupProps,\n triggerProps: mergedTriggerProps,\n itemRoot,\n items,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n openMethod: renderedOpenMethod\n });\n const ref = useMergedRefs(inputRef, validation.inputRef);\n const hiddenInputName = multiple ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(value) || !name) {\n return null;\n }\n return value.map(v => {\n const currentSerializedValue = stringifyAsValue(v, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue,\n disabled: disabled\n }, currentSerializedValue);\n });\n }, [multiple, value, form, name, itemToStringValue, disabled]);\n return /*#__PURE__*/_jsxs(SelectRootContext.Provider, {\n value: store,\n children: [/*#__PURE__*/_jsx(SelectFloatingContext.Provider, {\n value: floatingContext,\n children: children\n }), /*#__PURE__*/_jsx(\"input\", {\n ...validation.getValidationProps(disabled, {\n onFocus() {\n // Move focus to the trigger element when the hidden input is focused.\n store.state.triggerElement?.focus({\n // Supported in Chrome from 144 (January 2026)\n focusVisible: true\n });\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/react/react/issues/9023\n if (event.nativeEvent.defaultPrevented || disabled || readOnly) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n function handleChange() {\n if (multiple) {\n // Browser autofill only writes a single scalar value.\n return;\n }\n\n // Preserve the original serialized matching, then fall back to rendered text,\n // which browsers can autofill for primitive values like\n // `value=\"US\">United States`.\n const nextValueLower = nextValue.toLowerCase();\n let matchingIndex = valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);\n if (matchingIndex === -1) {\n matchingIndex = valuesRef.current.findIndex((_, index) => {\n const renderedLabel = labelsRef.current[index];\n return renderedLabel != null && renderedLabel.toLowerCase() === nextValueLower;\n });\n }\n const matchingValue = valuesRef.current[matchingIndex];\n if (matchingValue != null) {\n // `setValue` may be canceled by `onValueChange`; rely on `useValueChanged` to\n // mark the field dirty and run validation only when the value actually changes.\n setValue(matchingValue, details);\n }\n }\n store.set('forceMount', true);\n queueMicrotask(handleChange);\n }\n }),\n id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: autoComplete,\n value: serializedValue,\n disabled: disabled,\n required: required && !(multiple && hasSelectedValue),\n readOnly: readOnly,\n ref: ref,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../internals/useBaseUiId.mjs\";\nexport function useRegisteredLabelId(idProp, setLabelId) {\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(currentId => currentId === id ? undefined : currentId);\n };\n }, [id, setLabelId]);\n return id;\n}","'use client';\n\nimport { isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { closest, getTarget } from \"../../floating-ui-react/utils.mjs\";\nimport { useRegisteredLabelId } from \"../../utils/useRegisteredLabelId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabel(params = {}) {\n const {\n id: idProp,\n fallbackControlId,\n native = false,\n setLabelId: setLabelIdProp,\n focusControl: focusControlProp\n } = params;\n const {\n controlId: contextControlId,\n setLabelId: setContextLabelId\n } = useLabelableContext();\n const syncLabelId = useStableCallback(nextLabelId => {\n setContextLabelId(nextLabelId);\n setLabelIdProp?.(nextLabelId);\n });\n const id = useRegisteredLabelId(idProp, syncLabelId);\n const resolvedControlId = contextControlId ?? fallbackControlId;\n function focusControl(event) {\n if (focusControlProp) {\n focusControlProp(event, resolvedControlId);\n return;\n }\n if (!resolvedControlId) {\n return;\n }\n const controlElement = getControlById(event.currentTarget, resolvedControlId);\n if (isHTMLElement(controlElement)) {\n focusElementWithVisible(controlElement);\n }\n }\n function handleInteraction(event) {\n const target = getTarget(event.nativeEvent);\n if (closest(target, 'button,input,select,textarea')) {\n return;\n }\n\n // Prevent text selection when double clicking label.\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n if (native) {\n return;\n }\n focusControl(event);\n }\n return native ? {\n id,\n htmlFor: resolvedControlId,\n onMouseDown: handleInteraction\n } : {\n id,\n onClick: handleInteraction,\n onPointerDown(event) {\n event.preventDefault();\n }\n };\n}\nexport function getControlById(label, id) {\n let root = label.getRootNode();\n while (isShadowRoot(root)) {\n const element = root.getElementById(id);\n if (element) {\n return element;\n }\n root = root.host.getRootNode();\n }\n return ownerDocument(label).getElementById(id);\n}\nexport function focusElementWithVisible(element) {\n element.focus({\n // Available from Chrome 144+ (January 2026).\n // Safari and Firefox already support it.\n focusVisible: true\n });\n}","'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useLabel } from \"../../internals/labelable-provider/useLabel.mjs\";\nimport { getDefaultLabelId } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\n\n/**\n * An accessible label that is automatically associated with the select trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectLabel = /*#__PURE__*/React.forwardRef(function SelectLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.\n const elementPropsWithoutId = elementProps;\n delete elementPropsWithoutId.id;\n const fieldRootContext = useFieldRootContext();\n const store = useSelectRootContext();\n const triggerElement = store.useState('triggerElement');\n const rootId = store.useState('id');\n const defaultLabelId = getDefaultLabelId(rootId);\n const labelProps = useLabel({\n id: defaultLabelId,\n fallbackControlId: triggerElement?.id ?? rootId,\n setLabelId(nextLabelId) {\n const resolvedLabelId = typeof nextLabelId === 'function' ? nextLabelId(store.state.labelId) : nextLabelId;\n store.set('labelId', resolvedLabelId);\n }\n });\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n state: fieldRootContext.state,\n props: [labelProps, elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectLabel.displayName = \"SelectLabel\";","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useFieldRootContext } from \"./FieldRootContext.mjs\";\n\n/**\n * Returns the field's `setFocused`, recording which control the focused state belongs to.\n *\n * Disabling or unmounting a focused control moves focus away without firing `blur`, so the focused\n * state would otherwise stay latched. A field can have several focus targets, so a control only\n * clears the shared state when focus last landed on itself. The stable callback doubles as that\n * identity.\n */\nexport function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {\n const {\n setFocused,\n focusOwnerRef\n } = useFieldRootContext();\n const setFieldFocused = useStableCallback(focused => {\n // A disabled target can still be focused (`aria-disabled` elements stay programmatically\n // focusable), but must not publish the field's focused styling.\n if (focused ? !disabled : focusOwnerRef.current === setFieldFocused) {\n focusOwnerRef.current = focused && setFieldFocused;\n onFocusedChange?.(focused);\n setFocused(focused);\n }\n });\n\n // Re-run when `disabled` changes so a focused control releases the field even when the browser\n // does not fire `blur`. The setup reclaims focus that no focus event reported: StrictMode\n // re-running effects after a mount-time focus, a control focused before hydration, or an\n // `aria-disabled` control re-enabled while it kept focus.\n useIsoLayoutEffect(() => {\n const el = focusTargetRef.current;\n const root = el?.getRootNode();\n if (root?.activeElement === el) {\n setFieldFocused(true);\n }\n return () => setFieldFocused(false);\n }, [disabled, focusTargetRef, setFieldFocused]);\n return setFieldFocused;\n}","import { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\n// Tolerance around the element bounds so a fast click whose pointer drifts slightly\n// during press-release isn't mistaken for a drag-off-and-release cancellation.\n// Matches typical OS/browser drag-initiation thresholds.\nconst BOUNDARY_OFFSET = 5;\n\n/**\n * Determines if a mouse event occurred within the bounds of an element\n * (including its pseudo-elements), with a small tolerance for pointer drift.\n */\nexport function isMouseWithinBounds(event, element) {\n const bounds = getPseudoElementBounds(element);\n return event.clientX >= bounds.left - BOUNDARY_OFFSET && event.clientX <= bounds.right + BOUNDARY_OFFSET && event.clientY >= bounds.top - BOUNDARY_OFFSET && event.clientY <= bounds.bottom + BOUNDARY_OFFSET;\n}\nexport function getPseudoElementBounds(element) {\n const elementRect = element.getBoundingClientRect();\n const win = ownerWindow(element);\n\n // Avoid \"Not implemented: window.getComputedStyle(elt, pseudoElt)\" in jsdom.\n if (platform.env.jsdom) {\n return elementRect;\n }\n const beforeStyles = win.getComputedStyle(element, '::before');\n const afterStyles = win.getComputedStyle(element, '::after');\n const hasPseudoElements = beforeStyles.content !== 'none' || afterStyles.content !== 'none';\n if (!hasPseudoElements) {\n return elementRect;\n }\n\n // Get dimensions of pseudo-elements\n const beforeWidth = parseFloat(beforeStyles.width) || 0;\n const beforeHeight = parseFloat(beforeStyles.height) || 0;\n const afterWidth = parseFloat(afterStyles.width) || 0;\n const afterHeight = parseFloat(afterStyles.height) || 0;\n\n // Calculate max dimensions including pseudo-elements\n const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);\n const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);\n\n // Calculate the differences to extend the bounds\n const widthDiff = totalWidth - elementRect.width;\n const heightDiff = totalHeight - elementRect.height;\n return {\n left: elementRect.left - widthDiff / 2,\n right: elementRect.right + widthDiff / 2,\n top: elementRect.top - heightDiff / 2,\n bottom: elementRect.bottom + heightDiff / 2\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 and `pointerType` to `''` (the native convention for\n * keyboard-generated clicks). When the click represents a mouse gesture, pass\n * `detail: 1` and `pointerType: 'mouse'` so consumers don't classify it as a\n * keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0,\n pointerType = ''\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n pointerType,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}","import { CommonTriggerDataAttributes } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * Present when the corresponding select is open.\n */\nexport const popupOpen = CommonTriggerDataAttributes.popupOpen;\n/**\n * Present when the trigger is pressed.\n */\nexport const pressed = CommonTriggerDataAttributes.pressed;\n/**\n * Present when the select is disabled.\n */\nexport const disabled = 'data-disabled';\n/**\n * Present when the select is readonly.\n */\nexport const readonly = 'data-readonly';\n/**\n * Indicates which side the corresponding popup is positioned relative to its anchor.\n * @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}\n */\nexport const popupSide = 'data-popup-side';\n/**\n * Present when the select is required.\n */\nexport const required = 'data-required';\n/**\n * Present when the select is in a valid state (when wrapped in Field.Root).\n */\nexport const valid = 'data-valid';\n/**\n * Present when the select is in an invalid state (when wrapped in Field.Root).\n */\nexport const invalid = 'data-invalid';\n/**\n * Present when the select has been touched (when wrapped in Field.Root).\n */\nexport const touched = 'data-touched';\n/**\n * Present when the select's value has changed (when wrapped in Field.Root).\n */\nexport const dirty = 'data-dirty';\n/**\n * Present when the select has a value (when wrapped in Field.Root).\n */\nexport const filled = 'data-filled';\n/**\n * Present when the select trigger is focused (when wrapped in Field.Root).\n */\nexport const focused = 'data-focused';\n/**\n * Present when the select doesn't have a value.\n */\nexport const placeholder = 'data-placeholder';","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useSetFieldFocused } from \"../../internals/field-root-context/useSetFieldFocused.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { isMouseWithinBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nimport * as SelectTriggerDataAttributes from \"./SelectTriggerDataAttributes.mjs\";\nconst SELECTED_DELAY = 400;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n [SelectTriggerDataAttributes.popupSide]: side\n } : null,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n validationMode,\n validation,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const store = useSelectRootContext();\n const readOnly = store.useState('readOnly');\n const required = store.useState('required');\n const selectDisabled = store.useState('disabled');\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const value = store.useState('value');\n const triggerProps = store.useState('triggerProps');\n const positionerElement = store.useState('positionerElement');\n const listElement = store.useState('listElement');\n const popupSideValue = store.useState('popupSide');\n const rootId = store.useState('id');\n const selectLabelId = store.useState('labelId');\n const hasSelectedValue = store.useState('hasSelectedValue');\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id: idProp\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const setFocused = useSetFieldFocused(disabled, triggerRef);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = store.useStateSetter('triggerElement');\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n // A mousedown on the trigger can open the popup under the cursor. Keep mouseup selection\n // disabled briefly so releasing over either the selected item or a neighboring item doesn't\n // commit an accidental selection. SelectItem can still opt into unselected mouseup sooner\n // after a real drag over the item.\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n store.context.selectionRef.current.allowUnselectedMouseUp = true;\n store.context.selectionRef.current.allowSelectedMouseUp = true;\n });\n return () => {\n selectedDelayTimeout.clear();\n };\n }\n store.context.selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, store, timeoutMouseDown, selectedDelayTimeout]);\n const mergedProps = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open,\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && store.context.alignItemWithTriggerActiveRef.current) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Don't treat the release as an outside press when it lands on the trigger or inside\n // the popup positioner (or their children).\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n if (isMouseWithinBounds(mouseEvent, triggerRef.current)) {\n return;\n }\n store.context.setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, elementProps, getButtonProps);\n const props = validation.getValidationProps(disabled, mergedProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n popupSide,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef, buttonRef, setTriggerElement],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const store = useSelectRootContext();\n const value = store.useState('value');\n const items = store.useState('items');\n const itemToStringLabel = store.useState('itemToStringLabel');\n const hasSelectedValue = store.useState('hasSelectedValue');\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = store.useState('hasNullItemLabel', shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (shouldCheckNullItemLabel && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, store.context.valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useSelectRootContext();\n const open = store.useState('open');\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const store = useSelectRootContext();\n const mounted = store.useState('mounted');\n const forceMount = store.useState('forceMount');\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";","'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => () => {},\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}","/* eslint-disable no-bitwise */\n'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { CompositeListContext } from \"./CompositeListContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Provides context for a list of items in a composite component.\n */\nexport function CompositeList(props) {\n const {\n children,\n elementsRef,\n labelsRef,\n onMapChange: onMapChangeProp\n } = props;\n const onMapChange = useStableCallback(onMapChangeProp);\n const [, setMapTick] = React.useState(0);\n const listeners = useRefWithInit(createListeners).current;\n const map = useRefWithInit(createMap).current;\n const nextIndexRef = React.useRef(0);\n const isDirtyRef = React.useRef(true);\n const itemsRef = React.useRef(null);\n const mutationObserverRef = React.useRef(null);\n\n // Item effects can run without their parent rendering. Schedule one synchronous\n // parent update for the whole commit so refs are rebuilt before paint and while\n // the originating React event is still inside `act()` in tests.\n const scheduleMapUpdate = useStableCallback(() => {\n if (isDirtyRef.current) {\n return;\n }\n isDirtyRef.current = true;\n setMapTick(tick => tick + 1);\n });\n const register = useStableCallback((node, registration) => {\n map.set(node, registration);\n scheduleMapUpdate();\n });\n const unregister = useStableCallback(node => {\n map.delete(node);\n scheduleMapUpdate();\n });\n const syncRefs = useStableCallback(items => {\n const nextMap = new Map();\n elementsRef.current.length = 0;\n if (labelsRef) {\n labelsRef.current.length = 0;\n }\n items.forEach(item => {\n nextMap.set(item.element, {\n ...(item.registration.metadata ?? {}),\n index: item.index\n });\n elementsRef.current[item.index] = item.element;\n if (labelsRef) {\n labelsRef.current[item.index] = item.registration.label !== undefined ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;\n }\n });\n nextIndexRef.current = elementsRef.current.length;\n return nextMap;\n });\n function observe(sortedNodes) {\n mutationObserverRef.current?.disconnect();\n mutationObserverRef.current = null;\n\n // A single item can't reorder.\n if (typeof MutationObserver !== 'function' || sortedNodes.length < 2) {\n return;\n }\n const mutationObserver = new MutationObserver(entries => {\n // Only verify the order after a move: a node that was removed and later\n // re-added within the same batch. Additions and removals alone can't\n // change the relative order of the remaining items, and items that mount\n // or unmount re-sort through `register`/`unregister`.\n if (!hasMovedNode(entries)) {\n return;\n }\n let previousConnectedNode = null;\n\n // If any connected node now appears before the previous connected node,\n // wrappers/items moved and the index map needs to be rebuilt.\n for (const node of sortedNodes) {\n if (!node.isConnected) {\n continue;\n }\n if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {\n mutationObserver.disconnect();\n scheduleMapUpdate();\n return;\n }\n previousConnectedNode = node;\n }\n });\n mutationObserverRef.current = mutationObserver;\n\n // A reorder that changes item indexes must invert at least one adjacent pair\n // from the previous sorted order. Observing each pair's common parent catches\n // both direct item moves and ancestor wrapper moves at the boundary.\n const roots = new Set();\n for (let i = 1; i < sortedNodes.length; i += 1) {\n const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);\n if (root) {\n roots.add(root);\n }\n }\n roots.forEach(root => mutationObserver.observe(root, {\n childList: true\n }));\n }\n const flush = useStableCallback(() => {\n const [items, automaticNodes] = getCompositeListSnapshot(map);\n const nextMap = syncRefs(items);\n const previousItems = itemsRef.current;\n const changed = !previousItems || previousItems.length !== items.length || items.some((item, index) => {\n const previousItem = previousItems[index];\n return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;\n });\n observe(automaticNodes);\n itemsRef.current = items;\n isDirtyRef.current = false;\n if (!changed) {\n return;\n }\n listeners.forEach(listener => listener(nextMap));\n onMapChange(nextMap);\n });\n useIsoLayoutEffect(() => {\n // Re-copy the last committed snapshot when the ref objects change or Strict Mode replays\n // effects without reattaching callback refs.\n if (!isDirtyRef.current && itemsRef.current) {\n syncRefs(itemsRef.current);\n }\n return () => {\n elementsRef.current = [];\n if (labelsRef) {\n labelsRef.current = [];\n }\n };\n }, [elementsRef, labelsRef, syncRefs]);\n useIsoLayoutEffect(() => {\n if (isDirtyRef.current) {\n flush();\n }\n });\n useIsoLayoutEffect(() => {\n return () => {\n mutationObserverRef.current?.disconnect();\n // React 18 Strict Mode replays effects without replaying callback refs.\n // Mark the retained map dirty so the replay rebuilds refs and observation.\n isDirtyRef.current = true;\n };\n }, []);\n const subscribeMapChange = useStableCallback(fn => {\n listeners.add(fn);\n return () => {\n listeners.delete(fn);\n };\n });\n const contextValue = React.useMemo(() => ({\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n }), [register, unregister, subscribeMapChange, nextIndexRef]);\n return /*#__PURE__*/_jsx(CompositeListContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createMap() {\n return new Map();\n}\nfunction createListeners() {\n return new Set();\n}\nfunction getCompositeListSnapshot(map) {\n const reservedIndices = new Set();\n const items = [];\n const automaticItems = [];\n map.forEach((registration, node) => {\n if (!node.isConnected) {\n return;\n }\n const index = registration.index;\n const item = {\n index: index ?? -1,\n element: node,\n registration\n };\n if (index === null) {\n automaticItems.push(item);\n } else if (index >= 0) {\n reservedIndices.add(index);\n items.push(item);\n }\n });\n let nextAutomaticIndex = 0;\n automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));\n automaticItems.forEach(item => {\n while (reservedIndices.has(nextAutomaticIndex)) {\n nextAutomaticIndex += 1;\n }\n item.index = nextAutomaticIndex;\n items.push(item);\n nextAutomaticIndex += 1;\n });\n if (reservedIndices.size > 0) {\n items.sort((a, b) => a.index - b.index);\n }\n return [items, automaticItems.map(item => item.element)];\n}\nfunction getCommonAncestor(firstNode, lastNode) {\n let ancestor = firstNode.parentElement;\n\n // The `parentElement` walk cannot cross shadow boundaries, so the native\n // `contains` is sufficient here.\n while (ancestor && !ancestor.contains(lastNode)) {\n ancestor = ancestor.parentElement;\n }\n return ancestor;\n}\nfunction hasMovedNode(entries) {\n for (const entry of entries) {\n for (let i = 0; i < entry.removedNodes.length; i += 1) {\n if (entry.removedNodes[i].isConnected) {\n return true;\n }\n }\n }\n return false;\n}\nfunction sortByDocumentPosition(a, b) {\n // Adjacent siblings are the common case for lists that are already in order, and\n // `compareDocumentPosition` scans siblings from the parent's first child, so sorting\n // a long flat list would otherwise be quadratic.\n if (a.nextElementSibling === b) {\n return -1;\n }\n if (b.nextElementSibling === a) {\n return 1;\n }\n // `DOCUMENT_POSITION_CONTAINED_BY` is always reported alongside `FOLLOWING`, and `CONTAINS`\n // alongside `PRECEDING`, so testing `FOLLOWING` alone orders siblings and nested items alike.\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPositionerContext.displayName = \"SelectPositionerContext\";\nexport function useSelectPositionerContext() {\n const context = React.useContext(SelectPositionerContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.' : _formatErrorMessage(59));\n }\n return context;\n}","import * as React from 'react';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const InternalBackdrop = /*#__PURE__*/React.forwardRef(function InternalBackdrop(props, ref) {\n const {\n cutout,\n ...otherProps\n } = props;\n let clipPath;\n if (cutout) {\n const rect = cutout.getBoundingClientRect();\n clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"presentation\"\n // Ensures Floating UI's outside press detection runs, as it considers\n // it an element that existed when the popup rendered.\n ,\n \"data-base-ui-inert\": \"\",\n ...otherProps,\n style: {\n position: 'fixed',\n inset: 0,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n clipPath\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") InternalBackdrop.displayName = \"InternalBackdrop\";","export function clearStyles(element, originalStyles) {\n if (element) {\n Object.assign(element.style, originalStyles);\n }\n}\nexport const LIST_FUNCTIONAL_STYLES = {\n position: 'relative',\n maxHeight: '100%',\n overflowX: 'hidden',\n overflowY: 'auto'\n};","'use client';\n\nimport { isOverflowElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from \"./addEventListener.mjs\";\nimport { platform } from \"./platform/index.mjs\";\nimport { ownerDocument, ownerWindow } from \"./owner.mjs\";\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { Timeout } from \"./useTimeout.mjs\";\nimport { AnimationFrame } from \"./useAnimationFrame.mjs\";\nlet originalHtmlStyles = {};\nlet originalBodyStyles = {};\nlet originalHtmlScrollBehavior = '';\n\n// The viewport's overflow comes from <html> when it establishes its own scroll container, and\n// propagates from <body> otherwise. An `overflow` style on the other element doesn't lock the page.\nfunction getViewportScroller(html, body) {\n return isOverflowElement(html) ? html : body;\n}\nfunction isPageScrollLocked(win, html, body) {\n return /hidden|clip/.test(win.getComputedStyle(getViewportScroller(html, body)).overflowY);\n}\nfunction hasInsetScrollbars(referenceElement) {\n if (typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const win = ownerWindow(doc);\n return win.innerWidth - doc.documentElement.clientWidth > 0;\n}\nfunction supportsStableScrollbarGutter(referenceElement) {\n const supported = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('scrollbar-gutter', 'stable');\n if (!supported || typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const scrollContainer = getViewportScroller(html, body);\n const originalScrollContainerOverflowY = scrollContainer.style.overflowY;\n const originalHtmlStyleGutter = html.style.scrollbarGutter;\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = originalScrollContainerOverflowY;\n html.style.scrollbarGutter = originalHtmlStyleGutter;\n return before === after;\n}\nfunction preventScrollOverlayScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n\n // If an `overflow` style is present on <html>, we need to lock it, because a lock on <body>\n // won't have any effect.\n // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it\n // instead, as sticky elements shift otherwise.\n const elementToLock = getViewportScroller(html, body);\n const originalElementToLockStyles = {\n overflowY: elementToLock.style.overflowY,\n overflowX: elementToLock.style.overflowX\n };\n Object.assign(elementToLock.style, {\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n return () => {\n Object.assign(elementToLock.style, originalElementToLockStyles);\n };\n}\nfunction preventScrollInsetScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n const resizeFrame = AnimationFrame.create();\n\n // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.\n if (platform.engine.webkit && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n function lockScroll() {\n /* DOM reads: */\n\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || '';\n const hasBothEdges = htmlScrollbarGutterValue.includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Values can be negative in Firefox\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n\n // Avoid shift due to the default <body> margin. This does cause elements to be clipped\n // with whitespace. Warn if <body> has margins?\n const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);\n const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);\n const elementToLock = getViewportScroller(html, body);\n updateGutterOnly = supportsStableScrollbarGutter(referenceElement);\n\n /*\n * DOM writes:\n * Do not read the DOM past this point!\n */\n\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n // Assign the longhands that `cleanup` restores, so nothing is left behind.\n overflowY: 'hidden',\n overflowX: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.setAttribute('data-base-ui-scroll-locked', '');\n html.style.scrollBehavior = 'unset';\n }\n function cleanup() {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.removeAttribute('data-base-ui-scroll-locked');\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n }\n function handleResize() {\n cleanup();\n resizeFrame.request(lockScroll);\n }\n lockScroll();\n const unsubscribeResize = addEventListener(win, 'resize', handleResize);\n return () => {\n resizeFrame.cancel();\n cleanup();\n // Sometimes this cleanup can run after test teardown because it is called\n // in a `setTimeout(fn, 0)`. Guard the returned cleanup to avoid calling\n // `removeEventListener` when it is no longer available in tests.\n if (typeof win.removeEventListener === 'function') {\n unsubscribeResize();\n }\n };\n}\nclass ScrollLocker {\n lockCount = 0;\n restore = null;\n timeoutLock = Timeout.create();\n timeoutUnlock = Timeout.create();\n acquire(referenceElement) {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.timeoutLock.start(0, () => this.lock(referenceElement));\n }\n return this.release;\n }\n release = () => {\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.timeoutUnlock.start(0, this.unlock);\n }\n };\n unlock = () => {\n if (this.lockCount === 0 && this.restore) {\n this.restore?.();\n this.restore = null;\n }\n };\n lock(referenceElement) {\n if (this.lockCount === 0 || this.restore !== null) {\n return;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n\n // The page is already locked, either by the site author or by a non-Base UI overlay that\n // hasn't cleaned up yet. Leave it alone and wait for the lock to clear before taking over,\n // otherwise we'd snapshot the locked state and restore it after our own lock is released.\n if (isPageScrollLocked(win, html, body)) {\n const observer = new win.MutationObserver(() => {\n if (isPageScrollLocked(win, html, body)) {\n return;\n }\n observer.disconnect();\n this.restore = null;\n this.lock(referenceElement);\n });\n\n // Watch every attribute: locks are applied through inline styles, classes, or attributes\n // paired with a stylesheet (`data-scroll-locked` in react-remove-scroll, for example).\n const options = {\n attributes: true\n };\n observer.observe(html, options);\n observer.observe(body, options);\n this.restore = () => observer.disconnect();\n return;\n }\n const hasOverlayScrollbars = platform.os.ios || !hasInsetScrollbars(referenceElement);\n\n // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous\n // side effects and bugs that arise on iOS, it must be researched extensively before\n // being enabled to ensure it doesn't cause the following issues:\n // - Textboxes must scroll into view when focused, nor cause a glitchy scroll animation.\n // - The navbar must not force itself into view and cause layout shift.\n // - Scroll containers must not flicker upon closing a popup when it has an exit animation.\n this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);\n }\n}\nconst SCROLL_LOCKER = new ScrollLocker();\n\n/**\n * Locks the scroll of the document when enabled.\n *\n * @param enabled - Whether to enable the scroll lock.\n * @param referenceElement - Element to use as a reference for lock calculations.\n */\nexport function useScrollLock(enabled = true, referenceElement = null) {\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n return SCROLL_LOCKER.acquire(referenceElement);\n }, [enabled, referenceElement]);\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\n\n// Touch-opened popups normally avoid scroll locking so users can still swipe outside to dismiss.\n// This hook re-enables scroll lock only when the popup is effectively full-width.\n// Treat popups with up to 20px of total horizontal gutter as full-width so common ~10px side\n// padding still locks scroll, since that leaves too little outside space for a reliable swipe.\nconst VIEWPORT_WIDTH_TOLERANCE_PX = 20;\n\n/**\n * Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when\n * enabled. For touch opens, scroll lock is applied only when the positioner width is effectively\n * viewport-sized.\n */\nexport function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {\n const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (!enabled || !touchOpen || positionerElement == null) {\n setTouchOpenShouldLockScroll(false);\n return;\n }\n const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;\n const popupWidth = positionerElement.offsetWidth;\n setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);\n }, [enabled, touchOpen, positionerElement]);\n useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);\n}","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useSelectFloatingContext, useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { CompositeList } from \"../../internals/composite/list/CompositeList.mjs\";\nimport { useAnchorPositioning } from \"../../internals/useAnchorPositioning.mjs\";\nimport { SelectPositionerContext } from \"./SelectPositionerContext.mjs\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.mjs\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../internals/constants.mjs\";\nimport { clearStyles } from \"../popup/utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findItemIndex } from \"../../internals/itemEquality.mjs\";\nimport { usePositioner } from \"../../utils/usePositioner.mjs\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst FIXED = {\n position: 'fixed'\n};\n\n/**\n * Positions the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPositioner = /*#__PURE__*/React.forwardRef(function SelectPositioner(componentProps, forwardedRef) {\n const {\n anchor,\n className,\n render,\n // `useAnchorPositioning` applies the same defaults to the undefined values; the names\n // remain destructured to exclude the props from `elementProps`.\n positionMethod,\n side,\n align,\n sideOffset,\n alignOffset,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding,\n sticky,\n disableAnchorTracking,\n alignItemWithTrigger = true,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const store = useSelectRootContext();\n const floatingRootContext = useSelectFloatingContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const value = store.useState('value');\n const openMethod = store.useState('openMethod');\n const positionerElement = store.useState('positionerElement');\n const triggerElement = store.useState('triggerElement');\n const isItemEqualToValue = store.useState('isItemEqualToValue');\n const transitionStatus = store.useState('transitionStatus');\n const scrollUpArrowRef = React.useRef(null);\n const scrollDownArrowRef = React.useRef(null);\n const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React.useState(alignItemWithTrigger);\n const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== 'touch';\n if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {\n setControlledAlignItemWithTrigger(alignItemWithTrigger);\n }\n React.useImperativeHandle(store.context.alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);\n useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === 'touch', positionerElement, triggerElement);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,\n collisionAvoidance,\n keepMounted: true\n });\n const renderedSide = alignItemWithTriggerActive ? 'none' : positioning.side;\n const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;\n const state = {\n open,\n side: renderedSide,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = store.useStateSetter('positionerElement');\n const element = usePositioner(componentProps, state, {\n styles: positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n const prevMapSizeRef = React.useRef(0);\n const onMapChange = useStableCallback(map => {\n if (store.context.valuesRef.current.length === 0) {\n return;\n }\n const prevSize = prevMapSizeRef.current;\n prevMapSizeRef.current = map.size;\n const eventDetails = createChangeEventDetails(REASONS.none);\n if (prevSize !== 0 && !store.state.multiple && value !== null) {\n const selectedValueIndex = findItemIndex(store.context.valuesRef.current, value, isItemEqualToValue);\n if (selectedValueIndex === -1) {\n const initialSelectedValue = store.context.initialValueRef.current;\n const hasInitial = initialSelectedValue != null && findItemIndex(store.context.valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1;\n const nextValue = hasInitial ? initialSelectedValue : null;\n store.context.setValue(nextValue, eventDetails);\n if (nextValue === null) {\n store.set('selectedIndex', null);\n store.context.selectedItemTextRef.current = null;\n }\n }\n }\n if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {\n const nextValue = value.filter(selectedItemValue => findItemIndex(store.context.valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1);\n if (nextValue.length !== value.length) {\n store.context.setValue(nextValue, eventDetails);\n if (nextValue.length === 0) {\n store.set('selectedIndex', null);\n store.context.selectedItemTextRef.current = null;\n }\n }\n }\n if (open && alignItemWithTriggerActive) {\n store.update({\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n const stylesToClear = {\n height: ''\n };\n clearStyles(positionerElement, stylesToClear);\n clearStyles(store.context.popupRef.current, stylesToClear);\n }\n });\n const contextValue = React.useMemo(() => ({\n ...positioning,\n side: renderedSide,\n alignItemWithTriggerActive,\n setControlledAlignItemWithTrigger,\n scrollUpArrowRef,\n scrollDownArrowRef\n }), [positioning, renderedSide, alignItemWithTriggerActive, setControlledAlignItemWithTrigger]);\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.context.listRef,\n labelsRef: store.context.labelsRef,\n onMapChange: onMapChange,\n children: /*#__PURE__*/_jsxs(SelectPositionerContext.Provider, {\n value: contextValue,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: triggerElement\n }), element]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPositioner.displayName = \"SelectPositioner\";","import { jsx as _jsx } from \"react/jsx-runtime\";\nconst DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';\nexport const styleDisableScrollbar = {\n className: DISABLE_SCROLLBAR_CLASS_NAME,\n getElement(nonce) {\n return /*#__PURE__*/_jsx(\"style\", {\n nonce: nonce,\n href: DISABLE_SCROLLBAR_CLASS_NAME,\n precedence: \"base-ui:low\",\n children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`\n });\n }\n};\nif (process.env.NODE_ENV !== \"production\") styleDisableScrollbar.getElement.displayName = \"styleDisableScrollbar.getElement\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToolbarRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToolbarRootContext.displayName = \"ToolbarRootContext\";\nexport function useToolbarRootContext(optional) {\n const context = React.useContext(ToolbarRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : _formatErrorMessage(69));\n }\n return context;\n}","import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, findNonDisabledListIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.mjs\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const MODIFIER_KEYS = [SHIFT, 'Control', 'Alt', 'Meta'];\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const CSPContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CSPContext.displayName = \"CSPContext\";\nconst DEFAULT_CSP_CONTEXT_VALUE = {\n disableStyleElements: false\n};\nexport function useCSPContext() {\n return React.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;\n}","/**\n * The available width between the trigger and the edge of the viewport.\n * @type {number}\n */\nexport const availableWidth = '--available-width';\n/**\n * The available height between the trigger and the edge of the viewport.\n * @type {number}\n */\nexport const availableHeight = '--available-height';\n/**\n * The anchor's width.\n * @type {number}\n */\nexport const anchorWidth = '--anchor-width';\n/**\n * The anchor's height.\n * @type {number}\n */\nexport const anchorHeight = '--anchor-height';\n/**\n * The coordinates that this element is anchored to. Used for animations and transitions.\n * @type {string}\n */\nexport const transformOrigin = '--transform-origin';","'use client';\n\nimport * as React from 'react';\nimport { rectToClientRect } from '@floating-ui/utils';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { platform } from '@base-ui/utils/platform';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { clamp } from '@base-ui/utils/clamp';\nimport { FloatingFocusManager, platform as floatingPlatform } from \"../../floating-ui-react/index.mjs\";\nimport { useSelectFloatingContext, useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { clearStyles, LIST_FUNCTIONAL_STYLES } from \"./utils.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { getDisabledMountTransitionStyles } from \"../../internals/getDisabledMountTransitionStyles.mjs\";\nimport { getMaxScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.mjs\";\nimport { useCSPContext } from \"../../internals/csp-context/CSPContext.mjs\";\nimport { useDirection } from \"../../internals/direction-context/DirectionContext.mjs\";\nimport * as SelectPositionerCssVars from \"../positioner/SelectPositionerCssVars.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the select list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPopup = /*#__PURE__*/React.forwardRef(function SelectPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const store = useSelectRootContext();\n const multiple = store.useState('multiple');\n const readOnly = store.useState('readOnly');\n const highlightItemOnHover = store.useState('highlightItemOnHover');\n const floatingRootContext = useSelectFloatingContext();\n const {\n side,\n align,\n alignItemWithTriggerActive,\n isPositioned,\n setControlledAlignItemWithTrigger\n } = useSelectPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const direction = useDirection();\n const {\n nonce,\n disableStyleElements\n } = useCSPContext();\n const id = store.useState('id');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const mounted = store.useState('mounted');\n const popupProps = store.useState('popupProps');\n const transitionStatus = store.useState('transitionStatus');\n const triggerElement = store.useState('triggerElement');\n const positionerElement = store.useState('positionerElement');\n const listElement = store.useState('listElement');\n const reachedMaxHeightRef = React.useRef(false);\n const initialPlacedRef = React.useRef(false);\n const originalPositionerStylesRef = React.useRef({});\n const scrollArrowFrame = useAnimationFrame();\n const handleScroll = useStableCallback(scroller => {\n if (!positionerElement || !store.context.popupRef.current || !initialPlacedRef.current) {\n return;\n }\n const isTopPositioned = positionerElement.style.top === '0px';\n const isBottomPositioned = positionerElement.style.bottom === '0px';\n if (reachedMaxHeightRef.current || !alignItemWithTriggerActive || !isTopPositioned && !isBottomPositioned) {\n store.context.handleScrollArrowVisibility(scroller);\n return;\n }\n const scale = getScale(positionerElement);\n const currentHeight = normalizeSize(positionerElement.getBoundingClientRect().height, 'y', scale);\n const doc = ownerDocument(positionerElement);\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const marginTop = parseFloat(positionerStyles.marginTop);\n const marginBottom = parseFloat(positionerStyles.marginBottom);\n const maxPopupHeight = getMaxPopupHeight(win.getComputedStyle(store.context.popupRef.current));\n const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);\n const scrollTop = scroller.scrollTop;\n const maxScrollTop = getMaxScrollTop(scroller);\n\n // `Infinity` requests a scroll to the recomputed maximum offset.\n let nextScrollTop = null;\n const setHeight = height => {\n positionerElement.style.height = `${height}px`;\n };\n const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;\n const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);\n if (diff <= SCROLL_EDGE_TOLERANCE_PX) {\n const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);\n if (heightDelta > 0) {\n // Consume the remaining scroll in height.\n setHeight(currentHeight + heightDelta);\n }\n scroller.scrollTop = isTopPositioned ? maxScrollTop : 0;\n if (maxAvailableHeight - (currentHeight + heightDelta) <= SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n store.context.handleScrollArrowVisibility(scroller);\n return;\n }\n if (maxAvailableHeight - nextHeight > SCROLL_EDGE_TOLERANCE_PX) {\n nextScrollTop = isTopPositioned ? Infinity : 0;\n } else if (isBottomPositioned && scrollTop < maxScrollTop) {\n const overshoot = currentHeight + diff - maxAvailableHeight;\n nextScrollTop = scrollTop - (diff - overshoot);\n }\n const nextPositionerHeight = Math.ceil(nextHeight);\n if (nextPositionerHeight !== 0) {\n setHeight(nextPositionerHeight);\n }\n if (nextScrollTop != null) {\n // Recompute bounds after resizing (clientHeight likely changed).\n const target = clamp(nextScrollTop, 0, getMaxScrollTop(scroller));\n\n // Avoid adjustments that re-trigger scroll events forever.\n if (Math.abs(scroller.scrollTop - target) > SCROLL_EDGE_TOLERANCE_PX) {\n scroller.scrollTop = target;\n }\n }\n if (nextPositionerHeight >= maxAvailableHeight - SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n store.context.handleScrollArrowVisibility(scroller);\n });\n React.useImperativeHandle(store.context.scrollHandlerRef, () => handleScroll, [handleScroll]);\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete(true);\n }\n }\n });\n const state = {\n open,\n transitionStatus,\n side,\n align\n };\n useIsoLayoutEffect(() => {\n if (!positionerElement || !store.context.popupRef.current || Object.keys(originalPositionerStylesRef.current).length) {\n return;\n }\n originalPositionerStylesRef.current = {\n top: positionerElement.style.top || '0',\n left: positionerElement.style.left || '0',\n right: positionerElement.style.right,\n height: positionerElement.style.height,\n bottom: positionerElement.style.bottom,\n minHeight: positionerElement.style.minHeight,\n maxHeight: positionerElement.style.maxHeight,\n marginTop: positionerElement.style.marginTop,\n marginBottom: positionerElement.style.marginBottom\n };\n }, [store, positionerElement]);\n useIsoLayoutEffect(() => {\n if (open || alignItemWithTriggerActive) {\n return;\n }\n initialPlacedRef.current = false;\n reachedMaxHeightRef.current = false;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n }, [open, alignItemWithTriggerActive, positionerElement]);\n useIsoLayoutEffect(() => {\n const popupElement = store.context.popupRef.current;\n\n // Wait for Floating UI's first positioning pass before reading DOM geometry.\n // We replace the final coordinates for aligned selects, but still need middleware\n // like `size()` to set CSS variables such as `--anchor-width`.\n if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === 'ending') {\n return;\n }\n initialPlacedRef.current = true;\n popupElement.style.removeProperty(SelectPositionerCssVars.transformOrigin);\n if (!alignItemWithTriggerActive) {\n // The wrapper supplies the scroller: the list owns scrolling once it has mounted, and\n // this effect re-runs (cancelling the stale frame) when that happens.\n scrollArrowFrame.request(() => store.context.handleScrollArrowVisibility(listElement || popupElement));\n return;\n }\n\n // Ensure we remove any transforms that can affect the location of the popup\n // and therefore the calculations.\n const restoreTransformStyles = unsetTransformStyles(popupElement);\n try {\n let textElement = store.context.selectedItemTextRef.current;\n if (!textElement?.isConnected) {\n const hasSelectedValue = store.select('hasSelectedValue');\n textElement = !hasSelectedValue && store.context.firstItemTextRef.current?.isConnected ? store.context.firstItemTextRef.current : null;\n }\n const valueElement = store.context.valueRef.current;\n const win = ownerWindow(positionerElement);\n const positionerStyles = win.getComputedStyle(positionerElement);\n const popupStyles = win.getComputedStyle(popupElement);\n const doc = ownerDocument(triggerElement);\n const scale = getScale(triggerElement);\n const triggerRect = normalizeRect(triggerElement.getBoundingClientRect(), scale);\n const positionerRect = normalizeRect(positionerElement.getBoundingClientRect(), scale);\n const triggerHeight = triggerRect.height;\n const scroller = listElement || popupElement;\n const scrollHeight = scroller.scrollHeight;\n const borderBottom = parseFloat(popupStyles.borderBottomWidth);\n // The `|| N` fallbacks cover an unset/`auto` value (parses to `NaN`). Note a literal `0`\n // also resolves to the fallback, so an explicit `margin: 0` or `min-height: 0` still takes\n // the default below.\n const marginTop = parseFloat(positionerStyles.marginTop) || 10;\n const marginBottom = parseFloat(positionerStyles.marginBottom) || 10;\n const minHeight = parseFloat(positionerStyles.minHeight) || 100;\n const maxPopupHeight = getMaxPopupHeight(popupStyles);\n const paddingLeft = 5;\n const paddingRight = 5;\n const triggerCollisionThreshold = 20;\n const viewportHeight = doc.documentElement.clientHeight - marginTop - marginBottom;\n const viewportWidth = doc.documentElement.clientWidth;\n const availableSpaceBeneathTrigger = viewportHeight - triggerRect.bottom + triggerHeight;\n let textRect;\n let alignedLeft = direction === 'rtl' ? triggerRect.right - positionerRect.width : triggerRect.left;\n let offsetY = 0;\n if (textElement && valueElement) {\n const valueRect = normalizeRect(valueElement.getBoundingClientRect(), scale);\n textRect = normalizeRect(textElement.getBoundingClientRect(), scale);\n alignedLeft = positionerRect.left + (direction === 'rtl' ? valueRect.right - textRect.right : valueRect.left - textRect.left);\n const valueCenterFromTriggerTop = valueRect.top - triggerRect.top + valueRect.height / 2;\n const textCenterFromPositionerTop = textRect.top - positionerRect.top + textRect.height / 2;\n offsetY = textCenterFromPositionerTop - valueCenterFromTriggerTop;\n }\n const idealHeight = availableSpaceBeneathTrigger + offsetY + marginBottom + borderBottom;\n let height = Math.min(viewportHeight, idealHeight);\n const maxHeight = viewportHeight - marginTop - marginBottom;\n const scrollTop = idealHeight - height;\n const maxRight = viewportWidth - paddingRight;\n positionerElement.style.left = `${clamp(alignedLeft, paddingLeft, maxRight - positionerRect.width)}px`;\n positionerElement.style.height = `${height}px`;\n // `none` (not the invalid `auto`) so the explicit height governs in align mode and isn't\n // clamped by a `max-height` from user CSS.\n positionerElement.style.maxHeight = 'none';\n positionerElement.style.marginTop = `${marginTop}px`;\n positionerElement.style.marginBottom = `${marginBottom}px`;\n popupElement.style.height = '100%';\n const maxScrollTop = getMaxScrollTop(scroller);\n const isTopPositioned = scrollTop >= maxScrollTop - SCROLL_EDGE_TOLERANCE_PX;\n if (isTopPositioned) {\n height = Math.min(viewportHeight, positionerRect.height) - (scrollTop - maxScrollTop);\n }\n\n // When the trigger is too close to the top or bottom of the viewport, or the minHeight is\n // reached, we fallback to aligning the popup to the trigger as the UX is poor otherwise.\n const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + SCROLL_EDGE_TOLERANCE_PX < Math.min(scrollHeight, minHeight);\n\n // Safari doesn't position the popup correctly when pinch-zoomed.\n const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && platform.engine.webkit;\n if (fallbackToAlignPopupToTrigger || isPinchZoomed) {\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n setControlledAlignItemWithTrigger(false);\n return;\n }\n const initialHeight = Math.max(minHeight, height);\n if (isTopPositioned) {\n const topOffset = Math.max(0, viewportHeight - idealHeight);\n positionerElement.style.top = positionerRect.height >= maxHeight ? '0' : `${topOffset}px`;\n positionerElement.style.height = `${height}px`;\n scroller.scrollTop = getMaxScrollTop(scroller);\n } else {\n positionerElement.style.bottom = '0';\n scroller.scrollTop = scrollTop;\n }\n if (textRect) {\n const popupTop = positionerRect.top;\n const popupHeight = positionerRect.height;\n const textCenterY = textRect.top + textRect.height / 2;\n const clampedY = clamp(popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50, 0, 100);\n popupElement.style.setProperty(SelectPositionerCssVars.transformOrigin, `50% ${clampedY}%`);\n }\n if (initialHeight === viewportHeight || height >= maxPopupHeight) {\n reachedMaxHeightRef.current = true;\n }\n store.context.handleScrollArrowVisibility(scroller);\n if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && store.context.listRef.current[0] != null) {\n store.set('activeIndex', 0);\n }\n } finally {\n restoreTransformStyles();\n }\n }, [store, open, positionerElement, triggerElement, alignItemWithTriggerActive, setControlledAlignItemWithTrigger, scrollArrowFrame, listElement, highlightItemOnHover, direction, isPositioned]);\n React.useEffect(() => {\n if (!alignItemWithTriggerActive || !positionerElement || !open) {\n return undefined;\n }\n const win = ownerWindow(positionerElement);\n function handleResize(event) {\n store.context.setOpen(false, createChangeEventDetails(REASONS.windowResize, event));\n }\n return addEventListener(win, 'resize', handleResize);\n }, [store, alignItemWithTriggerActive, positionerElement, open]);\n const defaultProps = {\n ...(listElement ? {\n role: 'presentation'\n } : {\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n 'aria-readonly': readOnly || undefined,\n id: `${id}-list`\n }),\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n onScroll(event) {\n if (listElement) {\n return;\n }\n handleScroll(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: listElement ? {\n height: '100%'\n } : LIST_FUNCTIONAL_STYLES\n }),\n className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : undefined\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.context.popupRef],\n state,\n stateAttributesMapping,\n props: [popupProps, defaultProps, getDisabledMountTransitionStyles(transitionStatus), elementProps]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n modal: false,\n disabled: !mounted,\n openInteractionType: openMethod,\n returnFocus: finalFocus,\n restoreFocus: true,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPopup.displayName = \"SelectPopup\";\nfunction getMaxPopupHeight(popupStyles) {\n const maxHeightStyle = popupStyles.maxHeight;\n return maxHeightStyle.endsWith('px') ? parseFloat(maxHeightStyle) || Infinity : Infinity;\n}\nfunction getMaxScrollTop(scroller) {\n return getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n}\nfunction getScale(element) {\n // The platform API is async-capable, but the DOM platform returns a plain scale object.\n return floatingPlatform.getScale(element);\n}\nfunction normalizeSize(size, axis, scale) {\n return size / scale[axis];\n}\nfunction normalizeRect(rect, scale) {\n return rectToClientRect({\n x: normalizeSize(rect.x, 'x', scale),\n y: normalizeSize(rect.y, 'y', scale),\n width: normalizeSize(rect.width, 'x', scale),\n height: normalizeSize(rect.height, 'y', scale)\n });\n}\nconst TRANSFORM_STYLE_RESETS = [['transform', 'none'], ['scale', '1'], ['translate', '0 0']];\nfunction unsetTransformStyles(popupElement) {\n const {\n style\n } = popupElement;\n const originalStyles = {};\n for (const [property, value] of TRANSFORM_STYLE_RESETS) {\n originalStyles[property] = style.getPropertyValue(property);\n style.setProperty(property, value, 'important');\n }\n return () => {\n for (const [property] of TRANSFORM_STYLE_RESETS) {\n const originalValue = originalStyles[property];\n if (originalValue) {\n style.setProperty(property, originalValue);\n } else {\n style.removeProperty(property);\n }\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useSelectRootContext();\n const multiple = store.useState('multiple');\n const readOnly = store.useState('readOnly');\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = store.useState('hasScrollArrows');\n const openMethod = store.useState('openMethod');\n const id = store.useState('id');\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n 'aria-readonly': readOnly || undefined,\n onScroll(event) {\n store.context.scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = store.useStateSetter('listElement');\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.mjs\";\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n guess,\n label,\n metadata,\n textRef,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n } = useCompositeListContext();\n\n // Guess the index from the render order. This avoids a re-render after mount for\n // flat lists rendered in DOM order; when the guess is wrong (grouped or out-of-order\n // rendering), the commit flush corrects it before paint.\n const indexRef = React.useRef(-1);\n const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1);\n const index = externalIndex ?? internalIndex;\n const componentRef = React.useRef(null);\n\n // Deliberately identity-sensitive: nested items sharing one DOM node rely on ref attachment\n // order to decide which registration wins, and republishing from an effect instead would let\n // an inner item's later update silently take ownership from the outer one.\n const ref = React.useCallback(node => {\n const previousNode = componentRef.current;\n if (previousNode) {\n unregister(previousNode);\n }\n componentRef.current = node;\n if (node) {\n register(node, {\n metadata: metadata ?? null,\n index: externalIndex ?? null,\n label,\n textRef\n });\n }\n }, [externalIndex, register, unregister, metadata, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setInternalIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange]);\n return {\n ref,\n index\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectItemContext.displayName = \"SelectItemContext\";\nexport function useSelectItemContext() {\n const context = React.useContext(SelectItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.' : _formatErrorMessage(57));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useCompositeListItem } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { SelectItemContext } from \"./SelectItemContext.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { compareItemEquality, removeItem, resolveSelectedIndex } from \"../../internals/itemEquality.mjs\";\nimport { isVirtualClick } from \"../../floating-ui-react/utils/event.mjs\";\n\n/**\n * An individual option in the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n value: itemValue = null,\n label,\n disabled: disabledProp = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n guess: true,\n label,\n textRef\n });\n const store = useSelectRootContext();\n const {\n props: itemProps,\n multiple,\n disabled: selectDisabled,\n readOnly,\n isItemEqualToValue\n } = store.useState('itemRoot');\n const disabled = selectDisabled || disabledProp;\n const highlighted = store.useState('isActive', listItem.index);\n const open = store.useState('open');\n const selected = store.useState('isSelected', itemValue);\n const selectedByFocus = store.useState('isSelectedByFocus', listItem.index);\n const index = listItem.index;\n const itemRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n const values = store.context.valuesRef.current;\n values[index] = itemValue;\n return () => {\n delete values[index];\n };\n }, [index, itemValue, store]);\n useIsoLayoutEffect(() => {\n const selectedValue = store.state.value;\n const currentIndex = store.state.selectedIndex;\n let nextIndex = currentIndex;\n let claims;\n if (multiple && Array.isArray(selectedValue)) {\n // The claiming item also owns the text ref that aligns the popup.\n nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, currentIndex);\n claims = nextIndex === index;\n if (index === currentIndex && !claims) {\n store.context.selectedItemTextRef.current = null;\n }\n } else {\n claims = selectedValue !== undefined && compareItemEquality(itemValue, selectedValue, isItemEqualToValue);\n if (claims) {\n nextIndex = index;\n }\n }\n store.set('selectedIndex', nextIndex);\n\n // Make sure SelectPopup can measure the selected item on first open.\n // SelectItemText can still update this ref later when focus moves.\n if (claims && textRef.current) {\n store.context.selectedItemTextRef.current = textRef.current;\n }\n }, [index, multiple, isItemEqualToValue, store, itemValue]);\n const pointerTypeRef = React.useRef('mouse');\n const allowMouseSelectionRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(event) {\n // A forced-open select (`open`/`defaultOpen`) can still receive item activations even\n // when the root is disabled or read-only, so guard the commit here too.\n if (selectDisabled || readOnly) {\n return;\n }\n const selectedValue = store.state.value;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];\n store.context.setValue(nextValue, createChangeEventDetails(REASONS.itemPress, event));\n } else {\n store.context.setValue(itemValue, createChangeEventDetails(REASONS.itemPress, event));\n store.context.setOpen(false, createChangeEventDetails(REASONS.itemPress, event));\n }\n }\n function resetDragMovement() {\n store.context.selectionRef.current.dragY = 0;\n }\n const defaultProps = {\n role: 'option',\n 'aria-selected': selected,\n tabIndex: open && highlighted ? 0 : -1,\n onKeyDown(event) {\n store.set('activeIndex', index);\n if (event.key === ' ' && store.context.typingRef.current) {\n // `useButton` skips Space activation for `role=\"option\"` items when the keydown\n // is `defaultPrevented`, keeping typeahead spaces from committing a selection.\n event.preventDefault();\n }\n },\n onClick(event) {\n const isMouseClick = pointerTypeRef.current !== 'touch';\n const clickPointerType = event.nativeEvent.pointerType;\n const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (\n // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual\n // clicks that carry browser pointer data, including an empty string from assistive\n // technology, can activate unhighlighted items.\n clickPointerType !== undefined || highlighted);\n // With alignItemWithTrigger, opening can place an item under the cursor. Real mouse\n // clicks must start on the item, while virtual clicks represent explicit keyboard or\n // assistive technology activation.\n const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;\n allowMouseSelectionRef.current = false;\n if (disabled || isInvalidMouseClick) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerMove(event) {\n if (event.pointerType === 'mouse' && event.buttons === 1) {\n const selection = store.context.selectionRef.current;\n selection.dragY += event.movementY;\n if (selection.dragY ** 2 >= 64) {\n selection.allowUnselectedMouseUp = true;\n }\n }\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n allowMouseSelectionRef.current = true;\n resetDragMovement();\n },\n onMouseUp() {\n resetDragMovement();\n if (disabled || pointerTypeRef.current === 'touch') {\n return;\n }\n\n // Regular clicks are committed by the click event.\n if (allowMouseSelectionRef.current) {\n return;\n }\n const disallowSelectedMouseUp = !store.context.selectionRef.current.allowSelectedMouseUp && selected;\n const disallowUnselectedMouseUp = !store.context.selectionRef.current.allowUnselectedMouseUp && !selected;\n if (disallowSelectedMouseUp || disallowUnselectedMouseUp) {\n return;\n }\n allowMouseSelectionRef.current = true;\n itemRef.current?.click();\n allowMouseSelectionRef.current = false;\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n index,\n textRef,\n selectedByFocus\n }), [selected, index, textRef, selectedByFocus]);\n return /*#__PURE__*/_jsx(SelectItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItem.displayName = \"SelectItem\";","'use client';\n\nimport * as React from 'react';\nimport { useTransitionStatus } from \"../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../internals/useOpenChangeComplete.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\nimport { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\n\n// The public wrappers mount this component only when selected or kept mounted, avoiding the\n// hook costs for unselected items. Pass selection as a prop so memoization observes changes.\nexport const ItemIndicator = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted,\n selected,\n ...elementProps\n } = componentProps;\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n batch: true,\n enabled: !selected,\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") ItemIndicator.displayName = \"ItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { ItemIndicator } from \"../../utils/ItemIndicator.mjs\";\n\n/**\n * Indicates whether the select item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItemIndicator = /*#__PURE__*/React.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {\n const {\n selected\n } = useSelectItemContext();\n const shouldRender = componentProps.keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ItemIndicator, {\n ...componentProps,\n selected: selected,\n ref: forwardedRef\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectItemIndicator.displayName = \"SelectItemIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectItemContext } from \"../item/SelectItemContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * A text label of the select item.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectItemText = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItemText(componentProps, forwardedRef) {\n const {\n index,\n textRef,\n selectedByFocus\n } = useSelectItemContext();\n const store = useSelectRootContext();\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const localRef = React.useCallback(node => {\n if (!node) {\n return;\n }\n if (index === 0) {\n store.context.firstItemTextRef.current = node;\n }\n if (selectedByFocus) {\n store.context.selectedItemTextRef.current = node;\n }\n }, [store, index, selectedByFocus]);\n const element = useRenderElement('div', componentProps, {\n ref: [localRef, forwardedRef, textRef],\n props: elementProps\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItemText.displayName = \"SelectItemText\";","/*!\nCopyright (c) 2023 Paul Miller (paulmillr.com)\nThe library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.\nYou can select a license of your choice.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n/**\n * Methods for encoding (generating) QR code patterns.\n * Check out decode.ts for decoding (reading).\n * @module\n * @example\n```js\nimport encodeQR from 'qr';\nconst txt = 'Hello world';\nconst ascii = encodeQR(txt, 'ascii'); // Not all fonts are supported\nconst terminalFriendly = encodeQR(txt, 'term'); // 2x larger, all fonts are OK\nconst gifBytes = encodeQR(txt, 'gif'); // Uncompressed GIF\nconst svgElement = encodeQR(txt, 'svg'); // SVG vector image element\nconst array = encodeQR(txt, 'raw'); // 2d array for canvas or other libs\n// import decodeQR from 'qr/decode.js';\n```\n */\n// We do not use newline escape code directly in strings because it's not parser-friendly\nconst chCodes = { newline: 10, reset: 27 };\nfunction assertNumber(n) {\n if (!Number.isSafeInteger(n))\n throw new Error(`integer expected: ${n}`);\n}\nfunction validateVersion(ver) {\n if (!Number.isSafeInteger(ver) || ver < 1 || ver > 40)\n throw new Error(`Invalid version=${ver}. Expected number [1..40]`);\n}\nfunction bin(dec, pad) {\n return dec.toString(2).padStart(pad, '0');\n}\nfunction mod(a, b) {\n const result = a % b;\n return result >= 0 ? result : b + result;\n}\nfunction fillArr(length, val) {\n return new Array(length).fill(val);\n}\nfunction popcnt(n) {\n n = n - ((n >>> 1) & 0x55555555);\n n = (n & 0x33333333) + ((n >>> 2) & 0x33333333);\n return (((n + (n >>> 4)) & 0x0f0f0f0f) * 0x01010101) >>> 24;\n}\n/**\n * Interleaves byte blocks.\n * @param blocks [[1, 2, 3], [4, 5, 6]]\n * @returns [1, 4, 2, 5, 3, 6]\n */\nfunction interleaveBytes(blocks) {\n let maxLen = 0;\n let totalLen = 0;\n for (const block of blocks) {\n maxLen = Math.max(maxLen, block.length);\n totalLen += block.length;\n }\n const result = new Uint8Array(totalLen);\n let idx = 0;\n for (let i = 0; i < maxLen; i++) {\n for (const block of blocks) {\n if (i < block.length)\n result[idx++] = block[i];\n }\n }\n return result;\n}\n// Optimize for minimal score/penalty\nfunction best() {\n let best;\n let bestScore = Infinity;\n return {\n add(score, value) {\n if (score >= bestScore)\n return;\n best = value;\n bestScore = score;\n },\n get: () => best,\n score: () => bestScore,\n };\n}\n// Based on https://github.com/paulmillr/scure-base/blob/main/index.ts\nfunction alphabet(alphabet) {\n return {\n has: (char) => alphabet.includes(char),\n decode: (input) => {\n if (!Array.isArray(input) || (input.length && typeof input[0] !== 'string'))\n throw new Error('alphabet.decode input should be array of strings');\n return input.map((letter) => {\n if (typeof letter !== 'string')\n throw new Error(`alphabet.decode: not string element=${letter}`);\n const index = alphabet.indexOf(letter);\n if (index === -1)\n throw new Error(`Unknown letter: \"${letter}\". Allowed: ${alphabet}`);\n return index;\n });\n },\n encode: (digits) => {\n if (!Array.isArray(digits) || (digits.length && typeof digits[0] !== 'number'))\n throw new Error('alphabet.encode input should be an array of numbers');\n return digits.map((i) => {\n assertNumber(i);\n if (i < 0 || i >= alphabet.length)\n throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet.length})`);\n return alphabet[i];\n });\n },\n };\n}\n// Transpose 32x32 bit matrix in-place\n// a[0..31] are 32 rows of 32 bits each; after transpose they become 32 columns.\nfunction transpose32(a) {\n if (a.length !== 32)\n throw new Error('expects 32 element matrix');\n const masks = [0x55555555, 0x33333333, 0x0f0f0f0f, 0x00ff00ff, 0x0000ffff];\n // Hello again, FFT\n for (let stage = 0; stage < 5; stage++) {\n const m = masks[stage] >>> 0;\n const s = 1 << stage; // 1,2,4,8,16\n const step = s << 1; // 2,4,8,16,32\n for (let i = 0; i < 32; i += step) {\n for (let k = 0; k < s; k++) {\n const i0 = i + k;\n const i1 = i0 + s;\n const x = a[i0] >>> 0;\n const y = a[i1] >>> 0;\n const t = ((x >>> s) ^ y) & m;\n a[i0] = (x ^ (t << s)) >>> 0;\n a[i1] = (y ^ t) >>> 0;\n }\n }\n }\n}\nconst bitMask = (x) => (1 << (x & 31)) >>> 0;\nconst rangeMask = (shift, len) => {\n // len in [0..32], shift in [0..31]\n if (len === 0)\n return 0;\n if (len === 32)\n return 0xffffffff;\n return (((1 << len) - 1) << shift) >>> 0;\n};\nexport class Bitmap {\n static size(size, limit) {\n if (typeof size === 'number')\n size = { height: size, width: size };\n if (!Number.isSafeInteger(size.height) && size.height !== Infinity)\n throw new Error(`Bitmap: invalid height=${size.height} (${typeof size.height})`);\n if (!Number.isSafeInteger(size.width) && size.width !== Infinity)\n throw new Error(`Bitmap: invalid width=${size.width} (${typeof size.width})`);\n if (limit !== undefined) {\n // Clamp length, so it won't overflow, also allows to use Infinity, so we draw until end\n size = {\n width: Math.min(size.width, limit.width),\n height: Math.min(size.height, limit.height),\n };\n }\n return size;\n }\n static fromString(s) {\n // Remove linebreaks on start and end, so we draw in `` section\n s = s.replace(/^\\n+/g, '').replace(/\\n+$/g, '');\n const lines = s.split(String.fromCharCode(chCodes.newline));\n const height = lines.length;\n let width;\n const rows = [];\n for (const line of lines) {\n const row = line.split('').map((i) => {\n if (i === 'X')\n return true;\n if (i === ' ')\n return false;\n if (i === '?')\n return undefined;\n throw new Error(`Bitmap.fromString: unknown symbol=${i}`);\n });\n if (width !== undefined && row.length !== width)\n throw new Error(`Bitmap.fromString different row sizes: width=${width} cur=${row.length}`);\n width = row.length;\n rows.push(row);\n }\n if (width === undefined)\n width = 0;\n return new Bitmap({ height, width }, rows);\n }\n // Two bitsets:\n // defined=0 -> undefined\n // defined=1,value=0 -> false\n // defined=1,value=1 -> true\n defined;\n value;\n tailMask;\n words;\n fullWords;\n height;\n width;\n constructor(size, data) {\n const { height, width } = Bitmap.size(size);\n this.height = height;\n this.width = width;\n this.tailMask = rangeMask(0, width & 31 || 32);\n this.words = Math.ceil(width / 32) | 0;\n this.fullWords = Math.floor(width / 32) | 0;\n this.value = new Uint32Array(this.words * height);\n this.defined = new Uint32Array(this.value.length);\n if (data) {\n // accept same semantics as old version\n if (data.length !== height)\n throw new Error(`Bitmap: data height mismatch: exp=${height} got=${data.length}`);\n for (let y = 0; y < height; y++) {\n const row = data[y];\n if (!row || row.length !== width)\n throw new Error(`Bitmap: data width mismatch at y=${y}: exp=${width} got=${row?.length}`);\n for (let x = 0; x < width; x++)\n this.set(x, y, row[x]);\n }\n }\n }\n point(p) {\n return this.get(p.x, p.y);\n }\n isInside(p) {\n return 0 <= p.x && p.x < this.width && 0 <= p.y && p.y < this.height;\n }\n size(offset) {\n if (!offset)\n return { height: this.height, width: this.width };\n const { x, y } = this.xy(offset);\n return { height: this.height - y, width: this.width - x };\n }\n xy(c) {\n if (typeof c === 'number')\n c = { x: c, y: c };\n if (!Number.isSafeInteger(c.x))\n throw new Error(`Bitmap: invalid x=${c.x}`);\n if (!Number.isSafeInteger(c.y))\n throw new Error(`Bitmap: invalid y=${c.y}`);\n // Do modulo, so we can use negative positions\n c.x = mod(c.x, this.width);\n c.y = mod(c.y, this.height);\n return c;\n }\n /**\n * Return pixel bit index\n */\n wordIndex(x, y) {\n return y * this.words + (x >>> 5);\n }\n bitIndex(x, y) {\n return { word: this.wordIndex(x, y), bit: x & 31 };\n }\n isDefined(x, y) {\n const wi = this.wordIndex(x, y);\n const m = bitMask(x);\n return (this.defined[wi] & m) !== 0;\n }\n get(x, y) {\n const wi = this.wordIndex(x, y);\n const m = bitMask(x);\n return (this.value[wi] & m) !== 0;\n }\n maskWord(wi, mask, v) {\n const { defined, value } = this;\n defined[wi] |= mask;\n value[wi] = (value[wi] & ~mask) | (-v & mask);\n }\n set(x, y, v) {\n if (v === undefined)\n return;\n this.maskWord(this.wordIndex(x, y), bitMask(x), v);\n }\n // word-span fill for constant values (fast path)\n fillRectConst(x0, y0, w, h, v) {\n if (w <= 0 || h <= 0)\n return;\n if (v === undefined)\n return;\n const { value, defined, words } = this;\n const startWord = x0 >>> 5;\n const endWord = (x0 + w - 1) >>> 5;\n const startBit = x0 & 31;\n const endBit = (x0 + w - 1) & 31;\n for (let ry = 0; ry < h; ry++) {\n const rowBase = (y0 + ry) * words;\n if (startWord === endWord) {\n const mask = rangeMask(startBit, endBit - startBit + 1);\n this.maskWord(rowBase + startWord, mask, v);\n continue;\n }\n this.maskWord(rowBase + startWord, rangeMask(startBit, 32 - startBit), v);\n for (let i = startWord + 1; i < endWord; i++) {\n defined[rowBase + i] = 0xffffffff;\n value[rowBase + i] = v ? 0xffffffff : 0;\n }\n this.maskWord(rowBase + endWord, rangeMask(0, endBit + 1), v);\n }\n }\n rectWords(x, y, width, height, cb) {\n for (let yPos = 0; yPos < height; yPos++) {\n const Py = y + yPos;\n for (let xPos = 0; xPos < width;) {\n const bitX = x + xPos;\n const { bit, word } = this.bitIndex(bitX, Py);\n const bitsPerWord = Math.min(32 - bit, width - xPos);\n cb(word, bitX, xPos, yPos, bitsPerWord);\n xPos += bitsPerWord;\n }\n }\n }\n // Basically every operation can be represented as rect\n rect(c, size, fn) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(size, this.size({ x, y }));\n if (typeof fn !== 'function') {\n this.fillRectConst(x, y, width, height, fn);\n return this;\n }\n const { defined, value } = this;\n this.rectWords(x, y, width, height, (wi, bitX, xPos, yPos, n) => {\n let defWord = 0;\n let valWord = value[wi];\n for (let b = 0; b < n; b++) {\n const mask = bitMask(bitX + b);\n const res = fn({ x: xPos + b, y: yPos }, (valWord & mask) !== 0);\n if (res === undefined)\n continue;\n defWord |= mask;\n valWord = (valWord & ~mask) | (-res & mask);\n }\n defined[wi] |= defWord;\n value[wi] = valWord;\n });\n return this;\n }\n // returns rectangular part of bitmap\n rectRead(c, size, fn) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(size, this.size({ x, y }));\n const { value } = this;\n this.rectWords(x, y, width, height, (wi, bitX, xPos, yPos, n) => {\n const valWord = value[wi];\n for (let b = 0; b < n; b++) {\n const mask = bitMask(bitX + b);\n fn({ x: xPos + b, y: yPos }, (valWord & mask) !== 0);\n }\n });\n return this;\n }\n // Horizontal & vertical lines\n hLine(c, len, value) {\n return this.rect(c, { width: len, height: 1 }, value);\n }\n vLine(c, len, value) {\n return this.rect(c, { width: 1, height: len }, value);\n }\n // add border\n border(border = 2, value) {\n const height = this.height + 2 * border;\n const width = this.width + 2 * border;\n const out = new Bitmap({ height, width });\n // fill everything with border value, then embed original\n out.rect(0, Infinity, value);\n out.embed({ x: border, y: border }, this);\n return out;\n }\n // Embed another bitmap on coordinates\n embed(c, src) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(src.size(), this.size({ x, y }));\n if (width <= 0 || height <= 0)\n return this;\n const { value, defined } = this;\n const { words: srcStride, value: srcValue } = src;\n for (let yPos = 0; yPos < height; yPos++) {\n const srcRow = yPos * srcStride;\n for (let xPos = 0; xPos < width;) {\n const dstX = x + xPos;\n const { word: dstWord, bit: dstBit } = this.bitIndex(dstX, y + yPos);\n const { word: srcWord, bit: srcBit } = src.bitIndex(xPos, yPos);\n const len = Math.min(32 - dstBit, width - xPos);\n const w0 = srcValue[srcWord];\n const w1 = srcBit && srcWord + 1 < srcRow + srcStride ? srcValue[srcWord + 1] : 0;\n const sVal = srcBit ? ((w0 >>> srcBit) | (w1 << (32 - srcBit))) >>> 0 : w0;\n const dstMask = rangeMask(dstBit, len);\n const valBits = ((sVal & rangeMask(0, len)) << dstBit) >>> 0;\n defined[dstWord] |= dstMask;\n value[dstWord] = (value[dstWord] & ~dstMask) | valBits;\n xPos += len;\n }\n }\n return this;\n }\n // returns rectangular part of bitmap\n rectSlice(c, size = this.size()) {\n const { x, y } = this.xy(c);\n const { height, width } = Bitmap.size(size, this.size({ x, y }));\n const rect = new Bitmap({ height, width });\n this.rectRead({ x, y }, { height, width }, (p, cur) => {\n if (this.isDefined(x + p.x, y + p.y)) {\n rect.set(p.x, p.y, cur);\n }\n });\n return rect;\n }\n // Change shape, replace rows with columns (data[y][x] -> data[x][y])\n transpose() {\n const { height, width, value, defined, words } = this;\n const dst = new Bitmap({ height: width, width: height });\n const { words: dstStride, value: dstValue, defined: dstDefined, tailMask: dstTail } = dst;\n const tmpV = new Uint32Array(32);\n const tmpD = new Uint32Array(32);\n // Process src in blocks: y in [by..by+31], x in 32-bit words\n for (let by = 0; by < height; by += 32) {\n for (let bx = 0; bx < words; bx++) {\n const rows = Math.min(32, height - by);\n for (let r = 0; r < rows; r++) {\n const wi = this.wordIndex(32 * bx, by + r);\n tmpV[r] = value[wi];\n tmpD[r] = defined[wi];\n }\n // zero-pad remainder\n tmpV.fill(0, rows);\n tmpD.fill(0, rows);\n transpose32(tmpV);\n transpose32(tmpD);\n for (let i = 0; i < 32; i++) {\n const dstY = bx * 32 + i;\n if (dstY >= width)\n break;\n const dstPos = dst.wordIndex(by, dstY);\n const curMask = by >>> 5 === dstStride - 1 ? dstTail : 0xffffffff;\n dstValue[dstPos] = tmpV[i] & curMask;\n dstDefined[dstPos] = tmpD[i] & curMask;\n }\n }\n }\n return dst;\n }\n // black <-> white (inplace)\n negate() {\n const n = this.defined.length;\n for (let i = 0; i < n; i++) {\n this.value[i] = ~this.value[i];\n this.defined[i] = 0xffffffff;\n }\n return this;\n }\n // Each pixel size is multiplied by factor\n scale(factor) {\n if (!Number.isSafeInteger(factor) || factor > 1024)\n throw new Error(`invalid scale factor: ${factor}`);\n const { height, width } = this;\n const res = new Bitmap({ height: factor * height, width: factor * width });\n return res.rect({ x: 0, y: 0 }, Infinity, ({ x, y }) => this.get((x / factor) | 0, (y / factor) | 0));\n }\n clone() {\n const res = new Bitmap(this.size());\n res.defined.set(this.defined);\n res.value.set(this.value);\n return res;\n }\n // Ensure that there is no undefined values left\n assertDrawn() {\n const { height, width, defined, tailMask, fullWords, words } = this;\n if (!height || !width)\n return;\n for (let y = 0; y < height; y++) {\n const rowBase = y * words;\n for (let wi = 0; wi < fullWords; wi++) {\n if (defined[rowBase + wi] !== 0xffffffff)\n throw new Error(`Invalid color type=undefined`);\n }\n if (words !== fullWords && (defined[rowBase + fullWords] & tailMask) !== tailMask)\n throw new Error(`Invalid color type=undefined`);\n }\n }\n countPatternInRow(y, patternLen, ...patterns) {\n if (patternLen <= 0 || patternLen >= 32)\n throw new Error('wrong patternLen');\n const mask = (1 << patternLen) - 1;\n const { width, value, words } = this;\n let count = 0;\n const rowBase = this.wordIndex(0, y);\n for (let i = 0, window = 0; i < words; i++) {\n const w = value[rowBase + i];\n const bitEnd = i === words - 1 ? width & 31 || 32 : 32;\n for (let b = 0; b < bitEnd; b++) {\n window = ((window << 1) | ((w >>> b) & 1)) & mask;\n if (i * 32 + b + 1 < patternLen)\n continue;\n for (const p of patterns) {\n if (window !== p)\n continue;\n count++;\n break;\n }\n }\n }\n return count;\n }\n getRuns(y, fn) {\n const { width, value, words } = this;\n if (width === 0)\n return;\n let runLen = 0;\n let runValue;\n const rowBase = this.wordIndex(0, y);\n for (let i = 0; i < words; i++) {\n const word = value[rowBase + i];\n const bitEnd = i === words - 1 ? width & 31 || 32 : 32;\n for (let b = 0; b < bitEnd; b++) {\n const bit = (word & (1 << b)) !== 0;\n if (bit === runValue) {\n runLen++;\n continue;\n }\n if (runValue !== undefined)\n fn(runLen, runValue);\n runValue = bit;\n runLen = 1;\n }\n }\n if (runValue !== undefined)\n fn(runLen, runValue);\n }\n popcnt() {\n const { height, width, words, fullWords, tailMask } = this;\n if (!height || !width)\n return 0;\n let count = 0;\n for (let y = 0; y < height; y++) {\n const rowBase = y * words;\n for (let wi = 0; wi < fullWords; wi++)\n count += popcnt(this.value[rowBase + wi]);\n if (words !== fullWords)\n count += popcnt(this.value[rowBase + fullWords] & tailMask);\n }\n return count;\n }\n countBoxes2x2(y) {\n const { width, words } = this;\n if (width < 2 || (y | 0) < 0 || y + 1 >= this.height)\n return 0;\n const base0 = this.wordIndex(0, y) | 0;\n const base1 = this.wordIndex(0, y + 1) | 0;\n // valid \"left-edge\" positions x in [0 .. W-2]\n const tailBits = width & 31;\n const validLast = tailBits === 0 ? 0x7fffffff : rangeMask(0, (width - 1) & 31);\n let boxes = 0;\n for (let wi = 0; wi < words; wi++) {\n const a0 = this.value[base0 + wi];\n const a1 = this.value[base1 + wi];\n // Compare bit x with bit x+1 at same bit position.\n const eqV = ~(a0 ^ a1) >>> 0; // row0[x] == row1[x]\n const n0 = wi + 1 < words ? this.value[base0 + wi + 1] >>> 0 : 0;\n const eqH0 = ~(a0 ^ (((a0 >>> 1) | ((n0 & 1) << 31)) >>> 0)) >>> 0; // row0[x] == row0[x+1]\n const n1 = wi + 1 < words ? this.value[base1 + wi + 1] >>> 0 : 0;\n const eqH1 = ~(a1 ^ (((a1 >>> 1) | ((n1 & 1) << 31)) >>> 0)) >>> 0; // row1[x] == row1[x+1]\n let m = (eqV & eqH0 & eqH1) >>> 0;\n if (wi === words - 1)\n m &= validLast;\n boxes += popcnt(m);\n }\n return boxes;\n }\n // Export\n toString() {\n const nl = String.fromCharCode(chCodes.newline);\n let out = '';\n for (let y = 0; y < this.height; y++) {\n let line = '';\n for (let x = 0; x < this.width; x++) {\n const v = this.get(x, y);\n line += !this.isDefined(x, y) ? '?' : v ? 'X' : ' ';\n }\n out += line + (y + 1 === this.height ? '' : nl);\n }\n return out;\n }\n toRaw() {\n const out = Array.from({ length: this.height }, () => new Array(this.width));\n for (let y = 0; y < this.height; y++) {\n const row = out[y];\n for (let x = 0; x < this.width; x++)\n row[x] = this.get(x, y);\n }\n return out;\n }\n toASCII() {\n const { height, width } = this;\n let out = '';\n // Terminal character height is x2 of character width, so we process two rows of bitmap\n // to produce one row of ASCII\n for (let y = 0; y < height; y += 2) {\n for (let x = 0; x < width; x++) {\n const first = this.get(x, y);\n const second = y + 1 >= height ? true : this.get(x, y + 1); // if last row outside bitmap, make it black\n if (!first && !second)\n out += '█'; // both rows white (empty)\n else if (!first && second)\n out += '▀'; // top row white\n else if (first && !second)\n out += '▄'; // down row white\n else if (first && second)\n out += ' '; // both rows black\n }\n out += String.fromCharCode(chCodes.newline);\n }\n return out;\n }\n toTerm() {\n const cc = String.fromCharCode(chCodes.reset);\n const reset = cc + '[0m';\n const whiteBG = cc + '[1;47m ' + reset;\n const darkBG = cc + `[40m ` + reset;\n const nl = String.fromCharCode(chCodes.newline);\n let out = '';\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n const v = this.get(x, y); // undefined -> white\n out += v ? darkBG : whiteBG;\n }\n out += nl;\n }\n return out;\n }\n toSVG(optimize = true) {\n let out = `<svg viewBox=\"0 0 ${this.width} ${this.height}\" xmlns=\"http://www.w3.org/2000/svg\">`;\n // Construct optimized SVG path data.\n let pathData = '';\n let prevPoint;\n this.rectRead(0, Infinity, (point, val) => {\n if (!val)\n return;\n const { x, y } = point;\n if (!optimize) {\n out += `<rect x=\"${x}\" y=\"${y}\" width=\"1\" height=\"1\" />`;\n return;\n }\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d#path_commands\n // Determine the shortest way to represent the initial cursor movement.\n // M - Move cursor (without drawing) to absolute coordinate pair.\n let m = `M${x} ${y}`;\n // Only allow using the relative cursor move command if previous points\n // were drawn.\n if (prevPoint) {\n // m - Move cursor (without drawing) to relative coordinate pair.\n const relM = `m${x - prevPoint.x} ${y - prevPoint.y}`;\n if (relM.length <= m.length)\n m = relM;\n }\n // Determine the shortest way to represent the cell's bottom line draw.\n // H - Draw line from cursor position to absolute x coordinate.\n // h - Draw line from cursor position to relative x coordinate.\n const bH = x < 10 ? `H${x}` : 'h-1';\n // v - Draw line from cursor position to relative y coordinate.\n // Z - Close path (draws line from cursor position to M coordinate).\n pathData += `${m}h1v1${bH}Z`;\n prevPoint = point;\n });\n if (optimize)\n out += `<path d=\"${pathData}\"/>`;\n out += `</svg>`;\n return out;\n }\n toGIF() {\n // NOTE: Small, but inefficient implementation.\n // Uses 1 byte per pixel.\n const u16le = (i) => [i & 0xff, (i >>> 8) & 0xff];\n const dims = [...u16le(this.width), ...u16le(this.height)];\n const data = [];\n this.rectRead(0, Infinity, (_, cur) => data.push(+(cur === true)));\n const N = 126; // Block size\n // prettier-ignore\n const bytes = [\n 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, ...dims, 0xf6, 0x00, 0x00, 0xff, 0xff, 0xff,\n ...fillArr(3 * 127, 0x00), 0x2c, 0x00, 0x00, 0x00, 0x00, ...dims, 0x00, 0x07\n ];\n const fullChunks = Math.floor(data.length / N);\n // Full blocks\n for (let i = 0; i < fullChunks; i++)\n bytes.push(N + 1, 0x80, ...data.slice(N * i, N * (i + 1)).map((i) => +i));\n // Remaining bytes\n bytes.push((data.length % N) + 1, 0x80, ...data.slice(fullChunks * N).map((i) => +i));\n bytes.push(0x01, 0x81, 0x00, 0x3b);\n return new Uint8Array(bytes);\n }\n toImage(isRGB = false) {\n const { height, width } = this.size();\n const data = new Uint8Array(height * width * (isRGB ? 3 : 4));\n let i = 0;\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const value = this.get(x, y) ? 0 : 255; // undefined -> white\n data[i++] = value;\n data[i++] = value;\n data[i++] = value;\n if (!isRGB)\n data[i++] = 255; // alpha channel\n }\n }\n return { height, width, data };\n }\n}\n// End of utils\n// Runtime type-checking\n/** Error correction mode. low: 7%, medium: 15%, quartile: 25%, high: 30% */\nexport const ECMode = ['low', 'medium', 'quartile', 'high'];\n/** QR Code encoding */\nexport const Encoding = ['numeric', 'alphanumeric', 'byte', 'kanji', 'eci'];\n// Various constants & tables\n// prettier-ignore\nconst BYTES = [\n // 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n // 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706,\n];\n// prettier-ignore\nconst WORDS_PER_BLOCK = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n medium: [10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n quartile: [13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n high: [17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n};\n// prettier-ignore\nconst ECC_BLOCKS = {\n // Version 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40\n low: [1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n medium: [1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n quartile: [1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n high: [1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81],\n};\nconst info = {\n size: {\n encode: (ver) => 21 + 4 * (ver - 1), // ver1 = 21, ver40=177 blocks\n decode: (size) => (size - 17) / 4,\n },\n sizeType: (ver) => Math.floor((ver + 7) / 17),\n // Based on https://codereview.stackexchange.com/questions/74925/algorithm-to-generate-this-alignment-pattern-locations-table-for-qr-codes\n alignmentPatterns(ver) {\n if (ver === 1)\n return [];\n const first = 6;\n const last = info.size.encode(ver) - first - 1;\n const distance = last - first;\n const count = Math.ceil(distance / 28);\n let interval = Math.floor(distance / count);\n if (interval % 2)\n interval += 1;\n else if ((distance % count) * 2 >= count)\n interval += 2;\n const res = [first];\n for (let m = 1; m < count; m++)\n res.push(last - (count - m) * interval);\n res.push(last);\n return res;\n },\n ECCode: {\n low: 0b01,\n medium: 0b00,\n quartile: 0b11,\n high: 0b10,\n },\n formatMask: 0b101010000010010,\n formatBits(ecc, maskIdx) {\n const data = (info.ECCode[ecc] << 3) | maskIdx;\n let d = data;\n for (let i = 0; i < 10; i++)\n d = (d << 1) ^ ((d >> 9) * 0b10100110111);\n return ((data << 10) | d) ^ info.formatMask;\n },\n versionBits(ver) {\n let d = ver;\n for (let i = 0; i < 12; i++)\n d = (d << 1) ^ ((d >> 11) * 0b1111100100101);\n return (ver << 12) | d;\n },\n alphabet: {\n numeric: alphabet('0123456789'),\n alphanumerc: alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'),\n }, // as Record<EncodingType, ReturnType<typeof alphabet>>,\n lengthBits(ver, type) {\n const table = {\n numeric: [10, 12, 14],\n alphanumeric: [9, 11, 13],\n byte: [8, 16, 16],\n kanji: [8, 10, 12],\n eci: [0, 0, 0],\n };\n return table[type][info.sizeType(ver)];\n },\n modeBits: {\n numeric: '0001',\n alphanumeric: '0010',\n byte: '0100',\n kanji: '1000',\n eci: '0111',\n },\n capacity(ver, ecc) {\n const bytes = BYTES[ver - 1];\n const words = WORDS_PER_BLOCK[ecc][ver - 1];\n const numBlocks = ECC_BLOCKS[ecc][ver - 1];\n const blockLen = Math.floor(bytes / numBlocks) - words;\n const shortBlocks = numBlocks - (bytes % numBlocks);\n return {\n words,\n numBlocks,\n shortBlocks,\n blockLen,\n capacity: (bytes - words * numBlocks) * 8,\n total: (words + blockLen) * numBlocks + numBlocks - shortBlocks,\n };\n },\n};\nconst PATTERNS = [\n (x, y) => (x + y) % 2 == 0,\n (_x, y) => y % 2 == 0,\n (x, _y) => x % 3 == 0,\n (x, y) => (x + y) % 3 == 0,\n (x, y) => (Math.floor(y / 2) + Math.floor(x / 3)) % 2 == 0,\n (x, y) => ((x * y) % 2) + ((x * y) % 3) == 0,\n (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 == 0,\n (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 == 0,\n];\n// Galois field && reed-solomon encoding\nconst GF = {\n tables: ((p_poly) => {\n const exp = fillArr(256, 0);\n const log = fillArr(256, 0);\n for (let i = 0, x = 1; i < 256; i++) {\n exp[i] = x;\n log[x] = i;\n x <<= 1;\n if (x & 0x100)\n x ^= p_poly;\n }\n return { exp, log };\n })(0x11d),\n exp: (x) => GF.tables.exp[x],\n log(x) {\n if (x === 0)\n throw new Error(`GF.log: invalid arg=${x}`);\n return GF.tables.log[x] % 255;\n },\n mul(x, y) {\n if (x === 0 || y === 0)\n return 0;\n return GF.tables.exp[(GF.tables.log[x] + GF.tables.log[y]) % 255];\n },\n add: (x, y) => x ^ y,\n pow: (x, e) => GF.tables.exp[(GF.tables.log[x] * e) % 255],\n inv(x) {\n if (x === 0)\n throw new Error(`GF.inverse: invalid arg=${x}`);\n return GF.tables.exp[255 - GF.tables.log[x]];\n },\n polynomial(poly) {\n if (poly.length == 0)\n throw new Error('GF.polymomial: invalid length');\n if (poly[0] !== 0)\n return poly;\n // Strip leading zeros\n let i = 0;\n for (; i < poly.length - 1 && poly[i] == 0; i++)\n ;\n return poly.slice(i);\n },\n monomial(degree, coefficient) {\n if (degree < 0)\n throw new Error(`GF.monomial: invalid degree=${degree}`);\n if (coefficient == 0)\n return [0];\n let coefficients = fillArr(degree + 1, 0);\n coefficients[0] = coefficient;\n return GF.polynomial(coefficients);\n },\n degree: (a) => a.length - 1,\n coefficient: (a, degree) => a[GF.degree(a) - degree],\n mulPoly(a, b) {\n if (a[0] === 0 || b[0] === 0)\n return [0];\n const res = fillArr(a.length + b.length - 1, 0);\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < b.length; j++) {\n res[i + j] = GF.add(res[i + j], GF.mul(a[i], b[j]));\n }\n }\n return GF.polynomial(res);\n },\n mulPolyScalar(a, scalar) {\n if (scalar == 0)\n return [0];\n if (scalar == 1)\n return a;\n const res = fillArr(a.length, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], scalar);\n return GF.polynomial(res);\n },\n mulPolyMonomial(a, degree, coefficient) {\n if (degree < 0)\n throw new Error('GF.mulPolyMonomial: invalid degree');\n if (coefficient == 0)\n return [0];\n const res = fillArr(a.length + degree, 0);\n for (let i = 0; i < a.length; i++)\n res[i] = GF.mul(a[i], coefficient);\n return GF.polynomial(res);\n },\n addPoly(a, b) {\n if (a[0] === 0)\n return b;\n if (b[0] === 0)\n return a;\n let smaller = a;\n let larger = b;\n if (smaller.length > larger.length)\n [smaller, larger] = [larger, smaller];\n let sumDiff = fillArr(larger.length, 0);\n let lengthDiff = larger.length - smaller.length;\n let s = larger.slice(0, lengthDiff);\n for (let i = 0; i < s.length; i++)\n sumDiff[i] = s[i];\n for (let i = lengthDiff; i < larger.length; i++)\n sumDiff[i] = GF.add(smaller[i - lengthDiff], larger[i]);\n return GF.polynomial(sumDiff);\n },\n remainderPoly(data, divisor) {\n const out = Array.from(data);\n for (let i = 0; i < data.length - divisor.length + 1; i++) {\n const elm = out[i];\n if (elm === 0)\n continue;\n for (let j = 1; j < divisor.length; j++) {\n if (divisor[j] !== 0)\n out[i + j] = GF.add(out[i + j], GF.mul(divisor[j], elm));\n }\n }\n return out.slice(data.length - divisor.length + 1, out.length);\n },\n divisorPoly(degree) {\n let g = [1];\n for (let i = 0; i < degree; i++)\n g = GF.mulPoly(g, [1, GF.pow(2, i)]);\n return g;\n },\n evalPoly(poly, a) {\n if (a == 0)\n return GF.coefficient(poly, 0); // Just return the x^0 coefficient\n let res = poly[0];\n for (let i = 1; i < poly.length; i++)\n res = GF.add(GF.mul(a, res), poly[i]);\n return res;\n },\n // TODO: cleanup\n euclidian(a, b, R) {\n // Force degree(a) >= degree(b)\n if (GF.degree(a) < GF.degree(b))\n [a, b] = [b, a];\n let rLast = a;\n let r = b;\n let tLast = [0];\n let t = [1];\n // while degree of Ri ≥ t/2\n while (2 * GF.degree(r) >= R) {\n let rLastLast = rLast;\n let tLastLast = tLast;\n rLast = r;\n tLast = t;\n if (rLast[0] === 0)\n throw new Error('rLast[0] === 0');\n r = rLastLast;\n let q = [0];\n const dltInverse = GF.inv(rLast[0]);\n while (GF.degree(r) >= GF.degree(rLast) && r[0] !== 0) {\n const degreeDiff = GF.degree(r) - GF.degree(rLast);\n const scale = GF.mul(r[0], dltInverse);\n q = GF.addPoly(q, GF.monomial(degreeDiff, scale));\n r = GF.addPoly(r, GF.mulPolyMonomial(rLast, degreeDiff, scale));\n }\n q = GF.mulPoly(q, tLast);\n t = GF.addPoly(q, tLastLast);\n if (GF.degree(r) >= GF.degree(rLast))\n throw new Error(`Division failed r: ${r}, rLast: ${rLast}`);\n }\n const sigmaTildeAtZero = GF.coefficient(t, 0);\n if (sigmaTildeAtZero == 0)\n throw new Error('sigmaTilde(0) was zero');\n const inverse = GF.inv(sigmaTildeAtZero);\n return [GF.mulPolyScalar(t, inverse), GF.mulPolyScalar(r, inverse)];\n },\n};\nfunction RS(eccWords) {\n return {\n encode(from) {\n const d = GF.divisorPoly(eccWords);\n const pol = Array.from(from);\n pol.push(...d.slice(0, -1).fill(0));\n return Uint8Array.from(GF.remainderPoly(pol, d));\n },\n decode(to) {\n const res = to.slice();\n const poly = GF.polynomial(Array.from(to));\n // Find errors\n let syndrome = fillArr(eccWords, 0);\n let hasError = false;\n for (let i = 0; i < eccWords; i++) {\n const evl = GF.evalPoly(poly, GF.exp(i));\n syndrome[syndrome.length - 1 - i] = evl;\n if (evl !== 0)\n hasError = true;\n }\n if (!hasError)\n return res;\n syndrome = GF.polynomial(syndrome);\n const monomial = GF.monomial(eccWords, 1);\n const [errorLocator, errorEvaluator] = GF.euclidian(monomial, syndrome, eccWords);\n // Error locations\n const locations = fillArr(GF.degree(errorLocator), 0);\n let e = 0;\n for (let i = 1; i < 256 && e < locations.length; i++) {\n if (GF.evalPoly(errorLocator, i) === 0)\n locations[e++] = GF.inv(i);\n }\n if (e !== locations.length)\n throw new Error('RS.decode: invalid errors number');\n for (let i = 0; i < locations.length; i++) {\n const pos = res.length - 1 - GF.log(locations[i]);\n if (pos < 0)\n throw new Error('RS.decode: invalid error location');\n const xiInverse = GF.inv(locations[i]);\n let denominator = 1;\n for (let j = 0; j < locations.length; j++) {\n if (i === j)\n continue;\n denominator = GF.mul(denominator, GF.add(1, GF.mul(locations[j], xiInverse)));\n }\n res[pos] = GF.add(res[pos], GF.mul(GF.evalPoly(errorEvaluator, xiInverse), GF.inv(denominator)));\n }\n return res;\n },\n };\n}\n// Interleaves blocks\nfunction interleave(ver, ecc) {\n const { words, shortBlocks, numBlocks, blockLen, total } = info.capacity(ver, ecc);\n const rs = RS(words);\n return {\n encode(bytes) {\n // Add error correction to bytes\n const blocks = [];\n const eccBlocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n const len = blockLen + (isShort ? 0 : 1);\n blocks.push(bytes.subarray(0, len));\n eccBlocks.push(rs.encode(bytes.subarray(0, len)));\n bytes = bytes.subarray(len);\n }\n const resBlocks = interleaveBytes(blocks);\n const resECC = interleaveBytes(eccBlocks);\n const res = new Uint8Array(resBlocks.length + resECC.length);\n res.set(resBlocks);\n res.set(resECC, resBlocks.length);\n return res;\n },\n decode(data) {\n if (data.length !== total)\n throw new Error(`interleave.decode: len(data)=${data.length}, total=${total}`);\n const blocks = [];\n for (let i = 0; i < numBlocks; i++) {\n const isShort = i < shortBlocks;\n blocks.push(new Uint8Array(words + blockLen + (isShort ? 0 : 1)));\n }\n // Short blocks\n let pos = 0;\n for (let i = 0; i < blockLen; i++) {\n for (let j = 0; j < numBlocks; j++)\n blocks[j][i] = data[pos++];\n }\n // Long blocks\n for (let j = shortBlocks; j < numBlocks; j++)\n blocks[j][blockLen] = data[pos++];\n // ECC\n for (let i = blockLen; i < blockLen + words; i++) {\n for (let j = 0; j < numBlocks; j++) {\n const isShort = j < shortBlocks;\n blocks[j][i + (isShort ? 0 : 1)] = data[pos++];\n }\n }\n // Decode\n // Error-correct and copy data blocks together into a stream of bytes\n const res = [];\n for (const block of blocks)\n res.push(...Array.from(rs.decode(block)).slice(0, -words));\n return Uint8Array.from(res);\n },\n };\n}\n// Draw\n// Generic template per version+ecc+mask. Can be cached, to speedup calculations.\nfunction drawTemplate(ver, ecc, maskIdx, test = false) {\n const size = info.size.encode(ver);\n let b = new Bitmap(size + 2);\n // Finder patterns\n // We draw full pattern and later slice, since before addition of borders finder is truncated by one pixel on sides\n const finder = new Bitmap(3).rect(0, 3, true).border(1, false).border(1, true).border(1, false);\n b = b\n .embed(0, finder) // top left\n .embed({ x: -finder.width, y: 0 }, finder) // top right\n .embed({ x: 0, y: -finder.height }, finder); // bottom left\n b = b.rectSlice(1, size);\n // Alignment patterns\n const align = new Bitmap(1).rect(0, 1, true).border(1, false).border(1, true);\n const alignPos = info.alignmentPatterns(ver);\n for (const y of alignPos) {\n for (const x of alignPos) {\n if (b.isDefined(x, y))\n continue;\n b.embed({ x: x - 2, y: y - 2 }, align); // center of pattern should be at position\n }\n }\n // Timing patterns\n b = b\n .hLine({ x: 0, y: 6 }, Infinity, ({ x }) => (b.isDefined(x, 6) ? undefined : x % 2 == 0))\n .vLine({ x: 6, y: 0 }, Infinity, ({ y }) => (b.isDefined(6, y) ? undefined : y % 2 == 0));\n // Format information\n {\n const bits = info.formatBits(ecc, maskIdx);\n const getBit = (i) => !test && ((bits >> i) & 1) == 1;\n // vertical\n for (let i = 0; i < 6; i++)\n b.set(8, i, getBit(i)); // right of top-left finder\n // TODO: re-write as lines, like:\n // b.vLine({ x: 8, y: 0 }, 6, ({ x, y }) => getBit(y));\n for (let i = 6; i < 8; i++)\n b.set(8, i + 1, getBit(i)); // after timing pattern\n for (let i = 8; i < 15; i++)\n b.set(8, size - 15 + i, getBit(i)); // right of bottom-left finder\n // horizontal\n for (let i = 0; i < 8; i++)\n b.set(size - i - 1, 8, getBit(i)); // under top-right finder\n for (let i = 8; i < 9; i++)\n b.set(15 - i - 1 + 1, 8, getBit(i)); // VVV, after timing\n for (let i = 9; i < 15; i++)\n b.set(15 - i - 1, 8, getBit(i)); // under top-left finder\n b.set(8, size - 8, !test); // bottom-left finder, right\n }\n // Version information\n if (ver >= 7) {\n const bits = info.versionBits(ver);\n for (let i = 0; i < 18; i += 1) {\n const bit = !test && ((bits >> i) & 1) == 1;\n const x = Math.floor(i / 3);\n const y = (i % 3) + size - 8 - 3;\n // two copies\n b.set(y, x, bit);\n b.set(x, y, bit);\n }\n }\n return b;\n}\n// zigzag: bottom->top && top->bottom\nfunction zigzag(tpl, maskIdx, fn) {\n const size = tpl.height;\n const pattern = PATTERNS[maskIdx];\n // zig-zag pattern\n let dir = -1;\n let y = size - 1;\n // two columns at time\n for (let xOffset = size - 1; xOffset > 0; xOffset -= 2) {\n if (xOffset == 6)\n xOffset = 5; // skip vertical timing pattern\n for (;; y += dir) {\n for (let j = 0; j < 2; j += 1) {\n const x = xOffset - j;\n if (tpl.isDefined(x, y))\n continue; // skip already written elements\n fn(x, y, pattern(x, y));\n }\n if (y + dir < 0 || y + dir >= size)\n break;\n }\n dir = -dir; // change direction\n }\n}\n// NOTE: byte encoding is just representation, QR works with strings only. Most decoders will fail on raw byte array,\n// since they expect unicode or other text encoding inside bytes\nfunction detectType(str) {\n let type = 'numeric';\n for (let x of str) {\n if (info.alphabet.numeric.has(x))\n continue;\n type = 'alphanumeric';\n if (!info.alphabet.alphanumerc.has(x))\n return 'byte';\n }\n return type;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nfunction encode(ver, ecc, data, type, encoder = utf8ToBytes) {\n let encoded = '';\n let dataLen = data.length;\n if (type === 'numeric') {\n const t = info.alphabet.numeric.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 2; i += 3)\n encoded += bin(t[i] * 100 + t[i + 1] * 10 + t[i + 2], 10);\n if (n % 3 === 1) {\n encoded += bin(t[n - 1], 4);\n }\n else if (n % 3 === 2) {\n encoded += bin(t[n - 2] * 10 + t[n - 1], 7);\n }\n }\n else if (type === 'alphanumeric') {\n const t = info.alphabet.alphanumerc.decode(data.split(''));\n const n = t.length;\n for (let i = 0; i < n - 1; i += 2)\n encoded += bin(t[i] * 45 + t[i + 1], 11);\n if (n % 2 == 1)\n encoded += bin(t[n - 1], 6); // pad if odd number of chars\n }\n else if (type === 'byte') {\n const utf8 = encoder(data);\n dataLen = utf8.length;\n encoded = Array.from(utf8)\n .map((i) => bin(i, 8))\n .join('');\n }\n else {\n throw new Error('encode: unsupported type');\n }\n const { capacity } = info.capacity(ver, ecc);\n const len = bin(dataLen, info.lengthBits(ver, type));\n let bits = info.modeBits[type] + len + encoded;\n if (bits.length > capacity)\n throw new Error('Capacity overflow');\n // Terminator\n bits += '0'.repeat(Math.min(4, Math.max(0, capacity - bits.length)));\n // Pad bits string untill full byte\n if (bits.length % 8)\n bits += '0'.repeat(8 - (bits.length % 8));\n // Add padding until capacity is full\n const padding = '1110110000010001';\n for (let idx = 0; bits.length !== capacity; idx++)\n bits += padding[idx % padding.length];\n // Convert a bitstring to array of bytes\n const bytes = Uint8Array.from(bits.match(/(.{8})/g).map((i) => Number(`0b${i}`)));\n return interleave(ver, ecc).encode(bytes);\n}\n// DRAW\nfunction drawQR(ver, ecc, data, maskIdx, test = false) {\n const b = drawTemplate(ver, ecc, maskIdx, test);\n let i = 0;\n const need = 8 * data.length;\n zigzag(b, maskIdx, (x, y, mask) => {\n let value = false;\n if (i < need) {\n value = ((data[i >>> 3] >> ((7 - i) & 7)) & 1) !== 0;\n i++;\n }\n b.set(x, y, value !== mask); // !== as xor\n });\n if (i !== need)\n throw new Error('QR: bytes left after draw');\n return b;\n}\nconst mkPattern = (pattern) => {\n const s = pattern.map((i) => (i ? '1' : '0')).join('');\n return { len: s.length, n: Number(`0b${s}`) };\n};\n// 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column, preceded or followed by light area 4 modules wide\nconst finderPattern = [true, false, true, true, true, false, true]; // dark:light:dark:light:dark\nconst lightPattern = [false, false, false, false]; // light area 4 modules wide\nconst P1 = mkPattern([...finderPattern, ...lightPattern]);\nconst P2 = mkPattern([...lightPattern, ...finderPattern]);\nfunction penalty(bm) {\n const { width, height } = bm;\n const transposed = bm.transpose();\n // Adjacent modules in row/column in same | No. of modules = (5 + i) color\n let adjacent = 0;\n for (let y = 0; y < height; y++) {\n bm.getRuns(y, (len) => {\n if (len >= 5)\n adjacent += 3 + (len - 5);\n });\n }\n for (let y = 0; y < width; y++) {\n transposed.getRuns(y, (len) => {\n if (len >= 5)\n adjacent += 3 + (len - 5);\n });\n }\n // Block of modules in same color (Block size = 2x2)\n let box = 0;\n for (let y = 0; y < height - 1; y++)\n box += 3 * bm.countBoxes2x2(y);\n let finder = 0;\n for (let y = 0; y < height; y++)\n finder += 40 * bm.countPatternInRow(y, P1.len, P1.n, P2.n);\n for (let y = 0; y < width; y++)\n finder += 40 * transposed.countPatternInRow(y, P1.len, P1.n, P2.n);\n // Proportion of dark modules in entire symbol\n // Add 10 points to a deviation of 5% increment or decrement in the proportion\n // ratio of dark module from the referential 50%\n let darkPixels = 0;\n darkPixels = bm.popcnt();\n //bm.rectRead(0, Infinity, (_c, val) => (darkPixels += val ? 1 : 0));\n // for (let y = 0; y < height; y++) {\n // for (let x = 0; x < width; x++) if (bm.get(x, y)) darkPixels++;\n // }\n const darkPercent = (darkPixels / (height * width)) * 100;\n const dark = 10 * Math.floor(Math.abs(darkPercent - 50) / 5);\n return adjacent + box + finder + dark;\n}\n// Selects best mask according to penalty, if no mask is provided\nfunction drawQRBest(ver, ecc, data, maskIdx) {\n if (maskIdx === undefined) {\n const bestMask = best();\n for (let mask = 0; mask < PATTERNS.length; mask++)\n bestMask.add(penalty(drawQR(ver, ecc, data, mask, true)), mask);\n maskIdx = bestMask.get();\n }\n if (maskIdx === undefined)\n throw new Error('Cannot find mask'); // Should never happen\n return drawQR(ver, ecc, data, maskIdx);\n}\nfunction validateECC(ec) {\n if (!ECMode.includes(ec))\n throw new Error(`Invalid error correction mode=${ec}. Expected: ${ECMode}`);\n}\nfunction validateEncoding(enc) {\n if (!Encoding.includes(enc))\n throw new Error(`Encoding: invalid mode=${enc}. Expected: ${Encoding}`);\n if (enc === 'kanji' || enc === 'eci')\n throw new Error(`Encoding: ${enc} is not supported (yet?).`);\n}\nfunction validateMask(mask) {\n if (![0, 1, 2, 3, 4, 5, 6, 7].includes(mask) || !PATTERNS[mask])\n throw new Error(`Invalid mask=${mask}. Expected number [0..7]`);\n}\nexport function encodeQR(text, output = 'raw', opts = {}) {\n const ecc = opts.ecc !== undefined ? opts.ecc : 'medium';\n validateECC(ecc);\n const encoding = opts.encoding !== undefined ? opts.encoding : detectType(text);\n validateEncoding(encoding);\n if (opts.mask !== undefined)\n validateMask(opts.mask);\n let ver = opts.version;\n let data, err = new Error('Unknown error');\n if (ver !== undefined) {\n validateVersion(ver);\n data = encode(ver, ecc, text, encoding, opts.textEncoder);\n }\n else {\n // If no version is provided, try to find smallest one which fits\n // Currently just scans all version, can be significantly speedup if needed\n for (let i = 1; i <= 40; i++) {\n try {\n data = encode(i, ecc, text, encoding, opts.textEncoder);\n ver = i;\n break;\n }\n catch (e) {\n err = e;\n }\n }\n }\n if (!ver || !data)\n throw err;\n let res = drawQRBest(ver, ecc, data, opts.mask);\n res.assertDrawn();\n const border = opts.border === undefined ? 2 : opts.border;\n if (!Number.isSafeInteger(border))\n throw new Error(`invalid border type=${typeof border}`);\n res = res.border(border, false); // Add border\n if (opts.scale !== undefined)\n res = res.scale(opts.scale); // Scale image\n if (output === 'raw')\n return res.toRaw();\n else if (output === 'ascii')\n return res.toASCII();\n else if (output === 'svg')\n return res.toSVG(opts.optimize);\n else if (output === 'gif')\n return res.toGIF();\n else if (output === 'term')\n return res.toTerm();\n else\n throw new Error(`Unknown output: ${output}`);\n}\nexport default encodeQR;\nexport const utils = {\n best,\n bin,\n popcnt,\n drawTemplate,\n fillArr,\n info,\n interleave,\n validateVersion,\n zigzag,\n};\n// Unsafe API utils, exported only for tests\nexport const _tests = {\n Bitmap,\n info,\n detectType,\n encode,\n drawQR,\n penalty,\n PATTERNS,\n};\n// Type tests\n// const o1 = qr('test', 'ascii');\n// const o2 = qr('test', 'raw');\n// const o3 = qr('test', 'gif');\n// const o4 = qr('test', 'svg');\n// const o5 = qr('test', 'term');\n//# sourceMappingURL=index.js.map","import { encodeQR } from 'qr';\nexport function create(value, options = {}) {\n const { errorCorrection, version } = options;\n const grid = encodeQR(value, 'raw', {\n border: 0,\n ecc: errorCorrection,\n scale: 1,\n version: version,\n });\n const finderLength = 7;\n const edgeLength = grid.length;\n return {\n edgeLength,\n finderLength,\n grid,\n value,\n };\n}\n//# sourceMappingURL=QrCode.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport * as QrCode from './QrCode.js';\n/**\n * Renders a QR code with a finder pattern, cells, and an `arena` (if provided).\n *\n * @params {@link Cuer.Props}\n * @returns A {@link React.ReactNode}\n */\nexport function Cuer(props) {\n const { arena, ...rest } = props;\n return (_jsxs(Cuer.Root, { ...rest, children: [_jsx(Cuer.Finder, {}), _jsx(Cuer.Cells, {}), arena && (_jsx(Cuer.Arena, { children: typeof arena === 'string' ? (_jsx(\"img\", { alt: \"Arena\", src: arena, style: {\n borderRadius: 1,\n height: '100%',\n objectFit: 'cover',\n width: '100%',\n } })) : (arena) }))] }));\n}\n(function (Cuer) {\n Cuer.Context = React.createContext(null);\n /**\n * Root component for the QR code.\n *\n * @params {@link Root.Props}\n * @returns A {@link React.ReactNode}\n */\n function Root(props) {\n const { children, size = '100%', value, version, errorCorrection, ...rest } = props;\n // Check if the children contain an `Arena` component.\n const hasArena = React.useMemo(() => (React.Children.map(children, (child) => {\n if (!React.isValidElement(child))\n return null;\n if (typeof child.type === 'string')\n return null;\n if ('displayName' in child.type &&\n child.type.displayName === 'Arena')\n return true;\n return null;\n }) ?? []).some(Boolean), [children]);\n // Create the QR code.\n const qrcode = React.useMemo(() => {\n let ecl = errorCorrection;\n // If the QR code has an arena, use a higher error correction level.\n if (hasArena && errorCorrection === 'low')\n ecl = 'medium';\n return QrCode.create(value, {\n errorCorrection: ecl,\n version,\n });\n }, [value, hasArena, errorCorrection, version]);\n const cellSize = 1;\n const edgeSize = qrcode.edgeLength * cellSize;\n const finderSize = (qrcode.finderLength * cellSize) / 2;\n const arenaSize = hasArena ? Math.floor(edgeSize / 4) : 0;\n const context = React.useMemo(() => ({ arenaSize, cellSize, edgeSize, qrcode, finderSize }), [arenaSize, edgeSize, qrcode, finderSize]);\n return (_jsx(Cuer.Context.Provider, { value: context, children: _jsxs(\"svg\", { ...rest, width: size, height: size, viewBox: `0 0 ${edgeSize} ${edgeSize}`, xmlns: \"http://www.w3.org/2000/svg\", children: [_jsx(\"title\", { children: \"QR Code\" }), children] }) }));\n }\n Cuer.Root = Root;\n (function (Root) {\n Root.displayName = 'Root';\n })(Root = Cuer.Root || (Cuer.Root = {}));\n /**\n * Finder component for the QR code. The finder pattern is the squares\n * on the top left, top right, and bottom left of the QR code.\n *\n * @params {@link Finder.Props}\n * @returns A {@link React.ReactNode}\n */\n function Finder(props) {\n const { className, fill, innerClassName, radius = 0.25 } = props;\n const { cellSize, edgeSize, finderSize } = React.useContext(Cuer.Context);\n function Inner({ position }) {\n let outerX = finderSize - (finderSize - cellSize) - cellSize / 2;\n if (position === 'top-right')\n outerX = edgeSize - finderSize - (finderSize - cellSize) - cellSize / 2;\n let outerY = finderSize - (finderSize - cellSize) - cellSize / 2;\n if (position === 'bottom-left')\n outerY = edgeSize - finderSize - (finderSize - cellSize) - cellSize / 2;\n let innerX = finderSize - cellSize * 1.5;\n if (position === 'top-right')\n innerX = edgeSize - finderSize - cellSize * 1.5;\n let innerY = finderSize - cellSize * 1.5;\n if (position === 'bottom-left')\n innerY = edgeSize - finderSize - cellSize * 1.5;\n return (_jsxs(_Fragment, { children: [_jsx(\"rect\", { className: className, stroke: fill ?? 'currentColor', fill: \"transparent\", x: outerX, y: outerY, width: cellSize + (finderSize - cellSize) * 2, height: cellSize + (finderSize - cellSize) * 2, rx: 2 * radius * (finderSize - cellSize), ry: 2 * radius * (finderSize - cellSize), strokeWidth: cellSize }), _jsx(\"rect\", { className: innerClassName, fill: fill ?? 'currentColor', x: innerX, y: innerY, width: cellSize * 3, height: cellSize * 3, rx: 2 * radius * cellSize, ry: 2 * radius * cellSize })] }));\n }\n return (_jsxs(_Fragment, { children: [_jsx(Inner, { position: \"top-left\" }), _jsx(Inner, { position: \"top-right\" }), _jsx(Inner, { position: \"bottom-left\" })] }));\n }\n Cuer.Finder = Finder;\n (function (Finder) {\n Finder.displayName = 'Finder';\n })(Finder = Cuer.Finder || (Cuer.Finder = {}));\n /**\n * Cells for the QR code.\n *\n * @params {@link Cells.Props}\n * @returns A {@link React.ReactNode}\n */\n function Cells(props) {\n const { className, fill = 'currentColor', inset: inset_ = true, radius = 1, } = props;\n const { arenaSize, cellSize, qrcode } = React.useContext(Cuer.Context);\n const { edgeLength, finderLength } = qrcode;\n const path = React.useMemo(() => {\n let path = '';\n for (let i = 0; i < qrcode.grid.length; i++) {\n const row = qrcode.grid[i];\n if (!row)\n continue;\n for (let j = 0; j < row.length; j++) {\n const cell = row[j];\n if (!cell)\n continue;\n // Skip rendering dots in arena area.\n const start = edgeLength / 2 - arenaSize / 2;\n const end = start + arenaSize;\n if (i >= start && i <= end && j >= start && j <= end)\n continue;\n // Skip rendering dots in the finder pattern areas\n const topLeftFinder = i < finderLength && j < finderLength;\n const topRightFinder = i < finderLength && j >= edgeLength - finderLength;\n const bottomLeftFinder = i >= edgeLength - finderLength && j < finderLength;\n if (topLeftFinder || topRightFinder || bottomLeftFinder)\n continue;\n // Add inset for padding\n const inset = inset_ ? cellSize * 0.1 : 0;\n const innerSize = (cellSize - inset * 2) / 2;\n // Calculate center positions\n const cx = j * cellSize + cellSize / 2;\n const cy = i * cellSize + cellSize / 2;\n // Calculate edge positions\n const left = cx - innerSize;\n const right = cx + innerSize;\n const top = cy - innerSize;\n const bottom = cy + innerSize;\n // Apply corner radius (clamped to maximum of innerSize)\n const r = radius * innerSize;\n path += [\n `M ${left + r},${top}`,\n `L ${right - r},${top}`,\n `A ${r},${r} 0 0,1 ${right},${top + r}`,\n `L ${right},${bottom - r}`,\n `A ${r},${r} 0 0,1 ${right - r},${bottom}`,\n `L ${left + r},${bottom}`,\n `A ${r},${r} 0 0,1 ${left},${bottom - r}`,\n `L ${left},${top + r}`,\n `A ${r},${r} 0 0,1 ${left + r},${top}`,\n 'z',\n ].join(' ');\n }\n }\n return path;\n }, [\n arenaSize,\n cellSize,\n edgeLength,\n finderLength,\n qrcode.grid,\n inset_,\n radius,\n ]);\n return _jsx(\"path\", { className: className, d: path, fill: fill });\n }\n Cuer.Cells = Cells;\n (function (Cells) {\n Cells.displayName = 'Cells';\n })(Cells = Cuer.Cells || (Cuer.Cells = {}));\n /**\n * Arena component for the QR code. The arena is the area in the center\n * of the QR code that is not part of the finder pattern.\n *\n * @params {@link Arena.Props}\n * @returns A {@link React.ReactNode}\n */\n function Arena(props) {\n const { children } = props;\n const { arenaSize, cellSize, edgeSize } = React.useContext(Cuer.Context);\n const start = Math.ceil(edgeSize / 2 - arenaSize / 2);\n const size = arenaSize + (arenaSize % 2);\n const padding = cellSize / 2;\n return (_jsx(\"foreignObject\", { x: start, y: start, width: size, height: size, children: _jsx(\"div\", { style: {\n alignItems: 'center',\n display: 'flex',\n fontSize: 1,\n justifyContent: 'center',\n height: '100%',\n overflow: 'hidden',\n width: '100%',\n padding,\n boxSizing: 'border-box',\n }, children: children }) }));\n }\n Cuer.Arena = Arena;\n (function (Arena) {\n Arena.displayName = 'Arena';\n })(Arena = Cuer.Arena || (Cuer.Arena = {}));\n})(Cuer || (Cuer = {}));\n//# sourceMappingURL=Cuer.js.map","export default \"data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8%2012.5493C8%2010.9893%208%2010.2107%208.29333%209.61333C8.576%209.04%209.04%208.57333%209.616%208.29333C10.2133%208%2010.992%208%2012.5493%208H51.4507C53.0107%208%2053.7867%208%2054.3867%208.29333C54.96%208.57333%2055.424%209.04%2055.704%209.61333C56%2010.2133%2056%2010.992%2056%2012.5493V51.4507C56%2053.0107%2056%2053.7867%2055.7067%2054.3867C55.424%2054.96%2054.96%2055.424%2054.3867%2055.704C53.7867%2056%2053.008%2056%2051.4507%2056H12.5493C10.9893%2056%2010.2133%2056%209.61333%2055.7067C9.03998%2055.4249%208.57656%2054.9606%208.296%2054.3867C8%2053.7867%208%2053.008%208%2051.4507V12.5493Z'%20fill='%230000FF'%20/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='64'%20fill='%23627EEA'%20/%3e%3cg%20transform='translate(18%208)'%3e%3cpath%20d='M14.996%200V17.74L29.99%2024.44L14.996%200Z'%20fill='white'%20fill-opacity='0.602'%20/%3e%3cpath%20d='M14.996%200L0%2024.44L14.996%2017.74V0Z'%20fill='white'%20/%3e%3cpath%20d='M14.996%2035.936V47.99L30%2027.232L14.996%2035.936Z'%20fill='white'%20fill-opacity='0.602'%20/%3e%3cpath%20d='M14.996%2047.99V35.934L0%2027.232L14.996%2047.99Z'%20fill='white'%20/%3e%3cpath%20d='M14.996%2033.146L29.99%2024.44L14.996%2017.744V33.146Z'%20fill='white'%20fill-opacity='0.2'%20/%3e%3cpath%20d='M0%2024.44L14.996%2033.146V17.744L0%2024.44Z'%20fill='white'%20fill-opacity='0.602'%20/%3e%3c/g%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='64'%20fill='black'%20/%3e%3cpath%20d='M46.964%2022.4753C46.7023%2022.7154%2046.3609%2022.8511%2046.005%2022.8563H12.3524C11.1577%2022.8563%2010.5556%2021.497%2011.3817%2020.7L16.9072%2015.3927C17.1641%2015.1449%2017.5064%2015.0044%2017.8639%2015H51.6496C52.8559%2015%2053.4463%2016.371%2052.6063%2017.1703L46.964%2022.4753ZM46.964%2048.6328C46.7026%2048.8718%2046.3599%2049.003%2046.005%2048.9999H12.3524C11.1577%2048.9999%2010.5556%2047.6522%2011.3817%2046.8552L16.9072%2041.5363C17.1662%2041.2936%2017.5083%2041.1582%2017.8639%2041.1576H51.6496C52.8559%2041.1576%2053.4463%2042.5169%2052.6063%2043.3139L46.964%2048.6328ZM46.964%2028.4517C46.7023%2028.2136%2046.3595%2028.0832%2046.005%2028.0869H12.3524C11.1577%2028.0869%2010.5556%2029.4346%2011.3817%2030.2293L16.9072%2035.5505C17.1687%2035.7893%2017.5092%2035.9241%2017.8639%2035.9293H51.6496C52.8559%2035.9293%2053.4463%2034.57%2052.6063%2033.7729L46.964%2028.4517Z'%20fill='white'%20/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='64'%20height='64'%20fill='black'%20/%3e%3cpath%20d='M29.689%2047H22.3877L29.1548%2026.12H20.5L22.3877%2020H46.5L44.6123%2026.12H36.4205L29.689%2047Z'%20fill='white'%20/%3e%3c/svg%3e\"","/**\n * Renders the deposit screen: the list of crypto networks a Tempo Account receives deposits on,\n * and the receive screen with the account's address and QR code for one network.\n * @module\n */\nimport { Select } from '@base-ui/react/select'\nimport { Link } from '@tanstack/react-router'\nimport { Cuer } from 'cuer'\nimport { type ReactNode, useState } from 'react'\nimport ArrowLeft from '~icons/lucide/arrow-left'\nimport Check from '~icons/lucide/check'\nimport ChevronDown from '~icons/lucide/chevron-down'\nimport ChevronRight from '~icons/lucide/chevron-right'\nimport Copy from '~icons/lucide/copy'\nimport Apple from '~icons/simple-icons/apple'\nimport { Button } from '../components/Button.js'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport pathUsd from '../components/icons/pathUSD.svg?url'\nimport usdc from '../components/icons/USDC.e.svg?url'\nimport usdt from '../components/icons/USDT0.svg?url'\nimport { Tooltip } from '../components/Tooltip.js'\nimport { style, variants } from '../zyzz.config.js'\nimport base from './chains/base.svg?url'\nimport ethereum from './chains/ethereum.svg?url'\nimport solana from './chains/solana.svg?url'\nimport tempo from './chains/tempo.svg?url'\n\n/** A network that deposits arrive on. Only Tempo receives them so far. */\ntype Network = {\n /** The tags the list shows, which name the network's main assets. */\n assets: readonly string[]\n /** Whether the screen accepts deposits on the network. */\n available: boolean\n /** The URL of the network's logo. */\n icon: string\n /** The network's ID. */\n id: 'base' | 'ethereum' | 'solana' | 'tempo'\n /** The network's display name. */\n name: string\n}\n\n// Base and Ethereum share the account's address format, but a transfer there does not reach Tempo,\n// so their receive screens stay unavailable until deposits bridge.\nconst networks: readonly Network[] = [\n {\n // The verified symbols, so a sender picks the exact token Tempo accepts.\n assets: ['USDC.e', 'USDT0', 'pathUSD'],\n available: true,\n icon: tempo,\n id: 'tempo',\n name: 'Tempo',\n },\n {\n assets: ['USDC', 'ETH', 'WETH', '+3'],\n available: false,\n icon: base,\n id: 'base',\n name: 'Base',\n },\n {\n assets: ['USDC', 'ETH', 'USDT', '+2'],\n available: false,\n icon: ethereum,\n id: 'ethereum',\n name: 'Ethereum',\n },\n {\n assets: ['USDC', 'SOL'],\n available: false,\n icon: solana,\n id: 'solana',\n name: 'Solana',\n },\n]\n\n/** The stablecoins a deposit on Tempo accepts. */\nconst stablecoins = [\n { icon: usdc, symbol: 'USDC.e' },\n { icon: usdt, symbol: 'USDT0' },\n { icon: pathUsd, symbol: 'pathUSD' },\n] as const\n\n/**\n * The deposit screen. Without `method` it lists the networks. With `method: 'tempo'` it shows the\n * account's address as a QR code and as text, with a copy control.\n */\nexport function Deposit(props: Deposit.Props): ReactNode {\n const Subtitle = props.heading === 'h4' ? 'h5' : 'h2'\n\n if (props.method === 'tempo')\n return (\n <div {...styles.column()}>\n <div {...styles.intro()}>\n <Header\n back={\n <Link\n {...styles.back()}\n aria-label=\"Back\"\n {...(props.address\n ? { search: { address: props.address }, to: '/deposit' }\n : { to: '/' })}\n >\n <ArrowLeft {...styles.backIcon()} aria-hidden />\n </Link>\n }\n heading={props.heading}\n title=\"Receive funds\"\n />\n <p {...styles.description()}>\n Send <strong>supported stablecoins</strong> to this address.\n </p>\n </div>\n {props.address ? (\n <Receive address={props.address} />\n ) : (\n <ErrorMessage>{props.error}</ErrorMessage>\n )}\n </div>\n )\n\n return (\n <div {...styles.column()}>\n <div {...styles.intro()}>\n <Header\n back={\n <Link {...styles.back()} aria-label=\"Back\" to=\"/\">\n <ArrowLeft {...styles.backIcon()} aria-hidden />\n </Link>\n }\n heading={props.heading}\n title=\"Deposit\"\n />\n <p {...styles.description()}>\n Choose an option below to send stablecoins to your wallet.\n </p>\n </div>\n {props.address ? (\n <>\n <section {...styles.section()}>\n <Subtitle {...styles.sectionTitle()}>Crypto</Subtitle>\n <ul {...styles.list()} role=\"list\">\n {networks.map((network) => (\n <li key={network.id}>\n <MethodRow\n address={network.available ? props.address : undefined}\n assets={network.assets}\n icon={<img {...styles.logo()} alt=\"\" src={network.icon} />}\n name={network.name}\n />\n </li>\n ))}\n </ul>\n </section>\n <section {...styles.section()}>\n <Subtitle {...styles.sectionTitle()}>Cash</Subtitle>\n <ul {...styles.list()} role=\"list\">\n <li>\n {/* The mark follows the text color, so it is black in light mode and white in dark mode. */}\n <MethodRow\n assets={['Coinbase']}\n icon={<Apple {...styles.apple()} aria-hidden />}\n name=\"Apple Pay\"\n />\n </li>\n </ul>\n </section>\n </>\n ) : (\n <ErrorMessage>{props.error}</ErrorMessage>\n )}\n </div>\n )\n}\n\nexport declare namespace Deposit {\n type Props = {\n /** The account that receives the deposit, or none when the address is not one of the user's. */\n address?: `0x${string}` | undefined\n /** Why the screen shows no address, such as an address that is not one of the user's. */\n error?: string | undefined\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** The method the screen shows, or none for the list of networks. */\n method?: 'tempo' | undefined\n }\n}\n\n/** The screen's title, with a link back. */\nfunction Header(props: Header.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n return (\n <header {...styles.header()}>\n {props.back}\n <Title {...styles.title()}>{props.title}</Title>\n </header>\n )\n}\n\ndeclare namespace Header {\n type Props = {\n /** The link back, which sits at the start of the title row. */\n back: ReactNode\n /** The level of the title: `h1` by default, or `h4` on the flows canvas. */\n heading?: 'h1' | 'h4' | undefined\n /** The screen's heading. */\n title: string\n }\n}\n\n/** One deposit method: a link when it is available, or a dimmed row marked as coming soon. */\nfunction MethodRow(props: MethodRow.Props): ReactNode {\n const { address } = props\n const content = (\n <>\n <span {...styles.methodIcon()}>{props.icon}</span>\n <span {...styles.networkBody()}>\n <span {...styles.networkName()}>{props.name}</span>\n <span {...styles.tags()}>\n {props.assets.map((asset) => (\n <span {...styles.tag()} key={asset}>\n {asset}\n </span>\n ))}\n </span>\n </span>\n {address ? (\n <ChevronRight {...styles.chevron()} aria-hidden />\n ) : (\n <span {...styles.soon()}>Coming soon</span>\n )}\n </>\n )\n\n // Only Tempo is available, so an available row opens its receive screen.\n if (address)\n return (\n <Link\n {...styles.network({ available: true })}\n search={{ address, method: 'tempo' }}\n to=\"/deposit\"\n >\n {content}\n </Link>\n )\n\n return (\n <div {...styles.network({ available: false })} aria-disabled>\n {content}\n </div>\n )\n}\n\ndeclare namespace MethodRow {\n type Props = {\n /** The account the receive screen opens for, or none when the method is unavailable. */\n address?: `0x${string}` | undefined\n /** The tags that name the method's assets or provider. */\n assets: readonly string[]\n /** The method's logo. */\n icon: ReactNode\n /** The method's name. */\n name: string\n }\n}\n\n/**\n * The account's address as a QR code and as text, a network picker, the accepted stablecoins, and\n * the controls that copy the address.\n */\nfunction Receive(props: Receive.Props): ReactNode {\n // The control that copied shows the confirmation, so the other keeps its label.\n const [status, setStatus] = useState<\n 'button' | 'failed' | 'icon' | undefined\n >()\n\n function copy(source: 'button' | 'icon') {\n // Both outcomes set the status, so the promise cannot reject. The `then` also catches a browser\n // without the Clipboard API, which throws on the property read.\n void Promise.resolve()\n .then(() => navigator.clipboard.writeText(props.address))\n .then(\n () => {\n setStatus(source)\n setTimeout(() => setStatus(undefined), 2000)\n },\n () => setStatus('failed'),\n )\n }\n\n return (\n <>\n <div {...styles.card()}>\n <span {...styles.cardHeader()}>\n <span {...styles.label()}>Deposit address</span>\n <button\n {...styles.copy()}\n aria-label={status === 'icon' ? 'Address copied' : 'Copy address'}\n onClick={() => copy('icon')}\n type=\"button\"\n >\n {status === 'icon' ? (\n <Check {...styles.icon()} aria-hidden />\n ) : (\n <Copy {...styles.icon()} aria-hidden />\n )}\n </button>\n </span>\n <div {...styles.qr()}>\n <Cuer arena={tempo} value={props.address} />\n </div>\n <code\n {...styles.address()}\n data-testid=\"deposit-address\"\n title={props.address}\n >\n {props.address}\n </code>\n </div>\n\n <div {...styles.fields()}>\n {/* Only Tempo is selectable, so the picker previews the networks that come later. */}\n <Select.Root value=\"tempo\">\n <div {...styles.field()}>\n <Select.Label {...styles.label()}>Network</Select.Label>\n <Select.Trigger {...styles.trigger()}>\n <Select.Value>\n {() => (\n <span {...styles.fieldValue()}>\n <img {...styles.fieldLogo()} alt=\"\" src={tempo} />\n Tempo\n </span>\n )}\n </Select.Value>\n <Select.Icon {...styles.triggerIcon()}>\n <ChevronDown {...styles.icon()} aria-hidden />\n </Select.Icon>\n </Select.Trigger>\n </div>\n <Select.Portal>\n <Select.Positioner\n align=\"end\"\n alignItemWithTrigger={false}\n sideOffset={8}\n >\n <Select.Popup {...styles.popup()}>\n <Select.List>\n {networks.map((network) => (\n <Select.Item\n {...styles.option()}\n disabled={!network.available}\n key={network.id}\n value={network.id}\n >\n <img {...styles.fieldLogo()} alt=\"\" src={network.icon} />\n <Select.ItemText>{network.name}</Select.ItemText>\n {network.available ? (\n <Select.ItemIndicator {...styles.indicator()}>\n <Check {...styles.icon()} aria-hidden />\n </Select.ItemIndicator>\n ) : (\n <span {...styles.soon()}>Coming soon</span>\n )}\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n\n <div {...styles.field()}>\n <span {...styles.label()}>Supported stablecoins</span>\n <span {...styles.coins()}>\n {stablecoins.map((coin) => (\n <Tooltip key={coin.symbol} label={coin.symbol}>\n <span {...styles.coin()} tabIndex={0}>\n <img\n {...styles.coinLogo()}\n alt={coin.symbol}\n height={20}\n src={coin.icon}\n width={20}\n />\n </span>\n </Tooltip>\n ))}\n </span>\n </div>\n </div>\n\n <p {...styles.warning()} role=\"note\">\n Only send <strong>supported stablecoins</strong> on{' '}\n <strong>Tempo</strong>. Sending other tokens or using a different\n network may result in permanent loss.\n </p>\n\n <div {...styles.actions()}>\n <Button onClick={() => copy('button')}>\n {status === 'button' ? 'Copied' : 'Copy address'}\n </Button>\n <Button to=\"/\" variant=\"secondary\">\n Done\n </Button>\n </div>\n <p {...styles.status()} aria-live=\"polite\" role=\"status\">\n {(() => {\n if (status === 'failed')\n return 'The address could not be copied. Select it and copy it manually.'\n if (status) return 'Address copied.'\n return undefined\n })()}\n </p>\n </>\n )\n}\n\ndeclare namespace Receive {\n type Props = {\n /** The address that receives the deposit. */\n address: `0x${string}`\n }\n}\n\nnamespace styles {\n // The two buttons share the row equally.\n export const actions = style({\n display: 'flex',\n gap: 3,\n '& > *': { flex: 1, minWidth: 0 },\n })\n\n // One line down to phone width. A narrower screen elides the end, and the QR code and copy control keep it whole.\n export const address = style({\n color: 'gray.900',\n overflow: 'hidden',\n textAlign: 'center',\n textOverflow: 'ellipsis',\n typography: 'label.12.mono',\n whiteSpace: 'nowrap',\n })\n\n export const apple = style({ color: 'foreground', height: 7, width: 7 })\n\n // Sits at the start of the title row, and its arrow hangs past the column edge. A phone's gutter\n // fits only a short hang.\n export const back = style({\n alignItems: 'center',\n borderRadius: 'full',\n bottom: 0,\n color: 'foreground',\n display: 'flex',\n height: 10,\n justifyContent: 'center',\n left: 'outdent',\n marginBlock: 'auto',\n outline: 'none',\n position: 'absolute',\n top: 0,\n width: 10,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n ':hover': { backgroundColor: 'grayAlpha.200' },\n // From this width, the gutter beside the column fits the wide hang.\n '@media (min-width: 32rem)': { left: 'outdentWide' },\n })\n\n export const backIcon = style({ height: 6, width: 6 })\n\n export const card = style({\n backgroundColor: 'background.surface',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: 'lg',\n display: 'grid',\n gap: 4,\n padding: 3,\n })\n\n export const cardHeader = style({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'space-between',\n })\n\n export const chevron = style({\n color: 'gray.900',\n flexShrink: 0,\n height: 4,\n marginLeft: 'auto',\n width: 4,\n })\n\n export const coin = style({\n borderRadius: 'full',\n outline: '2px solid',\n outlineColor: 'background.surface',\n ':focus-visible': { outlineColor: 'blue.700' },\n '@media (prefers-reduced-motion: no-preference)': {\n transitionDuration: '150ms',\n transitionProperty: 'margin',\n transitionTimingFunction: 'in-out',\n },\n })\n\n export const coinLogo = style({\n borderRadius: 'full',\n display: 'block',\n height: 5,\n width: 5,\n })\n\n // The coins overlap, and spread apart while hovered so each one can show its tooltip.\n export const coins = style({\n display: 'flex',\n flexShrink: 0,\n '& > span + span': { marginInlineStart: 'overlap' },\n '&:hover > span + span': { marginInlineStart: 1 },\n })\n\n export const column = style({\n display: 'grid',\n gap: 6,\n maxWidth: 'sm',\n width: 'full',\n })\n\n // The pseudo-element bleeds past the icon, so the touch target is larger than what shows.\n export const copy = style({\n backgroundColor: 'transparent',\n border: 'none',\n color: 'gray.900',\n cursor: 'pointer',\n display: 'flex',\n flexShrink: 0,\n outline: 'none',\n padding: 0,\n position: 'relative',\n '&::before': {\n content: '\"\"',\n inset: 'bleed',\n position: 'absolute',\n },\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n ':hover': { color: 'foreground' },\n })\n\n export const description = style({\n color: 'gray.900',\n textAlign: 'center',\n textWrap: 'balance',\n typography: 'copy.14',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const field = style({\n alignItems: 'center',\n display: 'flex',\n gap: 4,\n justifyContent: 'space-between',\n minHeight: 12,\n paddingInline: 4,\n })\n\n export const fieldLogo = style({ borderRadius: 'full', height: 5, width: 5 })\n\n // Select renders a hidden input between the rows, so the divider selects any later row.\n export const fields = style({\n backgroundColor: 'background.surface',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: 'lg',\n display: 'grid',\n '& > div ~ div': { borderTop: '1px solid', borderTopColor: 'gray.400' },\n })\n\n export const fieldValue = style({\n alignItems: 'center',\n display: 'flex',\n gap: 2,\n typography: 'label.14',\n })\n\n export const header = style({\n display: 'flex',\n justifyContent: 'center',\n position: 'relative',\n })\n\n export const icon = style({ height: 4, width: 4 })\n\n export const indicator = style({ display: 'flex', marginLeft: 'auto' })\n\n export const intro = style({ display: 'grid', gap: 2 })\n\n export const label = style({ color: 'gray.900', typography: 'label.14' })\n\n export const list = style({\n display: 'grid',\n gap: 1,\n listStyle: 'none',\n margin: 0,\n padding: 0,\n })\n\n export const logo = style({\n borderRadius: 'full',\n display: 'block',\n height: 9,\n width: 9,\n })\n\n export const methodIcon = style({\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: 9,\n justifyContent: 'center',\n width: 9,\n })\n\n export const network = variants({\n base: {\n alignItems: 'center',\n borderRadius: 'lg',\n color: 'foreground',\n display: 'flex',\n gap: 3,\n outline: 'none',\n padding: 2,\n textDecoration: 'none',\n },\n variants: {\n available: {\n false: { opacity: 0.5 },\n true: {\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n },\n ':hover': { backgroundColor: 'grayAlpha.200' },\n },\n },\n },\n })\n\n export const networkBody = style({ display: 'grid', gap: 1, minWidth: 0 })\n\n export const networkName = style({\n fontWeight: 'medium',\n typography: 'label.16',\n })\n\n export const option = style({\n alignItems: 'center',\n borderRadius: 'md',\n cursor: 'default',\n display: 'flex',\n gap: 2,\n outline: 'none',\n paddingBlock: 2,\n paddingInline: 2,\n typography: 'label.14',\n userSelect: 'none',\n '&[data-disabled]': { opacity: 0.5 },\n '&[data-highlighted]': { backgroundColor: 'grayAlpha.200' },\n })\n\n export const popup = style({\n backgroundColor: 'background.surface',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: 'lg',\n boxShadow: 'lg',\n minWidth: 56,\n outline: 'none',\n padding: 1,\n })\n\n // Scanners read dark modules on a light ground with a quiet zone, so the code keeps them in dark mode.\n export const qr = style({\n backgroundColor: 'white',\n borderRadius: 'md',\n color: 'black',\n justifySelf: 'center',\n padding: 2,\n width: 44,\n })\n\n export const section = style({ display: 'grid', gap: 2 })\n\n export const sectionTitle = style({ typography: 'heading.20' })\n\n export const soon = style({\n color: 'gray.900',\n flexShrink: 0,\n marginLeft: 'auto',\n typography: 'label.12',\n })\n\n export const status = style({\n color: 'gray.900',\n textAlign: 'center',\n typography: 'copy.13',\n })\n\n export const tag = style({\n backgroundColor: 'gray.200',\n borderRadius: 'sm',\n color: 'gray.900',\n paddingInline: 1,\n typography: 'label.12',\n })\n\n export const tags = style({ display: 'flex', flexWrap: 'wrap', gap: 1 })\n\n export const title = style({\n letterSpacing: 'title',\n textAlign: 'center',\n typography: 'heading.24',\n })\n\n // The negative margin keeps the label in line with the row while the hover fill bleeds outward.\n export const trigger = style({\n alignItems: 'center',\n backgroundColor: 'transparent',\n border: 'none',\n borderRadius: 'md',\n color: 'foreground',\n cursor: 'pointer',\n display: 'flex',\n gap: 2,\n marginRight: 'bleed',\n outline: 'none',\n paddingBlock: 2,\n paddingInline: 3,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n },\n ':hover': { backgroundColor: 'grayAlpha.200' },\n })\n\n export const triggerIcon = style({ color: 'gray.900', display: 'flex' })\n\n export const warning = style({\n backgroundColor: 'amber.100',\n border: '1px solid',\n borderColor: 'amber.400',\n borderRadius: 'lg',\n color: 'amber.900',\n padding: 4,\n typography: 'copy.13',\n '& strong': { fontWeight: 'medium' },\n })\n}\n","/** The deposit page: how to send stablecoins to one of the signed-in user's Tempo Accounts. @module */\nimport { createFileRoute } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { Deposit } from '../screens/Deposit.js'\nimport { style } from '../zyzz.config.js'\n\nexport const Route = createFileRoute('/deposit')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Redirects a visitor without a session to sign-in. Otherwise returns the method that the query\n * names, and the account at the query's `address` when it is one of the user's accounts in the\n * `default` realm. For another address, a spent account limit, or a failed read, it returns\n * `address: null` with the reason. The page creates no account.\n */\n loader: async (match): Promise<Page.Props> => {\n const client = Client.create()\n const session = await parseResponse(client.v1.auth.session.$get())\n // The sign-in page's query leaves the address out.\n if (!session.user) Loader.redirect({ href: '/login' })\n\n const { address, method } = match.deps\n const shown = method === 'tempo' ? method : null\n const account = await parseResponse(\n client.v1.account.$get({ query: {} }),\n ).catch((error: unknown) => ({ error }))\n if ('error' in account)\n return {\n address: null,\n error:\n Client.reason(account.error) === 'rate_limited'\n ? Client.message(account.error)\n : 'Your wallets failed to load. Reload the page to try again.',\n method: shown,\n }\n\n // Only one of the user's own accounts receives a deposit through this page.\n const found = account.tempo.find(\n (entry) => entry.address.toLowerCase() === address?.toLowerCase(),\n )\n if (!found)\n return {\n address: null,\n error:\n 'This wallet was not found. Go back to your account, then choose Deposit.',\n method: shown,\n }\n return { address: found.address, error: null, method: shown }\n },\n loaderDeps: (match: { search: Search }) => ({\n address: match.search.address,\n method: match.search.method,\n }),\n validateSearch: (search: Record<string, unknown>): Search => ({\n ...(typeof search.address === 'string' ? { address: search.address } : {}),\n ...(typeof search.method === 'string' ? { method: search.method } : {}),\n }),\n})\n\n/** The search parameters that the page reads. */\ntype Search = {\n /** The account that receives the deposit. */\n address?: string | undefined\n /** The method that the page shows, such as `tempo`, or the list of networks without one. */\n method?: string | undefined\n}\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n return (\n <main {...styles.page()} aria-label=\"Deposit\">\n <Deposit\n address={props.address ?? undefined}\n error={props.error ?? undefined}\n method={props.method ?? undefined}\n />\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** The account that receives the deposit, or `null` when the query names none of the user's. */\n address: `0x${string}` | null\n /** Why the page shows no address, or `null` when it shows one. */\n error: string | null\n /** The method that the page shows, or `null` for the list of networks. */\n method: 'tempo' | null\n }\n}\n\nnamespace styles {\n // Content starts at the same height as on the account page, so the titles line up.\n export const page = style({\n alignItems: 'flex-start',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","/**\n * Renders a one-time code field as a row of boxes, after Link's sign-in screen.\n * @module\n */\nimport {\n type ChangeEvent,\n type FocusEvent,\n Fragment,\n type InputHTMLAttributes,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { style } from '../zyzz.config.js'\n\n/**\n * One native input drawn as `length` boxes. The input stays uncontrolled, so forms read it from\n * `FormData`, and autofill and paste fill every box at once. The boxes show its letters and digits,\n * uppercased. `aria-invalid` draws them in red until the next keystroke. When `aria-invalid` turns\n * on, the field clears, takes focus, and shakes, so a refused code can be typed again at once.\n * `verified` tints the boxes green.\n */\nexport function CodeInput(props: CodeInput.Props): ReactNode {\n const { length, onBlur, onChange, onFocus, separator, verified, ...rest } =\n props\n const [value, setValue] = useState(String(rest.defaultValue ?? ''))\n const [focused, setFocused] = useState(false)\n // Typing after a refusal clears the red, while the refusal stands until the next submission.\n const [edited, setEdited] = useState(false)\n const [nudging, setNudging] = useState(false)\n const input = useRef<HTMLInputElement>(null)\n\n const characters = clean(value)\n const active = Math.min(characters.length, length - 1)\n const invalid =\n rest['aria-invalid'] === true || rest['aria-invalid'] === 'true'\n\n // A field that renders invalid keeps its value, so only a later refusal clears it.\n const previous = useRef(invalid)\n useEffect(() => {\n const refused = invalid && !previous.current\n previous.current = invalid\n if (!refused || !input.current) return\n input.current.value = ''\n input.current.focus()\n setEdited(false)\n setNudging(true)\n setValue('')\n }, [invalid])\n\n return (\n <div {...styles.root()}>\n <div\n {...styles.boxes()}\n aria-hidden\n data-nudging={nudging}\n onAnimationEnd={() => setNudging(false)}\n >\n {Array.from({ length }, (_, index) => (\n <Fragment key={index}>\n {index === separator ? <span {...styles.separator()} /> : null}\n <span\n {...styles.box()}\n data-active={focused && !rest.readOnly && index === active}\n data-invalid={invalid && !edited}\n data-verified={Boolean(verified)}\n >\n {characters[index]}\n </span>\n </Fragment>\n ))}\n </div>\n <input\n autoCapitalize=\"characters\"\n autoComplete=\"one-time-code\"\n spellCheck={false}\n {...rest}\n {...styles.input()}\n ref={input}\n onBlur={(event: FocusEvent<HTMLInputElement>) => {\n setFocused(false)\n onBlur?.(event)\n }}\n onChange={(event: ChangeEvent<HTMLInputElement>) => {\n // The input holds only what the boxes show, so a paste cannot submit hidden characters.\n const characters = clean(event.currentTarget.value).slice(0, length)\n if (characters !== event.currentTarget.value)\n event.currentTarget.value = characters\n setEdited(true)\n setValue(characters)\n onChange?.(event)\n }}\n onFocus={(event: FocusEvent<HTMLInputElement>) => {\n setFocused(true)\n onFocus?.(event)\n }}\n />\n </div>\n )\n}\n\n/** A code's letters and digits, uppercased. */\nfunction clean(value: string) {\n return value.replace(/[^0-9a-z]/gi, '').toUpperCase()\n}\n\nexport declare namespace CodeInput {\n /** A text input's attributes, except `value`, since the input stays uncontrolled. */\n type Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> & {\n /** The number of boxes. */\n length: number\n /** The box index a dash precedes, as in `BCDF–GHJK`. */\n separator?: number | undefined\n /** Whether the code was accepted, which tints the boxes green. */\n verified?: boolean | undefined\n }\n}\n\nnamespace styles {\n // The boxes match `Input`: a gray fill, and a border in the text color on the active box.\n export const box = style({\n alignItems: 'center',\n aspectRatio: 'code',\n backgroundColor: 'gray.100',\n border: '2px solid',\n borderColor: 'transparent',\n borderRadius: 'xl',\n display: 'flex',\n flex: '1 1 0',\n justifyContent: 'center',\n maxWidth: 12,\n transitionDuration: '150ms',\n transitionProperty: 'background-color, border-color, color',\n transitionTimingFunction: 'in-out',\n typography: 'label.20',\n '&[data-active=\"true\"]': { borderColor: 'foreground' },\n // An empty active box shows a caret, since the real input's caret is hidden.\n '&[data-active=\"true\"]:empty::after': {\n backgroundColor: 'foreground',\n content: '\"\"',\n height: 5,\n width: 'px',\n '@media (prefers-reduced-motion: no-preference)': { animation: 'pulse' },\n },\n '&[data-invalid=\"true\"]': { borderColor: 'red.800', color: 'gray.700' },\n '&[data-verified=\"true\"]': {\n backgroundColor: 'green.100',\n borderColor: 'green.700',\n color: 'green.900',\n },\n })\n\n export const boxes = style({\n display: 'flex',\n gap: 2,\n justifyContent: 'center',\n '&[data-nudging=\"true\"]': {\n '@media (prefers-reduced-motion: no-preference)': { animation: 'nudge' },\n },\n })\n\n // Covers the boxes so a tap anywhere on them focuses the input, which draws nothing itself.\n export const input = style({\n backgroundColor: 'transparent',\n border: 'none',\n caretColor: 'transparent',\n color: 'transparent',\n cursor: 'text',\n inset: 0,\n outline: 'none',\n position: 'absolute',\n width: 'full',\n '::selection': { backgroundColor: 'transparent' },\n })\n\n export const root = style({ position: 'relative' })\n\n export const separator = style({\n alignSelf: 'center',\n backgroundColor: 'gray.500',\n flexShrink: 0,\n height: 'px',\n width: 3,\n })\n}\n","/**\n * The device screen, where a signed-in user enters a CLI's user code and approves or denies it, with\n * the key that the CLI requests. The layout follows the device screen of the WorkOS implementation.\n * @module\n */\nimport { type FormEvent, type ReactNode, useId } from 'react'\nimport BadgeCheck from '~icons/lucide/badge-check'\nimport Check from '~icons/lucide/check'\nimport Clock from '~icons/lucide/clock'\nimport LaptopMinimal from '~icons/lucide/laptop-minimal'\nimport MapPin from '~icons/lucide/map-pin'\nimport Network from '~icons/lucide/network'\nimport TriangleAlert from '~icons/lucide/triangle-alert'\nimport type * as KeyAuthorization from '../../internal/KeyAuthorization.js'\nimport { Button } from '../components/Button.js'\nimport { CodeInput } from '../components/CodeInput.js'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport { Grant } from '../components/Grant.js'\nimport { Tooltip } from '../components/Tooltip.js'\nimport { style } from '../zyzz.config.js'\n\n/**\n * The device screen. Without `request` it asks for the code that the terminal shows. With one it\n * shows what the CLI requested, with any key and the message that the key signs, for approval, and\n * then the outcome. A key that approval cannot sign holds the approval, and the screen states why.\n */\nexport function DeviceApproval(props: DeviceApproval.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n // Several screens can share a document, such as on the flows canvas, so each derives its own IDs.\n const id = useId()\n const app = props.request?.app\n const refusal = props.refusal ?? props.request?.key_authorization?.refusal\n const description = (() => {\n if (props.status === 'denied')\n return 'Denied. The device was not signed in.'\n if (!props.request) return 'Enter the code shown in your terminal.'\n // An app without a display name could be anyone's, so the screen flags it.\n if (!app)\n return (\n <>\n Enter the code from your device to grant{' '}\n <Tooltip label=\"Unverified app\">\n <span {...styles.unverified()} tabIndex={0}>\n <TriangleAlert {...styles.warning()} aria-hidden />\n an unverified app\n </span>\n </Tooltip>{' '}\n access to your account.\n </>\n )\n return (\n <>\n Enter the code from your device to grant <strong>\n {app.name}\n </strong>{' '}\n <Tooltip label=\"Verified app\">\n <BadgeCheck\n {...styles.verified()}\n aria-label=\"Verified\"\n role=\"img\"\n tabIndex={0}\n />\n </Tooltip>{' '}\n access to your account.\n </>\n )\n })()\n\n if (props.status === 'approved')\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n <Title {...styles.title()}>Authorization successful</Title>\n <p {...styles.success()} aria-live=\"polite\" role=\"status\">\n <span {...styles.check()}>\n <Check aria-hidden />\n </span>\n You can close this tab.\n </p>\n </header>\n </div>\n )\n\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n {props.request ? (\n // Apps have no logos, so a verified app shows a device in their place.\n <span {...styles.avatar()} data-verified={Boolean(app)}>\n {app ? (\n <LaptopMinimal {...styles.avatarIcon()} aria-hidden />\n ) : (\n <TriangleAlert {...styles.avatarIcon()} aria-hidden />\n )}\n </span>\n ) : null}\n <Title {...styles.title()}>Authorize a device</Title>\n <p {...styles.description()}>{description}</p>\n </header>\n {(() => {\n if (props.status === 'denied') return null\n if (!props.request)\n return (\n <form {...styles.stack()} onSubmit={props.onSubmitCode}>\n <CodeInput\n aria-describedby={`${id}-error`}\n aria-invalid={props.invalid}\n aria-label=\"Code shown in your terminal\"\n autoComplete=\"off\"\n autoFocus={props.autoFocus}\n defaultValue={props.code}\n length={8}\n name=\"code\"\n // The field holds while the lookup runs, so a refusal clears only the code it refused.\n readOnly={props.fetching}\n required\n separator={4}\n />\n <Button loading={props.fetching} type=\"submit\">\n Continue\n </Button>\n </form>\n )\n return (\n <div {...styles.stack()}>\n <CodeInput\n aria-label=\"Code\"\n defaultValue={props.request.user_code}\n // A different request remounts the boxes, which read their value once.\n key={props.request.user_code}\n length={8}\n readOnly\n separator={4}\n />\n {props.request.key_authorization ? (\n <Grant\n heading={props.heading === 'h4' ? 'h5' : 'h2'}\n keyAuthorization={props.request.key_authorization}\n />\n ) : null}\n {props.request.challenge ? (\n <div {...styles.challenge()} role=\"note\">\n <p {...styles.challengeTitle()}>\n This sign-in also signs a message\n </p>\n <p {...styles.challengeText()}>\n Approve only if you started this sign-in in your own terminal\n and expect this message.\n </p>\n <pre {...styles.message()}>{props.request.challenge}</pre>\n </div>\n ) : null}\n <dl {...styles.details()}>\n {props.request.device ? (\n <div {...styles.row()}>\n <dt>\n <LaptopMinimal\n {...styles.icon()}\n aria-label=\"Device name\"\n role=\"img\"\n />\n </dt>\n <dd>\n {/* The CLI chooses the name, so it renders as text within the API's 64 characters, and the screen says where it comes from. */}\n {/* `bdi` isolates the name's direction from the label after it. */}\n <bdi {...styles.device()}>\n {props.request.device.slice(0, 64)}\n </bdi>{' '}\n <span {...styles.source()}>(as the device reports it)</span>\n </dd>\n </div>\n ) : null}\n {props.request.location ? (\n <div {...styles.row()}>\n <dt>\n <MapPin\n {...styles.icon()}\n aria-label=\"Location\"\n role=\"img\"\n />\n </dt>\n <dd>{props.request.location}</dd>\n </div>\n ) : null}\n <div {...styles.row()}>\n <dt>\n <Clock {...styles.icon()} aria-label=\"Requested\" role=\"img\" />\n </dt>\n <dd>{date.format(props.request.created_at * 1000)} UTC</dd>\n </div>\n {props.request.ip ? (\n <div {...styles.row()}>\n <dt>\n <Network\n {...styles.icon()}\n aria-label=\"IP address\"\n role=\"img\"\n />\n </dt>\n <dd>{props.request.ip}</dd>\n </div>\n ) : null}\n </dl>\n <Button\n disabled={props.denying || Boolean(refusal)}\n loading={props.approving}\n onClick={props.onApprove}\n >\n Approve\n </Button>\n <Button\n disabled={props.approving}\n loading={props.denying}\n onClick={props.onDeny}\n variant=\"tertiary\"\n >\n Deny\n </Button>\n </div>\n )\n })()}\n\n {/* A failed decision outranks the refusal, whose only action is the denial that failed. */}\n <ErrorMessage align=\"center\" id={`${id}-error`}>\n {props.error ?? (refusal ? refusals[refusal] : undefined)}\n </ErrorMessage>\n </div>\n )\n}\n\nexport declare namespace DeviceApproval {\n type Props = {\n /** Whether the approval is in progress. */\n approving: boolean\n /** Whether the code field takes focus. */\n autoFocus?: boolean | undefined\n /** The user code that the form starts with. */\n code: string\n /** Whether the denial is in progress. */\n denying: boolean\n /** Why reading, approving, or denying the request failed. */\n error?: string | undefined\n /** Whether the request for the entered code is loading. */\n fetching: boolean\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** Whether the code matched no request, which marks the field invalid. */\n invalid: boolean\n /** Approves the request, which signs the CLI in. */\n onApprove: () => void\n /** Denies the request. */\n onDeny: () => void\n /** Submits the entered user code. */\n onSubmitCode: (event: FormEvent<HTMLFormElement>) => void\n /**\n * Why approval cannot sign the key, which holds the approval. Takes the place of the key's own\n * `refusal`, such as after an approval that the API refused.\n */\n refusal?: Refusal | undefined\n /** What the CLI behind the code requested, once the code matches one. */\n request?: Request | undefined\n /** The request's outcome, once it has one. */\n status?: 'approved' | 'denied' | undefined\n }\n\n /** A key that the CLI requests, as the device page shows it. */\n type Key = KeyAuthorization.Description & {\n /** Why approval cannot sign the key. Absent when it can. */\n refusal?: Refusal | undefined\n }\n\n /**\n * Why approval cannot sign a key: the key names an account that the user does not hold, a passkey\n * that the page cannot use owns the account, the user holds no account, or the user's accounts\n * could not be read.\n */\n type Refusal = 'foreign_account' | 'no_account' | 'passkey' | 'unavailable'\n\n /** A device request, as `GET /v1/device/requests/:code` returns it. */\n type Request = {\n /** The app that requested the code. Absent when the app has no display name. */\n app?: { name: string } | undefined\n /** The message whose hash the key's signature covers. Absent when the CLI sent none. */\n challenge?: string | undefined\n /** When the CLI requested the code, in Unix seconds. */\n created_at: number\n /** The name that the CLI reported, such as its hostname. Absent when it reported none. */\n device?: string | undefined\n /** The CLI's IP address. Absent when it is unknown. */\n ip?: string | undefined\n /** The key that the CLI requests. Absent when it requests none. */\n key_authorization?: Key | undefined\n /** The CLI's city and country. Absent when they are unknown. */\n location?: string | undefined\n /** The user code, such as `BCDF-GHJK`. */\n user_code: string\n }\n}\n\n/** Why approval cannot sign a key, as the screen states it. */\nconst refusals: Record<DeviceApproval.Refusal, string> = {\n foreign_account:\n \"The terminal requests a key for a Tempo Account that you do not hold. Deny the request, and start the sign-in again in the terminal as that account's owner.\",\n no_account:\n 'You have no Tempo Account for this app yet, so no account can approve the key. Deny the request, create an account, and try again.',\n passkey:\n 'This Tempo Account signs with a passkey that this page cannot use. Deny the request, and return to the terminal.',\n unavailable:\n 'Tempo ID cannot read your Tempo Account right now. Reload the page in a minute, or deny the request.',\n}\n\n/** UTC, so the server render and the browser agree. */\nconst date = new Intl.DateTimeFormat('en-US', {\n dateStyle: 'medium',\n timeStyle: 'short',\n timeZone: 'UTC',\n})\n\nnamespace styles {\n export const avatar = style({\n alignItems: 'center',\n backgroundColor: 'background.surface',\n border: '1px solid',\n borderColor: 'gray.400',\n borderRadius: 'full',\n boxShadow: 'sm',\n color: 'foreground',\n display: 'flex',\n height: 14,\n justifyContent: 'center',\n marginBottom: 3,\n width: 14,\n '&[data-verified=\"false\"]': {\n backgroundColor: 'amber.100',\n borderColor: 'amber.400',\n color: 'amber.900',\n },\n })\n\n export const avatarIcon = style({ height: 6, width: 6 })\n\n export const challenge = style({\n backgroundColor: 'amber.100',\n borderRadius: '2xl',\n display: 'grid',\n gap: 2,\n padding: 4,\n })\n\n export const challengeText = style({\n color: 'foreground',\n typography: 'copy.14',\n })\n\n export const challengeTitle = style({\n color: 'amber.900',\n typography: 'label.14',\n })\n\n export const check = style({\n alignItems: 'center',\n backgroundColor: 'foreground',\n borderRadius: 'full',\n color: 'background.primary',\n display: 'inline-flex',\n flexShrink: 0,\n height: 6,\n justifyContent: 'center',\n width: 6,\n })\n\n export const column = style({\n display: 'grid',\n gap: 8,\n maxWidth: 'lg',\n width: 'full',\n })\n\n // A narrow measure wraps the app's name onto a second line.\n export const description = style({\n color: 'gray.900',\n maxWidth: 'xs',\n textWrap: 'balance',\n typography: 'copy.16',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const device = style({ fontWeight: 'medium' })\n\n export const details = style({\n backgroundColor: 'gray.100',\n borderRadius: '2xl',\n display: 'grid',\n gap: 2,\n margin: 0,\n padding: 4,\n typography: 'copy.14',\n })\n\n export const header = style({\n display: 'grid',\n gap: 2,\n justifyItems: 'center',\n textAlign: 'center',\n })\n\n export const icon = style({\n color: 'gray.900',\n display: 'block',\n flexShrink: 0,\n height: 4,\n width: 4,\n })\n\n export const message = style({\n margin: 0,\n overflowWrap: 'anywhere',\n typography: 'copy.13.mono',\n whiteSpace: 'pre-wrap',\n })\n\n export const row = style({\n alignItems: 'center',\n display: 'flex',\n gap: 3,\n minWidth: 0,\n overflowWrap: 'anywhere',\n })\n\n export const source = style({ color: 'gray.900' })\n\n export const stack = style({ display: 'grid', gap: 4 })\n\n export const success = style({\n alignItems: 'center',\n display: 'flex',\n gap: 2,\n justifyContent: 'center',\n typography: 'copy.16',\n })\n\n export const title = style({\n textWrap: 'balance',\n typography: 'heading.24',\n })\n\n export const unverified = style({\n borderRadius: 'sm',\n color: 'amber.900',\n fontWeight: 'semibold',\n outline: 'none',\n whiteSpace: 'nowrap',\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const verified = style({\n display: 'inline',\n height: 4,\n outline: 'none',\n verticalAlign: 'middle',\n width: 4,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const warning = style({\n display: 'inline',\n height: 4,\n marginInlineEnd: 1,\n verticalAlign: 'middle',\n width: 4,\n })\n}\n","/**\n * The device page: the signed-in user approves or denies a CLI's request. The CLI shows\n * `verification_uri_complete`, which opens the page with the user code filled in, so the user only\n * decides. A visit to `/device` without a code asks for the code that the terminal shows. The CLI\n * receives its tokens, and any key that approval signs, on its next poll. A passkey-owned account\n * signs the key with its passkey in this browser, which takes a second request.\n * @module\n */\nimport { useMutation } from '@tanstack/react-query'\nimport { createFileRoute, useRouter } from '@tanstack/react-router'\nimport { parseResponse } from 'hono/client'\nimport { type FormEvent, useState } from 'react'\nimport { Authentication } from 'webauthx/client'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { DeviceApproval } from '../screens/DeviceApproval.js'\nimport { style } from '../zyzz.config.js'\n\n/** Wraps a failure of the browser's passkey ceremony, which reaches no API. */\nclass CeremonyError extends Error {\n override name = 'Page.CeremonyError'\n}\n\nexport const Route = createFileRoute('/device')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Sends a visitor without a session to sign-in, which returns to the page with its query.\n * Otherwise returns the user code from the query, and the request that it names, or the refusal's\n * message for an unknown or expired code, a code that another user holds, or a spent rate limit.\n * Reading a pending code binds it to the user. The CLI's link names the code `code`, and the link\n * of `POST /device/code` names it `user_code` (RFC 8628 §3.3.1).\n */\n loader: async (match): Promise<Page.Props> => {\n const client = Client.create()\n const session = await parseResponse(client.v1.auth.session.$get())\n if (!session.user) {\n // Sign-in returns only to the device page with its code alone, so `return_to` leaves out\n // `chain`, which the root route keeps on every page.\n const { pathname, searchStr } = match.location\n const params = new URLSearchParams(searchStr)\n params.delete('chain')\n const returnTo = params.size > 0 ? `${pathname}?${params}` : pathname\n const query = new URLSearchParams({ return_to: returnTo })\n Loader.redirect({ href: `/login?${query}` })\n }\n\n const code = match.deps.code ?? match.deps.user_code ?? ''\n if (!code) return { code, error: null, request: null }\n try {\n // The client puts a path parameter into the URL as it is, so the code is encoded, and a\n // value such as `../account` names no other route.\n const found = await parseResponse(\n client.v1.device.requests[':code'].$get({\n param: { code: encodeURIComponent(code) },\n }),\n )\n return { code, error: null, request: found.request }\n } catch (error) {\n return { code, error: Client.message(error), request: null }\n }\n },\n loaderDeps: (match: { search: Search }) => ({\n code: match.search.code,\n user_code: match.search.user_code,\n }),\n validateSearch: (search: Record<string, unknown>): Search => ({\n ...(typeof search.code === 'string' ? { code: search.code } : {}),\n ...(typeof search.user_code === 'string'\n ? { user_code: search.user_code }\n : {}),\n }),\n})\n\n/** The search parameters that the page reads. */\ntype Search = {\n /** The user code, as the CLI's link names it. */\n code?: string | undefined\n /** The user code, as the link of `POST /device/code` names it. */\n user_code?: string | undefined\n}\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const router = useRouter()\n // Whether the page loads the request of a submitted code.\n const [fetching, setFetching] = useState(false)\n const code = props.request?.user_code ?? props.code\n // Without a session, the page's loader sends the browser to sign-in, which returns here.\n const onError = (error: Error) => {\n if (Client.reason(error) === 'session_required') window.location.reload()\n }\n const approve = useMutation({\n async mutationFn() {\n const json = {\n // Approval signs for the account that the page shows.\n ...(props.request?.key_authorization?.account\n ? { account: props.request.key_authorization.account }\n : {}),\n code,\n }\n const decided = await parseResponse(\n client.v1.device.approve.$post({ json }),\n )\n if (!('step' in decided)) return decided\n\n // The passkey signs the key authorization's digest, which the step's options carry.\n const assertion = await Authentication.sign({\n options: { publicKey: decided.step.options.publicKey },\n }).catch((error: unknown) => {\n throw new CeremonyError('Passkey ceremony failed.', { cause: error })\n })\n const signed = await parseResponse(\n client.v1.device.approve.$post({\n json: { ...json, passkey: { assertion } },\n }),\n )\n if ('step' in signed)\n throw new Error('The approval requested a second passkey step.')\n return signed\n },\n onError,\n })\n const deny = useMutation({\n mutationFn: () =>\n parseResponse(client.v1.device.deny.$post({ json: { code } })),\n onError,\n })\n\n const status = (() => {\n if (approve.isSuccess) return 'approved'\n if (deny.isSuccess) return 'denied'\n const decided = props.request?.status\n return decided === 'pending' ? undefined : decided\n })()\n const error = (() => {\n if (props.error) return props.error\n // The API's refusal names the other flows, and the screen states the step here instead.\n if (approve.error && Client.reason(approve.error) !== 'webauthn_required')\n return message(approve.error)\n if (deny.error) return Client.message(deny.error)\n return undefined\n })()\n\n function submitCode(event: FormEvent<HTMLFormElement>) {\n event.preventDefault()\n const value = String(new FormData(event.currentTarget).get('code'))\n setFetching(true)\n // The router renders a failed navigation itself, so the field holds only until it settles.\n void router\n .navigate({ search: { code: value }, to: '/device' })\n .finally(() => setFetching(false))\n }\n\n return (\n <main {...styles.page()}>\n <DeviceApproval\n approving={approve.isPending}\n autoFocus\n code={props.code}\n denying={deny.isPending}\n error={error}\n fetching={fetching}\n invalid={Boolean(props.error)}\n onApprove={() => approve.mutate()}\n onDeny={() => deny.mutate()}\n onSubmitCode={submitCode}\n refusal={\n Client.reason(approve.error) === 'webauthn_required'\n ? 'passkey'\n : undefined\n }\n request={props.request ?? undefined}\n status={status}\n />\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** The user code from the query, or an empty string without one. */\n code: string\n /** Why the code names no request, such as an unknown or expired code. */\n error: string | null\n /** The request that the code names, or `null` without a code or for an unknown one. */\n request:\n | (DeviceApproval.Request & {\n /** Whether the user approved or denied the code. `pending` until the user decides. */\n status: 'approved' | 'denied' | 'pending'\n })\n | null\n }\n}\n\n/**\n * Returns the message to show for `error`. A ceremony that the user cancels, or that times out,\n * fails with a `NotAllowedError` from the browser, which the passkey library wraps in its own error.\n * A refused assertion takes a new passkey step, which the next approval starts.\n */\nfunction message(error: unknown) {\n if (Client.reason(error) === 'webauthn_rejected')\n return 'Your passkey did not sign the approval. Approve again, or deny the request.'\n if (!(error instanceof CeremonyError)) return Client.message(error)\n if (names(error).includes('NotAllowedError'))\n return 'The passkey request was canceled. Approve again, or deny the request.'\n return 'Your passkey did not sign the approval. Approve again, or deny the request.'\n}\n\n/** Returns the names of `error` and of each error in its chain of causes. */\nfunction names(error: unknown): readonly string[] {\n if (!(error instanceof Error)) return []\n return [error.name, ...names(error.cause)]\n}\n\nnamespace styles {\n export const page = style({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","/** Renders the text input. @module */\nimport type { InputHTMLAttributes, ReactNode } from 'react'\nimport type { Props } from 'zyzz'\nimport { variants } from '../zyzz.config.js'\n\n/** A text input in the `medium` or `large` size. `aria-invalid` draws it in red. */\nexport function Input(props: Input.Props): ReactNode {\n const { size, ...rest } = props\n return <input {...rest} {...styles.input({ size })} />\n}\n\nexport declare namespace Input {\n /** The size, with a text input's attributes. */\n type Props = Props.Variants<typeof styles.input> &\n Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>\n}\n\nnamespace styles {\n // A gray fill with no visible border. Focus draws the border in the text color.\n export const input = variants({\n base: {\n backgroundColor: 'gray.100',\n border: '2px solid',\n borderColor: 'transparent',\n borderRadius: 'xl',\n color: 'foreground',\n minWidth: 0,\n outline: 'none',\n paddingInline: 4,\n transitionDuration: '150ms',\n transitionProperty: 'background-color, border-color',\n transitionTimingFunction: 'in-out',\n width: 'full',\n '::placeholder': { color: 'gray.900' },\n ':hover': { backgroundColor: 'gray.200' },\n ':focus': { backgroundColor: 'gray.100', borderColor: 'foreground' },\n '&[aria-invalid=\"true\"]': { borderColor: 'red.800' },\n ':disabled': { color: 'gray.700', cursor: 'not-allowed' },\n },\n defaultVariants: { size: 'large' },\n variants: {\n size: {\n large: { height: 12, typography: 'copy.16' },\n medium: { height: 9, typography: 'copy.14' },\n },\n },\n })\n}\n","/** The sign-in screen: an email address and the code sent to it, Google, or a passkey. @module */\nimport { type FormEvent, type ReactNode, useId } from 'react'\nimport Google from '~icons/logos/google-icon'\nimport BadgeCheck from '~icons/lucide/badge-check'\nimport Fingerprint from '~icons/lucide/fingerprint'\nimport { Button } from '../components/Button.js'\nimport { CodeInput } from '../components/CodeInput.js'\nimport { ErrorMessage } from '../components/ErrorMessage.js'\nimport { Grant } from '../components/Grant.js'\nimport { Input } from '../components/Input.js'\nimport { Tooltip } from '../components/Tooltip.js'\nimport { style } from '../zyzz.config.js'\nimport type { Approval } from './Approval.js'\n\n/**\n * The sign-in screen. Without `email` it asks for one, for Google, or for a passkey. With `email` it\n * asks for the code sent there.\n */\nexport function SignIn(props: SignIn.Props): ReactNode {\n const Title = props.heading ?? 'h1'\n const { email } = props\n // Several screens can share a document, such as on the flows canvas, so each derives its own IDs.\n const id = useId()\n\n return (\n <div {...styles.column()}>\n <header {...styles.header()}>\n <Title {...styles.title()}>\n {(() => {\n if (email) return 'Check your email'\n if (props.linking) return 'Verify your email'\n return 'Sign in to Tempo'\n })()}\n </Title>\n {(() => {\n if (email)\n return (\n <p {...styles.description()}>\n Enter the 6-digit code sent to <strong>{email}</strong>.\n {props.linking\n ? ' Your passkey then confirms the sign-in.'\n : null}\n </p>\n )\n if (props.linking)\n return (\n <p {...styles.description()}>\n Enter your email to finish signing in with your passkey.\n </p>\n )\n if (props.request)\n return (\n <p {...styles.description()}>\n Continue to let{' '}\n <span {...styles.app()}>\n <strong>{props.request.app}</strong>{' '}\n <Tooltip label=\"Verified app\">\n <BadgeCheck\n {...styles.badge()}\n aria-label=\"Verified\"\n role=\"img\"\n tabIndex={0}\n />\n </Tooltip>\n </span>{' '}\n use your Tempo Account.\n </p>\n )\n return null\n })()}\n </header>\n {/* The code step only proves the email, so the key shows once, before it. Signing in grants it. */}\n {props.request && !email && !props.linking ? (\n <Grant\n heading={props.heading === 'h4' ? 'h5' : 'h2'}\n keyAuthorization={props.request.key}\n />\n ) : null}\n\n {email ? (\n // A form submitted before the page hydrates posts, so the address and code stay out of the URL.\n <form {...styles.code()} method=\"post\" onSubmit={props.onSubmitCode}>\n <CodeInput\n aria-describedby={`${id}-error`}\n aria-invalid={props.invalid}\n aria-label=\"Code\"\n // The step replaces the email form, so focus moves to the field it asks for.\n autoFocus={props.autoFocus}\n inputMode=\"numeric\"\n // `CodeInput` cuts the cleaned value to `length`. A native `maxLength` would cut a pasted\n // code before the space or dash around it is removed.\n length={6}\n name=\"code\"\n // A complete code submits itself.\n onChange={(event) => {\n if (event.currentTarget.value.length === 6)\n event.currentTarget.form?.requestSubmit()\n }}\n pattern=\"\\d{6}\"\n readOnly={props.verifying || props.verified}\n required\n verified={props.verified}\n />\n <ErrorMessage align=\"center\" id={`${id}-error`}>\n {props.error}\n </ErrorMessage>\n <div {...styles.links()}>\n <button\n {...styles.link()}\n disabled={\n props.resend === 'pending' || props.verifying || props.verified\n }\n onClick={props.onResend}\n type=\"button\"\n >\n {(() => {\n if (props.resend === 'pending') return 'Sending…'\n if (props.resend === 'sent') return 'Code sent'\n return 'Resend code'\n })()}\n </button>\n <button\n {...styles.link()}\n // The address stays until the code's result returns, so the result applies to it.\n disabled={props.verifying || props.verified}\n onClick={props.onChangeEmail}\n type=\"button\"\n >\n Use a different email\n </button>\n <p {...styles.status()} aria-live=\"polite\" role=\"status\">\n {(() => {\n if (props.resend === 'pending') return 'Sending a new code.'\n if (props.resend === 'sent')\n return `A new code was sent to ${email}.`\n return undefined\n })()}\n </p>\n </div>\n </form>\n ) : (\n <div {...styles.stack()}>\n <form\n {...styles.stack()}\n method=\"post\"\n onSubmit={props.onSubmitEmail}\n >\n <Input\n aria-describedby={`${id}-error`}\n aria-invalid={props.invalid}\n aria-label=\"Email\"\n // `webauthn` lets the browser offer passkeys in the field's autofill.\n autoComplete={props.onPasskey ? 'email webauthn' : 'email'}\n // 1Password's inline menu takes focus from the field when it is clicked.\n data-1p-ignore\n id={`${id}-email`}\n name=\"email\"\n placeholder=\"Email address\"\n required\n type=\"email\"\n />\n <ErrorMessage id={`${id}-error`}>{props.error}</ErrorMessage>\n <Button\n // One sign-in runs at a time, since each one sets the session.\n disabled={props.passkeyPending}\n loading={props.sending}\n type=\"submit\"\n >\n Continue with email\n </Button>\n </form>\n {/* A passkey that waits for its email links only through the code, so the other methods hide. */}\n {!props.linking && (props.onGoogle || props.onPasskey) ? (\n <hr {...styles.rule()} />\n ) : null}\n {props.onGoogle && !props.linking ? (\n <Button\n disabled={props.sending || props.passkeyPending}\n onClick={props.onGoogle}\n prefix={<Google aria-hidden />}\n variant=\"secondary\"\n >\n Continue with Google\n </Button>\n ) : null}\n {props.onPasskey && !props.linking ? (\n <Button\n disabled={props.sending}\n loading={props.passkeyPending}\n onClick={props.onPasskey}\n prefix={<Fingerprint aria-hidden />}\n variant=\"secondary\"\n >\n Continue with passkey\n </Button>\n ) : null}\n {props.linking && props.onStartOver ? (\n <button\n {...styles.link()}\n onClick={props.onStartOver}\n type=\"button\"\n >\n Start over\n </button>\n ) : null}\n </div>\n )}\n </div>\n )\n}\n\nexport declare namespace SignIn {\n type Props = {\n /** Whether the code field takes focus when it appears. */\n autoFocus?: boolean | undefined\n /** The address a code was sent to, which shows the code step. */\n email?: string | undefined\n /** Why the current step failed. */\n error?: string | undefined\n /** The level of the screen's title: `h1` by default, or `h4` on the flows canvas, below the canvas's own headings. */\n heading?: 'h1' | 'h4' | undefined\n /** Whether the current step's own request failed, which marks its field invalid. */\n invalid: boolean\n /** Whether a passkey waits for the emailed code that links it, which the email and code steps explain. */\n linking?: boolean | undefined\n /** Returns to the email step. */\n onChangeEmail: () => void\n /** Signs in with Google. Absent, the screen offers no Google sign-in. */\n onGoogle?: (() => void) | undefined\n /** Signs in with a passkey. Absent, the screen offers no passkey sign-in. */\n onPasskey?: (() => void) | undefined\n /** Sends a new code to `email`. */\n onResend: () => void\n /**\n * Drops the passkey that waits for a code, and returns to the first sign-in step. Absent, the\n * linking step offers no way back.\n */\n onStartOver?: (() => void) | undefined\n /** Submits the code form. */\n onSubmitCode: (event: FormEvent<HTMLFormElement>) => void\n /** Submits the email form, which sends a code. */\n onSubmitEmail: (event: FormEvent<HTMLFormElement>) => void\n /** Whether a passkey sign-in runs, which holds its button and the email form. */\n passkeyPending?: boolean | undefined\n /**\n * The app's authorization request that the sign-in continues, with the key that the sign-in\n * grants. Absent for a sign-in without one, or for a request whose key the approval page shows.\n */\n request?:\n | {\n /** The app's display name. */\n app: string\n /** What the key that the app requests may do. */\n key: Approval.Key\n }\n | undefined\n /** The progress of a resent code. */\n resend: 'idle' | 'pending' | 'sent'\n /** Whether the first code is being sent. */\n sending: boolean\n /** Whether the code was accepted, which tints the code field green before the sign-in continues. */\n verified?: boolean | undefined\n /** Whether the code is being verified, which holds the code field. */\n verifying: boolean\n }\n}\n\nnamespace styles {\n // The app's name and badge wrap as one word, so a hyphenated name never splits.\n export const app = style({ whiteSpace: 'nowrap' })\n\n export const badge = style({\n display: 'inline',\n height: 4,\n outline: 'none',\n verticalAlign: 'middle',\n width: 4,\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const code = style({ display: 'grid', gap: 6 })\n\n export const column = style({\n display: 'grid',\n gap: 8,\n maxWidth: 'sm',\n width: 'full',\n })\n\n export const description = style({\n color: 'gray.900',\n textWrap: 'balance',\n typography: 'copy.16',\n '& strong': { color: 'foreground', fontWeight: 'medium' },\n })\n\n export const header = style({\n display: 'grid',\n gap: 2,\n textAlign: 'center',\n })\n\n // A quiet pill, filled while hovered.\n export const link = style({\n backgroundColor: 'transparent',\n border: 'none',\n borderRadius: 'full',\n color: 'foreground',\n cursor: 'pointer',\n height: 9,\n justifySelf: 'center',\n outline: 'none',\n paddingInline: 4,\n transitionDuration: '150ms',\n transitionProperty: 'background-color, color',\n transitionTimingFunction: 'in-out',\n typography: 'button.14',\n ':disabled': { color: 'gray.700', cursor: 'not-allowed' },\n ':hover:not(:disabled)': { backgroundColor: 'gray.100' },\n ':focus-visible': {\n outline: '2px solid',\n outlineColor: 'blue.700',\n outlineOffset: '2px',\n },\n })\n\n export const links = style({\n display: 'grid',\n gap: 1,\n justifyItems: 'center',\n })\n\n // The rule between the emailed code and the other sign-in methods.\n export const rule = style({\n border: 'none',\n borderTop: '1px solid',\n borderTopColor: 'gray.400',\n marginBlock: 1,\n width: 'full',\n })\n\n export const stack = style({ display: 'grid', gap: 3 })\n\n // Screen readers announce the resend's progress, which the button label shows visually.\n export const status = style({\n clipPath: 'inset(50%)',\n height: 'px',\n overflow: 'hidden',\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: 'px',\n })\n\n export const title = style({\n textWrap: 'balance',\n typography: 'heading.24',\n })\n}\n","/**\n * Signs a visitor in with an emailed code, Google, or a passkey. The sign-in then continues the app's\n * authorization that sent the visitor here, returns to the device page, or opens the account. A wallet.tempo passkey without an\n * email waits for the emailed code that links it. A failed Google sign-in returns here with `error`.\n * @module\n */\nimport { useMutation } from '@tanstack/react-query'\nimport { createFileRoute, useRouter } from '@tanstack/react-router'\nimport { type InferResponseType, parseResponse } from 'hono/client'\nimport { type FormEvent, useEffect, useRef, useState } from 'react'\nimport { Authentication } from 'webauthx/client'\nimport * as Client from '../lib/Client.js'\nimport * as Loader from '../lib/Loader.js'\nimport { SignIn } from '../screens/SignIn.js'\nimport { style } from '../zyzz.config.js'\n\n/** A signed passkey assertion, as the browser returns it. */\ntype Assertion = Awaited<ReturnType<typeof Authentication.sign>>\n\n/** The response of a passkey verification: a signed-in user, or the email step. */\ntype PasskeyResult = InferResponseType<\n Client.Client['v1']['auth']['passkey']['verify']['$post'],\n 200\n>\n\n/** The time in milliseconds between checks of an autofill request's deadline. */\nconst autofillInterval = 10 * 1000\n\n/**\n * The wall-clock time in milliseconds that an autofill request waits for a passkey before a new one\n * replaces it. It is one minute shorter than the 5-minute lifetime of a challenge.\n */\nconst autofillLifetime = 4 * 60 * 1000\n\n/** Wraps a failure of the browser's passkey ceremony, which reaches no API. */\nclass CeremonyError extends Error {\n override name = 'Page.CeremonyError'\n}\n\nexport const Route = createFileRoute('/login')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: () => <Page {...Route.useLoaderData()} />,\n /**\n * Redirects a signed-in user to `return_to`, a path on the device page, or else to the account.\n * Otherwise returns the sign-in methods that `GET /v1/auth/methods` reads, whether a Google\n * sign-in failed (`error=access_denied`), and the page that sign-in returns to. An app's\n * authorization that asks to sign in again (`prompt=login`) carries a signed `sig`, and shows the\n * page with a session.\n */\n loader: async (match): Promise<Page.Props> => {\n const query = new URLSearchParams(match.location.searchStr)\n const signed = query.has('sig')\n const returnTo = query.get('return_to')\n const client = Client.create()\n const [session, methods] = await Promise.all([\n parseResponse(client.v1.auth.session.$get()),\n parseResponse(\n client.v1.auth.methods.$get({\n query: {\n // The API names the app only from a signed authorization request.\n ...(signed ? { oauth_query: query.toString() } : {}),\n ...(returnTo ? { return_to: returnTo } : {}),\n },\n }),\n ),\n ])\n if (session.user && !signed)\n Loader.redirect({ href: methods.return_to ?? '/' })\n\n return {\n // Better Auth sends its other failures here too, with their own codes. Only the failed route of\n // a provider sign-in sends `access_denied`.\n failed: methods.google && query.get('error') === 'access_denied',\n google: methods.google,\n passkeys: methods.passkeys,\n request: methods.request,\n returnTo: methods.return_to,\n userCode: methods.user_code,\n }\n },\n // The loader reads the whole query, so a change to any parameter loads the page again.\n loaderDeps: (match) => ({ search: match.search }),\n server: {\n handlers: {\n // The sign-in form posts here only when it is submitted before the page hydrates, and the page\n // then sends the code itself. The redirect keeps the query, so an app's signed authorization\n // request stays on the page.\n POST: (options) =>\n new Response(null, {\n headers: { location: `/login${new URL(options.request.url).search}` },\n status: 303,\n }),\n },\n },\n})\n\n/** Renders the page. */\nfunction Page(props: Page.Props) {\n const client = Client.use()\n const router = useRouter()\n // The email step's link, while a wallet.tempo passkey waits for the code that links it.\n const [link, setLink] = useState<string | undefined>(undefined)\n // The autofill request that waits for a passkey picked from the email field, if one runs.\n const autofill = useRef<AbortController | undefined>(undefined)\n const passkey = useMutation({\n async mutationFn(variables: { assertion?: Assertion | undefined }) {\n const assertion = variables.assertion ?? (await ceremony({}))\n return parseResponse(\n client.v1.auth.passkey.verify.$post({\n json: { assertion, ...oauthQuery() },\n }),\n )\n },\n })\n const resend = useMutation({ mutationFn: sendCode })\n const send = useMutation({ mutationFn: sendCode })\n const verify = useMutation({\n async mutationFn(variables: { code: string; email: string }) {\n // The link's passkey signs again, so a page left at the email step links nothing for the next\n // person, who cannot sign with it.\n const linked = link ? { assertion: await ceremony({ link }), link } : {}\n return parseResponse(\n client.v1.auth.code.verify.$post({\n json: { ...variables, ...linked, ...oauthQuery() },\n }),\n )\n },\n })\n const email = send.isSuccess ? send.variables.email : undefined\n\n /**\n * Requests passkey options, and signs them in the browser. Options with `link` ask for the email\n * step's passkey again. A conditional request waits for a passkey picked from the email field's\n * autofill, until `signal` aborts it.\n */\n async function ceremony(options: {\n link?: string | undefined\n mediation?: 'conditional' | undefined\n signal?: AbortSignal | undefined\n }) {\n const { link, mediation, signal } = options\n const response = await parseResponse(\n client.v1.auth.passkey.options.$post({\n json: {\n ...(link ? { link } : {}),\n ...(mediation ? { mediation } : {}),\n ...oauthQuery(),\n // The API reads the device app from the code itself, so the code selects its realms.\n ...(props.userCode ? { user_code: props.userCode } : {}),\n },\n }),\n )\n // The response reads optional fields as possibly `undefined`, which the ceremony's options\n // omit instead.\n const { allowCredentials, ...publicKey } = response.options.publicKey\n try {\n return await Authentication.sign({\n // ox types the request with optional members that the DOM types leave out when absent. The\n // object is the one that ox built for `navigator.credentials.get`.\n getFn: (request) =>\n navigator.credentials.get({\n ...(request as CredentialRequestOptions),\n ...(signal ? { signal } : {}),\n }),\n options: {\n publicKey: {\n ...publicKey,\n ...(allowCredentials ? { allowCredentials } : {}),\n },\n ...(response.options.mediation\n ? { mediation: response.options.mediation }\n : {}),\n },\n })\n } catch (error) {\n throw new CeremonyError('Passkey ceremony failed.', { cause: error })\n }\n }\n\n // Autofill offers the browser's passkeys in the email field while the first step shows and no\n // other sign-in runs. A passkey picked there signs in as the button does.\n useEffect(() => {\n if (!props.passkeys || email || link || passkey.isPending || send.isPending)\n return\n const controller = new AbortController()\n autofill.current = controller\n void (async () => {\n const available =\n await window.PublicKeyCredential?.isConditionalMediationAvailable?.()\n if (!available || controller.signal.aborted) return\n // The browser holds a conditional request open with no time limit, but its challenge expires,\n // so a new request replaces it before then.\n while (!controller.signal.aborted) {\n const round = new AbortController()\n const abort = () => round.abort()\n // The challenge expires by wall-clock time, which runs on while the device sleeps and timers\n // stop, so the round checks a deadline when the page shows again and at a short interval.\n const deadline = Date.now() + autofillLifetime\n const check = () => {\n if (Date.now() >= deadline) round.abort()\n }\n controller.signal.addEventListener('abort', abort)\n document.addEventListener('visibilitychange', check)\n window.addEventListener('pageshow', check)\n const timer = setInterval(check, autofillInterval)\n // A ceremony that the browser aborts, or that fails before a passkey is picked, offers the\n // button instead, so its failure shows nothing.\n const result = await ceremony({\n mediation: 'conditional',\n signal: round.signal,\n }).then(\n (assertion) => ({ assertion }),\n (error: unknown) => ({ error }),\n )\n clearInterval(timer)\n controller.signal.removeEventListener('abort', abort)\n document.removeEventListener('visibilitychange', check)\n window.removeEventListener('pageshow', check)\n if (controller.signal.aborted) return\n if ('assertion' in result) {\n send.reset()\n passkey.mutate(\n { assertion: result.assertion },\n { onSuccess: applyPasskey },\n )\n return\n }\n if (round.signal.aborted) continue\n // A request that does not reach the API, as while a device reconnects after sleep, starts\n // again. A refusal ends the autofill, so it does not repeat.\n if (!(result.error instanceof TypeError)) return\n await reconnect({ signal: controller.signal })\n }\n })()\n return () => controller.abort()\n // `ceremony`, `passkey.mutate`, and `send.reset` read current state when they run, so they are\n // not dependencies.\n }, [props.passkeys, email, link, passkey.isPending, send.isPending])\n\n function sendCode(variables: { email: string }) {\n return parseResponse(client.v1.auth.code.$post({ json: variables }))\n }\n\n function submitEmail(event: FormEvent<HTMLFormElement>) {\n event.preventDefault()\n // One sign-in runs at a time, since a passkey sign-in sets its own session.\n if (send.isPending || passkey.isPending) return\n passkey.reset()\n // A passkey picked from the autofill during the send would start a second sign-in.\n autofill.current?.abort()\n send.mutate({\n email: String(new FormData(event.currentTarget).get('email')),\n })\n }\n\n function submitCode(event: FormEvent<HTMLFormElement>) {\n event.preventDefault()\n // A complete code submits the form, and Enter can submit it again before the first returns.\n if (!email || verify.isPending || verify.isSuccess) return\n const form = event.currentTarget\n resend.reset()\n verify.mutate(\n { code: String(new FormData(form).get('code')), email },\n {\n onError(error) {\n // An expired link, or a passkey that does not sign again, leaves the code valid, so the next\n // attempt signs in with email only.\n if (linkFailed(error)) setLink(undefined)\n // The refused code clears, so the next one can be typed at once.\n const field = form.elements.namedItem('code')\n if (!(field instanceof HTMLInputElement)) return\n field.value = ''\n field.focus()\n },\n onSuccess(data) {\n // The accepted code shows green for a moment, so the sign-in confirms it before it\n // continues. The router renders a failed navigation itself, so the timer need not wait.\n window.setTimeout(() => continueTo(data), verifiedDelay)\n },\n },\n )\n }\n\n /** Continues to the app's redirect, to the page that sent the visitor here, or to the account. */\n function continueTo(data: { redirect: string | null }) {\n if (data.redirect) window.location.assign(data.redirect)\n // The device page loads as a document, so its loader reads the code on the server, where a\n // refused lookup logs nothing in the browser.\n else if (props.returnTo) window.location.assign(props.returnTo)\n else void router.navigate({ to: '/' })\n }\n\n /**\n * Sends the browser to Google, and back to this page. With an app's authorization request, the\n * callback continues it instead.\n */\n function signInWithGoogle() {\n const page = new URL(window.location.href)\n // The next attempt drops the failure of the last one.\n page.searchParams.delete('error')\n const url = new URL('/v1/auth/oauth/google', window.location.origin)\n // A path, which Tempo ID resolves against its own origin.\n url.searchParams.set('return_to', page.pathname + page.search)\n const { oauth_query } = oauthQuery()\n if (oauth_query) url.searchParams.set('oauth_query', oauth_query)\n window.location.assign(url)\n }\n\n function signInWithPasskey() {\n if (passkey.isPending) return\n send.reset()\n // The result applies through the call's own callback, which a reset drops, so a sign-in that\n // returns after the email path takes over sets no link.\n // The browser runs one passkey request at a time, so the autofill request ends first.\n autofill.current?.abort()\n passkey.mutate({}, { onSuccess: applyPasskey })\n }\n\n /** Continues a verified passkey sign-in, or asks for the email that links a wallet.tempo passkey. */\n function applyPasskey(data: PasskeyResult) {\n if ('step' in data) setLink(data.step.link)\n else continueTo({ redirect: data.redirect })\n }\n\n function sendAgain() {\n if (!email || verify.isPending || verify.isSuccess) return\n verify.reset()\n resend.mutate({ email })\n }\n\n // A reset mutation drops the callbacks of its request, so a result that returns after the\n // address changes updates nothing. The passkey's link clears too, so the code of another address\n // in a shared browser links nothing.\n function changeEmail() {\n passkey.reset()\n resend.reset()\n send.reset()\n setLink(undefined)\n verify.reset()\n }\n\n // A tab left at the email step can reach the next person, who drops the passkey's link here. The\n // reset drops a pending code request too, so its result does not open the code step.\n function startOver() {\n passkey.reset()\n send.reset()\n setLink(undefined)\n }\n\n const error = (() => {\n if (email) return verify.error ?? resend.error\n return send.error ?? passkey.error\n })()\n // The failure of a Google sign-in shows until another sign-in starts.\n const failed = props.failed && send.isIdle && passkey.isIdle\n\n return (\n <main {...styles.page()}>\n <SignIn\n autoFocus\n email={email}\n error={(() => {\n if (error) return message(error, { code: Boolean(email) })\n if (failed)\n return 'Sign-in with Google failed. Try again, or continue with email.'\n return undefined\n })()}\n invalid={Boolean(email ? verify.error : send.error)}\n linking={Boolean(link)}\n onChangeEmail={changeEmail}\n onGoogle={props.google ? signInWithGoogle : undefined}\n onPasskey={props.passkeys ? signInWithPasskey : undefined}\n onResend={sendAgain}\n onStartOver={startOver}\n onSubmitCode={submitCode}\n onSubmitEmail={submitEmail}\n passkeyPending={passkey.isPending}\n request={props.request ?? undefined}\n resend={(() => {\n if (resend.isPending) return 'pending'\n if (resend.isSuccess) return 'sent'\n return 'idle'\n })()}\n sending={send.isPending}\n verified={verify.isSuccess}\n verifying={verify.isPending}\n />\n </main>\n )\n}\n\ndeclare namespace Page {\n type Props = {\n /** Whether a Google sign-in returned here with `error`. */\n failed: boolean\n /** Whether the page offers Google sign-in, which the deployment configures. */\n google: boolean\n /** Whether the page offers passkey sign-in, which the loader decides from the app's realms. */\n passkeys: boolean\n /**\n * The app's authorization request that the sign-in continues, with the key that the sign-in\n * grants, or `null` without one.\n */\n request: SignIn.Props['request'] | null\n /** The page that sign-in returns to, a path on the device page, or `null` for the account. */\n returnTo: string | null\n /** The user code of the device page that sign-in returns to, or `null` without one. */\n userCode: string | null\n }\n}\n\n/** How long an accepted code shows green before the sign-in continues, in milliseconds. */\nconst verifiedDelay = 500\n\n/** Returns whether `error` refused the email step's link, which leaves the code valid. */\nfunction linkFailed(error: unknown) {\n if (error instanceof CeremonyError) return true\n const reason = Client.reason(error)\n return (\n reason === 'passkey_link_expired' ||\n reason === 'passkey_not_permitted' ||\n reason === 'webauthn_rejected'\n )\n}\n\n/**\n * Returns the message to show for `error`. A ceremony that the user cancels, or that times out,\n * fails with a `NotAllowedError` from the browser, which the passkey library wraps in its own error.\n */\nfunction message(error: unknown, options: message.Options) {\n // At the code step, only the link's passkey runs a ceremony, and its failure drops the link. An\n // expired or refused link keeps the refusal's own message.\n if (\n options.code &&\n (error instanceof CeremonyError ||\n Client.reason(error) === 'webauthn_rejected')\n )\n return 'Your passkey did not confirm the sign-in. Enter the code again to sign in with email only.'\n if (!(error instanceof CeremonyError)) return Client.message(error)\n if (names(error).includes('NotAllowedError'))\n return 'Passkey sign-in was canceled. Try again, or continue with email.'\n return 'Passkey sign-in failed. Try again, or continue with email.'\n}\n\ndeclare namespace message {\n type Options = {\n /** Whether the page shows the code step, where a refusal of the link's passkey drops the link. */\n code: boolean\n }\n}\n\n/** Returns the names of `error` and of each error in its chain of causes. */\nfunction names(error: unknown): readonly string[] {\n if (!(error instanceof Error)) return []\n return [error.name, ...names(error.cause)]\n}\n\n/**\n * Returns the signed authorization request that `GET /oauth2/authorize` put in the page's query, as\n * the verify request's `oauth_query`, or nothing when the visitor came without one. The `error` of a\n * failed Google sign-in is not part of the signed request, so the request drops it.\n */\nfunction oauthQuery(): { oauth_query?: string } {\n const params = new URLSearchParams(window.location.search)\n if (!params.has('sig')) return {}\n params.delete('error')\n return { oauth_query: params.toString() }\n}\n\n/**\n * Resolves after `autofillInterval`, when the browser comes back online, or when `signal` aborts,\n * whichever comes first.\n */\nfunction reconnect(options: reconnect.Options) {\n const { signal } = options\n return new Promise<void>((resolve) => {\n const done = () => {\n clearTimeout(timer)\n window.removeEventListener('online', done)\n signal.removeEventListener('abort', done)\n resolve()\n }\n const timer = setTimeout(done, autofillInterval)\n window.addEventListener('online', done)\n signal.addEventListener('abort', done)\n })\n}\n\ndeclare namespace reconnect {\n type Options = {\n /** Ends the wait early, when the autofill stops. */\n signal: AbortSignal\n }\n}\n\nnamespace styles {\n export const page = style({\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n minHeight: 'screen',\n paddingBlock: 16,\n paddingInline: 4,\n })\n}\n","/**\n * Lays out every Tempo ID flow as a canvas of artboards: where each flow enters, the screens it\n * shows, the request on each arrow, and where it exits. Each artboard renders its page's screen\n * from `src/app/screens/` with sample props, so the canvas changes with the pages. An app's own\n * screens, in the headless flows, render with the third-party tokens, so they read apart from\n * Tempo ID's.\n * @module\n */\nimport { createFileRoute } from '@tanstack/react-router'\nimport type { FormEvent, ReactNode } from 'react'\nimport ChevronRight from '~icons/lucide/chevron-right'\nimport { CodeInput } from '../components/CodeInput.js'\nimport { Account } from '../screens/Account.js'\nimport { Approval, InvalidRequest } from '../screens/Approval.js'\nimport { ChooseAccount } from '../screens/ChooseAccount.js'\nimport { Deposit } from '../screens/Deposit.js'\nimport { DeviceApproval } from '../screens/DeviceApproval.js'\nimport { SignIn } from '../screens/SignIn.js'\nimport { style, variants, vars } from '../zyzz.config.js'\n\n/** One box in a flow: an entry point, a Tempo ID screen, or an external step such as a provider. */\ntype Node = {\n /** A secondary line, such as the request that enters the flow. */\n detail?: string | undefined\n /** The request or event on the arrow that leads into this node. Absent on the first node. */\n edge?: string | undefined\n /** The screen's or the step's name. */\n name: string\n /** Who renders the screen: Tempo ID when absent, or `app` for an app's own interface. */\n owner?: 'app' | undefined\n /** The screen, for an artboard. An external step has none. */\n screen?: ReactNode | undefined\n}\n\n/** One path through Tempo ID, from its entry point to its exit. */\ntype Flow = {\n /** What the flow does, and when it applies, with code spans between backticks. */\n description: string\n /** The entry point, each screen or external step, and the exit, in order. */\n nodes: readonly Node[]\n /** The flow's name. */\n title: string\n}\n\n/** A titled group of related flows. */\ntype Section = {\n /** The flows, in reading order. */\n flows: readonly Flow[]\n /** The group's name. */\n title: string\n}\n\nexport const Route = createFileRoute('/_/flows')({\n // The route splitter drops the style namespace, so the component stays in this chunk.\n codeSplitGroupings: [],\n component: Page,\n // The canvas renders in the browser alone, since its sample balances format in the browser's\n // locale and its sample expiries read the clock.\n ssr: false,\n})\n\n/** Renders the canvas. */\nfunction Page(): ReactNode {\n return (\n <main {...styles.canvas()}>\n <header {...styles.intro()}>\n <h1 {...styles.title()}>Flows</h1>\n <p {...styles.lede()}>\n Every path through Tempo ID, from the entry point on the left to the\n exit on the right. Each arrow names the request or event that leads to\n the next step. Scroll to pan.\n </p>\n </header>\n {sections().map((section) => (\n <section {...styles.section()} key={section.title}>\n <h2 {...styles.sectionTitle()}>{section.title}</h2>\n {section.flows.map((flow) => (\n <article {...styles.flow()} key={flow.title}>\n <header {...styles.flowHeader()}>\n <h3 {...styles.flowTitle()}>{flow.title}</h3>\n <p {...styles.flowDescription()}>\n <Description text={flow.description} />\n </p>\n </header>\n <ol {...styles.row()}>\n {flow.nodes.map((node, index) => (\n <li {...styles.step()} key={`${index}:${node.name}`}>\n {index > 0 ? <Arrow label={node.edge} /> : null}\n {node.screen ? (\n <figure {...styles.artboard()}>\n <figcaption {...styles.frameLabel()}>\n {node.owner === 'app'\n ? `App · ${node.name}`\n : node.name}\n </figcaption>\n {node.owner === 'app' ? (\n <div {...vars({ set: 'thirdParty' })}>\n <div {...styles.frame()}>{node.screen}</div>\n </div>\n ) : (\n <div {...styles.frame()}>{node.screen}</div>\n )}\n </figure>\n ) : (\n <External\n detail={node.detail}\n kind={(() => {\n if (index === 0) return 'Entry'\n if (index === flow.nodes.length - 1) return 'Exit'\n return 'External'\n })()}\n name={node.name}\n />\n )}\n </li>\n ))}\n </ol>\n </article>\n ))}\n </section>\n ))}\n </main>\n )\n}\n\n/** Renders `text`, with each span between backticks as code. */\nfunction Description(props: Description.Props): ReactNode {\n // Splitting on the backticks puts each code span at an odd index.\n return props.text.split('`').map((part, index) =>\n index % 2 ? (\n <code {...styles.code()} key={index}>\n {part}\n </code>\n ) : (\n part\n ),\n )\n}\n\ndeclare namespace Description {\n type Props = {\n /** The flow's description, with code spans between backticks. */\n text: string\n }\n}\n\n/** A labeled arrow between two nodes. */\nfunction Arrow(props: Arrow.Props): ReactNode {\n return (\n <span {...styles.arrow()} aria-label={props.label ?? 'Then'} role=\"img\">\n <span {...styles.edge()}>{props.label}</span>\n <span {...styles.shaft()}>\n <span {...styles.line()} />\n <ChevronRight {...styles.head()} aria-hidden />\n </span>\n </span>\n )\n}\n\ndeclare namespace Arrow {\n type Props = {\n /** The request or event that the arrow stands for. */\n label?: string | undefined\n }\n}\n\n/** A step outside Tempo ID's pages, such as the app that starts a flow or a provider's page. */\nfunction External(props: External.Props): ReactNode {\n return (\n <div {...styles.external({ kind: props.kind })}>\n <span {...styles.kind()}>{props.kind}</span>\n <span {...styles.externalName()}>{props.name}</span>\n {props.detail ? <code {...styles.detail()}>{props.detail}</code> : null}\n </div>\n )\n}\n\ndeclare namespace External {\n type Props = {\n /** A secondary line, such as the request that enters the flow. */\n detail?: string | undefined\n /** Where the step sits in its flow. */\n kind: 'Entry' | 'Exit' | 'External'\n /** The step's name. */\n name: string\n }\n}\n\n/**\n * A sample app's own screen, which a headless app builds on Tempo ID's API. It draws its own\n * controls, styled after a food-delivery app, so it reads apart from Tempo ID's pages.\n */\nfunction AppScreen(props: AppScreen.Props): ReactNode {\n return (\n <div {...styles.app()}>\n <header {...styles.appHeader()}>\n <h4 {...styles.appTitle()}>{props.title}</h4>\n {props.description ? (\n <p {...styles.appDescription()}>{props.description}</p>\n ) : null}\n </header>\n {props.children}\n </div>\n )\n}\n\ndeclare namespace AppScreen {\n type Props = {\n /** The screen's controls. */\n children?: ReactNode | undefined\n /** The line below the title. */\n description?: string | undefined\n /** The screen's heading. */\n title: string\n }\n}\n\n/** A pill button in the sample app's style. */\nfunction AppButton(props: AppButton.Props): ReactNode {\n return (\n <button {...styles.appButton({ tone: props.tone })} type=\"button\">\n {props.children}\n </button>\n )\n}\n\ndeclare namespace AppButton {\n type Props = {\n /** The button's label. */\n children: ReactNode\n /** The button's colors: the brand red, Google's blue, or a quiet gray. */\n tone: 'brand' | 'google' | 'quiet'\n }\n}\n\n/** The sample app's labeled email field. */\nfunction AppEmailField(): ReactNode {\n return (\n <label {...styles.appField()}>\n <span {...styles.appLabel()}>Email</span>\n <input {...styles.appInput()} placeholder=\"Required\" readOnly />\n </label>\n )\n}\n\n/** The sample app's sign-in, which offers Google, a passkey, and an email. */\nfunction AppSignIn(): ReactNode {\n return (\n <AppScreen title=\"Sign in or sign up\">\n <AppButton tone=\"google\">Continue with Google</AppButton>\n <AppButton tone=\"quiet\">Continue with passkey</AppButton>\n <p {...styles.appDivider()}>or continue with email</p>\n <AppEmailField />\n <AppButton tone=\"brand\">Continue</AppButton>\n </AppScreen>\n )\n}\n\n/** The sample app's email step, which an unlinked passkey needs before its code. */\nfunction AppEmail(): ReactNode {\n return (\n <AppScreen\n description=\"Sign in with your email to link this passkey.\"\n title=\"Add your email\"\n >\n <AppEmailField />\n <AppButton tone=\"brand\">Continue</AppButton>\n </AppScreen>\n )\n}\n\n/** The sample app's code step. */\nfunction AppCode(): ReactNode {\n return (\n <AppScreen\n description={`Enter the 6-digit code sent to ${email}.`}\n title=\"Check your email\"\n >\n <CodeInput aria-label=\"Code\" length={6} readOnly />\n <AppButton tone=\"brand\">Verify</AppButton>\n </AppScreen>\n )\n}\n\n/** The sample app once it holds the authorization. */\nfunction AppSignedIn(): ReactNode {\n return (\n <AppScreen description={email} title=\"You're signed in\">\n <p {...styles.appAddress()}>{accounts[0].address}</p>\n <AppButton tone=\"quiet\">Sign out</AppButton>\n </AppScreen>\n )\n}\n\n/** A handler that the canvas's screens call, which does nothing. */\nfunction noop() {}\n\n/** A form handler that the canvas's screens call, which keeps the form from submitting. */\nfunction prevent(event: FormEvent<HTMLFormElement>) {\n event.preventDefault()\n}\n\n/** The sample user's Tempo Accounts: one owned by a Privy wallet, and one by a passkey. */\nconst accounts = [\n {\n address: '0x1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9f3c',\n balance: { amount: '1250.5', currency: 'USD' },\n owner: 'privy',\n realm: null,\n },\n {\n address: '0x7c4d2e9a1b3f5c7d9e0a2b4c6d8e0f1a3b5c21ab',\n balance: { amount: '42', currency: 'USD' },\n owner: 'webAuthn',\n realm: null,\n },\n] as const satisfies readonly ChooseAccount.Account[]\n\n/** The sample address that the code steps name. */\nconst email = 'user@example.com'\n\n/** The sample refusal of an upstream service, which the failure flows show. */\nconst unavailable = 'An upstream service is unavailable. Retry later.'\n\n/** The key that the samples request: 100 USD a day for a week, in pathUSD. */\nfunction key(): Approval.Key {\n return {\n expiry: Math.floor(Date.now() / 1000) + 7 * 24 * 60 * 60,\n limits: [\n {\n amount: '100',\n currency: 'USD',\n period: 24 * 60 * 60,\n tokens: [{ amount: '100', symbol: 'pathUSD' }],\n },\n ],\n }\n}\n\n/** The props that `Approval` takes for a key, before a decision. */\nfunction approval(): Approval.Props {\n return {\n app: 'Tempo Wallet',\n approving: false,\n denying: false,\n destination: 'wallet.tempo.xyz',\n email,\n heading: 'h4',\n keyAuthorization: key(),\n onApprove: noop,\n onDeny: noop,\n }\n}\n\n/** The request that the sign-in page shows and grants: the app and its key. */\nfunction signInRequest(): NonNullable<SignIn.Props['request']> {\n return { app: 'Tempo Wallet', key: key() }\n}\n\n/** The entry of an app's redirect with a key, which a signed-out user signs in for. */\nconst keyedEntry = {\n detail: 'GET /authorize?…&key_authorization',\n name: 'Web app',\n} as const satisfies Node\n\n/** The props that `Account` takes once the user is signed in. */\nfunction account(): Account.Props {\n return {\n accounts: [accounts[0]],\n email,\n heading: 'h4',\n onSignOut: noop,\n signingOut: false,\n }\n}\n\n/** The props that `ChooseAccount` takes with nothing chosen. */\nfunction chooseAccount(): ChooseAccount.Props {\n return { accounts, app: 'Tempo Wallet', heading: 'h4', onChoose: noop }\n}\n\n/** The props that `DeviceApproval` takes before anything is submitted. */\nfunction deviceApproval(): DeviceApproval.Props {\n return {\n approving: false,\n code: '',\n denying: false,\n fetching: false,\n heading: 'h4',\n invalid: false,\n onApprove: noop,\n onDeny: noop,\n onSubmitCode: prevent,\n }\n}\n\n/** A sample request of `tempo-id login`, with its key, as `GET /v1/device/requests/:code` returns it. */\nfunction deviceRequest(): DeviceApproval.Request {\n return {\n app: { name: 'Tempo CLI' },\n created_at: Math.floor(Date.now() / 1000),\n device: 'ada-macbook',\n ip: '203.0.113.7',\n key_authorization: key(),\n location: 'San Francisco, US',\n user_code: 'BDWP-HQPK',\n }\n}\n\n/** The entry of `tempo-id login`, which requests a code with a new access key. */\nconst loginEntry = {\n detail: 'POST /v1/device/authorize with key_authorization',\n name: 'tempo-id login',\n} as const satisfies Node\n\n/** The exit of `tempo-id login`: the poll that receives the tokens and the signed key. */\nconst loginExit = {\n detail:\n 'Tokens and key_authorization, stored in ~/.tempo/id/credentials.json. A replaced session’s refresh token goes to POST /oauth2/revoke.',\n edge: 'POST /v1/device/token: authorization_pending, then tokens',\n name: 'tempo-id login',\n} as const satisfies Node\n\n/** The props that `SignIn` takes before anything is submitted, with every sign-in method. */\nfunction signIn(): SignIn.Props {\n return {\n heading: 'h4',\n invalid: false,\n onChangeEmail: noop,\n onGoogle: noop,\n onPasskey: noop,\n onResend: noop,\n onStartOver: noop,\n onSubmitCode: prevent,\n onSubmitEmail: prevent,\n resend: 'idle',\n sending: false,\n verifying: false,\n }\n}\n\n/** The entry of an app's redirect: the browser opens `/authorize`, which `/oauth2/authorize` signs. */\nconst redirectEntry = {\n detail: 'GET /authorize?client_id&redirect_uri&code_challenge&state',\n name: 'Web app',\n} as const satisfies Node\n\n/** The requests of a headless app's page load that select its own sign-in: no session, and the providers. */\nconst appSignInEdge = 'GET /v1/auth/session: no user, GET /v1/auth/providers'\n\n/** The exit of an app's redirect: the app redeems the code at the token endpoint. */\nconst tokenExit = {\n detail: 'Access, ID, and refresh tokens',\n edge: 'POST /oauth2/token with code_verifier',\n name: 'Web app',\n} as const satisfies Node\n\n/**\n * Every flow, grouped by how it starts. Update it in the same change as any flow it shows. The page\n * calls it on each render, so sample dates and expiries read the clock then.\n */\nfunction sections(): readonly Section[] {\n return [\n {\n flows: [\n {\n description:\n 'A visitor opens Tempo ID without a session and signs in with an emailed code. An accepted code shows green for 500 ms before the sign-in continues.',\n nodes: [\n { detail: 'GET /', name: 'Browser opens Tempo ID' },\n {\n edge: '302 /login',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect: null',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Email code',\n },\n {\n description:\n 'A passkey of the realm signs the user in with one prompt, from the button or from the email field’s autofill.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n { name: 'Sign in', screen: <SignIn {...signIn()} /> },\n {\n detail: 'POST /v1/auth/passkey/options',\n edge: 'Sign in with a passkey, or autofill',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/passkey/verify',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Passkey',\n },\n {\n description:\n 'A wallet.tempo passkey without an email verifies one with a code. The passkey signs again with the code, which links it to the user.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n { name: 'Sign in', screen: <SignIn {...signIn()} /> },\n {\n detail: 'POST /v1/auth/passkey/options',\n edge: 'Sign in with a passkey',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/passkey/verify: step email',\n name: 'Sign in (link passkey)',\n screen: <SignIn {...signIn()} linking />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email (link passkey)',\n screen: <SignIn {...signIn()} email={email} linking />,\n },\n {\n detail: 'POST /v1/auth/passkey/options with link',\n edge: 'Code complete',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/code/verify with link and assertion: 200',\n name: 'Check your email (link accepted)',\n screen: <SignIn {...signIn()} email={email} linking verified />,\n },\n {\n edge: 'after 500 ms, redirect: null',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Passkey without an email',\n },\n {\n description:\n 'Start over on the email step drops the passkey’s link and a pending code request, so the passkey stays unlinked.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Sign in with a passkey, POST /v1/auth/passkey/verify: step email',\n name: 'Sign in (link passkey)',\n screen: <SignIn {...signIn()} linking />,\n },\n {\n edge: 'Start over',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n ],\n title: 'Passkey link, started over',\n },\n {\n description:\n 'Google signs the user in, and its callback returns to the sign-in page, which sends a signed-in user on.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n { name: 'Sign in', screen: <SignIn {...signIn()} /> },\n {\n edge: 'GET /v1/auth/oauth/google?return_to=/login',\n name: 'Google',\n },\n {\n edge: 'GET /callback/google, 302 /login, 302 /',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Google',\n },\n {\n description:\n 'A Google sign-in that fails returns to the sign-in page with `error=access_denied`, whatever the cause.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n { name: 'Sign in', screen: <SignIn {...signIn()} /> },\n {\n edge: 'GET /v1/auth/oauth/google?return_to=/login',\n name: 'Google',\n },\n {\n edge: 'GET /callback/google, 302 /v1/auth/oauth/google/failed, 302 /login?error=access_denied',\n name: 'Sign in (Google failed)',\n screen: (\n <SignIn\n {...signIn()}\n error=\"Sign-in with Google failed. Try again, or continue with email.\"\n />\n ),\n },\n ],\n title: 'Google, failed',\n },\n {\n description:\n 'A deployment without Google, and realms without a passkey relying party at Tempo ID’s origin, leave only the email field.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: '200, google: false, passkeys: false',\n name: 'Sign in (email only)',\n screen: (\n <SignIn\n {...signIn()}\n onGoogle={undefined}\n onPasskey={undefined}\n />\n ),\n },\n ],\n title: 'Email only',\n },\n {\n description:\n 'Each sign-in request holds its controls, shows a spinner, and announces its progress until it settles. One sign-in runs at a time.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Continue, POST /v1/auth/code',\n name: 'Sign in (sending)',\n screen: <SignIn {...signIn()} sending />,\n },\n {\n edge: 'Or: Sign in with a passkey',\n name: 'Sign in (passkey pending)',\n screen: <SignIn {...signIn()} passkeyPending />,\n },\n {\n edge: 'Code complete, POST /v1/auth/code/verify',\n name: 'Check your email (verifying)',\n screen: <SignIn {...signIn()} email={email} verifying />,\n },\n {\n edge: 'Or: Resend code, POST /v1/auth/code',\n name: 'Check your email (resending)',\n screen: <SignIn {...signIn()} email={email} resend=\"pending\" />,\n },\n ],\n title: 'Sign-in in progress',\n },\n ],\n title: 'Sign-in',\n },\n {\n flows: [\n {\n description:\n 'The account page lists the user’s Tempo Accounts in the `default` realm, oldest first, each with its balance and a deposit link. A lone wallet shows its balance large, without a list.',\n nodes: [\n { detail: 'GET /', name: 'Browser opens Tempo ID' },\n {\n edge: '200, one wallet',\n name: 'Your account (one wallet)',\n screen: <Account {...account()} />,\n },\n {\n edge: 'Or: several wallets',\n name: 'Your account (several wallets)',\n screen: <Account {...account()} accounts={accounts} />,\n },\n {\n edge: 'Or: a balance read fails',\n name: 'Your account (balance unavailable)',\n screen: (\n <Account\n {...account()}\n accounts={[accounts[0], { ...accounts[1], balance: null }]}\n />\n ),\n },\n {\n edge: 'Or: no wallets',\n name: 'Your account (no wallets)',\n screen: <Account {...account()} accounts={[]} />,\n },\n {\n edge: 'Or: the accounts cannot be read',\n name: 'Your account (unavailable)',\n screen: (\n <Account\n {...account()}\n accountError=\"Your wallets failed to load. Reload the page to try again.\"\n accounts={null}\n />\n ),\n },\n ],\n title: 'Account page',\n },\n {\n description:\n 'The account page and the deposit page send a visitor without a session to sign-in, which then opens the account page. The deposit page leaves the address out of the sign-in query.',\n nodes: [\n { detail: 'GET / or GET /deposit?address', name: 'Browser' },\n {\n edge: '302 /login, no session',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect: null, GET /',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Account page, signed out',\n },\n {\n description:\n 'Deposit lists the networks and cash methods for one of the user’s wallets. Only Tempo is available, and it shows the wallet’s address as a QR code and as text. Back on Receive funds returns to the deposit methods.',\n nodes: [\n { detail: 'GET /', name: 'Browser opens Tempo ID' },\n {\n edge: '200, one wallet',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n {\n edge: 'Deposit, GET /deposit?address',\n name: 'Deposit',\n screen: <Deposit address={accounts[0].address} heading=\"h4\" />,\n },\n {\n edge: 'Tempo, GET /deposit?address&method=tempo',\n name: 'Receive funds',\n screen: (\n <Deposit\n address={accounts[0].address}\n heading=\"h4\"\n method=\"tempo\"\n />\n ),\n },\n {\n edge: 'Back, GET /deposit?address',\n name: 'Deposit',\n screen: <Deposit address={accounts[0].address} heading=\"h4\" />,\n },\n {\n edge: 'Back, GET /',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Deposit',\n },\n {\n description: 'Done on Receive funds opens the account page at once.',\n nodes: [\n { detail: 'GET /deposit?address&method=tempo', name: 'Browser' },\n {\n edge: '200 deposit page',\n name: 'Receive funds',\n screen: (\n <Deposit\n address={accounts[0].address}\n heading=\"h4\"\n method=\"tempo\"\n />\n ),\n },\n {\n edge: 'Done, GET /',\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n ],\n title: 'Deposit, Done',\n },\n {\n description:\n 'An address that is not one of the user’s wallets in the `default` realm shows no address. A spent rate limit or a failed account read shows its own reason in the same place.',\n nodes: [\n {\n detail: 'GET /deposit?address (not the user’s)',\n name: 'Browser',\n },\n {\n edge: '200, address: null',\n name: 'Deposit (wallet not found)',\n screen: (\n <Deposit\n error=\"This wallet was not found. Go back to your account, then choose Deposit.\"\n heading=\"h4\"\n />\n ),\n },\n {\n edge: 'Or: the account rate limit is spent',\n name: 'Deposit (rate limited)',\n screen: (\n <Deposit\n error=\"Too many requests. Retry after 60 seconds.\"\n heading=\"h4\"\n />\n ),\n },\n {\n edge: 'Or: the accounts cannot be read',\n name: 'Deposit (unavailable)',\n screen: (\n <Deposit\n error=\"Your wallets failed to load. Reload the page to try again.\"\n heading=\"h4\"\n />\n ),\n },\n ],\n title: 'Wallet not found',\n },\n ],\n title: 'Account and deposit',\n },\n {\n flows: [\n {\n description:\n 'A web app redirects a signed-out user. Better Auth signs the request, and the sign-in continues it.',\n nodes: [\n redirectEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'after 500 ms, redirect',\n name: 'Web app callback',\n },\n tokenExit,\n ],\n title: 'Redirect, signed out',\n },\n {\n description:\n 'A signed-out user’s request with a key shows the app and the key on the sign-in page. The first sign-in of the request grants the key, so the browser returns to the app without the approval page.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig, GET /login: request',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, grants the key',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'after 500 ms, redirect',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in that grants a key',\n },\n {\n description:\n 'On the sign-in page, the passkey’s challenge is the digest of the request’s key. One tap signs the user in and signs the key, for an account that this passkey owns, or that Privy or secp256k1 owns.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n detail:\n 'POST /v1/auth/passkey/options with oauth_query: the key’s digest',\n edge: 'Sign in with a passkey',\n name: 'Authenticator prompt',\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'POST /v1/auth/passkey/verify with oauth_query, grants the key',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in that grants a key, passkey one-tap',\n },\n {\n description:\n 'The sign-in page starts Google with `sec-fetch-site: same-origin`, so the start sets the `__Host-tempo-id-grant` cookie for the request. The callback grants the key only when the cookie matches the request, and clears it.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'GET /v1/auth/oauth/google?oauth_query&return_to, same-origin: sets __Host-tempo-id-grant',\n name: 'Google',\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'GET /callback/google, the cookie matches: grants the key, 302',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in that grants a key, Google',\n },\n {\n description:\n 'Any site can send a browser to the Google start. Without `sec-fetch-site: same-origin`, the start clears the grant cookie. The callback then keeps the redirect to the approval page, which shows the key.',\n nodes: [\n {\n detail: 'GET /v1/auth/oauth/google?oauth_query&return_to',\n name: 'Another site',\n },\n {\n edge: 'cross-site: clears __Host-tempo-id-grant, 302',\n name: 'Google',\n },\n {\n edge: 'GET /callback/google, no grant cookie, 302 /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Google start from another site',\n },\n {\n description:\n 'The account step does not run when the account reads are spent. The sign-in page shows no account, so a user with several accounts gets no grant, and the approval page opens. That page holds Approve until a reload after a minute.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: ACCOUNT_LIMIT spent, no account step, several accounts: no grant',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /authorize?…&sig',\n name: 'Authorize this app (unavailable)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{ ...key(), refusal: 'unavailable' }}\n />\n ),\n },\n {\n edge: 'Reload after a minute',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Several accounts, none chosen',\n },\n {\n description:\n 'A held grant covers only the request that the sign-in spent. A request with another `scope`, or with a `challenge`, takes no held grant on the account step, so the approval page opens.',\n nodes: [\n {\n detail: 'GET /choose-account?…&sig, another scope or a challenge',\n name: 'Browser',\n },\n {\n edge: '200 account step',\n name: 'Choose a wallet',\n screen: <ChooseAccount {...chooseAccount()} />,\n },\n {\n edge: 'Choose, POST /v1/authorize/account: another scope, no held grant, redirect /authorize?…&sig',\n name: 'Authorize this app (another scope)',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Or: a challenge, which takes no grant, redirect /authorize?…&sig',\n name: 'Authorize this app (challenge)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{\n ...key(),\n challenge: 'Sign in to api.example.com\\nNonce: 8f2a91',\n }}\n />\n ),\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Account step for another request',\n },\n {\n description:\n 'A user with more than one account in the app’s realms chooses one. The sign-in holds its grant for the session for 10 minutes, and the choice takes it.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, holds the grant',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /choose-account?…&sig',\n name: 'Choose a wallet',\n screen: <ChooseAccount {...chooseAccount()} />,\n },\n {\n edge: 'Choose, POST /v1/authorize/account',\n name: 'Choose a wallet (selecting)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n selecting={accounts[0].address}\n />\n ),\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'takes the held grant, redirect',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in that grants a key, account step',\n },\n {\n description:\n 'A sign-in that cannot grant the key keeps the redirect to the approval page, which shows the request again. Another passkey may own the account, or the request may be a replay. Approval may refuse the key, or the rate limit may be spent, which also refuses Approve until it resets. An upstream service may also fail.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'Sign-in with oauth_query: the grant fails, redirect /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Authorize this app (approving)',\n screen: <Approval {...approval()} approving />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'redirect, or the passkey step first',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in that keeps the approval page',\n },\n {\n description:\n 'The account step’s signed query expires 10 minutes after the sign-in, just before its held grant. A later choice is refused with `authorization_expired`, so the user starts again in the app.',\n nodes: [\n keyedEntry,\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, holds the grant',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /choose-account?…&sig',\n name: 'Choose a wallet',\n screen: <ChooseAccount {...chooseAccount()} />,\n },\n {\n edge: 'After 10 minutes, Choose, POST /v1/authorize/account: authorization_expired',\n name: 'Choose a wallet (request expired)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n error=\"Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.\"\n />\n ),\n },\n {\n detail: 'GET /authorize?…&key_authorization, a new request',\n edge: 'Return to the app, and start again',\n name: 'Web app',\n },\n ],\n title: 'Account step after the request expires',\n },\n {\n description:\n 'A request with a `challenge` signs a message that only the approval page shows. So the sign-in page shows no key, and the sign-in grants nothing.',\n nodes: [\n {\n ...keyedEntry,\n detail: 'GET /authorize?…&key_authorization&challenge',\n },\n {\n edge: '302 /oauth2/authorize, 302 /login?…&sig, GET /login: request: null',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /authorize?…&sig',\n name: 'Authorize this app (challenge)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{\n ...key(),\n challenge: 'Sign in to api.example.com\\nNonce: 8f2a91',\n }}\n />\n ),\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Sign-in with a challenge',\n },\n {\n description:\n 'A signed-in user returns to an app that skips consent at once. Tempo ID shows no screen.',\n nodes: [\n redirectEntry,\n {\n detail: 'GET redirect_uri?code&state',\n edge: '302 /oauth2/authorize, 302, no screen',\n name: 'Web app callback',\n },\n tokenExit,\n ],\n title: 'Redirect, signed in',\n },\n {\n description:\n 'A request with `prompt=login` asks a signed-in user to sign in again. The sign-in page shows the request, and its key, despite the session.',\n nodes: [\n {\n ...keyedEntry,\n detail: 'GET /authorize?…&key_authorization&prompt=login',\n },\n {\n edge: '302 /oauth2/authorize, 302 /login?…&prompt=login consent&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, grants the key',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'after 500 ms, redirect',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Redirect with prompt=login',\n },\n {\n description:\n 'A signed-in user approves an app that does not skip consent, once for the scopes it requests. The request carries no key, so the page shows none.',\n nodes: [\n redirectEntry,\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig',\n name: 'Authorize this app (no key)',\n screen: <Approval {...approval()} keyAuthorization={undefined} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'POST /v1/authorize/consent, accept',\n name: 'Web app callback',\n },\n tokenExit,\n ],\n title: 'Approval without a key',\n },\n {\n description:\n 'A signed-in user’s request with a key opens the approval page. A Privy or secp256k1 owner signs the key on the server when the user approves.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Authorize this app (approving)',\n screen: <Approval {...approval()} approving />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'redirect',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Approval of a key',\n },\n {\n description:\n 'A passkey owns the account, so the approval returns the passkey step. The passkey signs the key’s digest, and the page approves again.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Authorize this app (approving)',\n screen: <Approval {...approval()} approving />,\n },\n {\n detail: 'Signs the key authorization, over the approving page',\n edge: 'step passkey',\n name: 'Authenticator prompt',\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'POST /v1/authorize/consent with passkey.assertion',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Approval of a key for a passkey account',\n },\n {\n description:\n 'An app with the `tempo-id:sign` scope sends a challenge, and the approval page shows the message that the key signs.',\n nodes: [\n {\n detail: 'GET /authorize?…&key_authorization&challenge',\n name: 'Native app',\n },\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig',\n name: 'Authorize this app (challenge)',\n screen: (\n <Approval\n {...approval()}\n app=\"Tempo Mobile\"\n destination=\"tempo\"\n keyAuthorization={{\n ...key(),\n challenge: 'Sign in to api.example.com\\nNonce: 8f2a91',\n }}\n />\n ),\n },\n {\n detail: 'tempo:/callback?code&state',\n edge: 'POST /v1/authorize/consent, accept',\n name: 'Native app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n name: 'Native app',\n },\n ],\n title: 'Approval with a challenge',\n },\n {\n description:\n 'A user with more than one Tempo Account in the app’s realms chooses one. Each row shows the account’s balance on the chain of the request’s key, or Unavailable when the read fails. The choice continues the authorization to the approval page.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n edge: '302 /oauth2/authorize, 302 /choose-account?…&sig',\n name: 'Choose a wallet',\n screen: <ChooseAccount {...chooseAccount()} />,\n },\n {\n edge: 'Choose, POST /v1/authorize/account',\n name: 'Choose a wallet (selecting)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n selecting={accounts[0].address}\n />\n ),\n },\n {\n edge: 'redirect /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'POST /v1/authorize/consent, accept',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Account step',\n },\n {\n description:\n 'An app in several realms, such as web-shared, lists accounts from each. Each row then names its realm, apart from the `default` realm.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n name: 'Web app in two realms',\n },\n {\n edge: '302 /oauth2/authorize, 302 /choose-account?…&sig',\n name: 'Choose a wallet (two realms)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n accounts={[\n { ...accounts[0], realm: 'Tempo Cash' },\n accounts[1],\n ]}\n />\n ),\n },\n {\n edge: 'Choose, POST /v1/authorize/account',\n name: 'Choose a wallet (two realms, selecting)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n accounts={[\n { ...accounts[0], realm: 'Tempo Cash' },\n accounts[1],\n ]}\n selecting={accounts[0].address}\n />\n ),\n },\n {\n edge: 'redirect /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'POST /v1/authorize/consent, accept',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Account step across realms',\n },\n {\n description:\n 'Denying returns the browser to the app with `error=access_denied`. The app receives no code.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Deny',\n name: 'Authorize this app (denying)',\n screen: <Approval {...approval()} denying />,\n },\n {\n detail: 'GET redirect_uri?error=access_denied&state',\n edge: 'POST /v1/authorize/consent, accept: false',\n name: 'Web app callback',\n },\n ],\n title: 'Denied approval',\n },\n {\n description:\n 'Approval cannot sign some keys, so the page holds Approve and states why. Deny still returns to the app.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n edge: '302 /oauth2/authorize, 302 /authorize?…&sig: no account, and no Privy app to create one',\n name: 'Authorize this app (no account)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{ ...key(), refusal: 'no_account' }}\n />\n ),\n },\n {\n edge: 'Or: a passkey whose relying party is not Tempo ID’s, or POST /v1/authorize/consent: webauthn_required',\n name: 'Authorize this app (passkey)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{ ...key(), refusal: 'passkey' }}\n />\n ),\n },\n {\n edge: 'Or: the accounts cannot be read',\n name: 'Authorize this app (unavailable)',\n screen: (\n <Approval\n {...approval()}\n keyAuthorization={{ ...key(), refusal: 'unavailable' }}\n />\n ),\n },\n {\n detail: 'GET redirect_uri?error=access_denied&state',\n edge: 'Deny, POST /v1/authorize/consent, accept: false',\n name: 'Web app callback',\n },\n ],\n title: 'Key that approval cannot sign',\n },\n {\n description:\n 'A key that breaks a rule returns to the app with the refusal, as `/oauth2/authorize` returns one before sign-in. The `error` names the rule, such as `invalid_authorization_details` for an expired key, or `unauthorized_client` for a challenge without the `tempo-id:sign` scope.',\n nodes: [\n {\n ...redirectEntry,\n detail: 'GET /authorize?…&key_authorization',\n },\n {\n detail: 'GET redirect_uri?error&error_description',\n edge: '302 /oauth2/authorize, key refused',\n name: 'Web app callback',\n },\n ],\n title: 'Refused key',\n },\n {\n description:\n 'A changed or expired query, or a request without a known app, shows an invalid request, on the approval page and on the account step.',\n nodes: [\n { detail: 'GET /authorize?…&sig (changed)', name: 'Browser' },\n {\n edge: '200, request: null',\n name: 'This sign-in request is invalid',\n screen: <InvalidRequest heading=\"h4\" />,\n },\n {\n edge: 'Or: GET /choose-account?…&sig (changed), 200, request: null',\n name: 'This sign-in request is invalid (account step)',\n screen: <InvalidRequest heading=\"h4\" />,\n },\n ],\n title: 'Invalid request',\n },\n {\n description:\n 'A backend runs the redirect flow and redeems the code with its client secret, so tokens never reach the browser. By default the request carries a key. The seeded backend uses only the `default` realm. Without a Privy app or secp256k1 owners there, as in the test harness, no account can sign the key. So the approval page holds Approve, and Deny signs the user in again without a key.',\n nodes: [\n {\n detail: 'GET /auth/start on the backend, with a key',\n name: 'Backend playground',\n },\n {\n edge: '302 /authorize with state and code_challenge, 302 /oauth2/authorize, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: (\n <SignIn\n {...signIn()}\n request={{ ...signInRequest(), app: 'Backend playground' }}\n />\n ),\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, no account to sign',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /authorize?…&sig',\n name: 'Authorize this app (no account)',\n screen: (\n <Approval\n {...approval()}\n app=\"Backend playground\"\n destination=\"backend.example.com\"\n keyAuthorization={{ ...key(), refusal: 'no_account' }}\n />\n ),\n },\n {\n detail: 'GET /auth/callback?error=access_denied&state',\n edge: 'Deny, POST /v1/authorize/consent, accept: false',\n name: 'Backend callback',\n },\n {\n detail: 'GET /auth/callback?code&state',\n edge: '302 /auth/start?key=false, 302 /authorize, 302 /oauth2/authorize, 302, no screen',\n name: 'Backend callback',\n },\n {\n detail: 'Tokens stay on the server, without a key',\n edge: 'POST /oauth2/token with client_secret',\n name: 'Backend session',\n },\n ],\n title: 'Backend app',\n },\n ],\n title: 'App authorization',\n },\n {\n flows: [\n {\n description:\n \"The app's own pages send the code, verify it, and request the authorization. Tempo ID shows no screen.\",\n nodes: [\n { detail: 'Web playground', name: \"App's sign-in\" },\n {\n edge: appSignInEdge,\n name: 'Sign in',\n owner: 'app',\n screen: <AppSignIn />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n owner: 'app',\n screen: <AppCode />,\n },\n {\n edge: 'POST /v1/auth/code/verify, POST /v1/account, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless email code',\n },\n {\n description:\n 'A signed-in user skips the code. The app requests the authorization at once.',\n nodes: [\n { detail: 'Session cookie set', name: \"App's page\" },\n {\n edge: 'GET /v1/auth/session, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless, signed in',\n },\n {\n description:\n \"The app's page runs the passkey ceremony with its client ID, which selects the app's realms.\",\n nodes: [\n { detail: 'Web playground', name: \"App's sign-in\" },\n {\n edge: appSignInEdge,\n name: 'Sign in',\n owner: 'app',\n screen: <AppSignIn />,\n },\n {\n detail: 'POST /v1/auth/passkey/options with client_id',\n edge: 'Continue with passkey',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/passkey/verify, POST /v1/account, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless passkey',\n },\n {\n description:\n \"A wallet.tempo passkey without an email verifies one through the app's own code step. The passkey signs again with the code, which links it. If that passkey owns the account, the app continues through the headless passkey fallback below.\",\n nodes: [\n { detail: 'Web playground', name: \"App's sign-in\" },\n {\n edge: appSignInEdge,\n name: 'Sign in',\n owner: 'app',\n screen: <AppSignIn />,\n },\n {\n detail: 'POST /v1/auth/passkey/options with client_id',\n edge: 'Continue with passkey',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/passkey/verify: step email',\n name: 'Add your email',\n owner: 'app',\n screen: <AppEmail />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n owner: 'app',\n screen: <AppCode />,\n },\n {\n detail: 'POST /v1/auth/passkey/options with link',\n edge: 'Code complete',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/auth/code/verify with link and assertion, POST /v1/account, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless passkey without an email',\n },\n {\n description:\n 'Google returns the browser to the app with a session. The app then requests the authorization. A user without a Tempo Account is refused with `rejected`, so the app reads the accounts, creates the first one if none exists, and requests the authorization again.',\n nodes: [\n { detail: 'Web playground', name: \"App's sign-in\" },\n {\n edge: appSignInEdge,\n name: 'Sign in',\n owner: 'app',\n screen: <AppSignIn />,\n },\n {\n edge: 'GET /v1/auth/oauth/google?client_id&return_to',\n name: 'Google',\n },\n {\n edge: 'GET /callback/google, 302 return_to, GET /v1/auth/session, POST /v1/authorize: rejected, GET /v1/account, POST /v1/account, GET /v1/auth/session, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless Google',\n },\n {\n description:\n 'Approval does not sign a key of a passkey that owns the account, so `POST /v1/authorize` refuses it with `webauthn_required`. The app signs in through a redirect without a key, which skips the approval page, since the playgrounds skip consent.',\n nodes: [\n {\n detail: 'POST /v1/authorize: webauthn_required',\n name: \"App's sign-in\",\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'GET /authorize without key_authorization, 302 /oauth2/authorize, 302, no screen',\n name: 'Web app callback',\n },\n {\n edge: 'POST /oauth2/token with code_verifier',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n ],\n title: 'Headless passkey fallback',\n },\n ],\n title: 'Headless apps',\n },\n {\n flows: [\n {\n description:\n \"`tempo-id login` requests a code with a new access key, and prints `verification_uri_complete`. Sign-in returns to the device page with the code filled in. The CLI's next poll receives the tokens and the signed key, and stores them.\",\n nodes: [\n loginEntry,\n {\n detail: 'GET /device?code',\n edge: 'Shows verification_uri_complete',\n name: 'Browser',\n },\n {\n edge: '302 /login?return_to=/device?code',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, /device?code',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'POST /v1/device/approve',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"approved\"\n />\n ),\n },\n loginExit,\n ],\n title: 'Device code, signed out',\n },\n {\n description:\n 'A user who opens the bare `verification_uri` types the code that the terminal shows.',\n nodes: [\n loginEntry,\n {\n detail: 'GET /device',\n edge: 'Shows user_code and verification_uri',\n name: 'Browser',\n },\n {\n edge: '200 device page',\n name: 'Authorize a device (enter a code)',\n screen: <DeviceApproval {...deviceApproval()} />,\n },\n {\n edge: 'Continue, GET /device?code',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'POST /v1/device/approve',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"approved\"\n />\n ),\n },\n loginExit,\n ],\n title: 'Device code, typed',\n },\n {\n description:\n 'A device client that reads discovery uses the standard endpoints of RFC 8628. The browser takes the same steps as for `POST /v1/device/authorize`.',\n nodes: [\n { detail: 'POST /device/code', name: 'Device client' },\n {\n detail: 'GET /device?user_code',\n edge: 'Shows verification_uri_complete',\n name: 'Browser',\n },\n {\n edge: '302 /login?return_to=/device?user_code',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, /device?code',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n device: undefined,\n key_authorization: undefined,\n }}\n />\n ),\n },\n {\n edge: 'Approve, POST /v1/device/approve',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n device: undefined,\n key_authorization: undefined,\n }}\n status=\"approved\"\n />\n ),\n },\n {\n detail:\n 'POST /oauth2/token with grant_type=urn:ietf:params:oauth:grant-type:device_code',\n edge: 'Next poll: tokens',\n name: 'Device client',\n },\n ],\n title: 'Device code, standard endpoints',\n },\n {\n description:\n \"Denying ends the request. The CLI's next poll is refused.\",\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: '200 device page',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'POST /v1/device/deny',\n name: 'Denied',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"denied\"\n />\n ),\n },\n {\n detail: 'Exits with not_signed_in',\n edge: 'POST /v1/device/token: request_denied',\n name: 'tempo-id login',\n },\n ],\n title: 'Device code, denied',\n },\n {\n description:\n 'A passkey owns the account, so the approval returns the passkey step. The passkey signs the key’s digest in this browser, and the page approves again.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: '200 device page',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'Approve, POST /v1/device/approve',\n name: 'Authorize a device (approving)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n approving\n request={deviceRequest()}\n />\n ),\n },\n {\n detail: 'Signs the key authorization, over the approving page',\n edge: 'step passkey',\n name: 'Authenticator prompt',\n },\n {\n edge: 'POST /v1/device/approve with passkey.assertion',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"approved\"\n />\n ),\n },\n loginExit,\n ],\n title: 'Device approval for a passkey account',\n },\n {\n description:\n 'Approval cannot sign some keys, so the page holds Approve and states why. Deny still ends the request.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: 'The key names an account that the user does not hold',\n name: 'Authorize a device (foreign account)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n key_authorization: { ...key(), refusal: 'foreign_account' },\n }}\n />\n ),\n },\n {\n edge: 'Or: no account, and no Privy app to create one',\n name: 'Authorize a device (no account)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n key_authorization: { ...key(), refusal: 'no_account' },\n }}\n />\n ),\n },\n {\n edge: 'Or: a passkey whose relying party is not Tempo ID’s, or POST /v1/device/approve: webauthn_required',\n name: 'Authorize a device (passkey)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n key_authorization: { ...key(), refusal: 'passkey' },\n }}\n />\n ),\n },\n {\n edge: 'Or: the accounts cannot be read',\n name: 'Authorize a device (unavailable)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n key_authorization: { ...key(), refusal: 'unavailable' },\n }}\n />\n ),\n },\n {\n detail: 'POST /v1/device/token: request_denied',\n edge: 'Deny, POST /v1/device/deny',\n name: 'tempo-id login',\n },\n ],\n title: 'Device key that approval cannot sign',\n },\n {\n description:\n 'A CLI with the `tempo-id:sign` scope sends a challenge, and the device page shows the message that the key signs.',\n nodes: [\n {\n detail:\n 'POST /v1/device/authorize with key_authorization and challenge',\n name: 'CLI',\n },\n {\n edge: 'GET /device?code, 200 device page',\n name: 'Authorize a device (challenge)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{\n ...deviceRequest(),\n challenge: 'Sign in to api.example.com\\nNonce: 8f2a91',\n }}\n />\n ),\n },\n {\n edge: 'Approve, POST /v1/device/approve, or the passkey step first',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"approved\"\n />\n ),\n },\n {\n detail:\n 'Tokens, and key_authorization bound to the challenge’s hash',\n edge: 'POST /v1/device/token: authorization_pending, then tokens',\n name: 'CLI',\n },\n ],\n title: 'Device code with a challenge',\n },\n {\n description:\n 'A code that is already approved or denied shows its outcome again, without the decision buttons.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: '200, status: approved',\n name: 'Authorization successful',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n status=\"approved\"\n />\n ),\n },\n ],\n title: 'Decided device code',\n },\n {\n description:\n 'A code that no one approves before `expires_in` ends the login. The CLI stores nothing, and the user runs `tempo-id login` again.',\n nodes: [\n loginEntry,\n {\n detail: 'Exits with not_signed_in',\n edge: 'POST /v1/device/token: authorization_pending, then device_code_expired',\n name: 'tempo-id login',\n },\n ],\n title: 'tempo-id login, expired',\n },\n {\n description:\n 'The CLI reads the stored session, refreshes its access token when it expires within 30 seconds, and reads the user.',\n nodes: [\n { detail: '~/.tempo/id/credentials.json', name: 'tempo-id whoami' },\n {\n detail: 'Email and Tempo Account',\n edge: 'POST /oauth2/token with refresh_token within 30 s of expiry, GET /oauth2/userinfo',\n name: 'tempo-id whoami',\n },\n ],\n title: 'tempo-id whoami',\n },\n {\n description:\n 'Each device request holds the code field or the decision buttons, and shows a spinner, until it settles.',\n nodes: [\n { detail: 'GET /device', name: 'Browser' },\n {\n edge: 'Continue, GET /device?code',\n name: 'Authorize a device (fetching)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n code=\"BDWP-HQPK\"\n fetching\n />\n ),\n },\n {\n edge: 'Approve, POST /v1/device/approve',\n name: 'Authorize a device (approving)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n approving\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'Or: Deny, POST /v1/device/deny',\n name: 'Authorize a device (denying)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n denying\n request={deviceRequest()}\n />\n ),\n },\n ],\n title: 'Device code in progress',\n },\n {\n description:\n 'A device app without a display name could be anyone’s, so the request omits `app`, and the page flags an unverified app.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: '200 device page, request without app',\n name: 'Authorize a device (unverified app)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={{ ...deviceRequest(), app: undefined }}\n />\n ),\n },\n ],\n title: 'Unverified device app',\n },\n {\n description:\n 'A code that matches no pending request, or one that another user holds, keeps the code form.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: 'unknown_code',\n name: 'Authorize a device (unknown code)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n code=\"BDWP-HQPX\"\n error=\"Invalid or expired code. Check the code in the terminal.\"\n invalid\n />\n ),\n },\n ],\n title: 'Unknown device code',\n },\n {\n description:\n 'Each user’s code lookups share one rate limit, so the page refuses a lookup over it and keeps the code form.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: 'Lookup over the rate limit',\n name: 'Authorize a device (rate limited)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n code=\"BDWP-HQPK\"\n error=\"Too many requests. Retry after 60 seconds.\"\n invalid\n />\n ),\n },\n ],\n title: 'Device code lookup rate limited',\n },\n ],\n title: 'Device grant',\n },\n {\n flows: [\n {\n description:\n 'Sign-out ends the session and revokes its refresh tokens, then opens the sign-in page.',\n nodes: [\n { detail: 'GET /', name: 'Browser opens Tempo ID' },\n {\n name: 'Your account',\n screen: <Account {...account()} />,\n },\n {\n edge: 'Sign out, POST /v1/auth/logout',\n name: 'Your account (signing out)',\n screen: <Account {...account()} signingOut />,\n },\n {\n edge: '200, then /login',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n ],\n title: 'Sign-out',\n },\n {\n description:\n 'An app signs the user out with its ID token. Tempo ID ends the session that the hint names, if this browser holds it, and redirects to the app.',\n nodes: [\n {\n detail:\n 'GET /oauth2/end-session?id_token_hint&post_logout_redirect_uri&state',\n name: 'Web app',\n },\n {\n detail: 'GET post_logout_redirect_uri?state',\n edge: '302, no screen',\n name: 'Web app',\n },\n ],\n title: 'RP-initiated logout',\n },\n {\n description:\n 'A cross-site form POST carries no `SameSite=Lax` session cookie, so Tempo ID seals the parameters and continues as a GET, which carries the cookie.',\n nodes: [\n {\n detail:\n 'POST /oauth2/end-session with id_token_hint, post_logout_redirect_uri, and state',\n name: 'Web app',\n },\n {\n detail: 'GET /oauth2/end-session?continuation',\n edge: '303, no session cookie',\n name: 'Browser',\n },\n {\n detail: 'GET post_logout_redirect_uri?state',\n edge: '302, no screen',\n name: 'Web app',\n },\n ],\n title: 'RP-initiated logout, form POST',\n },\n {\n description:\n \"An app's own Sign out ends the Tempo ID session. The app forgets the sign-in even if the request fails, and shows the error.\",\n nodes: [\n { detail: 'Web playground', name: \"App's page\" },\n {\n edge: 'GET /v1/auth/session, POST /v1/authorize',\n name: 'Signed in',\n owner: 'app',\n screen: <AppSignedIn />,\n },\n {\n edge: 'Sign out, POST /v1/auth/logout',\n name: 'Sign in',\n owner: 'app',\n screen: <AppSignIn />,\n },\n ],\n title: 'Headless sign-out',\n },\n {\n description:\n 'The CLI revokes the stored refresh token at the deployment that issued it, and deletes the session even if the revocation fails.',\n nodes: [\n { detail: '~/.tempo/id/credentials.json', name: 'tempo-id logout' },\n {\n detail: 'Session deleted',\n edge: 'POST /oauth2/revoke with the refresh token',\n name: 'tempo-id logout',\n },\n ],\n title: 'tempo-id logout',\n },\n ],\n title: 'Sign-out',\n },\n {\n flows: [\n {\n description:\n 'A refused send keeps the first step, with the refusal below the email field, which it marks invalid. The user can try again or pick another method.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'POST /v1/auth/code: 503',\n name: 'Sign in (send failed)',\n screen: <SignIn {...signIn()} error={unavailable} invalid />,\n },\n ],\n title: 'Send failed',\n },\n {\n description:\n 'A canceled prompt or a refused passkey keeps the first step, with the error below the email field. The email field is not marked invalid, since no address was sent.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Canceled prompt, or POST /v1/auth/passkey/verify refused',\n name: 'Sign in (passkey failed)',\n screen: (\n <SignIn\n {...signIn()}\n error=\"Passkey sign-in was canceled. Try again, or continue with email.\"\n />\n ),\n },\n ],\n title: 'Passkey failed',\n },\n {\n description:\n 'A refused code clears the field and marks it invalid, so the next code can be typed at once.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'POST /v1/auth/code/verify: 401',\n name: 'Check your email (wrong code)',\n screen: (\n <SignIn\n {...signIn()}\n email={email}\n error=\"Invalid or expired code. Request a new one.\"\n invalid\n />\n ),\n },\n ],\n title: 'Wrong code',\n },\n {\n description:\n 'A passkey that does not sign again, or whose assertion is refused, drops the link. The code field clears and takes focus, so the next code signs in with email only.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Canceled prompt, or POST /v1/auth/code/verify with link: webauthn_rejected',\n name: 'Check your email (link failed)',\n screen: (\n <SignIn\n {...signIn()}\n email={email}\n error=\"Your passkey did not confirm the sign-in. Enter the code again to sign in with email only.\"\n invalid\n />\n ),\n },\n ],\n title: 'Passkey link failed',\n },\n {\n description:\n 'A resent code shows Code sent on the button, and a hidden status announces the send. The code field keeps its value.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Resend code, POST /v1/auth/code',\n name: 'Check your email (resent)',\n screen: <SignIn {...signIn()} email={email} resend=\"sent\" />,\n },\n ],\n title: 'Resent code',\n },\n {\n description:\n 'A refused resend keeps the code step and its code, with the refusal below the code field. The code stays valid, so the field is not marked invalid.',\n nodes: [\n { detail: 'GET /login', name: 'Browser opens sign-in' },\n {\n edge: 'Resend code, POST /v1/auth/code: 429',\n name: 'Check your email (resend refused)',\n screen: (\n <SignIn\n {...signIn()}\n email={email}\n error=\"Too many requests. Retry after 60 seconds.\"\n />\n ),\n },\n ],\n title: 'Resend refused',\n },\n {\n description:\n 'A failed selection keeps the account step, so the user can choose again. The page does not reload, so an ended session or an expired request shows its refusal in the same place.',\n nodes: [\n { detail: 'GET /choose-account?…&sig', name: 'Browser' },\n {\n edge: 'POST /v1/authorize/account: 503',\n name: 'Choose a wallet (failed)',\n screen: (\n <ChooseAccount {...chooseAccount()} error={unavailable} />\n ),\n },\n {\n edge: 'Or: POST /v1/authorize/account: session_required',\n name: 'Choose a wallet (session ended)',\n screen: (\n <ChooseAccount {...chooseAccount()} error=\"Sign in first.\" />\n ),\n },\n {\n edge: 'Or: POST /v1/authorize/account: authorization_expired',\n name: 'Choose a wallet (request expired)',\n screen: (\n <ChooseAccount\n {...chooseAccount()}\n error=\"Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.\"\n />\n ),\n },\n ],\n title: 'Account selection failed',\n },\n {\n description:\n 'A failed decision keeps the approval page, with the refusal below the buttons.',\n nodes: [\n { detail: 'GET /authorize?…&sig', name: 'Browser' },\n {\n edge: 'POST /v1/authorize/consent: 503',\n name: 'Authorize this app (failed)',\n screen: <Approval {...approval()} error={unavailable} />,\n },\n ],\n title: 'Approval failed',\n },\n {\n description:\n 'A spent authorization rate limit refuses Approve, as it refuses the grant at sign-in. The approval page stays until the limit resets.',\n nodes: [\n { detail: 'GET /authorize?…&sig', name: 'Browser' },\n {\n edge: 'Approve, POST /v1/authorize/consent: 429 rate_limited',\n name: 'Authorize this app (rate limited)',\n screen: (\n <Approval\n {...approval()}\n error=\"Too many requests. Retry after 60 seconds.\"\n />\n ),\n },\n ],\n title: 'Approval rate limited',\n },\n {\n description:\n 'A canceled prompt or a refused assertion keeps the approval page, and Approve starts a new passkey step.',\n nodes: [\n { detail: 'GET /authorize?…&sig', name: 'Browser' },\n {\n edge: 'Canceled prompt, or POST /v1/authorize/consent with passkey.assertion: webauthn_rejected',\n name: 'Authorize this app (passkey failed)',\n screen: (\n <Approval\n {...approval()}\n error=\"The passkey request was canceled. Approve again, or deny the request.\"\n />\n ),\n },\n ],\n title: 'Passkey approval failed',\n },\n {\n description:\n 'A session that ends before the decision reloads the page, and the loader sends the browser to sign-in with the signed query. A sign-in already spent this request, so the next sign-in opens the approval page again.',\n nodes: [\n { detail: 'GET /authorize?…&sig', name: 'Browser' },\n {\n edge: '200 approval page',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Approve, POST /v1/authorize/consent: session_required, reload, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n edge: 'after 500 ms, redirect /authorize?…&sig',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'Approve, POST /v1/authorize/consent',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Approval, session expired',\n },\n {\n description:\n 'A user who was signed in when the request arrived reached the approval page without a sign-in, so the request is unspent. The sign-in after the reload grants the key and returns to the app at once.',\n nodes: [\n { detail: 'GET /authorize?…&sig', name: 'Browser' },\n {\n edge: '200 approval page',\n name: 'Authorize this app',\n screen: <Approval {...approval()} />,\n },\n {\n edge: 'Approve, POST /v1/authorize/consent: session_required, reload, 302 /login?…&sig',\n name: 'Sign in (key)',\n screen: <SignIn {...signIn()} request={signInRequest()} />,\n },\n {\n edge: 'POST /v1/auth/code',\n name: 'Check your email',\n screen: <SignIn {...signIn()} email={email} />,\n },\n {\n edge: 'POST /v1/auth/code/verify with oauth_query: 200, grants the key',\n name: 'Check your email (accepted)',\n screen: <SignIn {...signIn()} email={email} verified />,\n },\n {\n detail: 'GET redirect_uri?code&state',\n edge: 'after 500 ms, redirect',\n name: 'Web app callback',\n },\n {\n ...tokenExit,\n detail: 'Tokens, account, and key_authorization',\n },\n ],\n title: 'Approval, session expired, unspent request',\n },\n {\n description:\n 'A failed decision keeps the device page with the request, and the refusal below the buttons.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: 'POST /v1/device/approve: 503',\n name: 'Authorize a device (failed)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n error={unavailable}\n request={deviceRequest()}\n />\n ),\n },\n ],\n title: 'Device decision failed',\n },\n {\n description:\n 'A session that ends before the decision reloads the page, and sign-in returns to the same code. The request is bound to its user, so another user’s sign-in shows the unknown code.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: '200 device page',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n {\n edge: 'Approve, POST /v1/device/approve: session_required, reload, 302 /login?return_to=/device?code',\n name: 'Sign in',\n screen: <SignIn {...signIn()} />,\n },\n {\n edge: 'Sign-in, /device?code',\n name: 'Authorize a device',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n request={deviceRequest()}\n />\n ),\n },\n ],\n title: 'Device decision, session expired',\n },\n {\n description:\n 'A canceled prompt or a refused assertion keeps the device page, and Approve starts a new passkey step.',\n nodes: [\n { detail: 'GET /device?code', name: 'Browser' },\n {\n edge: 'Canceled prompt, or POST /v1/device/approve with passkey.assertion: webauthn_rejected',\n name: 'Authorize a device (passkey failed)',\n screen: (\n <DeviceApproval\n {...deviceApproval()}\n error=\"The passkey request was canceled. Approve again, or deny the request.\"\n request={deviceRequest()}\n />\n ),\n },\n ],\n title: 'Device passkey approval failed',\n },\n {\n description:\n 'A failed sign-out keeps the account page, with the refusal above the button.',\n nodes: [\n { detail: 'GET /', name: 'Browser opens Tempo ID' },\n {\n edge: 'POST /v1/auth/logout: 503',\n name: 'Your account (sign-out failed)',\n screen: <Account {...account()} error={unavailable} />,\n },\n ],\n title: 'Sign-out failed',\n },\n ],\n title: 'Request failures',\n },\n ]\n}\n\nnamespace styles {\n export const app = style({ display: 'grid', gap: 3 })\n\n export const appAddress = style({\n color: 'gray.900',\n margin: 0,\n overflowWrap: 'anywhere',\n typography: 'copy.13.mono',\n })\n\n export const appButton = variants({\n base: {\n alignItems: 'center',\n border: 'none',\n borderRadius: 'full',\n cursor: 'pointer',\n display: 'flex',\n gap: 3,\n height: 12,\n justifyContent: 'center',\n paddingInline: 6,\n typography: 'button.16',\n width: 'full',\n },\n variants: {\n tone: {\n brand: { backgroundColor: 'red.700', color: 'white' },\n google: { backgroundColor: 'blue.700', color: 'white' },\n quiet: { backgroundColor: 'gray.100', color: 'foreground' },\n },\n },\n })\n\n export const appDescription = style({\n color: 'gray.900',\n typography: 'copy.16',\n })\n\n // A rule on each side of the label, as the sample app's divider draws it.\n export const appDivider = style({\n alignItems: 'center',\n color: 'gray.900',\n display: 'flex',\n gap: 4,\n margin: 0,\n typography: 'copy.14',\n whiteSpace: 'nowrap',\n '&::before, &::after': {\n backgroundColor: 'gray.400',\n content: '\"\"',\n flexGrow: 1,\n height: 'px',\n },\n })\n\n export const appField = style({ display: 'grid', gap: 2 })\n\n export const appHeader = style({ display: 'grid', gap: 2, marginBottom: 2 })\n\n export const appInput = style({\n backgroundColor: 'gray.100',\n border: 'none',\n borderRadius: 'md',\n color: 'foreground',\n height: 12,\n paddingInline: 4,\n typography: 'copy.16',\n width: 'full',\n })\n\n export const appLabel = style({ typography: 'label.16' })\n\n export const appTitle = style({ typography: 'heading.32' })\n\n export const arrow = style({\n alignItems: 'center',\n display: 'grid',\n flexShrink: 0,\n gap: 2,\n justifyItems: 'center',\n paddingInline: 3,\n width: 48,\n })\n\n export const artboard = style({ display: 'grid', gap: 2, margin: 0 })\n\n export const canvas = style({\n backgroundColor: 'gray.100',\n display: 'grid',\n gap: 16,\n minHeight: 'screen',\n // The canvas grows to its widest flow, so the page scrolls to pan.\n minWidth: 'full',\n padding: 4,\n width: 'max',\n '@media (min-width: 48rem)': { padding: 12 },\n })\n\n export const code = style({ typography: 'copy.13.mono' })\n\n export const detail = style({\n color: 'gray.900',\n overflowWrap: 'anywhere',\n typography: 'copy.13.mono',\n })\n\n export const edge = style({\n color: 'gray.900',\n overflowWrap: 'anywhere',\n textAlign: 'center',\n typography: 'copy.13.mono',\n })\n\n export const external = variants({\n base: {\n backgroundColor: 'background.surface',\n border: '1px dashed',\n borderColor: 'gray.500',\n borderRadius: 'lg',\n display: 'grid',\n flexShrink: 0,\n gap: 1,\n padding: 4,\n width: 56,\n },\n variants: {\n kind: {\n Entry: { borderColor: 'blue.700', borderStyle: 'solid' },\n Exit: { borderColor: 'green.700', borderStyle: 'solid' },\n External: {},\n },\n },\n })\n\n export const externalName = style({ typography: 'label.14' })\n\n export const flow = style({ display: 'grid', gap: 4 })\n\n export const flowDescription = style({\n color: 'gray.900',\n typography: 'copy.14',\n })\n\n // The flow's text stays at the canvas's left edge while the row scrolls.\n export const flowHeader = style({\n display: 'grid',\n gap: 1,\n left: 4,\n maxWidth: 'readable',\n position: 'sticky',\n '@media (min-width: 48rem)': { left: 12 },\n })\n\n export const flowTitle = style({ typography: 'heading.16' })\n\n export const frame = style({\n backgroundColor: 'background.primary',\n border: '1px solid',\n borderColor: 'grayAlpha.400',\n borderRadius: 'lg',\n boxShadow: 'md',\n paddingBlock: 10,\n paddingInline: 6,\n width: 96,\n })\n\n export const frameLabel = style({ color: 'gray.900', typography: 'label.12' })\n\n export const head = style({\n color: 'gray.600',\n flexShrink: 0,\n height: 4,\n width: 4,\n })\n\n export const intro = style({\n display: 'grid',\n gap: 2,\n left: 4,\n maxWidth: 'readable',\n position: 'sticky',\n '@media (min-width: 48rem)': { left: 12 },\n })\n\n export const kind = style({\n color: 'gray.900',\n textTransform: 'uppercase',\n typography: 'label.12',\n })\n\n export const lede = style({ color: 'gray.900', typography: 'copy.16' })\n\n export const line = style({\n backgroundColor: 'gray.600',\n flexGrow: 1,\n height: 'px',\n })\n\n export const row = style({\n alignItems: 'center',\n display: 'flex',\n listStyle: 'none',\n margin: 0,\n padding: 0,\n })\n\n export const section = style({ display: 'grid', gap: 10 })\n\n export const sectionTitle = style({\n borderBottom: '1px solid',\n borderBottomColor: 'grayAlpha.400',\n paddingBottom: 2,\n typography: 'heading.20',\n })\n\n export const shaft = style({\n alignItems: 'center',\n display: 'flex',\n width: 'full',\n })\n\n export const step = style({ alignItems: 'center', display: 'flex' })\n\n export const title = style({ typography: 'heading.32' })\n}\n","/* eslint-disable */\n\n// @ts-nocheck\n\n// noinspection JSUnusedGlobalSymbols\n\n// This file was automatically generated by TanStack Router.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nimport { Route as rootRouteImport } from './routes/__root'\nimport { Route as IndexRouteImport } from './routes/index'\nimport { Route as AuthorizeRouteImport } from './routes/authorize'\nimport { Route as ChooseAccountRouteImport } from './routes/choose-account'\nimport { Route as DepositRouteImport } from './routes/deposit'\nimport { Route as DeviceRouteImport } from './routes/device'\nimport { Route as LoginRouteImport } from './routes/login'\nimport { Route as Char91_Char93FlowsRouteImport } from './routes/[_].flows'\n\nconst IndexRoute = IndexRouteImport.update({\n id: '/',\n path: '/',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst AuthorizeRoute = AuthorizeRouteImport.update({\n id: '/authorize',\n path: '/authorize',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst ChooseAccountRoute = ChooseAccountRouteImport.update({\n id: '/choose-account',\n path: '/choose-account',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst DepositRoute = DepositRouteImport.update({\n id: '/deposit',\n path: '/deposit',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst DeviceRoute = DeviceRouteImport.update({\n id: '/device',\n path: '/device',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst LoginRoute = LoginRouteImport.update({\n id: '/login',\n path: '/login',\n getParentRoute: () => rootRouteImport,\n} as any)\nconst Char91_Char93FlowsRoute = Char91_Char93FlowsRouteImport.update({\n id: '/_/flows',\n path: '/_/flows',\n getParentRoute: () => rootRouteImport,\n} as any)\n\nexport interface FileRoutesByFullPath {\n '/': typeof IndexRoute\n '/authorize': typeof AuthorizeRoute\n '/choose-account': typeof ChooseAccountRoute\n '/deposit': typeof DepositRoute\n '/device': typeof DeviceRoute\n '/login': typeof LoginRoute\n '/_/flows': typeof Char91_Char93FlowsRoute\n}\nexport interface FileRoutesByTo {\n '/': typeof IndexRoute\n '/authorize': typeof AuthorizeRoute\n '/choose-account': typeof ChooseAccountRoute\n '/deposit': typeof DepositRoute\n '/device': typeof DeviceRoute\n '/login': typeof LoginRoute\n '/_/flows': typeof Char91_Char93FlowsRoute\n}\nexport interface FileRoutesById {\n __root__: typeof rootRouteImport\n '/': typeof IndexRoute\n '/authorize': typeof AuthorizeRoute\n '/choose-account': typeof ChooseAccountRoute\n '/deposit': typeof DepositRoute\n '/device': typeof DeviceRoute\n '/login': typeof LoginRoute\n '/_/flows': typeof Char91_Char93FlowsRoute\n}\nexport interface FileRouteTypes {\n fileRoutesByFullPath: FileRoutesByFullPath\n fullPaths:\n | '/'\n | '/authorize'\n | '/choose-account'\n | '/deposit'\n | '/device'\n | '/login'\n | '/_/flows'\n fileRoutesByTo: FileRoutesByTo\n to:\n | '/'\n | '/authorize'\n | '/choose-account'\n | '/deposit'\n | '/device'\n | '/login'\n | '/_/flows'\n id:\n | '__root__'\n | '/'\n | '/authorize'\n | '/choose-account'\n | '/deposit'\n | '/device'\n | '/login'\n | '/_/flows'\n fileRoutesById: FileRoutesById\n}\nexport interface RootRouteChildren {\n IndexRoute: typeof IndexRoute\n AuthorizeRoute: typeof AuthorizeRoute\n ChooseAccountRoute: typeof ChooseAccountRoute\n DepositRoute: typeof DepositRoute\n DeviceRoute: typeof DeviceRoute\n LoginRoute: typeof LoginRoute\n Char91_Char93FlowsRoute: typeof Char91_Char93FlowsRoute\n}\n\ndeclare module '@tanstack/react-router' {\n interface FileRoutesByPath {\n '/': {\n id: '/'\n path: '/'\n fullPath: '/'\n preLoaderRoute: typeof IndexRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/authorize': {\n id: '/authorize'\n path: '/authorize'\n fullPath: '/authorize'\n preLoaderRoute: typeof AuthorizeRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/choose-account': {\n id: '/choose-account'\n path: '/choose-account'\n fullPath: '/choose-account'\n preLoaderRoute: typeof ChooseAccountRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/deposit': {\n id: '/deposit'\n path: '/deposit'\n fullPath: '/deposit'\n preLoaderRoute: typeof DepositRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/device': {\n id: '/device'\n path: '/device'\n fullPath: '/device'\n preLoaderRoute: typeof DeviceRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/login': {\n id: '/login'\n path: '/login'\n fullPath: '/login'\n preLoaderRoute: typeof LoginRouteImport\n parentRoute: typeof rootRouteImport\n }\n '/_/flows': {\n id: '/_/flows'\n path: '/_/flows'\n fullPath: '/_/flows'\n preLoaderRoute: typeof Char91_Char93FlowsRouteImport\n parentRoute: typeof rootRouteImport\n }\n }\n}\n\nconst rootRouteChildren: RootRouteChildren = {\n IndexRoute: IndexRoute,\n AuthorizeRoute: AuthorizeRoute,\n ChooseAccountRoute: ChooseAccountRoute,\n DepositRoute: DepositRoute,\n DeviceRoute: DeviceRoute,\n LoginRoute: LoginRoute,\n Char91_Char93FlowsRoute: Char91_Char93FlowsRoute,\n}\nexport const routeTree = rootRouteImport\n ._addFileChildren(rootRouteChildren)\n ._addFileTypes<FileRouteTypes>()\n\nimport type { getRouter } from './router.tsx'\nimport type { createStart } from '@tanstack/react-start'\ndeclare module '@tanstack/react-start' {\n interface Register {\n ssr: true\n router: Awaited<ReturnType<typeof getRouter>>\n }\n}\n","/** Creates the router for each server request and for the browser. @module */\nimport { createRouter } from '@tanstack/react-router'\nimport { routeTree } from './routeTree.gen.js'\n\n/** Returns a router. TanStack Start calls it once per server request, and once in the browser. */\nexport function getRouter() {\n return createRouter({\n // A loader reads the session, so its data is never reused for another navigation.\n defaultPreloadStaleTime: 0,\n parseSearch,\n routeTree,\n scrollRestoration: true,\n stringifySearch,\n })\n}\n\n/**\n * Parses a search string into the strings it holds, with a list for a repeated parameter. The\n * router's default parses each value as JSON, which changes a value that reads as JSON, such as a\n * user code of digits. Loaders read the query as the browser sent it, too.\n */\nfunction parseSearch(search: string) {\n const params = new URLSearchParams(search)\n return Object.fromEntries(\n [...new Set(params.keys())].map((key) => {\n const values = params.getAll(key)\n return [key, values.length > 1 ? values : values[0]]\n }),\n )\n}\n\n/** Serializes search values as {@link parseSearch} reads them, repeating a parameter for a list. */\nfunction stringifySearch(search: Record<string, unknown>) {\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(search)) {\n if (value === undefined) continue\n for (const entry of Array.isArray(value) ? value : [value])\n params.append(key, String(entry))\n }\n const query = params.toString()\n return query ? `?${query}` : ''\n}\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof getRouter>\n }\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,172,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277],"mappings":"4XCEA,SAAS6e,EAAsB,EAAS,EAAU,EAAO,EAAkB,CAC1E,IAAMC,EAAenB,EAAiBoB,CAAO,EACvCC,EAAe,CAAC,EAChBC,EAAkB,CAAC,EACzB,IAAK,IAAMC,KAASJ,EAAc,IAAK,IAAMK,KAAU,MAAM,QAAQD,EAAM,OAAO,EAAIA,EAAM,QAAU,CAAC,EAAG,CACzG,GAAI,CAACC,EAAQ,SACb,GAAM,CAAE,WAAU,GAAGC,GAAUD,EAC/BH,EAAa,KAAK,CACjB,IAAK,SACL,MAAO,CACN,GAAGI,EACH,GAAGC,EACH,OACD,EACA,UACD,CAAC,CACF,CACA,GAAIC,EAAU,IAAK,IAAMJ,KAASJ,EAAc,IAAK,IAAMS,KAASD,EAAS,OAAOJ,EAAM,QAAQ,EAAE,SAAW,CAAC,EAAGD,EAAgB,KAAK,CACvI,IAAK,SACL,MAAO,CACN,GAAGM,EAAM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