@tinyrack/issuary-server 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/dist/entities/oauth-client.entity.d.ts +18 -0
  2. package/dist/entities/oauth-client.entity.d.ts.map +1 -1
  3. package/dist/entities/oauth-code.entity.d.ts +18 -0
  4. package/dist/entities/oauth-code.entity.d.ts.map +1 -1
  5. package/dist/entities/oauth-device-code.entity.d.ts +18 -0
  6. package/dist/entities/oauth-device-code.entity.d.ts.map +1 -1
  7. package/dist/entities/revoked-token.entity.d.ts +18 -0
  8. package/dist/entities/revoked-token.entity.d.ts.map +1 -1
  9. package/dist/entities/terms-content.entity.d.ts +9 -0
  10. package/dist/entities/terms-content.entity.d.ts.map +1 -1
  11. package/dist/entities/terms.entity.d.ts +9 -0
  12. package/dist/entities/terms.entity.d.ts.map +1 -1
  13. package/dist/entities/user-consent.entity.d.ts +18 -0
  14. package/dist/entities/user-consent.entity.d.ts.map +1 -1
  15. package/dist/entities/user-terms-consent.entity.d.ts +9 -0
  16. package/dist/entities/user-terms-consent.entity.d.ts.map +1 -1
  17. package/dist/entities/user-totp-recovery-code.entity.d.ts +9 -0
  18. package/dist/entities/user-totp-recovery-code.entity.d.ts.map +1 -1
  19. package/dist/entities/user-totp.entity.d.ts +9 -0
  20. package/dist/entities/user-totp.entity.d.ts.map +1 -1
  21. package/dist/entities/user.entity.d.ts +9 -0
  22. package/dist/entities/user.entity.d.ts.map +1 -1
  23. package/dist/entities/user.entity.js +4 -0
  24. package/dist/entities/user.entity.js.map +1 -1
  25. package/dist/entrypoints/app.d.ts +53 -0
  26. package/dist/entrypoints/app.d.ts.map +1 -1
  27. package/dist/entrypoints/database/postgres/compiled-functions.d.ts +23 -20
  28. package/dist/entrypoints/database/postgres/compiled-functions.d.ts.map +1 -1
  29. package/dist/entrypoints/database/postgres/compiled-functions.js +134 -104
  30. package/dist/entrypoints/database/postgres/compiled-functions.js.map +1 -1
  31. package/dist/entrypoints/database/sqlite/compiled-functions.d.ts +23 -20
  32. package/dist/entrypoints/database/sqlite/compiled-functions.d.ts.map +1 -1
  33. package/dist/entrypoints/database/sqlite/compiled-functions.js +134 -104
  34. package/dist/entrypoints/database/sqlite/compiled-functions.js.map +1 -1
  35. package/dist/lib/config/resolved.d.ts +1 -0
  36. package/dist/lib/config/resolved.d.ts.map +1 -1
  37. package/dist/lib/config/security.d.ts +2 -0
  38. package/dist/lib/config/security.d.ts.map +1 -1
  39. package/dist/lib/config/security.js +5 -0
  40. package/dist/lib/config/security.js.map +1 -1
  41. package/dist/middleware/auth.d.ts +8 -0
  42. package/dist/middleware/auth.d.ts.map +1 -1
  43. package/dist/middleware/auth.js +64 -0
  44. package/dist/middleware/auth.js.map +1 -1
  45. package/dist/middleware/session.d.ts +9 -0
  46. package/dist/middleware/session.d.ts.map +1 -1
  47. package/dist/middleware/session.js +18 -0
  48. package/dist/middleware/session.js.map +1 -1
  49. package/dist/migrations/postgres/Migration20260825110000_add_password_reset_required.d.ts +6 -0
  50. package/dist/migrations/postgres/Migration20260825110000_add_password_reset_required.d.ts.map +1 -0
  51. package/dist/migrations/postgres/Migration20260825110000_add_password_reset_required.js +11 -0
  52. package/dist/migrations/postgres/Migration20260825110000_add_password_reset_required.js.map +1 -0
  53. package/dist/migrations/postgres/index.d.ts.map +1 -1
  54. package/dist/migrations/postgres/index.js +2 -0
  55. package/dist/migrations/postgres/index.js.map +1 -1
  56. package/dist/migrations/sqlite/Migration20260825110000_add_password_reset_required.d.ts +6 -0
  57. package/dist/migrations/sqlite/Migration20260825110000_add_password_reset_required.d.ts.map +1 -0
  58. package/dist/migrations/sqlite/Migration20260825110000_add_password_reset_required.js +10 -0
  59. package/dist/migrations/sqlite/Migration20260825110000_add_password_reset_required.js.map +1 -0
  60. package/dist/migrations/sqlite/index.d.ts.map +1 -1
  61. package/dist/migrations/sqlite/index.js +2 -0
  62. package/dist/migrations/sqlite/index.js.map +1 -1
  63. package/dist/repositories/oauth-code.repository.d.ts +2 -2
  64. package/dist/repositories/oauth-code.repository.d.ts.map +1 -1
  65. package/dist/repositories/oauth-code.repository.js +7 -3
  66. package/dist/repositories/oauth-code.repository.js.map +1 -1
  67. package/dist/repositories/oauth-device-code.repository.d.ts +4 -4
  68. package/dist/repositories/oauth-device-code.repository.d.ts.map +1 -1
  69. package/dist/repositories/oauth-device-code.repository.js +18 -6
  70. package/dist/repositories/oauth-device-code.repository.js.map +1 -1
  71. package/dist/repositories/user-totp-recovery-code.repository.d.ts +7 -1
  72. package/dist/repositories/user-totp-recovery-code.repository.d.ts.map +1 -1
  73. package/dist/repositories/user-totp-recovery-code.repository.js +2 -1
  74. package/dist/repositories/user-totp-recovery-code.repository.js.map +1 -1
  75. package/dist/repositories/user-totp.repository.d.ts +9 -0
  76. package/dist/repositories/user-totp.repository.d.ts.map +1 -1
  77. package/dist/routes/api/auth/index.d.ts +52 -0
  78. package/dist/routes/api/auth/index.d.ts.map +1 -1
  79. package/dist/routes/api/auth/index.js +2 -0
  80. package/dist/routes/api/auth/index.js.map +1 -1
  81. package/dist/routes/api/auth/passkey/verify/post.d.ts +37 -0
  82. package/dist/routes/api/auth/passkey/verify/post.d.ts.map +1 -1
  83. package/dist/routes/api/auth/passkey/verify/post.js +8 -2
  84. package/dist/routes/api/auth/passkey/verify/post.js.map +1 -1
  85. package/dist/routes/api/auth/password/reset-required/post.d.ts +18 -0
  86. package/dist/routes/api/auth/password/reset-required/post.d.ts.map +1 -0
  87. package/dist/routes/api/auth/password/reset-required/post.js +39 -0
  88. package/dist/routes/api/auth/password/reset-required/post.js.map +1 -0
  89. package/dist/routes/api/index.d.ts +52 -0
  90. package/dist/routes/api/index.d.ts.map +1 -1
  91. package/dist/routes/index.d.ts +52 -0
  92. package/dist/routes/index.d.ts.map +1 -1
  93. package/dist/routes/oauth/device/get-post.js +5 -5
  94. package/dist/routes/oauth/device/get-post.js.map +1 -1
  95. package/dist/schemas/error.d.ts +25 -0
  96. package/dist/schemas/error.d.ts.map +1 -1
  97. package/dist/schemas/error.js +1 -0
  98. package/dist/schemas/error.js.map +1 -1
  99. package/dist/schemas/response.d.ts +22 -0
  100. package/dist/schemas/response.d.ts.map +1 -1
  101. package/dist/schemas/response.js +8 -0
  102. package/dist/schemas/response.js.map +1 -1
  103. package/dist/seeders/config.seeder.js +2 -1
  104. package/dist/seeders/config.seeder.js.map +1 -1
  105. package/dist/services/container.d.ts +1 -0
  106. package/dist/services/container.d.ts.map +1 -1
  107. package/dist/services/container.js +15 -0
  108. package/dist/services/container.js.map +1 -1
  109. package/dist/services/legacy-credential-retirement.service.d.ts +20 -0
  110. package/dist/services/legacy-credential-retirement.service.d.ts.map +1 -0
  111. package/dist/services/legacy-credential-retirement.service.js +90 -0
  112. package/dist/services/legacy-credential-retirement.service.js.map +1 -0
  113. package/dist/services/oauth-client.service.d.ts +1 -0
  114. package/dist/services/oauth-client.service.d.ts.map +1 -1
  115. package/dist/services/oauth-client.service.js +17 -2
  116. package/dist/services/oauth-client.service.js.map +1 -1
  117. package/dist/services/oauth-connect.service.d.ts.map +1 -1
  118. package/dist/services/oauth-connect.service.js +4 -0
  119. package/dist/services/oauth-connect.service.js.map +1 -1
  120. package/dist/services/oauth-token.service.d.ts.map +1 -1
  121. package/dist/services/oauth-token.service.js +4 -4
  122. package/dist/services/oauth-token.service.js.map +1 -1
  123. package/dist/services/password-auth.service.d.ts.map +1 -1
  124. package/dist/services/password-auth.service.js +12 -3
  125. package/dist/services/password-auth.service.js.map +1 -1
  126. package/dist/services/security.service.d.ts +8 -0
  127. package/dist/services/security.service.d.ts.map +1 -1
  128. package/dist/services/security.service.js +85 -22
  129. package/dist/services/security.service.js.map +1 -1
  130. package/dist/services/totp.service.js +2 -2
  131. package/dist/services/totp.service.js.map +1 -1
  132. package/package.json +1 -1
  133. package/public/assets/2fa-BgveHSB_.js +2 -0
  134. package/public/assets/{2fa-B5vLgDXQ.js.map → 2fa-BgveHSB_.js.map} +1 -1
  135. package/public/assets/2fa-C37MUkye.js +2 -0
  136. package/public/assets/{2fa-CCOTIHDZ.js.map → 2fa-C37MUkye.js.map} +1 -1
  137. package/public/assets/2fa-UL_cNRnQ.js +2 -0
  138. package/public/assets/{2fa-C5vUVgr_.js.map → 2fa-UL_cNRnQ.js.map} +1 -1
  139. package/public/assets/2fa-kiqzGSz2.js +2 -0
  140. package/public/assets/{2fa-BqsM_D-X.js.map → 2fa-kiqzGSz2.js.map} +1 -1
  141. package/public/assets/{DialogHandle-BmtK2pRn.js → DialogHandle-Zvz8SgS0.js} +2 -2
  142. package/public/assets/{DialogHandle-BmtK2pRn.js.map → DialogHandle-Zvz8SgS0.js.map} +1 -1
  143. package/public/assets/admin-DbDuu6AI.js +2 -0
  144. package/public/assets/{admin-BPijkLw-.js.map → admin-DbDuu6AI.js.map} +1 -1
  145. package/public/assets/admin-users-CwTJdiih.js +2 -0
  146. package/public/assets/{admin-users-DvPbw1Vq.js.map → admin-users-CwTJdiih.js.map} +1 -1
  147. package/public/assets/{auth-choice-row-BCGjuedo.js → auth-choice-row-BlSsUI7d.js} +2 -2
  148. package/public/assets/{auth-choice-row-BCGjuedo.js.map → auth-choice-row-BlSsUI7d.js.map} +1 -1
  149. package/public/assets/{auth-field-DD8kvl--.js → auth-field-HwxENJnB.js} +2 -2
  150. package/public/assets/{auth-field-DD8kvl--.js.map → auth-field-HwxENJnB.js.map} +1 -1
  151. package/public/assets/{auth-layout-VtpryDof.js → auth-layout-CoeqNhTT.js} +2 -2
  152. package/public/assets/{auth-layout-VtpryDof.js.map → auth-layout-CoeqNhTT.js.map} +1 -1
  153. package/public/assets/{auth-page-header-CIn2E4zI.js → auth-page-header-CIs08f5Y.js} +2 -2
  154. package/public/assets/{auth-page-header-CIn2E4zI.js.map → auth-page-header-CIs08f5Y.js.map} +1 -1
  155. package/public/assets/{authorization-context-banner-SOuBHWIb.js → authorization-context-banner-BbtQmMYH.js} +2 -2
  156. package/public/assets/{authorization-context-banner-SOuBHWIb.js.map → authorization-context-banner-BbtQmMYH.js.map} +1 -1
  157. package/public/assets/{avatar-BEQjf2x6.js → avatar-CttWiIv3.js} +2 -2
  158. package/public/assets/{avatar-BEQjf2x6.js.map → avatar-CttWiIv3.js.map} +1 -1
  159. package/public/assets/{checkbox-gdHnSFQ-.js → checkbox-CJrRV8S1.js} +2 -2
  160. package/public/assets/{checkbox-gdHnSFQ-.js.map → checkbox-CJrRV8S1.js.map} +1 -1
  161. package/public/assets/config-v3-oy_ef.js +2 -0
  162. package/public/assets/config-v3-oy_ef.js.map +1 -0
  163. package/public/assets/{consent-BqqFDdsr.js → consent-BIhxtXHx.js} +2 -2
  164. package/public/assets/{consent-BqqFDdsr.js.map → consent-BIhxtXHx.js.map} +1 -1
  165. package/public/assets/{consent-CfRbz2R7.js → consent-DRmENn26.js} +2 -2
  166. package/public/assets/{consent-CfRbz2R7.js.map → consent-DRmENn26.js.map} +1 -1
  167. package/public/assets/{email-CKKakxPJ.js → email-CVRDeJ78.js} +2 -2
  168. package/public/assets/{email-CKKakxPJ.js.map → email-CVRDeJ78.js.map} +1 -1
  169. package/public/assets/email-UL_cNRnQ.js +2 -0
  170. package/public/assets/{email-C5vUVgr_.js.map → email-UL_cNRnQ.js.map} +1 -1
  171. package/public/assets/error-2VPY5w8V.js +2 -0
  172. package/public/assets/{error-BMXxpgfR.js.map → error-2VPY5w8V.js.map} +1 -1
  173. package/public/assets/{field-Cn4H1CUj.js → field-DDt6F9TZ.js} +2 -2
  174. package/public/assets/{field-Cn4H1CUj.js.map → field-DDt6F9TZ.js.map} +1 -1
  175. package/public/assets/forgot-DzDcduho.js +2 -0
  176. package/public/assets/{forgot-rO9sByfV.js.map → forgot-DzDcduho.js.map} +1 -1
  177. package/public/assets/forgot-UL_cNRnQ.js +2 -0
  178. package/public/assets/{forgot-C5vUVgr_.js.map → forgot-UL_cNRnQ.js.map} +1 -1
  179. package/public/assets/index-gliHKncz.js +11 -0
  180. package/public/assets/index-gliHKncz.js.map +1 -0
  181. package/public/assets/{initial-avatar-CtuDUz_W.js → initial-avatar-CZzHAPm3.js} +2 -2
  182. package/public/assets/{initial-avatar-CtuDUz_W.js.map → initial-avatar-CZzHAPm3.js.map} +1 -1
  183. package/public/assets/{input-CzQki7k6.js → input-CNRpSR08.js} +2 -2
  184. package/public/assets/{input-CzQki7k6.js.map → input-CNRpSR08.js.map} +1 -1
  185. package/public/assets/{labeled-separator-CV7nb0XW.js → labeled-separator-fnKySKv2.js} +2 -2
  186. package/public/assets/{labeled-separator-CV7nb0XW.js.map → labeled-separator-fnKySKv2.js.map} +1 -1
  187. package/public/assets/link-BN90emXr.js +2 -0
  188. package/public/assets/link-BN90emXr.js.map +1 -0
  189. package/public/assets/lock-keyhole-Cz72xkCn.js +2 -0
  190. package/public/assets/lock-keyhole-Cz72xkCn.js.map +1 -0
  191. package/public/assets/login-C6m2qSUt.js +2 -0
  192. package/public/assets/login-C6m2qSUt.js.map +1 -0
  193. package/public/assets/login-UL_cNRnQ.js +2 -0
  194. package/public/assets/login-UL_cNRnQ.js.map +1 -0
  195. package/public/assets/{logout-B5T52P8u.js → logout-CHdmF_16.js} +2 -2
  196. package/public/assets/{logout-B5T52P8u.js.map → logout-CHdmF_16.js.map} +1 -1
  197. package/public/assets/{modal-BDQFucjz.js → modal-sCM_zT82.js} +2 -2
  198. package/public/assets/{modal-BDQFucjz.js.map → modal-sCM_zT82.js.map} +1 -1
  199. package/public/assets/{mutationOptions-DyYFUbyn.js → mutationOptions-CrswitPs.js} +2 -2
  200. package/public/assets/{mutationOptions-DyYFUbyn.js.map → mutationOptions-CrswitPs.js.map} +1 -1
  201. package/public/assets/passkey-B2Blw47e.js +2 -0
  202. package/public/assets/{passkey-J1qnYp9A.js.map → passkey-B2Blw47e.js.map} +1 -1
  203. package/public/assets/passkey-CEx1VZ5R.js +2 -0
  204. package/public/assets/{passkey-CynCz1Dt.js.map → passkey-CEx1VZ5R.js.map} +1 -1
  205. package/public/assets/passkey-CU8x9J2w.js +2 -0
  206. package/public/assets/{passkey-BE9JvJOP.js.map → passkey-CU8x9J2w.js.map} +1 -1
  207. package/public/assets/passkey-UL_cNRnQ.js +2 -0
  208. package/public/assets/{passkey-C5vUVgr_.js.map → passkey-UL_cNRnQ.js.map} +1 -1
  209. package/public/assets/password-BhU_a0cR.js +2 -0
  210. package/public/assets/password-BhU_a0cR.js.map +1 -0
  211. package/public/assets/password-UL_cNRnQ.js +2 -0
  212. package/public/assets/password-UL_cNRnQ.js.map +1 -0
  213. package/public/assets/password-reset-CIacHnvA.js +2 -0
  214. package/public/assets/{password-reset-sU5KkBKi.js.map → password-reset-CIacHnvA.js.map} +1 -1
  215. package/public/assets/{password-strength-BeSOu_Ga.js → password-strength-C0Zkrrct.js} +2 -2
  216. package/public/assets/{password-strength-BeSOu_Ga.js.map → password-strength-C0Zkrrct.js.map} +1 -1
  217. package/public/assets/{pin-input-Cc-VkrQ3.js → pin-input-BlD4tPZJ.js} +2 -2
  218. package/public/assets/{pin-input-Cc-VkrQ3.js.map → pin-input-BlD4tPZJ.js.map} +1 -1
  219. package/public/assets/{profile-BcjsVYOx.js → profile-D1cEjfs8.js} +2 -2
  220. package/public/assets/{profile-BcjsVYOx.js.map → profile-D1cEjfs8.js.map} +1 -1
  221. package/public/assets/{profile-B5NaJfeS.js → profile-D43Yq-6S.js} +2 -2
  222. package/public/assets/{profile-B5NaJfeS.js.map → profile-D43Yq-6S.js.map} +1 -1
  223. package/public/assets/recovery-CLExnfYX.js +2 -0
  224. package/public/assets/{recovery-PnUATiUi.js.map → recovery-CLExnfYX.js.map} +1 -1
  225. package/public/assets/register-CZUyWXRO.js +2 -0
  226. package/public/assets/{register-DQXhru0_.js.map → register-CZUyWXRO.js.map} +1 -1
  227. package/public/assets/register-UL_cNRnQ.js +2 -0
  228. package/public/assets/{register-C5vUVgr_.js.map → register-UL_cNRnQ.js.map} +1 -1
  229. package/public/assets/reset-N3RQTYEB.js +2 -0
  230. package/public/assets/reset-N3RQTYEB.js.map +1 -0
  231. package/public/assets/reset-UL_cNRnQ.js +2 -0
  232. package/public/assets/{reset-C5vUVgr_.js.map → reset-UL_cNRnQ.js.map} +1 -1
  233. package/public/assets/reset-required-Cv5edDS6.js +2 -0
  234. package/public/assets/reset-required-Cv5edDS6.js.map +1 -0
  235. package/public/assets/reset-required-UL_cNRnQ.js +2 -0
  236. package/public/assets/reset-required-UL_cNRnQ.js.map +1 -0
  237. package/public/assets/{select-DqZynXSt.js → select-CWdSzsVo.js} +2 -2
  238. package/public/assets/{select-DqZynXSt.js.map → select-CWdSzsVo.js.map} +1 -1
  239. package/public/assets/select-UL_cNRnQ.js +2 -0
  240. package/public/assets/{select-C5vUVgr_.js.map → select-UL_cNRnQ.js.map} +1 -1
  241. package/public/assets/{separator-B0Bvh1he.js → separator-BWGym8uM.js} +2 -2
  242. package/public/assets/{separator-B0Bvh1he.js.map → separator-BWGym8uM.js.map} +1 -1
  243. package/public/assets/shell-header-bar-C9AB5lT-.js +2 -0
  244. package/public/assets/{shell-header-bar-CjG5qvPg.js.map → shell-header-bar-C9AB5lT-.js.map} +1 -1
  245. package/public/assets/{terms-BHDAgn-H.js → terms-COVFmzyl.js} +2 -2
  246. package/public/assets/{terms-BHDAgn-H.js.map → terms-COVFmzyl.js.map} +1 -1
  247. package/public/assets/{terms-B5NaJfeS.js → terms-D43Yq-6S.js} +2 -2
  248. package/public/assets/{terms-B5NaJfeS.js.map → terms-D43Yq-6S.js.map} +1 -1
  249. package/public/assets/{terms-checkbox-list-6jteUTIZ.js → terms-checkbox-list-Cw0zB-lO.js} +2 -2
  250. package/public/assets/{terms-checkbox-list-6jteUTIZ.js.map → terms-checkbox-list-Cw0zB-lO.js.map} +1 -1
  251. package/public/assets/totp-BFJEXxk0.js +2 -0
  252. package/public/assets/{totp-CJtfVNEq.js.map → totp-BFJEXxk0.js.map} +1 -1
  253. package/public/assets/{totp-BNZ904Zm.js → totp-BfCm6IWl.js} +2 -2
  254. package/public/assets/{totp-BNZ904Zm.js.map → totp-BfCm6IWl.js.map} +1 -1
  255. package/public/assets/totp-MINhsVxT.js +2 -0
  256. package/public/assets/{totp-ECvOUcFx.js.map → totp-MINhsVxT.js.map} +1 -1
  257. package/public/assets/use-totp-setup-C7Zk_2IY.js +3 -0
  258. package/public/assets/{use-totp-setup-BbS3XcZA.js.map → use-totp-setup-C7Zk_2IY.js.map} +1 -1
  259. package/public/assets/{useAriaLabelledBy-ByuMi3Ry.js → useAriaLabelledBy-CiOCg6X5.js} +2 -2
  260. package/public/assets/{useAriaLabelledBy-ByuMi3Ry.js.map → useAriaLabelledBy-CiOCg6X5.js.map} +1 -1
  261. package/public/assets/{useMutation-BWZ0G4Td.js → useMutation-ZLFeJg75.js} +2 -2
  262. package/public/assets/{useMutation-BWZ0G4Td.js.map → useMutation-ZLFeJg75.js.map} +1 -1
  263. package/public/assets/useQuery-BvMz34BW.js +2 -0
  264. package/public/assets/{useQuery-Ckxjmvtl.js.map → useQuery-BvMz34BW.js.map} +1 -1
  265. package/public/assets/{users-CmFxrCQT.js → users-COM7u3A-.js} +2 -2
  266. package/public/assets/{users-CmFxrCQT.js.map → users-COM7u3A-.js.map} +1 -1
  267. package/public/index.html +4 -3
  268. package/public/assets/2fa-B5vLgDXQ.js +0 -2
  269. package/public/assets/2fa-BqsM_D-X.js +0 -2
  270. package/public/assets/2fa-C5vUVgr_.js +0 -2
  271. package/public/assets/2fa-CCOTIHDZ.js +0 -2
  272. package/public/assets/admin-BPijkLw-.js +0 -2
  273. package/public/assets/admin-users-DvPbw1Vq.js +0 -2
  274. package/public/assets/config-DTQCUlfZ.js +0 -2
  275. package/public/assets/config-DTQCUlfZ.js.map +0 -1
  276. package/public/assets/email-C5vUVgr_.js +0 -2
  277. package/public/assets/error-BMXxpgfR.js +0 -2
  278. package/public/assets/forgot-C5vUVgr_.js +0 -2
  279. package/public/assets/forgot-rO9sByfV.js +0 -2
  280. package/public/assets/index-CS23Ozt6.js +0 -11
  281. package/public/assets/index-CS23Ozt6.js.map +0 -1
  282. package/public/assets/login-C5vUVgr_.js +0 -2
  283. package/public/assets/login-C5vUVgr_.js.map +0 -1
  284. package/public/assets/login-nukebli4.js +0 -2
  285. package/public/assets/login-nukebli4.js.map +0 -1
  286. package/public/assets/passkey-BE9JvJOP.js +0 -2
  287. package/public/assets/passkey-C5vUVgr_.js +0 -2
  288. package/public/assets/passkey-CynCz1Dt.js +0 -2
  289. package/public/assets/passkey-J1qnYp9A.js +0 -2
  290. package/public/assets/password-C5vUVgr_.js +0 -2
  291. package/public/assets/password-C5vUVgr_.js.map +0 -1
  292. package/public/assets/password-RkUttbhD.js +0 -2
  293. package/public/assets/password-RkUttbhD.js.map +0 -1
  294. package/public/assets/password-reset-sU5KkBKi.js +0 -2
  295. package/public/assets/recovery-PnUATiUi.js +0 -2
  296. package/public/assets/register-C5vUVgr_.js +0 -2
  297. package/public/assets/register-DQXhru0_.js +0 -2
  298. package/public/assets/reset-C5vUVgr_.js +0 -2
  299. package/public/assets/reset-CQgIa3yf.js +0 -2
  300. package/public/assets/reset-CQgIa3yf.js.map +0 -1
  301. package/public/assets/select-C5vUVgr_.js +0 -2
  302. package/public/assets/shell-header-bar-CjG5qvPg.js +0 -2
  303. package/public/assets/totp-CJtfVNEq.js +0 -2
  304. package/public/assets/totp-ECvOUcFx.js +0 -2
  305. package/public/assets/use-totp-setup-BbS3XcZA.js +0 -3
  306. package/public/assets/useQuery-Ckxjmvtl.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"modal-BDQFucjz.js","names":["Dialog.Backdrop","Dialog.Close","Dialog.Description","Dialog.createHandle","Dialog.Popup","Dialog.Portal","Dialog.Root","Dialog.Title","Dialog.Trigger","Dialog.Viewport"],"sources":["../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs","../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs","../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/root/DialogRoot.mjs","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-backdrop.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-close.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-description.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-handle.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-popup.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-portal.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-root.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-title.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-trigger.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-viewport.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/index.js","../../../frontend/src/components/ui/modal.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogBackdrop.displayName = \"DialogBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: floatingId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n '--nested-dialogs': nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: dialogStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";","'use client';\n\nimport { useRenderDialogRoot } from \"./useRenderDialogRoot.mjs\";\n\n/**\n * Groups all parts of the dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport function DialogRoot(props) {\n return useRenderDialogRoot('dialog', props);\n}","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-backdrop.tsx\nconst TRDialogBackdrop = createComponentPart(Dialog.Backdrop, \"tr-layer-backdrop tr-dialog-backdrop\");\n//#endregion\nexport { TRDialogBackdrop };\n\n//# sourceMappingURL=dialog-backdrop.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-close.tsx\nconst TRDialogClose = createComponentPart(Dialog.Close, \"tr-dialog-close\");\n//#endregion\nexport { TRDialogClose };\n\n//# sourceMappingURL=dialog-close.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-description.tsx\nconst TRDialogDescription = createComponentPart(Dialog.Description, \"tr-dialog-description\");\n//#endregion\nexport { TRDialogDescription };\n\n//# sourceMappingURL=dialog-description.js.map","\"use client\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-handle.ts\nfunction createDialogHandle() {\n\treturn Dialog.createHandle();\n}\n//#endregion\nexport { createDialogHandle };\n\n//# sourceMappingURL=dialog-handle.js.map","\"use client\";\nimport { mergeComponentClassName } from \"../../internal/component-class-name.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-popup.tsx\nfunction TRDialogPopup({ className, placement = \"middle\", ...props }) {\n\treturn /* @__PURE__ */ jsx(Dialog.Popup, {\n\t\t...props,\n\t\tclassName: mergeComponentClassName(\"tr-dialog tr-dialog-box\", className),\n\t\t\"data-placement\": placement\n\t});\n}\n//#endregion\nexport { TRDialogPopup };\n\n//# sourceMappingURL=dialog-popup.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-portal.tsx\nconst TRDialogPortal = createComponentPart(Dialog.Portal);\n//#endregion\nexport { TRDialogPortal };\n\n//# sourceMappingURL=dialog-portal.js.map","\"use client\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-root.tsx\nfunction TRDialogRoot(props) {\n\treturn /* @__PURE__ */ jsx(Dialog.Root, { ...props });\n}\n//#endregion\nexport { TRDialogRoot };\n\n//# sourceMappingURL=dialog-root.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-title.tsx\nconst TRDialogTitle = createComponentPart(Dialog.Title, \"tr-dialog-title\");\n//#endregion\nexport { TRDialogTitle };\n\n//# sourceMappingURL=dialog-title.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-trigger.tsx\nconst TRDialogTrigger = createComponentPart(Dialog.Trigger, \"tr-dialog-trigger\");\n//#endregion\nexport { TRDialogTrigger };\n\n//# sourceMappingURL=dialog-trigger.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-viewport.tsx\nconst TRDialogViewport = createComponentPart(Dialog.Viewport, \"tr-layer-viewport tr-dialog-viewport\");\n//#endregion\nexport { TRDialogViewport };\n\n//# sourceMappingURL=dialog-viewport.js.map","import { TRDialogBackdrop } from \"./dialog-backdrop.js\";\nimport { TRDialogClose } from \"./dialog-close.js\";\nimport { TRDialogDescription } from \"./dialog-description.js\";\nimport { createDialogHandle } from \"./dialog-handle.js\";\nimport { TRDialogPopup } from \"./dialog-popup.js\";\nimport { TRDialogPortal } from \"./dialog-portal.js\";\nimport { TRDialogRoot } from \"./dialog-root.js\";\nimport { TRDialogTitle } from \"./dialog-title.js\";\nimport { TRDialogTrigger } from \"./dialog-trigger.js\";\nimport { TRDialogViewport } from \"./dialog-viewport.js\";\n//#region src/components/dialog/index.tsx\nconst TRDialog = {\n\tBackdrop: TRDialogBackdrop,\n\tClose: TRDialogClose,\n\tDescription: TRDialogDescription,\n\tPopup: TRDialogPopup,\n\tPortal: TRDialogPortal,\n\tRoot: TRDialogRoot,\n\tViewport: TRDialogViewport,\n\tTitle: TRDialogTitle,\n\tTrigger: TRDialogTrigger,\n\tcreateHandle: createDialogHandle\n};\n//#endregion\nexport { TRDialog, TRDialogBackdrop, TRDialogClose, TRDialogDescription, TRDialogPopup, TRDialogPortal, TRDialogRoot, TRDialogTitle, TRDialogTrigger, TRDialogViewport, createDialogHandle };\n\n//# sourceMappingURL=index.js.map","import { TRDialog } from '@tinyrack/ui/components/dialog';\nimport type { LucideIcon } from 'lucide-react';\nimport { XIcon } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\n\ntype ModalVariant = 'default' | 'destructive';\n\ninterface ModalProps {\n isOpen: boolean;\n onClose: () => void;\n title: string;\n description?: string;\n children: ReactNode;\n size?: 'sm' | 'md' | 'lg';\n preventClose?: boolean;\n icon?: LucideIcon;\n variant?: ModalVariant;\n}\n\n/*\n Set through `--tr-dialog-box-max-width`, the override hook `.tr-dialog-box`\n exposes, rather than a `max-w-*` utility. The box feeds that same custom\n property into its own `width: min(…)` calculation, so a utility would move\n the max-width while leaving the width computation on the old value.\n\n This is the current design system overlay scale (20/32rem), not Tailwind's\n width scale. The local `lg` compatibility option now resolves to the largest\n supported overlay token, and `md` remains the unstyled `TRDialog` default.\n*/\nconst sizeClasses = {\n sm: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-sm)]',\n md: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-md)]',\n lg: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-md)]',\n} as const;\n\nconst iconVariantClasses: Record<ModalVariant, string> = {\n default: 'bg-tinyrack-surface-muted text-tinyrack-text',\n destructive: 'bg-tinyrack-danger-surface text-tinyrack-danger',\n};\n\nexport function Modal({\n isOpen,\n onClose,\n title,\n description,\n children,\n size = 'md',\n preventClose = false,\n icon: IconComponent,\n variant = 'default',\n}: ModalProps) {\n useEffect(() => {\n if (!isOpen) return;\n if (preventClose) return;\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, preventClose, onClose]);\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <TRDialog.Root\n defaultOpen\n disablePointerDismissal={preventClose}\n onOpenChange={(open) => {\n if (!open && !preventClose) {\n onClose();\n }\n }}\n >\n <TRDialog.Portal>\n <TRDialog.Viewport>\n <TRDialog.Backdrop />\n {/*\n No max-height here: `.tr-dialog-box` already clamps itself against\n `100dvh` minus the viewport gap, which is more correct than the\n `90vh`/`85vh` this used to override it with.\n */}\n <TRDialog.Popup className={sizeClasses[size]}>\n <div className=\"flex items-start gap-tinyrack-md\">\n {IconComponent && (\n <div\n className={`flex size-tinyrack-2xl shrink-0 items-center justify-center rounded-tinyrack-full ${iconVariantClasses[variant]}`}\n >\n <IconComponent aria-hidden className=\"size-tinyrack-lg\" />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-tinyrack-3xs\">\n <TRDialog.Title>{title}</TRDialog.Title>\n {description && (\n <TRDialog.Description className=\"text-tinyrack-text-muted text-tinyrack-xs\">\n {description}\n </TRDialog.Description>\n )}\n </div>\n {!preventClose && (\n <TRDialog.Close\n aria-label=\"Close\"\n className=\"shrink-0\"\n data-testid=\"modal-close\"\n >\n <XIcon aria-hidden className=\"size-tinyrack-lg\" />\n </TRDialog.Close>\n )}\n </div>\n {children}\n </TRDialog.Popup>\n </TRDialog.Viewport>\n </TRDialog.Portal>\n </TRDialog.Root>\n );\n}\n\ninterface ModalActionsProps {\n children: ReactNode;\n}\n\nexport function ModalActions({ children }: ModalActionsProps) {\n return (\n <div className=\"flex justify-end gap-tinyrack-sm pt-tinyrack-lg\">\n {children}\n </div>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":"4VAaa,EAA8B,EAAM,WAAW,SAAwB,EAAgB,EAAc,CAChH,GAAM,CACJ,SACA,YACA,QACA,cAAc,GACd,GAAG,GACD,EACE,EAAQ,EAAqB,EAC7B,EAAO,EAAM,SAAS,MAAM,EAC5B,EAAS,EAAM,SAAS,QAAQ,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qDAC7B,CACmB,CAAA,CAErB,IACJ,CAAC,IACA,EAAA,EAAA,IAAA,CAAC,EAAS,MAAV,CACE,aAAW,QACX,UAAU,WACV,cAAY,wBAEZ,EAAA,EAAA,IAAA,CAAC,EAAD,CAAO,cAAA,GAAY,UAAU,kBAAoB,CAAA,CACnC,CAAA,CAEf,IACJ,CACa,GACC,CAAA,CAAA,CACJ,CAAA,CACJ,CAAA,EApDR,IAsDX,CAMA,SAAgB,EAAa,CAAE,YAA+B,CAC5D,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,kDACZ,UACE,CAAA,CAET"}
1
+ {"version":3,"file":"modal-sCM_zT82.js","names":["Dialog.Backdrop","Dialog.Close","Dialog.Description","Dialog.createHandle","Dialog.Popup","Dialog.Portal","Dialog.Root","Dialog.Title","Dialog.Trigger","Dialog.Viewport"],"sources":["../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs","../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs","../../../../node_modules/.pnpm/@base-ui+react@1.7.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@base-ui/react/dialog/root/DialogRoot.mjs","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-backdrop.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-close.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-description.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-handle.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-popup.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-portal.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-root.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-title.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-trigger.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/dialog-viewport.js","../../../../node_modules/.pnpm/@tinyrack+ui@0.25.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7_shiki@4.3.1_tailwindcss@4.3.2/node_modules/@tinyrack/ui/dist/components/dialog/index.js","../../../frontend/src/components/ui/modal.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { popupTransitionStateMapping } from \"../../utils/popupStateMapping.mjs\";\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping: popupTransitionStateMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogBackdrop.displayName = \"DialogBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.mjs\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.mjs\";\nimport { FOCUSABLE_POPUP_PROPS, createDefaultInitialFocus } from \"../../utils/popups/index.mjs\";\nimport { dialogStateAttributesMapping } from \"../utils/stateAttributesMapping.mjs\";\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n initialFocus,\n ...elementProps\n } = componentProps;\n const store = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n const floatingId = floatingRootContext.useState('floatingId');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const resolvedInitialFocus = initialFocus === undefined ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const setPopupElement = store.useStateSetter('popupElement');\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n id: floatingId,\n 'aria-labelledby': titleElementId,\n 'aria-describedby': descriptionElementId,\n role,\n ...FOCUSABLE_POPUP_PROPS,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n '--nested-dialogs': nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping: dialogStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";","'use client';\n\nimport { useRenderDialogRoot } from \"./useRenderDialogRoot.mjs\";\n\n/**\n * Groups all parts of the dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport function DialogRoot(props) {\n return useRenderDialogRoot('dialog', props);\n}","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-backdrop.tsx\nconst TRDialogBackdrop = createComponentPart(Dialog.Backdrop, \"tr-layer-backdrop tr-dialog-backdrop\");\n//#endregion\nexport { TRDialogBackdrop };\n\n//# sourceMappingURL=dialog-backdrop.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-close.tsx\nconst TRDialogClose = createComponentPart(Dialog.Close, \"tr-dialog-close\");\n//#endregion\nexport { TRDialogClose };\n\n//# sourceMappingURL=dialog-close.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-description.tsx\nconst TRDialogDescription = createComponentPart(Dialog.Description, \"tr-dialog-description\");\n//#endregion\nexport { TRDialogDescription };\n\n//# sourceMappingURL=dialog-description.js.map","\"use client\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-handle.ts\nfunction createDialogHandle() {\n\treturn Dialog.createHandle();\n}\n//#endregion\nexport { createDialogHandle };\n\n//# sourceMappingURL=dialog-handle.js.map","\"use client\";\nimport { mergeComponentClassName } from \"../../internal/component-class-name.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-popup.tsx\nfunction TRDialogPopup({ className, placement = \"middle\", ...props }) {\n\treturn /* @__PURE__ */ jsx(Dialog.Popup, {\n\t\t...props,\n\t\tclassName: mergeComponentClassName(\"tr-dialog tr-dialog-box\", className),\n\t\t\"data-placement\": placement\n\t});\n}\n//#endregion\nexport { TRDialogPopup };\n\n//# sourceMappingURL=dialog-popup.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-portal.tsx\nconst TRDialogPortal = createComponentPart(Dialog.Portal);\n//#endregion\nexport { TRDialogPortal };\n\n//# sourceMappingURL=dialog-portal.js.map","\"use client\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-root.tsx\nfunction TRDialogRoot(props) {\n\treturn /* @__PURE__ */ jsx(Dialog.Root, { ...props });\n}\n//#endregion\nexport { TRDialogRoot };\n\n//# sourceMappingURL=dialog-root.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-title.tsx\nconst TRDialogTitle = createComponentPart(Dialog.Title, \"tr-dialog-title\");\n//#endregion\nexport { TRDialogTitle };\n\n//# sourceMappingURL=dialog-title.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-trigger.tsx\nconst TRDialogTrigger = createComponentPart(Dialog.Trigger, \"tr-dialog-trigger\");\n//#endregion\nexport { TRDialogTrigger };\n\n//# sourceMappingURL=dialog-trigger.js.map","\"use client\";\nimport { createComponentPart } from \"../../internal/component-part.js\";\nimport { Dialog } from \"@base-ui/react/dialog\";\n//#region src/components/dialog/dialog-viewport.tsx\nconst TRDialogViewport = createComponentPart(Dialog.Viewport, \"tr-layer-viewport tr-dialog-viewport\");\n//#endregion\nexport { TRDialogViewport };\n\n//# sourceMappingURL=dialog-viewport.js.map","import { TRDialogBackdrop } from \"./dialog-backdrop.js\";\nimport { TRDialogClose } from \"./dialog-close.js\";\nimport { TRDialogDescription } from \"./dialog-description.js\";\nimport { createDialogHandle } from \"./dialog-handle.js\";\nimport { TRDialogPopup } from \"./dialog-popup.js\";\nimport { TRDialogPortal } from \"./dialog-portal.js\";\nimport { TRDialogRoot } from \"./dialog-root.js\";\nimport { TRDialogTitle } from \"./dialog-title.js\";\nimport { TRDialogTrigger } from \"./dialog-trigger.js\";\nimport { TRDialogViewport } from \"./dialog-viewport.js\";\n//#region src/components/dialog/index.tsx\nconst TRDialog = {\n\tBackdrop: TRDialogBackdrop,\n\tClose: TRDialogClose,\n\tDescription: TRDialogDescription,\n\tPopup: TRDialogPopup,\n\tPortal: TRDialogPortal,\n\tRoot: TRDialogRoot,\n\tViewport: TRDialogViewport,\n\tTitle: TRDialogTitle,\n\tTrigger: TRDialogTrigger,\n\tcreateHandle: createDialogHandle\n};\n//#endregion\nexport { TRDialog, TRDialogBackdrop, TRDialogClose, TRDialogDescription, TRDialogPopup, TRDialogPortal, TRDialogRoot, TRDialogTitle, TRDialogTrigger, TRDialogViewport, createDialogHandle };\n\n//# sourceMappingURL=index.js.map","import { TRDialog } from '@tinyrack/ui/components/dialog';\nimport type { LucideIcon } from 'lucide-react';\nimport { XIcon } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\n\ntype ModalVariant = 'default' | 'destructive';\n\ninterface ModalProps {\n isOpen: boolean;\n onClose: () => void;\n title: string;\n description?: string;\n children: ReactNode;\n size?: 'sm' | 'md' | 'lg';\n preventClose?: boolean;\n icon?: LucideIcon;\n variant?: ModalVariant;\n}\n\n/*\n Set through `--tr-dialog-box-max-width`, the override hook `.tr-dialog-box`\n exposes, rather than a `max-w-*` utility. The box feeds that same custom\n property into its own `width: min(…)` calculation, so a utility would move\n the max-width while leaving the width computation on the old value.\n\n This is the current design system overlay scale (20/32rem), not Tailwind's\n width scale. The local `lg` compatibility option now resolves to the largest\n supported overlay token, and `md` remains the unstyled `TRDialog` default.\n*/\nconst sizeClasses = {\n sm: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-sm)]',\n md: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-md)]',\n lg: '[--tr-dialog-box-max-width:var(--tinyrack-overlay-width-md)]',\n} as const;\n\nconst iconVariantClasses: Record<ModalVariant, string> = {\n default: 'bg-tinyrack-surface-muted text-tinyrack-text',\n destructive: 'bg-tinyrack-danger-surface text-tinyrack-danger',\n};\n\nexport function Modal({\n isOpen,\n onClose,\n title,\n description,\n children,\n size = 'md',\n preventClose = false,\n icon: IconComponent,\n variant = 'default',\n}: ModalProps) {\n useEffect(() => {\n if (!isOpen) return;\n if (preventClose) return;\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, preventClose, onClose]);\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <TRDialog.Root\n defaultOpen\n disablePointerDismissal={preventClose}\n onOpenChange={(open) => {\n if (!open && !preventClose) {\n onClose();\n }\n }}\n >\n <TRDialog.Portal>\n <TRDialog.Viewport>\n <TRDialog.Backdrop />\n {/*\n No max-height here: `.tr-dialog-box` already clamps itself against\n `100dvh` minus the viewport gap, which is more correct than the\n `90vh`/`85vh` this used to override it with.\n */}\n <TRDialog.Popup className={sizeClasses[size]}>\n <div className=\"flex items-start gap-tinyrack-md\">\n {IconComponent && (\n <div\n className={`flex size-tinyrack-2xl shrink-0 items-center justify-center rounded-tinyrack-full ${iconVariantClasses[variant]}`}\n >\n <IconComponent aria-hidden className=\"size-tinyrack-lg\" />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-tinyrack-3xs\">\n <TRDialog.Title>{title}</TRDialog.Title>\n {description && (\n <TRDialog.Description className=\"text-tinyrack-text-muted text-tinyrack-xs\">\n {description}\n </TRDialog.Description>\n )}\n </div>\n {!preventClose && (\n <TRDialog.Close\n aria-label=\"Close\"\n className=\"shrink-0\"\n data-testid=\"modal-close\"\n >\n <XIcon aria-hidden className=\"size-tinyrack-lg\" />\n </TRDialog.Close>\n )}\n </div>\n {children}\n </TRDialog.Popup>\n </TRDialog.Viewport>\n </TRDialog.Portal>\n </TRDialog.Root>\n );\n}\n\ninterface ModalActionsProps {\n children: ReactNode;\n}\n\nexport function ModalActions({ children }: ModalActionsProps) {\n return (\n <div className=\"flex justify-end gap-tinyrack-sm pt-tinyrack-lg\">\n {children}\n </div>\n );\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":"4VAaa,EAA8B,EAAM,WAAW,SAAwB,EAAgB,EAAc,CAChH,GAAM,CACJ,SACA,YACA,QACA,cAAc,GACd,GAAG,GACD,EACE,EAAQ,EAAqB,EAC7B,EAAO,EAAM,SAAS,MAAM,EAC5B,EAAS,EAAM,SAAS,QAAQ,EAChC,EAAU,EAAM,SAAS,SAAS,EAMxC,OAAO,EAAiB,MAAO,EAAgB,CAC7C,MAAA,CAJA,OACA,iBAHuB,EAAM,SAAS,kBAGvB,CAGX,EACJ,IAAK,CAAC,EAAM,QAAQ,YAAa,CAAY,EAC7C,uBAAwB,EACxB,MAAO,CAAC,CACN,KAAM,eACN,OAAQ,CAAC,EACT,MAAO,CACL,WAAY,OACZ,iBAAkB,MACpB,CACF,EAAG,CAAY,EACf,QAAS,GAAe,CAAC,CAC3B,CAAC,CACH,CAAC,QCzBY,EAA2B,EAAM,WAAW,SAAqB,EAAgB,EAAc,CAC1G,GAAM,CACJ,SACA,YACA,QACA,aACA,eACA,GAAG,GACD,EACE,EAAQ,EAAqB,EAC7B,EAAuB,EAAM,SAAS,sBAAsB,EAC5D,EAA0B,EAAM,S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this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i=this.state.status===`pending`,a=!this.#r.canStart();try{if(i)n();else{this.#i({type:`pending`,variables:t,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:a})}let e=await this.#r.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#n.runNext(this)}}#i(e){let n=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=n(this.state),t.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}function a(e){return e}export{r as n,i as r,a as t};
2
- //# sourceMappingURL=mutationOptions-DyYFUbyn.js.map
1
+ import{dr as e,pr as t,ur as n}from"./config-v3-oy_ef.js";var r=class extends n{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i=this.state.status===`pending`,a=!this.#r.canStart();try{if(i)n();else{this.#i({type:`pending`,variables:t,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:a})}let e=await this.#r.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#n.runNext(this)}}#i(e){let n=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=n(this.state),t.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}function a(e){return e}export{r as n,i as r,a as t};
2
+ //# sourceMappingURL=mutationOptions-CrswitPs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutationOptions-DyYFUbyn.js","names":["#client","#mutationCache","#observers","#retryer","#dispatch"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.101.2/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.2_react@19.2.7/node_modules/@tanstack/react-query/build/modern/mutationOptions.js"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #client;\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.#client = config.client;\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const onContinue = () => {\n this.#dispatch({ type: \"continue\" });\n };\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables, mutationFnContext);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (restored) {\n onContinue();\n } else {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this,\n mutationFnContext\n );\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext\n );\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext\n );\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onError?.(\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n this.#dispatch({ type: \"error\", error });\n throw error;\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationOptions.ts\nfunction mutationOptions(options) {\n return options;\n}\nexport {\n mutationOptions\n};\n//# sourceMappingURL=mutationOptions.js.map"],"x_google_ignoreList":[0,1],"mappings":"0DAIA,IAAI,EAAW,cAAc,CAAU,CACrC,GACA,GACA,GACA,GACA,YAAY,EAAQ,CAClB,MAAM,EACN,KAAKA,GAAU,EAAO,OACt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U,KACV,KAAM,UACN,QACF,CAAC,CACH,CAAC,CACH,CACF,EACA,SAAS,GAAkB,CACzB,MAAO,CACL,QAAS,IAAK,GACd,KAAM,IAAK,GACX,MAAO,KACP,aAAc,EACd,cAAe,KACf,SAAU,GACV,OAAQ,OACR,UAAW,IAAK,GAChB,YAAa,CACf,CACF,CClRA,SAAS,EAAgB,EAAS,CAChC,OAAO,CACT"}
1
+ {"version":3,"file":"mutationOptions-CrswitPs.js","names":["#client","#mutationCache","#observers","#retryer","#dispatch"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.101.2/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.2_react@19.2.7/node_modules/@tanstack/react-query/build/modern/mutationOptions.js"],"sourcesContent":["// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #client;\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.#client = config.client;\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const onContinue = () => {\n this.#dispatch({ type: \"continue\" });\n };\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables, mutationFnContext);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (restored) {\n onContinue();\n } else {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this,\n mutationFnContext\n );\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext\n );\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext\n );\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onError?.(\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n this.#dispatch({ type: \"error\", error });\n throw error;\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationOptions.ts\nfunction mutationOptions(options) {\n return options;\n}\nexport {\n mutationOptions\n};\n//# sourceMappingURL=mutationOptions.js.map"],"x_google_ignoreList":[0,1],"mappings":"0DAIA,IAAI,EAAW,cAAc,CAAU,CACrC,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CACpC,EAAS,iBAAiB,CAAM,CAClC,CAAC,EACD,KAAKD,GAAe,OAAO,CACzB,SAAU,KACV,KAAM,UACN,QACF,CAAC,CACH,CAAC,CACH,CACF,EACA,SAAS,GAAkB,CACzB,MAAO,CACL,QAAS,IAAK,GACd,KAAM,IAAK,GACX,MAAO,KACP,aAAc,EACd,cAAe,KACf,SAAU,GACV,OAAQ,OACR,UAAW,IAAK,GAChB,YAAa,CACf,CACF,CClRA,SAAS,EAAgB,EAAS,CAChC,OAAO,CACT"}
@@ -0,0 +1,2 @@
1
+ import{Yn as e,i as t,n,r}from"./config-v3-oy_ef.js";import{t as i}from"./mutationOptions-CrswitPs.js";function a(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function o(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function s(){return c.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var c={stubThis:e=>e};function l(e){let{id:t}=e;return{...e,id:o(t),transports:e.transports}}function u(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var d=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function f({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new d({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new d({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new d({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new d({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new d({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new d({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new d({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new d({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!u(t))return new d({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new d({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new d({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new d({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var p=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},m=[`cross-platform`,`platform`];function h(e){if(e&&!(m.indexOf(e)<0))return e}async function g(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!s())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:o(t.challenge),user:{...t.user,id:o(t.user.id)},excludeCredentials:t.excludeCredentials?.map(l)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=p.createNewAbortSignal();let c;try{c=await navigator.credentials.create(i)}catch(e){throw f({error:e,options:i})}if(!c)throw Error(`Registration was not completed`);let{id:u,rawId:d,response:m,type:g}=c,v;typeof m.getTransports==`function`&&(v=m.getTransports());let y;if(typeof m.getPublicKeyAlgorithm==`function`)try{y=m.getPublicKeyAlgorithm()}catch(e){_(`getPublicKeyAlgorithm()`,e)}let b;if(typeof m.getPublicKey==`function`)try{let e=m.getPublicKey();e!==null&&(b=a(e))}catch(e){_(`getPublicKey()`,e)}let x;if(typeof m.getAuthenticatorData==`function`)try{x=a(m.getAuthenticatorData())}catch(e){_(`getAuthenticatorData()`,e)}return{id:u,rawId:a(d),response:{attestationObject:a(m.attestationObject),clientDataJSON:a(m.clientDataJSON),transports:v,publicKeyAlgorithm:y,publicKey:b,authenticatorData:x},type:g,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:h(c.authenticatorAttachment)}}function _(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function v(){if(!s())return y.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?y.stubThis(new Promise(e=>e(!1))):y.stubThis(e.isConditionalMediationAvailable())}var y={stubThis:e=>e};function b({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new d({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new d({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!u(t))return new d({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new d({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new d({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function x(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!s())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(l));let c={...t,challenge:o(t.challenge),allowCredentials:i},u={};if(n){if(!await v())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');u.mediation=`conditional`,c.allowCredentials=[]}u.publicKey=c,u.signal=p.createNewAbortSignal();let d;try{d=await navigator.credentials.get(u)}catch(e){throw b({error:e,options:u})}if(!d)throw Error(`Authentication was not completed`);let{id:f,rawId:m,response:g,type:_}=d,y;return g.userHandle&&(y=a(g.userHandle)),{id:f,rawId:a(m),response:{authenticatorData:a(g.authenticatorData),clientDataJSON:a(g.clientDataJSON),signature:a(g.signature),userHandle:y},type:_,clientExtensionResults:d.getClientExtensionResults(),authenticatorAttachment:h(d.authenticatorAttachment)}}var S=e({queryKey:n.passkeys(),queryFn:async()=>t(await r.api.user.passkeys.$get())}),C=i({mutationFn:async e=>{let{options:n}=await t(await r.api.user.passkeys.register.options.$post()),i=await g({optionsJSON:n});return t(await r.api.user.passkeys.register.verify.$post({json:{response:i,name:e.name}}))}}),w=i({mutationFn:async e=>t(await r.api.user.passkeys[`:id`].$delete({param:{id:e.id}}))}),T=i({mutationFn:async e=>t(await r.api.user.passkeys[`:id`].$patch({param:{id:e.id},json:{name:e.name}}))}),E=i({mutationFn:async()=>{let{options:e}=await t(await r.api.auth.passkey.options.$post()),n=await x({optionsJSON:e});return t(await r.api.auth.passkey.verify.$post({json:{response:{...n,clientExtensionResults:{...n.clientExtensionResults}}}}))}}),D=async(e,n)=>{try{let{options:i}=await t(await r.api.auth.passkey.options.$post({},{init:{signal:n}})),a=await x({optionsJSON:i,useBrowserAutofill:!0});e(await t(await r.api.auth.passkey.verify.$post({json:{response:{...a,clientExtensionResults:{...a.clientExtensionResults}}}},{init:{signal:n}})))}catch(e){e instanceof Error&&e.name}};export{T as a,C as i,w as n,D as o,S as r,E as t};
2
+ //# sourceMappingURL=passkey-B2Blw47e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"passkey-J1qnYp9A.js","names":[],"sources":["../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/bufferToBase64URLString.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/webAuthnError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/webAuthnAbortService.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/toAuthenticatorAttachment.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js","../../../frontend/src/queries/passkey.ts"],"sourcesContent":["/**\n * Convert the given array buffer into a Base64URL-encoded string. Ideal for converting various\n * credential response ArrayBuffers to string for sending back to the server as JSON.\n *\n * Helper method to compliment `base64URLStringToBuffer`\n */\nexport function bufferToBase64URLString(buffer) {\n const bytes = new Uint8Array(buffer);\n let str = '';\n for (const charCode of bytes) {\n str += String.fromCharCode(charCode);\n }\n const base64String = btoa(str);\n return base64String.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}\n","/**\n * Convert from a Base64URL-encoded string to an Array Buffer. Best used when converting a\n * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or\n * excludeCredentials\n *\n * Helper method to compliment `bufferToBase64URLString`\n */\nexport function base64URLStringToBuffer(base64URLString) {\n // Convert from Base64URL to Base64\n const base64 = base64URLString.replace(/-/g, '+').replace(/_/g, '/');\n /**\n * Pad with '=' until it's a multiple of four\n * (4 - (85 % 4 = 1) = 3) % 4 = 3 padding\n * (4 - (86 % 4 = 2) = 2) % 4 = 2 padding\n * (4 - (87 % 4 = 3) = 1) % 4 = 1 padding\n * (4 - (88 % 4 = 0) = 4) % 4 = 0 padding\n */\n const padLength = (4 - (base64.length % 4)) % 4;\n const padded = base64.padEnd(base64.length + padLength, '=');\n // Convert to a binary string\n const binary = atob(padded);\n // Convert binary string to buffer\n const buffer = new ArrayBuffer(binary.length);\n const bytes = new Uint8Array(buffer);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return buffer;\n}\n","/**\n * Determine if the browser is capable of Webauthn\n */\nexport function browserSupportsWebAuthn() {\n return _browserSupportsWebAuthnInternals.stubThis(globalThis?.PublicKeyCredential !== undefined &&\n typeof globalThis.PublicKeyCredential === 'function');\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _browserSupportsWebAuthnInternals = {\n stubThis: (value) => value,\n};\n","import { base64URLStringToBuffer } from './base64URLStringToBuffer.js';\nexport function toPublicKeyCredentialDescriptor(descriptor) {\n const { id } = descriptor;\n return {\n ...descriptor,\n id: base64URLStringToBuffer(id),\n /**\n * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer\n * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports\n * are fine to pass to WebAuthn since browsers will recognize the new value.\n */\n transports: descriptor.transports,\n };\n}\n","/**\n * A simple test to determine if a hostname is a properly-formatted domain name\n *\n * A \"valid domain\" is defined here: https://url.spec.whatwg.org/#valid-domain\n *\n * Regex was originally sourced from here, then remixed to add punycode support:\n * https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html\n */\nexport function isValidDomain(hostname) {\n return (\n // Consider localhost valid as well since it's okay wrt Secure Contexts\n hostname === 'localhost' ||\n // Support punycode (ACE) or ascii labels and domains\n /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(hostname));\n}\n","/**\n * A custom Error used to return a more nuanced error detailing _why_ one of the eight documented\n * errors in the spec was raised after calling `navigator.credentials.create()` or\n * `navigator.credentials.get()`:\n *\n * - `AbortError`\n * - `ConstraintError`\n * - `InvalidStateError`\n * - `NotAllowedError`\n * - `NotSupportedError`\n * - `SecurityError`\n * - `TypeError`\n * - `UnknownError`\n *\n * Error messages were determined through investigation of the spec to determine under which\n * scenarios a given error would be raised.\n */\nexport class WebAuthnError extends Error {\n constructor({ message, code, cause, name, }) {\n // @ts-ignore: help Rollup understand that `cause` is okay to set\n super(message, { cause });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = name ?? cause.name;\n this.code = code;\n }\n}\n","import { isValidDomain } from './isValidDomain.js';\nimport { WebAuthnError } from './webAuthnError.js';\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.create()`\n */\nexport function identifyRegistrationError({ error, options, }) {\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Registration ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'ConstraintError') {\n if (publicKey.authenticatorSelection?.requireResidentKey === true) {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 4)\n return new WebAuthnError({\n message: 'Discoverable credentials were required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT',\n cause: error,\n });\n }\n else if (\n // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024\n options.mediation === 'conditional' &&\n publicKey.authenticatorSelection?.userVerification === 'required') {\n // https://w3c.github.io/webauthn/#sctn-createCredential (Step 22.4)\n return new WebAuthnError({\n message: 'User verification was required during automatic registration but it could not be performed',\n code: 'ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE',\n cause: error,\n });\n }\n else if (publicKey.authenticatorSelection?.userVerification === 'required') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 5)\n return new WebAuthnError({\n message: 'User verification was required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT',\n cause: error,\n });\n }\n }\n else if (error.name === 'InvalidStateError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 20)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 3)\n return new WebAuthnError({\n message: 'The authenticator was previously registered',\n code: 'ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED',\n cause: error,\n });\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'NotSupportedError') {\n const validPubKeyCredParams = publicKey.pubKeyCredParams.filter((param) => param.type === 'public-key');\n if (validPubKeyCredParams.length === 0) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 10)\n return new WebAuthnError({\n message: 'No entry in pubKeyCredParams was of type \"public-key\"',\n code: 'ERROR_MALFORMED_PUBKEYCREDPARAMS',\n cause: error,\n });\n }\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 2)\n return new WebAuthnError({\n message: 'No available authenticator supported any of the specified pubKeyCredParams algorithms',\n code: 'ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = globalThis.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 7)\n return new WebAuthnError({\n message: `${globalThis.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rp.id !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 8)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rp.id}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'TypeError') {\n if (publicKey.user.id.byteLength < 1 || publicKey.user.id.byteLength > 64) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 5)\n return new WebAuthnError({\n message: 'User ID was not between 1 and 64 characters',\n code: 'ERROR_INVALID_USER_ID_LENGTH',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 8)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new credential',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return error;\n}\n","class BaseWebAuthnAbortService {\n constructor() {\n Object.defineProperty(this, \"controller\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n createNewAbortSignal() {\n // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get()\n if (this.controller) {\n const abortError = new Error('Cancelling existing WebAuthn API call for new one');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n }\n const newController = new AbortController();\n this.controller = newController;\n return newController.signal;\n }\n cancelCeremony() {\n if (this.controller) {\n const abortError = new Error('Manually cancelling existing WebAuthn API call');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n this.controller = undefined;\n }\n }\n}\n/**\n * A service singleton to help ensure that only a single WebAuthn ceremony is active at a time.\n *\n * Users of **@simplewebauthn/browser** shouldn't typically need to use this, but it can help e.g.\n * developers building projects that use client-side routing to better control the behavior of\n * their UX in response to router navigation events.\n */\nexport const WebAuthnAbortService = new BaseWebAuthnAbortService();\n","const attachments = ['cross-platform', 'platform'];\n/**\n * If possible coerce a `string` value into a known `AuthenticatorAttachment`\n */\nexport function toAuthenticatorAttachment(attachment) {\n if (!attachment) {\n return;\n }\n if (attachments.indexOf(attachment) < 0) {\n return;\n }\n return attachment;\n}\n","import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString.js';\nimport { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer.js';\nimport { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn.js';\nimport { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor.js';\nimport { identifyRegistrationError } from '../helpers/identifyRegistrationError.js';\nimport { WebAuthnAbortService } from '../helpers/webAuthnAbortService.js';\nimport { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment.js';\n/**\n * Begin authenticator \"registration\" via WebAuthn attestation\n *\n * @param optionsJSON Output from **@simplewebauthn/server**'s `generateRegistrationOptions()`\n * @param useAutoRegister (Optional) Try to silently create a passkey with the password manager that the user just signed in with. Defaults to `false`.\n */\nexport async function startRegistration(options) {\n // @ts-ignore: Intentionally check for old call structure to warn about improper API call\n if (!options.optionsJSON && options.challenge) {\n console.warn('startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.');\n // @ts-ignore: Reassign the options, passed in as a positional argument, to the expected variable\n options = { optionsJSON: options };\n }\n const { optionsJSON, useAutoRegister = false } = options;\n if (!browserSupportsWebAuthn()) {\n throw new Error('WebAuthn is not supported in this browser');\n }\n // We need to convert some values to Uint8Arrays before passing the credentials to the navigator\n const publicKey = {\n ...optionsJSON,\n challenge: base64URLStringToBuffer(optionsJSON.challenge),\n user: {\n ...optionsJSON.user,\n id: base64URLStringToBuffer(optionsJSON.user.id),\n },\n excludeCredentials: optionsJSON.excludeCredentials?.map(toPublicKeyCredentialDescriptor),\n };\n // Prepare options for `.create()`\n const createOptions = {};\n /**\n * Try to use conditional create to register a passkey for the user with the password manager\n * the user just used to authenticate with. The user won't be shown any prominent UI by the\n * browser.\n */\n if (useAutoRegister) {\n // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024\n createOptions.mediation = 'conditional';\n }\n // Finalize options\n createOptions.publicKey = publicKey;\n // Set up the ability to cancel this request if the user attempts another\n createOptions.signal = WebAuthnAbortService.createNewAbortSignal();\n // Wait for the user to complete attestation\n let credential;\n try {\n credential = (await navigator.credentials.create(createOptions));\n }\n catch (err) {\n throw identifyRegistrationError({ error: err, options: createOptions });\n }\n if (!credential) {\n throw new Error('Registration was not completed');\n }\n const { id, rawId, response, type } = credential;\n // Continue to play it safe with `getTransports()` for now, even when L3 types say it's required\n let transports = undefined;\n if (typeof response.getTransports === 'function') {\n transports = response.getTransports();\n }\n // L3 says this is required, but browser and webview support are still not guaranteed.\n let responsePublicKeyAlgorithm = undefined;\n if (typeof response.getPublicKeyAlgorithm === 'function') {\n try {\n responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm();\n }\n catch (error) {\n warnOnBrokenImplementation('getPublicKeyAlgorithm()', error);\n }\n }\n let responsePublicKey = undefined;\n if (typeof response.getPublicKey === 'function') {\n try {\n const _publicKey = response.getPublicKey();\n if (_publicKey !== null) {\n responsePublicKey = bufferToBase64URLString(_publicKey);\n }\n }\n catch (error) {\n warnOnBrokenImplementation('getPublicKey()', error);\n }\n }\n // L3 says this is required, but browser and webview support are still not guaranteed.\n let responseAuthenticatorData;\n if (typeof response.getAuthenticatorData === 'function') {\n try {\n responseAuthenticatorData = bufferToBase64URLString(response.getAuthenticatorData());\n }\n catch (error) {\n warnOnBrokenImplementation('getAuthenticatorData()', error);\n }\n }\n return {\n id,\n rawId: bufferToBase64URLString(rawId),\n response: {\n attestationObject: bufferToBase64URLString(response.attestationObject),\n clientDataJSON: bufferToBase64URLString(response.clientDataJSON),\n transports,\n publicKeyAlgorithm: responsePublicKeyAlgorithm,\n publicKey: responsePublicKey,\n authenticatorData: responseAuthenticatorData,\n },\n type,\n clientExtensionResults: credential.getClientExtensionResults(),\n authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment),\n };\n}\n/**\n * Visibly warn when we detect an issue related to a passkey provider intercepting WebAuthn API\n * calls\n */\nfunction warnOnBrokenImplementation(methodName, cause) {\n console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${methodName}. You should report this error to them.\\n`, cause);\n}\n","import { browserSupportsWebAuthn } from './browserSupportsWebAuthn.js';\n/**\n * Determine if the browser supports conditional UI, so that WebAuthn credentials can\n * be shown to the user in the browser's typical password autofill popup.\n */\nexport function browserSupportsWebAuthnAutofill() {\n if (!browserSupportsWebAuthn()) {\n return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));\n }\n /**\n * I don't like the `as unknown` here but there's a `declare var PublicKeyCredential` in\n * TS' DOM lib that's making it difficult for me to just go `as PublicKeyCredentialFuture` as I\n * want. I think I'm fine with this for now since it's _supposed_ to be temporary, until TS types\n * have a chance to catch up.\n */\n const globalPublicKeyCredential = globalThis\n .PublicKeyCredential;\n if (globalPublicKeyCredential?.isConditionalMediationAvailable === undefined) {\n return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));\n }\n return _browserSupportsWebAuthnAutofillInternals.stubThis(globalPublicKeyCredential.isConditionalMediationAvailable());\n}\n// Make it possible to stub the return value during testing\nexport const _browserSupportsWebAuthnAutofillInternals = {\n stubThis: (value) => value,\n};\n","import { isValidDomain } from './isValidDomain.js';\nimport { WebAuthnError } from './webAuthnError.js';\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.get()`\n */\nexport function identifyAuthenticationError({ error, options, }) {\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Authentication ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = globalThis.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 5)\n return new WebAuthnError({\n message: `${globalThis.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rpId !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 6)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rpId}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 12)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new assertion signature',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return error;\n}\n","import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString.js';\nimport { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer.js';\nimport { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn.js';\nimport { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill.js';\nimport { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor.js';\nimport { identifyAuthenticationError } from '../helpers/identifyAuthenticationError.js';\nimport { WebAuthnAbortService } from '../helpers/webAuthnAbortService.js';\nimport { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment.js';\n/**\n * Begin authenticator \"login\" via WebAuthn assertion\n *\n * @param optionsJSON Output from **@simplewebauthn/server**'s `generateAuthenticationOptions()`\n * @param useBrowserAutofill (Optional) Initialize conditional UI to enable logging in via browser autofill prompts. Defaults to `false`.\n * @param verifyBrowserAutofillInput (Optional) Ensure a suitable `<input>` element is present when `useBrowserAutofill` is `true`. Defaults to `true`.\n */\nexport async function startAuthentication(options) {\n // @ts-ignore: Intentionally check for old call structure to warn about improper API call\n if (!options.optionsJSON && options.challenge) {\n console.warn('startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.');\n // @ts-ignore: Reassign the options, passed in as a positional argument, to the expected variable\n options = { optionsJSON: options };\n }\n const { optionsJSON, useBrowserAutofill = false, verifyBrowserAutofillInput = true, } = options;\n if (!browserSupportsWebAuthn()) {\n throw new Error('WebAuthn is not supported in this browser');\n }\n // We need to avoid passing empty array to avoid blocking retrieval\n // of public key\n let allowCredentials;\n if (optionsJSON.allowCredentials?.length !== 0) {\n allowCredentials = optionsJSON.allowCredentials?.map(toPublicKeyCredentialDescriptor);\n }\n // We need to convert some values to Uint8Arrays before passing the credentials to the navigator\n const publicKey = {\n ...optionsJSON,\n challenge: base64URLStringToBuffer(optionsJSON.challenge),\n allowCredentials,\n };\n // Prepare options for `.get()`\n const getOptions = {};\n /**\n * Set up the page to prompt the user to select a credential for authentication via the browser's\n * input autofill mechanism.\n */\n if (useBrowserAutofill) {\n if (!(await browserSupportsWebAuthnAutofill())) {\n throw Error('Browser does not support WebAuthn autofill');\n }\n // Check for an <input> with \"webauthn\" in its `autocomplete` attribute\n const eligibleInputs = document.querySelectorAll(\"input[autocomplete$='webauthn']\");\n // WebAuthn autofill requires at least one valid input\n if (eligibleInputs.length < 1 && verifyBrowserAutofillInput) {\n throw Error('No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected');\n }\n // `CredentialMediationRequirement` doesn't know about \"conditional\" yet as of\n // typescript@4.6.3\n getOptions.mediation = 'conditional';\n // Conditional UI requires an empty allow list\n publicKey.allowCredentials = [];\n }\n // Finalize options\n getOptions.publicKey = publicKey;\n // Set up the ability to cancel this request if the user attempts another\n getOptions.signal = WebAuthnAbortService.createNewAbortSignal();\n // Wait for the user to complete assertion\n let credential;\n try {\n credential = (await navigator.credentials.get(getOptions));\n }\n catch (err) {\n throw identifyAuthenticationError({ error: err, options: getOptions });\n }\n if (!credential) {\n throw new Error('Authentication was not completed');\n }\n const { id, rawId, response, type } = credential;\n let userHandle = undefined;\n if (response.userHandle) {\n userHandle = bufferToBase64URLString(response.userHandle);\n }\n // Convert values to base64 to make it easier to send back to the server\n return {\n id,\n rawId: bufferToBase64URLString(rawId),\n response: {\n authenticatorData: bufferToBase64URLString(response.authenticatorData),\n clientDataJSON: bufferToBase64URLString(response.clientDataJSON),\n signature: bufferToBase64URLString(response.signature),\n userHandle,\n },\n type,\n clientExtensionResults: credential.getClientExtensionResults(),\n authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment),\n };\n}\n","import {\n startAuthentication,\n startRegistration,\n} from '@simplewebauthn/browser';\nimport { mutationOptions, queryOptions } from '@tanstack/react-query';\nimport type { InferResponseType } from 'hono/client';\nimport { client, jsonOk } from '#frontend/libs/api.ts';\nimport { queryKeys } from './keys';\nimport type { AuthResponse } from './session';\n\nexport type PasskeysResponse = InferResponseType<\n (typeof client.api.user.passkeys)['$get'],\n 200\n>;\n\nexport type PasskeyInfo = PasskeysResponse['passkeys'][number];\n\nexport type PasskeySetupVerifyResponse = InferResponseType<\n (typeof client.api.user.passkeys.register.verify)['$post'],\n 200\n>;\n\n/**\n * Get all passkeys for current user\n */\nexport const getPasskeysQueryOptions = queryOptions({\n queryKey: queryKeys.passkeys(),\n queryFn: async () => {\n const res = await client.api.user.passkeys.$get();\n return jsonOk(res);\n },\n});\n\n/**\n * Register a new passkey\n */\nexport type RegisterPasskeyParams = {\n name?: string;\n};\n\nexport const registerPasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: RegisterPasskeyParams) => {\n // Step 1: Get registration options from server\n const optionsRes = await client.api.user.passkeys.register.options.$post();\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn registration in browser\n const registrationResponse = await startRegistration({\n optionsJSON: options,\n });\n\n // Step 3: Send registration response to server\n const verifyRes = await client.api.user.passkeys.register.verify.$post({\n json: {\n response: registrationResponse,\n name: params.name,\n },\n });\n return jsonOk(verifyRes);\n },\n});\n\n/**\n * Delete a passkey\n */\nexport type DeletePasskeyParams = {\n id: string;\n};\n\nexport const deletePasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: DeletePasskeyParams) => {\n const res = await client.api.user.passkeys[':id'].$delete({\n param: { id: params.id },\n });\n return jsonOk(res);\n },\n});\n\n/**\n * Rename a passkey\n */\nexport type RenamePasskeyParams = {\n id: string;\n name: string;\n};\n\nexport const renamePasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: RenamePasskeyParams) => {\n const res = await client.api.user.passkeys[':id'].$patch({\n param: { id: params.id },\n json: { name: params.name },\n });\n return jsonOk(res);\n },\n});\n\n/**\n * Authenticate with passkey (supports both passwordless\n * and 2FA)\n *\n * The server automatically determines the mode based on\n * session state:\n * - If pending2FAUser session exists: 2FA mode\n * - Otherwise: Passwordless mode (discoverable\n * credentials)\n */\nexport const authenticateWithPasskeyMutationOptions = mutationOptions({\n mutationFn: async () => {\n // Step 1: Get authentication options from server\n const optionsRes = await client.api.auth.passkey.options.$post();\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn authentication in browser\n const authenticationResponse = await startAuthentication({\n optionsJSON: options,\n });\n\n // Step 3: Send authentication response to server\n const verifyRes = await client.api.auth.passkey.verify.$post({\n json: {\n response: {\n ...authenticationResponse,\n clientExtensionResults: {\n ...authenticationResponse.clientExtensionResults,\n },\n },\n },\n });\n return jsonOk(verifyRes);\n },\n});\n\n/**\n * Start conditional passkey authentication (browser\n * autofill / Conditional UI)\n *\n * This enables the browser to suggest passkeys in the\n * autofill dropdown when the user focuses on an input\n * with autocomplete=\"username webauthn\".\n *\n * Should be called on page load and runs in the background\n * until:\n * - User selects a passkey from the autofill dropdown\n * - The AbortController is aborted (e.g., on component\n * unmount)\n *\n * @param onSuccess - Callback when passkey authentication\n * succeeds\n * @param abortSignal - AbortSignal to cancel the\n * conditional authentication\n */\nexport const startConditionalPasskeyAuth = async (\n onSuccess: (data: AuthResponse) => void,\n abortSignal: AbortSignal,\n): Promise<void> => {\n try {\n // Step 1: Get authentication options from server\n const optionsRes = await client.api.auth.passkey.options.$post(\n {},\n { init: { signal: abortSignal } },\n );\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn with conditional mediation\n const authenticationResponse = await startAuthentication({\n optionsJSON: options,\n useBrowserAutofill: true,\n });\n\n // Step 3: Send authentication response to server\n const verifyRes = await client.api.auth.passkey.verify.$post(\n {\n json: {\n response: {\n ...authenticationResponse,\n clientExtensionResults: {\n ...authenticationResponse.clientExtensionResults,\n },\n },\n },\n },\n { init: { signal: abortSignal } },\n );\n const data = await jsonOk(verifyRes);\n onSuccess(data);\n } catch (error) {\n // AbortError is expected when component unmounts\n if (error instanceof Error && error.name !== 'AbortError') {\n // Non-abort error - could be handled here in the future\n }\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,CACF,CAAC,EAqBY,EAA8B,MACzC,EACA,IACkB,CAClB,GAAI,CAMF,GAAM,CAAE,WAAY,MAAM,EAAO,MAJR,EAAO,IAAI,KAAK,QAAQ,QAAQ,MACvD,CAAC,EACD,CAAE,KAAM,CAAE,OAAQ,CAAY,CAAE,CAClC,CAC2C,EAGrC,EAAyB,MAAM,EAAoB,CACvD,YAAa,EACb,mBAAoB,EACtB,CAAC,EAiBD,EAAU,MADS,EAAO,MAbF,EAAO,IAAI,KAAK,QAAQ,OAAO,MACrD,CACE,KAAM,CACJ,SAAU,CACR,GAAG,EACH,uBAAwB,CACtB,GAAG,EAAuB,sBAC5B,CACF,CACF,CACF,EACA,CAAE,KAAM,CAAE,OAAQ,CAAY,CAAE,CAClC,CACmC,CACrB,CAChB,OAAS,EAAO,CAEV,aAAiB,OAAS,EAAM,IAGtC,CACF"}
1
+ {"version":3,"file":"passkey-B2Blw47e.js","names":[],"sources":["../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/bufferToBase64URLString.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/webAuthnError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/webAuthnAbortService.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/toAuthenticatorAttachment.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js","../../../../node_modules/.pnpm/@simplewebauthn+browser@13.3.0/node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js","../../../frontend/src/queries/passkey.ts"],"sourcesContent":["/**\n * Convert the given array buffer into a Base64URL-encoded string. Ideal for converting various\n * credential response ArrayBuffers to string for sending back to the server as JSON.\n *\n * Helper method to compliment `base64URLStringToBuffer`\n */\nexport function bufferToBase64URLString(buffer) {\n const bytes = new Uint8Array(buffer);\n let str = '';\n for (const charCode of bytes) {\n str += String.fromCharCode(charCode);\n }\n const base64String = btoa(str);\n return base64String.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}\n","/**\n * Convert from a Base64URL-encoded string to an Array Buffer. Best used when converting a\n * credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or\n * excludeCredentials\n *\n * Helper method to compliment `bufferToBase64URLString`\n */\nexport function base64URLStringToBuffer(base64URLString) {\n // Convert from Base64URL to Base64\n const base64 = base64URLString.replace(/-/g, '+').replace(/_/g, '/');\n /**\n * Pad with '=' until it's a multiple of four\n * (4 - (85 % 4 = 1) = 3) % 4 = 3 padding\n * (4 - (86 % 4 = 2) = 2) % 4 = 2 padding\n * (4 - (87 % 4 = 3) = 1) % 4 = 1 padding\n * (4 - (88 % 4 = 0) = 4) % 4 = 0 padding\n */\n const padLength = (4 - (base64.length % 4)) % 4;\n const padded = base64.padEnd(base64.length + padLength, '=');\n // Convert to a binary string\n const binary = atob(padded);\n // Convert binary string to buffer\n const buffer = new ArrayBuffer(binary.length);\n const bytes = new Uint8Array(buffer);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return buffer;\n}\n","/**\n * Determine if the browser is capable of Webauthn\n */\nexport function browserSupportsWebAuthn() {\n return _browserSupportsWebAuthnInternals.stubThis(globalThis?.PublicKeyCredential !== undefined &&\n typeof globalThis.PublicKeyCredential === 'function');\n}\n/**\n * Make it possible to stub the return value during testing\n * @ignore Don't include this in docs output\n */\nexport const _browserSupportsWebAuthnInternals = {\n stubThis: (value) => value,\n};\n","import { base64URLStringToBuffer } from './base64URLStringToBuffer.js';\nexport function toPublicKeyCredentialDescriptor(descriptor) {\n const { id } = descriptor;\n return {\n ...descriptor,\n id: base64URLStringToBuffer(id),\n /**\n * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer\n * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports\n * are fine to pass to WebAuthn since browsers will recognize the new value.\n */\n transports: descriptor.transports,\n };\n}\n","/**\n * A simple test to determine if a hostname is a properly-formatted domain name\n *\n * A \"valid domain\" is defined here: https://url.spec.whatwg.org/#valid-domain\n *\n * Regex was originally sourced from here, then remixed to add punycode support:\n * https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html\n */\nexport function isValidDomain(hostname) {\n return (\n // Consider localhost valid as well since it's okay wrt Secure Contexts\n hostname === 'localhost' ||\n // Support punycode (ACE) or ascii labels and domains\n /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(hostname));\n}\n","/**\n * A custom Error used to return a more nuanced error detailing _why_ one of the eight documented\n * errors in the spec was raised after calling `navigator.credentials.create()` or\n * `navigator.credentials.get()`:\n *\n * - `AbortError`\n * - `ConstraintError`\n * - `InvalidStateError`\n * - `NotAllowedError`\n * - `NotSupportedError`\n * - `SecurityError`\n * - `TypeError`\n * - `UnknownError`\n *\n * Error messages were determined through investigation of the spec to determine under which\n * scenarios a given error would be raised.\n */\nexport class WebAuthnError extends Error {\n constructor({ message, code, cause, name, }) {\n // @ts-ignore: help Rollup understand that `cause` is okay to set\n super(message, { cause });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = name ?? cause.name;\n this.code = code;\n }\n}\n","import { isValidDomain } from './isValidDomain.js';\nimport { WebAuthnError } from './webAuthnError.js';\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.create()`\n */\nexport function identifyRegistrationError({ error, options, }) {\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Registration ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'ConstraintError') {\n if (publicKey.authenticatorSelection?.requireResidentKey === true) {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 4)\n return new WebAuthnError({\n message: 'Discoverable credentials were required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT',\n cause: error,\n });\n }\n else if (\n // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024\n options.mediation === 'conditional' &&\n publicKey.authenticatorSelection?.userVerification === 'required') {\n // https://w3c.github.io/webauthn/#sctn-createCredential (Step 22.4)\n return new WebAuthnError({\n message: 'User verification was required during automatic registration but it could not be performed',\n code: 'ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE',\n cause: error,\n });\n }\n else if (publicKey.authenticatorSelection?.userVerification === 'required') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 5)\n return new WebAuthnError({\n message: 'User verification was required but no available authenticator supported it',\n code: 'ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT',\n cause: error,\n });\n }\n }\n else if (error.name === 'InvalidStateError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 20)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 3)\n return new WebAuthnError({\n message: 'The authenticator was previously registered',\n code: 'ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED',\n cause: error,\n });\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'NotSupportedError') {\n const validPubKeyCredParams = publicKey.pubKeyCredParams.filter((param) => param.type === 'public-key');\n if (validPubKeyCredParams.length === 0) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 10)\n return new WebAuthnError({\n message: 'No entry in pubKeyCredParams was of type \"public-key\"',\n code: 'ERROR_MALFORMED_PUBKEYCREDPARAMS',\n cause: error,\n });\n }\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 2)\n return new WebAuthnError({\n message: 'No available authenticator supported any of the specified pubKeyCredParams algorithms',\n code: 'ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = globalThis.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 7)\n return new WebAuthnError({\n message: `${globalThis.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rp.id !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 8)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rp.id}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'TypeError') {\n if (publicKey.user.id.byteLength < 1 || publicKey.user.id.byteLength > 64) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 5)\n return new WebAuthnError({\n message: 'User ID was not between 1 and 64 characters',\n code: 'ERROR_INVALID_USER_ID_LENGTH',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 8)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new credential',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return error;\n}\n","class BaseWebAuthnAbortService {\n constructor() {\n Object.defineProperty(this, \"controller\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n createNewAbortSignal() {\n // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get()\n if (this.controller) {\n const abortError = new Error('Cancelling existing WebAuthn API call for new one');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n }\n const newController = new AbortController();\n this.controller = newController;\n return newController.signal;\n }\n cancelCeremony() {\n if (this.controller) {\n const abortError = new Error('Manually cancelling existing WebAuthn API call');\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n this.controller = undefined;\n }\n }\n}\n/**\n * A service singleton to help ensure that only a single WebAuthn ceremony is active at a time.\n *\n * Users of **@simplewebauthn/browser** shouldn't typically need to use this, but it can help e.g.\n * developers building projects that use client-side routing to better control the behavior of\n * their UX in response to router navigation events.\n */\nexport const WebAuthnAbortService = new BaseWebAuthnAbortService();\n","const attachments = ['cross-platform', 'platform'];\n/**\n * If possible coerce a `string` value into a known `AuthenticatorAttachment`\n */\nexport function toAuthenticatorAttachment(attachment) {\n if (!attachment) {\n return;\n }\n if (attachments.indexOf(attachment) < 0) {\n return;\n }\n return attachment;\n}\n","import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString.js';\nimport { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer.js';\nimport { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn.js';\nimport { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor.js';\nimport { identifyRegistrationError } from '../helpers/identifyRegistrationError.js';\nimport { WebAuthnAbortService } from '../helpers/webAuthnAbortService.js';\nimport { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment.js';\n/**\n * Begin authenticator \"registration\" via WebAuthn attestation\n *\n * @param optionsJSON Output from **@simplewebauthn/server**'s `generateRegistrationOptions()`\n * @param useAutoRegister (Optional) Try to silently create a passkey with the password manager that the user just signed in with. Defaults to `false`.\n */\nexport async function startRegistration(options) {\n // @ts-ignore: Intentionally check for old call structure to warn about improper API call\n if (!options.optionsJSON && options.challenge) {\n console.warn('startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.');\n // @ts-ignore: Reassign the options, passed in as a positional argument, to the expected variable\n options = { optionsJSON: options };\n }\n const { optionsJSON, useAutoRegister = false } = options;\n if (!browserSupportsWebAuthn()) {\n throw new Error('WebAuthn is not supported in this browser');\n }\n // We need to convert some values to Uint8Arrays before passing the credentials to the navigator\n const publicKey = {\n ...optionsJSON,\n challenge: base64URLStringToBuffer(optionsJSON.challenge),\n user: {\n ...optionsJSON.user,\n id: base64URLStringToBuffer(optionsJSON.user.id),\n },\n excludeCredentials: optionsJSON.excludeCredentials?.map(toPublicKeyCredentialDescriptor),\n };\n // Prepare options for `.create()`\n const createOptions = {};\n /**\n * Try to use conditional create to register a passkey for the user with the password manager\n * the user just used to authenticate with. The user won't be shown any prominent UI by the\n * browser.\n */\n if (useAutoRegister) {\n // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024\n createOptions.mediation = 'conditional';\n }\n // Finalize options\n createOptions.publicKey = publicKey;\n // Set up the ability to cancel this request if the user attempts another\n createOptions.signal = WebAuthnAbortService.createNewAbortSignal();\n // Wait for the user to complete attestation\n let credential;\n try {\n credential = (await navigator.credentials.create(createOptions));\n }\n catch (err) {\n throw identifyRegistrationError({ error: err, options: createOptions });\n }\n if (!credential) {\n throw new Error('Registration was not completed');\n }\n const { id, rawId, response, type } = credential;\n // Continue to play it safe with `getTransports()` for now, even when L3 types say it's required\n let transports = undefined;\n if (typeof response.getTransports === 'function') {\n transports = response.getTransports();\n }\n // L3 says this is required, but browser and webview support are still not guaranteed.\n let responsePublicKeyAlgorithm = undefined;\n if (typeof response.getPublicKeyAlgorithm === 'function') {\n try {\n responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm();\n }\n catch (error) {\n warnOnBrokenImplementation('getPublicKeyAlgorithm()', error);\n }\n }\n let responsePublicKey = undefined;\n if (typeof response.getPublicKey === 'function') {\n try {\n const _publicKey = response.getPublicKey();\n if (_publicKey !== null) {\n responsePublicKey = bufferToBase64URLString(_publicKey);\n }\n }\n catch (error) {\n warnOnBrokenImplementation('getPublicKey()', error);\n }\n }\n // L3 says this is required, but browser and webview support are still not guaranteed.\n let responseAuthenticatorData;\n if (typeof response.getAuthenticatorData === 'function') {\n try {\n responseAuthenticatorData = bufferToBase64URLString(response.getAuthenticatorData());\n }\n catch (error) {\n warnOnBrokenImplementation('getAuthenticatorData()', error);\n }\n }\n return {\n id,\n rawId: bufferToBase64URLString(rawId),\n response: {\n attestationObject: bufferToBase64URLString(response.attestationObject),\n clientDataJSON: bufferToBase64URLString(response.clientDataJSON),\n transports,\n publicKeyAlgorithm: responsePublicKeyAlgorithm,\n publicKey: responsePublicKey,\n authenticatorData: responseAuthenticatorData,\n },\n type,\n clientExtensionResults: credential.getClientExtensionResults(),\n authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment),\n };\n}\n/**\n * Visibly warn when we detect an issue related to a passkey provider intercepting WebAuthn API\n * calls\n */\nfunction warnOnBrokenImplementation(methodName, cause) {\n console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${methodName}. You should report this error to them.\\n`, cause);\n}\n","import { browserSupportsWebAuthn } from './browserSupportsWebAuthn.js';\n/**\n * Determine if the browser supports conditional UI, so that WebAuthn credentials can\n * be shown to the user in the browser's typical password autofill popup.\n */\nexport function browserSupportsWebAuthnAutofill() {\n if (!browserSupportsWebAuthn()) {\n return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));\n }\n /**\n * I don't like the `as unknown` here but there's a `declare var PublicKeyCredential` in\n * TS' DOM lib that's making it difficult for me to just go `as PublicKeyCredentialFuture` as I\n * want. I think I'm fine with this for now since it's _supposed_ to be temporary, until TS types\n * have a chance to catch up.\n */\n const globalPublicKeyCredential = globalThis\n .PublicKeyCredential;\n if (globalPublicKeyCredential?.isConditionalMediationAvailable === undefined) {\n return _browserSupportsWebAuthnAutofillInternals.stubThis(new Promise((resolve) => resolve(false)));\n }\n return _browserSupportsWebAuthnAutofillInternals.stubThis(globalPublicKeyCredential.isConditionalMediationAvailable());\n}\n// Make it possible to stub the return value during testing\nexport const _browserSupportsWebAuthnAutofillInternals = {\n stubThis: (value) => value,\n};\n","import { isValidDomain } from './isValidDomain.js';\nimport { WebAuthnError } from './webAuthnError.js';\n/**\n * Attempt to intuit _why_ an error was raised after calling `navigator.credentials.get()`\n */\nexport function identifyAuthenticationError({ error, options, }) {\n const { publicKey } = options;\n if (!publicKey) {\n throw Error('options was missing required publicKey property');\n }\n if (error.name === 'AbortError') {\n if (options.signal instanceof AbortSignal) {\n // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 16)\n return new WebAuthnError({\n message: 'Authentication ceremony was sent an abort signal',\n code: 'ERROR_CEREMONY_ABORTED',\n cause: error,\n });\n }\n }\n else if (error.name === 'NotAllowedError') {\n /**\n * Pass the error directly through. Platforms are overloading this error beyond what the spec\n * defines and we don't want to overwrite potentially useful error messages.\n */\n return new WebAuthnError({\n message: error.message,\n code: 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY',\n cause: error,\n });\n }\n else if (error.name === 'SecurityError') {\n const effectiveDomain = globalThis.location.hostname;\n if (!isValidDomain(effectiveDomain)) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 5)\n return new WebAuthnError({\n message: `${globalThis.location.hostname} is an invalid domain`,\n code: 'ERROR_INVALID_DOMAIN',\n cause: error,\n });\n }\n else if (publicKey.rpId !== effectiveDomain) {\n // https://www.w3.org/TR/webauthn-2/#sctn-discover-from-external-source (Step 6)\n return new WebAuthnError({\n message: `The RP ID \"${publicKey.rpId}\" is invalid for this domain`,\n code: 'ERROR_INVALID_RP_ID',\n cause: error,\n });\n }\n }\n else if (error.name === 'UnknownError') {\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 1)\n // https://www.w3.org/TR/webauthn-2/#sctn-op-get-assertion (Step 12)\n return new WebAuthnError({\n message: 'The authenticator was unable to process the specified options, or could not create a new assertion signature',\n code: 'ERROR_AUTHENTICATOR_GENERAL_ERROR',\n cause: error,\n });\n }\n return error;\n}\n","import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString.js';\nimport { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer.js';\nimport { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn.js';\nimport { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill.js';\nimport { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor.js';\nimport { identifyAuthenticationError } from '../helpers/identifyAuthenticationError.js';\nimport { WebAuthnAbortService } from '../helpers/webAuthnAbortService.js';\nimport { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment.js';\n/**\n * Begin authenticator \"login\" via WebAuthn assertion\n *\n * @param optionsJSON Output from **@simplewebauthn/server**'s `generateAuthenticationOptions()`\n * @param useBrowserAutofill (Optional) Initialize conditional UI to enable logging in via browser autofill prompts. Defaults to `false`.\n * @param verifyBrowserAutofillInput (Optional) Ensure a suitable `<input>` element is present when `useBrowserAutofill` is `true`. Defaults to `true`.\n */\nexport async function startAuthentication(options) {\n // @ts-ignore: Intentionally check for old call structure to warn about improper API call\n if (!options.optionsJSON && options.challenge) {\n console.warn('startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.');\n // @ts-ignore: Reassign the options, passed in as a positional argument, to the expected variable\n options = { optionsJSON: options };\n }\n const { optionsJSON, useBrowserAutofill = false, verifyBrowserAutofillInput = true, } = options;\n if (!browserSupportsWebAuthn()) {\n throw new Error('WebAuthn is not supported in this browser');\n }\n // We need to avoid passing empty array to avoid blocking retrieval\n // of public key\n let allowCredentials;\n if (optionsJSON.allowCredentials?.length !== 0) {\n allowCredentials = optionsJSON.allowCredentials?.map(toPublicKeyCredentialDescriptor);\n }\n // We need to convert some values to Uint8Arrays before passing the credentials to the navigator\n const publicKey = {\n ...optionsJSON,\n challenge: base64URLStringToBuffer(optionsJSON.challenge),\n allowCredentials,\n };\n // Prepare options for `.get()`\n const getOptions = {};\n /**\n * Set up the page to prompt the user to select a credential for authentication via the browser's\n * input autofill mechanism.\n */\n if (useBrowserAutofill) {\n if (!(await browserSupportsWebAuthnAutofill())) {\n throw Error('Browser does not support WebAuthn autofill');\n }\n // Check for an <input> with \"webauthn\" in its `autocomplete` attribute\n const eligibleInputs = document.querySelectorAll(\"input[autocomplete$='webauthn']\");\n // WebAuthn autofill requires at least one valid input\n if (eligibleInputs.length < 1 && verifyBrowserAutofillInput) {\n throw Error('No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected');\n }\n // `CredentialMediationRequirement` doesn't know about \"conditional\" yet as of\n // typescript@4.6.3\n getOptions.mediation = 'conditional';\n // Conditional UI requires an empty allow list\n publicKey.allowCredentials = [];\n }\n // Finalize options\n getOptions.publicKey = publicKey;\n // Set up the ability to cancel this request if the user attempts another\n getOptions.signal = WebAuthnAbortService.createNewAbortSignal();\n // Wait for the user to complete assertion\n let credential;\n try {\n credential = (await navigator.credentials.get(getOptions));\n }\n catch (err) {\n throw identifyAuthenticationError({ error: err, options: getOptions });\n }\n if (!credential) {\n throw new Error('Authentication was not completed');\n }\n const { id, rawId, response, type } = credential;\n let userHandle = undefined;\n if (response.userHandle) {\n userHandle = bufferToBase64URLString(response.userHandle);\n }\n // Convert values to base64 to make it easier to send back to the server\n return {\n id,\n rawId: bufferToBase64URLString(rawId),\n response: {\n authenticatorData: bufferToBase64URLString(response.authenticatorData),\n clientDataJSON: bufferToBase64URLString(response.clientDataJSON),\n signature: bufferToBase64URLString(response.signature),\n userHandle,\n },\n type,\n clientExtensionResults: credential.getClientExtensionResults(),\n authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment),\n };\n}\n","import {\n startAuthentication,\n startRegistration,\n} from '@simplewebauthn/browser';\nimport { mutationOptions, queryOptions } from '@tanstack/react-query';\nimport type { InferResponseType } from 'hono/client';\nimport { client, jsonOk } from '#frontend/libs/api.ts';\nimport { queryKeys } from './keys';\n\nexport type PasskeyAuthenticationResponse = InferResponseType<\n (typeof client.api.auth.passkey.verify)['$post'],\n 200\n>;\n\nexport type PasskeysResponse = InferResponseType<\n (typeof client.api.user.passkeys)['$get'],\n 200\n>;\n\nexport type PasskeyInfo = PasskeysResponse['passkeys'][number];\n\nexport type PasskeySetupVerifyResponse = InferResponseType<\n (typeof client.api.user.passkeys.register.verify)['$post'],\n 200\n>;\n\n/**\n * Get all passkeys for current user\n */\nexport const getPasskeysQueryOptions = queryOptions({\n queryKey: queryKeys.passkeys(),\n queryFn: async () => {\n const res = await client.api.user.passkeys.$get();\n return jsonOk(res);\n },\n});\n\n/**\n * Register a new passkey\n */\nexport type RegisterPasskeyParams = {\n name?: string;\n};\n\nexport const registerPasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: RegisterPasskeyParams) => {\n // Step 1: Get registration options from server\n const optionsRes = await client.api.user.passkeys.register.options.$post();\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn registration in browser\n const registrationResponse = await startRegistration({\n optionsJSON: options,\n });\n\n // Step 3: Send registration response to server\n const verifyRes = await client.api.user.passkeys.register.verify.$post({\n json: {\n response: registrationResponse,\n name: params.name,\n },\n });\n return jsonOk(verifyRes);\n },\n});\n\n/**\n * Delete a passkey\n */\nexport type DeletePasskeyParams = {\n id: string;\n};\n\nexport const deletePasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: DeletePasskeyParams) => {\n const res = await client.api.user.passkeys[':id'].$delete({\n param: { id: params.id },\n });\n return jsonOk(res);\n },\n});\n\n/**\n * Rename a passkey\n */\nexport type RenamePasskeyParams = {\n id: string;\n name: string;\n};\n\nexport const renamePasskeyMutationOptions = mutationOptions({\n mutationFn: async (params: RenamePasskeyParams) => {\n const res = await client.api.user.passkeys[':id'].$patch({\n param: { id: params.id },\n json: { name: params.name },\n });\n return jsonOk(res);\n },\n});\n\n/**\n * Authenticate with passkey (supports both passwordless\n * and 2FA)\n *\n * The server automatically determines the mode based on\n * session state:\n * - If pending2FAUser session exists: 2FA mode\n * - Otherwise: Passwordless mode (discoverable\n * credentials)\n */\nexport const authenticateWithPasskeyMutationOptions = mutationOptions({\n mutationFn: async () => {\n // Step 1: Get authentication options from server\n const optionsRes = await client.api.auth.passkey.options.$post();\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn authentication in browser\n const authenticationResponse = await startAuthentication({\n optionsJSON: options,\n });\n\n // Step 3: Send authentication response to server\n const verifyRes = await client.api.auth.passkey.verify.$post({\n json: {\n response: {\n ...authenticationResponse,\n clientExtensionResults: {\n ...authenticationResponse.clientExtensionResults,\n },\n },\n },\n });\n return jsonOk(verifyRes);\n },\n});\n\n/**\n * Start conditional passkey authentication (browser\n * autofill / Conditional UI)\n *\n * This enables the browser to suggest passkeys in the\n * autofill dropdown when the user focuses on an input\n * with autocomplete=\"username webauthn\".\n *\n * Should be called on page load and runs in the background\n * until:\n * - User selects a passkey from the autofill dropdown\n * - The AbortController is aborted (e.g., on component\n * unmount)\n *\n * @param onSuccess - Callback when passkey authentication\n * succeeds\n * @param abortSignal - AbortSignal to cancel the\n * conditional authentication\n */\nexport const startConditionalPasskeyAuth = async (\n onSuccess: (data: PasskeyAuthenticationResponse) => void,\n abortSignal: AbortSignal,\n): Promise<void> => {\n try {\n // Step 1: Get authentication options from server\n const optionsRes = await client.api.auth.passkey.options.$post(\n {},\n { init: { signal: abortSignal } },\n );\n const { options } = await jsonOk(optionsRes);\n\n // Step 2: Start WebAuthn with conditional mediation\n const authenticationResponse = await startAuthentication({\n optionsJSON: options,\n useBrowserAutofill: true,\n });\n\n // Step 3: Send authentication response to server\n const verifyRes = await client.api.auth.passkey.verify.$post(\n {\n json: {\n response: {\n ...authenticationResponse,\n clientExtensionResults: {\n ...authenticationResponse.clientExtensionResults,\n },\n },\n },\n },\n { init: { signal: abortSignal } },\n );\n const data = await jsonOk(verifyRes);\n onSuccess(data);\n } catch (error) {\n // AbortError is expected when component unmounts\n if (error instanceof Error && error.name !== 'AbortError') {\n // Non-abort error - could be handled here in the future\n }\n }\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12],"mappings":"uGAMA,SAAgB,EAAwB,EAAQ,CAC5C,IAAM,EAAQ,IAAI,WAAW,CAAM,EAC/B,EAAM,GACV,IAAK,IAAM,KAAY,EACnB,GAAO,OAAO,aAAa,CAAQ,EAGvC,OADqB,KAAK,CACR,CAAC,CAAC,QAAQ,MAAO,GAAG,CAAC,CAAC,QAAQ,MAAO,GAAG,CAAC,CAAC,QAAQ,KAAM,EAAE,CAChF,CCPA,SAAgB,EAAwB,EAAiB,CAErD,IAAM,EAAS,EAAgB,QAAQ,KAAM,GAAG,CAAC,CAAC,QAAQ,KAAM,GAAG,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AE,KAAM,CAAE,OAAQ,CAAY,CAAE,CAClC,CACmC,CACrB,CAChB,OAAS,EAAO,CAEV,aAAiB,OAAS,EAAM,IAGtC,CACF"}
@@ -0,0 +1,2 @@
1
+ import{J as e,U as t,Z as n,i as r,q as i,s as a}from"./createLucideIcon-BPpAIXR_.js";import{Dn as o,Yn as s,i as c,n as l,r as u,sr as d}from"./config-v3-oy_ef.js";import{t as f}from"./useMutation-ZLFeJg75.js";import{t as p}from"./useQuery-BvMz34BW.js";import{t as m}from"./link-BN90emXr.js";import{t as h}from"./fingerprint-pattern-DP62Vk8x.js";import{F as g,N as _,R as v,S as y,j as b,m as x,z as S}from"./index-gliHKncz.js";import{t as C}from"./auth-page-header-CIs08f5Y.js";import{t as w}from"./alert-leqyvHOp.js";import{t as T}from"./auth-layout-CoeqNhTT.js";import{t as E}from"./promise-OpBtq8tG.js";import{n as D,t as O}from"./auth-footer-Cz5ivsDc.js";import{t as k}from"./passkey-error-ZqqPQUta.js";import{t as A}from"./passkey-B2Blw47e.js";var j=n(e()),M=s({queryKey:l.pendingSecondFactorMethods(),queryFn:async()=>c(await u.api.auth[`2fa`].methods.$get()),retry:!1}),N=i();function P(){let{t:e}=r(),n=o(),i=d(),s=x.useSearch(),[c,l]=(0,j.useState)(null),u=(0,j.useRef)(!1),P=p({...M,enabled:c!==null}).data?.methods.includes(`totp`)??!1,F=t=>{switch(t){case`unsupported`:return e(`verifyPasskey.error.unsupported`);case`not_allowed`:return e(`verifyPasskey.error.notAllowed`);case`expired`:return e(`verifyPasskey.error.expired`);case`user_mismatch`:return e(`verifyPasskey.error.userMismatch`);case`verification_failed`:return e(`verifyPasskey.error.failed`)}},I=f({...A,onSuccess:async e=>{e.user&&(i.setQueryData(y.queryKey,{user:e.user}),await E(),g(s)?window.location.href=b(s):n.navigate({to:`/profile`}))},onError:async e=>{let t=k(e);l({message:F(t),reason:t})},onSettled:()=>{i.invalidateQueries({queryKey:y.queryKey})}});return(0,j.useEffect)(()=>{u.current||(u.current=!0,I.mutate())},[I]),(0,N.jsxs)(T,{children:[(0,N.jsx)(C,{align:`center`,subtitle:e(`verifyPasskey.subtitle`),title:e(`verifyPasskey.title`)}),(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg`,children:[(0,N.jsx)(`div`,{className:`flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted`,children:(0,N.jsx)(h,{"aria-hidden":!0,className:`size-tinyrack-2xl text-tinyrack-text-muted`})}),I.isPending&&(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-sm`,children:[(0,N.jsx)(t,{uiSize:`md`}),(0,N.jsx)(`p`,{className:`text-center text-tinyrack-sm text-tinyrack-text-muted`,children:e(`verifyPasskey.waiting`)})]}),c&&(0,N.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-tinyrack-md`,children:[(0,N.jsx)(w,{className:`w-full`,icon:v,type:`error`,children:c.message}),P&&(0,N.jsx)(S,{className:`w-full`,intent:`primary`,render:(0,N.jsx)(m,{search:_(s),to:`/verify/totp`}),uiSize:`lg`,children:e(`verifyPasskey.useTotp`)}),(0,N.jsx)(a,{appearance:P?`outline`:`solid`,className:`w-full`,intent:P?`neutral`:`primary`,onClick:()=>{l(null),I.mutate()},type:`button`,uiSize:`lg`,children:e(`verifyPasskey.retry`)})]})]}),(0,N.jsx)(O,{children:(0,N.jsx)(D,{link:(0,N.jsx)(m,{search:s,to:`/login`,children:e(`verifyPasskey.backToLogin`)})})})]})}export{P as component};
2
+ //# sourceMappingURL=passkey-CEx1VZ5R.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"passkey-CynCz1Dt.js","names":["useMutation","useQuery","useQueryClient","Link","useRouter","TRButton","TRLinkButton","TRSpinner","CircleAlertIcon","FingerprintIcon","useEffect","useRef","useState","useTranslation","AuthFooter","AuthFooterLink","AuthPageHeader","Alert","AuthLayout","buildAuthenticatedAuthorizeUrl","extractOAuthParams","isOAuthFlow","classifyPasskeyError","tick","authenticateWithPasskeyMutationOptions","getPendingSecondFactorMethodsQueryOptions","getSessionQueryOptions","Route","VerifyPasskey","t","router","queryClient","search","useSearch","error","setError","message","reason","PasskeyErrorReason","hasStarted","pendingMethodsQuery","enabled","canUseTotp","data","methods","includes","getErrorMessage","verifyMutation","onSuccess","user","setQueryData","queryKey","window","location","href","navigate","to","onError","err","onSettled","invalidateQueries","current","mutate","isPending","component"],"sources":["../../../frontend/src/queries/second-factor.ts","../../../frontend/src/routes/verify/passkey/index.tsx?tsr-split=component"],"sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport type { InferResponseType } from 'hono/client';\nimport { client, jsonOk } from '#frontend/libs/api.ts';\nimport { queryKeys } from './keys';\n\nexport type PendingSecondFactorMethodsResponse = InferResponseType<\n (typeof client.api.auth)['2fa']['methods']['$get'],\n 200\n>;\n\nexport const getPendingSecondFactorMethodsQueryOptions = queryOptions({\n queryKey: queryKeys.pendingSecondFactorMethods(),\n queryFn: async () => {\n const res = await client.api.auth['2fa'].methods.$get();\n return jsonOk(res);\n },\n retry: false,\n});\n","import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { createFileRoute, Link, useRouter } from '@tanstack/react-router';\nimport { TRButton } from '@tinyrack/ui/components/button';\nimport { TRLinkButton } from '@tinyrack/ui/components/link-button';\nimport { TRSpinner } from '@tinyrack/ui/components/spinner';\nimport { CircleAlertIcon, FingerprintIcon } from 'lucide-react';\nimport { useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n AuthFooter,\n AuthFooterLink,\n} from '#frontend/components/auth/auth-footer.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { Alert } from '#frontend/components/ui/alert.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n isOAuthFlow,\n OAuthSearchSchema,\n} from '#frontend/libs/oauth-search.ts';\nimport {\n classifyPasskeyError,\n type PasskeyErrorReason,\n} from '#frontend/libs/passkey-error.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { authenticateWithPasskeyMutationOptions } from '#frontend/queries/passkey.ts';\nimport { getPendingSecondFactorMethodsQueryOptions } from '#frontend/queries/second-factor.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema;\n\nexport const Route = createFileRoute('/verify/passkey/')({\n component: VerifyPasskey,\n validateSearch: SearchSchema,\n});\n\nfunction VerifyPasskey() {\n const { t } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n const [error, setError] = useState<{\n message: string;\n reason: PasskeyErrorReason;\n } | null>(null);\n const hasStarted = useRef(false);\n const pendingMethodsQuery = useQuery({\n ...getPendingSecondFactorMethodsQueryOptions,\n enabled: error !== null,\n });\n const canUseTotp =\n pendingMethodsQuery.data?.methods.includes('totp') ?? false;\n\n const getErrorMessage = (reason: PasskeyErrorReason) => {\n switch (reason) {\n case 'unsupported':\n return t('verifyPasskey.error.unsupported');\n case 'not_allowed':\n return t('verifyPasskey.error.notAllowed');\n case 'expired':\n return t('verifyPasskey.error.expired');\n case 'user_mismatch':\n return t('verifyPasskey.error.userMismatch');\n case 'verification_failed':\n return t('verifyPasskey.error.failed');\n }\n };\n\n const verifyMutation = useMutation({\n ...authenticateWithPasskeyMutationOptions,\n onSuccess: async (data) => {\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, {\n user: data.user,\n });\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href = buildAuthenticatedAuthorizeUrl(search);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n },\n onError: async (err) => {\n const reason = classifyPasskeyError(err);\n setError({\n message: getErrorMessage(reason),\n reason,\n });\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n // Auto-start passkey authentication on mount (with guard for StrictMode)\n useEffect(() => {\n if (hasStarted.current) return;\n hasStarted.current = true;\n verifyMutation.mutate();\n }, [verifyMutation]);\n\n return (\n <AuthLayout>\n {/*\n Centred: this screen has no form to scan, only a device prompt to wait\n on, so the eye has nothing to follow down a left edge.\n */}\n <AuthPageHeader\n align=\"center\"\n subtitle={t('verifyPasskey.subtitle')}\n title={t('verifyPasskey.title')}\n />\n\n <div className=\"flex flex-col items-center gap-tinyrack-lg\">\n <div className=\"flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted\">\n <FingerprintIcon\n aria-hidden\n className=\"size-tinyrack-2xl text-tinyrack-text-muted\"\n />\n </div>\n\n {verifyMutation.isPending && (\n <div className=\"flex flex-col items-center gap-tinyrack-sm\">\n <TRSpinner uiSize=\"md\" />\n <p className=\"text-center text-tinyrack-sm text-tinyrack-text-muted\">\n {t('verifyPasskey.waiting')}\n </p>\n </div>\n )}\n\n {error && (\n <div className=\"flex w-full flex-col items-center gap-tinyrack-md\">\n <Alert className=\"w-full\" icon={CircleAlertIcon} type=\"error\">\n {error.message}\n </Alert>\n {canUseTotp && (\n <TRLinkButton\n className=\"w-full\"\n intent=\"primary\"\n render={\n <Link search={extractOAuthParams(search)} to=\"/verify/totp\" />\n }\n uiSize=\"lg\"\n >\n {t('verifyPasskey.useTotp')}\n </TRLinkButton>\n )}\n <TRButton\n appearance={canUseTotp ? 'outline' : 'solid'}\n className=\"w-full\"\n intent={canUseTotp ? 'neutral' : 'primary'}\n onClick={() => {\n setError(null);\n verifyMutation.mutate();\n }}\n type=\"button\"\n uiSize=\"lg\"\n >\n {t('verifyPasskey.retry')}\n </TRButton>\n </div>\n )}\n </div>\n\n <AuthFooter>\n <AuthFooterLink\n link={\n <Link search={search} to=\"/login\">\n {t('verifyPasskey.backToLogin')}\n </Link>\n }\n />\n </AuthFooter>\n </AuthLayout>\n );\n}\n"],"mappings":"6tBAUA,EAAA,EAAA,4GAOA,CAAA,QCoBA,SAAS4B,GAAgB,CACvB,GA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AAA,CAAC,EAAD,CAAcG,SAAQ,GAAG,kBACtBH,EAAE,2BAA2B,CAC1B,CAAA,CACP,CAAA,CAEO,CAAA,CACF,CAAA,CAAA,CAEhB"}
1
+ {"version":3,"file":"passkey-CEx1VZ5R.js","names":["useMutation","useQuery","useQueryClient","Link","useRouter","TRButton","TRLinkButton","TRSpinner","CircleAlertIcon","FingerprintIcon","useEffect","useRef","useState","useTranslation","AuthFooter","AuthFooterLink","AuthPageHeader","Alert","AuthLayout","buildAuthenticatedAuthorizeUrl","extractOAuthParams","isOAuthFlow","classifyPasskeyError","tick","authenticateWithPasskeyMutationOptions","getPendingSecondFactorMethodsQueryOptions","getSessionQueryOptions","Route","VerifyPasskey","t","router","queryClient","search","useSearch","error","setError","message","reason","PasskeyErrorReason","hasStarted","pendingMethodsQuery","enabled","canUseTotp","data","methods","includes","getErrorMessage","verifyMutation","onSuccess","user","setQueryData","queryKey","window","location","href","navigate","to","onError","err","onSettled","invalidateQueries","current","mutate","isPending","component"],"sources":["../../../frontend/src/queries/second-factor.ts","../../../frontend/src/routes/verify/passkey/index.tsx?tsr-split=component"],"sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport type { InferResponseType } from 'hono/client';\nimport { client, jsonOk } from '#frontend/libs/api.ts';\nimport { queryKeys } from './keys';\n\nexport type PendingSecondFactorMethodsResponse = InferResponseType<\n (typeof client.api.auth)['2fa']['methods']['$get'],\n 200\n>;\n\nexport const getPendingSecondFactorMethodsQueryOptions = queryOptions({\n queryKey: queryKeys.pendingSecondFactorMethods(),\n queryFn: async () => {\n const res = await client.api.auth['2fa'].methods.$get();\n return jsonOk(res);\n },\n retry: false,\n});\n","import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { createFileRoute, Link, useRouter } from '@tanstack/react-router';\nimport { TRButton } from '@tinyrack/ui/components/button';\nimport { TRLinkButton } from '@tinyrack/ui/components/link-button';\nimport { TRSpinner } from '@tinyrack/ui/components/spinner';\nimport { CircleAlertIcon, FingerprintIcon } from 'lucide-react';\nimport { useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n AuthFooter,\n AuthFooterLink,\n} from '#frontend/components/auth/auth-footer.tsx';\nimport { AuthPageHeader } from '#frontend/components/auth/auth-page-header.tsx';\nimport { Alert } from '#frontend/components/ui/alert.tsx';\nimport { AuthLayout } from '#frontend/features/layout/auth-layout.tsx';\nimport {\n buildAuthenticatedAuthorizeUrl,\n extractOAuthParams,\n isOAuthFlow,\n OAuthSearchSchema,\n} from '#frontend/libs/oauth-search.ts';\nimport {\n classifyPasskeyError,\n type PasskeyErrorReason,\n} from '#frontend/libs/passkey-error.ts';\nimport { tick } from '#frontend/libs/promise.ts';\nimport { authenticateWithPasskeyMutationOptions } from '#frontend/queries/passkey.ts';\nimport { getPendingSecondFactorMethodsQueryOptions } from '#frontend/queries/second-factor.ts';\nimport { getSessionQueryOptions } from '#frontend/queries/session.ts';\n\nconst SearchSchema = OAuthSearchSchema;\n\nexport const Route = createFileRoute('/verify/passkey/')({\n component: VerifyPasskey,\n validateSearch: SearchSchema,\n});\n\nfunction VerifyPasskey() {\n const { t } = useTranslation();\n const router = useRouter();\n const queryClient = useQueryClient();\n const search = Route.useSearch();\n const [error, setError] = useState<{\n message: string;\n reason: PasskeyErrorReason;\n } | null>(null);\n const hasStarted = useRef(false);\n const pendingMethodsQuery = useQuery({\n ...getPendingSecondFactorMethodsQueryOptions,\n enabled: error !== null,\n });\n const canUseTotp =\n pendingMethodsQuery.data?.methods.includes('totp') ?? false;\n\n const getErrorMessage = (reason: PasskeyErrorReason) => {\n switch (reason) {\n case 'unsupported':\n return t('verifyPasskey.error.unsupported');\n case 'not_allowed':\n return t('verifyPasskey.error.notAllowed');\n case 'expired':\n return t('verifyPasskey.error.expired');\n case 'user_mismatch':\n return t('verifyPasskey.error.userMismatch');\n case 'verification_failed':\n return t('verifyPasskey.error.failed');\n }\n };\n\n const verifyMutation = useMutation({\n ...authenticateWithPasskeyMutationOptions,\n onSuccess: async (data) => {\n if (data.user) {\n queryClient.setQueryData(getSessionQueryOptions.queryKey, {\n user: data.user,\n });\n await tick();\n\n if (isOAuthFlow(search)) {\n window.location.href = buildAuthenticatedAuthorizeUrl(search);\n } else {\n router.navigate({ to: '/profile' });\n }\n }\n },\n onError: async (err) => {\n const reason = classifyPasskeyError(err);\n setError({\n message: getErrorMessage(reason),\n reason,\n });\n },\n onSettled: () => {\n queryClient.invalidateQueries({\n queryKey: getSessionQueryOptions.queryKey,\n });\n },\n });\n\n // Auto-start passkey authentication on mount (with guard for StrictMode)\n useEffect(() => {\n if (hasStarted.current) return;\n hasStarted.current = true;\n verifyMutation.mutate();\n }, [verifyMutation]);\n\n return (\n <AuthLayout>\n {/*\n Centred: this screen has no form to scan, only a device prompt to wait\n on, so the eye has nothing to follow down a left edge.\n */}\n <AuthPageHeader\n align=\"center\"\n subtitle={t('verifyPasskey.subtitle')}\n title={t('verifyPasskey.title')}\n />\n\n <div className=\"flex flex-col items-center gap-tinyrack-lg\">\n <div className=\"flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted\">\n <FingerprintIcon\n aria-hidden\n className=\"size-tinyrack-2xl text-tinyrack-text-muted\"\n />\n </div>\n\n {verifyMutation.isPending && (\n <div className=\"flex flex-col items-center gap-tinyrack-sm\">\n <TRSpinner uiSize=\"md\" />\n <p className=\"text-center text-tinyrack-sm text-tinyrack-text-muted\">\n {t('verifyPasskey.waiting')}\n </p>\n </div>\n )}\n\n {error && (\n <div className=\"flex w-full flex-col items-center gap-tinyrack-md\">\n <Alert className=\"w-full\" icon={CircleAlertIcon} type=\"error\">\n {error.message}\n </Alert>\n {canUseTotp && (\n <TRLinkButton\n className=\"w-full\"\n intent=\"primary\"\n render={\n <Link search={extractOAuthParams(search)} to=\"/verify/totp\" />\n }\n uiSize=\"lg\"\n >\n {t('verifyPasskey.useTotp')}\n </TRLinkButton>\n )}\n <TRButton\n appearance={canUseTotp ? 'outline' : 'solid'}\n className=\"w-full\"\n intent={canUseTotp ? 'neutral' : 'primary'}\n onClick={() => {\n setError(null);\n verifyMutation.mutate();\n }}\n type=\"button\"\n uiSize=\"lg\"\n >\n {t('verifyPasskey.retry')}\n </TRButton>\n </div>\n )}\n </div>\n\n <AuthFooter>\n <AuthFooterLink\n link={\n <Link search={search} to=\"/login\">\n {t('verifyPasskey.backToLogin')}\n </Link>\n }\n />\n </AuthFooter>\n </AuthLayout>\n );\n}\n"],"mappings":"4vBAUA,EAAA,EAAA,4GAOA,CAAA,QCoBA,SAAS4B,GAAgB,CACvB,GAAM,CAAEC,KAAMhB,EAAe,EACvBiB,EAAS1B,EAAU,EACnB2B,EAAc7B,EAAe,EAC7B8B,EAASL,EAAMM,UAAU,EACzB,CAACC,EAAOC,IAAAA,EAAAA,EAAAA,SAAAA,CAGJ,IAAI,EACRI,GAAAA,EAAAA,EAAAA,OAAAA,CAAoB,EAAK,EAKzBG,EAJsBzC,EAAS,CACnC,GAAGwB,EACHgB,QAASP,IAAU,IACrB,CAEEM,CAAAA,CAAoBG,MAAMC,QAAQC,SAAS,MAAM,GAAK,GAElDC,EAAmBT,GAA+B,CACtD,OAAQA,EAAR,CACE,IAAK,cACH,OAAOR,EAAE,iCAAiC,EAC5C,IAAK,cACH,OAAOA,EAAE,gCAAgC,EAC3C,IAAK,UACH,OAAOA,EAAE,6BAA6B,EACxC,IAAK,gBACH,OAAOA,EAAE,kCAAkC,EAC7C,IAAK,sBACH,OAAOA,EAAE,4BAA4B,CACzC,CACF,EAEMkB,EAAiB/C,EAAY,CACjC,GAAGwB,EACHwB,UAAW,KAAOL,IAAS,CACrBA,EAAKM,OACPlB,EAAYmB,aAAaxB,EAAuByB,SAAU,CACxDF,KAAMN,EAAKM,IACb,CAAC,EACD,MAAM1B,EAAK,EAEPF,EAAYW,CAAM,EACpBoB,OAAOC,SAASC,KAAOnC,EAA+Ba,CAAM,EAE5DF,EAAOyB,SAAS,CAAEC,GAAI,UAAW,CAAC,EAGxC,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AE7D,OAAO,cAENH,EAAE,uBAAuB,CACd,CAAA,GAEhB,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,WAAYa,EAAa,UAAY,QACrC,UAAU,SACV,OAAQA,EAAa,UAAY,UACjC,YAAe,CACbP,EAAS,IAAI,EACbY,EAAee,OAAO,CACxB,EACA,KAAK,SACL,OAAO,cAENjC,EAAE,qBAAqB,CAChB,CAAA,CACP,GAEJ,KAEL,EAAA,EAAA,IAAA,CAAC,EAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,MACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAcG,SAAQ,GAAG,kBACtBH,EAAE,2BAA2B,CAC1B,CAAA,CACP,CAAA,CAEO,CAAA,CACF,CAAA,CAAA,CAEhB"}
@@ -0,0 +1,2 @@
1
+ import{J as e,Z as t,i as n,n as r,q as i,s as a,t as o}from"./createLucideIcon-BPpAIXR_.js";import{Dn as s,sr as c,t as l}from"./config-v3-oy_ef.js";import{t as u}from"./useMutation-ZLFeJg75.js";import{tt as d}from"./shell-header-bar-C9AB5lT-.js";import{t as f}from"./link-BN90emXr.js";import{t as p}from"./auth-field-HwxENJnB.js";import{t as m}from"./fingerprint-pattern-DP62Vk8x.js";import{t as h}from"./shield-check-D_p8H0ni.js";import{c as g,o as _}from"./zod-C87S6Tec.js";import{F as v,N as y,R as b,S as x,j as S,u as C,z as w}from"./index-gliHKncz.js";import{t as T}from"./auth-page-header-CIs08f5Y.js";import{t as E}from"./alert-leqyvHOp.js";import{t as D}from"./auth-layout-CoeqNhTT.js";import{t as O}from"./promise-OpBtq8tG.js";import{n as k,t as A}from"./auth-footer-Cz5ivsDc.js";import{t as j}from"./passkey-error-ZqqPQUta.js";import{i as M}from"./passkey-B2Blw47e.js";import{r as N,t as P}from"./standard-schema-e8gtSzGE.js";var F=o(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),I=t(e()),L=i();function R(){let{t:e}=n(),t=s(),i=c(),o=C.useSearch(),{data:R}=d(l),[z,B]=(0,I.useState)(o.passkey_name?`registering`:`form`),[V,H]=(0,I.useState)(``),U=(0,I.useRef)(!1),W=R.auth.password.enabled&&R.auth.password.two_factor.enrollment_required&&R.auth.password.totp.enabled,{register:G,handleSubmit:K,formState:{errors:q}}=N({defaultValues:{name:``},resolver:P((0,I.useMemo)(()=>_({name:g().max(100,e(`validation.passkey.name.max`))}),[e]))}),J=u({...M,onSuccess:async e=>{e.second_factor_setup_completed&&e.user?(i.setQueryData(x.queryKey,{user:e.user}),await O(),v(o)?window.location.href=S(o):t.navigate({to:`/profile`})):(i.invalidateQueries({queryKey:x.queryKey}),t.navigate({to:`/profile`}))},onError:t=>{switch(B(`error`),j(t)){case`unsupported`:H(e(`setupPasskey.error.unsupported`));return;case`not_allowed`:H(e(`setupPasskey.error.notAllowed`));return;case`expired`:H(e(`setupPasskey.error.expired`));return;case`user_mismatch`:case`verification_failed`:H(e(`setupPasskey.error.failed`));return}},onSettled:()=>{i.invalidateQueries({queryKey:x.queryKey})}});return(0,I.useEffect)(()=>{o.passkey_name&&!U.current&&(U.current=!0,J.mutate({name:o.passkey_name}))},[J,o.passkey_name]),z===`registering`?(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg py-tinyrack-xl`,children:[(0,L.jsx)(m,{"aria-hidden":!0,className:`size-tinyrack-3xl animate-pulse text-tinyrack-primary`}),(0,L.jsx)(r,{align:`center`,as:`p`,color:`muted`,variant:`body`,children:e(`setupPasskey.waiting`)})]})]}):z===`error`?(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsx)(E,{icon:b,type:`error`,children:V}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-sm`,children:[W&&(0,L.jsxs)(w,{className:`w-full gap-tinyrack-sm`,intent:`primary`,render:(0,L.jsx)(f,{search:y(o),to:`/setup/totp`}),uiSize:`lg`,children:[(0,L.jsx)(h,{"aria-hidden":!0,className:`size-tinyrack-xl`}),e(`setupPasskey.useTotp`)]}),(0,L.jsx)(a,{appearance:W?`outline`:`solid`,className:`w-full`,intent:W?`neutral`:`primary`,onClick:()=>{o.passkey_name?(B(`registering`),H(``),J.mutate({name:o.passkey_name})):B(`form`)},type:`button`,uiSize:`lg`,children:e(`setupPasskey.retry`)})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(f,{search:y(o),to:`/login`,children:e(`setupPasskey.backToLogin`)})})})]}):(0,L.jsxs)(D,{children:[(0,L.jsx)(T,{subtitle:e(`setupPasskey.subtitle`),title:e(`setupPasskey.title`)}),(0,L.jsx)(E,{icon:h,type:`info`,children:e(`setupPasskey.required`)}),(0,L.jsx)(r,{align:`center`,as:`p`,color:`muted`,variant:`bodySm`,children:e(`setupPasskey.description`)}),(0,L.jsxs)(`form`,{className:`flex flex-col gap-tinyrack-lg`,onSubmit:K(e=>{B(`registering`),H(``),J.mutate({name:e.name||void 0})}),children:[(0,L.jsx)(p,{error:q.name,hint:e(`setupPasskey.name.hint`),icon:F,id:`passkey-name`,label:e(`setupPasskey.name.label`),placeholder:e(`setupPasskey.name.placeholder`),...G(`name`),type:`text`}),(0,L.jsx)(a,{className:`w-full`,intent:`primary`,loading:J.isPending,loadingLabel:e(`setupPasskey.registering`),type:`submit`,uiSize:`lg`,children:e(`setupPasskey.continue`)})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(f,{search:y(o),to:`/login`,children:e(`setupPasskey.backToLogin`)})})})]})}export{R as component};
2
+ //# sourceMappingURL=passkey-CU8x9J2w.js.map