@tinyrack/issuary-server 0.30.0 → 0.32.1

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 (478) hide show
  1. package/dist/entities/auth-budget.entity.d.ts +20 -0
  2. package/dist/entities/auth-budget.entity.d.ts.map +1 -0
  3. package/dist/entities/auth-budget.entity.js +11 -0
  4. package/dist/entities/auth-budget.entity.js.map +1 -0
  5. package/dist/entities/browser-session.entity.d.ts +32 -0
  6. package/dist/entities/browser-session.entity.d.ts.map +1 -0
  7. package/dist/entities/browser-session.entity.js +12 -0
  8. package/dist/entities/browser-session.entity.js.map +1 -0
  9. package/dist/entities/email-verification.entity.d.ts +18 -0
  10. package/dist/entities/email-verification.entity.d.ts.map +1 -1
  11. package/dist/entities/email-verification.entity.js +2 -0
  12. package/dist/entities/email-verification.entity.js.map +1 -1
  13. package/dist/entities/oauth-client.entity.d.ts +120 -0
  14. package/dist/entities/oauth-client.entity.d.ts.map +1 -1
  15. package/dist/entities/oauth-code.entity.d.ts +120 -0
  16. package/dist/entities/oauth-code.entity.d.ts.map +1 -1
  17. package/dist/entities/oauth-code.entity.js +3 -0
  18. package/dist/entities/oauth-code.entity.js.map +1 -1
  19. package/dist/entities/oauth-device-code.entity.d.ts +120 -0
  20. package/dist/entities/oauth-device-code.entity.d.ts.map +1 -1
  21. package/dist/entities/oauth-device-code.entity.js +3 -0
  22. package/dist/entities/oauth-device-code.entity.js.map +1 -1
  23. package/dist/entities/oauth-grant.entity.d.ts +52 -0
  24. package/dist/entities/oauth-grant.entity.d.ts.map +1 -0
  25. package/dist/entities/oauth-grant.entity.js +19 -0
  26. package/dist/entities/oauth-grant.entity.js.map +1 -0
  27. package/dist/entities/password-reset.entity.d.ts +18 -0
  28. package/dist/entities/password-reset.entity.d.ts.map +1 -1
  29. package/dist/entities/password-reset.entity.js +2 -0
  30. package/dist/entities/password-reset.entity.js.map +1 -1
  31. package/dist/entities/pending-oauth-registration.entity.d.ts +9 -0
  32. package/dist/entities/pending-oauth-registration.entity.d.ts.map +1 -1
  33. package/dist/entities/pending-oauth-registration.entity.js +1 -0
  34. package/dist/entities/pending-oauth-registration.entity.js.map +1 -1
  35. package/dist/entities/revoked-token.entity.d.ts +120 -0
  36. package/dist/entities/revoked-token.entity.d.ts.map +1 -1
  37. package/dist/entities/terms-content.entity.d.ts +36 -0
  38. package/dist/entities/terms-content.entity.d.ts.map +1 -1
  39. package/dist/entities/terms.entity.d.ts +36 -0
  40. package/dist/entities/terms.entity.d.ts.map +1 -1
  41. package/dist/entities/user-consent.entity.d.ts +120 -0
  42. package/dist/entities/user-consent.entity.d.ts.map +1 -1
  43. package/dist/entities/user-terms-consent.entity.d.ts +36 -0
  44. package/dist/entities/user-terms-consent.entity.d.ts.map +1 -1
  45. package/dist/entities/user-totp-recovery-code.entity.d.ts +36 -0
  46. package/dist/entities/user-totp-recovery-code.entity.d.ts.map +1 -1
  47. package/dist/entities/user-totp.entity.d.ts +36 -0
  48. package/dist/entities/user-totp.entity.d.ts.map +1 -1
  49. package/dist/entities/user-totp.entity.js +1 -0
  50. package/dist/entities/user-totp.entity.js.map +1 -1
  51. package/dist/entities/user.entity.d.ts +36 -0
  52. package/dist/entities/user.entity.d.ts.map +1 -1
  53. package/dist/entities/user.entity.js +3 -0
  54. package/dist/entities/user.entity.js.map +1 -1
  55. package/dist/entrypoints/app.d.ts +438 -424
  56. package/dist/entrypoints/app.d.ts.map +1 -1
  57. package/dist/entrypoints/app.js +78 -6
  58. package/dist/entrypoints/app.js.map +1 -1
  59. package/dist/entrypoints/database/postgres/compiled-functions.d.ts +326 -200
  60. package/dist/entrypoints/database/postgres/compiled-functions.js +1849 -518
  61. package/dist/entrypoints/database/postgres/compiled-functions.js.map +1 -1
  62. package/dist/entrypoints/database/sqlite/compiled-functions.d.ts +326 -200
  63. package/dist/entrypoints/database/sqlite/compiled-functions.js +1849 -518
  64. package/dist/entrypoints/database/sqlite/compiled-functions.js.map +1 -1
  65. package/dist/entrypoints/database/sqlite/sqlite.d.ts.map +1 -1
  66. package/dist/entrypoints/database/sqlite/sqlite.js +1 -0
  67. package/dist/entrypoints/database/sqlite/sqlite.js.map +1 -1
  68. package/dist/entrypoints/scheduler/database.d.ts +3 -1
  69. package/dist/entrypoints/scheduler/database.d.ts.map +1 -1
  70. package/dist/entrypoints/scheduler/database.js +13 -2
  71. package/dist/entrypoints/scheduler/database.js.map +1 -1
  72. package/dist/entrypoints/scheduler/distributed-runner.d.ts +4 -0
  73. package/dist/entrypoints/scheduler/distributed-runner.d.ts.map +1 -1
  74. package/dist/entrypoints/scheduler/distributed-runner.js +26 -1
  75. package/dist/entrypoints/scheduler/distributed-runner.js.map +1 -1
  76. package/dist/lib/config/client.js +1 -1
  77. package/dist/lib/config/client.js.map +1 -1
  78. package/dist/lib/config/email.d.ts +1 -0
  79. package/dist/lib/config/email.d.ts.map +1 -1
  80. package/dist/lib/config/email.js.map +1 -1
  81. package/dist/lib/database/entities.d.ts.map +1 -1
  82. package/dist/lib/database/entities.js +6 -0
  83. package/dist/lib/database/entities.js.map +1 -1
  84. package/dist/lib/openapi.d.ts +2 -0
  85. package/dist/lib/openapi.d.ts.map +1 -1
  86. package/dist/lib/openapi.js +36 -1
  87. package/dist/lib/openapi.js.map +1 -1
  88. package/dist/lib/request-ip.d.ts +4 -0
  89. package/dist/lib/request-ip.d.ts.map +1 -0
  90. package/dist/lib/request-ip.js +39 -0
  91. package/dist/lib/request-ip.js.map +1 -0
  92. package/dist/middleware/auth-budget.d.ts +3 -0
  93. package/dist/middleware/auth-budget.d.ts.map +1 -0
  94. package/dist/middleware/auth-budget.js +80 -0
  95. package/dist/middleware/auth-budget.js.map +1 -0
  96. package/dist/middleware/session.d.ts +23 -5
  97. package/dist/middleware/session.d.ts.map +1 -1
  98. package/dist/middleware/session.js +152 -12
  99. package/dist/middleware/session.js.map +1 -1
  100. package/dist/middleware/strict-input.d.ts +4 -0
  101. package/dist/middleware/strict-input.d.ts.map +1 -0
  102. package/dist/middleware/strict-input.js +144 -0
  103. package/dist/middleware/strict-input.js.map +1 -0
  104. package/dist/migrations/postgres/Migration20260910120000_api_security.d.ts +6 -0
  105. package/dist/migrations/postgres/Migration20260910120000_api_security.d.ts.map +1 -0
  106. package/dist/migrations/postgres/Migration20260910120000_api_security.js +20 -0
  107. package/dist/migrations/postgres/Migration20260910120000_api_security.js.map +1 -0
  108. package/dist/migrations/postgres/Migration20260910160000_security_followup.d.ts +6 -0
  109. package/dist/migrations/postgres/Migration20260910160000_security_followup.d.ts.map +1 -0
  110. package/dist/migrations/postgres/Migration20260910160000_security_followup.js +23 -0
  111. package/dist/migrations/postgres/Migration20260910160000_security_followup.js.map +1 -0
  112. package/dist/migrations/postgres/Migration20260910200000_authentication_epoch.d.ts +6 -0
  113. package/dist/migrations/postgres/Migration20260910200000_authentication_epoch.d.ts.map +1 -0
  114. package/dist/migrations/postgres/Migration20260910200000_authentication_epoch.js +28 -0
  115. package/dist/migrations/postgres/Migration20260910200000_authentication_epoch.js.map +1 -0
  116. package/dist/migrations/postgres/Migration20260910220000_flow_revocation.d.ts +6 -0
  117. package/dist/migrations/postgres/Migration20260910220000_flow_revocation.d.ts.map +1 -0
  118. package/dist/migrations/postgres/Migration20260910220000_flow_revocation.js +19 -0
  119. package/dist/migrations/postgres/Migration20260910220000_flow_revocation.js.map +1 -0
  120. package/dist/migrations/postgres/index.d.ts.map +1 -1
  121. package/dist/migrations/postgres/index.js +8 -0
  122. package/dist/migrations/postgres/index.js.map +1 -1
  123. package/dist/migrations/sqlite/Migration20260910120000_api_security.d.ts +6 -0
  124. package/dist/migrations/sqlite/Migration20260910120000_api_security.d.ts.map +1 -0
  125. package/dist/migrations/sqlite/Migration20260910120000_api_security.js +20 -0
  126. package/dist/migrations/sqlite/Migration20260910120000_api_security.js.map +1 -0
  127. package/dist/migrations/sqlite/Migration20260910160000_security_followup.d.ts +6 -0
  128. package/dist/migrations/sqlite/Migration20260910160000_security_followup.d.ts.map +1 -0
  129. package/dist/migrations/sqlite/Migration20260910160000_security_followup.js +23 -0
  130. package/dist/migrations/sqlite/Migration20260910160000_security_followup.js.map +1 -0
  131. package/dist/migrations/sqlite/Migration20260910200000_authentication_epoch.d.ts +8 -0
  132. package/dist/migrations/sqlite/Migration20260910200000_authentication_epoch.d.ts.map +1 -0
  133. package/dist/migrations/sqlite/Migration20260910200000_authentication_epoch.js +72 -0
  134. package/dist/migrations/sqlite/Migration20260910200000_authentication_epoch.js.map +1 -0
  135. package/dist/migrations/sqlite/Migration20260910220000_flow_revocation.d.ts +6 -0
  136. package/dist/migrations/sqlite/Migration20260910220000_flow_revocation.d.ts.map +1 -0
  137. package/dist/migrations/sqlite/Migration20260910220000_flow_revocation.js +19 -0
  138. package/dist/migrations/sqlite/Migration20260910220000_flow_revocation.js.map +1 -0
  139. package/dist/migrations/sqlite/index.d.ts.map +1 -1
  140. package/dist/migrations/sqlite/index.js +8 -0
  141. package/dist/migrations/sqlite/index.js.map +1 -1
  142. package/dist/repositories/email-verification.repository.d.ts +1 -0
  143. package/dist/repositories/email-verification.repository.d.ts.map +1 -1
  144. package/dist/repositories/email-verification.repository.js +8 -17
  145. package/dist/repositories/email-verification.repository.js.map +1 -1
  146. package/dist/repositories/oauth-code.repository.d.ts +2 -0
  147. package/dist/repositories/oauth-code.repository.d.ts.map +1 -1
  148. package/dist/repositories/oauth-code.repository.js +8 -0
  149. package/dist/repositories/oauth-code.repository.js.map +1 -1
  150. package/dist/repositories/oauth-device-code.repository.d.ts +3 -0
  151. package/dist/repositories/oauth-device-code.repository.d.ts.map +1 -1
  152. package/dist/repositories/oauth-device-code.repository.js +64 -29
  153. package/dist/repositories/oauth-device-code.repository.js.map +1 -1
  154. package/dist/repositories/password-reset.repository.d.ts +1 -0
  155. package/dist/repositories/password-reset.repository.d.ts.map +1 -1
  156. package/dist/repositories/password-reset.repository.js +6 -19
  157. package/dist/repositories/password-reset.repository.js.map +1 -1
  158. package/dist/repositories/pending-oauth-registration.repository.d.ts +2 -0
  159. package/dist/repositories/pending-oauth-registration.repository.d.ts.map +1 -1
  160. package/dist/repositories/pending-oauth-registration.repository.js +16 -2
  161. package/dist/repositories/pending-oauth-registration.repository.js.map +1 -1
  162. package/dist/repositories/terms.repository.d.ts.map +1 -1
  163. package/dist/repositories/terms.repository.js +1 -0
  164. package/dist/repositories/terms.repository.js.map +1 -1
  165. package/dist/repositories/user-consent.repository.d.ts.map +1 -1
  166. package/dist/repositories/user-consent.repository.js +9 -3
  167. package/dist/repositories/user-consent.repository.js.map +1 -1
  168. package/dist/repositories/user-terms-consent.repository.d.ts.map +1 -1
  169. package/dist/repositories/user-terms-consent.repository.js +2 -0
  170. package/dist/repositories/user-terms-consent.repository.js.map +1 -1
  171. package/dist/repositories/user-totp-recovery-code.repository.d.ts +24 -0
  172. package/dist/repositories/user-totp-recovery-code.repository.d.ts.map +1 -1
  173. package/dist/repositories/user-totp.repository.d.ts +36 -0
  174. package/dist/repositories/user-totp.repository.d.ts.map +1 -1
  175. package/dist/routes/.well-known/openid-configuration/get.d.ts.map +1 -1
  176. package/dist/routes/.well-known/openid-configuration/get.js +5 -1
  177. package/dist/routes/.well-known/openid-configuration/get.js.map +1 -1
  178. package/dist/routes/api/admin/console/index.d.ts.map +1 -1
  179. package/dist/routes/api/admin/console/index.js +29 -14
  180. package/dist/routes/api/admin/console/index.js.map +1 -1
  181. package/dist/routes/api/admin/me/get.js +2 -3
  182. package/dist/routes/api/admin/me/get.js.map +1 -1
  183. package/dist/routes/api/admin/users/index.d.ts.map +1 -1
  184. package/dist/routes/api/admin/users/index.js +59 -52
  185. package/dist/routes/api/admin/users/index.js.map +1 -1
  186. package/dist/routes/api/auth/accounts/select.post.d.ts +6 -6
  187. package/dist/routes/api/auth/email/resend/post.d.ts.map +1 -1
  188. package/dist/routes/api/auth/email/resend/post.js +3 -24
  189. package/dist/routes/api/auth/email/resend/post.js.map +1 -1
  190. package/dist/routes/api/auth/email/verify/post.d.ts.map +1 -1
  191. package/dist/routes/api/auth/email/verify/post.js +29 -12
  192. package/dist/routes/api/auth/email/verify/post.js.map +1 -1
  193. package/dist/routes/api/auth/login/post.d.ts.map +1 -1
  194. package/dist/routes/api/auth/login/post.js +4 -3
  195. package/dist/routes/api/auth/login/post.js.map +1 -1
  196. package/dist/routes/api/auth/passkey/verify/post.d.ts.map +1 -1
  197. package/dist/routes/api/auth/passkey/verify/post.js +25 -11
  198. package/dist/routes/api/auth/passkey/verify/post.js.map +1 -1
  199. package/dist/routes/api/auth/password/forgot/post.d.ts.map +1 -1
  200. package/dist/routes/api/auth/password/forgot/post.js +2 -19
  201. package/dist/routes/api/auth/password/forgot/post.js.map +1 -1
  202. package/dist/routes/api/auth/register/post.d.ts.map +1 -1
  203. package/dist/routes/api/auth/register/post.js +4 -3
  204. package/dist/routes/api/auth/register/post.js.map +1 -1
  205. package/dist/routes/api/auth/totp/recovery/verify/post.d.ts.map +1 -1
  206. package/dist/routes/api/auth/totp/recovery/verify/post.js +7 -5
  207. package/dist/routes/api/auth/totp/recovery/verify/post.js.map +1 -1
  208. package/dist/routes/api/auth/totp/verify/post.d.ts.map +1 -1
  209. package/dist/routes/api/auth/totp/verify/post.js +7 -5
  210. package/dist/routes/api/auth/totp/verify/post.js.map +1 -1
  211. package/dist/routes/api/consent/get.d.ts +3 -0
  212. package/dist/routes/api/consent/get.d.ts.map +1 -1
  213. package/dist/routes/api/consent/get.js +26 -4
  214. package/dist/routes/api/consent/get.js.map +1 -1
  215. package/dist/routes/api/consent/index.d.ts +3 -0
  216. package/dist/routes/api/consent/index.d.ts.map +1 -1
  217. package/dist/routes/api/consent/post.d.ts.map +1 -1
  218. package/dist/routes/api/consent/post.js +142 -114
  219. package/dist/routes/api/consent/post.js.map +1 -1
  220. package/dist/routes/api/docs/get.d.ts.map +1 -1
  221. package/dist/routes/api/docs/get.js +8 -1
  222. package/dist/routes/api/docs/get.js.map +1 -1
  223. package/dist/routes/api/index.d.ts +382 -379
  224. package/dist/routes/api/index.d.ts.map +1 -1
  225. package/dist/routes/api/oauth/_provider/authorize/get.d.ts.map +1 -1
  226. package/dist/routes/api/oauth/_provider/authorize/get.js +5 -1
  227. package/dist/routes/api/oauth/_provider/authorize/get.js.map +1 -1
  228. package/dist/routes/api/oauth/_provider/callback/get.d.ts.map +1 -1
  229. package/dist/routes/api/oauth/_provider/callback/get.js +30 -6
  230. package/dist/routes/api/oauth/_provider/callback/get.js.map +1 -1
  231. package/dist/routes/api/oauth/_provider/callback/post.d.ts +9 -9
  232. package/dist/routes/api/oauth/_provider/callback/post.d.ts.map +1 -1
  233. package/dist/routes/api/oauth/_provider/callback/post.js +31 -31
  234. package/dist/routes/api/oauth/_provider/callback/post.js.map +1 -1
  235. package/dist/routes/api/oauth/_provider/delete.d.ts.map +1 -1
  236. package/dist/routes/api/oauth/_provider/delete.js +14 -11
  237. package/dist/routes/api/oauth/_provider/delete.js.map +1 -1
  238. package/dist/routes/api/terms/consent/post.d.ts.map +1 -1
  239. package/dist/routes/api/terms/consent/post.js +59 -43
  240. package/dist/routes/api/terms/consent/post.js.map +1 -1
  241. package/dist/routes/api/user/delete.d.ts.map +1 -1
  242. package/dist/routes/api/user/delete.js +8 -8
  243. package/dist/routes/api/user/delete.js.map +1 -1
  244. package/dist/routes/api/user/passkeys/_id/delete.d.ts.map +1 -1
  245. package/dist/routes/api/user/passkeys/_id/delete.js +17 -29
  246. package/dist/routes/api/user/passkeys/_id/delete.js.map +1 -1
  247. package/dist/routes/api/user/passkeys/_id/patch.d.ts.map +1 -1
  248. package/dist/routes/api/user/passkeys/_id/patch.js +16 -13
  249. package/dist/routes/api/user/passkeys/_id/patch.js.map +1 -1
  250. package/dist/routes/api/user/passkeys/register/verify/post.d.ts.map +1 -1
  251. package/dist/routes/api/user/passkeys/register/verify/post.js +27 -19
  252. package/dist/routes/api/user/passkeys/register/verify/post.js.map +1 -1
  253. package/dist/routes/api/user/password/delete.d.ts.map +1 -1
  254. package/dist/routes/api/user/password/delete.js +13 -10
  255. package/dist/routes/api/user/password/delete.js.map +1 -1
  256. package/dist/routes/api/user/password/post.d.ts.map +1 -1
  257. package/dist/routes/api/user/password/post.js +13 -10
  258. package/dist/routes/api/user/password/post.js.map +1 -1
  259. package/dist/routes/api/user/password/put.d.ts.map +1 -1
  260. package/dist/routes/api/user/password/put.js +13 -10
  261. package/dist/routes/api/user/password/put.js.map +1 -1
  262. package/dist/routes/api/user/totp/confirm/post.d.ts.map +1 -1
  263. package/dist/routes/api/user/totp/confirm/post.js +33 -18
  264. package/dist/routes/api/user/totp/confirm/post.js.map +1 -1
  265. package/dist/routes/api/user/totp/delete.d.ts.map +1 -1
  266. package/dist/routes/api/user/totp/delete.js +13 -18
  267. package/dist/routes/api/user/totp/delete.js.map +1 -1
  268. package/dist/routes/api/user/totp/recovery/regenerate/post.d.ts.map +1 -1
  269. package/dist/routes/api/user/totp/recovery/regenerate/post.js +13 -10
  270. package/dist/routes/api/user/totp/recovery/regenerate/post.js.map +1 -1
  271. package/dist/routes/api/user/totp/setup/post.d.ts.map +1 -1
  272. package/dist/routes/api/user/totp/setup/post.js +13 -8
  273. package/dist/routes/api/user/totp/setup/post.js.map +1 -1
  274. package/dist/routes/api/user/totp/verify/post.d.ts.map +1 -1
  275. package/dist/routes/api/user/totp/verify/post.js +23 -12
  276. package/dist/routes/api/user/totp/verify/post.js.map +1 -1
  277. package/dist/routes/index.d.ts +243 -230
  278. package/dist/routes/index.d.ts.map +1 -1
  279. package/dist/routes/oauth/authorize/get.d.ts.map +1 -1
  280. package/dist/routes/oauth/authorize/get.js +12 -4
  281. package/dist/routes/oauth/authorize/get.js.map +1 -1
  282. package/dist/routes/oauth/device/get-post.d.ts +10 -0
  283. package/dist/routes/oauth/device/get-post.d.ts.map +1 -1
  284. package/dist/routes/oauth/device/get-post.js +32 -3
  285. package/dist/routes/oauth/device/get-post.js.map +1 -1
  286. package/dist/routes/oauth/device-authorization/post.d.ts.map +1 -1
  287. package/dist/routes/oauth/device-authorization/post.js +13 -7
  288. package/dist/routes/oauth/device-authorization/post.js.map +1 -1
  289. package/dist/routes/oauth/end-session/get.d.ts +9 -9
  290. package/dist/routes/oauth/end-session/get.d.ts.map +1 -1
  291. package/dist/routes/oauth/end-session/get.js +2 -3
  292. package/dist/routes/oauth/end-session/get.js.map +1 -1
  293. package/dist/routes/oauth/index.d.ts +19 -9
  294. package/dist/routes/oauth/index.d.ts.map +1 -1
  295. package/dist/routes/oauth/revoke/post.d.ts.map +1 -1
  296. package/dist/routes/oauth/revoke/post.js +10 -2
  297. package/dist/routes/oauth/revoke/post.js.map +1 -1
  298. package/dist/routes/oauth/token/post.d.ts.map +1 -1
  299. package/dist/routes/oauth/token/post.js +69 -57
  300. package/dist/routes/oauth/token/post.js.map +1 -1
  301. package/dist/schemas/error.d.ts +75 -0
  302. package/dist/schemas/error.d.ts.map +1 -1
  303. package/dist/schemas/error.js +3 -0
  304. package/dist/schemas/error.js.map +1 -1
  305. package/dist/schemas/field.d.ts.map +1 -1
  306. package/dist/schemas/field.js +3 -0
  307. package/dist/schemas/field.js.map +1 -1
  308. package/dist/seeders/config.seeder.d.ts +1 -1
  309. package/dist/seeders/config.seeder.d.ts.map +1 -1
  310. package/dist/seeders/config.seeder.js +100 -36
  311. package/dist/seeders/config.seeder.js.map +1 -1
  312. package/dist/services/admin-console.service.d.ts.map +1 -1
  313. package/dist/services/admin-console.service.js +137 -100
  314. package/dist/services/admin-console.service.js.map +1 -1
  315. package/dist/services/auth-budget.service.d.ts +6 -0
  316. package/dist/services/auth-budget.service.d.ts.map +1 -0
  317. package/dist/services/auth-budget.service.js +30 -0
  318. package/dist/services/auth-budget.service.js.map +1 -0
  319. package/dist/services/authentication-epoch.d.ts +5 -0
  320. package/dist/services/authentication-epoch.d.ts.map +1 -0
  321. package/dist/services/authentication-epoch.js +22 -0
  322. package/dist/services/authentication-epoch.js.map +1 -0
  323. package/dist/services/authorization-browser.service.d.ts +18 -0
  324. package/dist/services/authorization-browser.service.d.ts.map +1 -0
  325. package/dist/services/authorization-browser.service.js +28 -0
  326. package/dist/services/authorization-browser.service.js.map +1 -0
  327. package/dist/services/browser-security.service.d.ts +14 -0
  328. package/dist/services/browser-security.service.d.ts.map +1 -0
  329. package/dist/services/browser-security.service.js +85 -0
  330. package/dist/services/browser-security.service.js.map +1 -0
  331. package/dist/services/browser-session.service.d.ts +25 -0
  332. package/dist/services/browser-session.service.d.ts.map +1 -0
  333. package/dist/services/browser-session.service.js +102 -0
  334. package/dist/services/browser-session.service.js.map +1 -0
  335. package/dist/services/cleanup.service.d.ts +1 -0
  336. package/dist/services/cleanup.service.d.ts.map +1 -1
  337. package/dist/services/cleanup.service.js +31 -0
  338. package/dist/services/cleanup.service.js.map +1 -1
  339. package/dist/services/client-security.d.ts +641 -0
  340. package/dist/services/client-security.d.ts.map +1 -0
  341. package/dist/services/client-security.js +10 -0
  342. package/dist/services/client-security.js.map +1 -0
  343. package/dist/services/container.d.ts +2 -0
  344. package/dist/services/container.d.ts.map +1 -1
  345. package/dist/services/container.js +7 -3
  346. package/dist/services/container.js.map +1 -1
  347. package/dist/services/email.service.d.ts +2 -14
  348. package/dist/services/email.service.d.ts.map +1 -1
  349. package/dist/services/email.service.js +35 -29
  350. package/dist/services/email.service.js.map +1 -1
  351. package/dist/services/jwt.service.d.ts +1 -0
  352. package/dist/services/jwt.service.d.ts.map +1 -1
  353. package/dist/services/jwt.service.js +13 -1
  354. package/dist/services/jwt.service.js.map +1 -1
  355. package/dist/services/mail-queue.service.d.ts +24 -0
  356. package/dist/services/mail-queue.service.d.ts.map +1 -0
  357. package/dist/services/mail-queue.service.js +223 -0
  358. package/dist/services/mail-queue.service.js.map +1 -0
  359. package/dist/services/mikro.service.d.ts.map +1 -1
  360. package/dist/services/mikro.service.js +2 -0
  361. package/dist/services/mikro.service.js.map +1 -1
  362. package/dist/services/oauth-authorize.service.d.ts +6 -1
  363. package/dist/services/oauth-authorize.service.d.ts.map +1 -1
  364. package/dist/services/oauth-authorize.service.js +136 -77
  365. package/dist/services/oauth-authorize.service.js.map +1 -1
  366. package/dist/services/oauth-browser-security.service.d.ts +7 -0
  367. package/dist/services/oauth-browser-security.service.d.ts.map +1 -0
  368. package/dist/services/oauth-browser-security.service.js +67 -0
  369. package/dist/services/oauth-browser-security.service.js.map +1 -0
  370. package/dist/services/oauth-client.service.d.ts +24 -1
  371. package/dist/services/oauth-client.service.d.ts.map +1 -1
  372. package/dist/services/oauth-client.service.js +52 -13
  373. package/dist/services/oauth-client.service.js.map +1 -1
  374. package/dist/services/oauth-connect.service.d.ts +37 -3
  375. package/dist/services/oauth-connect.service.d.ts.map +1 -1
  376. package/dist/services/oauth-connect.service.js +236 -212
  377. package/dist/services/oauth-connect.service.js.map +1 -1
  378. package/dist/services/oauth-token.service.d.ts +6 -4
  379. package/dist/services/oauth-token.service.d.ts.map +1 -1
  380. package/dist/services/oauth-token.service.js +295 -209
  381. package/dist/services/oauth-token.service.js.map +1 -1
  382. package/dist/services/passkey.service.d.ts +26 -7
  383. package/dist/services/passkey.service.d.ts.map +1 -1
  384. package/dist/services/passkey.service.js +71 -42
  385. package/dist/services/passkey.service.js.map +1 -1
  386. package/dist/services/password-auth.service.d.ts +5 -1
  387. package/dist/services/password-auth.service.d.ts.map +1 -1
  388. package/dist/services/password-auth.service.js +79 -52
  389. package/dist/services/password-auth.service.js.map +1 -1
  390. package/dist/services/password-reset.service.d.ts.map +1 -1
  391. package/dist/services/password-reset.service.js +34 -15
  392. package/dist/services/password-reset.service.js.map +1 -1
  393. package/dist/services/security.service.d.ts +3 -1
  394. package/dist/services/security.service.d.ts.map +1 -1
  395. package/dist/services/security.service.js +11 -2
  396. package/dist/services/security.service.js.map +1 -1
  397. package/dist/services/terms-policy.service.d.ts +7 -0
  398. package/dist/services/terms-policy.service.d.ts.map +1 -0
  399. package/dist/services/terms-policy.service.js +26 -0
  400. package/dist/services/terms-policy.service.js.map +1 -0
  401. package/dist/services/terms.service.d.ts.map +1 -1
  402. package/dist/services/terms.service.js +3 -2
  403. package/dist/services/terms.service.js.map +1 -1
  404. package/dist/services/totp.service.d.ts +4 -5
  405. package/dist/services/totp.service.d.ts.map +1 -1
  406. package/dist/services/totp.service.js +116 -86
  407. package/dist/services/totp.service.js.map +1 -1
  408. package/dist/services/user-consent.service.d.ts +12 -0
  409. package/dist/services/user-consent.service.d.ts.map +1 -1
  410. package/dist/services/user-consent.service.js +19 -1
  411. package/dist/services/user-consent.service.js.map +1 -1
  412. package/dist/services/user-security.service.d.ts +15 -0
  413. package/dist/services/user-security.service.d.ts.map +1 -0
  414. package/dist/services/user-security.service.js +57 -0
  415. package/dist/services/user-security.service.js.map +1 -0
  416. package/dist/services/user.service.d.ts +6 -4
  417. package/dist/services/user.service.d.ts.map +1 -1
  418. package/dist/services/user.service.js +143 -121
  419. package/dist/services/user.service.js.map +1 -1
  420. package/frontend/client/assets/{auth-layout-B4h13HhN.js → auth-layout-sea6nww4.js} +1 -1
  421. package/frontend/client/assets/{auth-page-header-BVY4zRzF.js → auth-page-header-CV85AJLW.js} +1 -1
  422. package/frontend/client/assets/document-navigation-FZbb5ldf.js +1 -0
  423. package/frontend/client/assets/i18n-vfKY-byx.js +1 -0
  424. package/frontend/client/assets/language-selector-Jso2cQNI.js +1 -0
  425. package/frontend/client/assets/manifest-90703545.js +1 -0
  426. package/frontend/client/assets/oauth-search-DebNssaC.js +1 -0
  427. package/frontend/client/assets/{passkey-CWcdr7Vy.js → passkey-CJhT-7yO.js} +1 -1
  428. package/frontend/client/assets/{promise-EbDcmV0j.js → promise-BP9iSIs-.js} +1 -1
  429. package/frontend/client/assets/{root-C2SlHCkE.js → root-BkavuloG.js} +1 -1
  430. package/frontend/client/assets/{route-3gQ9Nsqa.js → route-B0udr9eT.js} +1 -1
  431. package/frontend/client/assets/route-B3Uv9aTa.js +1 -0
  432. package/frontend/client/assets/{route-DSD60oyb.js → route-B6hIfgxz.js} +1 -1
  433. package/frontend/client/assets/{route-DO38I3ML.js → route-BEWds2g-.js} +1 -1
  434. package/frontend/client/assets/route-Bm9LsorH.js +1 -0
  435. package/frontend/client/assets/route-Btv5Y69z.js +1 -0
  436. package/frontend/client/assets/route-BvyDzziE.js +1 -0
  437. package/frontend/client/assets/route-C6kG9u7j.js +1 -0
  438. package/frontend/client/assets/route-C7C3Z0vI.js +1 -0
  439. package/frontend/client/assets/{route-DQpLeFuG.js → route-CVyefM3x.js} +1 -1
  440. package/frontend/client/assets/{route-CkpB3-_U.js → route-CXth2Wqz.js} +1 -1
  441. package/frontend/client/assets/{route-9FLiqn21.js → route-Clxc1C2d.js} +1 -1
  442. package/frontend/client/assets/route-D0IqOurp.js +1 -0
  443. package/frontend/client/assets/route-DHmYUnJR.js +1 -0
  444. package/frontend/client/assets/route-DTjZQ_Fl.js +1 -0
  445. package/frontend/client/assets/route-D_dTeu1b.js +1 -0
  446. package/frontend/client/assets/{route-CrswLAAa.js → route-Dj8gVemC.js} +1 -1
  447. package/frontend/client/assets/{route-BUM2hTU8.js → route-DnhPlHOi.js} +1 -1
  448. package/frontend/client/assets/route-FY92YQhF.js +1 -0
  449. package/frontend/client/assets/{route-DH6kQz8L.js → route-PcLpZHbT.js} +1 -1
  450. package/frontend/client/assets/{route-bKG0wKRh.js → route-qpE7i22X.js} +1 -1
  451. package/frontend/client/assets/{route-3IIrVTOK.js → route-wK89gmoS.js} +1 -1
  452. package/frontend/client/assets/security-error-message-CMsTsiWf.js +1 -0
  453. package/frontend/client/assets/{shell-header-bar-Bg85QIAq.js → shell-header-bar-DRx10tE5.js} +1 -1
  454. package/frontend/client/assets/{terms-DV0oDTRf.js → terms-Bu9Itxxs.js} +1 -1
  455. package/frontend/client/assets/{use-totp-setup-D7XZ6Nos.js → use-totp-setup-CoOXWOcT.js} +1 -1
  456. package/frontend/server/assets/{hydration-Cvbp7-6s.js → hydration-DWMjpNav.js} +1 -1
  457. package/frontend/server/assets/{root-loader.server-DaTcVcNU.js → root-loader.server-B4OqoLGG.js} +3 -3
  458. package/frontend/server/assets/{route-runtime.server-CEa264cW.js → route-runtime.server-03_pjVDT.js} +1 -1
  459. package/frontend/server/assets/{session-QqvIIQ6R.js → session-sJkmzJie.js} +51 -57
  460. package/frontend/server/index.js +337 -403
  461. package/package.json +1 -1
  462. package/frontend/client/assets/authorization-context-banner-az4f8FCY.js +0 -1
  463. package/frontend/client/assets/document-navigation-Cnp3Alf0.js +0 -1
  464. package/frontend/client/assets/i18n-CMepi_uj.js +0 -1
  465. package/frontend/client/assets/language-selector-Chn-k7Pw.js +0 -1
  466. package/frontend/client/assets/manifest-8c4a603f.js +0 -1
  467. package/frontend/client/assets/oauth-search-DybZ6VWp.js +0 -1
  468. package/frontend/client/assets/route-BFU8OK2a.js +0 -1
  469. package/frontend/client/assets/route-BKI6LDOW.js +0 -1
  470. package/frontend/client/assets/route-CusK9Y2K.js +0 -1
  471. package/frontend/client/assets/route-DEVG2czp.js +0 -1
  472. package/frontend/client/assets/route-DjCJn53Y.js +0 -1
  473. package/frontend/client/assets/route-E-_SSP-x.js +0 -1
  474. package/frontend/client/assets/route-J9z_OG4L.js +0 -1
  475. package/frontend/client/assets/route-LjqDZz5f.js +0 -1
  476. package/frontend/client/assets/route-N586tYcn.js +0 -1
  477. package/frontend/client/assets/route-nHjY3_n0.js +0 -1
  478. package/frontend/client/assets/route-sHm4cfOd.js +0 -1
@@ -0,0 +1 @@
1
+ import{$ as e,J as t,a as n,f as r,o as i}from"./components-DF4L3dSB.js";import{t as a}from"./jsx-runtime-B-57GDDH.js";import{L as o,a as s,i as c,n as l,t as u}from"./api-CfCwvXbU.js";import{n as d,r as f,t as p}from"./text-CBHShrvS.js";import{t as m}from"./useMutation-BkuKGzks.js";import{t as h}from"./useQuery-BLm0XsTI.js";import{t as g}from"./mutationOptions-Dfvzj6n2.js";import{V as _}from"./select-C_WHBpl_.js";import{a as v,i as y,r as b,t as x}from"./shell-header-bar-DRx10tE5.js";import{i as S,r as C}from"./NullStore-UyCsFQfz.js";import{t as w}from"./card-BaQElRNE.js";import{t as T}from"./circle-alert-BZCKPkRn.js";import{a as E,i as D,n as ee,r as O,t as k}from"./use-totp-setup-CoOXWOcT.js";import{t as A}from"./auth-field-CDCz-y27.js";import{t as j}from"./fingerprint-pattern-AUfgwio5.js";import{t as M}from"./key-round-BlUAV-K9.js";import{n as N,r as P}from"./language-selector-Jso2cQNI.js";import{n as te,t as F}from"./provider-mark-CCOkSxh7.js";import{n as ne,r as re,t as ie}from"./logout-DpMjBzc5.js";import{t as I}from"./shield-check-2DKLuF9J.js";import{t as L}from"./trash-C7RyeTUJ.js";import{t as R}from"./triangle-alert-B0lTzZDi.js";import{t as ae}from"./auth-page-header-CV85AJLW.js";import{t as oe}from"./link-button-DGt9hwk7.js";import{t as z}from"./alert-DS8e0Gvg.js";import{n as B,t as V}from"./modal-BDu41alh.js";import{t as H}from"./security-error-message-CMsTsiWf.js";import{t as se}from"./initial-avatar-ByHiX-IF.js";import{t as ce}from"./route-error-fallback-CRL2Et8O.js";import{r as U,t as W}from"./standard-schema-kM5DbC12.js";import{r as G}from"./FieldItemContext-B3N2qWH8.js";import{a as K,s as q}from"./schemas-B87iTMww.js";import{t as J}from"./document-navigation-FZbb5ldf.js";import{n as Y,t as le}from"./promise-BP9iSIs-.js";import{n as ue,r as de}from"./totp-4989Pb-o.js";import{t as fe}from"./badge-Cr0iG_iG.js";import{a as pe,i as me,n as he,r as ge}from"./passkey-CJhT-7yO.js";import{n as _e,t as ve}from"./route-module-2foR49uh.js";var ye={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};ye.node;var be=_(ye),xe={name:`link-2-off`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]};xe.node;var Se=_(xe),Ce={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Ce.node;var we=_(Ce),Te={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Te.node;var Ee=_(Te),X=e(t(),1),Z=a();function De({isConfigManaged:e,isDeletionEnabled:t,onDeleteClick:n}){let{t:r}=s();return t?(0,Z.jsxs)(w.Root,{className:`border-tinyrack-danger-border bg-tinyrack-danger-surface`,variant:`outlined`,children:[(0,Z.jsxs)(w.Header,{className:`border-tinyrack-danger-border border-b-tinyrack-default px-tinyrack-lg py-tinyrack-md`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-sm`,children:[(0,Z.jsx)(R,{"aria-hidden":!0,className:`size-tinyrack-lg text-tinyrack-danger-foreground`}),(0,Z.jsx)(w.Title,{className:`text-tinyrack-danger-foreground`,children:r(`profile.dangerZone.title`)})]}),(0,Z.jsx)(w.Description,{children:r(`profile.dangerZone.description`)})]}),(0,Z.jsx)(w.Content,{className:`px-tinyrack-lg py-tinyrack-md`,children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-tinyrack-lg`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-tinyrack-3xs`,children:[(0,Z.jsx)(p,{as:`p`,variant:`bodySm`,weight:`medium`,children:r(`profile.deleteAccount.title`)}),(0,Z.jsx)(p,{as:`p`,color:`muted`,variant:`caption`,children:r(e?`profile.deleteAccount.configManaged`:`profile.deleteAccount.description`)})]}),(0,Z.jsxs)(C,{appearance:`outline`,"data-testid":`profile-delete-account`,disabled:e,intent:`danger`,onClick:n,type:`button`,uiSize:`sm`,children:[(0,Z.jsx)(L,{"aria-hidden":!0,className:`size-tinyrack-lg`}),r(`profile.deleteAccount.button`)]})]})})]}):null}function Oe({providerId:e,iconUrl:t,className:n=`size-tinyrack-xl`}){return e===`google`||e===`github`||e===`apple`?(0,Z.jsx)(F,{"aria-hidden":!0,className:n,provider:e}):t?(0,Z.jsx)(`img`,{alt:``,className:n,src:t}):(0,Z.jsx)(te,{"aria-hidden":!0,className:n})}function Q({icon:e,active:t,title:n,status:r,note:i,actions:a}){let o;return o=(0,X.isValidElement)(e)?e:(0,Z.jsx)(e,{"aria-hidden":!0,className:`size-tinyrack-lg ${t?`text-tinyrack-success-foreground`:`text-tinyrack-text-muted`}`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-tinyrack-lg p-tinyrack-lg`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-tinyrack-md`,children:[(0,Z.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-tinyrack-md ${t?`bg-tinyrack-success-surface`:`bg-tinyrack-surface-muted`}`,children:o}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-tinyrack-3xs`,children:[(0,Z.jsx)(p,{variant:`bodySm`,weight:`medium`,children:n}),(0,Z.jsx)(p,{color:`muted`,variant:`caption`,children:r}),i]})]}),a&&(0,Z.jsx)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-tinyrack-xs`,children:a})]})}function ke({providers:e,unlinkingProvider:t,getAuthorizeUrl:n,onUnlinkRequest:r}){let{t:i}=s();return e.length===0?null:(0,Z.jsxs)(w.Root,{variant:`outlined`,children:[(0,Z.jsxs)(w.Header,{className:`border-tinyrack-border border-b-tinyrack-default px-tinyrack-lg py-tinyrack-md`,children:[(0,Z.jsx)(w.Title,{children:i(`profile.linkedAccounts.title`)}),(0,Z.jsx)(w.Description,{children:i(`profile.linkedAccounts.description`)})]}),(0,Z.jsx)(w.Content,{className:`divide-y divide-tinyrack-border p-0`,children:e.map(e=>(0,Z.jsx)(Q,{actions:e.linked?(0,Z.jsx)(C,{appearance:`ghost`,intent:`danger`,loading:t===e.id,loadingLabel:i(`profile.linkedAccounts.unlinking`),onClick:()=>r(e),type:`button`,uiSize:`sm`,children:t===e.id?void 0:i(`profile.linkedAccounts.unlink`)}):(0,Z.jsx)(oe,{appearance:`outline`,intent:`neutral`,render:(0,Z.jsx)(`a`,{href:n(e.id,`link`,`/profile`)}),uiSize:`sm`,children:i(`profile.linkedAccounts.link`)}),active:e.linked,icon:(0,Z.jsx)(Oe,{className:`size-tinyrack-lg`,iconUrl:e.icon_url,providerId:e.id}),status:e.linked?i(`profile.linkedAccounts.connected`):i(`profile.linkedAccounts.notConnected`),title:e.display_name},e.id))})]})}function Ae({passkeyCount:e,onOpenModal:t}){let{t:n}=s(),r=e>0;return(0,Z.jsx)(Q,{actions:(0,Z.jsx)(C,{appearance:`ghost`,intent:`primary`,onClick:()=>t(r?`manage`:`setup`),type:`button`,uiSize:`sm`,children:n(r?`profile.passkey.manage`:`profile.passkey.add`)}),active:r,icon:j,status:r?n(`profile.passkey.status.enabled`,{count:e}):n(`profile.passkey.status.disabled`),title:n(`profile.passkey.title`)})}function je({hasPassword:e,hasOtherPrimaryMethod:t,isConfigManaged:n,hasSecondFactorOnly:r,onOpenModal:i}){let{t:a}=s();return(0,Z.jsx)(Q,{actions:n?void 0:e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-password-change`,intent:`primary`,onClick:()=>i(`change`),type:`button`,uiSize:`sm`,children:a(`profile.password.change`)}),t?(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-password-remove`,intent:`danger`,onClick:()=>i(`remove`),type:`button`,uiSize:`sm`,children:a(`profile.password.remove`)}):null,!t&&r&&(0,Z.jsxs)(v.Root,{children:[(0,Z.jsx)(v.Trigger,{render:(0,Z.jsx)(C,{appearance:`ghost`,disabled:!0,type:`button`,uiSize:`sm`,children:a(`profile.password.remove`)})}),(0,Z.jsx)(v.Portal,{children:(0,Z.jsx)(v.Positioner,{children:(0,Z.jsx)(v.Popup,{className:`max-w-tinyrack-measure-lg rounded-tinyrack-md border border-tinyrack-border bg-tinyrack-surface p-tinyrack-md text-tinyrack-text text-tinyrack-xs shadow-tinyrack-overlay`,children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-tinyrack-sm`,children:[(0,Z.jsx)(E,{"aria-hidden":!0,className:`size-tinyrack-lg shrink-0 text-tinyrack-warning-foreground`}),(0,Z.jsx)(p,{variant:`caption`,children:a(`profile.password.removeDisabledReason`)})]})})})})]})]}):(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-password-set`,intent:`primary`,onClick:()=>i(`set`),type:`button`,uiSize:`sm`,children:a(`profile.password.set`)}),active:e,icon:M,note:n?(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-xs`,children:[(0,Z.jsx)(ne,{"aria-hidden":!0,className:`size-tinyrack-md shrink-0`}),(0,Z.jsx)(p,{as:`span`,color:`muted`,variant:`caption`,children:a(`profile.password.configManaged`)})]}):void 0,status:a(e?`profile.password.status.set`:`profile.password.status.notSet`),title:a(`profile.password.title`)})}function Me({totpEnabled:e,recoveryCodesMissing:t,onOpenModal:n}){let{t:r}=s();return(0,Z.jsx)(Q,{actions:e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-totp-regenerate`,intent:`primary`,onClick:()=>n(`regenerate`),type:`button`,uiSize:`sm`,children:r(`profile.totp.regenerate`)}),(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-totp-disable`,intent:`danger`,onClick:()=>n(`disable`),type:`button`,uiSize:`sm`,children:r(`profile.totp.disable`)})]}):(0,Z.jsx)(C,{appearance:`ghost`,"data-testid":`profile-totp-enable`,intent:`primary`,onClick:()=>n(`setup`),type:`button`,uiSize:`sm`,children:r(`profile.totp.enable`)}),active:e,icon:I,status:r(e?t?`profile.totp.status.recoveryCodesMissing`:`profile.totp.status.enabled`:`profile.totp.status.disabled`),title:r(`profile.totp.title`)})}var Ne={error:T,warning:R,info:E};function $({variant:e,children:t}){return(0,Z.jsx)(z,{"data-testid":`alert-banner-${e}`,icon:Ne[e],type:e,children:t})}function Pe({isOpen:e,onClose:t,providerName:n,isPending:r,onConfirm:i}){let{t:a}=s(),[o,c]=(0,X.useState)(null),l=()=>{r||(c(null),t())};return(0,Z.jsx)(V,{description:a(`profile.linkedAccounts.unlinkModal.description`,{provider:n}),icon:Se,isOpen:e,onClose:l,preventClose:r,title:a(`profile.linkedAccounts.unlinkModal.title`),variant:`destructive`,children:(0,Z.jsxs)(`div`,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,children:[(0,Z.jsx)($,{variant:`warning`,children:a(`profile.linkedAccounts.unlinkModal.warning`,{provider:n})}),o&&(0,Z.jsx)($,{variant:`error`,children:o}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`unlink-oauth-cancel`,disabled:r,intent:`neutral`,onClick:l,type:`button`,uiSize:`sm`,children:a(`profile.linkedAccounts.unlinkModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`unlink-oauth-unlink`,disabled:r,intent:`danger`,loading:r,loadingLabel:a(`profile.linkedAccounts.unlinking`),onClick:async()=>{c(null);try{await i(),l()}catch(e){c(H(e,a,a(`profile.linkedAccounts.unlinkError`)))}},type:`button`,uiSize:`sm`,children:a(`profile.linkedAccounts.unlink`)})]})]})})}function Fe({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-tinyrack-lg px-tinyrack-lg py-tinyrack-md`,children:[(0,Z.jsx)(p,{className:`shrink-0`,color:`muted`,variant:`caption`,children:e}),(0,Z.jsx)(p,{truncate:!0,variant:`bodySm`,weight:`medium`,children:t})]})}function Ie({user:e}){let{t}=s();return(0,Z.jsxs)(w.Root,{variant:`outlined`,children:[(0,Z.jsxs)(w.Header,{className:`border-tinyrack-border border-b-tinyrack-default px-tinyrack-lg py-tinyrack-md`,children:[(0,Z.jsx)(w.Title,{children:t(`profile.account.title`)}),(0,Z.jsx)(w.Description,{children:t(`profile.account.description`)})]}),(0,Z.jsxs)(w.Content,{className:`divide-y divide-tinyrack-border p-0`,children:[(0,Z.jsx)(Fe,{label:t(`profile.id.label`),value:e.sub}),(0,Z.jsx)(Fe,{label:t(`profile.email.label`),value:e.email})]})]})}function Le({children:e,headerActions:t}){return(0,Z.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-tinyrack-surface`,children:[(0,Z.jsx)(y,{}),(0,Z.jsx)(x,{actions:t,brand:!0}),(0,Z.jsx)(`main`,{className:`flex flex-1 justify-center px-tinyrack-lg py-tinyrack-xl`,children:(0,Z.jsx)(`div`,{className:`auth-enter flex w-full max-w-tinyrack-overlay-width-md flex-col gap-tinyrack-xl`,children:e})}),(0,Z.jsx)(b,{})]})}var Re=g({mutationFn:async e=>{let t=await u.api.user.password.$post({json:e});return l(t)}}),ze=g({mutationFn:async e=>{let t=await u.api.user.password.$put({json:e});return l(t)}}),Be=g({mutationFn:async e=>{let t=await u.api.user.password.$delete({json:e});return l(t)}});function Ve({isOpen:e,onClose:t}){let{t:n}=s(),r=o(),{data:i}=f(N),a=i.auth.password.policy,l=(0,X.useMemo)(()=>K({currentPassword:q().min(1,n(`validation.password.required`)),newPassword:q().min(a.min_length,n(`validation.password.min`,{count:a.min_length})).max(a.max_length,n(`validation.password.max`,{count:a.max_length})),confirmPassword:q()}).refine(e=>e.newPassword===e.confirmPassword,{message:n(`validation.confirmPassword.mismatch`),path:[`confirmPassword`]}),[a.max_length,a.min_length,n]),u=U({resolver:W(l),defaultValues:{currentPassword:``,newPassword:``,confirmPassword:``}}),d=m({...ze,onSuccess:()=>{r.invalidateQueries({queryKey:Y.queryKey}),p(),J(`/login`)}}),p=()=>{u.reset(),t()},h=u.handleSubmit(async e=>{try{await d.mutateAsync({current_password:e.currentPassword,new_password:e.newPassword})}catch(e){e instanceof c&&e.code===`INVALID_CURRENT_PASSWORD`?u.setError(`currentPassword`,{message:n(`profile.password.changeModal.invalidCurrent`)}):u.setError(`root`,{message:H(e,n,n(`profile.password.changeModal.error`))})}});return(0,Z.jsx)(V,{description:n(`profile.password.changeModal.description`),icon:M,isOpen:e,onClose:p,title:n(`profile.password.changeModal.title`),children:(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:h,children:[(0,Z.jsx)(A,{error:u.formState.errors.currentPassword,errorTestId:`change-password-error-currentPassword`,id:`current-password`,label:n(`profile.password.changeModal.currentPassword`),placeholder:n(`profile.password.changeModal.currentPasswordPlaceholder`),...u.register(`currentPassword`),type:`password`}),(0,Z.jsx)(A,{error:u.formState.errors.newPassword,errorTestId:`change-password-error-newPassword`,id:`new-password-change`,label:n(`profile.password.changeModal.newPassword`),placeholder:n(`profile.password.changeModal.newPasswordPlaceholder`),...u.register(`newPassword`),type:`password`}),(0,Z.jsx)(A,{error:u.formState.errors.confirmPassword,errorTestId:`change-password-error-confirmPassword`,id:`confirm-password-change`,label:n(`profile.password.changeModal.confirmPassword`),placeholder:n(`profile.password.changeModal.confirmPasswordPlaceholder`),...u.register(`confirmPassword`),type:`password`}),u.formState.errors.root&&(0,Z.jsx)($,{variant:`error`,children:u.formState.errors.root.message}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`change-password-cancel`,disabled:d.isPending,intent:`neutral`,onClick:p,type:`button`,uiSize:`sm`,children:n(`profile.password.changeModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`change-password-submit`,disabled:d.isPending,intent:`primary`,loading:d.isPending,loadingLabel:n(`profile.password.changeModal.submitting`),type:`submit`,uiSize:`sm`,children:d.isPending?void 0:n(`profile.password.changeModal.submit`)})]})]})})}var He=g({mutationFn:async()=>{let e=await u.api.user.$delete();return l(e)}});function Ue({isOpen:e,onClose:t,retentionDays:n}){let{t:i}=s(),a=r(),c=o(),l=(0,X.useMemo)(()=>K({confirmation:q().refine(e=>e.toLowerCase()===i(`profile.deleteAccount.modal.confirmPlaceholder`).toLowerCase(),{message:i(`validation.confirmText.mismatch`)})}),[i]),u=U({resolver:W(l),defaultValues:{confirmation:``}}),d=m({...He,onSuccess:async()=>{c.setQueryData(Y.queryKey,{user:null}),await le(),a(`/login`)}}),f=()=>{d.isPending||(u.reset(),t())},h=u.handleSubmit(async()=>{try{await d.mutateAsync()}catch{u.setError(`root`,{message:i(`profile.deleteAccount.error`)})}});return(0,Z.jsx)(V,{icon:L,isOpen:e,onClose:f,preventClose:d.isPending,title:i(`profile.deleteAccount.modal.title`),variant:`destructive`,children:(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:h,children:[(0,Z.jsxs)($,{variant:`error`,children:[(0,Z.jsx)(p,{as:`span`,variant:`bodySm`,children:i(`profile.deleteAccount.modal.description`,{days:n})}),(0,Z.jsx)(`br`,{}),(0,Z.jsx)(p,{as:`span`,className:`opacity-tinyrack-hover`,variant:`caption`,children:i(`profile.deleteAccount.modal.warning`)})]}),(0,Z.jsx)(A,{autoComplete:`off`,error:u.formState.errors.confirmation,errorTestId:`delete-account-error`,id:`delete-confirmation`,label:i(`profile.deleteAccount.modal.confirmLabel`),placeholder:i(`profile.deleteAccount.modal.confirmPlaceholder`),...u.register(`confirmation`),type:`text`}),u.formState.errors.root&&(0,Z.jsx)($,{variant:`error`,children:u.formState.errors.root.message}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`delete-account-cancel`,disabled:d.isPending,intent:`neutral`,onClick:f,type:`button`,uiSize:`sm`,children:i(`profile.deleteAccount.modal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`delete-account-submit`,disabled:d.isPending,intent:`danger`,loading:d.isPending,loadingLabel:i(`profile.deleteAccount.modal.confirming`),type:`submit`,uiSize:`sm`,children:d.isPending?void 0:i(`profile.deleteAccount.modal.confirm`)})]})]})})}function We({isOpen:e,onClose:t}){let{t:n}=s(),r=o(),i=(0,X.useMemo)(()=>K({code:q().length(6,n(`validation.totp.length`)).regex(/^\d{6}$/,n(`validation.totp.digits`))}),[n]),a=U({resolver:W(i),defaultValues:{code:``}}),l=m({...ue,onSuccess:()=>{r.invalidateQueries({queryKey:Y.queryKey}),u()}}),u=()=>{a.reset(),t()},d=a.handleSubmit(async e=>{try{await l.mutateAsync({code:e.code})}catch(e){if(e instanceof c&&e.code===`CANNOT_REMOVE_LAST_SECOND_FACTOR`){a.setError(`code`,{message:n(`profile.totp.disableModal.cannotRemoveLastSecondFactor`)});return}a.setError(`code`,{message:H(e,n,n(`profile.totp.disableModal.error`))})}});return(0,Z.jsx)(V,{description:n(`profile.totp.disableModal.description`),icon:I,isOpen:e,onClose:u,title:n(`profile.totp.disableModal.title`),variant:`destructive`,children:(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:d,children:[(0,Z.jsx)($,{variant:`warning`,children:n(`profile.totp.disableModal.warning`)}),(0,Z.jsx)(A,{autoComplete:`one-time-code`,error:a.formState.errors.code,errorTestId:`disable-totp-error`,id:`disable-totp-code`,inputMode:`numeric`,label:n(`profile.totp.disableModal.codeLabel`),maxLength:6,pattern:`[0-9]*`,placeholder:`000000`,...a.register(`code`),type:`text`}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`disable-totp-cancel`,disabled:l.isPending,intent:`neutral`,onClick:u,type:`button`,uiSize:`sm`,children:n(`profile.totp.disableModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`disable-totp-submit`,disabled:l.isPending,intent:`danger`,loading:l.isPending,loadingLabel:n(`profile.totp.disableModal.disabling`),type:`submit`,uiSize:`sm`,children:l.isPending?void 0:n(`profile.totp.disableModal.disable`)})]})]})})}function Ge({isOpen:e,onClose:t,onAddNew:n}){let{t:r}=s(),i=o(),[a,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(null),[f,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(null),{data:y,isLoading:b}=h({...ge,enabled:e}),x=m({...he,onSuccess:()=>{i.invalidateQueries({queryKey:P.passkeys()}),i.invalidateQueries({queryKey:Y.queryKey})},onSettled:()=>{d(null)}}),w=(0,X.useCallback)(()=>{l(null),d(null),g(null),v(null),t()},[t]),T=e=>{g(e.id),v(null)},E=()=>{g(null),v(null)},D=async e=>{d(e.id),g(null);try{await x.mutateAsync({id:e.id})}catch(e){if(e instanceof c&&e.code===`CANNOT_REMOVE_LAST_SECOND_FACTOR`){v(r(`profile.passkey.manageModal.cannotRemoveLastSecondFactor`));return}v(H(e,r,r(`profile.passkey.manageModal.deleteError`)))}},ee=e=>new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`}),O=y?.passkeys||[];return(0,Z.jsxs)(V,{icon:j,isOpen:e,onClose:w,size:`lg`,title:r(`profile.passkey.manageModal.title`),children:[(0,Z.jsxs)(`div`,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-sm`,children:[_&&(0,Z.jsx)($,{variant:`error`,children:_}),b&&(0,Z.jsx)(`div`,{className:`flex justify-center py-tinyrack-xl`,children:(0,Z.jsx)(S,{uiSize:`md`})}),!b&&O.length===0&&(0,Z.jsx)(p,{align:`center`,className:`py-tinyrack-xl`,color:`muted`,"data-testid":`passkeys-empty`,variant:`bodySm`,children:r(`profile.passkey.manageModal.noPasskeys`)}),!b&&O.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-tinyrack-sm`,children:O.map(e=>(0,Z.jsx)(Ke,{formatDate:ee,isConfirmingDelete:f===e.id,isDeleting:u===e.id,isEditing:a?.id===e.id,onCancelDelete:E,onCancelEdit:()=>l(null),onConfirmDelete:()=>D(e),onEdit:()=>l(e),onRequestDelete:()=>T(e),passkey:e},e.id))})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`manage-passkeys-close`,intent:`neutral`,onClick:w,type:`button`,uiSize:`sm`,children:r(`profile.passkey.manageModal.close`)}),(0,Z.jsx)(C,{"data-testid":`manage-passkeys-add-new`,intent:`primary`,onClick:()=>{w(),n()},type:`button`,uiSize:`sm`,children:r(`profile.passkey.manageModal.addNew`)})]})]})}function Ke({passkey:e,isDeleting:t,isEditing:n,isConfirmingDelete:r,onEdit:i,onCancelEdit:a,onRequestDelete:c,onConfirmDelete:l,onCancelDelete:u,formatDate:d}){let{t:f}=s(),h=o(),g=(0,X.useMemo)(()=>K({name:q().min(1,f(`validation.passkey.name.required`)).max(100,f(`validation.passkey.name.max`))}),[f]),_=U({resolver:W(g),defaultValues:{name:e.name||``}}),v=m({...pe,onSuccess:()=>{h.invalidateQueries({queryKey:P.passkeys()}),a()}}),y=_.handleSubmit(async t=>{try{await v.mutateAsync({id:e.id,name:t.name})}catch{_.setError(`name`,{message:f(`profile.passkey.manageModal.renameError`)})}});return n?(0,Z.jsxs)(G,{className:`flex flex-col gap-tinyrack-xs rounded-tinyrack-md bg-tinyrack-surface-muted p-tinyrack-sm`,onSubmit:y,children:[(0,Z.jsx)(A,{"data-testid":`passkey-rename-input`,error:_.formState.errors.name,errorTestId:`passkey-rename-error`,hideLabel:!0,label:f(`profile.passkey.manageModal.nameLabel`),placeholder:f(`profile.passkey.manageModal.namePlaceholder`),..._.register(`name`),type:`text`}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-tinyrack-xs`,children:[(0,Z.jsx)(C,{appearance:`ghost`,disabled:v.isPending,onClick:()=>{_.reset(),a()},type:`button`,uiSize:`sm`,children:f(`profile.passkey.manageModal.cancelEdit`)}),(0,Z.jsx)(C,{disabled:v.isPending,intent:`primary`,type:`submit`,uiSize:`sm`,children:v.isPending?f(`profile.passkey.manageModal.saving`):f(`profile.passkey.manageModal.save`)})]})]}):r?(0,Z.jsxs)(`div`,{className:`flex items-center justify-between rounded-tinyrack-md border border-tinyrack-danger-border bg-tinyrack-danger-surface p-tinyrack-sm text-tinyrack-danger-foreground`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-sm`,children:[(0,Z.jsx)(L,{className:`size-tinyrack-lg`}),(0,Z.jsx)(p,{color:`danger`,variant:`caption`,children:f(`profile.passkey.manageModal.deleteConfirmInline`)})]}),(0,Z.jsxs)(`div`,{className:`flex gap-tinyrack-xs`,children:[(0,Z.jsx)(C,{appearance:`ghost`,onClick:u,type:`button`,uiSize:`sm`,children:f(`profile.passkey.manageModal.cancelEdit`)}),(0,Z.jsx)(C,{intent:`danger`,onClick:l,type:`button`,uiSize:`sm`,children:f(`profile.passkey.manageModal.delete`)})]})]}):(0,Z.jsxs)(`div`,{className:`flex items-center justify-between rounded-tinyrack-md bg-tinyrack-surface-muted p-tinyrack-sm`,"data-testid":`passkey-item`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-sm`,children:[e.device_type===`multiDevice`?(0,Z.jsx)(be,{className:`size-tinyrack-lg text-tinyrack-primary-foreground`}):(0,Z.jsx)(Ee,{className:`size-tinyrack-lg text-tinyrack-primary-foreground`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(p,{variant:`caption`,weight:`medium`,children:e.name||f(`profile.passkey.manageModal.unnamedPasskey`)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-xs`,children:[(0,Z.jsx)(p,{color:`muted`,variant:`caption`,children:f(`profile.passkey.manageModal.createdAt`,{date:d(e.created_at)})}),e.backed_up&&(0,Z.jsx)(fe,{uiSize:`md`,variant:`success`,children:f(`profile.passkey.manageModal.backedUp`)})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex gap-tinyrack-xs`,children:[(0,Z.jsx)(C,{appearance:`ghost`,"aria-label":f(`profile.passkey.manageModal.rename`),onClick:i,type:`button`,uiSize:`sm`,children:(0,Z.jsx)(we,{className:`size-tinyrack-lg`})}),(0,Z.jsx)(C,{appearance:`ghost`,"aria-label":f(`profile.passkey.manageModal.delete`),disabled:t,intent:`danger`,loading:t,onClick:c,type:`button`,uiSize:`sm`,children:t?void 0:(0,Z.jsx)(L,{className:`size-tinyrack-lg`})})]})]})}function qe({isOpen:e,onClose:t}){let{t:n}=s(),i=r(),a=o(),{data:l}=f(N),[u,d]=(0,X.useState)(`verify`),[p,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),v=m({...de,onSuccess:async e=>{h(e),d(`recovery`),await a.invalidateQueries({queryKey:Y.queryKey})}}),y=(0,X.useCallback)(()=>{d(`verify`),h(null),_(null),v.reset()},[v]),b=(0,X.useCallback)(()=>{y(),t()},[t,y]),x=(0,X.useCallback)(async e=>{_(null);try{await v.mutateAsync({code:e})}catch(e){if(e instanceof c){if(e.code===`INVALID_TOTP_CODE`)throw e;if(e.code===`UNAUTHORIZED`){a.setQueryData(Y.queryKey,{user:null}),await le(),i(`/login`);return}if(e.code===`TOTP_NOT_ENABLED`||e.code===`VALIDATION_ERROR`){await a.invalidateQueries({queryKey:Y.queryKey}),b();return}}_(H(e,n,n(`profile.totp.regenerateModal.unexpectedError`)))}},[b,v,i,a,n]);return l.auth.password.totp.enabled?(0,Z.jsx)(V,{description:n(u===`verify`?`profile.totp.regenerateModal.description`:`profile.totp.regenerateModal.recoveryDescription`),icon:I,isOpen:e,onClose:b,preventClose:u===`recovery`,size:`sm`,title:n(u===`verify`?`profile.totp.regenerateModal.title`:`profile.totp.regenerateModal.recoveryTitle`),children:u===`verify`?(0,Z.jsxs)(`div`,{className:`mt-tinyrack-lg`,children:[g&&(0,Z.jsx)(`div`,{className:`mb-tinyrack-md`,children:(0,Z.jsx)($,{variant:`error`,children:g})}),(0,Z.jsx)(O,{invalidMessage:n(`profile.totp.regenerateModal.error`),isPending:v.isPending,onSubmit:x,pendingText:n(`profile.totp.regenerateModal.submitting`),submitLabel:n(`profile.totp.regenerateModal.submit`)})]}):(0,Z.jsx)(`div`,{className:`mt-tinyrack-lg`,children:(0,Z.jsx)(D,{onConfirm:b,recoveryCodes:p?.recovery_codes??[]})})}):null}function Je({isOpen:e,onClose:t}){let{t:n}=s(),r=o(),i=(0,X.useMemo)(()=>K({currentPassword:q().min(1,n(`validation.password.required`))}),[n]),a=U({resolver:W(i),defaultValues:{currentPassword:``}}),l=m({...Be,onSuccess:()=>{r.invalidateQueries({queryKey:Y.queryKey}),u(),J(`/login`)}}),u=()=>{a.reset(),t()},d=a.handleSubmit(async e=>{try{await l.mutateAsync({current_password:e.currentPassword})}catch(e){if(e instanceof c){if(e.code===`INVALID_CURRENT_PASSWORD`){a.setError(`currentPassword`,{message:n(`profile.password.removeModal.invalidCurrent`)});return}if(e.code===`CANNOT_REMOVE_LAST_AUTH_METHOD`){a.setError(`root`,{message:n(`profile.password.removeModal.noOAuth`)});return}if(e.code===`CANNOT_REMOVE_PASSWORD_WITH_SECOND_FACTOR_ONLY`){a.setError(`root`,{message:n(`profile.password.removeModal.noOAuthWith2FA`)});return}}a.setError(`root`,{message:H(e,n,n(`profile.password.removeModal.error`))})}});return(0,Z.jsx)(V,{description:n(`profile.password.removeModal.description`),icon:M,isOpen:e,onClose:u,title:n(`profile.password.removeModal.title`),variant:`destructive`,children:(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:d,children:[(0,Z.jsx)(A,{error:a.formState.errors.currentPassword,errorTestId:`remove-password-error`,id:`current-password-remove`,label:n(`profile.password.removeModal.currentPassword`),placeholder:n(`profile.password.removeModal.currentPasswordPlaceholder`),...a.register(`currentPassword`),type:`password`}),a.formState.errors.root&&(0,Z.jsx)($,{variant:`error`,children:a.formState.errors.root.message}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`remove-password-cancel`,disabled:l.isPending,intent:`neutral`,onClick:u,type:`button`,uiSize:`sm`,children:n(`profile.password.removeModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`remove-password-submit`,disabled:l.isPending,intent:`danger`,loading:l.isPending,loadingLabel:n(`profile.password.removeModal.submitting`),type:`submit`,uiSize:`sm`,children:l.isPending?void 0:n(`profile.password.removeModal.submit`)})]})]})})}function Ye({isOpen:e,onClose:t}){let{t:n}=s(),r=o(),{data:i}=f(N),a=i.auth.password.policy,c=(0,X.useMemo)(()=>K({password:q().min(a.min_length,n(`validation.password.min`,{count:a.min_length})).max(a.max_length,n(`validation.password.max`,{count:a.max_length})),confirmPassword:q()}).refine(e=>e.password===e.confirmPassword,{message:n(`validation.confirmPassword.mismatch`),path:[`confirmPassword`]}),[a.max_length,a.min_length,n]),l=U({resolver:W(c),defaultValues:{password:``,confirmPassword:``}}),u=m({...Re,onSuccess:()=>{r.invalidateQueries({queryKey:Y.queryKey}),d(),J(`/login`)}}),d=()=>{l.reset(),t()},p=l.handleSubmit(async e=>{try{await u.mutateAsync({password:e.password})}catch(e){l.setError(`root`,{message:H(e,n,n(`profile.password.setModal.error`))})}});return(0,Z.jsx)(V,{description:n(`profile.password.setModal.description`),icon:M,isOpen:e,onClose:d,title:n(`profile.password.setModal.title`),children:(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:p,children:[(0,Z.jsx)(A,{error:l.formState.errors.password,errorTestId:`set-password-error-password`,id:`new-password`,label:n(`profile.password.setModal.newPassword`),placeholder:n(`profile.password.setModal.newPasswordPlaceholder`),...l.register(`password`),type:`password`}),(0,Z.jsx)(A,{error:l.formState.errors.confirmPassword,errorTestId:`set-password-error-confirmPassword`,id:`confirm-password`,label:n(`profile.password.setModal.confirmPassword`),placeholder:n(`profile.password.setModal.confirmPasswordPlaceholder`),...l.register(`confirmPassword`),type:`password`}),l.formState.errors.root&&(0,Z.jsx)($,{variant:`error`,children:l.formState.errors.root.message}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`set-password-cancel`,disabled:u.isPending,intent:`neutral`,onClick:d,type:`button`,uiSize:`sm`,children:n(`profile.password.setModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`set-password-submit`,disabled:u.isPending,intent:`primary`,loading:u.isPending,loadingLabel:n(`profile.password.setModal.submitting`),type:`submit`,uiSize:`sm`,children:u.isPending?void 0:n(`profile.password.setModal.submit`)})]})]})})}function Xe({isOpen:e,onClose:t,isRequired:n=!1,canSwitchToTotp:r=!1,onSwitchToTotp:i}){let{t:a}=s(),c=o(),[l,u]=(0,X.useState)(`name`),[d,f]=(0,X.useState)(null),h=(0,X.useMemo)(()=>K({name:q().max(100,a(`validation.passkey.name.max`)).optional().transform(e=>e?.trim()||void 0)}),[a]),g=U({resolver:W(h),defaultValues:{name:``}}),_=m({...me,onSuccess:()=>{c.invalidateQueries({queryKey:P.passkeys()}),c.invalidateQueries({queryKey:Y.queryKey}),v()},onError:e=>{u(`name`),e.name===`NotAllowedError`?f(a(`profile.passkey.setupModal.cancelled`)):f(H(e,a,a(`profile.passkey.setupModal.error`)))}}),v=(0,X.useCallback)(()=>{g.reset(),u(`name`),f(null),t()},[g,t]),y=g.handleSubmit(async e=>{u(`register`),f(null);try{await _.mutateAsync({name:e.name})}catch{}}),b=_.isPending;return(0,Z.jsxs)(V,{description:n?a(`profile.passkey.setupModal.requiredDescription`):void 0,icon:j,isOpen:e,onClose:v,preventClose:n,size:`sm`,title:a(`profile.passkey.setupModal.title`),children:[l===`name`&&(0,Z.jsxs)(G,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,onSubmit:y,children:[(0,Z.jsx)(p,{as:`p`,color:`muted`,variant:`caption`,children:a(`profile.passkey.setupModal.description`)}),d&&(0,Z.jsx)($,{variant:`error`,children:d}),(0,Z.jsx)(A,{error:g.formState.errors.name,errorTestId:`setup-passkey-error`,hint:a(`profile.passkey.setupModal.nameHint`),id:`passkey-name`,label:a(`profile.passkey.setupModal.nameLabel`),placeholder:a(`profile.passkey.setupModal.namePlaceholder`),...g.register(`name`),type:`text`}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`setup-passkey-cancel`,intent:`neutral`,onClick:v,type:`button`,uiSize:`sm`,children:a(`profile.passkey.setupModal.cancel`)}),(0,Z.jsx)(C,{"data-testid":`setup-passkey-continue`,intent:`primary`,type:`submit`,uiSize:`sm`,children:a(`profile.passkey.setupModal.continue`)})]}),r&&i&&(0,Z.jsx)(p,{align:`center`,as:`p`,className:`mt-tinyrack-sm`,variant:`caption`,children:(0,Z.jsx)(C,{appearance:`ghost`,intent:`primary`,onClick:i,type:`button`,uiSize:`sm`,children:a(`profile.passkey.setupModal.switchToTotp`)})})]}),l===`register`&&(0,Z.jsxs)(`div`,{className:`mt-tinyrack-lg`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-md py-tinyrack-xl`,"data-testid":`setup-passkey-loading`,children:[(0,Z.jsx)(S,{uiSize:`md`}),(0,Z.jsx)(p,{align:`center`,as:`p`,color:`muted`,variant:`caption`,children:a(`profile.passkey.setupModal.waitingForDevice`)})]}),(0,Z.jsx)(B,{children:(0,Z.jsx)(C,{appearance:`outline`,"data-testid":`setup-passkey-cancel`,disabled:b,intent:`neutral`,onClick:v,type:`button`,uiSize:`sm`,children:a(`profile.passkey.setupModal.cancel`)})})]})]})}function Ze({isOpen:e,onClose:t,isRequired:n=!1,canSwitchToPasskey:r=!1,onSwitchToPasskey:i}){let{t:a}=s(),{step:o,setupData:c,setupError:l,recoveryCodes:u,isSetupPending:d,isVerifyPending:f,isConfirmPending:m,startSetup:h,verify:g,goToVerify:_,goToQr:v,confirmRecoveryCodes:y,reset:b}=k({autoStart:!1,onConfirmSuccess:()=>{b(),t()}}),x=(0,X.useCallback)(()=>{b(),t()},[t,b]),w=(0,X.useCallback)(()=>{!c&&!d&&h()},[c,d,h]);e&&!c&&!d&&o!==`error`&&w();let T=(0,X.useCallback)(async e=>{await g(e)},[g]),E=a(o===`recovery`?`setupTotp.recoveryCodes.title`:`profile.totp.setupModal.title`);return(0,Z.jsxs)(V,{description:n?a(`profile.totp.setupModal.requiredDescription`):void 0,icon:I,isOpen:e,onClose:x,preventClose:n||o===`recovery`,size:`sm`,title:E,children:[d&&(0,Z.jsx)(`div`,{className:`flex justify-center py-tinyrack-xl`,"data-testid":`setup-totp-loading`,children:(0,Z.jsx)(S,{uiSize:`md`})}),o===`error`&&(0,Z.jsxs)(`div`,{className:`mt-tinyrack-lg flex flex-col gap-tinyrack-md`,children:[(0,Z.jsx)($,{variant:`error`,children:H(l,a,a(`profile.totp.setupModal.setupError`))}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(C,{appearance:`outline`,intent:`neutral`,onClick:x,type:`button`,uiSize:`sm`,children:a(`profile.totp.setupModal.cancel`)}),(0,Z.jsx)(C,{intent:`primary`,onClick:h,type:`button`,uiSize:`sm`,children:a(`profile.totp.setupModal.retry`)})]})]}),c&&o===`qr`&&(0,Z.jsx)(`div`,{className:`mt-tinyrack-lg`,children:(0,Z.jsx)(ee,{additionalActions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(B,{children:(0,Z.jsx)(C,{appearance:`outline`,intent:`neutral`,onClick:x,type:`button`,uiSize:`sm`,children:a(`profile.totp.setupModal.cancel`)})}),r&&i&&(0,Z.jsx)(p,{align:`center`,as:`p`,className:`mt-tinyrack-sm`,variant:`caption`,children:(0,Z.jsx)(C,{appearance:`ghost`,intent:`primary`,onClick:i,type:`button`,uiSize:`sm`,children:a(`profile.totp.setupModal.switchToPasskey`)})})]}),onNext:_,setupData:c})}),c&&o===`verify`&&(0,Z.jsx)(`div`,{className:`mt-tinyrack-lg`,children:(0,Z.jsx)(O,{isPending:f,onBack:v,onSubmit:T})}),o===`recovery`&&u.length>0&&(0,Z.jsx)(`div`,{className:`mt-tinyrack-lg`,children:(0,Z.jsx)(D,{isLoading:m,onConfirm:y,recoveryCodes:u})})]})}var Qe=(e=>d({queryKey:P.oauth.accounts(),queryFn:async()=>{let t=await e.api.user[`oauth-accounts`].$get();return l(t)}}))(u),$e=g({mutationFn:async e=>{let t=await u.api.oauth[`:provider`].$delete({param:{provider:e}});return l(t)}});function et(e,t=`login`,n){let r=new URLSearchParams({mode:t});return n&&r.set(`return_url`,n),`/api/oauth/${encodeURIComponent(e)}/authorize?${r.toString()}`}var tt={access_denied:`oauth.error.accessDenied`,temporarily_unavailable:`oauth.error.temporarilyUnavailable`,server_error:`oauth.error.serverError`};function nt(e){return(0,Z.jsx)(ce,{...e,onUnauthorized:()=>{J(`/login`)}})}function rt({search:e}){let{t}=s(),n=r(),i=o(),a=e.oauth_error,c=a?t(tt[a]??`oauth.error.failed`):void 0,[l,u]=(0,X.useState)(null),[d,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,E]=(0,X.useState)(!1),{data:D}=f(Y),{data:ee}=f(Qe),{data:O}=f(N),k=m({...ie,onSuccess:async()=>{i.setQueryData(Y.queryKey,{user:null}),await le(),n(`/login`)},onSettled:()=>{i.invalidateQueries({queryKey:Y.queryKey})}}),A=m({...$e,onSuccess:()=>{i.invalidateQueries({queryKey:Qe.queryKey})},onSettled:()=>{u(null)}}),j=async()=>{d&&(u(d.id),await A.mutateAsync(d.id))};if(!D.user)return null;let M=D.user,P=ee.available_providers,te=P.some(e=>e.linked),F=M.managed_by===`config`,ne=O.auth.password,I=O.auth.passkey,L=ne.totp.enabled,R=I.enabled,oe=O.account_deletion.enabled,B=O.account_deletion.retention,V=(()=>{let e=B.match(/^(\d+)([dmy])$/);if(!e)return 30;let t=parseInt(e[1],10);switch(e[2]){case`d`:return t;case`m`:return t*30;case`y`:return t*365;default:return 30}})(),H=!F&&L,ce=!F&&R,U=P.length>0;return(0,Z.jsxs)(Le,{headerActions:(0,Z.jsx)(C,{appearance:`ghost`,"aria-label":t(`profile.logout`),"data-testid":`profile-logout`,disabled:k.isPending,loading:k.isPending,onClick:()=>k.mutate(),type:`button`,uiSize:`sm`,children:k.isPending?void 0:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{"aria-hidden":!0,className:`size-tinyrack-lg`}),(0,Z.jsx)(p,{as:`span`,className:`hidden sm:inline`,variant:`bodySm`,children:t(`profile.logout`)})]})}),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-tinyrack-lg`,children:[(0,Z.jsx)(se,{email:M.email,size:`lg`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-tinyrack-3xs`,children:[(0,Z.jsx)(ae,{title:t(`profile.title`)}),(0,Z.jsx)(p,{as:`p`,color:`muted`,"data-testid":`profile-user-email`,truncate:!0,variant:`bodySm`,children:M.email})]})]}),c&&(0,Z.jsx)(z,{icon:T,type:`error`,children:c}),M&&(0,Z.jsx)(Ie,{user:M}),(0,Z.jsxs)(w.Root,{variant:`outlined`,children:[(0,Z.jsxs)(w.Header,{className:`border-tinyrack-border border-b-tinyrack-default px-tinyrack-lg py-tinyrack-md`,children:[(0,Z.jsx)(w.Title,{children:t(`profile.security.title`)}),(0,Z.jsx)(w.Description,{children:t(`profile.security.description`)})]}),H&&M.totp_recovery_codes_missing&&(0,Z.jsx)(`div`,{className:`border-tinyrack-border border-b-tinyrack-default px-tinyrack-lg py-tinyrack-md`,"data-testid":`profile-totp-recovery-warning`,children:(0,Z.jsx)(z,{icon:T,type:`warning`,children:t(`profile.totp.recoveryCodesMissing`)})}),(0,Z.jsxs)(w.Content,{className:`divide-y divide-tinyrack-border p-0`,children:[(0,Z.jsx)(je,{hasOtherPrimaryMethod:te||R&&M.passkey_count>0,hasPassword:M.has_password,hasSecondFactorOnly:M.has_password&&!te&&!(R&&M.passkey_count>0)&&M.totp_registered,isConfigManaged:F,onOpenModal:_}),H&&(0,Z.jsx)(Me,{onOpenModal:y,recoveryCodesMissing:M.totp_recovery_codes_missing,totpEnabled:M.totp_registered}),ce&&(0,Z.jsx)(Ae,{onOpenModal:x,passkeyCount:M.passkey_count})]})]}),U&&(0,Z.jsx)(ke,{getAuthorizeUrl:et,onUnlinkRequest:e=>h({id:e.id,name:e.display_name}),providers:P,unlinkingProvider:l}),(0,Z.jsx)(De,{isConfigManaged:F,isDeletionEnabled:oe,onDeleteClick:()=>E(!0)}),(0,Z.jsx)(Ye,{isOpen:g===`set`,onClose:()=>_(null)}),(0,Z.jsx)(Ve,{isOpen:g===`change`,onClose:()=>_(null)}),(0,Z.jsx)(Je,{isOpen:g===`remove`,onClose:()=>_(null)}),(0,Z.jsx)(Ze,{isOpen:v===`setup`,onClose:()=>y(null)}),(0,Z.jsx)(We,{isOpen:v===`disable`,onClose:()=>y(null)}),(0,Z.jsx)(qe,{isOpen:v===`regenerate`,onClose:()=>y(null)}),(0,Z.jsx)(Xe,{isOpen:b===`setup`,onClose:()=>x(null)}),(0,Z.jsx)(Ge,{isOpen:b===`manage`,onAddNew:()=>x(`setup`),onClose:()=>x(null)}),(0,Z.jsx)(Pe,{isOpen:d!==null,isPending:A.isPending,onClose:()=>h(null),onConfirm:j,providerName:d?.name??``}),(0,Z.jsx)(Ue,{isOpen:S,onClose:()=>E(!1),retentionDays:V})]})}var it=i(function({error:e}){return(0,Z.jsx)(ve,{component:nt,error:e})}),at=n(function({loaderData:e}){return(0,Z.jsx)(_e,{state:e.dehydratedState,children:(0,Z.jsx)(rt,{search:e.search})})});export{it as ErrorBoundary,at as default};
@@ -0,0 +1 @@
1
+ import{$ as e,J as t,a as n,f as r,o as i}from"./components-DF4L3dSB.js";import{c as a}from"./toast-XXVYYXim.js";import{t as o}from"./jsx-runtime-B-57GDDH.js";import{L as s,a as c,n as l,t as u}from"./api-CfCwvXbU.js";import{r as d}from"./text-CBHShrvS.js";import{t as f}from"./useMutation-BkuKGzks.js";import{t as p}from"./mutationOptions-Dfvzj6n2.js";import{r as m}from"./NullStore-UyCsFQfz.js";import{t as h}from"./auth-field-CDCz-y27.js";import{n as g}from"./language-selector-Jso2cQNI.js";import{t as _}from"./lock-Cr_egoXD.js";import{t as v}from"./mail-B2PK2vlI.js";import{t as y}from"./security-error-message-CMsTsiWf.js";import{t as b}from"./route-error-fallback-CRL2Et8O.js";import{r as x,t as S}from"./standard-schema-kM5DbC12.js";import{r as C}from"./FieldItemContext-B3N2qWH8.js";import{a as ee,r as w,s as T}from"./schemas-B87iTMww.js";import{t as E}from"./document-navigation-FZbb5ldf.js";import{n as D,t as O}from"./promise-BP9iSIs-.js";import{o as k}from"./passkey-CJhT-7yO.js";import{n as A,r as j,t as M}from"./route-module-2foR49uh.js";import{t as N}from"./auth-layout-sea6nww4.js";import{t as te}from"./link-Dsq51NsW.js";import{n as P,t as F}from"./auth-footer-LG_gGuJv.js";import{i as I,r as L,t as R}from"./oauth-search-DebNssaC.js";import{t as z}from"./sanitized-rich-text-uZcpKo6H.js";var B=e(t(),1),V=p({mutationFn:async e=>{let t=await u.api.auth.login.$post({json:e});return l(t)}}),H=o();function U({search:e}){let{t,i18n:n}=c(),[i,o]=(0,B.useState)(!1);(0,B.useEffect)(()=>{o(!0)},[]);let l=r(),u=s(),p=(0,B.useCallback)((e,t)=>l(t?j(e,t):e),[l]),b=e.account_selection_state&&e.prompt?.split(` `).includes(`login`)?{...e,account_selected:1}:e,A=e.lang??n.language,{data:M}=d(g),U=M.registration.signup_notice?.[A]??M.registration.signup_notice?.[M.i18n.fallback_language],W=M.auth.password.enabled,G=M.auth.passkey.enabled,K=M.identity_providers.length+ +!!W+ +!!G>1,q=(0,B.useMemo)(()=>ee({email:T().min(1,t(`validation.email.required`)).pipe(w(t(`validation.email.invalid`))),password:T().min(1,t(`validation.password.required`))}),[t]),J=f({...V,onSuccess:async(t,n)=>{let r=t.user;if(r.email_verification_required&&!r.email_verified){p(`/verify/email`,{email:n.email,...L(e)});return}u.setQueryData(D.queryKey,{user:r}),await O();let i=[];if(M.auth.password.totp.enabled&&r.totp_registered&&i.push(`totp`),M.auth.passkey.enabled&&r.passkey_count>0&&i.push(`passkey`),r.second_factor_required&&i.length===0){if(M.available_2fa_setup_methods.length>1)return p(`/setup/2fa`,L(e));if(M.available_2fa_setup_methods.length===1)return M.available_2fa_setup_methods[0]===`totp`?p(`/setup/totp`,L(e)):p(`/setup/passkey`,{...L(e),passkey_name:`default`})}if(i.length>1)return p(`/verify/2fa`,L(e));if(i.length===1)return i[0]===`totp`?p(`/verify/totp`,L(e)):p(`/verify/passkey`,L(e));if(I(e))E(R(b));else return l(`/profile`)},onError:e=>{ne(`email`,{type:`manual`,message:y(e,t,t(`login.error.failed`))})}}),Y=(0,B.useCallback)(async t=>{t.user&&(u.setQueryData(D.queryKey,t),await O(),I(e)?E(R(b)):l(`/profile`)),u.invalidateQueries({queryKey:D.queryKey})},[u,l,e,b]),X=(0,B.useRef)(null),Z=(0,B.useRef)(Y);(0,B.useEffect)(()=>{Z.current=Y},[Y]),(0,B.useEffect)(()=>{if(!G||!W)return;let e=new AbortController;return X.current=e,k(e=>{Z.current(e)},e.signal),()=>{e.abort()}},[G,W]);let{register:Q,setError:ne,handleSubmit:re,formState:{errors:$}}=x({defaultValues:{email:``,password:``},resolver:S(q)});return(0,H.jsxs)(N,{showBrandSubtitle:!0,children:[W&&(0,H.jsxs)(C,{className:`flex flex-col gap-tinyrack-lg`,method:`post`,onSubmit:re(e=>{X.current?.abort(),J.mutate(e)}),children:[(0,H.jsx)(h,{autoComplete:`username webauthn`,disabled:!i,error:$.email,icon:v,label:t(`login.email.label`),placeholder:t(`login.email.placeholder`),...Q(`email`),type:`email`}),(0,H.jsx)(h,{autoComplete:`current-password`,disabled:!i,error:$.password,icon:_,label:t(`login.password.label`),labelAction:M.email.enabled?(0,H.jsx)(te,{className:`text-tinyrack-xs`,render:(0,H.jsx)(a,{to:`/password/forgot`}),children:t(`login.link.forgotPassword`)}):void 0,placeholder:t(`login.password.placeholder`),...Q(`password`),type:`password`}),(0,H.jsx)(m,{className:`w-full`,disabled:!i,intent:`primary`,loading:J.isPending,loadingLabel:t(`login.submitting`),type:`submit`,uiSize:`lg`,children:t(`login.submit`)})]}),U&&(0,H.jsx)(z,{html:U,variant:`notice`}),(M.registration.public_registration||K)&&(0,H.jsxs)(F,{children:[M.registration.public_registration&&(0,H.jsx)(P,{link:(0,H.jsx)(a,{to:j(`/register`,L(e)),children:t(`login.link.register`)}),text:t(`login.footer.noAccount`)}),K&&(0,H.jsx)(P,{link:(0,H.jsx)(a,{to:j(`/login`,L(e)),children:t(`login.password.backToMethods`)})})]})]})}var W=i(function({error:e}){return(0,H.jsx)(M,{component:b,error:e})}),G=n(function({loaderData:e}){return(0,H.jsx)(A,{state:e.dehydratedState,children:(0,H.jsx)(U,{search:e.search})})});export{W as ErrorBoundary,G as default};
@@ -0,0 +1 @@
1
+ import{$ as e,J as t,a as n,f as r,o as i}from"./components-DF4L3dSB.js";import{c as a}from"./toast-XXVYYXim.js";import{t as o}from"./jsx-runtime-B-57GDDH.js";import{a as s,i as c}from"./api-CfCwvXbU.js";import{t as l}from"./text-CBHShrvS.js";import{t as u}from"./useMutation-BkuKGzks.js";import{V as d}from"./select-C_WHBpl_.js";import{r as f}from"./NullStore-UyCsFQfz.js";import{t as p}from"./auth-field-CDCz-y27.js";import{t as m}from"./mail-B2PK2vlI.js";import{t as h}from"./auth-page-header-CV85AJLW.js";import{t as g}from"./security-error-message-CMsTsiWf.js";import{t as _}from"./auth-outcome-DyY0JgWG.js";import{t as v}from"./route-error-fallback-CRL2Et8O.js";import{r as y,t as b}from"./standard-schema-kM5DbC12.js";import{r as x}from"./FieldItemContext-B3N2qWH8.js";import{a as S,r as C,s as w}from"./schemas-B87iTMww.js";import{n as T,t as E}from"./route-module-2foR49uh.js";import{t as D}from"./auth-layout-sea6nww4.js";import{n as O,t as k}from"./auth-footer-LG_gGuJv.js";import{t as A}from"./password-reset-BhkJhVQ4.js";var j={name:`mail-check`,size:24,node:[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]};j.node;var M=d(j),N=e(t(),1),P=o();function F(){let{t:e}=s(),t=r(),[n,i]=(0,N.useState)(!1),[o,d]=(0,N.useState)(``),v=(0,N.useMemo)(()=>S({email:w().min(1,e(`validation.email.required`)).pipe(C(e(`validation.email.invalid`)))}),[e]),T=u({...A,onSuccess:()=>{i(!0)}}),{register:E,setError:j,handleSubmit:F,formState:{errors:I}}=y({defaultValues:{email:``},resolver:b(v)});return n?(0,P.jsx)(D,{children:(0,P.jsx)(`div`,{"data-testid":`alert-success`,children:(0,P.jsxs)(_,{description:(0,P.jsxs)(P.Fragment,{children:[e(`forgotPassword.success.subtitle`),(0,P.jsx)(`br`,{}),e(`forgotPassword.success.description`,{email:o})]}),icon:M,title:e(`forgotPassword.success.title`),tone:`success`,children:[(0,P.jsx)(f,{className:`w-full`,intent:`primary`,onClick:()=>t(`/login`),type:`button`,uiSize:`lg`,children:e(`forgotPassword.backToLogin`)}),(0,P.jsx)(l,{align:`center`,color:`muted`,variant:`caption`,children:e(`forgotPassword.success.checkSpam`)})]})})}):(0,P.jsxs)(D,{children:[(0,P.jsx)(h,{subtitle:e(`forgotPassword.subtitle`),title:e(`forgotPassword.title`)}),(0,P.jsxs)(x,{className:`flex flex-col gap-tinyrack-lg`,onSubmit:F(async t=>{try{d(t.email),await T.mutateAsync(t)}catch(t){t&&typeof t==`object`&&`code`in t&&t.code===`USER_NOT_EDITABLE`?j(`email`,{type:`manual`,message:e(`forgotPassword.error.notEditable`)}):t instanceof c&&t.code===`TOO_MANY_REQUESTS`?j(`email`,{type:`manual`,message:g(t,e,e(`error.defaultMessage`))}):i(!0)}}),children:[(0,P.jsx)(p,{autoComplete:`email`,error:I.email,icon:m,label:e(`forgotPassword.email.label`),placeholder:e(`forgotPassword.email.placeholder`),...E(`email`),type:`email`}),(0,P.jsx)(f,{className:`w-full`,intent:`primary`,loading:T.isPending,loadingLabel:e(`forgotPassword.submitting`),type:`submit`,uiSize:`lg`,children:e(`forgotPassword.submit`)})]}),(0,P.jsx)(k,{children:(0,P.jsx)(O,{link:(0,P.jsx)(a,{to:`/login`,children:e(`register.link.login`)}),text:e(`forgotPassword.footer.rememberedPassword`)})})]})}var I=i(function({error:e}){return(0,P.jsx)(E,{component:v,error:e})}),L=n(function({loaderData:e}){return(0,P.jsx)(T,{state:e.dehydratedState,children:(0,P.jsx)(F,{})})});export{I as ErrorBoundary,L as default};
@@ -1 +1 @@
1
- import{$ as e,J as t,a as n,f as r}from"./components-DF4L3dSB.js";import{c as i}from"./toast-XXVYYXim.js";import{t as a}from"./jsx-runtime-B-57GDDH.js";import{L as o,a as s,n as c,t as l}from"./api-CfCwvXbU.js";import{n as u,t as d}from"./text-CBHShrvS.js";import{t as f}from"./useMutation-BkuKGzks.js";import{t as p}from"./useQuery-BLm0XsTI.js";import{i as m,r as h}from"./NullStore-UyCsFQfz.js";import{t as g}from"./circle-alert-BZCKPkRn.js";import{t as _}from"./fingerprint-pattern-AUfgwio5.js";import{r as v}from"./language-selector-Chn-k7Pw.js";import{t as y}from"./auth-page-header-BVY4zRzF.js";import{t as b}from"./link-button-DGt9hwk7.js";import{t as x}from"./alert-DS8e0Gvg.js";import{n as S,t as C}from"./promise-EbDcmV0j.js";import{t as w}from"./passkey-CWcdr7Vy.js";import{t as T}from"./document-navigation-Cnp3Alf0.js";import{n as E,r as D}from"./route-module-2foR49uh.js";import{t as O}from"./auth-layout-B4h13HhN.js";import{n as k,t as A}from"./auth-footer-LG_gGuJv.js";import{a as j,r as M,t as N}from"./oauth-search-DybZ6VWp.js";import{t as P}from"./passkey-error-C3DrncLi.js";var F=e(t(),1),I=u({queryKey:v.pendingSecondFactorMethods(),queryFn:async()=>{let e=await l.api.auth[`2fa`].methods.$get();return c(e)},retry:!1}),L=a();function R({search:e}){let{t}=s(),n=r(),a=o(),[c,l]=(0,F.useState)(null),u=(0,F.useRef)(!1),v=p({...I,enabled:c!==null}).data?.methods.includes(`totp`)??!1,E=e=>{switch(e){case`unsupported`:return t(`verifyPasskey.error.unsupported`);case`not_allowed`:return t(`verifyPasskey.error.notAllowed`);case`expired`:return t(`verifyPasskey.error.expired`);case`user_mismatch`:return t(`verifyPasskey.error.userMismatch`);case`verification_failed`:return t(`verifyPasskey.error.failed`)}},R=f({...w,onSuccess:async t=>{t.user&&(a.setQueryData(S.queryKey,{user:t.user}),await C(),j(e)?T(N(e)):await n(`/profile`))},onError:async e=>{let t=P(e);l({message:E(t),reason:t})}});return(0,F.useEffect)(()=>{u.current||(u.current=!0,R.mutate())},[R]),(0,L.jsxs)(O,{children:[(0,L.jsx)(y,{align:`center`,subtitle:t(`verifyPasskey.subtitle`),title:t(`verifyPasskey.title`)}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg`,children:[(0,L.jsx)(`div`,{className:`flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted`,children:(0,L.jsx)(_,{"aria-hidden":!0,className:`size-tinyrack-2xl text-tinyrack-text-muted`})}),R.isPending&&(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-sm`,children:[(0,L.jsx)(m,{uiSize:`md`}),(0,L.jsx)(d,{align:`center`,as:`p`,color:`muted`,variant:`bodySm`,children:t(`verifyPasskey.waiting`)})]}),c&&(0,L.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-tinyrack-md`,children:[(0,L.jsx)(x,{className:`w-full`,icon:g,type:`error`,children:c.message}),v&&(0,L.jsx)(b,{className:`w-full`,intent:`primary`,render:(0,L.jsx)(i,{to:D(`/verify/totp`,M(e))}),uiSize:`lg`,children:t(`verifyPasskey.useTotp`)}),(0,L.jsx)(h,{appearance:v?`outline`:`solid`,className:`w-full`,intent:v?`neutral`:`primary`,onClick:()=>{l(null),R.mutate()},type:`button`,uiSize:`lg`,children:t(`verifyPasskey.retry`)})]})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(i,{to:D(`/login`,e),children:t(`verifyPasskey.backToLogin`)})})})]})}var z=n(function({loaderData:e}){return(0,L.jsx)(E,{state:e.dehydratedState,children:(0,L.jsx)(R,{search:e.search})})});export{z as default};
1
+ import{$ as e,J as t,a as n,f as r}from"./components-DF4L3dSB.js";import{c as i}from"./toast-XXVYYXim.js";import{t as a}from"./jsx-runtime-B-57GDDH.js";import{L as o,a as s,n as c,t as l}from"./api-CfCwvXbU.js";import{n as u,t as d}from"./text-CBHShrvS.js";import{t as f}from"./useMutation-BkuKGzks.js";import{t as p}from"./useQuery-BLm0XsTI.js";import{i as m,r as h}from"./NullStore-UyCsFQfz.js";import{t as g}from"./circle-alert-BZCKPkRn.js";import{t as _}from"./fingerprint-pattern-AUfgwio5.js";import{r as v}from"./language-selector-Jso2cQNI.js";import{t as y}from"./auth-page-header-CV85AJLW.js";import{t as b}from"./link-button-DGt9hwk7.js";import{t as x}from"./alert-DS8e0Gvg.js";import{t as S}from"./document-navigation-FZbb5ldf.js";import{n as C,t as w}from"./promise-BP9iSIs-.js";import{t as T}from"./passkey-CJhT-7yO.js";import{n as E,r as D}from"./route-module-2foR49uh.js";import{t as O}from"./auth-layout-sea6nww4.js";import{n as k,t as A}from"./auth-footer-LG_gGuJv.js";import{i as j,r as M,t as N}from"./oauth-search-DebNssaC.js";import{t as P}from"./passkey-error-C3DrncLi.js";var F=e(t(),1),I=u({queryKey:v.pendingSecondFactorMethods(),queryFn:async()=>{let e=await l.api.auth[`2fa`].methods.$get();return c(e)},retry:!1}),L=a();function R({search:e}){let{t}=s(),n=r(),a=o(),[c,l]=(0,F.useState)(null),u=(0,F.useRef)(!1),v=p({...I,enabled:c!==null}).data?.methods.includes(`totp`)??!1,E=e=>{switch(e){case`unsupported`:return t(`verifyPasskey.error.unsupported`);case`not_allowed`:return t(`verifyPasskey.error.notAllowed`);case`expired`:return t(`verifyPasskey.error.expired`);case`user_mismatch`:return t(`verifyPasskey.error.userMismatch`);case`verification_failed`:return t(`verifyPasskey.error.failed`)}},R=f({...T,onSuccess:async t=>{t.user&&(a.setQueryData(C.queryKey,{user:t.user}),await w(),j(e)?S(N(e)):await n(`/profile`))},onError:async e=>{let t=P(e);l({message:E(t),reason:t})}});return(0,F.useEffect)(()=>{u.current||(u.current=!0,R.mutate())},[R]),(0,L.jsxs)(O,{children:[(0,L.jsx)(y,{align:`center`,subtitle:t(`verifyPasskey.subtitle`),title:t(`verifyPasskey.title`)}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-lg`,children:[(0,L.jsx)(`div`,{className:`flex size-tinyrack-3xl items-center justify-center rounded-tinyrack-full bg-tinyrack-surface-muted`,children:(0,L.jsx)(_,{"aria-hidden":!0,className:`size-tinyrack-2xl text-tinyrack-text-muted`})}),R.isPending&&(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-tinyrack-sm`,children:[(0,L.jsx)(m,{uiSize:`md`}),(0,L.jsx)(d,{align:`center`,as:`p`,color:`muted`,variant:`bodySm`,children:t(`verifyPasskey.waiting`)})]}),c&&(0,L.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-tinyrack-md`,children:[(0,L.jsx)(x,{className:`w-full`,icon:g,type:`error`,children:c.message}),v&&(0,L.jsx)(b,{className:`w-full`,intent:`primary`,render:(0,L.jsx)(i,{to:D(`/verify/totp`,M(e))}),uiSize:`lg`,children:t(`verifyPasskey.useTotp`)}),(0,L.jsx)(h,{appearance:v?`outline`:`solid`,className:`w-full`,intent:v?`neutral`:`primary`,onClick:()=>{l(null),R.mutate()},type:`button`,uiSize:`lg`,children:t(`verifyPasskey.retry`)})]})]}),(0,L.jsx)(A,{children:(0,L.jsx)(k,{link:(0,L.jsx)(i,{to:D(`/login`,e),children:t(`verifyPasskey.backToLogin`)})})})]})}var z=n(function({loaderData:e}){return(0,L.jsx)(E,{state:e.dehydratedState,children:(0,L.jsx)(R,{search:e.search})})});export{z as default};
@@ -1 +1 @@
1
- import{a as e}from"./components-DF4L3dSB.js";import{t}from"./jsx-runtime-B-57GDDH.js";import{a as n}from"./api-CfCwvXbU.js";import{t as r}from"./text-CBHShrvS.js";import{B as i,t as a,z as o}from"./select-C_WHBpl_.js";import{s}from"./i18n-CMepi_uj.js";import{t as c}from"./language-selector-Chn-k7Pw.js";import{n as l}from"./route-module-2foR49uh.js";var u=t();function d(){let{t:e}=n(),{colorScheme:t,setColorScheme:l}=s(),d=[[`light`,e(`common.theme.light`)],[`dark`,e(`common.theme.dark`)]];return(0,u.jsxs)(`div`,{className:`mx-auto flex w-full max-w-tinyrack-measure-xl flex-col gap-tinyrack-2xl`,children:[(0,u.jsxs)(`header`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h1`,variant:`headingMd`,weight:`heading`,children:e(`admin.settings.title`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.description`)})]}),(0,u.jsxs)(`section`,{className:`grid items-start gap-tinyrack-md sm:grid-cols-2`,children:[(0,u.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h2`,variant:`headingSm`,children:e(`admin.settings.language`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.languageDescription`)})]}),(0,u.jsx)(c,{alwaysVisible:!0,className:`w-full sm:justify-self-end`,presentation:`field`,triggerClassName:`w-full min-w-full`,uiSize:`md`})]}),(0,u.jsxs)(`section`,{className:`grid items-start gap-tinyrack-md sm:grid-cols-2`,children:[(0,u.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h2`,variant:`headingSm`,children:e(`admin.settings.theme`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.themeDescription`)})]}),(0,u.jsxs)(a.Root,{onValueChange:e=>{(e===`light`||e===`dark`)&&l(e)},value:t,children:[(0,u.jsxs)(a.Trigger,{appearance:`solid`,"aria-label":e(`admin.settings.theme`),className:`w-full sm:justify-self-end`,uiSize:`md`,children:[(0,u.jsx)(a.Value,{children:d.find(([e])=>e===t)?.[1]}),(0,u.jsx)(a.Icon,{children:(0,u.jsx)(o,{"aria-hidden":!0})})]}),(0,u.jsx)(a.Portal,{children:(0,u.jsx)(a.Positioner,{children:(0,u.jsx)(a.Popup,{children:(0,u.jsx)(a.List,{children:d.map(([e,t])=>(0,u.jsxs)(a.Item,{value:e,children:[(0,u.jsx)(a.ItemText,{children:t}),(0,u.jsx)(a.ItemIndicator,{children:(0,u.jsx)(i,{"aria-hidden":!0})})]},e))})})})})]})]})]})}var f=e(function({loaderData:e}){return(0,u.jsx)(l,{state:e.dehydratedState,children:(0,u.jsx)(d,{})})});export{f as default};
1
+ import{a as e}from"./components-DF4L3dSB.js";import{t}from"./jsx-runtime-B-57GDDH.js";import{a as n}from"./api-CfCwvXbU.js";import{t as r}from"./text-CBHShrvS.js";import{B as i,t as a,z as o}from"./select-C_WHBpl_.js";import{s}from"./i18n-vfKY-byx.js";import{t as c}from"./language-selector-Jso2cQNI.js";import{n as l}from"./route-module-2foR49uh.js";var u=t();function d(){let{t:e}=n(),{colorScheme:t,setColorScheme:l}=s(),d=[[`light`,e(`common.theme.light`)],[`dark`,e(`common.theme.dark`)]];return(0,u.jsxs)(`div`,{className:`mx-auto flex w-full max-w-tinyrack-measure-xl flex-col gap-tinyrack-2xl`,children:[(0,u.jsxs)(`header`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h1`,variant:`headingMd`,weight:`heading`,children:e(`admin.settings.title`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.description`)})]}),(0,u.jsxs)(`section`,{className:`grid items-start gap-tinyrack-md sm:grid-cols-2`,children:[(0,u.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h2`,variant:`headingSm`,children:e(`admin.settings.language`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.languageDescription`)})]}),(0,u.jsx)(c,{alwaysVisible:!0,className:`w-full sm:justify-self-end`,presentation:`field`,triggerClassName:`w-full min-w-full`,uiSize:`md`})]}),(0,u.jsxs)(`section`,{className:`grid items-start gap-tinyrack-md sm:grid-cols-2`,children:[(0,u.jsxs)(`div`,{className:`flex flex-col gap-tinyrack-xs`,children:[(0,u.jsx)(r,{as:`h2`,variant:`headingSm`,children:e(`admin.settings.theme`)}),(0,u.jsx)(r,{as:`p`,color:`muted`,variant:`bodySm`,children:e(`admin.settings.themeDescription`)})]}),(0,u.jsxs)(a.Root,{onValueChange:e=>{(e===`light`||e===`dark`)&&l(e)},value:t,children:[(0,u.jsxs)(a.Trigger,{appearance:`solid`,"aria-label":e(`admin.settings.theme`),className:`w-full sm:justify-self-end`,uiSize:`md`,children:[(0,u.jsx)(a.Value,{children:d.find(([e])=>e===t)?.[1]}),(0,u.jsx)(a.Icon,{children:(0,u.jsx)(o,{"aria-hidden":!0})})]}),(0,u.jsx)(a.Portal,{children:(0,u.jsx)(a.Positioner,{children:(0,u.jsx)(a.Popup,{children:(0,u.jsx)(a.List,{children:d.map(([e,t])=>(0,u.jsxs)(a.Item,{value:e,children:[(0,u.jsx)(a.ItemText,{children:t}),(0,u.jsx)(a.ItemIndicator,{children:(0,u.jsx)(i,{"aria-hidden":!0})})]},e))})})})})]})]})]})}var f=e(function({loaderData:e}){return(0,u.jsx)(l,{state:e.dehydratedState,children:(0,u.jsx)(d,{})})});export{f as default};
@@ -0,0 +1 @@
1
+ import{a as e,t}from"./components-DF4L3dSB.js";import{t as n}from"./jsx-runtime-B-57GDDH.js";import{n as r}from"./auth-layout-sea6nww4.js";var i=n(),a=e(function(){return(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as default};
@@ -1 +1 @@
1
- import{a as e,o as t}from"./components-DF4L3dSB.js";import{c as n}from"./toast-XXVYYXim.js";import{t as r}from"./jsx-runtime-B-57GDDH.js";import{L as i,a,n as o,t as s}from"./api-CfCwvXbU.js";import{n as c,r as l}from"./text-CBHShrvS.js";import{t as u}from"./useMutation-BkuKGzks.js";import{t as d}from"./mutationOptions-Dfvzj6n2.js";import{V as f}from"./select-C_WHBpl_.js";import{n as p}from"./shell-header-bar-Bg85QIAq.js";import{r as m}from"./NullStore-UyCsFQfz.js";import{t as h}from"./auth-choice-row-DNB3B1Vs.js";import{r as g}from"./language-selector-Chn-k7Pw.js";import{t as _}from"./trash-C7RyeTUJ.js";import{t as v}from"./auth-page-header-BVY4zRzF.js";import{t as y}from"./link-button-DGt9hwk7.js";import{t as b}from"./alert-DS8e0Gvg.js";import{t as x}from"./initial-avatar-ByHiX-IF.js";import{t as S}from"./route-error-fallback-CRL2Et8O.js";import{t as C}from"./badge-Cr0iG_iG.js";import{t as w}from"./document-navigation-Cnp3Alf0.js";import{n as T,t as E}from"./route-module-2foR49uh.js";import{t as D}from"./auth-layout-B4h13HhN.js";import{n as O,r as k}from"./oauth-search-DybZ6VWp.js";var A={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};A.node;var j=f(A),M={name:`circle-user-round`,size:24,node:[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`user-circle-2`]};M.node;var N=f(M),P={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};P.node;var F=f(P);function I(e,t){return c({queryKey:g.accounts(t),queryFn:async()=>{let n=await e.api.auth.accounts.$get({query:t?{client_id:t}:{}});return o(n)}})}function L(e){return I(s,e)}var R=d({mutationFn:async e=>{let t=await s.api.auth.accounts.select.$post({json:e});return o(t)}}),z=d({mutationFn:async e=>{let t=await s.api.auth.accounts.remove.$post({json:e});return o(t)}}),B=r();function V(e){let t=e?.split(` `).filter(Boolean)??[];return t.includes(`login`)||t.push(`login`),t.join(` `)}function H(e){let t=k(e),n=new URLSearchParams;for(let[e,r]of Object.entries({...t,prompt:V(t.prompt),account_selected:1}))r!==void 0&&n.set(e,String(r));return`/login?${n.toString()}`}function U({search:e}){let{t}=a(),r=i(),{data:o}=l(L(e.client_id)),s=o.accounts.length===0&&!o.allow_add_account,c=()=>{w(O({...e,account_selected:1}))},d=u({...R,onSuccess:c}),f=u({...z,onSuccess:()=>{r.invalidateQueries({queryKey:g.accounts(e.client_id)})}});return(0,B.jsxs)(D,{width:`wide`,children:[(0,B.jsx)(v,{subtitle:t(`accountSelect.subtitle`),title:t(`accountSelect.title`)}),o.accounts.length===0?(0,B.jsx)(b,{icon:N,type:`info`,children:t(s?`accountSelect.unavailable`:`accountSelect.noRememberedAccounts`)}):(0,B.jsx)(`div`,{className:`flex flex-col gap-tinyrack-sm`,"data-testid":`account-list`,children:o.accounts.map(e=>(0,B.jsx)(`div`,{"data-testid":`remembered-account-${e.sub}`,children:(0,B.jsx)(h,{description:e.current?t(`accountSelect.currentAccount`):t(`accountSelect.rememberedAccount`),indicator:e.current?(0,B.jsx)(C,{className:`shrink-0 whitespace-nowrap`,uiSize:`md`,variant:`info`,children:t(`accountSelect.current`)}):null,label:e.email,leading:(0,B.jsx)(x,{email:e.email,size:`md`}),render:(0,B.jsx)(m,{"data-testid":`select-account-${e.sub}`,disabled:d.isPending,onClick:()=>d.mutate({sub:e.sub}),type:`button`,uiSize:`lg`}),selected:e.current,surface:`card`,trailing:o.allow_remove_account&&!e.current?(0,B.jsx)(p,{appearance:`ghost`,"aria-label":t(`accountSelect.removeAccount`,{email:e.email}),"data-testid":`remove-account-${e.sub}`,disabled:f.isPending,intent:`neutral`,onClick:()=>f.mutate({sub:e.sub}),type:`button`,uiSize:`sm`,children:(0,B.jsx)(_,{"aria-hidden":!0,className:`size-tinyrack-lg`})}):null})},e.sub))}),o.allow_add_account?(0,B.jsxs)(y,{appearance:`ghost`,className:`w-full justify-between`,intent:`neutral`,render:(0,B.jsx)(n,{to:H(e)}),uiSize:`lg`,children:[(0,B.jsx)(F,{"aria-hidden":!0,className:`size-tinyrack-lg`}),t(`accountSelect.useAnotherAccount`),(0,B.jsx)(j,{"aria-hidden":!0,className:`size-tinyrack-lg`})]}):null]})}var W=t(function({error:e}){return(0,B.jsx)(E,{component:S,error:e})}),G=e(function({loaderData:e}){return(0,B.jsx)(T,{state:e.dehydratedState,children:(0,B.jsx)(U,{search:e.search})})});export{W as ErrorBoundary,G as default};
1
+ import{a as e,o as t}from"./components-DF4L3dSB.js";import{c as n}from"./toast-XXVYYXim.js";import{t as r}from"./jsx-runtime-B-57GDDH.js";import{L as i,a,n as o,t as s}from"./api-CfCwvXbU.js";import{n as c,r as l}from"./text-CBHShrvS.js";import{t as u}from"./useMutation-BkuKGzks.js";import{t as d}from"./mutationOptions-Dfvzj6n2.js";import{V as f}from"./select-C_WHBpl_.js";import{n as p}from"./shell-header-bar-DRx10tE5.js";import{r as m}from"./NullStore-UyCsFQfz.js";import{t as h}from"./auth-choice-row-DNB3B1Vs.js";import{r as g}from"./language-selector-Jso2cQNI.js";import{t as _}from"./trash-C7RyeTUJ.js";import{t as v}from"./auth-page-header-CV85AJLW.js";import{t as y}from"./link-button-DGt9hwk7.js";import{t as b}from"./alert-DS8e0Gvg.js";import{t as x}from"./initial-avatar-ByHiX-IF.js";import{t as S}from"./route-error-fallback-CRL2Et8O.js";import{t as C}from"./document-navigation-FZbb5ldf.js";import{t as w}from"./badge-Cr0iG_iG.js";import{n as T,t as E}from"./route-module-2foR49uh.js";import{t as D}from"./auth-layout-sea6nww4.js";import{n as O,r as k}from"./oauth-search-DebNssaC.js";var A={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};A.node;var j=f(A),M={name:`circle-user-round`,size:24,node:[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`user-circle-2`]};M.node;var N=f(M),P={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};P.node;var F=f(P);function I(e,t){return c({queryKey:g.accounts(t),queryFn:async()=>{let n=await e.api.auth.accounts.$get({query:t?{client_id:t}:{}});return o(n)}})}function L(e){return I(s,e)}var R=d({mutationFn:async e=>{let t=await s.api.auth.accounts.select.$post({json:e});return o(t)}}),z=d({mutationFn:async e=>{let t=await s.api.auth.accounts.remove.$post({json:e});return o(t)}}),B=r();function V(e){let t=e?.split(` `).filter(Boolean)??[];return t.includes(`login`)||t.push(`login`),t.join(` `)}function H(e){let t=k(e),n=new URLSearchParams;for(let[e,r]of Object.entries({...t,prompt:V(t.prompt),account_selected:1}))r!==void 0&&n.set(e,String(r));return`/login?${n.toString()}`}function U({search:e}){let{t}=a(),r=i(),{data:o}=l(L(e.client_id)),s=o.accounts.length===0&&!o.allow_add_account,c=()=>{C(O({...e,account_selected:1}))},d=u({...R,onSuccess:c}),f=u({...z,onSuccess:()=>{r.invalidateQueries({queryKey:g.accounts(e.client_id)})}});return(0,B.jsxs)(D,{width:`wide`,children:[(0,B.jsx)(v,{subtitle:t(`accountSelect.subtitle`),title:t(`accountSelect.title`)}),o.accounts.length===0?(0,B.jsx)(b,{icon:N,type:`info`,children:t(s?`accountSelect.unavailable`:`accountSelect.noRememberedAccounts`)}):(0,B.jsx)(`div`,{className:`flex flex-col gap-tinyrack-sm`,"data-testid":`account-list`,children:o.accounts.map(e=>(0,B.jsx)(`div`,{"data-testid":`remembered-account-${e.sub}`,children:(0,B.jsx)(h,{description:e.current?t(`accountSelect.currentAccount`):t(`accountSelect.rememberedAccount`),indicator:e.current?(0,B.jsx)(w,{className:`shrink-0 whitespace-nowrap`,uiSize:`md`,variant:`info`,children:t(`accountSelect.current`)}):null,label:e.email,leading:(0,B.jsx)(x,{email:e.email,size:`md`}),render:(0,B.jsx)(m,{"data-testid":`select-account-${e.sub}`,disabled:d.isPending,onClick:()=>d.mutate({sub:e.sub}),type:`button`,uiSize:`lg`}),selected:e.current,surface:`card`,trailing:o.allow_remove_account&&!e.current?(0,B.jsx)(p,{appearance:`ghost`,"aria-label":t(`accountSelect.removeAccount`,{email:e.email}),"data-testid":`remove-account-${e.sub}`,disabled:f.isPending,intent:`neutral`,onClick:()=>f.mutate({sub:e.sub}),type:`button`,uiSize:`sm`,children:(0,B.jsx)(_,{"aria-hidden":!0,className:`size-tinyrack-lg`})}):null})},e.sub))}),o.allow_add_account?(0,B.jsxs)(y,{appearance:`ghost`,className:`w-full justify-between`,intent:`neutral`,render:(0,B.jsx)(n,{to:H(e)}),uiSize:`lg`,children:[(0,B.jsx)(F,{"aria-hidden":!0,className:`size-tinyrack-lg`}),t(`accountSelect.useAnotherAccount`),(0,B.jsx)(j,{"aria-hidden":!0,className:`size-tinyrack-lg`})]}):null]})}var W=t(function({error:e}){return(0,B.jsx)(E,{component:S,error:e})}),G=e(function({loaderData:e}){return(0,B.jsx)(T,{state:e.dehydratedState,children:(0,B.jsx)(U,{search:e.search})})});export{W as ErrorBoundary,G as default};