@alook/app 0.1.46 → 0.1.47

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 (230) hide show
  1. package/bundled/email-worker/index.js +2 -2
  2. package/bundled/queue-worker/index.js +1 -1
  3. package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
  4. package/bundled/web/.open-next/assets/BUILD_ID +1 -1
  5. package/bundled/web/.open-next/assets/_next/static/chunks/{1thqqd8mgk392.js → 0_vlirz00r9q3.js} +1 -1
  6. package/bundled/web/.open-next/assets/_next/static/chunks/0fhupcu7gw5-g.js +1 -0
  7. package/bundled/web/.open-next/assets/_next/static/chunks/{00nwwh7t3-94u.js → 0t1fkk2aoe46s.js} +2 -2
  8. package/bundled/web/.open-next/assets/_next/static/chunks/{0bbbf3c--s4nt.js → 0xd95q8dh9nth.js} +1 -1
  9. package/bundled/web/.open-next/assets/_next/static/chunks/{0177g_82selwt.js → 0yvh-4_s35xb-.js} +1 -1
  10. package/bundled/web/.open-next/assets/_next/static/chunks/140rz0mf_gln5.js +1 -0
  11. package/bundled/web/.open-next/assets/_next/static/chunks/17_1uj99552co.js +1 -0
  12. package/bundled/web/.open-next/assets/_next/static/chunks/{2lzrcnv3h01ye.js → 188n8dv95gspf.js} +2 -2
  13. package/bundled/web/.open-next/assets/_next/static/chunks/1t1-4gr4g9-gk.js +1 -0
  14. package/bundled/web/.open-next/assets/_next/static/chunks/1vv8sekkn7ca7.js +1 -0
  15. package/bundled/web/.open-next/assets/_next/static/chunks/2009nt3x08t7f.js +1 -0
  16. package/bundled/web/.open-next/assets/_next/static/chunks/{2h4tal5a8ozdj.css → 21hdf3-tpkomr.css} +1 -1
  17. package/bundled/web/.open-next/assets/_next/static/chunks/2axyc5j5bmuu7.js +20 -0
  18. package/bundled/web/.open-next/assets/_next/static/chunks/2cg05psk59acc.css +1 -0
  19. package/bundled/web/.open-next/assets/_next/static/chunks/2l5ipmh5tt-zw.js +1 -0
  20. package/bundled/web/.open-next/assets/_next/static/chunks/{3j04_qzqc8w_l.js → 2mmbu93s7a0m4.js} +1 -1
  21. package/bundled/web/.open-next/assets/_next/static/chunks/2pi74q1djax_j.js +1 -0
  22. package/bundled/web/.open-next/assets/_next/static/chunks/2pup1a3f06cvv.js +1 -0
  23. package/bundled/web/.open-next/assets/_next/static/chunks/2rppouots3wnd.js +1 -0
  24. package/bundled/web/.open-next/assets/_next/static/chunks/2umnqrh2lz20p.js +1 -0
  25. package/bundled/web/.open-next/assets/_next/static/chunks/2wol9tomcwmy-.js +1 -0
  26. package/bundled/web/.open-next/assets/_next/static/chunks/{1nztgrf53ss2o.js → 34ad0gln6p9mc.js} +1 -1
  27. package/bundled/web/.open-next/assets/_next/static/chunks/3678fpz9w9yx7.js +1 -0
  28. package/bundled/web/.open-next/assets/_next/static/chunks/38-2d78030m_h.js +1 -0
  29. package/bundled/web/.open-next/assets/_next/static/chunks/{2uu-vuh4bhmn-.js → 392tyqmzowh4n.js} +1 -1
  30. package/bundled/web/.open-next/assets/_next/static/chunks/{42xemtm1t_inw.js → 3dweor92bn1fg.js} +1 -1
  31. package/bundled/web/.open-next/assets/_next/static/chunks/{0yrjoj6i80b13.js → 3fycjvwvjxxe7.js} +1 -1
  32. package/bundled/web/.open-next/assets/_next/static/chunks/{0a7ly50c0irhh.js → 3kp4-3im11oyn.js} +1 -1
  33. package/bundled/web/.open-next/assets/_next/static/chunks/{1e5hn5ft96mrw.js → 3qwk5pvuky-tc.js} +1 -1
  34. package/bundled/web/.open-next/assets/_next/static/chunks/3ud6196bax4yc.js +2 -0
  35. package/bundled/web/.open-next/assets/_next/static/chunks/{turbopack-3v2fy6lperb7_.js → turbopack-3t97qecmun8ck.js} +1 -1
  36. package/bundled/web/.open-next/assets/sw.js +1 -1
  37. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_global-error.cache +1 -1
  38. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_not-found.cache +1 -1
  39. package/bundled/web/.open-next/cache/l7JcQdOJYySajzS1KAORl/contact.cache +1 -0
  40. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/device.cache +1 -1
  41. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/onboarding-preview.cache +1 -1
  42. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/pricing-concept.cache +1 -1
  43. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/pricing.cache +1 -1
  44. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/privacy.cache +1 -1
  45. package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/serwist/sw.js.cache +1 -1
  46. package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
  47. package/bundled/web/.open-next/cloudflare/init.js +1 -1
  48. package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
  49. package/bundled/web/.open-next/middleware/handler.mjs +4 -4
  50. package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
  51. package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +6 -6
  52. package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +4 -4
  53. package/bundled/web/.open-next/server-functions/default/src/web/.next/required-server-files.json +2 -2
  54. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  55. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(home)/page_client-reference-manifest.js +1 -1
  56. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  57. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/[channelId]/page_client-reference-manifest.js +1 -1
  58. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/page_client-reference-manifest.js +1 -1
  59. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/settings/page_client-reference-manifest.js +1 -1
  60. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/invite/[token]/page_client-reference-manifest.js +1 -1
  61. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/[dmId]/page_client-reference-manifest.js +1 -1
  62. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/bots/page_client-reference-manifest.js +1 -1
  63. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/friends/page_client-reference-manifest.js +1 -1
  64. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/machines/page_client-reference-manifest.js +1 -1
  65. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/page_client-reference-manifest.js +1 -1
  66. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/onboarding-preview/page_client-reference-manifest.js +1 -1
  67. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/page_client-reference-manifest.js +1 -1
  68. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/[channelId]/page_client-reference-manifest.js +1 -1
  69. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/page_client-reference-manifest.js +1 -1
  70. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/settings/page_client-reference-manifest.js +1 -1
  71. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/invite/[token]/page_client-reference-manifest.js +1 -1
  72. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/[dmId]/page_client-reference-manifest.js +1 -1
  73. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/bots/page_client-reference-manifest.js +1 -1
  74. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/friends/page_client-reference-manifest.js +1 -1
  75. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/machines/page_client-reference-manifest.js +1 -1
  76. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/page_client-reference-manifest.js +1 -1
  77. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/onboarding-preview/page_client-reference-manifest.js +1 -1
  78. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/page_client-reference-manifest.js +1 -1
  79. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/contact/page_client-reference-manifest.js +1 -1
  80. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
  81. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/landing-legacy/page_client-reference-manifest.js +1 -1
  82. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/onboarding-preview/page_client-reference-manifest.js +1 -1
  83. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/pricing/page_client-reference-manifest.js +1 -1
  84. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/pricing-concept/page_client-reference-manifest.js +1 -1
  85. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  86. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
  87. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  88. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +65 -69
  89. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1ct1usd._.js +1 -1
  90. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1-7foy1._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_03no4-2._.js} +1 -1
  91. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1_ivo7r._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0zd2m6u._.js} +1 -1
  92. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1iexmau._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1jq9i9s._.js} +1 -1
  93. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__024hatd._.js +3 -0
  94. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__08bo8pg._.js +3 -0
  95. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0er5w1y._.js +3 -0
  96. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1n1hzgg._.js +3 -0
  97. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +65 -69
  98. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00cx5e_._.js +3 -0
  99. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00d19_4._.js +1 -1
  100. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0cogu8j._.js → _06jf8-3._.js} +2 -2
  101. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0819w4u._.js +1 -1
  102. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_086-1v_._.js +1 -1
  103. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_09v7ppp._.js +1 -1
  104. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_127opyy._.js → _0_d2_yz._.js} +2 -2
  105. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0djtnj_._.js +1 -1
  106. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0fgqn7p._.js +22 -0
  107. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0gt3fqd._.js +3 -0
  108. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1m_bb91._.js → _0kjmsuf._.js} +2 -2
  109. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0laj1vh._.js +3 -0
  110. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0a1covk._.js → _0op1s0h._.js} +2 -2
  111. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0tr5tf8._.js +1 -1
  112. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0uinku_._.js +1 -1
  113. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ulh9qf._.js +1 -1
  114. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0xvya63._.js +1 -1
  115. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0zk-6sq._.js +3 -0
  116. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1-1q6bt._.js +3 -0
  117. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1-x1xdl._.js +2 -2
  118. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0xp97b1._.js → _117-2e3._.js} +2 -2
  119. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_11h5qp9._.js +1 -1
  120. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_13xipld._.js +1 -1
  121. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_15gov5k._.js +1 -1
  122. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1640_ni._.js +1 -1
  123. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_17fctb6._.js +22 -0
  124. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1ewek2f._.js +1 -1
  125. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0ljlxsv._.js → _1gakrqx._.js} +2 -2
  126. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1gj8gn1._.js +1 -1
  127. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1b2ol5x._.js → _1gytpb_._.js} +2 -2
  128. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1fhm2rs._.js → _1jtz070._.js} +1 -1
  129. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1nm05cr._.js +3 -0
  130. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1nytmku._.js +3 -0
  131. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1us65pi._.js +3 -0
  132. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1w0zw8i._.js +1 -1
  133. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1cx9ua4._.js → _214ta2t._.js} +1 -1
  134. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-f4fpm._.js → node_modules__pnpm_0097mmd._.js} +1 -1
  135. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0r6z90r._.js → node_modules__pnpm_00eiak_._.js} +1 -1
  136. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0s-z4zf._.js → node_modules__pnpm_01cia-g._.js} +1 -1
  137. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m2qxgk._.js → node_modules__pnpm_01yk3fx._.js} +1 -1
  138. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1ayb864._.js → node_modules__pnpm_02smzd_._.js} +1 -1
  139. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_00c11_c._.js → node_modules__pnpm_03rxn2x._.js} +1 -1
  140. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0_nw64v._.js → node_modules__pnpm_03wj0t4._.js} +1 -1
  141. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0cvjw9i._.js → node_modules__pnpm_05c5bgp._.js} +1 -1
  142. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0blbev3._.js → node_modules__pnpm_064o-o_._.js} +1 -1
  143. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_11e-npx._.js → node_modules__pnpm_07l09-d._.js} +1 -1
  144. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_09bvy71._.js → node_modules__pnpm_0dori0l._.js} +1 -1
  145. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1mfsik-._.js → node_modules__pnpm_0fgssuc._.js} +1 -1
  146. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m-2ca1._.js → node_modules__pnpm_0h31fyp._.js} +1 -1
  147. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_08sh6lq._.js → node_modules__pnpm_0iorffo._.js} +1 -1
  148. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1-c3rlj._.js → node_modules__pnpm_0tx0dz2._.js} +1 -1
  149. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1vs8g1m._.js → node_modules__pnpm_0u3tve4._.js} +1 -1
  150. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-kb9vk._.js → node_modules__pnpm_0un9z0x._.js} +1 -1
  151. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_070fpt8._.js → node_modules__pnpm_0ux1312._.js} +1 -1
  152. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_157gdig._.js → node_modules__pnpm_0vbkpol._.js} +1 -1
  153. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1asgfic._.js → node_modules__pnpm_0wrv_s9._.js} +1 -1
  154. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0b1vf_7._.js → node_modules__pnpm_0yy67gq._.js} +1 -1
  155. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1nq5wvh._.js → node_modules__pnpm_167ic81._.js} +1 -1
  156. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1mib8iw._.js → node_modules__pnpm_16a71ys._.js} +1 -1
  157. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1_et9ao._.js → node_modules__pnpm_1bj-8tf._.js} +1 -1
  158. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1prm9wo._.js → node_modules__pnpm_1dav1ya._.js} +1 -1
  159. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m7v0y2._.js → node_modules__pnpm_1edc4wg._.js} +1 -1
  160. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0gqxh94._.js → node_modules__pnpm_1g67_l_._.js} +1 -1
  161. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1orcadd._.js → node_modules__pnpm_1h_4uav._.js} +1 -1
  162. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1-dd625._.js → node_modules__pnpm_1kdkhmj._.js} +1 -1
  163. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1y8nnsd._.js → node_modules__pnpm_1kxm1bx._.js} +1 -1
  164. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0fdef--._.js → node_modules__pnpm_1mu5qb5._.js} +1 -1
  165. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1xhq2ni._.js → node_modules__pnpm_1n0a569._.js} +1 -1
  166. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1wj99ai._.js → node_modules__pnpm_1p-jj1h._.js} +1 -1
  167. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1diq3cq._.js → node_modules__pnpm_1rcn3pb._.js} +1 -1
  168. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_07mqf39._.js → node_modules__pnpm_1uaag00._.js} +1 -1
  169. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-l2dm_._.js → node_modules__pnpm_1ukw6z6._.js} +1 -1
  170. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_08f9ywz._.js → node_modules__pnpm_1v0qc-p._.js} +1 -1
  171. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_03c-uqx._.js → node_modules__pnpm_1xy4aqy._.js} +1 -1
  172. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1sh8pig._.js → node_modules__pnpm_1xzd_xq._.js} +1 -1
  173. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_09h-4yj._.js +1 -1
  174. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_0yqt0fx._.js +1 -1
  175. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_11g9nod._.js +1 -1
  176. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1-ostj6._.js +1 -1
  177. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_pricing_127grdu._.js +1 -1
  178. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +6 -6
  179. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
  180. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
  181. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
  182. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +2 -2
  183. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +795 -867
  184. package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +4 -4
  185. package/bundled/web/wrangler.toml +1 -1
  186. package/bundled/ws-do/index.js +2 -2
  187. package/dist/daemon/index.js +418 -303
  188. package/dist/index.js +1 -1
  189. package/package.json +1 -1
  190. package/bundled/web/.open-next/assets/_next/static/chunks/0ib9uwa0z-dsz.js +0 -1
  191. package/bundled/web/.open-next/assets/_next/static/chunks/0iwup-jnjrnec.js +0 -1
  192. package/bundled/web/.open-next/assets/_next/static/chunks/0yvr7whfqda3q.js +0 -1
  193. package/bundled/web/.open-next/assets/_next/static/chunks/1zpwi6czw7ai-.js +0 -1
  194. package/bundled/web/.open-next/assets/_next/static/chunks/20loivmezlm5a.js +0 -1
  195. package/bundled/web/.open-next/assets/_next/static/chunks/28pnob-12so6n.js +0 -20
  196. package/bundled/web/.open-next/assets/_next/static/chunks/2i53b9t712-8k.js +0 -2
  197. package/bundled/web/.open-next/assets/_next/static/chunks/2tqh9wwavuxwq.js +0 -1
  198. package/bundled/web/.open-next/assets/_next/static/chunks/2uwi9gt28dg6t.js +0 -1
  199. package/bundled/web/.open-next/assets/_next/static/chunks/3-m490wvnsr-n.js +0 -1
  200. package/bundled/web/.open-next/assets/_next/static/chunks/30gpw8oi502mg.js +0 -1
  201. package/bundled/web/.open-next/assets/_next/static/chunks/3861y4ak8gkfc.js +0 -1
  202. package/bundled/web/.open-next/assets/_next/static/chunks/39-78ukwmmip3.js +0 -1
  203. package/bundled/web/.open-next/assets/_next/static/chunks/3dbjh1gzez-8i.js +0 -1
  204. package/bundled/web/.open-next/assets/_next/static/chunks/3ekglfdj1praq.css +0 -1
  205. package/bundled/web/.open-next/assets/_next/static/chunks/3g8qj_h02jo0x.js +0 -1
  206. package/bundled/web/.open-next/assets/_next/static/chunks/3jtsw1j65-agm.js +0 -1
  207. package/bundled/web/.open-next/cache/EYIUufIdDY9MZnN1L4UIr/contact.cache +0 -1
  208. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__06dwsqz._.js +0 -3
  209. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0a_lhi2._.js +0 -3
  210. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0ag1oov._.js +0 -3
  211. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1kqvewd._.js +0 -3
  212. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0b6xa_y._.js +0 -3
  213. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0fczp2o._.js +0 -3
  214. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0lkpg4u._.js +0 -3
  215. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0slfbkf._.js +0 -3
  216. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0wm9g4g._.js +0 -3
  217. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0z8ofkn._.js +0 -3
  218. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1213-9m._.js +0 -22
  219. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_19kvvyn._.js +0 -3
  220. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1h0ocvt._.js +0 -3
  221. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1m9xtpd._.js +0 -3
  222. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1pgfzei._.js +0 -3
  223. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1tciap9._.js +0 -3
  224. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1zfcy06._.js +0 -3
  225. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_08frtr7._.js +0 -22
  226. /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_buildManifest.js +0 -0
  227. /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_clientMiddlewareManifest.js +0 -0
  228. /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_ssgManifest.js +0 -0
  229. /package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/favicon.ico.cache +0 -0
  230. /package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/robots.txt.cache +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,484065,746069,e=>{"use strict";var t=e.i(1087);let n={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};n.node;let l=(0,t.default)(n);e.s(["Activity",0,l],484065);let r={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};r.node;let a=(0,t.default)(r);e.s(["RotateCcw",0,a],746069)},962726,e=>{"use strict";var t=e.i(653933);e.s(["ChevronRight",()=>t.default])},48920,e=>{"use strict";var t=e.i(1087);let n={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};n.node;let l=(0,t.default)(n);e.s(["Monitor",0,l],48920)},551095,168614,521073,e=>{"use strict";var t=e.i(237649),n=e.i(1087);let l={name:"dices",size:24,node:[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]};l.node;let r=(0,n.default)(l);var a=e.i(520582);e.i(400175);var s=e.i(190720);e.i(954194);var i=e.i(582168);e.s(["BotFormFields",0,function({avatarDraft:e,onAvatarChange:n,name:l,setName:o,onShuffle:u,description:d,setDescription:c,nameError:f}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"flex justify-center pb-3",children:(0,t.jsx)(s.BotAvatarPickerDialog,{image:"procedural"===e.kind?e.image:e.previewUrl,onChange:n})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:"bot-name",value:l,maxLength:i.COMMUNITY_BOT_NAME_MAX,onChange:e=>o(e.target.value),placeholder:"Name your bot",autoFocus:!0,"aria-invalid":!!f,"aria-describedby":f?"bot-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-2 text-muted-foreground/50 transition-colors hover:bg-accent hover:text-foreground",children:(0,t.jsx)(r,{className:"size-4"})})]}),f&&(0,t.jsx)("p",{id:"bot-name-error",className:"mt-1 text-xs text-destructive",children:f})]}),(0,t.jsx)(a.AutoResizeTextarea,{id:"bot-description",value:d,maxLength:i.COMMUNITY_BOT_DESCRIPTION_MAX,onChange:e=>c(e.target.value),placeholder:"What is this bot for?",rows:1,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]})}],551095);var o=e.i(855372),u=e.i(473131),d=e.i(613349),c=e.i(777104),f=e.i(561261),p=e.i(382416);let m="__default__",h="__custom__";function x(e,t){let n=(t??"").trim();return 0===n.length?{selectValue:m,customName:""}:e.includes(n)?{selectValue:n,customName:""}:{selectValue:h,customName:n}}function g(e,t){if(null===e||e===m)return null;if(e===h){let e=t.trim();return 0===e.length?null:e}return e}e.s(["MODEL_SELECT_CUSTOM",0,h,"MODEL_SELECT_DEFAULT",0,m,"formatModelLabel",0,function(e,t){let n=(t??"").trim();if(0===n.length)return null;if(e){let t=`${e}-`;if(n.startsWith(t)&&n.length>t.length)return n.slice(t.length)}return n},"modelNameFromSelect",0,g,"modelSelectState",0,x],168614);var v=e.i(903477);e.s([],594309),e.i(594309);var b=e.i(239786),C=e.i(512042),y=e.i(312207),S=e.i(486205),j=e.i(395815),w=e.i(665308),R=e.i(473444),A=e.i(747054),M=e.i(871689),N=e.i(776988),E=e.i(251412),I=e.i(34623),T=e.i(31663),L=e.i(394113),V=e.i(813551),P=e.i(294718),k=e.i(758737);let O=p.createContext(void 0),D=p.createContext(void 0),H=p.createContext(void 0);function F(){let e=p.useContext(O);if(void 0===e)throw Error((0,k.default)(60));return e}function B(){let e=p.useContext(D);if(void 0===e)throw Error((0,k.default)(101));return e}function z(){let e=p.useContext(H);if(void 0===e)throw Error((0,k.default)(61));return e}var U=e.i(618910),_=e.i(796739),Y=e.i(850835),W=e.i(206822),X=e.i(401993);let K=(e,t)=>Object.is(e,t);function q(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function Z(e,t,n){return!!e&&e.some(e=>void 0!==e&&q(t,e,n))}function G(e,t,n){return e?e.findIndex(e=>void 0!==e&&q(e,t,n)):-1}function $(e,t,n,l){let r=l&&Array.isArray(t)?e.findIndex(function(e,t){if(t!==K)return n=>Z(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(0!==t||e.some(e=>Object.is(t,e)))}(t,n)):G(e,t,n);return -1===r?null:r}var J=e.i(592781);function Q(e){var t;return"object"==typeof(t=e?.[0])&&null!=t&&Array.isArray(t.items)}function ee(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return(0,J.serializeValue)(e)}function et(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?(0,J.serializeValue)(e.value):(0,J.serializeValue)(e)}function en(e,t,n){if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??ee(e,n);if(Array.isArray(t)){let l=Q(t)?t.flatMap(e=>e.items):t;if(null==e||"object"!=typeof e){let t=l.find(t=>t.value===e);return t&&null!=t.label?t.label:ee(e,n)}if("value"in e){let t=l.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return ee(e,n)}let el={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:l}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==et(t,l))},hasNullItemLabel:(e,t)=>!!t&&function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(Q(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1}(e.items),open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,l=e.value;return e.multiple?Array.isArray(l)&&l.some(e=>q(t,e,n)):q(t,l,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};var er=e.i(28972),ea=e.i(685350),es=e.i(236329),ei=e.i(647978),eo=e.i(769971),eu=e.i(429152),ed=e.i(73135);function ec(e,t){return Math.max(0,e-t)}function ef(e,t){if(t<=0)return 0;let n=(0,ed.clamp)(e,0,t),l=t-n,r=n<=1,a=l<=1;return r&&a?n<=l?0:t:r?0:a?t:n}var ep=e.i(68271),em=e.i(782844),eh=e.i(11897),ex=e.i(353644),eg=e.i(668312),ev=e.i(405020);let eb=p.forwardRef(function(e,t){let{render:n,className:l,style:r,...a}=e;delete a.id;let s=(0,U.useFieldRootContext)(),i=F(),o=i.useState("triggerElement"),u=i.useState("id"),d=(0,ev.getDefaultLabelId)(u),c=(0,eg.useLabel)({id:d,fallbackControlId:o?.id??u,setLabelId(e){let t="function"==typeof e?e(i.state.labelId):e;i.set("labelId",t)}});return(0,eh.useRenderElement)("div",e,{ref:t,state:s.state,props:[c,a],stateAttributesMapping:ex.fieldValidityMapping})});var eC=e.i(516948),ey=e.i(699397),eS=e.i(90164),ej=e.i(684318),ew=e.i(812855),eR=e.i(553796),eA=e.i(978310),eM=e.i(501301),eN=e.i(319390);eN.CommonTriggerDataAttributes.popupOpen,eN.CommonTriggerDataAttributes.pressed;let eE={...ej.pressableTriggerOpenStateMapping,...ex.fieldValidityMapping,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},eI=p.forwardRef(function(e,t){let{render:n,className:l,id:r,disabled:a=!1,nativeButton:s=!0,style:i,...o}=e,{setTouched:u,setFocused:d,validationMode:c,validation:f,state:m,disabled:h}=(0,U.useFieldRootContext)(),{labelId:x}=(0,eS.useLabelableContext)(),g=F(),{readOnly:v,required:b,disabled:C}=B(),y=h||C||a,S=g.useState("open"),j=g.useState("mounted"),w=g.useState("value"),R=g.useState("triggerProps"),A=g.useState("positionerElement"),N=g.useState("listElement"),E=g.useState("popupSide"),I=g.useState("id"),T=g.useState("labelId"),L=g.useState("hasSelectedValue"),V=j&&A?E:null,P=(0,ev.resolveAriaLabelledBy)(x,T);(0,Y.useLabelableId)({id:r});let k=(0,M.useValueAsRef)(A),O=p.useRef(null),{getButtonProps:D,buttonRef:H}=(0,eM.useButton)({disabled:y,native:s}),z=g.useStateSetter("triggerElement"),_=(0,ey.useTimeout)(),W=(0,ey.useTimeout)(),X=(0,ey.useTimeout)();p.useEffect(()=>{if(S)return X.start(400,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{X.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},W.clear()},[S,g,W,X]);let K=(0,em.mergeProps)(R,{id:r??I,role:"combobox","aria-expanded":S,"aria-haspopup":"listbox","aria-controls":S?N?.id??(0,eA.getFloatingFocusElement)(A)?.id:void 0,"aria-labelledby":P,"aria-readonly":v||void 0,"aria-required":b||void 0,tabIndex:y?-1:0,onFocus(e){d(!0),S&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,(0,er.createChangeEventDetails)(ea.REASONS.none,e.nativeEvent)),_.start(0,()=>{g.set("forceMount",!0)})},onBlur(e){(0,eR.contains)(A,e.relatedTarget)||(u(!0),d(!1),"onBlur"===c&&f.commit(w))},onMouseDown(e){if(S)return;let t=(0,eC.ownerDocument)(e.currentTarget);function n(e){if(!O.current)return;let t=e.target;(0,eR.contains)(O.current,t)||(0,eR.contains)(k.current,t)||(0,ew.isMouseWithinBounds)(e,O.current)||g.context.setOpen(!1,(0,er.createChangeEventDetails)(ea.REASONS.cancelOpen,e))}W.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},o,D),q=f.getValidationProps(y,K);q.role="combobox";let Z={...m,open:S,disabled:y,value:w,readOnly:v,popupSide:V,placeholder:!L};return(0,eh.useRenderElement)("button",e,{ref:[t,O,H,z],state:Z,stateAttributesMapping:eE,props:q})}),eT={value:()=>null},eL=p.forwardRef(function(e,n){let{className:l,render:r,children:a,placeholder:s,style:i,...o}=e,u=F(),d=u.useState("value"),c=u.useState("items"),f=u.useState("itemToStringLabel"),m=u.useState("hasSelectedValue"),h=!m&&null!=s&&null==a,x=u.useState("hasNullItemLabel",h),g=null;if("function"==typeof a)g=a(d);else if(null!=a)g=a;else if(h&&!x)g=s;else if(Array.isArray(d))g=d.reduce((e,n,l)=>(l>0&&e.push(", "),e.push((0,t.jsx)(p.Fragment,{children:en(n,c,f)},l)),e),[]);else g=en(d,c,f);return(0,eh.useRenderElement)("span",e,{state:{value:d,placeholder:!m},ref:[n,u.context.valueRef],props:[{children:g},o],stateAttributesMapping:eT})}),eV=p.forwardRef(function(e,t){let{render:n,className:l,style:r,...a}=e,s=F().useState("open");return(0,eh.useRenderElement)("span",e,{state:{open:s},ref:t,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:ej.triggerOpenStateMapping})});var eP=e.i(10592);let ek=p.forwardRef(function(e,n){let l=F(),r=l.useState("mounted"),a=l.useState("forceMount");return r||a?(0,t.jsx)(eP.FloatingPortal,{ref:n,...e}):null});var eO=e.i(557490);let eD={...ej.popupStateMapping,...eO.transitionStatusMapping},eH=p.forwardRef(function(e,t){let{render:n,className:l,style:r,...a}=e,s=F(),i=s.useState("open"),o=s.useState("mounted"),u=s.useState("transitionStatus");return(0,eh.useRenderElement)("div",e,{state:{open:i,transitionStatus:u},ref:t,props:[{role:"presentation",hidden:!o,style:{userSelect:"none",WebkitUserSelect:"none"}},a],stateAttributesMapping:eD})});var eF=e.i(568505),eB=e.i(358535),ez=e.i(796069);let eU=p.createContext(void 0);function e_(){let e=p.useContext(eU);if(!e)throw Error((0,k.default)(59));return e}var eY=e.i(107127),eW=e.i(30909);function eX(e,t){e&&Object.assign(e.style,t)}let eK={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var eq=e.i(234216),eZ=e.i(429638);let eG={position:"fixed"},e$=p.forwardRef(function(e,n){let{anchor:l,className:r,render:a,positionMethod:s,side:i,align:o,sideOffset:u,alignOffset:d,collisionBoundary:c="clipping-ancestors",collisionPadding:f,arrowPadding:m,sticky:h,disableAnchorTracking:x,alignItemWithTrigger:g=!0,collisionAvoidance:v=eW.DROPDOWN_COLLISION_AVOIDANCE,style:b,...C}=e,y=F(),S=z(),j=y.useState("open"),w=y.useState("mounted"),M=y.useState("modal"),N=y.useState("value"),E=y.useState("openMethod"),I=y.useState("positionerElement"),T=y.useState("triggerElement"),L=y.useState("isItemEqualToValue"),V=y.useState("transitionStatus"),P=p.useRef(null),k=p.useRef(null),[O,D]=p.useState(g),H=w&&O&&"touch"!==E;w||O===g||D(g),p.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>H),(0,eZ.useAnchoredPopupScrollLock)((H||M)&&j,"touch"===E,I,T);let B=(0,ez.useAnchorPositioning)({anchor:l,floatingRootContext:S,positionMethod:s,mounted:w,side:i,sideOffset:u,align:o,alignOffset:d,arrowPadding:m,collisionBoundary:c,collisionPadding:f,sticky:h,disableAnchorTracking:x??H,collisionAvoidance:v,keepMounted:!0}),U=H?"none":B.side,_=H?eG:B.positionerStyles,Y={open:j,side:U,align:B.align,anchorHidden:B.anchorHidden};(0,R.useIsoLayoutEffect)(()=>{y.set("popupSide",B.side)},[y,B.side]);let W=y.useStateSetter("positionerElement"),X=(0,eq.usePositioner)(e,Y,{styles:_,transitionStatus:V,props:C,refs:[n,W],hidden:!w,inert:!j}),K=p.useRef(0),q=(0,A.useStableCallback)(e=>{if(0===y.context.valuesRef.current.length)return;let t=K.current;K.current=e.size;let n=(0,er.createChangeEventDetails)(ea.REASONS.none);if(0!==t&&!y.state.multiple&&null!==N&&-1===G(y.context.valuesRef.current,N,L)){let e=y.context.initialValueRef.current,t=null!=e&&-1!==G(y.context.valuesRef.current,e,L)?e:null;y.context.setValue(t,n),null===t&&(y.set("selectedIndex",null),y.context.selectedItemTextRef.current=null)}if(0!==t&&y.state.multiple&&Array.isArray(N)){let e=N.filter(e=>-1!==G(y.context.valuesRef.current,e,L));e.length!==N.length&&(y.context.setValue(e,n),0===e.length&&(y.set("selectedIndex",null),y.context.selectedItemTextRef.current=null))}if(j&&H){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:""};eX(I,e),eX(y.context.popupRef.current,e)}}),Z=p.useMemo(()=>({...B,side:U,alignItemWithTriggerActive:H,setControlledAlignItemWithTrigger:D,scrollUpArrowRef:P,scrollDownArrowRef:k}),[B,U,H,D]);return(0,t.jsx)(eB.CompositeList,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:q,children:(0,t.jsxs)(eU.Provider,{value:Z,children:[w&&M&&(0,t.jsx)(eY.InternalBackdrop,{inert:(0,eF.inertValue)(!j),cutout:T}),X]})})});var eJ=e.i(210242),eQ=e.i(721472),e0=e.i(400449),e1=e.i(479995),e5=e.i(261569),e2=e.i(297797),e4=e.i(825339);let e6="base-ui-disable-scrollbar";var e3=e.i(258524),e7=e.i(157020),e9=e.i(505947),e8=e.i(122813),te=e.i(25497);let tt="--transform-origin",tn={...ej.popupStateMapping,...eO.transitionStatusMapping},tl=p.forwardRef(function(e,n){let l,{render:r,className:a,style:s,finalFocus:i,...o}=e,u=F(),{multiple:d,readOnly:c,highlightItemOnHover:f}=B(),m=z(),{side:h,align:x,alignItemWithTriggerActive:g,isPositioned:v,setControlledAlignItemWithTrigger:b}=e_(),C=null!=(0,e3.useToolbarRootContext)(!0),y=(0,te.useDirection)(),{nonce:S,disableStyleElements:j}=(0,e8.useCSPContext)(),w=u.useState("id"),M=u.useState("open"),N=u.useState("openMethod"),E=u.useState("mounted"),I=u.useState("popupProps"),T=u.useState("transitionStatus"),L=u.useState("triggerElement"),V=u.useState("positionerElement"),P=u.useState("listElement"),k=p.useRef(!1),O=p.useRef(!1),D=p.useRef({}),H=(0,e5.useAnimationFrame)(),U=(0,A.useStableCallback)(e=>{var t;if(!V||!u.context.popupRef.current||!O.current)return;let n="0px"===V.style.top,l="0px"===V.style.bottom;if(k.current||!g||!n&&!l)return void u.context.handleScrollArrowVisibility(e);let r=ts(V),a=(t=V.getBoundingClientRect().height,t/r.y),s=(0,eC.ownerDocument)(V),i=(0,e1.ownerWindow)(V),o=i.getComputedStyle(V),d=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),f=tr(i.getComputedStyle(u.context.popupRef.current)),p=Math.min(s.documentElement.clientHeight-d-c,f),m=e.scrollTop,h=ta(e),x=null,v=e=>{V.style.height=`${e}px`},b=n?h-m:m,C=Math.min(a+b,p);if(b<=1){let t=(0,ed.clamp)(b,0,p-a);t>0&&v(a+t),e.scrollTop=n?h:0,p-(a+t)<=1&&(k.current=!0),u.context.handleScrollArrowVisibility(e);return}if(p-C>1)x=n?1/0:0;else if(l&&m<h){let e=a+b-p;x=m-(b-e)}let y=Math.ceil(C);if(0!==y&&v(y),null!=x){let t=(0,ed.clamp)(x,0,ta(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}y>=p-1&&(k.current=!0),u.context.handleScrollArrowVisibility(e)});p.useImperativeHandle(u.context.scrollHandlerRef,()=>U,[U]),(0,es.useOpenChangeComplete)({open:M,ref:u.context.popupRef,onComplete(){M&&u.context.onOpenChangeComplete(!0)}}),(0,R.useIsoLayoutEffect)(()=>{V&&u.context.popupRef.current&&!Object.keys(D.current).length&&(D.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[u,V]),(0,R.useIsoLayoutEffect)(()=>{M||g||(O.current=!1,k.current=!1,eX(V,D.current))},[M,g,V]),(0,R.useIsoLayoutEffect)(()=>{let e=u.context.popupRef.current;if(!M||!L||!V||!e||g&&!v||"ending"===u.state.transitionStatus)return;if(O.current=!0,e.style.removeProperty(tt),!g)return void H.request(()=>u.context.handleScrollArrowVisibility(P||e));let t=function(e){let{style:t}=e,n={};for(let[e,l]of to)n[e]=t.getPropertyValue(e),t.setProperty(e,l,"important");return()=>{for(let[e]of to){let l=n[e];l?t.setProperty(e,l):t.removeProperty(e)}}}(e);try{let t,n=u.context.selectedItemTextRef.current;n?.isConnected||(n=!u.select("hasSelectedValue")&&u.context.firstItemTextRef.current?.isConnected?u.context.firstItemTextRef.current:null);let l=u.context.valueRef.current,r=(0,e1.ownerWindow)(V),a=r.getComputedStyle(V),s=r.getComputedStyle(e),i=(0,eC.ownerDocument)(L),o=ts(L),d=ti(L.getBoundingClientRect(),o),c=ti(V.getBoundingClientRect(),o),p=d.height,m=P||e,h=m.scrollHeight,x=parseFloat(s.borderBottomWidth),g=parseFloat(a.marginTop)||10,v=parseFloat(a.marginBottom)||10,C=parseFloat(a.minHeight)||100,S=tr(s),j=i.documentElement.clientHeight-g-v,w=i.documentElement.clientWidth,R=j-d.bottom+p,A="rtl"===y?d.right-c.width:d.left,M=0;if(n&&l){let e=ti(l.getBoundingClientRect(),o);t=ti(n.getBoundingClientRect(),o),A=c.left+("rtl"===y?e.right-t.right:e.left-t.left);let r=e.top-d.top+e.height/2;M=t.top-c.top+t.height/2-r}let N=R+M+v+x,E=Math.min(j,N),I=j-g-v,T=N-E;V.style.left=`${(0,ed.clamp)(A,5,w-5-c.width)}px`,V.style.height=`${E}px`,V.style.maxHeight="none",V.style.marginTop=`${g}px`,V.style.marginBottom=`${v}px`,e.style.height="100%";let O=ta(m),H=T>=O-1;H&&(E=Math.min(j,c.height)-(T-O));let F=d.top<20||d.bottom>j-20||Math.ceil(E)+1<Math.min(h,C),B=(r.visualViewport?.scale??1)!==1&&e0.platform.engine.webkit;if(F||B){eX(V,D.current),b(!1);return}let z=Math.max(C,E);if(H){let e=Math.max(0,j-N);V.style.top=c.height>=I?"0":`${e}px`,V.style.height=`${E}px`,m.scrollTop=ta(m)}else V.style.bottom="0",m.scrollTop=T;if(t){let n=c.top,l=c.height,r=t.top+t.height/2,a=(0,ed.clamp)(l>0?(r-n)/l*100:50,0,100);e.style.setProperty(tt,`50% ${a}%`)}(z===j||E>=S)&&(k.current=!0),u.context.handleScrollArrowVisibility(m),f&&null===u.state.selectedIndex&&null===u.state.activeIndex&&null!=u.context.listRef.current[0]&&u.set("activeIndex",0)}finally{t()}},[u,M,V,L,g,b,H,P,f,y,v]),p.useEffect(()=>{if(!g||!V||!M)return;let e=(0,e1.ownerWindow)(V);return(0,eQ.addEventListener)(e,"resize",function(e){u.context.setOpen(!1,(0,er.createChangeEventDetails)(ea.REASONS.windowResize,e))})},[u,g,V,M]);let _={...P?{role:"presentation"}:{role:"listbox","aria-multiselectable":d||void 0,"aria-readonly":c||void 0,id:`${w}-list`},onKeyDown(e){C&&e7.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()},onScroll(e){P||U(e.currentTarget)},...g&&{style:P?{height:"100%"}:eK},className:!P&&g?e6:void 0},Y=(0,eh.useRenderElement)("div",e,{ref:[n,u.context.popupRef],state:{open:M,transitionStatus:T,side:h,align:x},stateAttributesMapping:tn,props:[I,_,(0,e9.getDisabledMountTransitionStyles)(T),o]});return(0,t.jsxs)(p.Fragment,{children:[!j&&(l=S,(0,t.jsx)("style",{nonce:l,href:e6,precedence:"base-ui:low",children:`.${e6}{scrollbar-width:none}.${e6}::-webkit-scrollbar{display:none}`})),(0,t.jsx)(e2.FloatingFocusManager,{context:m,modal:!1,disabled:!E,openInteractionType:N,returnFocus:i,restoreFocus:!0,children:Y})]})});function tr(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function ta(e){return ec(e.scrollHeight,e.clientHeight)}function ts(e){return e4.platform.getScale(e)}function ti(e,t){return(0,eJ.rectToClientRect)({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}let to=[["transform","none"],["scale","1"],["translate","0 0"]],tu=p.forwardRef(function(e,t){let{render:n,className:l,style:r,...a}=e,s=F(),{multiple:i,readOnly:o}=B(),{alignItemWithTriggerActive:u}=e_(),d=s.useState("hasScrollArrows"),c=s.useState("openMethod"),f=s.useState("id"),p={id:`${f}-list`,role:"listbox","aria-multiselectable":i||void 0,"aria-readonly":o||void 0,onScroll(e){s.context.scrollHandlerRef.current?.(e.currentTarget)},...u&&{style:eK},className:d&&"touch"!==c?e6:void 0},m=s.useStateSetter("listElement");return(0,eh.useRenderElement)("div",e,{ref:[t,m],props:[p,a]})});var td=e.i(205512);let tc=p.createContext(void 0);function tf(){let e=p.useContext(tc);if(!e)throw Error((0,k.default)(57));return e}var tp=e.i(886164);let tm=p.memo(p.forwardRef(function(e,n){let{render:l,className:r,style:a,value:s=null,label:i,disabled:o=!1,nativeButton:u=!1,...d}=e,c=p.useRef(null),f=(0,td.useCompositeListItem)({guess:!0,label:i,textRef:c}),m=F(),{itemProps:h,multiple:x,disabled:g,readOnly:v}=B(),b=g||o,C=m.useState("isActive",f.index),y=m.useState("open"),S=m.useState("isSelected",s),j=m.useState("isSelectedByFocus",f.index),w=m.useState("isItemEqualToValue"),A=f.index,M=p.useRef(null);(0,R.useIsoLayoutEffect)(()=>{let e=m.context.valuesRef.current;return e[A]=s,()=>{delete e[A]}},[A,s,m]),(0,R.useIsoLayoutEffect)(()=>{let e,t=m.state.value,n=m.state.selectedIndex,l=n;if(x&&Array.isArray(t)){var r;r=m.context.valuesRef.current,e=(l=Z(t,s,w)?null!=n&&A>n&&Z(t,r[n],w)?n:A:A===n?$(r,t,w,!0):n)===A,A!==n||e||(m.context.selectedItemTextRef.current=null)}else(e=void 0!==t&&q(s,t,w))&&(l=A);m.set("selectedIndex",l),e&&c.current&&(m.context.selectedItemTextRef.current=c.current)},[A,x,w,m,s]);let N=p.useRef("mouse"),E=p.useRef(!1),{getButtonProps:I,buttonRef:T}=(0,eM.useButton)({disabled:b,focusableWhenDisabled:!0,native:u,composite:!0});function L(){m.context.selectionRef.current.dragY=0}let V=(0,eh.useRenderElement)("div",e,{ref:[T,n,f.ref,M],state:{disabled:b,selected:S,highlighted:C},props:[h,{role:"option","aria-selected":S,tabIndex:y&&C?0:-1,onKeyDown(e){m.set("activeIndex",A)," "===e.key&&m.context.typingRef.current&&e.preventDefault()},onClick(e){let t="touch"!==N.current,n=e.nativeEvent.pointerType,l=t&&(0,tp.isVirtualClick)(e.nativeEvent)&&(void 0!==n||C),r=t&&!l&&!E.current;E.current=!1,b||r||function(e){if(g||v)return;let t=m.state.value;if(x){let n=Array.isArray(t)?t:[],l=S?n.filter(e=>!q(s,e,w)):[...n,s];m.context.setValue(l,(0,er.createChangeEventDetails)(ea.REASONS.itemPress,e))}else m.context.setValue(s,(0,er.createChangeEventDetails)(ea.REASONS.itemPress,e)),m.context.setOpen(!1,(0,er.createChangeEventDetails)(ea.REASONS.itemPress,e))}(e.nativeEvent)},onPointerEnter(e){N.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){let t=m.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){N.current=e.pointerType,E.current=!0,L()},onMouseUp(){if(L(),b||"touch"===N.current||E.current)return;let e=!m.context.selectionRef.current.allowSelectedMouseUp&&S,t=!m.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(E.current=!0,M.current?.click(),E.current=!1)}},d,I]}),P=p.useMemo(()=>({selected:S,index:A,textRef:c,selectedByFocus:j}),[S,A,c,j]);return(0,t.jsx)(tc.Provider,{value:P,children:V})})),th=p.forwardRef(function(e,n){let{selected:l}=tf();return e.keepMounted||l?(0,t.jsx)(tx,{...e,ref:n}):null}),tx=p.memo(p.forwardRef((e,t)=>{let{render:n,className:l,style:r,keepMounted:a,...s}=e,{selected:i}=tf(),o=p.useRef(null),{transitionStatus:u,setMounted:d}=(0,W.useTransitionStatus)(i),c=(0,eh.useRenderElement)("span",e,{ref:[t,o],state:{selected:i,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:eO.transitionStatusMapping});return(0,es.useOpenChangeComplete)({batch:!0,enabled:!i,open:i,ref:o,onComplete(){i||d(!1)}}),c})),tg=p.memo(p.forwardRef(function(e,t){let{index:n,textRef:l,selectedByFocus:r}=tf(),a=F(),{render:s,className:i,style:o,...u}=e,d=p.useCallback(e=>{e&&(0===n&&(a.context.firstItemTextRef.current=e),r&&(a.context.selectedItemTextRef.current=e))},[a,n,r]);return(0,eh.useRenderElement)("div",e,{ref:[d,t,l],props:u})})),tv=p.forwardRef(function(e,t){let{render:n,className:l,style:r,...a}=e,s=F(),{side:i,align:o,arrowRef:u,arrowStyles:d,arrowUncentered:c,alignItemWithTriggerActive:f}=e_(),p=s.useState("open"),m=(0,eh.useRenderElement)("div",e,{state:{open:p,side:i,align:o,uncentered:c},ref:[u,t],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:ej.popupTransitionStateMapping});return f?null:m}),tb=p.forwardRef(function(e,t){let{render:n,className:l,style:r,direction:a,keepMounted:s,...i}=e,o="up"===a,u=F(),{side:d,scrollDownArrowRef:c,scrollUpArrowRef:f}=e_(),p=u.useState(o?"scrollUpArrowVisible":"scrollDownArrowVisible"),m=u.useState("openMethod"),h=p&&"touch"!==m,x=(0,ey.useTimeout)(),g=o?f:c,{mounted:v,transitionStatus:b,setMounted:C}=(0,W.useTransitionStatus)(h);(0,R.useIsoLayoutEffect)(()=>(u.context.scrollArrowsMountedCountRef.current+=1,u.set("hasScrollArrows",!0),()=>{u.context.scrollArrowsMountedCountRef.current=Math.max(0,u.context.scrollArrowsMountedCountRef.current-1),0===u.context.scrollArrowsMountedCountRef.current&&u.set("hasScrollArrows",!1)}),[u]),(0,es.useOpenChangeComplete)({open:h,ref:g,onComplete(){h||C(!1)}});let y=(0,eh.useRenderElement)("div",e,{ref:[t,g],state:{direction:a,visible:h,side:d,transitionStatus:b},props:[{"aria-hidden":!0,children:o?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||x.isStarted()||(u.set("activeIndex",null),x.start(40,function e(){let t=u.state.listElement??u.context.popupRef.current;if(!t)return;u.set("activeIndex",null),u.context.handleScrollArrowVisibility(t);let n=ec(t.scrollHeight,t.clientHeight),l=ef(t.scrollTop,n),r=l===(o?0:n),a=u.context.listRef.current;if(l!==t.scrollTop&&(t.scrollTop=l),r)return void x.clear();if(a.length>0){let e=g.current?.offsetHeight||0;t.scrollTop=function(e,t,n,l,r,a){if(t){let t=0,l=n+r-1;for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.offsetTop>=l){t=n;break}}let s=Math.max(0,t-1),i=e[s];return s<t&&i?ef(i.offsetTop-r,a):0}let s=e.length-1,i=n+l-r+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>i){s=Math.max(0,t-1);break}}let o=Math.min(e.length-1,s+1),u=e[o];return o>s&&u?ef(u.offsetTop+u.offsetHeight-l+r,a):a}(a,o,l,t.clientHeight,e,n)}x.start(40,e)}))},onMouseLeave(){x.clear()}},i],stateAttributesMapping:eO.transitionStatusMapping});return v||s?y:null}),tC=p.forwardRef(function(e,n){return(0,t.jsx)(tb,{...e,ref:n,direction:"down"})}),ty=p.forwardRef(function(e,n){return(0,t.jsx)(tb,{...e,ref:n,direction:"up"})}),tS=p.createContext(void 0),tj=p.forwardRef(function(e,n){let{render:l,className:r,style:a,...s}=e,[i,o]=p.useState(),u=p.useMemo(()=>({labelId:i,setLabelId:o}),[i,o]),d=(0,eh.useRenderElement)("div",e,{ref:n,props:[{role:"group","aria-labelledby":i},s]});return(0,t.jsx)(tS.Provider,{value:u,children:d})});var tw=e.i(891508);let tR=p.forwardRef(function(e,t){let{render:n,className:l,style:r,id:a,...s}=e,{setLabelId:i}=function(){let e=p.useContext(tS);if(void 0===e)throw Error((0,k.default)(56));return e}(),o=(0,tw.useBaseUiId)(a);return(0,R.useIsoLayoutEffect)(()=>(i(o),()=>{i(e=>e===o?void 0:e)}),[o,i]),(0,eh.useRenderElement)("div",e,{ref:t,props:[{id:o,"aria-hidden":!0},s]})}),tA=p.forwardRef(function(e,t){let{className:n,render:l,orientation:r="horizontal",style:a,...s}=e;return(0,eh.useRenderElement)("div",e,{state:{orientation:r},ref:t,props:[{role:"presentation"},s]})});e.s(["Arrow",0,tv,"Backdrop",0,eH,"Group",0,tj,"GroupLabel",0,tR,"Icon",0,eV,"Item",0,tm,"ItemIndicator",0,th,"ItemText",0,tg,"Label",0,eb,"List",0,tu,"Popup",0,tl,"Portal",0,ek,"Positioner",0,e$,"Root",0,function(e){let n,{id:l,value:r,defaultValue:a=null,onValueChange:s,open:i,defaultOpen:o=!1,onOpenChange:u,name:d,form:c,autoComplete:f,disabled:m=!1,readOnly:h=!1,required:x=!1,modal:g=!0,actionsRef:v,inputRef:k,onOpenChangeComplete:F,items:B,multiple:z=!1,itemToStringLabel:Z,itemToStringValue:G,isItemEqualToValue:J=K,highlightItemOnHover:Q=!0,children:en}=e,{clearErrors:ed}=(0,ei.useFormContext)(),{setDirty:eh,setTouched:ex,setFocused:eg,validityData:ev,setFilled:eb,name:eC,disabled:ey,validation:eS,validationMode:ej}=(0,U.useFieldRootContext)(),ew=(0,Y.useLabelableId)({id:l}),eR=ey||m,eA=eC??d,[eM,eN]=(0,w.useControlled)({controlled:r,default:z?a??E.EMPTY_ARRAY:a,name:"Select",state:"value"}),[eE,eI]=(0,w.useControlled)({controlled:i,default:o,name:"Select",state:"open"}),eT=p.useRef([]),eL=p.useRef([]),eV=p.useRef(null),eP=p.useRef(null),ek=p.useRef(0),eO=p.useRef(null),eD=p.useRef([]),eH=p.useRef(!1),eF=p.useRef(null),eB=p.useRef(null),ez=p.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),eU=p.useRef(!1),e_=p.useRef(eM),{mounted:eY,setMounted:eW,transitionStatus:eX}=(0,W.useTransitionStatus)(eE),{openMethod:eK,triggerProps:eq}=(0,eu.useOpenInteractionType)(eE),eZ=(0,y.useRefWithInit)(()=>new N.ReactStore({id:ew,labelId:void 0,modal:g,multiple:z,itemToStringLabel:Z,itemToStringValue:G,isItemEqualToValue:J,value:eM,open:eE,mounted:eY,transitionStatus:eX,items:B,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:E.EMPTY_OBJECT,triggerProps:E.EMPTY_OBJECT,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:E.NOOP,setOpen:E.NOOP,handleScrollArrowVisibility:E.NOOP,onOpenChangeComplete:E.NOOP,listRef:eT,popupRef:eV,scrollHandlerRef:eP,scrollArrowsMountedCountRef:ek,valueRef:eO,valuesRef:eD,labelsRef:eL,typingRef:eH,selectionRef:ez,firstItemTextRef:eF,selectedItemTextRef:eB,alignItemWithTriggerActiveRef:eU,initialValueRef:e_},el)).current,eG=eZ.useState("activeIndex"),e$=eZ.useState("selectedIndex"),eJ=eZ.useState("triggerElement"),eQ=eZ.useState("positionerElement"),e0=(0,S.usePreviousValue)(eK),e1=eK??e0,e5=p.useMemo(()=>z?"":et(eM,G),[z,eM,G]),e2=p.useMemo(()=>z&&Array.isArray(eM)?eM.map(e=>et(e,G)):et(eM,G),[z,eM,G]),e4=(0,M.useValueAsRef)(eJ),e6=(0,A.useStableCallback)(()=>e2);(0,_.useRegisterFieldControl)(e4,ew,eM,e6,!eR,d);let e3=z?Array.isArray(eM)&&eM.length>0:null!=eM&&""!==e5;(0,R.useIsoLayoutEffect)(()=>{eb(e3)},[e3,eb]),(0,R.useIsoLayoutEffect)(function(){let e=$(eD.current,eM,J,z);null===e&&(eB.current=null),eE||eZ.set("selectedIndex",e)},[z,eE,eM,J,eZ]),(0,eo.useValueChanged)(eM,()=>{var e;ed(eA),eh((e=ev.initialValue,Array.isArray(eM)&&Array.isArray(e)?!(0,X.areArraysEqual)(eM,e,(e,t)=>q(e,t,J)):eM!==e)),eS.change(eM)});let e7=(0,A.useStableCallback)((e,t)=>{u?.(e,t),!t.isCanceled&&(eI(e),e||t.reason!==ea.REASONS.focusOut&&t.reason!==ea.REASONS.outsidePress||(ex(!0),eg(!1),"onBlur"===ej&&eS.commit(eM)))}),e9=(0,A.useStableCallback)(()=>{eW(!1),eZ.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),F?.(!1)});(0,es.useOpenChangeComplete)({enabled:!v,open:eE,ref:eV,onComplete(){eE||e9()}}),p.useImperativeHandle(v,()=>({unmount:e9}),[e9]);let e8=(0,A.useStableCallback)((e,t)=>{s?.(e,t),t.isCanceled||eN(e)}),te=(0,A.useStableCallback)(e=>{let t=ec(e.scrollHeight,e.clientHeight),n=ef(e.scrollTop,t);eZ.set("scrollUpArrowVisible",n>0),eZ.set("scrollDownArrowVisible",n<t)}),tt=(0,L.useFloatingRootContext)({open:eE,onOpenChange:e7,elements:{reference:eJ,floating:eQ}}),tn=(0,I.useClick)(tt,{enabled:!eR,event:"mousedown"}),tl=(0,T.useDismiss)(tt),tr=(0,V.useListNavigation)(tt,{enabled:!eR,listRef:eT,activeIndex:eG,selectedIndex:e$,disabledIndices:E.EMPTY_ARRAY,onNavigate(e){(null!==e||eE)&&eZ.set("activeIndex",e)},focusItemOnHover:Q}),ta=(0,P.useTypeahead)(tt,{enabled:!eR&&(eE||!h&&!z),listRef:eL,activeIndex:eG,selectedIndex:e$,disabledIndices:e=>(0,j.isElementDisabled)(eT.current[e]),onMatch(e){eE?eZ.set("activeIndex",e):e8(eD.current[e],(0,er.createChangeEventDetails)(ea.REASONS.none))},onTyping(e){eH.current=e}}),ts=p.useMemo(()=>(0,em.mergeProps)(ta.reference,tr.reference,tl.reference,tn.reference,eq),[tn.reference,ta.reference,tr.reference,tl.reference,eq]),ti=p.useMemo(()=>(0,em.mergeProps)(ep.FOCUSABLE_POPUP_PROPS,ta.floating,tr.floating,tl.floating),[ta.floating,tr.floating,tl.floating]),to=tr.item??E.EMPTY_OBJECT;eZ.useContextCallback("setValue",e8),eZ.useContextCallback("setOpen",e7),eZ.useContextCallback("handleScrollArrowVisibility",te),eZ.useContextCallback("onOpenChangeComplete",F),(n=p.useRef(!0)).current&&(n.current=!1,(()=>{eZ.update({popupProps:ti,triggerProps:ts})})()),eZ.useSyncedValues({id:ew,modal:g,multiple:z,value:eM,open:eE,mounted:eY,transitionStatus:eX,popupProps:ti,triggerProps:ts,items:B,itemToStringLabel:Z,itemToStringValue:G,isItemEqualToValue:J,openMethod:e1});let tu=p.useMemo(()=>({disabled:eR,readOnly:h,required:x,multiple:z,highlightItemOnHover:Q,itemProps:to}),[eR,h,x,z,Q,to]),td=(0,C.useMergedRefs)(k,eS.inputRef),tc=z?void 0:eA,tf=p.useMemo(()=>z&&Array.isArray(eM)&&eA?eM.map(e=>{let n=et(e,G);return(0,t.jsx)("input",{type:"hidden",form:c,name:eA,value:n,disabled:eR},n)}):null,[z,eM,c,eA,G,eR]);return(0,t.jsxs)(O.Provider,{value:eZ,children:[(0,t.jsx)(D.Provider,{value:tu,children:(0,t.jsx)(H.Provider,{value:tt,children:en})}),(0,t.jsx)("input",{...eS.getValidationProps(eR,{onFocus(){eZ.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||eR||h)return;let t=e.currentTarget.value,n=(0,er.createChangeEventDetails)(ea.REASONS.none,e.nativeEvent);eZ.set("forceMount",!0),queueMicrotask(function(){if(z)return;let e=t.toLowerCase(),l=eD.current.findIndex(t=>et(t,G).toLowerCase()===e||ee(t,Z).toLowerCase()===e);-1===l&&(l=eD.current.findIndex((t,n)=>{let l=eL.current[n];return null!=l&&l.toLowerCase()===e}));let r=eD.current[l];null!=r&&e8(r,n)})}}),id:ew&&null==tc?`${ew}-hidden-input`:void 0,form:c,name:tc,autoComplete:f,value:e5,disabled:eR,required:x&&!(z&&e3),readOnly:h,ref:td,style:eA?b.visuallyHiddenInput:b.visuallyHidden,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),tf]})},"ScrollDownArrow",0,tC,"ScrollUpArrow",0,ty,"Separator",0,tA,"Trigger",0,eI,"Value",0,eL],248101);var tM=e.i(248101),tM=tM,tN=e.i(677023),tN=tN,tE=e.i(233553);let tI={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};tI.node;let tT=(0,n.default)(tI),tL=tM.Root;function tV({className:e,...n}){return(0,t.jsx)(tM.Value,{"data-slot":"select-value",className:(0,d.cn)("flex flex-1 text-left",e),...n})}function tP({className:e,size:n="default",children:l,...r}){return(0,t.jsxs)(tM.Trigger,{"data-slot":"select-trigger","data-size":n,className:(0,d.cn)("flex w-fit items-center justify-between gap-2 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[l,(0,t.jsx)(tM.Icon,{render:(0,t.jsx)(tN.default,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function tk({className:e,children:n,side:l="bottom",sideOffset:r=4,align:a="center",alignOffset:s=0,alignItemWithTrigger:i=!0,...o}){return(0,t.jsx)(tM.Portal,{children:(0,t.jsx)(tM.Positioner,{side:l,sideOffset:r,align:a,alignOffset:s,alignItemWithTrigger:i,className:"isolate z-50",children:(0,t.jsxs)(tM.Popup,{"data-slot":"select-content","data-align-trigger":i,className:(0,d.cn)("thin-scrollbar relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[(0,t.jsx)(tH,{}),(0,t.jsx)(tM.List,{children:n}),(0,t.jsx)(tF,{})]})})})}function tO({className:e,children:n,...l}){return(0,t.jsxs)(tM.Item,{"data-slot":"select-item",className:(0,d.cn)("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...l,children:[(0,t.jsx)(tM.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:n}),(0,t.jsx)(tM.ItemIndicator,{render:(0,t.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,t.jsx)(tE.CheckIcon,{className:"pointer-events-none"})})]})}function tD({className:e,...n}){return(0,t.jsx)(tM.Separator,{"data-slot":"select-separator",className:(0,d.cn)("pointer-events-none -mx-1 my-1 h-px bg-border",e),...n})}function tH({className:e,...n}){return(0,t.jsx)(tM.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:(0,t.jsx)(tT,{})})}function tF({className:e,...n}){return(0,t.jsx)(tM.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:(0,t.jsx)(tN.default,{})})}function tB({className:e,...n}){return(0,t.jsx)(tk,{className:(0,d.cn)("p-1.5",e),...n})}function tz({className:e,...n}){return(0,t.jsx)(tO,{className:(0,d.cn)("min-h-10 py-2 pr-9 pl-3 leading-snug",e),...n})}function tU({runtime:e,value:n,onChange:l,disabled:r}){let a=(0,p.useMemo)(()=>e?.reasoning?.models.filter(e=>e.id!==m&&e.id!==h)??[],[e]),s=(0,p.useMemo)(()=>a.map(e=>e.id),[a]),i=(0,p.useMemo)(()=>x(s,n),[s,n]),[o,d]=(0,c.useAtom)((0,f.useCreateAtom)(i.selectValue)),[b,C]=(0,c.useAtom)((0,f.useCreateAtom)(i.customName)),[y,S]=(0,c.useAtom)((0,f.useCreateAtom)("")),j=(0,f.useCreateAtom)(null);(0,p.useEffect)(()=>{let t=j.get();j.set(null),t&&t.runtime===e&&t.value===n||(d(i.selectValue),C(i.customName),S(""))},[i,e,n,j,C,S,d]);let w=o===h,R=e?`Default (${e.id}'s own default)`:"Default",A=y.trim().toLowerCase(),M=A?a.filter(e=>e.id.toLowerCase().includes(A)||e.displayName?.toLowerCase().includes(A)):a,N=[{value:m,label:R},{value:h,label:"Custom…"},...a.map(e=>({value:e.id,label:e.displayName&&e.displayName!==e.id?`${e.id} — ${e.displayName}`:e.id}))];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(u.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,t.jsxs)(tL,{items:N,value:o,onValueChange:(t,n)=>{if("none"===n.reason&&A&&s.includes(o))return void n.cancel();let r=t??m;d(r);let a=g(r,b);j.set({runtime:e,value:a}),l(a)},onOpenChange:e=>{e||S("")},disabled:r,children:[(0,t.jsx)(tP,{"data-testid":"bot-model-select",className:"w-full data-[size=default]:h-11 sm:data-[size=default]:h-8",children:(0,t.jsx)(tV,{placeholder:R})}),(0,t.jsx)(tB,{className:"overflow-y-hidden",children:0===s.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tz,{value:m,children:R}),(0,t.jsx)(tz,{value:h,children:"Custom…"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"bot-model-fixed-controls",className:"shrink-0 bg-popover",children:[(0,t.jsx)("div",{className:"p-1.5",children:(0,t.jsx)(v.Input,{autoFocus:!0,"data-testid":"bot-model-filter-input",value:y,placeholder:"Filter models…","aria-label":"Filter models",onChange:e=>S(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let t=e.currentTarget.closest('[role="listbox"]')?.querySelector("[data-highlighted]");t&&(e.preventDefault(),e.stopPropagation(),t.click());return}["ArrowDown","ArrowUp","Escape","Tab"].includes(e.key)||e.stopPropagation()},className:"h-10 font-mono sm:h-8"})}),(0,t.jsx)(tz,{value:m,children:R}),(0,t.jsx)(tz,{value:h,children:"Custom…"}),(0,t.jsx)(tD,{className:"mx-1 my-1.5"})]}),(0,t.jsxs)("div",{"data-testid":"bot-model-probe-results",className:"thin-scrollbar max-h-[min(18rem,50dvh)] overflow-y-auto",children:[M.map(e=>(0,t.jsx)(tz,{value:e.id,children:e.displayName&&e.displayName!==e.id?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{children:e.displayName}),(0,t.jsx)("span",{className:"max-w-full break-all whitespace-normal font-mono text-xs text-muted-foreground",children:e.id})]}):(0,t.jsx)("span",{className:"font-mono",children:e.id})},e.id)),A&&0===M.length?(0,t.jsx)("p",{role:"status",className:"px-2 py-2 text-xs text-muted-foreground",children:"No matching models"}):null]})]})})]}),w&&(0,t.jsx)(v.Input,{"data-testid":"bot-model-custom-input",value:b,disabled:r,placeholder:"e.g. provider/model-id",onChange:t=>{C(t.target.value);let n=g(h,t.target.value);j.set({runtime:e,value:n}),l(n)},className:"h-11 font-mono sm:h-8"})]})}var t_=e.i(907903),tY=e.i(381153);let tW="__default__";function tX(e){return 0===e.length?e:e[0].toUpperCase()+e.slice(1)}function tK({runtime:e,model:n,daemonVersion:l,value:r,onChange:a,disabled:s}){let i=(0,p.useMemo)(()=>{let t,l,a,s,i;return t=e?.reasoning,a=(l=n??t?.defaultModelId??null)?t?.models.find(e=>e.id===l):void 0,s=a?.supportedReasoningEfforts??[],i=null===r||s.some(e=>e.value===r),{modelId:l,options:s,defaultReasoningEffort:a?.defaultReasoningEffort??null,canonicalEffort:i?r:null,supported:i}},[e,n,r]),o=e?.reasoning?.models.some(e=>e.id===i.modelId)??!1;(0,p.useEffect)(()=>{o&&!i.supported&&null!==r&&a(null)},[o,a,i.supported,r]);let d="Default",c=r&&!i.options.some(e=>e.value===r)?[...i.options,{value:r}]:i.options,f=[{value:tW,label:d},...c.map(e=>({value:e.value,label:tX(e.value)}))],m=r??tW,h=r?i.options.find(e=>e.value===r)?.description:void 0,x=0===i.options.length,g=x&&void 0!==l&&!(0,t_.releaseVersionGte)(l,"0.1.25")?"Check the daemon version in Machines, then update and restart it there.":x?"This runtime/model does not report reasoning effort options.":null===r?"Default sends no override. Your runtime or user configuration stays in control.":h??"Alook sends this reasoning effort as an explicit override.";return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(u.Label,{className:"text-xs text-muted-foreground",children:"Reasoning effort"}),(0,t.jsxs)(tL,{items:f,value:m,onValueChange:e=>{a(e&&e!==tW?e:null)},disabled:s||x,children:[(0,t.jsx)(tP,{"data-testid":tY.tid.botReasoningEffort,className:"w-full data-[size=default]:h-11 sm:data-[size=default]:h-8","aria-describedby":"bot-reasoning-effort-help",children:(0,t.jsx)(tV,{placeholder:d})}),(0,t.jsxs)(tB,{children:[(0,t.jsx)(tz,{value:tW,children:d}),c.map(e=>(0,t.jsx)(tz,{value:e.value,children:tX(e.value)},e.value))]})]}),(0,t.jsx)("p",{id:"bot-reasoning-effort-help",className:"text-xs text-muted-foreground",children:g})]})}let tq=()=>{};e.s(["BotRuntimeFields",0,function({options:e,runtime:n,model:l,daemonVersion:r,reasoningEffort:a=null,onRuntimeChange:s,onModelChange:i,onReasoningEffortChange:c=tq,radioName:f="edit-bot-runtime",motionTargetPrefix:p,modelMotionTarget:m,runtimeOptionClassName:h,modelClassName:x,runtimeError:g,disableUnhealthyOptions:v=!1}){let b=e.find(e=>e.id===n)??null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(u.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),0===e.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"This machine has no runtimes installed."}):(0,t.jsx)("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Runtime","data-testid":"bot-provider-picker",children:e.map(e=>{let l=n===e.id,r=e.unhealthy&&(v||!l);return(0,t.jsxs)("label",{"data-motion-target":p?`${p}-${e.id}`:void 0,className:(0,d.cn)("flex items-center gap-2 rounded-lg border p-2 cursor-pointer transition-colors",l?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",r&&"opacity-40 pointer-events-none",h?.(e.id)),children:[(0,t.jsx)("input",{type:"radio",name:f,value:e.id,checked:l,disabled:r,onChange:()=>{var t;(t=e.id)!==n&&(s(t),i(null),c(null))},className:"accent-primary size-3.5"}),(0,t.jsx)(o.ProviderLogo,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"text-sm",children:e.id}),e.unhealthy&&(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:"unavailable"})]},e.id)})}),g?(0,t.jsx)("p",{className:"text-xs text-destructive",children:g}):null]}),n?(0,t.jsxs)("div",{"data-motion-target":m,className:(0,d.cn)("flex flex-col gap-4",x),children:[(0,t.jsx)(tU,{runtime:b,value:l,onChange:i}),(0,t.jsx)(tK,{runtime:b,model:l,daemonVersion:r,value:a,onChange:c})]}):null]})}],521073)},855372,e=>{"use strict";var t=e.i(237649),n=e.i(48920);function l({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:e,children:(0,t.jsx)("path",{d:"m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"})})}function r({className:e,...n}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,"data-provider-logo":"openai",...n,children:(0,t.jsx)("path",{d:"M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"})})}function a({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,t.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function s({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M8 2C5.5 2 3.5 4 3.5 6.5S5 10.5 6.5 11v1.5H8V11c.3.1.7.1 1 0v1.5h1.5V11c1.5-.5 3-2.5 3-4.5S10.5 2 8 2Z",fill:"#E8453A"}),(0,t.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,t.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,t.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,t.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function i({className:e}){return(0,t.jsx)("img",{src:"data:image/webp;base64,UklGRuYDAABXRUJQVlA4INoDAADQEwCdASowADAAPm0uk0ckIiGhKrqpWIANiWkAEyQea/fD8IewvGL5V7Nb3H8u/MA8G9rT+4flL+UfIe42/23GB8zPqF/o3E0UAP5h/h/+F6ZX+x5evnX/r+4T/K/67/u/zg7znogfrusMANZLkn1gvlY/vNsKubtj/9xLSzxTsLr7K9GLdFNs5rwtISRcPXvH4z57n2fg0XR3aQ2D+pPpycwyl7TwAAD+/2DbjivnePzfyHCsdOgJXKlUR/OgAkofD7K4AdmsPKyP5Ml4/4HBYmIm5/efn/H+X3IZtngyaUOvwbFuRS/1yODFYO3vf3qeXGgPdfgIROXd/EPT7K2jysfvY9N71+w6g2gBPs+P6lxYkPf6S9QfpvH/7Pp7i8xRh0nVDBTEQyczSz7V9hoqo4nDJuii+SfibZRR/d5zB+9jkcb1DNN7YnC5Y7+WfGrE3eseXt3hSm+NS5++m1MHbjsrd9z/Q4HPRP/C85Po41XObalGyIUcFUL2j2n3uI/Yh6U8r6trCUJFB4kT3fsv6+8ylX/d96y2hq869FCXLjq4YqEO8vs5BtT52sf7KyDxPAWkH/b06YbfVXf4/7y5THL6Sr/4mOrrY9P2LW81f05HHFN8n0jcyqKOH7AluMm0AHPgFyz8RVrfBdmnPiC2FLMQfNDte5yGFzGC3fMlDed/tS/PO3Q/hjsNLvAXUUjqHyCo3JeN69jyNgWjjf8iUqoBsXT+lJyp2r8p60ad1jxhNyTblyJwda8aWEw1hFDeGjpMGguDF66RL4c+ZO+PhculC6WxvCsZ7IPAsdD7/ywx3w3AowJ66hAAK7k+m6X2QV06OVOCwyIGERex/AUyuBbLUK93X58+M+Si7YfYjVYGpoJ7JvSgD8ExaA21z9OY+si+1wreacDanKnFDmhwBQC3t6MLeXCOGp3VURDKl10K7tdKHQcb4hr48ba+1x/MrMRwHfq3IQrDIXPYCg4b0OLnVN9JyXttKGM63B5imIdKuU0r6hhSslT10lGLjnIJuwO5WKR0RHs+BX5vs6H63y3K7IuuZ1eRN+Aczvbs4QuDs6ZRuzjJ/1DJ5R/3ZrFPrtxvMwT06vAXIgcbhLGNLhOQUYRPdUN5MgyCtL5NH71ArTPLRRkIjhGwoCYXKKqlqIKKT9NX3vwp/nlh4SX71dlYg/mPXbJ9bMeVugyjqFahjFTJ/rT3HtBCWG8h+OvvbOFDFKurCG9BOhO9B719OS7zsP0KPqoymnv7hVvoJyZp0iziCbBvaJpmF9Cvfs8/vWqWr7TUo616WfMW+X9nkgpuqtnfAAAAAA==",alt:"Hermes",className:`${e} rounded-sm`})}function o({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:e,children:[(0,t.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,t.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,t.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function u({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,children:(0,t.jsx)("path",{d:"M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"})})}function d({className:e}){return(0,t.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:e,children:[(0,t.jsx)("path",{fill:"#14120B",d:"M999.994 554.294C999.994 559.859 999.994 565.419 999.962 570.984C999.935 575.67 999.882 580.357 999.753 585.038C999.475 595.247 998.875 605.542 997.059 615.639C995.217 625.88 992.212 635.409 987.477 644.718C982.822 653.861 976.738 662.233 969.485 669.491C962.227 676.748 953.861 682.828 944.712 687.482C935.409 692.217 925.875 695.222 915.633 697.065C905.537 698.88 895.242 699.48 885.033 699.759C880.346 699.887 875.665 699.941 870.978 699.968C865.413 700.005 859.853 700 854.288 700H745.695C740.13 700 734.571 700 729.005 699.968C724.319 699.941 719.632 699.887 714.951 699.759C704.742 699.48 694.447 698.88 684.35 697.065C674.109 695.222 664.58 692.217 655.271 687.482C646.128 682.828 637.756 676.743 630.499 669.491C623.241 662.233 617.161 653.866 612.507 644.718C607.772 635.414 604.767 625.88 602.925 615.639C601.109 605.542 600.509 595.247 600.23 585.038C600.102 580.352 600.048 575.67 600.021 570.984C600 565.419 600 559.859 600 554.294V445.701C600 440.136 600 434.576 600.032 429.011C600.059 424.324 600.112 419.637 600.241 414.956C600.52 404.747 601.119 394.452 602.935 384.356C604.778 374.115 607.783 364.586 612.518 355.277C617.172 346.133 623.257 337.762 630.509 330.504C637.767 323.246 646.133 317.167 655.282 312.512C664.586 307.777 674.12 304.772 684.361 302.93C694.458 301.114 704.752 300.514 714.961 300.236C719.648 300.107 724.329 300.054 729.016 300.027C734.576 300 740.136 300 745.701 300H854.294C859.859 300 865.419 300 870.984 300.032C875.67 300.059 880.357 300.112 885.038 300.241C895.247 300.52 905.542 301.119 915.639 302.935C925.88 304.778 935.409 307.783 944.718 312.518C953.861 317.172 962.233 323.257 969.491 330.509C976.748 337.767 982.828 346.133 987.482 355.282C992.217 364.586 995.222 374.12 997.065 384.361C998.88 394.458 999.48 404.752 999.759 414.961C999.887 419.648 999.941 424.329 999.968 429.016C1000.01 434.581 1000 440.141 1000 445.706V554.299L999.994 554.294Z"}),(0,t.jsx)("path",{fill:"#72716D",d:"M800.004 500L923.821 571.486C923.061 572.804 921.957 573.929 920.591 574.716L804.863 641.531C801.858 643.266 798.151 643.266 795.146 641.531L679.417 574.716C678.052 573.929 676.948 572.804 676.188 571.486L800.004 500Z"}),(0,t.jsx)("path",{fill:"#55544F",d:"M800.005 357.168V500L676.188 571.486C675.427 570.168 675.004 568.647 675.004 567.072V432.928C675.004 429.774 676.686 426.865 679.418 425.285L795.141 358.47C796.646 357.602 798.323 357.168 799.999 357.168H800.005Z"}),(0,t.jsx)("path",{fill:"#43413C",d:"M923.815 428.515C923.055 427.197 921.951 426.072 920.586 425.285L804.857 358.47C803.357 357.602 801.68 357.168 800.004 357.168V500L923.821 571.486C924.581 570.168 925.005 568.647 925.005 567.072V432.928C925.005 431.348 924.587 429.838 923.821 428.515H923.815Z"}),(0,t.jsx)("path",{fill:"#D6D5D2",d:"M915.156 433.518C915.857 434.728 915.954 436.281 915.156 437.663L802.764 632.323C802.008 633.641 800 633.1 800 631.584V503.311C800 502.287 799.727 501.302 799.229 500.44L915.15 433.512H915.156V433.518Z"}),(0,t.jsx)("path",{fill:"white",d:"M915.155 433.518L799.233 500.445C798.741 499.588 798.023 498.86 797.134 498.345L686.049 434.209C684.731 433.453 685.272 431.445 686.788 431.445H911.566C913.162 431.445 914.459 432.307 915.155 433.518Z"})]})}function c({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:e,children:[(0,t.jsx)("path",{d:"M12 24C12 18.2 12 15.5 10.1 13.9C8.5 12 5.8 12 0 12C5.8 12 8.5 12 10.1 10.1C12 8.5 12 5.8 12 0C12 5.8 12 8.5 13.9 10.1C15.5 12 18.2 12 24 12C18.2 12 15.5 12 13.9 13.9C12 15.5 12 18.2 12 24Z",fill:"url(#gemini-gradient)"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{stopColor:"#4285F4"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#886FBF"})]})})]})}function f({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 180 180",fill:"none",className:e,"data-provider-logo":"antigravity","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M144.248 149.062C151.748 154.688 162.998 150.938 152.685 140.625C121.748 110.625 128.31 28.125 89.8727 28.125C51.4352 28.125 57.9977 110.625 27.0602 140.625C15.8102 151.875 27.9977 154.688 35.4977 149.062C64.5602 129.375 62.6852 94.6875 89.8727 94.6875C117.06 94.6875 115.185 129.375 144.248 149.062Z",fill:"#202124",className:"dark:fill-white"})})}function p({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,children:[(0,t.jsx)("path",{d:"M3.25 2.25a.75.75 0 0 1 .75.75v4.16l4.61-4.69a.75.75 0 0 1 1.07 1.05L6.05 7.21l3.95 5.39a.75.75 0 1 1-1.21.89L5.18 8.5 4 9.7V13a.75.75 0 0 1-1.5 0V3a.75.75 0 0 1 .75-.75Z"}),(0,t.jsx)("circle",{cx:"12.5",cy:"3.5",r:"1"})]})}function m({className:e}){return(0,t.jsxs)("svg",{viewBox:"0 0 1024 1024",fill:"none",className:e,"data-provider-logo":"grok","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916",className:"fill-current"}),(0,t.jsx)("path",{d:"M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339",className:"fill-current"})]})}e.s(["OpenAILogo",0,r,"ProviderLogo",0,function({provider:e,className:h="h-4 w-4"}){switch(e){case"claude":return(0,t.jsx)(l,{className:h});case"codex":return(0,t.jsx)(r,{className:h});case"opencode":return(0,t.jsx)(a,{className:h});case"openclaw":return(0,t.jsx)(s,{className:h});case"hermes":return(0,t.jsx)(i,{className:h});case"pi":return(0,t.jsx)(o,{className:h});case"copilot":return(0,t.jsx)(u,{className:h});case"cursor":return(0,t.jsx)(d,{className:h});case"gemini":return(0,t.jsx)(c,{className:h});case"antigravity":return(0,t.jsx)(f,{className:h});case"kimi":return(0,t.jsx)(p,{className:h});case"grok":return(0,t.jsx)(m,{className:h});default:return(0,t.jsx)(n.Monitor,{className:h})}}])},332680,e=>{"use strict";var t=e.i(237649),n=e.i(952536),l=e.i(613349),r=e.i(186339),a=e.i(873120);function s({...e}){return(0,t.jsx)(n.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function i({className:e,...r}){return(0,t.jsx)(n.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,l.cn)("fixed inset-0 z-50 bg-black/20 backdrop-blur-[2px] transition-[opacity,backdrop-filter] duration-200 ease-out data-ending-style:opacity-0 data-ending-style:backdrop-blur-none data-starting-style:opacity-0 data-starting-style:backdrop-blur-none",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(n.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,l.cn)("flex-1 overflow-y-auto thin-scrollbar px-4 sm:px-6 py-4",e),...n})},"SheetClose",0,function({...e}){return(0,t.jsx)(n.Dialog.Close,{"data-slot":"sheet-close",...e})},"SheetContent",0,function({className:e,children:o,side:u="right",showCloseButton:d=!0,showOverlay:c=!0,...f}){return(0,t.jsxs)(s,{children:[c&&(0,t.jsx)(i,{forceRender:!0}),(0,t.jsxs)(n.Dialog.Popup,{"data-slot":"sheet-content","data-side":u,className:(0,l.cn)("fixed z-50 flex flex-col bg-background shadow-xl outline-none transition duration-300 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0","data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-full data-[side=right]:max-w-md data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10","data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-full data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10","data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10","data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10",e),...f,children:[o,d&&(0,t.jsxs)(n.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3 z-10",size:"icon-sm"}),children:[(0,t.jsx)(a.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(n.Dialog.Description,{"data-slot":"sheet-description",className:(0,l.cn)("text-sm text-muted-foreground",e),...r})},"SheetFooter",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,l.cn)("flex flex-col-reverse gap-2 border-t bg-muted/50 px-4 sm:px-6 py-4 sm:flex-row sm:justify-end",e),...n})},"SheetHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,l.cn)("flex flex-col gap-1 border-b px-4 sm:px-6 py-4",e),...n})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(n.Dialog.Title,{"data-slot":"sheet-title",className:(0,l.cn)("font-heading text-lg leading-tight font-semibold",e),...r})}])},450463,e=>{"use strict";function t(e){let t=new Date(e);if(isNaN(t.getTime()))return"";let n=Math.floor((new Date().getTime()-t.getTime())/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;let l=Math.floor(n/60);if(l<24)return`${l}h ago`;let r=Math.floor(l/24);return r<7?`${r}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"})}e.s(["relativeTime",0,t,"timeAgo",0,function(e){return e?t(e):"never"}])}]);
@@ -1,20 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,799518,e=>{"use strict";var t=e.i(1087);let n={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};n.node;let a=(0,t.default)(n);e.s(["default",0,a])},272090,31163,e=>{"use strict";var t=e.i(1087);let n={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};n.node;let a=(0,t.default)(n);e.s(["LogOut",0,a],272090);var r=e.i(382416),i=e.i(290139),s=e.i(159514),o=e.i(183899),l=e.i(622435),c=e.i(919391),u=e.i(975210);let d="inboxThreadOpener",m=0;e.s(["THREAD_OPENER_HANDOFF_PARAM",0,d,"armThreadOpenerReadHandoff",0,function(e,t){let n="u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():(m+=1,`opener-${m}`);(0,u.armThreadOpenerReservationHandoff)(e,{...t,nonce:n});let a=(0,l.channelHref)(t.serverId,t.childChannelId);return`${a}?${d}=${encodeURIComponent(n)}`},"clearThreadOpenerReadHandoff",0,function(e){(0,u.clearThreadOpenerReservationHandoff)(e)},"useClaimThreadOpenerReadHandoff",0,function(e){let t=(0,s.useQueryClient)(),n=(0,o.useCurrentUser)(),a=(0,i.useRouter)(),m=(0,i.useSearchParams)(),h=(0,r.useRef)(null),p=(0,r.useRef)(null),f=(0,r.useRef)(0);(0,r.useLayoutEffect)(()=>{if(!e||p.current===e.nonce)return;h.current&&((0,c.releaseReadSurface)(h.current),h.current=null,p.current=null);let r=(0,u.getThreadOpenerReservationHandoff)(t,e.nonce);if(!r||r.serverId!==e.serverId||r.parentChannelId!==e.parentChannelId||r.childChannelId!==e.childChannelId||r.openerMessageId!==e.openerMessageId||r.openerSeq!==e.openerSeq)return void(0,u.terminateThreadOpenerReservationHandoff)(t,e.nonce);let i=(0,c.registerReadSurface)(t,n.id,{kind:"timeline",channelId:r.parentChannelId},0,"cancel-uncommitted"),s=(0,c.submitReadIntentGeneration)(i,{kind:"timeline",channelId:r.parentChannelId,messageId:r.openerMessageId,seq:r.openerSeq});if(null===s){(0,c.releaseReadSurface)(i),(0,u.terminateThreadOpenerReservationHandoff)(t,r.nonce);return}h.current=i,p.current=r.nonce,(0,u.completeThreadOpenerReservationHandoff)(t,r.nonce,s);let o=m.toString(),f=`${(0,l.channelHref)(r.serverId,r.childChannelId)}${o?`?${o}`:""}`;a.replace((0,l.removeCommunityParam)(f,d),{scroll:!1})},[n.id,t,a,m,e]),(0,r.useLayoutEffect)(()=>(f.current+=1,()=>{let e=++f.current,t=h.current;t&&queueMicrotask(()=>{f.current===e&&h.current===t&&(h.current=null,p.current=null,(0,c.releaseReadSurface)(t))})}),[t])},"useThreadOpenerRouteGate",0,function({serverId:e,childChannelId:t,parentChannelId:n,openerMessageId:a,lifecycle:o}){let c=(0,s.useQueryClient)(),m=(0,i.useRouter)(),h=(0,i.usePathname)(),p=(0,i.useSearchParams)(),f=p.get(d),g=f?(0,u.getThreadOpenerReservationHandoff)(c,f):null,v=(0,r.useCallback)(()=>{if(!f)return;let n=p.toString(),a=`${(0,l.channelHref)(e,t)}${n?`?${n}`:""}`;m.replace((0,l.removeCommunityParam)(a,d),{scroll:!1})},[t,f,m,p,e]),y=!!g&&g.serverId===e&&g.childChannelId===t,b=h===(0,l.channelHref)(e,t),x=y&&"ready"===o&&g.parentChannelId===n&&g.openerMessageId===a;return(0,r.useLayoutEffect)(()=>{if(!f||!b)return;let n=(0,u.registerThreadOpenerRouteLease)(c,f,e,t);return()=>(0,u.releaseThreadOpenerRouteLease)(n)},[t,f,c,b,e]),(0,r.useLayoutEffect)(()=>{if(f&&b&&(!y||"terminal-error"===o||"ready"===o&&!x)){(0,u.terminateThreadOpenerReservationHandoff)(c,f),v();return}},[x,v,o,f,c,b,y]),b&&x&&g?g:null}],31163)},523264,e=>{"use strict";var t=e.i(1087);let n={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};n.node;let a=(0,t.default)(n);e.s(["Shield",0,a],523264)},739475,414297,e=>{"use strict";var t=e.i(1087);let n={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};n.node;let a=(0,t.default)(n);e.s(["Sun",0,a],739475);let r={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};r.node;let i=(0,t.default)(r);e.s(["Moon",0,i],414297)},696166,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return u}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let i=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class s{disable(){throw i}getStore(){}run(){throw i}exit(){throw i}enterWith(){throw i}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new s}function c(e){return o?o.bind(e):s.bind(e)}function u(){return o?o.snapshot():function(e,...t){return e(...t)}}},402724,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,e.r(696166).createAsyncLocalStorage)()},103679,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=e.r(402724)},562975,(e,t,n)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return a}})},116916,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return r}});let a=e.r(184748);function r({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},674789,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let a=e.r(237649),r=e.r(382416),i=e.r(116916),s=e.r(984862);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...l,...e},n=(0,r.lazy)(()=>t.loader().then(o)),c=t.loading;function u(e){let o=c?(0,a.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,u=l?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(s.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(n,{...e})]}):(0,a.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(n,{...e})});return(0,a.jsx)(u,{...l?{fallback:o}:{},children:d})}return u.displayName="LoadableComponent",u}},719728,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return r}});let a=e.r(836437)._(e.r(674789));function r(e,t){let n={};"function"==typeof e&&(n.loader=e);let r={...n,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},984862,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return l}});let a=e.r(237649),r=e.r(929554),i=e.r(103679),s=e.r(562975),o=e.r(253332);function l({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,o.getAssetTokenQuery)();return(0,a.jsx)(a.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,s.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,r.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},200069,e=>{"use strict";var t=e.i(237649),n=e.i(382416),a=e.i(290139),r=e.i(695230),i=e.i(557922),s=e.i(159514),o=e.i(777104),l=e.i(561261),c=e.i(374402),u=e.i(474707),d=e.i(152845),m=e.i(514649),h=e.i(343699);function p(e){return e.state.isPaused}function f(e){return"success"===e.state.status}let g=["added","removed","updated"];function v(e){return g.includes(e)}async function y({queryClient:e,persister:t,maxAge:n=864e5,buster:a="",hydrateOptions:r}){try{let s=await t.restoreClient();if(s)if(!s.timestamp)return t.removeClient();else{var i;let o,l,c,u=Date.now()-s.timestamp>n,d=s.buster!==a;if(u||d)return t.removeClient();i=s.clientState,o=e.getMutationCache(),l=e.getQueryCache(),c=r?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData,i.mutations?.forEach(({state:t,...n})=>{o.build(e,{...e.getDefaultOptions().hydrate?.mutations,...r?.defaultOptions?.mutations,...n},t)}),i.queries?.forEach(({queryKey:t,state:n,queryHash:a,meta:i,promise:s,dehydratedAt:o,queryType:u})=>{let d=s?function(e){let t;if(e.then(e=>(t=e,e),h.noop)?.catch?.(h.noop),void 0!==t)return{data:t}}(s):void 0,m=void 0===n.data?d?.data:n.data,p=void 0===m?m:c?c(m):m,f=l.get(a),g=f?.state.status==="pending",v=f?.state.fetchStatus==="fetching";if(f){let e=d&&o>f.state.dataUpdatedAt;if(n.dataUpdatedAt>f.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=n;f.setState({...t,data:p,..."pending"===n.status&&void 0!==p&&{status:"success",dataUpdatedAt:o,...!v&&{fetchStatus:"idle"}}})}}else f=l.build(e,{...e.getDefaultOptions().hydrate?.queries,...r?.defaultOptions?.queries,queryKey:t,queryHash:a,meta:i,_type:u},{...n,data:p,fetchStatus:"idle",status:"pending"===n.status&&void 0!==p?"success":n.status,..."pending"===n.status&&void 0!==p&&{dataUpdatedAt:o}});!s||d||g||v||!(o>f.state.dataUpdatedAt)||f.fetch(void 0,{initialPromise:Promise.resolve(s).then(c)}).catch(h.noop)})}}catch(e){throw await t.removeClient(),e}}async function b({queryClient:e,persister:t,buster:n="",dehydrateOptions:a}){let r={buster:n,timestamp:Date.now(),clientState:function(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??p,a=e.getMutationCache().getAll().flatMap(e=>n(e)?[{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}]:[]),r=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??f,i=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,s=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:a,queries:e.getQueryCache().getAll().flatMap(e=>{let t;return r(e)?[{dehydratedAt:Date.now(),state:{...e.state,...void 0!==e.state.data&&{data:s?s(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,..."pending"===e.state.status&&{promise:(t=e.promise?.then(s).catch(e=>i?.(e)===!1?Promise.reject(e):Promise.reject(Error("redacted"))),t?.catch(h.noop),t)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}]:[]})}}(e,a)};await t.persistClient(r)}let x=({children:e,persistOptions:a,onSuccess:r,onError:i,...o})=>{let[l,c]=n.useState(!0),u=n.useRef({persistOptions:a,onSuccess:r,onError:i}),d=n.useRef(!1);return n.useEffect(()=>{u.current={persistOptions:a,onSuccess:r,onError:i}}),n.useEffect(()=>{let e,t,n={...u.current.persistOptions,queryClient:o.client};return d.current||(d.current=!0,y(n).then(()=>u.current.onSuccess?.()).catch(()=>u.current.onError?.()).finally(()=>{c(!1)})),l?void 0:(e=n.queryClient.getQueryCache().subscribe(e=>{v(e.type)&&b(n)}),t=n.queryClient.getMutationCache().subscribe(e=>{v(e.type)&&b(n)}),()=>{e(),t()})},[o.client,l]),(0,t.jsx)(s.QueryClientProvider,{...o,children:(0,t.jsx)(m.IsRestoringProvider,{value:l,children:e})})};var w=e.i(583262),C=e.i(636557),k=e.i(423360),S=e.i(526822),j=e.i(919391),I=e.i(177519),A=e.i(152961),P=e.i(23055),E=e.i(556125),N=e.i(204779),R=e.i(86694),T=e.i(323512),M=e.i(279389),O=e.i(334016),D=e.i(645980);function L(){let e;return{ready:new Promise(t=>{e=t}),release:e}}function _({children:e,onRestoreComplete:a,queryClient:i,registry:s}){let o=(0,m.useIsRestoring)(),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{null!==l.current&&(clearTimeout(l.current),l.current=null);let e=(0,r.registerCommunityDbRegistry)(s);return()=>{l.current=setTimeout(()=>{l.current=null,e(),i.cancelQueries().catch(e=>{(0,C.isAbortError)(e)||console.error("Community query cancellation failed",e)}),(0,j.disposeReadCoordinator)(i),(0,S.disposeAccountReadStateReconciliation)(i),(0,I.disposeAccountUnreadProjection)(i),s.cleanup().finally(()=>i.clear()).catch(e=>{(0,C.isAbortError)(e)||console.error("Community collection cleanup failed",e)})},0)}},[i,s]),(0,n.useLayoutEffect)(()=>{if(!o)return a(),(0,T.installCommunityDbSync)(i,s)},[o,a,i,s]),(0,t.jsx)(R.CommunityDbProvider,{registry:s,children:e})}function U(e){let n=(0,P.useSession)();return(0,t.jsx)(F,{...e,session:n,sessionViewer:P.currentSessionViewer},e.userId??"anon")}function F({children:e,userId:i,initialUser:s,session:o,sessionViewer:l}){let[u]=(0,n.useState)(()=>{let e=(0,w.createQueryClient)();return s&&s.id===i&&e.setQueryData(c.communityKeys.communityDbCollection(i,"profiles"),[M.profileSchema.parse({userId:i,name:s.name,discriminator:s.discriminator??"",avatar:s.avatar,avatarVersion:s.avatarVersion??0,aboutMe:s.aboutMe,statusEmoji:s.statusEmoji,statusText:s.statusText})],{updatedAt:0}),e}),[d]=(0,n.useState)(L),[m]=(0,n.useState)(()=>(0,r.createCommunityDbRegistry)(u,i,{waitForRestore:d.ready})),h=(0,n.useMemo)(()=>i?(0,I.getAccountUnreadProjection)(u,i):null,[u,i]);(0,n.useEffect)(()=>{if(h)return h.setReconcileScheduler(()=>{u.invalidateQueries({queryKey:c.communityKeys.inboxUnreads(),exact:!0}),u.invalidateQueries({queryKey:c.communityKeys.inboxMentions(),exact:!0}),u.invalidateQueries({queryKey:c.communityKeys.dms(),exact:!0}),u.invalidateQueries({queryKey:c.communityKeys.servers(),exact:!0}),u.invalidateQueries({predicate:({queryKey:e})=>(0,c.isCommunityServerDetailQueryKey)(e)})}),()=>h.setReconcileScheduler(null)},[u,h]);let[p]=(0,n.useState)(()=>(0,k.createIdbPersister)(i)),f=(0,A.useSelector)(m.runtime.lifecycle,e=>e.active),g=(0,a.useRouter)();(0,n.useLayoutEffect)(()=>{m.bindAuthentication(l,p.retireAccount,p.retireChannels)},[m,l,p]);let v=(0,n.useRef)(()=>void 0);(0,n.useLayoutEffect)(()=>{(0,D.setTelemetryUser)(i),v.current=(0,D.captureTelemetryIdentityRetirement)()},[i]);let y=(0,n.useRef)(!1),b=!o.isPending&&!o.error&&o.data?.user.id!==i;(0,n.useLayoutEffect)(()=>(m.authenticationView.setState(e=>({...e,active:!0})),()=>{m.authenticationView.setState(e=>({active:!1,generation:e.generation+1}));let e=m.sessionViewer();void 0!==e&&e!==m.accountId&&((0,N.retireCommunityAccount)(m),d.release(),m.retireDisk().catch(()=>void 0))}),[m,d]),(0,n.useLayoutEffect)(()=>{!b||(o.data?.user.id||l?.()!==null||v.current(),y.current||(y.current=!0,d.release(),(0,N.retireCommunityAccount)(m),m.retireDisk().catch(()=>void 0),o.data?.user.id?g.refresh():g.replace("/sign-in")))},[m,b,d,g,o.data?.user.id,l,i]);let C=(0,n.useCallback)(()=>{m.runtime.lifecycle.get().active&&((0,N.retireCommunityAccount)(m),window.location.reload())},[m]);(0,E.usePersistedAccountLifecycle)(p,C);let S=()=>{(d.release(),m.runtime.lifecycle.get().active)?(m.captureRestoredCollections(),m.runtime.ws.get().profileViewerId!==i&&m.runtime.ws.actions.activateProfileAccount(i)):u.clear()};return(0,t.jsx)(x,{client:u,onSuccess:()=>{m.runtime.lifecycle.get().active?(0,O.observeHydration)(p,u):(0,O.discardHydration)(p),S(),m.runtime.lifecycle.get().active&&Promise.all([u.invalidateQueries({queryKey:c.communityKeys.servers(),exact:!0,refetchType:"active"}),u.invalidateQueries({queryKey:c.communityKeys.folders(),exact:!0,refetchType:"active"}),u.invalidateQueries({queryKey:c.communityKeys.dms(),exact:!0,refetchType:"active"}),u.invalidateQueries({predicate:({queryKey:e})=>(0,c.isCommunityServerDetailQueryKey)(e),refetchType:"active"})])},onError:()=>{(0,O.discardHydration)(p),S()},persistOptions:{persister:p,maxAge:k.PERSIST_MAX_AGE_MS,buster:k.PERSIST_BUSTER,dehydrateOptions:{shouldDehydrateQuery:e=>"success"===e.state.status&&(0,k.shouldPersistQuery)(e.queryKey,e.state.data)}},children:f&&!b?(0,t.jsxs)(_,{onRestoreComplete:d.release,queryClient:u,registry:m,children:[e,null]}):null})}var q=e.i(183899),K=e.i(956832),z=e.i(718877),B=e.i(130826),H=e.i(50271),$=e.i(115870),Q=e.i(239706);function V(){return(0,n.useEffect)(()=>{(0,$.perfTraceEnabled)()&&(0,Q.installReactScan)().catch(()=>{})},[]),null}var W=e.i(923750),Y=e.i(362790),G=e.i(601688),X=e.i(193497),J=e.i(51201),Z=e.i(344920),ee=e.i(366020),et=e.i(597574),en=e.i(1087);let ea={name:"briefcase-business",size:24,node:[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]};ea.node;let er=(0,en.default)(ea),ei={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};ei.node;let es=(0,en.default)(ei);var eo=e.i(799518),eo=eo;let el={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};el.node;let ec=(0,en.default)(el),eu=[{value:"claude",label:"Claude Code",provider:"claude"},{value:"codex",label:"Codex",provider:"codex"},{value:"grok",label:"Grok Build",provider:"grok"},{value:"cursor",label:"Cursor",provider:"cursor"},{value:"opencode",label:"OpenCode",provider:"opencode"},{value:"pi",label:"Pi",provider:"pi"}],ed=[{value:"office",label:"Work",icon:er,accentKey:"work"},{value:"developer",label:"Software development",icon:es,accentKey:"code"},{value:"founder",label:"Building a company",icon:ec,accentKey:"rocket"},{value:"home",label:"Home and family",icon:eo.default,accentKey:"coral"}];var em=e.i(174629),eh=e.i(381153),ep=e.i(60115),ef=e.i(490367);function eg(){let e=(0,u.useCommunityRuntime)(),r=(0,a.usePathname)(),i=(0,q.useCurrentUser)(),m=(0,ee.useCommunityOnboarding)(),h=(0,s.useQueryClient)(),p=(0,X.useCommunityMutationOrigin)(),f=JSON.stringify([m?.machineId,m?.harness,m?.identity]),g=(0,J.useCommunityViewSource)(`onboarding:${f}`,m?.stage==="initializing"),[v,y]=(0,o.useAtom)((0,l.useCreateAtom)("")),[b,x]=(0,o.useAtom)((0,l.useCreateAtom)("")),[w,C]=(0,o.useAtom)((0,l.useCreateAtom)("")),k=["community","onboarding-initialization",f],S=(0,G.useMutationState)({filters:{mutationKey:k,status:"pending"},select:e=>e.mutationId}),j=(0,Y.useMutation)({meta:{observabilityAction:"community.onboarding.initialize"},mutationKey:k,scope:{id:JSON.stringify(k)},mutationFn:async({token:t,profileSnapshot:n,assert:a,input:r})=>{a();let i=(0,ee.readCommunityOnboardingState)(e),s=await (0,em.initializeCommunityOnboarding)({...r,checkpoint:i?.initialization?.checkpoint,onCheckpoint:t=>{a(),(0,ee.updateCommunityOnboardingInitialization)(e,e=>({...e,checkpoint:t}))},onProgress:t=>{a(),(0,ee.updateCommunityOnboardingInitialization)(e,e=>({...e,step:t}))},services:{assert:a,request:(e,n)=>p.request(t,e,{...n,signal:a.signal,assertActive:a}),publishBot:(e,t)=>{a(),(0,d.writeCommunityProfilePatches)([{id:e.id,identityAbout:{name:e.name??t.name,discriminator:e.discriminator,kind:"bot"},avatar:{avatar:e.image??t.image,avatarVersion:e.avatarVersion}}],p.registry,{snapshot:n})},resolveBot:e=>p.registry?.collections.profiles.get(e),readChannels:async e=>{a(),await h.invalidateQueries({queryKey:c.communityKeys.servers(),exact:!0}),a();let t={queryKey:c.communityKeys.server(e),queryFn:({signal:t})=>(0,Z.serverProjectedQueryFn)(h,e,t)(),staleTime:0},n=new W.QueryObserver(h,{...t,enabled:!1}).subscribe(()=>void 0);a.signal.addEventListener("abort",n,{once:!0});try{return a(),await h.query({...t,select:void 0}),a(),[...p.registry.collections.channels.values()].filter(t=>t.serverId===e&&!t.parentChannelId).map(({id:e,name:t,type:n,categoryId:a})=>({id:e,name:t,type:n,categoryId:a??null}))}finally{a.signal.removeEventListener("abort",n),n()}}}});return a(),(0,ee.updateCommunityOnboardingInitialization)(e,e=>({...e,result:s})),await h.invalidateQueries({queryKey:c.communityKeys.bots(),exact:!0}),p.assert(t),s}}),I=m?.initialization,A=I?.checkpoint??{},P=I?.step??"creating-bots",E=I?.result??null,N=j.variables?.assert.signal===g.signal?j.error:null,R=N instanceof Error?N.message:"We couldn’t finish setting up your room.",T=E?"success":S.length?"loading":N&&!(N instanceof DOMException&&"AbortError"===N.name)?"error":"idle";(0,n.useEffect)(()=>{let t=I?.pendingDestination;t&&r===t&&(0,ee.completeCommunityOnboarding)(e)},[r,I?.pendingDestination,e]);let M=j.mutateAsync,O=(0,n.useCallback)(async()=>{if(S.length||m?.stage!=="initializing"||!m.machineId||!m.harness||!m.identity)return;let e=p.begin(),t=g.capture();t();try{await M({...e,assert:t,input:{machineId:m.machineId,runtime:m.harness,identity:m.identity,userName:i.name,userDiscriminator:i.discriminator}})}catch{}},[S.length,m,p,g,M,i.name,i.discriminator]);if((0,n.useEffect)(()=>{m?.stage==="initializing"&&"idle"===T&&O()},[T,f,m?.stage,g.signal,O]),!m)return null;if("harness"===m.stage)return(0,t.jsx)(ep.OnboardingSelectDialog,{open:!0,onOpenChange:()=>void 0,step:{current:1,total:3},stepLabel:"Your harness",title:"Which harness do you already use?",description:"Pick the setup that already runs your bots.",options:[...eu],value:v,onValueChange:y,submitLabel:"Continue",onSubmit:t=>{(0,ee.advanceCommunityOnboarding)(e,"harness","machine",{harness:t})},testId:eh.tid.onboardingHarnessDialog,optionTestId:eh.tid.onboardingHarnessOption});if("machine"===m.stage){var D;return(0,t.jsx)(et.OnboardingMachineDialog,{open:!0,harness:m.harness??"",harnessLabel:(D=m.harness,eu.find(e=>e.value===D)?.label??"your harness"),onConnected:t=>{(0,ee.advanceCommunityOnboarding)(e,"machine","identity",{machineId:t})},onChooseAnotherHarness:()=>{y(""),(0,ee.recoverCommunityOnboardingHarness)(e)},onManageMachines:()=>{(0,ee.skipCommunityOnboarding)(e)}})}return"identity"===m.stage?(0,t.jsx)(ep.OnboardingSelectDialog,{open:!0,onOpenChange:()=>void 0,step:{current:3,total:3},stepLabel:"About you",title:"Which best describes you?",description:"We’ll shape the room around your work.",options:[...ed],value:b,onValueChange:x,customOption:{value:"custom",label:"Something else",placeholder:"Your role"},customValue:w,onCustomValueChange:C,submitLabel:"Finish setup",onSubmit:t=>{(0,ee.advanceCommunityOnboarding)(e,"identity","initializing",{identity:t})},testId:eh.tid.onboardingIdentityDialog,optionTestId:eh.tid.onboardingIdentityOption}):"initializing"===m.stage?(0,t.jsx)(ef.OnboardingStatusDialog,{status:"idle"===T?"loading":T,currentStep:P,checkpoint:A,detail:"error"===T?R:"success"===T?`${E?.bots.length??0} bots are in your room and ready to work.`:"Follow along as your room comes together.",onRetry:()=>void O(),onContinue:()=>{if(!E)return;let t=`/c/channels/${E.serverId}/${E.publicChannelId}`,n=e.ui.get().uiHandlers.navigate;n&&(g.capture()(),(0,ee.updateCommunityOnboardingInitialization)(e,e=>({...e,pendingDestination:t})),n(E.serverId,E.publicChannelId))}}):null}let ev={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};ev.node;let ey=(0,en.default)(ev);var eb=e.i(186339),ex=e.i(381338);function ew({children:e}){let n=(0,ex.useCommunityWsStore)(e=>e.connectionStatus),a=(0,ex.useCommunityWsStore)(e=>e.reconnectNow);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"contents",children:e}),"failed"===n&&(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true","data-testid":eh.tid.wsReconnectOverlay,"data-ws-status":n,className:"fixed bottom-4 right-4 z-50 flex max-w-xs items-center gap-3 rounded-lg border bg-popover p-3 text-popover-foreground shadow-(--e2)",children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"grid size-9 shrink-0 place-items-center rounded-md bg-warning/10 text-warning",children:(0,t.jsx)(ey,{className:"size-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"font-heading text-sm font-medium",children:"Connection lost"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Cached content is still available."})]}),(0,t.jsx)(eb.Button,{type:"button",variant:"secondary","data-testid":eh.tid.wsRetry,onClick:a,className:"h-11 shrink-0 sm:h-9",children:"Retry"})]})]})}var eC=e.i(506607),ek=e.i(622435),eS=e.i(636686),ej=e.i(312462);function eI(){let e=(0,a.usePathname)(),t=(0,a.useRouter)(),r=(0,q.useCurrentUser)(),i=(0,s.useQueryClient)(),o=(0,Z.useServers)(),l=(0,ek.communityServerId)(e),c=(0,A.useSelector)((0,u.getCommunityRuntime)(i).serverEject,e=>!!l&&e.flushedServerIds.has(l));return(0,n.useEffect)(()=>{l&&c&&(0,eS.runAuthoritativeServerEject)({serverId:l,servers:o.servers,isSuccess:o.isSuccess,isFetching:o.isFetching,consumeVoluntaryLeave:e=>(0,eS.consumeVoluntaryLeave)(i,e),clearLastChannel:ej.clearLastChannel,toast:eC.toast,accountId:r.id,routeHref:e,replace:e=>t.replace(e)})},[c,r.id,e,i,t,l,o.servers,o.isSuccess,o.isFetching]),null}function eA({children:e}){let t=(0,m.useIsRestoring)(),a=(0,R.useOptionalCommunityDbRegistry)(),r=(0,n.useRef)(!1);return(0,n.useLayoutEffect)(()=>{if(t&&!r.current){r.current=!0,performance.mark("alook:restore:start");return}if(t||!r.current)return;performance.mark("alook:restore:complete"),a?.hasRestoredData()===!0&&performance.mark("alook:restore:first-cached-paint");let e=requestAnimationFrame(()=>performance.mark("alook:restore:stable"));return()=>cancelAnimationFrame(e)},[a,t]),e}var eP=e.i(215932);function eE({currentUser:e,children:n}){return(0,t.jsx)(U,{userId:e.id,initialUser:e,children:(0,t.jsx)(eA,{children:(0,t.jsx)(eN,{viewerId:e.id,children:(0,t.jsx)(q.CurrentUserProvider,{initialUser:e,children:(0,t.jsx)(eR,{children:n})})})})})}function eN({children:e,viewerId:r}){let i=(0,u.useCommunityRuntime)(),[s,c]=(0,o.useAtom)((0,l.useCreateAtom)(!1)),d=(0,ex.useCommunityWsStore)(e=>e.profileViewerId),m=(0,a.usePathname)();return(0,n.useLayoutEffect)(()=>{d!==r&&i.ws.actions.activateProfileAccount(r),c(!0)},[d,i.ws.actions,c,r]),s&&d===r?e:(0,t.jsx)(eP.CommunitySessionPendingFrame,{pathname:m})}function eR({children:e}){let n=(0,s.useQueryClient)(),a=(0,q.useCurrentUser)();(0,z.useNotificationSettings)(),(0,H.useAccountAttention)(),(0,B.useNativeSystemNotifications)(a.id),(0,K.useCommunityWs)({viewerUserId:a.id});let o=(0,r.getCommunityDbRegistry)(n);return(0,i.useQuery)({queryKey:c.communityKeys.selfProfile(),queryFn:async({signal:e})=>({id:(await (0,d.apiFetchProfiles)("/api/community/users/me/profile",e=>[{id:e.id,identityAbout:{name:e.name,discriminator:e.discriminator,aboutMe:e.aboutMe},avatar:{avatar:e.avatar,avatarVersion:e.avatarVersion},status:{statusEmoji:e.statusEmoji,statusText:e.statusText}}],{signal:e},o)).id}),enabled:o?.accountId===a.id,staleTime:3e5}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V,{}),(0,t.jsxs)(ew,{children:[(0,t.jsx)(eI,{}),(0,t.jsx)(eg,{}),e]})]})}var eT=e.i(932135),eM=e.i(996718),eO=e.i(729979),eD=e.i(164237),eL=e.i(250569),e_=e.i(800989),eU=e.i(274762),eF=e.i(804),eq=e.i(294656),eK=e.i(779646),ez=e.i(392965),eB=e.i(561668),eH=e.i(328076),e$=e.i(849050);let eQ={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};eQ.node;let eV=(0,en.default)(eQ);var eW=e.i(272090);let eY={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};eY.node;let eG=(0,en.default)(eY);var eX=e.i(739475),eJ=e.i(414297),eZ=e.i(48920);let e0={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};e0.node;let e1=(0,en.default)(e0);var e2=e.i(928765),e4=e.i(523264);let e5={name:"credit-card",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}],["path",{d:"M6 14h2",key:"mk7k0u"}]]};e5.node;let e9=(0,en.default)(e5);var e6=e.i(518071),e3=e.i(520582),e7=e.i(393153),e8=e.i(613349),te=e.i(58231);let tt="September 17, 2026",tn="underline decoration-foreground/30 underline-offset-3 transition-colors hover:decoration-foreground/60";function ta({className:e}){return(0,t.jsxs)("div",{className:(0,e8.cn)(e),"data-privacy-policy":tt,children:[(0,t.jsxs)("p",{className:"mb-12 text-sm text-muted-foreground",children:["Last updated: ",tt]}),(0,t.jsxs)("div",{className:"prose prose-neutral max-w-none space-y-8 text-[1.0625rem] leading-relaxed dark:prose-invert",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Interpretation and Definitions"}),(0,t.jsxs)("p",{className:"text-foreground/80",children:['In this Privacy Policy, "Company" (referred to as "We", "Us", or "Our") refers to Alook AI. "Service" refers to the Alook platform accessible at'," ",(0,t.jsx)("a",{href:"https://alook.ai",className:tn,children:"alook.ai"}),'. "You" means the individual accessing or using our Service. "Personal Data" is any information that relates to an identified or identifiable individual.']})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Collecting and Using Your Personal Data"}),(0,t.jsx)("h3",{className:"mt-8 mb-3 text-lg font-medium",children:"Types of Data Collected"}),(0,t.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Personal Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You, including but not limited to:"}),(0,t.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,t.jsx)("li",{children:"Email address"}),(0,t.jsx)("li",{children:"Name"}),(0,t.jsx)("li",{children:"Usage data"})]}),(0,t.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Usage Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"Necessary diagnostic data may be processed to keep the Service secure and reliable. Optional analytics, such as the pages You visit and how You interact with product features, is collected only after You choose to allow analytics in this browser."}),(0,t.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Information from Third-Party Social Login"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"Alook allows You to create an account and log in through third-party services including Google and GitHub. If You decide to register through or grant us access to a third-party service, We may collect Personal Data already associated with Your account, such as Your name and email address."}),(0,t.jsx)("h4",{className:"mt-6 mb-2 text-base font-medium",children:"Tracking Technologies and Cookies"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"We use necessary cookies to provide sign-in, security, and saved preferences. We use optional analytics cookies only after You allow them. Your analytics choice is saved in a first-party cookie for 180 days and can be changed using the preference control below at any time. Choosing only necessary cookies keeps Google Tag Manager and optional analytics disabled."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Use of Your Personal Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"We may use Your Personal Data for the following purposes:"}),(0,t.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"To provide and maintain our Service"}),", including processing and delivering AI agent tasks on your behalf."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"To manage Your Account"})," and provide You with access to functionalities of the Service available to registered users."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"To contact You"})," by email or other equivalent forms of electronic communication regarding updates or informative communications related to the Service."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"To manage Your requests"})," and attend to any requests You make to Us."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"For business transfers"})," in connection with any merger, sale of company assets, financing, or acquisition of all or a portion of Our business."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"For other purposes"})," such as data analysis, identifying usage trends, and improving our Service."]})]})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Sharing Your Personal Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"We may share Your personal information in the following situations:"}),(0,t.jsxs)("ul",{className:"mt-3 list-disc space-y-2 pl-6 text-foreground/80",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"With Service Providers:"})," We share data with third-party AI model providers to power agent capabilities. Data sent to these providers is governed by their respective privacy policies. We minimize the data shared and only send what is necessary to fulfill Your requests."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"For business transfers:"})," In connection with a merger, acquisition, or asset sale, Your Personal Data may be transferred."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"With Your consent:"})," We may disclose Your personal information for any other purpose with Your consent."]})]}),(0,t.jsx)("p",{className:"mt-4 text-foreground/80",children:"We do not sell Your Personal Data to third parties."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Retention of Your Personal Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"We will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your data to the extent necessary to comply with our legal obligations, resolve disputes, and enforce our agreements."}),(0,t.jsx)("p",{className:"mt-4 text-foreground/80",children:"Usage Data is generally retained for a shorter period of time, except when it is used to strengthen security or improve the functionality of Our Service."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Security of Your Personal Data"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"The security of Your Personal Data is important to Us. Your data is stored securely using industry-standard encryption. Agent workspaces are isolated per user. However, no method of transmission over the Internet or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Children's Privacy"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We will take steps to remove that information."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Your Data Rights"}),(0,t.jsx)("p",{className:"text-foreground/80",children:"You have the right to access, update, or delete Your Personal Data at any time. You can manage certain information through Your Account settings, or contact Us directly to request assistance with these actions."})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Changes to This Privacy Policy"}),(0,t.jsx)("p",{className:"text-foreground/80",children:'We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page and updating the "Last updated" date at the top. You are advised to review this Privacy Policy periodically for any changes.'})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mt-10 mb-4 text-xl font-semibold",children:"Contact Us"}),(0,t.jsxs)("p",{className:"text-foreground/80",children:["If you have any questions about this Privacy Policy, You can contact us at"," ",(0,t.jsx)("a",{href:"mailto:support@alook.ai",className:tn,children:"support@alook.ai"}),"."]})]})]}),(0,t.jsx)("div",{className:"mt-12",children:(0,t.jsx)(te.AnalyticsPreferenceControl,{})})]})}var tr=e.i(531342);function ti({label:e,children:n}){return(0,t.jsxs)("fieldset",{className:"min-w-0",children:[(0,t.jsx)("legend",{className:"mb-1.5 text-xs text-muted-foreground",children:e}),n]})}var ts=e.i(751041),to=e.i(228918),tl=e.i(527668),tc=e.i(109762),tu=e.i(690887),td=e.i(791978);let tm={name:"mail-warning",size:24,node:[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]]};tm.node;let th=(0,en.default)(tm);var tp=e.i(783524),tf=e.i(182149),tg=e.i(577992);async function tv(e){try{switch((await e.json()).error){case"INVALID_OTP":return"That code is incorrect. Try again.";case"OTP_EXPIRED":return"That code expired. Send a new code.";case"TOO_MANY_ATTEMPTS":return"Too many incorrect attempts. Send a new code.";case"RATE_LIMITED":return"Too many requests. Try again when the timer ends.";case"CODE_SEND_FAILED":return"We couldn’t send the code. Try again.";case"ACCOUNT_DELETION_FAILED":return"Your account wasn’t deleted. Try again."}}catch{}return"Something went wrong. Try again."}function ty({email:e,onCancel:a,onDeleted:i}){let[c,u]=(0,o.useAtom)((0,l.useCreateAtom)("notice")),[d,m]=(0,o.useAtom)((0,l.useCreateAtom)("")),[h,p]=(0,o.useAtom)((0,l.useCreateAtom)(0)),[f,g]=(0,o.useAtom)((0,l.useCreateAtom)("")),v=(0,n.useRef)(null),y=(0,n.useRef)(null),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{"code"===c?y.current?.focus():v.current?.focus()},[c]),(0,n.useEffect)(()=>{f&&("code"===c?y.current?.focus():b.current?.focus())},[f,c]),(0,n.useEffect)(()=>{if(h<=0)return;let e=window.setTimeout(()=>{p(e=>Math.max(0,e-1))},1e3);return()=>window.clearTimeout(e)},[h,p]);let x=(0,s.useQueryClient)(),w=(0,r.getCommunityDbRegistry)(x),S=(0,eH.useCreateStore)({active:!0,generation:0}),j=(0,n.useRef)(!1),I=(0,n.useRef)(void 0);(0,n.useLayoutEffect)(()=>(S.setState(e=>({...e,active:!0})),()=>{S.setState(e=>({active:!1,generation:e.generation+1})),!j.current&&I.current&&(0,e$.cancelAccountDeletionAuthTransition)(I.current)}),[S]);let A=()=>{if(!w)throw new DOMException("Missing deletion account","AbortError");let e=(0,T.captureCommunityLiveSnapshotToken)(x),t=S.get().generation,n=new AbortController,a=()=>{(0,T.assertCommunityLiveSnapshotTokenCurrent)(x,e,n.signal);let a=S.get();if(!a.active||a.generation!==t)throw new DOMException("Retired deletion view","AbortError")};a();let r=()=>{try{a()}catch{n.abort()}},i=S.subscribe(r),s=w.runtime.lifecycle.subscribe(r);return{registry:w,generation:t,controller:n,assertActive:a,options:(0,N.communityRequestOptions)(x,e,n.signal,a),release:()=>{i.unsubscribe(),s.unsubscribe()}}},P=(0,Y.useMutation)({meta:{observabilityAction:"account.deletion.command"},mutationFn:async({action:e,body:t,source:n})=>{n.assertActive();let a=await fetch(`/api/community/users/me/account-deletion${"code"===e?"/code":""}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:t,signal:n.controller.signal});return"code"!==e&&a.ok||n.assertActive(),a}}),E=P.isPending&&P.variables?.action==="code",R=P.isPending&&P.variables?.action==="delete",M=async()=>{let e=A();g("");try{let t=await P.mutateAsync({action:"code",body:"{}",source:e});if(e.assertActive(),401===t.status){await e.options.onUnauthorized?.()&&(0,e$.redirectToSignIn)(e.registry.accountId);return}if(!t.ok){let n=429===t.status?(0,tg.parseRetryAfterSeconds)(t.headers):null,a=await tv(t);e.assertActive(),n&&p(n),g(a);return}let n=await t.json();e.assertActive(),m(""),p(n.resend_after),u("code")}catch(t){if((0,C.isAbortError)(t))return;try{e.assertActive()}catch{return}g("We couldn’t send the code. Check your connection and try again.")}finally{e.release()}},O=async()=>{if(!/^\d{6}$/u.test(d))return;let e=A(),t=e.registry.authenticationView.get().generation,n=()=>{let n=e.registry.sessionViewer();return e.registry.authenticationView.get().active&&e.registry.authenticationView.get().generation===t&&(null==n||n===e.registry.accountId)};g("");let a=(0,e$.beginAccountDeletionAuthTransition)(e.registry.accountId);I.current=a;try{let t=await P.mutateAsync({action:"delete",body:JSON.stringify({otp:d}),source:e});if(!t.ok){let n=await tv(t);e.assertActive(),(0,e$.cancelAccountDeletionAuthTransition)(a),I.current=void 0,m(""),g(n);return}let r=!0;try{e.assertActive()}catch{r=!1}if(j.current=!0,(0,N.retireCommunityAccount)(e.registry),await (0,k.clearPersistedCache)(e.registry.accountId).catch(()=>void 0),!r||!n()){(0,e$.cancelAccountDeletionAuthTransition)(a),I.current=void 0;return}try{await i()}catch{}n()&&globalThis.location.replace(e$.ACCOUNT_DELETED_SIGN_IN_PATH)}catch(t){if((0,e$.cancelAccountDeletionAuthTransition)(a),I.current=void 0,(0,C.isAbortError)(t))return;try{e.assertActive()}catch{return}m(""),g("Your account wasn’t deleted. Check your connection and try again.")}finally{e.release()}};return(0,t.jsx)("div",{className:"mx-auto w-full max-w-md animate-in fade-in duration-150 motion-reduce:animate-none","data-testid":eh.tid.accountDeletionFlow,children:"notice"===c?(0,t.jsxs)("section",{className:"space-y-8",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,t.jsx)(tp.Trash2,{className:"size-5"})}),(0,t.jsx)("h2",{ref:v,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Delete your account?"}),(0,t.jsx)("p",{className:"text-sm leading-6 text-muted-foreground",children:"Your profile, messages, agents, and account data will be permanently removed."}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"This can’t be undone."})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-muted/60 p-4",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Deletion code will be sent to"}),(0,t.jsx)("div",{className:"mt-1 break-all text-sm font-medium",children:e})]}),f?(0,t.jsx)("p",{ref:b,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:f}):null,(0,t.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[(0,t.jsx)(eb.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:a,disabled:E,children:"Cancel"}),(0,t.jsx)(eb.Button,{className:"h-11 sm:h-9",onClick:M,disabled:E||h>0,"data-testid":eh.tid.accountDeletionSendCode,children:E?"Sending code…":h>0?`Send deletion code in ${h}s`:"Send deletion code"})]})]}):(0,t.jsxs)("section",{className:"space-y-8",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("span",{className:"flex size-10 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:(0,t.jsx)(th,{className:"size-5"})}),(0,t.jsx)("h2",{ref:v,tabIndex:-1,className:"text-xl font-medium tracking-tight outline-none",children:"Enter deletion code"}),(0,t.jsxs)("p",{className:"text-sm leading-6 text-muted-foreground",children:["We sent a 6-digit code to ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:e}),"."]})]}),(0,t.jsx)(tf.InputOTP,{ref:y,value:d,onChange:e=>{m(e),g("")},maxLength:6,autoFocus:!0,disabled:R,"aria-label":"Deletion code","aria-invalid":!!f,containerClassName:"justify-center sm:justify-start","data-testid":eh.tid.accountDeletionOtp,children:(0,t.jsx)(tf.InputOTPGroup,{children:Array.from({length:6},(e,n)=>(0,t.jsx)(tf.InputOTPSlot,{index:n,className:"size-11 text-base"},n))})}),f?(0,t.jsx)("p",{ref:b,tabIndex:-1,role:"alert",className:"text-sm text-destructive outline-none",children:f}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 sm:flex-row",children:[(0,t.jsx)(eb.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:()=>{g(""),u("notice")},disabled:R,children:"Back"}),(0,t.jsx)(eb.Button,{variant:"ghost",className:"h-11 sm:h-9",onClick:M,disabled:R||E||h>0,children:E?"Sending…":h>0?`Resend code in ${h}s`:"Resend code"})]}),(0,t.jsx)(eb.Button,{variant:"destructive",className:"h-11 sm:h-9",onClick:O,disabled:R||6!==d.length,"data-testid":eh.tid.accountDeletionSubmit,children:R?"Deleting account…":"Delete account"})]})]})})}let tb=[{value:"light",label:"Light",icon:eX.Sun},{value:"dark",label:"Dark",icon:eJ.Moon},{value:"system",label:"System",icon:eZ.Monitor}],tx=[{value:"profile",label:"My Profile",icon:eV},{value:"billing",label:"Subscription & billing",icon:e9},{value:"appearance",label:"Appearance",icon:eG},{value:"advanced",label:"Advanced",icon:e1},{value:"privacy",label:"Privacy",icon:e4.Shield}];function tw(){let{theme:e,setTheme:a}=(0,e6.useTheme)(),[r,i]=(0,o.useAtom)((0,l.useCreateAtom)(!1));(0,n.useEffect)(()=>i(!0),[i]);let s=r?e??"system":void 0;return(0,t.jsx)("div",{className:"mx-auto w-full max-w-md space-y-4",children:(0,t.jsx)(ti,{label:"Theme",children:(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-xl bg-muted/60 p-1",children:tb.map(({value:e,label:n,icon:r})=>{let i=s===e;return(0,t.jsxs)("button",{onClick:()=>a(e),"aria-pressed":i,className:["flex min-h-16 flex-col items-center justify-center gap-2 rounded-lg px-2 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",i?"bg-background text-foreground shadow-(--e1)":"text-muted-foreground hover:bg-background/60 hover:text-foreground"].join(" "),children:[(0,t.jsx)(r,{className:"size-5"}),n]},e)})})})})}let tC=["device","cache","size"];function tk(){let[e,a]=(0,o.useAtom)((0,l.useCreateAtom)(!1)),[r,c]=(0,o.useAtom)((0,l.useCreateAtom)(null)),u=(0,s.useQueryClient)(),d=(0,i.useQuery)({queryKey:tC,queryFn:({signal:e})=>(0,k.getPersistedCacheSizeBytes)(e),retry:!1,staleTime:0}),m=(0,Y.useMutation)({meta:{observabilityAction:"cache.clear"},mutationFn:k.clearAllPersistedCaches}),h=m.isPending;(0,eB.useObservedQueryRegion)("settings",d,1);let p=d.isPending?"loading":d.isError?"unavailable":d.data,f=(0,eH.useCreateStore)({active:!0,generation:0});return(0,n.useLayoutEffect)(()=>(f.setState(e=>({...e,active:!0})),()=>f.setState(e=>({active:!1,generation:e.generation+1}))),[f]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e7.ConfirmDialog,{open:e,onOpenChange:e=>{e||a(!1)},title:"Clear local cache?",description:"This removes locally cached messages and public files for every account used on this device. The next channel or DM you open will refetch from the server. Nothing on the server is deleted.",confirmLabel:"Clear cache",loadingLabel:"Clearing...",loading:h,onConfirm:async()=>{c(null);let e=f.get().generation,t=u.getQueryCache().find({queryKey:tC,exact:!0}),n=()=>{let t=f.get();if(!t.active||t.generation!==e)throw new DOMException("Retired cache settings view","AbortError")};try{await u.cancelQueries({queryKey:tC,exact:!0}),n(),await m.mutateAsync(),n(),t&&u.getQueryCache().find({queryKey:tC,exact:!0})===t&&await u.refetchQueries({queryKey:tC,exact:!0}),n(),a(!1)}catch(e){try{n()}catch{return}c(e instanceof Error?e.message:"Device cache has not been fully cleared. Please try again."),(0,e$.toastApiError)(e,"Failed to clear cache",n),a(!1)}}}),(0,t.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-md flex-col",children:[(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-base font-medium tracking-tight",children:"Clear local cache"}),r&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:r}),(0,t.jsxs)("p",{className:"flex items-baseline justify-between gap-4 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cached messages and public files"}),(0,t.jsx)("span",{"data-testid":eh.tid.settingsCacheSize,className:"font-mono tabular-nums text-foreground",children:"loading"===p?"Calculating…":"unavailable"===p?"Unavailable":(0,k.formatBytes)(p)})]}),(0,t.jsx)("p",{className:"max-w-[65ch] text-sm leading-6 text-muted-foreground",children:"Removes locally cached messages and public files for every account used on this device. The next channel or DM you open will refetch from the server. Nothing on the server is deleted."}),(0,t.jsx)(eb.Button,{variant:"destructive",size:"sm",className:"mt-2 h-11 sm:h-8",onClick:()=>a(!0),children:"Clear local cache"})]}),(0,t.jsxs)("footer",{"data-testid":eh.tid.settingsWebVersion,className:"mt-auto pt-8 font-mono text-xs tabular-nums text-muted-foreground",children:["Web v","0.1.46"]})]})]})}function tS({initialTab:e="profile",billingReturn:a=null,onClose:r,userId:i,userName:s,userEmail:c,aboutMe:u,avatar:d,statusEmoji:m,statusText:h,onSave:p,onLogout:f,onAccountDeleted:g,onUploadAvatar:v}){let[y,b]=(0,o.useAtom)((0,l.useCreateAtom)(s)),[x,w]=(0,o.useAtom)((0,l.useCreateAtom)(u)),[C,k]=(0,o.useAtom)((0,l.useCreateAtom)({emoji:m??null,text:h??null})),[S,j]=(0,o.useAtom)((0,l.useCreateAtom)({name:s,aboutMe:u,emoji:m??null,text:h??null})),[I,A]=(0,o.useAtom)((0,l.useCreateAtom)(e));(0,n.useEffect)(()=>{A(e)},[e,A]);let P=(0,td.useBilling)(a,"billing"===I),[E,N]=(0,o.useAtom)((0,l.useCreateAtom)(!1));(0,ez.useObservedRegion)("settings","billing"!==I&&"advanced"!==I,{source:"unknown",version:"settings_"+I,freshness:"unknown",count:1});let R=y!==S.name||x!==S.aboutMe||C.emoji!==S.emoji||C.text!==S.text;return(0,t.jsx)(tc.SettingsShell,{value:I,onValueChange:A,label:"User Settings",title:"billing"===I?"Subscription & billing":E?"Delete account":"appearance"===I?"Appearance":"advanced"===I?"Advanced":"privacy"===I?"Privacy Policy":"My Profile",tabs:tx,onClose:r,disabled:E,navFooter:(0,t.jsxs)(eb.Button,{variant:"ghost",className:tl.SETTINGS_LOGOUT_CLASS,size:"sm",onClick:f,"aria-label":"Log out",disabled:E,children:[(0,t.jsx)(eW.LogOut,{className:"size-4"})," ",(0,t.jsx)("span",{className:"sr-only sm:not-sr-only",children:"Log Out"})]}),children:E?(0,t.jsx)(ty,{email:c,onCancel:()=>N(!1),onDeleted:g}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tc.SettingsShellPanel,{value:"billing",children:(0,t.jsx)("div",{className:"mx-auto w-full max-w-xl",children:(0,t.jsx)(tu.BillingContent,{billing:P})})}),(0,t.jsx)(tc.SettingsShellPanel,{value:"profile",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-md space-y-8",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsx)("span",{className:"block size-24 overflow-hidden rounded-full ring-1 ring-border/50",children:(0,t.jsx)(tr.Avatar,{label:d,seed:i??void 0,size:96})}),(0,t.jsxs)("button",{type:"button",onClick:v,className:"flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:[(0,t.jsx)(e2.Camera,{className:"size-3.5"})," Change photo"]})]}),(0,t.jsx)("input",{value:y,onChange:e=>b(e.target.value),placeholder:"Your name","aria-label":"Display name",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background sm:text-2xl"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"About"}),(0,t.jsx)(e3.AutoResizeTextarea,{value:x,onChange:e=>w(e.target.value),placeholder:"Add a bit about yourself…",className:"min-h-11 w-full rounded-sm border-0 bg-transparent px-0 py-1 text-sm leading-6 text-foreground shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-4 focus-visible:ring-offset-background"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Status"}),(0,t.jsx)(ts.StatusEditor,{emoji:C.emoji,text:C.text,onChange:(e,t)=>k({emoji:e,text:t}),children:(0,t.jsx)("button",{className:"inline-flex min-h-11 items-center gap-2 rounded-full border border-border/50 px-3 text-sm transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8",children:(0,to.hasStatus)(C.emoji,C.text)?(0,t.jsxs)("span",{children:[C.emoji," ",C.text]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Set a status"})})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)(eb.Button,{variant:"ghost",size:"sm",className:"h-11 shrink-0 px-3 text-destructive hover:text-destructive sm:h-8",onClick:()=>N(!0),"aria-label":"Delete account","data-testid":eh.tid.accountDeletionOpen,children:"Delete account"}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,t.jsx)(eb.Button,{variant:"ghost",size:"sm",className:"h-11 sm:h-8",onClick:()=>{b(S.name),w(S.aboutMe),k({emoji:S.emoji,text:S.text})},disabled:!R,children:"Cancel"}),(0,t.jsx)(eb.Button,{size:"sm",className:"h-11 sm:h-8",onClick:()=>{if(!R)return;let e=y.trim(),t=x.trim();p({name:e,aboutMe:t,statusEmoji:C.emoji,statusText:C.text}),j({name:e,aboutMe:t,emoji:C.emoji,text:C.text}),b(e),w(t)},disabled:!R,children:"Save changes"})]})]})]})}),(0,t.jsx)(tc.SettingsShellPanel,{value:"appearance",children:(0,t.jsx)(tw,{})}),(0,t.jsx)(tc.SettingsShellPanel,{value:"advanced",className:"h-full",children:(0,t.jsx)(tk,{})}),(0,t.jsx)(tc.SettingsShellPanel,{value:"privacy",children:(0,t.jsx)("div",{className:"mx-auto w-full max-w-2xl pb-8",children:(0,t.jsx)(ta,{})})})]})})}var tj=e.i(393085);function tI(e){return Number(e.toFixed(6)).toString()}function tA(e,t){if(void 0!==e&&void 0!==t&&Number.isFinite(e)&&Number.isFinite(t)&&!(e<=0)&&!(t<=0))return{width:e,height:t}}var tP=e.i(677204);function tE({image:e}){let a=(0,n.useMemo)(()=>tA(e.width,e.height),[e.height,e.width]),[r,i]=(0,o.useAtom)((0,l.useCreateAtom)(a)),[s,c]=(0,o.useAtom)((0,l.useCreateAtom)(null)),[u,d,,m,h,p]=(0,tP.useRemoteImageAttempt)(),[f,g,v,y,b,x,w]=(0,tP.useRemoteImageAttempt)(),C=function(e){if(!e)return{width:"min(200px, 90vw, 85vh)",aspectRatio:"1 / 1"};let t=85*(e.width/e.height);return{width:`min(${tI(e.width)}px, 90vw, ${tI(t)}vh)`,aspectRatio:`${tI(e.width)} / ${tI(e.height)}`}}(r),k=!!e.thumbnailUrl&&"ready"===u,S="ready"===f&&s===g;return(0,n.useEffect)(()=>{if("ready"!==f||!v)return;let e=tA(v.naturalWidth,v.naturalHeight),t=()=>{i(a??e),c(g)};if("function"!=typeof requestAnimationFrame)return void t();let n=requestAnimationFrame(t);return()=>cancelAnimationFrame(n)},[a,g,v,f,i,c]),(0,t.jsxs)("div",{className:"relative w-fit",children:[(0,t.jsxs)("div",{"data-testid":eh.tid.imageLightbox,"data-native-context-menu":"true",className:"relative overflow-hidden rounded-lg bg-background",style:C,children:[e.thumbnailUrl&&(0,t.jsx)("img",{ref:m,"data-testid":eh.tid.imageLightboxThumbnail,"data-remote-image-kind":"content","data-remote-image-state":u,src:e.thumbnailUrl,alt:e.name,onLoad:h,onError:p,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${k&&!S?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`thumbnail-${d}`),!k&&!S&&"pending"===f&&(0,t.jsx)("div",{"data-testid":eh.tid.imageLightboxLoading,role:"status",className:"absolute inset-0 flex animate-pulse items-center justify-center bg-muted/70 px-4 text-sm text-muted-foreground motion-reduce:animate-none",children:"Loading original image"}),"error"!==f&&(0,t.jsx)("img",{ref:y,"data-testid":eh.tid.imageLightboxOriginal,"data-remote-image-kind":"content","data-remote-image-state":f,src:e.originalUrl,alt:e.name,onLoad:b,onError:x,className:`absolute inset-0 size-full rounded-lg object-contain transition-opacity duration-150 ease-out motion-reduce:transition-none ${S?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`},`original-${g}`)]}),"error"===f&&(0,t.jsxs)("div",{"data-testid":eh.tid.imageLightboxError,role:"status",className:"absolute bottom-3 left-1/2 z-10 flex min-h-11 w-max max-w-[min(90vw,24rem)] -translate-x-1/2 items-center justify-between gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm",children:[(0,t.jsx)("span",{children:"Failed to load original image"}),(0,t.jsx)("button",{type:"button","data-testid":eh.tid.imageLightboxRetry,onClick:w,className:"h-12 min-w-12 rounded-md px-3 font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:h-9 sm:min-w-0",children:"Retry"})]})]})}function tN({image:e,onClose:n}){return(0,t.jsx)(eK.Dialog,{open:!0,onOpenChange:e=>{e||n()},children:(0,t.jsx)(eK.DialogContent,{className:"flex max-h-[90vh] w-auto items-center justify-center border-none bg-transparent p-0 shadow-none sm:max-w-none",showCloseButton:!1,children:(0,t.jsx)(tE,{image:e},`${e.originalUrl}\u0000${e.thumbnailUrl??""}\u0000${e.width??""}\u0000${e.height??""}`)})})}var tR=e.i(549712),tT=e.i(719728),tM=e.i(564658),tO=e.i(607378),tD=e.i(265142),tL=e.i(49980),t_=e.i(972525),tU=e.i(655041),tF=e.i(986087);e.i(43729);var tq=e.i(786637),tK=e.i(43345);let tz=(0,tT.default)(()=>e.A(762162).then(e=>e.CodePreview),{loadableGenerated:{modules:[145142]},ssr:!1,loading:()=>(0,t.jsxs)("div",{"data-testid":eh.tid.codePreview,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(tD.Loader2,{className:"size-4 animate-spin"}),"Loading syntax highlighter…"]})}),tB=(0,tT.default)(()=>e.A(911974).then(e=>e.PdfPreview),{loadableGenerated:{modules:[144402]},ssr:!1,loading:()=>(0,t.jsxs)("div",{"data-testid":eh.tid.pdfPreviewStatus,role:"status",className:"flex min-h-40 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(tD.Loader2,{className:"size-4 animate-spin motion-reduce:animate-none"}),"Loading PDF renderer…"]})}),tH={status:"idle",content:null,error:null};function t$({attachment:e}){let n=(0,tK.useAttachmentDownload)(e),a=(0,tq.attachmentDownloadStatusText)(n.state),r="downloading"===n.state.status?tD.Loader2:"saved"===n.state.status||"started"===n.state.status?tM.CircleCheck:"error"===n.state.status?tL.RefreshCw:tO.Download;return(0,t.jsxs)("button",{type:"button","data-testid":eh.tid.attachmentPreviewDownload,onClick:()=>"downloading"===n.state.status?n.cancel():void n.start(),"aria-busy":"downloading"===n.state.status,className:(0,eb.buttonVariants)({variant:"outline",size:"sm",className:"h-11 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground sm:h-7"}),children:[(0,t.jsx)(r,{className:`size-3.5 ${"downloading"===n.state.status?"animate-spin motion-reduce:animate-none":""}`}),"downloading"===n.state.status?"Cancel download":a??"Download"]})}async function tQ(e,t=tF.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES,n){return new TextDecoder().decode(await tV(e,t,n))}async function tV(e,t,n){if(!e.ok)throw Error(`Couldn’t load this attachment (${e.status})`);let a=Number(e.headers.get("content-length"));if(Number.isFinite(a)&&a>t)throw Error("This file is too large to preview");if(!e.body){let a=new Uint8Array(await e.arrayBuffer());if(n?.aborted)throw new DOMException("Aborted","AbortError");if(a.byteLength>t)throw Error("This file is too large to preview");return a}let r=e.body.getReader(),i=0,s=[];try{for(;;){if(n?.aborted)throw new DOMException("Aborted","AbortError");let{done:e,value:a}=await r.read();if(n?.aborted)throw new DOMException("Aborted","AbortError");if(e)break;if((i+=a.byteLength)>t)throw await r.cancel(),Error("This file is too large to preview");s.push(a)}let e=new Uint8Array(i),a=0;for(let t of s)e.set(t,a),a+=t.byteLength;return e}finally{n?.aborted&&await r.cancel().catch(()=>void 0),r.releaseLock()}}function tW({attachment:e,open:n,onOpenChange:a}){let r=(0,tR.useApplicationOwner)(),s=e?(0,tF.resolveAttachmentPresentation)(e.name,e.contentType):null,o=s?.previewKind==="pdf"?tF.MAX_PDF_ATTACHMENT_PREVIEW_BYTES:tF.MAX_TEXT_ATTACHMENT_PREVIEW_BYTES,l=s?.previewKind?e?.sizeBytes!==void 0&&e.sizeBytes>o?"This file is too large to preview":null:"This file type can’t be previewed",c=(0,i.useQuery)({queryKey:(0,tR.applicationKey)(r,"attachment-preview",n?e?.url??null:null,s?.previewKind??null,o),enabled:n&&null!==e&&null===l,gcTime:0,staleTime:1/0,retry:!1,queryFn:async({signal:t})=>{let n=(0,tR.captureApplicationOwner)(r),a=()=>(0,tR.assertApplicationOwner)(n,t);if(a(),!e||!s?.previewKind)throw Error("No attachment selected");try{let n=await fetch(e.url,{credentials:"same-origin",signal:t});a();let r="pdf"===s.previewKind?{status:"ready",kind:"pdf",content:await tV(n,o,t),error:null}:{status:"ready",kind:"text",content:await tQ(n,o,t),error:null};return a(),r}catch(e){throw a(),e}}},r.queryClient),u=n&&e?l?{status:"error",content:null,error:l}:c.isError?{status:"error",content:null,error:c.error instanceof Error?c.error.message:"Couldn’t load this attachment"}:c.data??{status:"loading",content:null,error:null}:tH;(0,eB.useObservedQueryRegion)("file_preview",c,void 0,n&&"ready"===u.status&&s?.previewKind==="text");let d=e?(0,tF.formatAttachmentSize)(e.sizeBytes)||e.size:"";return(0,t.jsxs)(t_.CommunitySheet,{open:n,onOpenChange:a,title:e?.name??"Attachment",description:[e?.contentType||s?.category,d].filter(Boolean).join(" · "),footer:e&&(0,t.jsx)(t$,{attachment:e}),resizable:!0,closeLabel:"Close attachment preview",contentTestId:eh.tid.attachmentPreviewSheet,bodyTestId:eh.tid.attachmentPreviewContent,bodyClassName:(0,e8.cn)("flex min-h-0 flex-col",s?.previewKind==="pdf"&&"overflow-hidden",(s?.previewKind==="code"||s?.previewKind==="text"||s?.previewKind==="pdf")&&"p-0 sm:p-0"),children:["loading"===u.status&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,t.jsx)(tD.Loader2,{className:"size-4 animate-spin"}),"Loading preview…"]}),"error"===u.status&&(0,t.jsxs)("div",{className:"flex min-h-40 flex-col items-center justify-center gap-2 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Preview unavailable"}),(0,t.jsx)("p",{className:"max-w-72 text-sm text-muted-foreground",children:u.error})]}),"ready"===u.status&&"text"===u.kind&&s?.previewKind==="markdown"&&(0,t.jsx)(tU.MessageBody,{text:u.content}),"ready"===u.status&&"text"===u.kind&&s?.previewKind!=="markdown"&&(0,t.jsx)(tz,{content:u.content,language:s?.shikiLanguage??null}),"ready"===u.status&&"pdf"===u.kind&&(0,t.jsx)(tB,{data:u.content})]})}var tY=e.i(369546);function tG({controller:e,breakpoint:n,extraDialogs:a,suppressProfileCard:r=!1}){let{profile:i,currentUser:s}=e,o=e.pendingAvatarCrop;return(0,t.jsxs)(t.Fragment,{children:[i&&!r&&(0,t.jsx)(tj.ProfileCard,{data:i.data,x:i.x,y:i.y,bp:n,onClose:e.closeProfile,onMessage:e.profileMessage,isSelf:!!i.data.userId&&i.data.userId===s.id,onUpdateStatus:e.updateOwnStatus,onOpenOwnerProfile:e.openOwnerProfile,onOpenBotAudit:e.openBotAudit},`${i.data.userId??i.data.name}:${i.x}:${i.y}`),e.preview&&(0,t.jsx)(tN,{image:e.preview,onClose:e.closePreview}),(0,t.jsx)(tW,{attachment:e.attachmentPreview,open:!!e.attachmentPreview,onOpenChange:e.onAttachmentPreviewOpenChange}),(0,t.jsx)(eK.Dialog,{open:e.editingProfile,onOpenChange:e.onUserSettingsOpenChange,children:(0,t.jsx)(eK.DialogContent,{className:"flex h-dvh max-h-dvh w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none p-0 sm:h-[calc(100vh-4rem)] sm:max-h-180 sm:w-[calc(100vw-4rem)] sm:max-w-4xl sm:rounded-xl",showCloseButton:!1,children:(0,t.jsx)(tS,{...e.userSettingsProps})})}),o&&(0,t.jsx)(tY.ImageCropDialog,{...o,maskShape:"circle"}),a]})}var tX=e.i(52622);let tJ={active:"none",update:null};function tZ(e){return[...new Set(e)]}function t0(e,t){return e.filter(e=>!t.has(e))}function t1(e,t){return e.filter(e=>t.has(e))}function t2(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function t4(e,t){if(!e.update)return e;let n=new Set(t),a=tZ(t);if(0===a.length)return{active:"update"===e.active?"none":e.active,update:null};let r=t1(e.update.acceptedMachineIds,n),i=t1(e.update.failedMachineIds,n),s=t1(e.update.pendingMachineIds,n),o=i.length>0?"retry":r.length>0||s.length>0?"updating":"update"===e.active?"expanded":"collapsedBadge";return o===e.update.phase&&t2(a,e.update.targetMachineIds)&&t2(r,e.update.acceptedMachineIds)&&t2(i,e.update.failedMachineIds)&&t2(s,e.update.pendingMachineIds)?e:{...e,update:{phase:o,targetMachineIds:a,acceptedMachineIds:r,failedMachineIds:i,pendingMachineIds:s}}}var t5=e.i(692462),t9=e.i(708717);function t6({breakpoint:e,checkpoint:n,sidebar:a,children:r,extraDialogs:i,rail:s,profile:o,inbox:l,userBarExtension:c,daemonUpdate:u,onUserBarInboxOpenChange:d,onUserBarOpenProfile:m,onUserBarOpenUpdate:h,dismissUserBarExtension:p}){let{surface:f}=n,{runningBots:g}=(0,t5.useRunningOwnedBots)(),v=(0,t.jsx)(eq.InboxPopover,{...l.popoverProps,surface:"extension"}),y={id:o.currentUser.id,name:o.currentUser.name,avatar:o.currentUser.avatar,runningBotCount:g.length},b="unknown"===e,x="profile"===c.active&&o.profile?.data.userId===o.currentUser.id,w=x&&o.profile?(0,t.jsx)(tj.ProfileCard,{data:o.profile.data,x:o.profile.x,y:o.profile.y,bp:e,onClose:o.closeProfile,onMessage:o.profileMessage,isSelf:!0,onUpdateStatus:o.updateOwnStatus,onOpenOwnerProfile:o.openOwnerProfile,onOpenBotAudit:o.openBotAudit,extension:!0}):null,C=x&&g.length>0?(0,t.jsx)(t9.ProfileRunningBotsCard,{onOpenBotAudit:o.openBotAudit,showShadow:"mobile"!==e}):null;return(0,t.jsx)(tX.CommunityShellLayout,{breakpoint:e,surface:f,rail:(0,t.jsx)(eU.ServerRail,{...s.railProps,bottomInset:60}),preserveHiddenMobileModules:!0,sidebar:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{hidden:"keep"!==n.sidebar.kind,inert:"keep"!==n.sidebar.kind,"aria-hidden":"keep"!==n.sidebar.kind||void 0,className:"flex min-h-0 flex-1 flex-col",children:"desktop"===e?a():a({noHeader:!1})}),"server-skeleton"===n.sidebar.kind?(0,t.jsx)(eD.ChannelSidebarSkeleton,{targetServerId:n.sidebar.serverId}):"me-skeleton"===n.sidebar.kind?(0,t.jsx)(eL.DmSidebarSkeleton,{}):null]}),main:"target-skeleton"===n.main.kind?(0,t.jsx)(e_.CommunityPendingFrame,{href:n.targetHref,reserveBackSlot:"detail"===f,conversationSubtype:n.main.conversationSubtype}):r,userBar:(0,t.jsx)(eF.UserBar,{breakpoint:e,user:y,onOpenProfile:m,onEditProfile:o.openUserSettings,inbox:v,hasUnread:l.hasUnread,unreadCount:l.unreadCount,unreadCountPartial:l.unreadCountPartial,inboxOpen:"inbox"===c.active,onInboxOpenChange:d,extension:{active:c.active,inbox:v,profile:w,profileCompanion:C,update:u.update,updateBadgePhase:c.update&&"update"!==c.active?"expanded"===c.update.phase?"collapsedBadge":c.update.phase:null,eligibleMachines:u.eligibleMachines,onOpenUpdate:h,onRequestUpdate:u.request,onDismiss:p}}),overlays:!b&&(0,t.jsx)(tG,{controller:o,breakpoint:e,extraDialogs:i,suppressProfileCard:x})})}var t3=e.i(876986),t7=e.i(280958);let t8=Object.freeze([]),ne=async(e={})=>{let t=(0,T.captureCommunityLiveSnapshotToken)(e.client);return{folders:(await (0,e$.apiFetch)("/api/community/users/me/server-folders",(0,N.communityRequestOptions)(e.client,t,e.signal))).folders.map(e=>({id:e.id,name:e.name,position:e.position??0,servers:e.servers.map(e=>({id:e.id,name:e.name,initial:(0,t7.avatarInitial)(e.name),icon:e.icon??null}))}))}};e.i(384302);var nt=e.i(462553),nn=e.i(333671);function na({targetServerId:e,activeServerId:t,overlay:n,hasActiveOpener:a,publishedHref:r}){if(e===t&&a)return{kind:"open-active"};if(e===t&&r&&(0,ek.communityServerId)(r)===e){let e=new URL(r,"https://alook.local");return e.searchParams.set(n,"1"),{kind:"navigate",href:`${e.pathname}${e.search}${e.hash}`}}return{kind:"navigate",href:`/c/channels/${e}?${n}=1`}}var nr=e.i(138906);function ni(e,t,n,a,r){let i=e?.collections.servers.get(t)?.detailComplete===!0,s=e&&i?r??Array.from(e.collections.channels.values()).filter(e=>e.serverId===t&&"thread"!==e.type&&!e.pending).map(e=>e.id):[];return(0,ej.resolveCommunityLandingHref)({serverId:t,channelIds:s,last:n,breakpoint:a})}e.i(954194);var ns=e.i(686988),no=e.i(354139),nl=e.i(217372);function nc(e,t){if(e&&t&&"role"in t)return t.role.charAt(0).toUpperCase()+t.role.slice(1)}var nu=e.i(47749),nd=e.i(725521),nm=e.i(776152),nh=e.i(939098),np=e.i(459663);e.i(463690);var nf=e.i(251829),ng=e.i(4674),nv=e.i(248933),ny=e.i(975210);let nb=new WeakMap;function nx(e,t){e.value.setState(e=>({...e,lease:t}))}function nw(e,t){if(e===t)return!0;if(!e)return!1;let n=e=>{let[t,n=""]=e.split("?"),a=new URLSearchParams(n);a.delete("inboxThreadOpener");let r=a.toString();return`${t}${r?`?${r}`:""}`};return n(e)===n(t)}var nC=e.i(387170),nk=e.i(797473),nS=e.i(588732),nj=e.i(595072),nI=e.i(31163),nA=e.i(631931),nP=e.i(214997),nE=e.i(850441),nN=e.i(874697),nR=e.i(42420);function nT(e,t,n,a=0){(0,u.getCommunityRuntime)(e).ws.actions.isChannelAccessRevoked(t.channelId,t.serverId??null)&&(0,ng.startChannelRouteVerification)(e,t.serverId??null,t.channelId).catch(()=>void 0);let{epoch:r,signal:i}=(0,nR.beginConversationNavigationProof)(e,t,n,a);(0,nR.registerConversationNavigationRecovery)(e,r,(n,a)=>{nT(e,t,n,a)});let s=t.anchorMessageId?{mode:"anchor",anchor:t.anchorMessageId}:{mode:"newest"},o=c.communityKeys.channelMessages(t.channelId),l="dm"===t.scopeKind?(0,nE.dmMessagesQueryFn)(t.channelId,{queryClient:e,onSurfaceReceipt:t=>{(0,nR.recordConversationNavigationReceipt)(e,t,n,r)}}):(0,nE.channelMessagesQueryFn)(t.channelId,null,{queryClient:e,onSurfaceReceipt:t=>{(0,nR.recordConversationNavigationReceipt)(e,t,n,r)}});e.cancelQueries({queryKey:o,exact:!0}),e.setQueryData(o,e=>e?{...e,pageParams:[s,...e.pageParams.slice(1)]}:e);let d={queryKey:o,queryFn:l,initialPageParam:s,pages:1,getNextPageParam:()=>void 0,retry:(0,nP.conversationReadRetryPolicy)(e.defaultQueryOptions({queryKey:o}).retry),networkMode:"always",staleTime:0},m=new nA.InfiniteQueryObserver(e,{...d,enabled:!1}).subscribe(()=>void 0);e.infiniteQuery({...d,select:void 0}).then(()=>{(0,nR.isCurrentConversationNavigation)(e,r,n)&&((0,nR.commitConversationNavigationProof)(e,t.channelId,n),(0,nR.getConversationNavigationProof)(e)?.status==="warming"&&(0,nR.failConversationNavigationProof)(e,r,n,!1,!0))}).catch(a=>{let s,o;if(i.aborted||!(0,nR.isCurrentConversationNavigation)(e,r,n))return;let l=a instanceof C.ApiError&&(403===a.status||404===a.status);l&&(s=c.communityKeys.channelMessages(t.channelId),o=c.communityKeys.channelReadStateSnapshot(t.channelId),e.removeQueries({queryKey:s}),e.removeQueries({queryKey:o}),e.removeQueries({queryKey:c.communityKeys.channelMeta(t.serverId??null,t.channelId)}),(0,u.getCommunityRuntime)(e).messageStream.actions.removeScope("dm"===t.scopeKind?{kind:"dm",id:t.channelId}:{kind:"channel",id:t.channelId,serverId:t.serverId})),(0,nR.failConversationNavigationProof)(e,r,n,l,!0)}).finally(m);let h=c.communityKeys.channelReadStateSnapshot(t.channelId);if(e.query({queryKey:h,staleTime:0,retry:!1,networkMode:"always",queryFn:(0,nN.channelReadStateSnapshotQueryFn)(t.channelId,t.scopeKind,{waitForRegistryReady:!0,assertNavigationCurrent:()=>{if(!(0,nR.isCurrentConversationNavigation)(e,r,n))throw new DOMException("Retired conversation warmup","AbortError")}}),select:void 0}).catch(()=>void 0),t.serverId){let n=t.serverId,a=c.communityKeys.server(n),r={queryKey:a,queryFn:({signal:t})=>(0,Z.serverProjectedQueryFn)(e,n,t)(),staleTime:1/0,networkMode:"always",retry:(0,nP.conversationReadRetryPolicy)(e.defaultQueryOptions({queryKey:a}).retry)},i=new W.QueryObserver(e,{...r,enabled:!1}).subscribe(()=>void 0);e.query({...r,select:void 0}).finally(i).catch(()=>void 0)}return r}var nM=e.i(929554);function nO(e){e.revision+=1}async function nD(e,t,n){let a=++e.revision,r=await t();return a===e.revision&&(n(r),!0)}var nL=e.i(907903);e.i(972115);var n_=e.i(908967),nU=e.i(846367);e.i(678523);var nF=e.i(840429);async function nq(e,t){await (0,e$.apiFetch)(`/api/community/machines/${e}/update`,{...t,method:"POST"})}var nK=e.i(617527);function nz(e,t){return`alook:daemon-update-collapsed:${e}:${t}`}function nB(e,t,n){try{let a=nz(e,t);n?window.localStorage.setItem(a,"1"):window.localStorage.removeItem(a)}catch{}}async function nH(e,t){let n=await Promise.allSettled(e.map(async e=>(await t(e),e))),a=[],r=[];return n.forEach((t,n)=>{let i=e[n];"fulfilled"===t.status?a.push(i):r.push(i)}),{acceptedMachineIds:a,failedMachineIds:r}}var n$=e.i(251535);let nQ="alook:native-back";function nV(e){let{view:d,activeServerId:m,frameHref:h,sidebar:p,children:f,extraDialogs:g,onOpenActiveServerSettings:v,onOpenActiveServerInvite:y,ownerDeleteRouteScope:b}=e,x=(0,s.useQueryClient)(),w=(0,q.useCurrentUser)(),C=(0,ex.useCommunityWsStore)(e=>e.accessEpoch),k=(0,eM.useBreakpoint)(),I=(0,ee.useCommunityOnboarding)(),E={...(0,ek.normalizeCommunityHref)(h),revision:0},M=(0,n.useRef)(E),[O,D]=(0,o.useAtom)((0,l.useCreateAtom)(E)),L=(0,n.useCallback)(e=>{let t=M.current,n=(0,ek.advanceCommunityCommittedFrame)(t,e);n!==t&&(M.current=n,D(n))},[D]);(0,n.useLayoutEffect)(()=>{L(h),(0,eT.commitNavigation)(h),b&&(0,eS.registerOwnerServerDeleteRoute)(x,b.serverId,b.token),(0,eS.observeOwnerServerDeleteRouteCommit)(x,h)},[L,h,b,x]),(0,n.useEffect)(()=>{(0,n$.flushOwnerServerDeleteRouteCommit)(x)},[h,x]);let _=function(e){let t=(0,a.useRouter)(),r=(0,a.usePathname)(),i=(0,a.useSearchParams)().toString(),c=i?`${r}?${i}`:r,u=(0,s.useQueryClient)(),d=(0,n.useRef)({revision:0}),m=(0,n.useRef)(!1);(0,n.useLayoutEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let h=(0,n.useRef)(e);(0,n.useLayoutEffect)(()=>{h.current=e},[e]);let p=(0,n.useCallback)(()=>{let e=d.current.revision,t=h.current.revision;return()=>m.current&&e===d.current.revision&&t===h.current.revision},[]),f=(0,n.useRef)(e.revision),g=(0,n.useRef)(e.leafKey),[v,y]=(0,o.useAtom)((0,l.useCreateAtom)(!1)),[b,x]=(0,o.useAtom)((0,l.useCreateAtom)(null)),w=(0,n.useCallback)(()=>{nO(d.current),(0,nR.cancelActiveConversationNavigationProof)(u),y(!1),x(null)},[u,y,x]);(0,n.useEffect)(()=>{null===b||((0,ek.normalizeCommunityHref)(b).leafKey===g.current?(0,ek.isPublishedNonStructuralCommit)(e,c,b):(0,ek.isStructuralFrameCommit)({committedFrame:e,targetHref:b,baselineRevision:f.current}))&&(nO(d.current),y(!1),x(null))},[e,b,c,y,x]),(0,n.useEffect)(()=>{let e=()=>w();return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},[w]);let C=(0,n.useCallback)(n=>{n!==c||v?((0,eT.beginNavigation)(n),nO(d.current),(0,nR.cancelActiveConversationNavigationProof)(u),f.current=e.revision,g.current=e.leafKey,(0,nM.flushSync)(()=>{y(!0),x(n)}),t.push(n)):(0,eT.navigationNoop)(n)},[e.leafKey,e.revision,v,c,u,t,y,x]),k=(0,n.useCallback)(n=>{n!==c||v?((0,eT.beginNavigation)(n),nO(d.current),f.current=e.revision,g.current=e.leafKey,(0,nM.flushSync)(()=>{y(!0),x(n)}),t.push(n)):(0,eT.navigationNoop)(n)},[e.leafKey,e.revision,v,c,t,y,x]),S=(0,n.useCallback)(n=>{n!==c||v?((0,eT.beginNavigation)(n),nO(d.current),(0,nR.cancelActiveConversationNavigationProof)(u),f.current=e.revision,g.current=e.leafKey,y(!0),x(n),t.replace(n)):(0,eT.navigationNoop)(n)},[e.leafKey,e.revision,v,c,u,t,y,x]),j=(0,n.useCallback)(async n=>{(0,nR.cancelActiveConversationNavigationProof)(u),f.current=e.revision,g.current=e.leafKey,y(!0),x(null);let a=nD(d.current,n,e=>{if(e===c){(0,eT.navigationNoop)(e),y(!1),x(null);return}(0,eT.beginNavigation)(e),x(e),t.push(e)}),r=d.current.revision;try{return await a}catch(e){throw d.current.revision===r&&(y(!1),x(null)),e}},[e.leafKey,e.revision,c,u,t,y,x]);return{captureIntent:p,publishedHref:c,navigationPending:v,pendingHref:b,push:C,pushImmediate:k,replace:S,resolveAndPush:j,cancelPendingNavigation:w}}(O),U=_.replace,F=(0,ek.resolveCommunityRoute)(O.pathname),K=_.pendingHref?(0,ek.normalizeCommunityHref)(_.pendingHref):null,z=K?.scope.kind==="server"?K.scope.serverId:null,B=_.pendingHref?(0,ek.resolveCommunityModulePlan)(_.pendingHref):null,H=B?.main.kind==="server-conversation"?B.main.leafId:null,$=(0,R.useServerTreeProjection)(z),Q=(0,R.useRouteChannelProjection)(H),V=$?.categories?.flatMap(e=>e.channels).find(e=>e.id===H)??Q,W=V?.type==="text"||V?.type==="forum"||V?.type==="thread"?V.type:void 0,G=z?void 0!==x.getQueryData(c.communityKeys.server(z))||void 0!==$:K?.scope.kind==="me"&&void 0!==x.getQueryData(c.communityKeys.dms()),et=(0,ek.resolveCommunityCheckpointPlan)({committedFrame:O,targetHref:_.pendingHref,pending:_.navigationPending,targetReady:G,targetConversationSubtype:W}),en="target"===et.rail.kind?et.rail.view:d,ea="target"===et.rail.kind?et.rail.activeServerId:m,er=function({navigation:e,queryClient:t,breakpoint:a,view:o,projectedView:u=o,activeServerId:d,projectedActiveServerId:m,onOpenActiveServerSettings:h,onOpenActiveServerInvite:p,accountId:f}){let g,v,y,b,x,w,C,k=(0,R.useOptionalCommunityDbRegistry)(),S=(0,X.useCommunityMutationOrigin)(),j=(0,Z.useServers)(),I=(g=(0,R.useServerRailProjection)(),v=(0,s.useQueryClient)(),{...(0,i.useQuery)({queryKey:c.communityKeys.folders(),queryFn:async(e={})=>{let t=(0,T.captureCommunityLiveSnapshotToken)(v),n=await ne(e);return(0,T.publishCommunityLiveSnapshot)(v,{snapshot:{kind:"folders",data:n},proof:{kind:"structural",token:t,signal:e.signal}}),n.folders.map(e=>e.id)}}),folders:g?.folders??t8}),A=j.servers,P=I.folders,E=A.length>0||void 0!==j.data||!f,N=(0,l.useCreateAtom)({active:!1,generation:0,navigation:null});(0,n.useLayoutEffect)(()=>(N.set(e=>({...e,active:!0,generation:e.generation+1})),()=>N.set(e=>({...e,active:!1,generation:e.generation+1}))),[k,N]),(0,n.useLayoutEffect)(()=>{N.set(t=>({...t,navigation:e}))},[e,N]);let M=(0,n.useCallback)(e=>N.get().active&&N.get().generation===e&&!!k?.runtime.lifecycle.get().active&&(0,r.getCommunityDbRegistry)(t)===k,[k,t,N]),O=(0,n.useCallback)(()=>{let t=N.get().generation,n=S.begin().token,a=k.authenticationView.get(),r=e.captureIntent(),i=()=>{S.assertOwner(n);let e=k.authenticationView.get();if(!M(t)||!e.active||e.generation!==a.generation)throw new DOMException("Retired rail account","AbortError")};return{assertAccount:i,assertUi:()=>{if(i(),!r())throw new DOMException("Retired rail intent","AbortError")}}},[k,e,S,M,N]),{mutateAsync:D}=(0,nt.useCreateServer)(),{mutate:L}=(0,nt.useLeaveServer)(),{mutate:_}=(0,nt.useUploadServerIcon)(),U=(0,n.useMemo)(()=>A.map(e=>({...e,active:e.id===m})),[m,A]),{homeHref:F,serverHrefs:q}=(y=(0,R.useOptionalCommunityDbRegistry)(),b=(0,n.useCallback)(e=>{let t=(0,nr.subscribeNavigationMemory)(e),n=y?.collections.servers.subscribeChanges(e),a=y?.collections.channels.subscribeChanges(e);return()=>{t(),n?.unsubscribe(),a?.unsubscribe()}},[y]),x=(0,n.useCallback)(()=>{let e=new Map;for(let t of y?.collections.channels.values()??[]){if(!t.serverId||"thread"===t.type||t.pending)continue;let n=e.get(t.serverId)??[];n.push(t.id),e.set(t.serverId,n)}return JSON.stringify({homeHref:(0,ej.resolveCommunityLandingHref)({serverId:null,last:(0,nr.readNavigationMemory)((0,nn.lastMeLocationKey)()),breakpoint:a}),serverHrefs:Object.fromEntries(A.map(({id:t})=>[t,ni(y,t,(0,nr.readNavigationMemory)((0,ej.lastChannelKey)(t)),a,e.get(t)??[])]))})},[y,A,a]),w=(0,n.useCallback)(()=>JSON.stringify({homeHref:(0,ej.resolveCommunityLandingHref)({serverId:null,last:null,breakpoint:a}),serverHrefs:Object.fromEntries(A.map(({id:e})=>[e,(0,ej.resolveCommunityLandingHref)({serverId:e,last:null,breakpoint:a})]))}),[A,a]),C=(0,n.useSyncExternalStore)(b,x,w),(0,n.useMemo)(()=>JSON.parse(C),[C])),K=(0,n.useCallback)(e=>ni(k,e,(0,ej.getLastChannel)(e),a),[a,k]),z=(0,n.useCallback)(t=>{(0,t3.markSwitch)("server",t),e.push(K(t))},[e,K]),B=(0,n.useCallback)(()=>(0,ej.resolveCommunityLandingHref)({serverId:null,last:(0,nn.getLastMeLeaf)(),breakpoint:a}),[a]),H=(0,n.useCallback)(()=>{e.push(B())},[B,e]),$=(0,n.useCallback)(async(t,n)=>{if(!M(N.get().generation))return;let{assertAccount:a,assertUi:r}=O();try{a();let i=await D({name:t});r();let s=i.server.id;(0,eC.toast)(`Server "${t}" created`),n&&_({serverId:s,file:n},{onError:e=>(0,e$.toastApiError)(e,"Server created, but the icon failed to upload",r)}),e.push(`/c/channels/${s}`)}catch(e){(0,e$.toastApiError)(e,"Failed to create server",r)}},[O,D,e,_,N,M]),Q=(0,n.useCallback)(e=>{if(!M(N.get().generation))return;let{assertAccount:n,assertUi:a}=O();try{n()}catch{return}(0,eS.markVoluntaryLeave)(t,e),L({serverId:e},{onSuccess:()=>{try{n()}catch{return}try{a(),(0,eC.toast)("Left server")}catch{}let t=N.get().navigation;if(t&&(0,ek.communityServerId)(t.navigationPending?t.pendingHref??"":t.publishedHref)===e){let n=new Set([...k.collections.serverMemberships.values()].filter(e=>e.viewer&&e.userId===k.accountId).map(e=>e.serverId)),a=[...k.collections.servers.values()].filter(e=>n.has(e.id)).sort((e,t)=>(e.position??0)-(t.position??0));t.replace((0,eS.pickPostEjectDestination)(a,e))}},onError:e=>(0,e$.toastApiError)(e,"Failed to leave server",a)})},[O,k,L,t,M,N]),V=(0,n.useCallback)(t=>{if(!t)return;let n=na({targetServerId:t,activeServerId:d,overlay:"settings",hasActiveOpener:!!h,publishedHref:e.publishedHref});"open-active"===n.kind?h?.():e.push(n.href)},[d,e,h]),W=(0,n.useCallback)(t=>{if(!t)return;let n=na({targetServerId:t,activeServerId:d,overlay:"invite",hasActiveOpener:!!p,publishedHref:e.publishedHref});"open-active"===n.kind?p?.():e.push(n.href)},[d,e,p]),Y=(0,n.useCallback)((t,n)=>{((0,t3.markSwitch)(n?"channel":"server",n??t),n)?e.push(`/c/channels/${t}/${n}`):e.push(K(t))},[e,K]);return{railProps:{servers:U,homeHref:F,serverHrefs:q,folders:P,activeServerId:m,serversLoading:j.isPending&&0===A.length,view:u,onHome:H,onServerNavigate:z,onCreateServer:$,onLeaveServer:E?Q:void 0,onOpenSettings:E?V:void 0,onOpenInvitePopover:E?W:void 0},navigate:Y}}({navigation:_,queryClient:x,breakpoint:k,view:d,activeServerId:m,projectedView:en,projectedActiveServerId:ea,onOpenActiveServerSettings:v,onOpenActiveServerInvite:y,accountId:w.id}),ei=function({router:e,queryClient:t,cancelPendingNavigation:d,view:m,activeServerId:h}){let p,f,g,v,y,b,x,w,C,k=(0,u.useCommunityRuntime)(),I=(0,J.useCommunityViewSource)(JSON.stringify(["shell-profile",m,h])),A=(0,a.usePathname)(),E=(0,a.useSearchParams)(),M=(0,td.readBillingReturn)(E.get("billing")),O="billing"===E.get("settings")||!!M,D=()=>{if(Q(!1),O){let e=new URLSearchParams(E.toString());e.delete("settings"),e.delete("billing"),window.history.replaceState(null,"",`${A}${e.size?`?${e}`:""}${window.location.hash}`)}},L=(0,q.useCurrentUser)(),{friends:_}=(0,nu.useFriends)(),U="server"===m?h??null:null,{members:F}=(0,nd.useServerMembers)(U),K=(0,nm.useCreateOrGetDm)(),{accept:z}=(0,np.useDmMessageSender)(),B=(0,nh.useUpdateProfile)(),H=(0,nh.useUploadUserAvatar)(),[$,Q]=(0,o.useAtom)((0,l.useCreateAtom)(!1)),[V,W]=(0,o.useAtom)((0,l.useCreateAtom)(null)),[G,X]=(0,o.useAtom)((0,l.useCreateAtom)(null)),[Z,ee]=(0,o.useAtom)((0,l.useCreateAtom)(null)),et=(0,l.useCreateAtom)(null),[en,ea]=(0,o.useAtom)(et),er=(0,n.useCallback)(e=>{e.release(),ea(t=>t===e?null:t)},[ea]);(0,n.useLayoutEffect)(()=>{if(!en)return;let e=()=>er(en);return en.assertActive.signal.aborted?e():en.assertActive.signal.addEventListener("abort",e,{once:!0}),()=>{en.assertActive.signal.removeEventListener("abort",e),en.release()}},[er,en]);let ei=V?.data.userId,es=(0,R.useCanonicalCommunityProfile)(ei);(0,i.useQuery)({queryKey:c.communityKeys.profile(ei??"__none__"),enabled:!!ei&&ei!==L.id,queryFn:(0,no.userProfileQueryFn)(ei??""),staleTime:no.PROFILE_STALE_TIME_MS});let eo=(0,n.useMemo)(()=>V?{...V,data:{...V.data,contextLabel:nc(U,F.find(e=>e.userId===ei)),mutual:es?.mutualServers??0,identity:es?.kind==="bot"&&es.ownerUserId&&es.ownerHandle?{kind:"bot",ownerProfile:{id:es.ownerUserId,handle:es.ownerHandle},ownedByViewer:es.ownedByViewer??!1}:es?.kind==="human"||ei===L.id?{kind:"human"}:void 0}}:null,[V,U,F,ei,es,L.id]),el=(0,n.useCallback)((e,t,n,a,r)=>{if(r&&r===L.id){let e=U?F.find(e=>e.userId===L.id):void 0;W({data:{userId:L.id,contextLabel:nc(U,e),mutual:0,identity:{kind:"human"}},x:t,y:n});return}let i=function(e,t,n){let{name:a,discriminator:r,userId:i}=n;return(i?(e??[]).find(e=>e.userId===i)??(t??[]).find(e=>e.userId===i):void 0)??(r?(e??[]).find(e=>e.name===a&&e.discriminator===r)??(t??[]).find(e=>e.name===a&&e.discriminator===r):void 0)??(e??[]).find(e=>e.name===a)??(t??[]).find(e=>e.name===a)}(F,_,{name:e,discriminator:a,userId:r}),s=i?.userId??r;W({data:{...s?{userId:s}:{name:e,discriminator:a},contextLabel:nc(U,i),mutual:0},x:t,y:n})},[L.id,_,F,U,W]),ec=(0,n.useCallback)((e,t,n,a)=>{el(e,t.clientX,t.clientY,n,a)},[el]),eu=(0,n.useCallback)(e=>{if(!eo)return;let t=(0,ns.parseNameAndTag)(e.handle);t&&el(t.name,eo.x,eo.y,t.discriminator,e.id)},[el,eo]),ed=(0,n.useCallback)(t=>{d(),e.push(`/c/me/bots?audit=${encodeURIComponent(t)}`),W(null)},[d,e,W]),em=(0,n.useCallback)(e=>X(e),[X]),eh=(0,n.useCallback)(e=>ee(e),[ee]),ep=async(e,t)=>{let n=I.capture();try{await B.mutateAsync({statusEmoji:e,statusText:t,assertActive:n}),n()}catch(e){(0,e$.toastApiError)(e,"Failed to update status",n)}},ef=async(t,n)=>{let a,r=I.capture();if(r(),!t)return void(0,eC.toast)("Could not find user");d();let i=e.captureIntent?.()??(()=>!0),s=()=>{if(r(),!i())throw new DOMException("Retired profile navigation","AbortError")};try{let e=await K.mutateAsync({userId:t,assertActive:r});s(),a=e.conversation.id}catch(e){(0,e$.toastApiError)(e,"Failed to open DM",s);return}let o=n.trim();if(o){let e=z({assertActive:r,dmId:a,content:o,author:{id:L.id,name:L.name,avatar:L.avatar}});if(!e.accepted)return void(0,eC.toast)("Failed to send message");e.committed}e.push(`/c/me/${a}`)},eg=async e=>{let t=I.capture();try{await B.mutateAsync({...e,assertActive:t}),t()}catch(e){(0,e$.toastApiError)(e,"Failed to save profile",t)}},ev=(p=(0,s.useQueryClient)(),f=(0,r.getCommunityDbRegistry)(p),g=(0,n.useCallback)(()=>{if(!f)throw new DOMException("Missing sign-out account","AbortError");if((0,r.getCommunityDbRegistry)(p)!==f)throw new DOMException("Retired sign-out account","AbortError");let e=(0,T.captureCommunityLiveSnapshotToken)(p);return(0,T.assertCommunityLiveSnapshotTokenCurrent)(p,e,void 0),{registry:f,token:e,authenticationGeneration:f.authenticationView.get().generation}},[p,f]),v=(0,Y.useMutation)({meta:{observabilityAction:"account.sign_out"},mutationKey:["community","sign-out"],scope:{id:"account-sign-out"},gcTime:0,mutationFn:async({registry:e,token:t})=>{let n=()=>(0,T.assertCommunityLiveSnapshotTokenCurrent)(p,t,void 0);n();let a=e.authenticationView.get().generation,r=new AbortController,i=e.runtime.lifecycle.subscribe(()=>{try{n()}catch{r.abort()}});try{let t=await (0,P.signOutWithOrigin)(n,{fetchOptions:{signal:r.signal,onRequest:n,onSuccess:n}});if(t?.error)throw n(),Error(t.error.message||"Failed to log out");(0,N.retireCommunityAccount)(e),await e.retireDisk().catch(e=>{console.error("Account disk cache retirement failed",e)});let i=e.sessionViewer();return e.authenticationView.get().active&&e.authenticationView.get().generation===a&&(null==i||i===e.accountId)}catch(e){throw n(),e}finally{i.unsubscribe()}}}),y=(0,n.useCallback)(e=>{if(!e)return;let t=e=>{let t=e.registry.authenticationView.get(),n=e.registry.sessionViewer();return(0,r.getCommunityDbRegistry)(p)===e.registry&&t.active&&t.generation===e.authenticationGeneration&&(null==n||n===e.registry.accountId)},n=e=>{try{return(0,T.assertCommunityLiveSnapshotTokenCurrent)(p,e.token,void 0),!0}catch{return!1}};return{onSuccess:(n,a,r,i)=>{n&&t(a)&&e.onSuccess?.(n,void 0,r,i)},onError:(t,a,r,i)=>{n(a)&&e.onError?.(t,void 0,r,i)},onSettled:(a,r,i,s,o)=>{(r?n(i):a&&t(i))&&e.onSettled?.(a,r,void 0,s,o)}}},[p]),b=v.mutate,x=v.mutateAsync,w=(0,n.useCallback)((e,t)=>b(g(),y(t)),[b,g,y]),C=(0,n.useCallback)((e,t)=>x(g(),y(t)),[x,g,y]),{...v,mutate:w,mutateAsync:C}),ey=async()=>{let e=(0,T.captureCommunityLiveSnapshotToken)(t);try{await ev.mutateAsync()&&globalThis.location.replace("/sign-in")}catch(n){(0,e$.toastApiError)(n,"Failed to log out",()=>(0,T.assertCommunityLiveSnapshotTokenCurrent)(t,e,void 0))}},eb=async()=>{d(),k.ui.actions.reset(),k.ws.actions.reset(),k.messageStream.actions.resetAll(),(0,j.disposeReadCoordinator)(t),(0,S.disposeAccountReadStateReconciliation)(t),t.clear(),Q(!1)},ex={onClose:D,initialTab:O?"billing":"profile",billingReturn:M,userId:L.id,userName:L.name,userEmail:L.email,aboutMe:L.aboutMe??"",avatar:L.avatar,statusEmoji:L.statusEmoji,statusText:L.statusText,onUploadAvatar:()=>{let e=I.capture(),t=document.createElement("input");t.type="file",t.accept="image/png,image/jpeg,image/webp",t.onchange=()=>{try{e()}catch{return}let n=t.files?.[0];if(!n)return;let a=(0,nl.validateIconSourceFile)(n);if(!a.ok)return void(0,eC.toast)(a.error);let r=URL.createObjectURL(n),i=!1;et.get()?.release(),ea({src:r,fileName:n.name,assertActive:e,release:()=>{i||(i=!0,URL.revokeObjectURL(r))}})},t.click()},onSave:eg,onLogout:ey,onAccountDeleted:eb},ew=null;return en&&(ew={imageSrc:en.src,originalFileName:en.fileName,onCropped:e=>{let t=en.assertActive;if(et.get()!==en)return void en.release();try{t()}catch{er(en);return}H.mutate({file:e,assertActive:t},{onSuccess:()=>{try{t()}catch{return}(0,eC.toast)("Avatar updated")},onError:e=>(0,e$.toastApiError)(e,"Failed to upload avatar",t)}),er(en)},onCancel:()=>{er(en)}}),{currentUser:L,openProfile:ec,openOwnerProfile:eu,openBotAudit:ed,previewImage:em,previewAttachment:eh,profile:eo,closeProfile:()=>W(null),profileMessage:ef,updateOwnStatus:ep,preview:G,closePreview:()=>X(null),attachmentPreview:Z,onAttachmentPreviewOpenChange:e=>{e||ee(null)},editingProfile:$||O,openUserSettings:()=>Q(!0),onUserSettingsOpenChange:e=>{e||D()},userSettingsProps:ex,pendingAvatarCrop:ew}}({router:_,queryClient:x,cancelPendingNavigation:_.cancelPendingNavigation,view:d,activeServerId:m}),es=function({router:e,queryClient:t,cancelPendingNavigation:a,publishedHref:r,navigationPending:i,pendingHref:s,viewerId:c,accessEpoch:u}){let d=(0,n.useCallback)(t=>{e.pushImmediate?e.pushImmediate(t):e.push(t)},[e]),m=(0,nf.useInboxAttention)(),h=m.servers,p=m.dms,f=m.mentions,g=m.isLoading,[v,y]=(0,o.useAtom)((0,l.useCreateAtom)(!1)),[b,x]=(0,o.useAtom)((0,l.useCreateAtom)("unreads")),w=(0,n.useRef)({unreads:0,mentions:0,marked:0}),C=(0,nf.useInboxMarked)(v),{mutate:k}=(0,nS.useUnmarkMessage)(),S=(0,nC.useMarkAllInboxRead)(),j=(0,nC.useDeleteMention)(),I=(0,nk.useAcceptFriendRequest)(),P=(0,nk.useRejectFriendRequest)(),E=function({queryClient:e,publishedHref:t,navigationPending:a,pendingHref:r}){let i,s=(0,l.useCreateAtom)(!1),[c,u]=(0,o.useAtom)(s),d=((i=nb.get(e))||(i={value:(0,nv.createStore)({lease:null,nextEpoch:0})},nb.set(e,i)),i),m=(0,A.useSelector)(d.value,e=>e.lease),h=m?.target??null,p=(0,l.useCreateAtom)(t),f=(0,n.useCallback)(e=>{d.value.get().lease?.epoch!==e.epoch||(nx(d,{...e,phase:"committed"}),(0,ny.activateInboxProjectionTicket)(e.ticket))},[d]),g=(0,n.useCallback)((e,t=!1)=>{let n=d.value.get().lease;return!!n&&n.epoch===e&&((0,ny.cancelInboxProjectionTicket)(n.ticket),nx(d,null),t&&u(n.previousOpen),!0)},[d,u]),v=(0,n.useCallback)((n,a)=>{let r=d.value.get().lease;r&&(0,ny.cancelInboxProjectionTicket)(r.ticket);let i=(d.value.setState(e=>({...e,nextEpoch:e.nextEpoch+1})),d.value.get().nextEpoch),o=s.get(),l=(0,ny.registerInboxProjectionTicket)(e,i,n,e=>{let t=d.value.get().lease;t&&t.epoch===e.epoch&&nx(d,null)});return nx(d,{epoch:i,target:n,destinationHref:a,originHref:t,previousOpen:o,phase:"submitting",submitted:!1,navigationObserved:!1,ticket:l}),u(!1),i},[d,s,e,t,u]),y=(0,n.useCallback)(e=>{let n=d.value.get().lease;if(!n||n.epoch!==e)return!1;let a={...n,submitted:!0};return nx(d,a),nw(t,n.destinationHref)&&f(a),!0},[f,t,d]),b=(0,n.useCallback)(()=>{let e=d.value.get().lease;e&&(0,ny.cancelInboxProjectionTicket)(e.ticket),nx(d,null);let t=s.get();return u(!1),t},[d,s,u]),x=(0,n.useCallback)(e=>{u(e)},[u]),w=(0,n.useCallback)(e=>!!e&&!!h&&h.identity===e.identity&&h.fingerprint===e.fingerprint,[h]),C=(0,n.useCallback)(e=>d.value.get().lease?.epoch===e,[d]);return(0,n.useEffect)(()=>{let e=d.value.get().lease;if(e&&e.submitted&&"submitting"===e.phase){if(nw(t,e.destinationHref))return void f(e);if(a&&nw(r,e.destinationHref)){e.navigationObserved||nx(d,{...e,navigationObserved:!0});return}(e.navigationObserved||t!==e.originHref||a&&null!==r)&&g(e.epoch)}},[f,a,r,m,t,g,d]),(0,n.useEffect)(()=>{let e=p.get();p.set(t),!nw(e,t)&&s.get()&&u(!1)},[t,p,s,u]),{open:c,projectionTarget:h,onOpenChange:x,beginProjection:v,markProjectionSubmitted:y,rollbackProjection:g,closeWithoutProjection:b,isProjected:w,isLatestProjection:C}}({queryClient:t,publishedHref:r,navigationPending:i,pendingHref:s}),N=(0,n.useCallback)(e=>{x(e),"marked"===e&&y(!0)},[x,y]),R=(0,n.useCallback)(e=>w.current[e],[]),M=(0,n.useCallback)((e,t)=>{w.current[e]=t},[]),O=(0,n.useCallback)(e=>I.mutateAsync({friendshipId:e}),[I]),D=(0,n.useCallback)(e=>P.mutateAsync({friendshipId:e}),[P]),L=(0,nj.useFriendRequestActionState)({rows:m.friendRequests,onAccept:O,onReject:D,surface:"inbox"}),_=(0,n.useCallback)((e,n,r,i,s)=>{let o=E.beginProjection(e,n);a(),(0,nI.clearThreadOpenerReadHandoff)(t);let l=nT(t,{...r,href:n,viewerId:c},u),m=n;try{m=i?.()??n,d(m),E.markProjectionSubmitted(o)&&s?.()}catch(n){(0,nR.cancelConversationNavigationProof)(t,l);let e=new URLSearchParams(m.split("?")[1]??"").get("inboxThreadOpener");throw e&&(0,ny.terminateThreadOpenerReservationHandoff)(t,e),E.isLatestProjection(o)&&(a(),E.rollbackProjection(o,!0)),n}},[u,a,E,d,t,c]),U=(0,n.useCallback)((e,n,r)=>{let i=(0,ek.channelHref)(e.serverId,n.channelId),s=r?(0,ny.inboxChannelRowTarget)(e,n):null;if(!s){let r=E.closeWithoutProjection();a(),(0,nI.clearThreadOpenerReadHandoff)(t);let s=nT(t,{href:i,viewerId:c,channelId:n.channelId,serverId:e.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===n.type?"forum":"channel"},u);try{d(i)}catch(e){throw(0,nR.cancelConversationNavigationProof)(t,s),a(),E.onOpenChange(r),e}return}_(s,i,{channelId:n.channelId,serverId:e.serverId,scopeKind:"channel",expectedSurfaceKind:"forum"===n.type?"forum":"channel"})},[u,a,E,d,_,t,c]),F=(0,n.useCallback)((e,n,a)=>{let r=(0,ny.inboxThreadRowTarget)(e,n,a),i=(0,ek.channelHref)(e.serverId,a.channelId);_(r,i,{channelId:a.channelId,serverId:e.serverId,scopeKind:"channel",expectedSurfaceKind:"thread"},()=>a.openerMessageId&&!0===a.openerUnread&&void 0!==a.openerSeq?(0,nI.armThreadOpenerReadHandoff)(t,{serverId:e.serverId,parentChannelId:a.parentChannelId??n.channelId,childChannelId:a.channelId,openerMessageId:a.openerMessageId,openerSeq:a.openerSeq}):i)},[_,t]),q=(0,n.useCallback)(e=>{let n=E.closeWithoutProjection();a(),(0,nI.clearThreadOpenerReadHandoff)(t);let r=null!=e.m.seq?`?seq=${e.m.seq}`:"",i=e.serverId?`${(0,ek.channelHref)(e.serverId,e.channelId)}${r}`:`/c/me/${e.channelId}${r}`,s=nT(t,{href:i,viewerId:c,channelId:e.channelId,...e.serverId?{serverId:e.serverId}:{},scopeKind:e.serverId?"channel":"dm",...e.serverId?{anchorMessageId:e.m.id}:{},...!e.serverId?{expectedSurfaceKind:"dm"}:{}},u);try{d(i)}catch(e){throw(0,nR.cancelConversationNavigationProof)(t,s),a(),E.onOpenChange(n),e}},[u,a,E,d,t,c]),K=(0,n.useCallback)(e=>{let n=e.channelId;_((0,ny.inboxDmRowTarget)(e),`/c/me/${n}`,{channelId:n,scopeKind:"dm",expectedSurfaceKind:"dm"},()=>{let n={id:e.channelId,userId:e.otherUserId,name:e.otherUserName,discriminator:e.otherUserDiscriminator,avatar:e.otherUserAvatar,avatarVersion:e.otherUserAvatarVersion,status:"offline",preview:"",activityAt:e.lastMessageAt,unread:!1};(0,T.publishCommunityDmSummary)(t,n)},()=>{(0,ng.startChannelRouteVerification)(t,null,n).catch(()=>void 0)})},[_,t]),z=(0,n.useCallback)(e=>{let t=(0,ny.inboxMentionRowTarget)(e);t&&e.serverId&&e.channelId&&_(t,`${(0,ek.channelHref)(e.serverId,e.channelId)}?msg=${e.m.id}`,{channelId:e.channelId,serverId:e.serverId,scopeKind:"channel",anchorMessageId:e.m.id})},[_]),B=(0,n.useCallback)(()=>{let e=E.closeWithoutProjection();a();try{d("/c/me/friends?tab=new")}catch(t){throw a(),E.onOpenChange(e),t}},[a,E,d]),H={friendRequests:L.items,unreads:h,unreadDms:p,mentions:f,marked:C.marked,markedLoading:C.isLoading,loading:g,attentionError:m.isInitialError,onRetryAttention:()=>{m.refetch()},hasProjectedUnreads:m.hasUnread,hasProjectedMentions:m.hasMention,onOpenChannel:U,onOpenThread:F,onOpenDm:K,onOpenMention:z,onOpenMarked:q,onOpenFriendRequests:B,onAcceptFriendRequest:e=>{L.act(e,"accept")},onRejectFriendRequest:e=>{L.act(e,"reject")},onRetryFriendRequest:e=>{L.retry(e)},activeTab:b,onActiveTabChange:N,onMarkedTabSelected:()=>y(!0),getScrollOffset:R,onScrollOffsetChange:M,onMarkAllRead:()=>{S.mutate()},onDeleteMention:e=>j.mutate({mentionId:e}),onUnmark:e=>k({messageId:e})},$=m.exactAttentionCount;return{popoverProps:H,unreadCount:$,unreadCountPartial:!1,hasUnread:$>0,open:E.open,onOpenChange:E.onOpenChange}}({router:_,queryClient:x,cancelPendingNavigation:_.cancelPendingNavigation,publishedHref:_.publishedHref,navigationPending:_.navigationPending,pendingHref:_.pendingHref,viewerId:w.id,accessEpoch:C}),[eo,el]=(0,o.useAtom)((0,l.useCreateAtom)(tJ)),ec=(0,n.useCallback)(e=>{el(t=>(function(e,t){switch(t.type){case"update.sync":{if(e.update)return t4(e,t.eligibleMachineIds);if(0===t.eligibleMachineIds.length)return e;let n=t.collapsed||"none"!==e.active;return{active:n?e.active:"update",update:{phase:n?"collapsedBadge":"expanded",targetMachineIds:tZ(t.eligibleMachineIds),acceptedMachineIds:[],failedMachineIds:[],pendingMachineIds:[]}}}case"update.eligibility":return t4(e,t.eligibleMachineIds);case"update.clear":return{active:"update"===e.active?"none":e.active,update:null};case"update.open":if(!e.update)return e;return{active:"update",update:{...e.update,phase:"collapsedBadge"===e.update.phase?"expanded":e.update.phase}};case"update.collapse":if(!e.update)return"update"===e.active?{...e,active:"none"}:e;return{active:"update"===e.active?"none":e.active,update:{...e.update,phase:"expanded"===e.update.phase?"collapsedBadge":e.update.phase}};case"update.dispatch":{if(!e.update)return e;let n=new Set(t.machineIds);return{active:"update",update:{...e.update,phase:"updating",failedMachineIds:t0(e.update.failedMachineIds,n),pendingMachineIds:tZ([...e.update.pendingMachineIds,...t.machineIds])}}}case"update.settle":{if(!e.update)return e;let n=new Set(e.update.targetMachineIds),a=t.acceptedMachineIds.filter(e=>n.has(e)),r=t.failedMachineIds.filter(e=>n.has(e)),i=new Set(a),s=new Set(r),o=new Set([...i,...s]),l=tZ([...t0(e.update.acceptedMachineIds,s),...a]),c=tZ([...t0(e.update.failedMachineIds,i),...r]);return{active:e.active,update:{...e.update,phase:c.length>0?"retry":"updating",acceptedMachineIds:l,failedMachineIds:c,pendingMachineIds:t0(e.update.pendingMachineIds,o)}}}case"extension.open":return{active:t.extension,update:e.update?.phase==="expanded"?{...e.update,phase:"collapsedBadge"}:e.update};case"extension.close":if(t.extension&&e.active!==t.extension)return e;return{active:"none",update:e.update?.phase==="expanded"?{...e.update,phase:"collapsedBadge"}:e.update}}})(t,e))},[el]),eu=function({userId:e,extensionState:t,dispatch:a,latestDaemonVersion:r="0.1.46",requestUpdate:i=nq}){let s=(0,X.useCommunityMutationOrigin)(),o=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>()=>{o.current=null},[s.registry,e,r]);let l=(0,nK.useMachines)(),c=(0,n.useMemo)(()=>{var e;return r?(e=l.machines,(0,nL.parseReleaseVersion)(r)?e.filter(e=>{let t=e.daemonVersion;return!!(0,nU.isPresenceOnline)(e.status)&&!!t&&!!(0,nL.parseReleaseVersion)(t)&&(0,nL.releaseVersionGte)(t,n_.SELF_UPDATE_MIN_DAEMON_VERSION)&&!(0,nL.releaseVersionGte)(t,r)}):[]):[]},[r,l.machines]),u=(0,n.useMemo)(()=>c.map(e=>e.id),[c]);(0,n.useLayoutEffect)(()=>{let e=new Set(u);for(let t of o.current?.machineIds??[])e.has(t)||o.current?.machineIds.delete(t)},[u]);let d=(0,n.useMemo)(()=>({registry:s.registry,userId:e,latestDaemonVersion:r}),[s.registry,e,r]),m=(0,n.useRef)(d);(0,n.useEffect)(()=>{m.current!==d&&(m.current=d,a({type:"update.clear"}))},[a,d]);let h=t.update;(0,n.useEffect)(()=>{if(r&&(0,nL.parseReleaseVersion)(r)&&l.isSuccess){if(0===u.length){nB(e,r,!1),a({type:"update.clear"});return}if(!h)return void a({type:"update.sync",collapsed:function(e,t){try{return"1"===window.localStorage.getItem(nz(e,t))}catch{return!1}}(e,r),eligibleMachineIds:u});a({type:"update.eligibility",eligibleMachineIds:u})}},[a,u,r,l.isSuccess,h,e]);let p=(0,n.useCallback)(()=>{r&&t.update&&(nB(e,r,!0),a({type:"update.collapse"}))},[a,t.update,r,e]),f=(0,n.useCallback)(()=>{r&&t.update&&(nB(e,r,!1),a({type:"update.open"}))},[a,t.update,r,e]),g=(0,n.useCallback)(async()=>{let e=t.update;if(!e||e.pendingMachineIds.length>0)return;let n=function(e,t){let n=new Set(t);if("retry"===e.phase)return e.failedMachineIds.filter(e=>n.has(e));let a=new Set(e.acceptedMachineIds),r=new Set(e.pendingMachineIds);return e.targetMachineIds.filter(e=>n.has(e)&&!a.has(e)&&!r.has(e))}(e,u);if(0===n.length)return;let r=s.begin().token,l=s.registry.authenticationView.get();s.assertOwner(r);let c={machineIds:new Set(n)};o.current=c,a({type:"update.dispatch",machineIds:n});let d=await nH(n,i);try{s.assertOwner(r)}catch{return}let m=s.registry.authenticationView.get();if(!m.active||m.generation!==l.generation||o.current!==c)return;let h=c.machineIds;for(let e of(d.acceptedMachineIds=d.acceptedMachineIds.filter(e=>h.has(e)),d.failedMachineIds=d.failedMachineIds.filter(e=>h.has(e)),d.failedMachineIds))nF.log.warn("daemon update request failed",{machineId:e});a({type:"update.settle",...d})},[a,u,t.update,i,s]);return{eligibleMachines:c,eligibleMachineIds:u,update:h,collapse:p,open:f,request:g}}({userId:w.id,extensionState:eo,dispatch:ec}),ed=(0,n.useCallback)(e=>{if(!e){es.onOpenChange(!1),ec({type:"extension.close",extension:"inbox"});return}"profile"===eo.active&&ei.closeProfile(),"update"===eo.active&&eu.collapse(),es.onOpenChange(!0),ec({type:"extension.open",extension:"inbox"})},[eu,ec,es,ei,eo.active]),em=(0,n.useCallback)((e,t,n,a)=>{if("profile"===eo.active){ei.closeProfile(),ec({type:"extension.close",extension:"profile"});return}"inbox"===eo.active&&es.onOpenChange(!1),"update"===eo.active&&eu.collapse(),ei.openProfile(e,t,n,a),ec({type:"extension.open",extension:"profile"})},[eu,ec,es,ei,eo.active]),eh=(0,n.useCallback)(()=>{"inbox"===eo.active&&es.onOpenChange(!1),"profile"===eo.active&&ei.closeProfile(),eu.open()},[eu,es,ei,eo.active]),ep=(0,n.useCallback)(()=>{"inbox"===eo.active&&es.onOpenChange(!1),"profile"===eo.active&&ei.closeProfile(),"update"===eo.active&&eu.collapse(),ec({type:"extension.close",extension:eo.active})},[eu,ec,es,ei,eo.active]);(0,n.useEffect)(()=>{"mobile"===k&&"detail"===et.surface&&"none"!==eo.active&&ep()},[k,et.surface,ep,eo.active]);let ef=(0,n.useCallback)(()=>("mobile"!==k||"detail"!==et.surface)&&"none"!==eo.active&&(ep(),!0),[k,et.surface,ep,eo.active]),eg=(0,n.useCallback)(()=>{F.parentPath&&_.replace(F.parentPath)},[_,F.parentPath]);return!function({dismissShellOverlay:e,parentPath:t,replacePath:a}){(0,n.useEffect)(()=>{let n=n=>{!n.cancelable||(0!==document.querySelectorAll('[data-slot="dialog-content"],[data-slot="alert-dialog-content"],[data-slot="sheet-content"]').length&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",code:"Escape",bubbles:!0,cancelable:!0})),1)||e()?n.preventDefault():t&&(n.preventDefault(),a(t)))};return window.addEventListener(nQ,n),()=>window.removeEventListener(nQ,n)},[e,t,a])}({dismissShellOverlay:ef,parentPath:F.parentPath,replacePath:U}),(0,n.useEffect)(()=>{"inbox"!==eo.active||es.open||ec({type:"extension.close",extension:"inbox"})},[ec,es.open,eo.active]),(0,n.useEffect)(()=>{"profile"!==eo.active||ei.profile?.data.userId!==w.id&&ec({type:"extension.close",extension:"profile"})},[w.id,ec,ei.profile,eo.active]),(0,n.useEffect)(()=>{"mobile"===k&&I?.status==="active"&&"server"===I.stage&&"detail"===F.surface&&F.parentPath&&U(F.parentPath)},[k,I,U,F.parentPath,F.surface]),(0,n.useEffect)(()=>{(0,u.getCommunityRuntime)(x).ui.actions.registerUiHandlers({previewImage:ei.previewImage,previewAttachment:ei.previewAttachment,openProfile:ei.openProfile,goBackMobile:eg,navigatePath:_.push,replacePath:_.replace,navigate:er.navigate,cancelPendingNavigation:_.cancelPendingNavigation})},[eg,ei.openProfile,ei.previewAttachment,ei.previewImage,er.navigate,_.cancelPendingNavigation,_.push,_.replace,x]),(0,t.jsx)(eO.CommunityRouteContext,{value:{frame:O,navigation:_,ownerDeleteRouteScope:b},children:(0,t.jsx)(t6,{breakpoint:k,checkpoint:et,sidebar:p,extraDialogs:g,rail:er,profile:ei,inbox:es,userBarExtension:eo,daemonUpdate:eu,onUserBarInboxOpenChange:ed,onUserBarOpenProfile:em,onUserBarOpenUpdate:eh,dismissUserBarExtension:ep,children:f})})}function nW({sidebar:e,children:r}){let i=(0,a.useSelectedLayoutSegments)(),o=i.length?`/c/${i.join("/")}`:"/c",l=(0,ek.communityServerId)(o),c=(0,s.useQueryClient)(),d=(0,q.useCurrentUser)(),m=(0,n.useMemo)(()=>l?{serverId:l,token:(0,eS.createOwnerServerDeleteRouteToken)(c)}:void 0,[c,l]),h=(0,n.useCallback)(()=>e,[e]);return(0,n.useLayoutEffect)(()=>{(0,u.getCommunityRuntime)(c).ui.actions.setCurrentServerId(l)},[c,l]),(0,t.jsx)(nV,{view:l?"server":"dm",activeServerId:l??void 0,frameHref:o,sidebar:h,ownerDeleteRouteScope:m,children:r},d.id)}var nY=e.i(205189);function nG({redirectTo:e}={}){let t=(0,a.useRouter)(),r=(0,eM.useBreakpoint)(),i=(0,R.useOptionalCommunityDbRegistry)();return(0,n.useEffect)(()=>{if("unknown"===r)return;let n=document.cookie.match(/(?:^|; )is_new_signup=([^;]*)/);if(!n)return;let a=decodeURIComponent(n[1]);if((0,nY.trackSignUp)(a),document.cookie="is_new_signup=; max-age=0; path=/","mobile"!==r&&e){if(e.startsWith("/c/")){if(!i?.runtime.lifecycle.get().active)return;(0,ee.startCommunityOnboarding)(i.runtime),t.replace(e);return}window.location.replace(e)}},[r,e,t,i]),null}var nX=e.i(181402),nJ=e.i(824863),nZ=e.i(88723),n0=e.i(395207);let n1={isDesktopTauri:()=>(0,nJ.isTauri)()&&(0,nJ.isDesktop)(),invoke:nJ.tauriInvoke,postCancel:e=>fetch("/api/auth/native/cancel",{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)})};async function n2(e=n1){if(!e.isDesktopTauri())return;let t=n0.nativeOauthSnapshotSchema.nullable().parse(await e.invoke("native_oauth_snapshot"));if(!t)return;let n=nZ.nativeOauthProofSchema.nullable().parse(await e.invoke("native_oauth_cancel",{attemptId:t.attemptId}));n&&await e.postCancel(n).catch(()=>{})}function n4(){return(0,n.useEffect)(()=>{n2().catch(()=>{})},[]),null}var n5=e.i(455393);e.s(["CommunityLayoutClient",0,function({children:e,sidebar:r,currentUser:i}){let s=(0,a.useRouter)(),o=(0,a.usePathname)(),l="public-invite"===(0,ek.resolveCommunityModulePlan)(o).route;return((0,n.useEffect)(()=>{l||i||s.replace("/sign-in")},[i,l,s]),(0,n.useEffect)(()=>{i?(0,n5.retireCommunityColdEntryAttempt)(i.id,o):(0,n5.clearCommunityColdEntryAttempts)()},[i,o]),l)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(nG,{}),e]}):i?(0,t.jsxs)(nX.AuthenticatedContextMenuBoundary,{children:[(0,t.jsx)(n4,{}),(0,t.jsxs)(eE,{currentUser:i,children:[(0,t.jsx)(nG,{redirectTo:"/c/me/machines"}),(0,t.jsx)(nW,{sidebar:r,children:e})]})]}):(0,t.jsx)(eP.CommunitySessionPendingFrame,{pathname:o})}],200069)},401462,e=>{"use strict";var t=e.i(237649),n=e.i(290139),a=e.i(215932);e.s(["CommunitySessionFallback",0,function(){let e=(0,n.usePathname)();return(0,t.jsx)(a.CommunitySessionPendingFrame,{pathname:e})}])},974802,e=>{e.v({shell:"settings-shell-module__Gd188q__shell"})},109762,527668,e=>{"use strict";var t=e.i(237649),n=e.i(731517),a=e.i(974802),r=e.i(186339),i=e.i(255334),s=e.i(996718),o=e.i(381153);let l="col-start-1 row-start-2 flex min-w-0 items-center gap-1 px-2 thin-scrollbar sm:row-span-2 sm:row-start-1 sm:flex-col sm:items-stretch sm:gap-2 sm:overflow-y-auto sm:p-4",c="h-11 min-w-0 flex-1 flex-row justify-start gap-1 overflow-hidden p-0 group-data-horizontal/tabs:h-11 sm:h-auto sm:w-full sm:flex-none sm:flex-col",u="size-11 justify-center gap-2 px-0 sm:h-9 sm:w-full sm:justify-start sm:px-2",d="sr-only sm:not-sr-only sm:min-w-0 sm:truncate sm:px-2 sm:pt-1 sm:text-xs sm:font-medium sm:text-muted-foreground",m="flex shrink-0 gap-1 sm:mt-auto sm:w-full sm:flex-col sm:border-t sm:border-border/60 sm:pt-2";e.s(["SETTINGS_LOGOUT_CLASS",0,"size-11 shrink-0 justify-center text-destructive hover:text-destructive sm:h-9 sm:w-full sm:justify-start","SETTINGS_NAV_CLASS",0,l,"SETTINGS_NAV_FOOTER_CLASS",0,m,"SETTINGS_NAV_LABEL_CLASS",0,d,"SETTINGS_TABS_LIST_CLASS",0,c,"SETTINGS_TAB_CLASS",0,u],527668),e.s(["SettingsShell",0,function({value:e,onValueChange:h,label:p,title:f,tabs:g,onClose:v,navFooter:y,disabled:b=!1,children:x}){let w=(0,s.useBreakpoint)();return(0,t.jsxs)(i.Tabs,{orientation:"mobile"===w?"horizontal":"vertical",value:e,onValueChange:e=>h(e),className:`grid min-h-0 w-full flex-1 gap-0 ${a.default.shell}`,"data-testid":o.tid.settingsShell,children:[(0,t.jsxs)("header",{className:"col-start-1 row-start-1 flex h-16 min-w-0 items-center px-4 sm:col-start-2 sm:px-8",children:[(0,t.jsx)("h1",{className:"min-w-0 flex-1 truncate text-lg font-medium tracking-tight",children:f}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",className:"size-11 sm:size-8",onClick:v,disabled:b,"aria-label":"Close settings","data-testid":o.tid.settingsClose,children:(0,t.jsx)(n.X,{className:"size-4"})})]}),(0,t.jsxs)("nav",{className:l,style:{background:"var(--d-rail)"},"data-testid":o.tid.settingsNav,children:[(0,t.jsx)("div",{className:d,"data-testid":o.tid.settingsLabel,children:p}),(0,t.jsx)(i.TabsList,{variant:"line",className:c,children:g.map(({value:e,label:n,icon:a})=>(0,t.jsxs)(i.TabsTrigger,{value:e,disabled:b,className:u,"data-testid":o.tid.settingsTab(e),children:[(0,t.jsx)(a,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only whitespace-nowrap sm:not-sr-only",children:n})]},e))}),y?(0,t.jsx)("div",{className:m,children:y}):null]}),(0,t.jsx)("div",{className:"col-start-1 row-start-3 min-h-0 min-w-0 overflow-y-auto rounded-tl-xl bg-background px-4 pt-6 pb-4 thin-scrollbar sm:col-start-2 sm:row-start-2 sm:p-8 sm:pt-4","data-testid":o.tid.settingsContent,children:x})]})},"SettingsShellPanel",0,function(e){return(0,t.jsx)(i.TabsContent,{...e,keepMounted:!0})}],109762)},729979,e=>{"use strict";var t=e.i(382416);let n=(0,t.createContext)(null),a=(0,t.createContext)(null);e.s(["CommunityRouteContext",0,n,"CommunityServerRouteContext",0,a,"useCommunityRouteFrame",0,function(){let e=(0,t.useContext)(n);if(!e)throw Error("Missing community route frame");return e},"useCommunityServerRoute",0,function(){let e=(0,t.useContext)(a);if(!e)throw Error("Missing server content route");return e}])},215932,52622,e=>{"use strict";var t=e.i(237649),n=e.i(164237),a=e.i(250569),r=e.i(708884),i=e.i(996718),s=e.i(622435),o=e.i(381153),l=e.i(800989),c=e.i(382416),u=e.i(929554),d=e.i(384755),m=e.i(888917),h=e.i(613349),p=e.i(259728),f=e.i(190209);let g=()=>()=>{},v="(min-width: 640px)",y={getItem:e=>"u"<typeof localStorage?null:localStorage.getItem(e),setItem:(e,t)=>{"u">typeof localStorage&&localStorage.setItem(e,t)}},b=1+1/64;function x(e){let t=document.documentElement;"number"==typeof e&&(t.style.setProperty(p.COMMUNITY_LAYOUT_PREPAINT_SIDEBAR_WIDTH,`${e}px`),t.style.setProperty(p.COMMUNITY_LAYOUT_PREPAINT_USER_BAR_WIDTH,`${(0,p.desktopUserBarOverlayWidth)(e)}px`)),t.setAttribute(p.COMMUNITY_LAYOUT_PREPAINT_ATTRIBUTE,"")}function w(){document.documentElement.removeAttribute(p.COMMUNITY_LAYOUT_PREPAINT_ATTRIBUTE)}function C({breakpoint:e,surface:n,rail:a,sidebar:i,main:s,userBar:o,overlays:l,busy:k,label:S,routeKind:j,testId:I,preserveHiddenMobileModules:A=!1}){let{defaultLayout:P,onLayoutChanged:E}=(0,d.useDefaultLayout)({id:"community-shell",onlySaveAfterUserInteractions:!0,storage:y}),N=(0,c.useSyncExternalStore)(g,()=>!0,()=>!1),R=N?P?.sidebar:void 0,T=(0,c.useRef)(null),M=(0,c.useRef)(null),O=(0,c.useRef)(null),D=(0,c.useRef)(null),L=(0,c.useRef)(null),_=(0,c.useRef)(e),U=(0,c.useRef)(e),F=(0,c.useRef)(void 0),q=(0,c.useRef)(null),K=(0,c.useRef)(!1);(0,c.useInsertionEffect)(()=>{if(U.current=e,"mobile"===e&&null!==q.current){let{animationFrame:e}=q.current;null!==e&&cancelAnimationFrame(e),q.current=null,w()}"mobile"===_.current&&"desktop"===e&&null===q.current&&(q.current={target:(0,p.desktopSidebarRestoreTarget)(F.current,R),animationFrame:null},x(q.current.target))},[e,R]);let z=(0,c.useCallback)(e=>{L.current?.style.setProperty("--community-desktop-user-bar-width",`${(0,p.desktopUserBarOverlayWidth)(e)}px`)},[]),B=(0,c.useCallback)(e=>{if("desktop"!==U.current||null!==q.current)return;let t=T.current?.getBoundingClientRect().width,n=t&&t>0?t:e.inPixels;F.current=n,z(n)},[z]),H=(0,c.useCallback)(()=>{let e=O.current;e&&(e.resize(p.COMMUNITY_SIDEBAR_DEFAULT_WIDTH),queueMicrotask(()=>{let e=M.current?.getLayout();e&&0!==Object.keys(e).length&&E(e,{isUserInteraction:!0})}))},[E]);(0,c.useLayoutEffect)(()=>{let e=e=>{let t=D.current;if(!t)return;let n=t.getBoundingClientRect();e.clientX>=n.left-10&&e.clientX<=n.right+10&&e.clientY>=n.top&&e.clientY<=n.bottom&&H()};return document.addEventListener("dblclick",e,!0),()=>document.removeEventListener("dblclick",e,!0)},[H]),(0,c.useLayoutEffect)(()=>{if(void 0===P||K.current)return;let t=M.current;if(!t)return;let n=document.documentElement.hasAttribute(p.COMMUNITY_LAYOUT_PREPAINT_ATTRIBUTE)&&window.matchMedia(v).matches?T.current?.getBoundingClientRect().width:void 0,a="desktop"===e?T.current?.closest('[data-slot="resizable-panel-group"]')?.getBoundingClientRect().width:void 0,r=a&&a>p.COMMUNITY_SEPARATOR_WIDTH?Math.min(p.COMMUNITY_SIDEBAR_MAX_WIDTH,Math.max(p.COMMUNITY_SIDEBAR_MIN_WIDTH,P.sidebar/100*(a-p.COMMUNITY_SEPARATOR_WIDTH))):n;K.current=!0,t.setLayout(P),r&&r>0?(O.current?.resize(r),F.current=r,z(r)):L.current?.style.setProperty("--community-desktop-user-bar-width",(0,p.desktopUserBarInitialOverlayCssWidth)(P.sidebar))},[e,P,z]),(0,c.useLayoutEffect)(()=>{!k&&void 0!==P&&K.current&&null===q.current&&window.matchMedia(v).matches&&requestAnimationFrame(()=>{w()})},[e,k,P]),(0,c.useLayoutEffect)(()=>{_.current=e;let t=q.current;if("desktop"!==e||null===t)return;let n=O.current;if(!n)return;let a=!1,r=()=>{if(a||q.current!==t||"desktop"!==U.current)return;let e=T.current?.closest('[data-slot="resizable-panel-group"]')?.getBoundingClientRect().width,i=e&&e>p.COMMUNITY_SEPARATOR_WIDTH?e-p.COMMUNITY_SEPARATOR_WIDTH:void 0,s="string"==typeof t.target?Number.parseFloat(t.target):i?t.target/i*100:void 0;(0,u.flushSync)(()=>{if(w(),void 0!==s){let e=M.current,t=Object.keys(e?.getLayout()??{});for(let n of 2===t.length?[t,t.toReversed()]:[["main","sidebar"],["sidebar","main"]]){let t=Object.fromEntries(n.map(e=>[e,"sidebar"===e?s:100-s])),a=e?.setLayout(t);if(a?.sidebar!==void 0&&.01>=Math.abs(a.sidebar-s))break}}else n.resize(t.target)});let o=n.getSize(),l="number"==typeof t.target?t.target:i&&void 0!==s?Math.min(p.COMMUNITY_SIDEBAR_MAX_WIDTH,Math.max(p.COMMUNITY_SIDEBAR_MIN_WIDTH,s/100*i)):void 0,c=M.current?.getLayout()?.sidebar??o.asPercentage;if(!(void 0===s?void 0!==l&&Math.abs(o.inPixels-l)<=b:.01>=Math.abs(c-s))){x(t.target),t.animationFrame=requestAnimationFrame(r);return}let d=T.current?.getBoundingClientRect().width,m=d&&d>0?d:o.inPixels;if(void 0!==l&&Math.abs(m-l)>b){x(t.target),t.animationFrame=requestAnimationFrame(r);return}F.current=m,z(m),q.current=null};return queueMicrotask(r),()=>{a=!0,null!==t.animationFrame&&cancelAnimationFrame(t.animationFrame),q.current===t&&(q.current=null,w())}},[e,P,z]);let $="desktop"===e,Q="mobile"===e&&"list"===n,V="mobile"===e&&"detail"===n,W="unknown"===e,Y=W&&"detail"===n,G=Q||W&&"list"===n,X=V||Y,J=V||Y,Z=Q||W&&"list"===n,ee=$||Q||W||A,et={"--community-desktop-user-bar-width":(0,p.desktopUserBarInitialOverlayCssWidth)(R),marginLeft:-p.COMMUNITY_RAIL_WIDTH};return(0,t.jsxs)(f.Shell,{"aria-busy":k?"true":void 0,"aria-label":S,"data-community-route-kind":j,"data-testid":I,"data-slot":"community-shell-root",children:[(!V||A)&&(0,t.jsx)("div",{inert:V,"aria-hidden":V||void 0,className:(0,h.cn)("flex min-h-0",Y&&"hidden sm:contents",V&&A&&"hidden"),children:a}),(0,t.jsxs)("div",{className:(0,h.cn)("relative flex min-h-0 min-w-0 flex-1 flex-col",!V&&!Y&&"pt-2",Y&&"pt-0 sm:pt-2"),children:[(0,t.jsx)(r.AppSurface,{"data-slot":"community-app-surface",className:(0,h.cn)("rounded-tl-xl rounded-tr-none rounded-br-none rounded-bl-none ring-0 border-l border-t border-border/40 shadow-none",V&&"rounded-none border-0 bg-background shadow-none ring-0",Y&&"max-sm:rounded-none max-sm:border-0 max-sm:bg-background max-sm:shadow-none max-sm:ring-0"),children:(0,t.jsxs)(m.ResizablePanelGroup,{id:"community-shell",groupRef:M,orientation:"horizontal",disabled:!$,className:(0,h.cn)("min-h-0 flex-1",!$&&["max-sm:*:data-[mobile-active=true]:flex-1!","max-sm:*:data-[mobile-hidden=true]:flex-none!","max-sm:*:data-[mobile-hidden=true]:w-0!","max-sm:*:data-[mobile-hidden=true]:min-w-0!","max-sm:*:data-[mobile-hidden=true]:max-w-0!","max-sm:*:data-[mobile-hidden=true]:overflow-hidden!"]),defaultLayout:N?P:void 0,onLayoutChanged:E,children:[(0,t.jsx)(m.ResizablePanel,{id:"sidebar",panelRef:O,defaultSize:p.COMMUNITY_SIDEBAR_DEFAULT_WIDTH,minSize:p.COMMUNITY_SIDEBAR_MIN_WIDTH,maxSize:p.COMMUNITY_SIDEBAR_MAX_WIDTH,groupResizeBehavior:"preserve-pixel-size",onResize:B,disabled:!$,"data-mobile-active":G||void 0,"data-mobile-hidden":X||void 0,className:(0,h.cn)("flex flex-col bg-sidebar",($||Q||W)&&"pb-[calc(3.75rem+var(--app-safe-area-bottom))] sm:pb-15"),children:(0,t.jsx)("div",{ref:T,"data-slot":"community-sidebar-panel-content","data-community-mobile-surface":Q?"list":void 0,hidden:V,inert:V,"aria-hidden":V||void 0,className:(0,h.cn)("flex min-h-0 min-w-0 flex-1 flex-col",Y&&"max-sm:hidden"),children:i})}),(0,t.jsx)(m.ResizableHandle,{disabled:!$,className:(0,h.cn)("bg-transparent",!$&&"max-sm:w-0! max-sm:min-w-0! max-sm:max-w-0! max-sm:overflow-hidden"),disableDoubleClick:!0,elementRef:D}),(0,t.jsx)(m.ResizablePanel,{id:"main",groupResizeBehavior:"preserve-relative-size",disabled:!$,"data-mobile-active":J||void 0,"data-mobile-hidden":Z||void 0,className:"flex min-w-0 flex-col bg-background",children:(0,t.jsx)("div",{"data-slot":"community-main-panel-content","data-community-mobile-surface":V?"detail":void 0,hidden:Q,inert:Q,"aria-hidden":Q||void 0,className:(0,h.cn)("flex min-h-0 flex-1 flex-col",W&&"list"===n&&"max-sm:hidden"),children:s})})]})}),ee&&(0,t.jsxs)("div",{ref:L,"data-slot":"community-user-bar-overlay",inert:V,"aria-hidden":V||void 0,className:(0,h.cn)("absolute bottom-0 left-0 z-10",$&&"w-(--community-desktop-user-bar-width)",W&&"w-[calc(100%+3.5rem)] sm:w-(--community-desktop-user-bar-width)",Y&&"max-sm:hidden",V&&A&&"hidden"),style:Q?{width:`calc(100% + ${p.COMMUNITY_RAIL_WIDTH}px)`,marginLeft:-p.COMMUNITY_RAIL_WIDTH}:et,children:[(0,t.jsx)("div",{"data-slot":"community-user-bar-underlay","aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 -z-10 bg-linear-to-t from-(--app-bg) to-transparent",style:{height:p.COMMUNITY_USER_BAR_HEIGHT_CSS}}),o]})]}),l]})}e.s(["CommunityShellLayout",0,C],52622);var k=e.i(274762),S=e.i(804);e.s(["CommunitySessionPendingFrame",0,function({pathname:e}){let c=(0,i.useBreakpoint)(),u=(0,s.resolveCommunityModulePlan)(e);return"community"!==u.rail?(0,t.jsx)(f.Shell,{"data-testid":o.tid.initialFrame,"data-community-route-kind":u.route,"aria-busy":"true","aria-label":"Loading community",children:(0,t.jsx)("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:(0,t.jsx)(r.AppSurface,{className:"rounded-none border-0 bg-background",children:"none"!==u.main.kind&&(0,t.jsx)(l.CommunityPendingFrame,{href:e,plan:u})})})}):(0,t.jsx)(C,{breakpoint:c,surface:"list"===u.surface?"list":"detail",rail:(0,t.jsx)(k.ServerRailPending,{bottomInset:60}),sidebar:"server"===u.sidebar.kind?(0,t.jsx)(n.ChannelSidebarSkeleton,{targetServerId:u.sidebar.serverId}):(0,t.jsx)(a.DmSidebarSkeleton,{}),main:(0,t.jsx)(l.CommunityPendingFrame,{href:e,plan:u,reserveBackSlot:"detail"===u.surface}),userBar:(0,t.jsx)(S.UserBarSkeleton,{}),testId:o.tid.initialFrame,routeKind:u.route,busy:!0,label:"Loading community",preserveHiddenMobileModules:!0})}],215932)},875061,e=>{"use strict";var t=e.i(782844),n=e.i(11897),a=e.i(294237),r=e.i(613349);let i=(0,a.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-1 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",render:s,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(i({variant:a}),e)},o),render:s,state:{slot:"badge",variant:a}},(0,n.useRenderElement)(l.defaultTagName??"div",l,l)},"badgeVariants",0,i],875061)},410763,e=>{"use strict";var t=e.i(237649),n=e.i(382416),a=e.i(294237),r=e.i(613349),i=e.i(473131),s=e.i(434433);let o=(0,a.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...a}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,r.cn)(o({orientation:n}),e),...a})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,r.cn)("group/field-content flex flex-1 flex-col gap-1 leading-snug",e),...n})},"FieldDescription",0,function({className:e,...n}){return(0,t.jsx)("p",{"data-slot":"field-description",className:(0,r.cn)("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-2","last:mt-0 nth-last-2:-mt-1","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...n})},"FieldError",0,function({className:e,children:a,errors:i,...s}){let o=(0,n.useMemo)(()=>{if(a)return a;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,t.jsx)("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:e.map((e,n)=>e?.message&&(0,t.jsx)("li",{children:e.message},n))})},[a,i]);return o?(0,t.jsx)("div",{role:"alert","data-slot":"field-error",className:(0,r.cn)("text-sm font-normal text-destructive",e),...s,children:o}):null},"FieldGroup",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-group",className:(0,r.cn)("group/field-group @container/field-group flex w-full flex-col gap-4 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(i.Label,{"data-slot":"field-label",className:(0,r.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})},"FieldSeparator",0,function({children:e,className:n,...a}){return(0,t.jsxs)("div",{"data-slot":"field-separator","data-content":!!e,className:(0,r.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",n),...a,children:[(0,t.jsx)(s.Separator,{className:"absolute inset-0 top-1/2"}),e&&(0,t.jsx)("span",{className:"relative mx-auto block w-fit bg-background px-2 text-muted-foreground","data-slot":"field-separator-content",children:e})]})},"FieldSet",0,function({className:e,...n}){return(0,t.jsx)("fieldset",{"data-slot":"field-set",className:(0,r.cn)("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",e),...n})},"FieldTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-label",className:(0,r.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",e),...n})}])},182149,e=>{"use strict";var t=e.i(237649),n=e.i(382416),a=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function u(e){let t=e.getBoundingClientRect().right,n=e;for(;n;){if("visible"!==getComputedStyle(n).overflowX)return n.getBoundingClientRect().left+n.clientLeft+n.clientWidth-t;n=n.parentElement}return document.documentElement.clientWidth-t}var d=n.createContext({}),m=n.forwardRef((e,t)=>{let a;var m,f,g,v,y,{value:b,onChange:x,maxLength:w,textAlign:C="left",pattern:k,placeholder:S,inputMode:j="numeric",onComplete:I,pushPasswordManagerStrategy:A="increase-width",pasteTransformer:P,containerClassName:E,noScriptCSSFallback:N=p,nonce:R,render:T,children:M}=e,O=((e,t)=>{var n={};for(var a in e)o.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&s)for(var a of s(e))0>t.indexOf(a)&&l.call(e,a)&&(n[a]=e[a]);return n})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","nonce","render","children"]);let[D,L]=n.useState("string"==typeof O.defaultValue?O.defaultValue:""),_=null!=b?b:D,U=(a=n.useRef(),n.useEffect(()=>{a.current=_}),a.current),F=n.useCallback(e=>{null==x||x(e),L(e)},[x]),q=n.useMemo(()=>k?"string"==typeof k?new RegExp(k):k:null,[k]),K=n.useRef(null),z=n.useRef(null),B=n.useRef({value:_,onChange:F,isIOS:"u">typeof window&&(null==(f=null==(m=null==window?void 0:window.CSS)?void 0:m.supports)?void 0:f.call(m,"-webkit-touch-callout","none"))}),H=n.useRef({prev:[null==(g=K.current)?void 0:g.selectionStart,null==(v=K.current)?void 0:v.selectionEnd,null==(y=K.current)?void 0:y.selectionDirection]});n.useImperativeHandle(t,()=>K.current,[]),n.useEffect(()=>{let e=K.current,t=z.current;if(!e||!t)return;function n(){if(document.activeElement!==e){G(null),J(null);return}let t=e.selectionStart,n=e.selectionEnd,a=e.selectionDirection,r=e.maxLength,i=e.value,s=H.current.prev,o=-1,l=-1,c;if(0!==i.length&&null!==t&&null!==n){let a=t===n,u=t===i.length&&i.length<r;if(a&&!u){if(0===t)o=0,l=1,c="forward";else if(t===r)o=t-1,l=t,c="backward";else if(r>1&&i.length>1){let e=0;if(null!==s[0]&&null!==s[1]){c=t<s[1]?"backward":"forward";let n=s[0]===s[1]&&s[0]<r;"backward"!==c||n||(e=-1)}o=e+t,l=e+t+1}}-1!==o&&-1!==l&&o!==l&&e.setSelectionRange(o,l,c)}let u=-1!==o?o:t,d=-1!==l?l:n,m=null!=c?c:a;G(u),J(d),H.current.prev=[u,d,m]}if(B.current.value!==e.value&&B.current.onChange(e.value),H.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{capture:!0}),n(),document.activeElement===e&&W(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",R&&e.setAttribute("nonce",R),document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";h(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),h(e.sheet,`[data-input-otp]:autofill { ${t} }`),h(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),h(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),h(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let a=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};a();let r="u"<typeof ResizeObserver?null:new ResizeObserver(a);return null==r||r.observe(e),()=>{document.removeEventListener("selectionchange",n,{capture:!0}),null==r||r.disconnect()}},[]);let[$,Q]=n.useState(!1),[V,W]=n.useState(!1),[Y,G]=n.useState(null),[X,J]=n.useState(null);n.useEffect(()=>{var e;let t=[setTimeout(e=()=>{var e,t,n,a;null==(e=K.current)||e.dispatchEvent(new Event("input"));let r=null==(t=K.current)?void 0:t.selectionStart,i=null==(n=K.current)?void 0:n.selectionEnd,s=null==(a=K.current)?void 0:a.selectionDirection;null!==r&&null!==i&&(G(r),J(i),H.current.prev=[r,i,s])},0),setTimeout(e,10),setTimeout(e,50)];return()=>{t.forEach(e=>clearTimeout(e))}},[_,V]),n.useEffect(()=>{void 0!==U&&_!==U&&U.length<w&&_.length===w&&(null==I||I(_))},[w,I,U,_]);let Z=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:a,isFocused:r}){let[i,s]=n.useState(!1),[o,l]=n.useState(!1),[c,d]=n.useState(!1),m=n.useMemo(()=>"none"!==a&&("increase-width"===a||"experimental-no-flickering"===a)&&i&&o,[i,o,a]),h=n.useCallback(()=>{let n=e.current,r=t.current;if(!n||!r||c||"none"===a)return;let i=n.getBoundingClientRect().left+n.offsetWidth,o=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,o)===n||(l(u(n)>=40),s(!0),d(!0))},[e,t,c,a]);return n.useEffect(()=>{let t=e.current;if(!t||"none"===a)return;function n(){l(u(t)>=40)}n();let r=setInterval(n,1e3);return()=>{clearInterval(r)}},[e,a]),n.useEffect(()=>{let e=r||document.activeElement===t.current;if("none"===a||!e)return;let n=setTimeout(h,0),i=setTimeout(h,2e3),s=setTimeout(h,5e3),o=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(n),clearTimeout(i),clearTimeout(s),clearTimeout(o)}},[t,r,a,h]),{hasPWMBadge:i,willPushPWMBadge:m,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:z,inputRef:K,pushPasswordManagerStrategy:A,isFocused:V}),ee=n.useCallback(e=>{let t=e.currentTarget.value.slice(0,w);t.length>0&&q&&!q.test(t)?e.preventDefault():("string"==typeof U&&t.length<U.length&&document.dispatchEvent(new Event("selectionchange")),F(t))},[w,F,U,q]),et=n.useCallback(()=>{var e;if(K.current){let t=Math.min(K.current.value.length,w-1),n=K.current.value.length;null==(e=K.current)||e.setSelectionRange(t,n),G(t),J(n)}W(!0)},[w]),en=n.useCallback(e=>{var t,n;let a=K.current;if(!P&&(!B.current.isIOS||!e.clipboardData||!a))return;let r=e.clipboardData.getData("text/plain"),i=P?P(r):r;e.preventDefault();let s=null==(t=K.current)?void 0:t.selectionStart,o=null==(n=K.current)?void 0:n.selectionEnd,l=(s!==o?_.slice(0,s)+i+_.slice(o):_.slice(0,s)+i+_.slice(s)).slice(0,w);if(l.length>0&&q&&!q.test(l))return;a.value=l,F(l);let c=Math.min(l.length,w-1),u=l.length;a.setSelectionRange(c,u),G(c),J(u)},[w,F,P,q,_]),ea=n.useMemo(()=>({position:"relative",cursor:O.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[O.disabled]),er=n.useMemo(()=>({position:"absolute",inset:0,width:Z.willPushPWMBadge?`calc(100% + ${Z.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:Z.willPushPWMBadge?`inset(0 ${Z.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:C,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height, 16px)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[Z.PWM_BADGE_SPACE_WIDTH,Z.willPushPWMBadge,C]),ei=n.useMemo(()=>{var e;return n.createElement("input",r(((e,t)=>{for(var n in t||(t={}))o.call(t,n)&&c(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&c(e,n,t[n]);return e})({autoComplete:O.autoComplete||"one-time-code"},O),i({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===_.length||void 0,"data-input-otp-mss":Y,"data-input-otp-mse":X,inputMode:j,pattern:null==q?void 0:q.source,"aria-placeholder":S,style:er,maxLength:w,value:_,ref:K,spellCheck:null!=(e=O.spellCheck)&&e,onPaste:e=>{var t;en(e),null==(t=O.onPaste)||t.call(O,e)},onChange:ee,onMouseOver:e=>{var t;Q(!0),null==(t=O.onMouseOver)||t.call(O,e)},onMouseLeave:e=>{var t;Q(!1),null==(t=O.onMouseLeave)||t.call(O,e)},onFocus:e=>{var t;et(),null==(t=O.onFocus)||t.call(O,e)},onBlur:e=>{var t;W(!1),null==(t=O.onBlur)||t.call(O,e)}})))},[ee,et,en,j,er,w,X,Y,S,O,null==q?void 0:q.source,_]),es=n.useMemo(()=>({slots:Array.from({length:w}).map((e,t)=>{var n;let a=V&&null!==Y&&null!==X&&(Y===X&&t===Y||t>=Y&&t<X),r=void 0!==_[t]?_[t]:null;return{char:r,placeholderChar:void 0!==_[0]?null:null!=(n=null==S?void 0:S[t])?n:null,isActive:a,hasFakeCaret:a&&null===r}}),isFocused:V,isHovering:!O.disabled&&$}),[V,$,w,X,Y,S,O.disabled,_]),eo=n.useMemo(()=>T?T(es):n.createElement(d.Provider,{value:es},M),[M,es,T]);return n.createElement(n.Fragment,null,null!==N&&n.createElement("noscript",null,n.createElement("style",null,N)),n.createElement("div",{ref:z,"data-input-otp-container":!0,translate:"no",style:ea,className:E},eo,n.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ei)))});function h(e,t){try{e.insertRule(t)}catch(e){console.warn("input-otp could not insert CSS rule:",t)}}m.displayName="Input";var p=`
2
- [data-input-otp] {
3
- --nojs-bg: white !important;
4
- --nojs-fg: black !important;
5
-
6
- background-color: var(--nojs-bg) !important;
7
- color: var(--nojs-fg) !important;
8
- caret-color: var(--nojs-fg) !important;
9
- letter-spacing: .25em !important;
10
- text-align: center !important;
11
- border: 1px solid var(--nojs-fg) !important;
12
- border-radius: 4px !important;
13
- width: 100% !important;
14
- }
15
- @media (prefers-color-scheme: dark) {
16
- [data-input-otp] {
17
- --nojs-bg: black !important;
18
- --nojs-fg: white !important;
19
- }
20
- }`,f=e.i(613349),g=e.i(1087);let v={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};v.node,(0,g.default)(v),e.s(["InputOTP",0,function({className:e,containerClassName:n,...a}){return(0,t.jsx)(m,{"data-slot":"input-otp",containerClassName:(0,f.cn)("cn-input-otp flex items-center has-disabled:opacity-50",n),spellCheck:!1,className:(0,f.cn)("disabled:cursor-not-allowed",e),...a})},"InputOTPGroup",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"input-otp-group",className:(0,f.cn)("flex items-center rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40",e),...n})},"InputOTPSlot",0,function({index:e,className:a,...r}){let i=n.useContext(d),{char:s,hasFakeCaret:o,isActive:l}=i?.slots[e]??{};return(0,t.jsxs)("div",{"data-slot":"input-otp-slot","data-active":l,className:(0,f.cn)("relative flex size-8 items-center justify-center border-y border-r border-input text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40",a),...r,children:[s,o&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})}],182149)},791978,e=>{"use strict";var t=e.i(561668),n=e.i(140851),a=e.i(382416),r=e.i(362790),i=e.i(557922),s=e.i(159514);e.i(954194);var o=e.i(735217),l=e.i(193497),c=e.i(328076),u=e.i(152961),d=e.i(549712),m=e.i(636557),h=e.i(849050),p=e.i(374402),f=e.i(205189);let g=new Set(["bif","clp","djf","gnf","jpy","kmf","krw","mga","pyg","rwf","vnd","vuv","xaf","xof","xpf"]),v=new Set(Intl.supportedValuesOf("currency"));e.s(["readBillingReturn",0,function(e){return"checkout"===e||"cancel"===e||"portal"===e?e:null},"useBilling",0,function(e=null,y=!1,b){let x=(0,s.useQueryClient)(),w=(0,l.useCommunityMutationOrigin)(),C=w.registry,k=(0,a.useMemo)(()=>b?(0,d.applicationKey)(b,"billing"):p.communityKeys.billing(),[b]),S=(0,a.useCallback)(()=>{if(b){let e=(0,d.captureApplicationOwner)(b);return{assert:()=>(0,d.assertApplicationOwner)(e),request:(t,n)=>(0,h.apiFetch)(t,{...n,authenticationAccount:b.userId,assertActive:()=>{(0,d.assertApplicationOwner)(e,n?.signal??void 0),n?.assertActive?.()},onUnauthorized:()=>(0,d.invalidateApplicationAuthentication)(e,n?.signal??void 0)})}}let e=w.begin().token;return{assert:()=>w.assert(e),request:(t,n)=>w.request(e,t,n)}},[b,w]),j=(0,c.useCreateStore)({active:y,generation:0,lock:null,redirecting:!1,actionError:null,polling:!1,observedPlan:null,handledReturn:null,returnStartedAt:0,returnComplete:!1}),I=(0,u.useSelector)(j,e=>e);(0,a.useLayoutEffect)(()=>(j.setState(e=>({...e,active:y,...!e.active&&y?{lock:null,redirecting:!1}:{}})),()=>j.setState(e=>({...e,active:!1,generation:e.generation+1}))),[j,y]);let A=(0,a.useCallback)(()=>{let e=S(),t=j.get().generation;return{...e,assertView:()=>{e.assert();let n=j.get();if(!n.active||n.generation!==t)throw new DOMException("Retired billing view","AbortError")}}},[S,j]),P=(0,i.useQuery)({queryKey:k,enabled:y,subscribed:y,queryFn:async({signal:e})=>{let t=S(),n=o.BillingSummarySchema.parse(await t.request("/api/community/billing",{signal:e}));return t.assert(),n},staleTime:3e4,refetchOnWindowFocus:!0,refetchInterval:!!I.polling&&2e3,retry:!1});(0,t.useObservedQueryRegion)("billing",P,void 0,y);let E=(0,a.useCallback)(()=>{C&&(x.invalidateQueries({queryKey:p.communityKeys.bots()}),x.invalidateQueries({queryKey:p.communityKeys.machines()}))},[x,C]);(0,a.useEffect)(()=>{let e=e=>{e.persisted&&(j.setState(e=>({...e,lock:null,redirecting:!1})),y&&(S().assert(),x.invalidateQueries({queryKey:k,exact:!0}),E()))};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[S,y,E,k,x,j]),(0,a.useEffect)(()=>{let t=j.get();if(!e||!y)return void j.setState(t=>({...t,polling:!1,handledReturn:e?t.handledReturn:null}));if(t.handledReturn===e){!t.returnComplete&&"cancel"!==e&&Date.now()-t.returnStartedAt<3e4&&j.setState(e=>({...e,polling:!0}));return}S().assert(),(0,n.emitTelemetry)("business.result",{action_name:"billing_return",phase:"auth",outcome:"cancel"===e?"cancelled":"observed",capability:"limited"}),j.setState(t=>({...t,handledReturn:e,returnComplete:!1,returnStartedAt:Date.now(),polling:"cancel"!==e})),x.invalidateQueries({queryKey:k,exact:!0}),E()},[y,e,x,j,S,k,E]),(0,a.useEffect)(()=>{if(!y||!I.polling)return;let e=A(),t=setTimeout(()=>{try{e.assertView()}catch{return}j.setState(e=>({...e,returnComplete:!0,polling:!1}))},Math.max(0,3e4-(Date.now()-I.returnStartedAt)));return()=>clearTimeout(t)},[A,y,I.polling,I.returnStartedAt,j]),(0,a.useEffect)(()=>{if(!y||!P.data)return;S().assert();let t=`${P.data.plan.id}:${P.data.isFounder}`,a=C?x.getQueryData(p.communityKeys.bots()):void 0,r=j.get().observedPlan??(a?`${a.plan.id}:${a.isFounder}`:null);null!==r&&r!==t&&E();let i="checkout"===e&&!P.data.isFounder&&P.dataUpdatedAt>=j.get().returnStartedAt&&P.data.subscription?.status==="active"&&P.data.subscription.plan.id===P.data.plan.id;i&&!j.get().returnComplete&&(0,n.emitTelemetry)("business.result",{action_name:"billing_return",outcome:"success",phase:"primary"}),j.setState(e=>({...e,observedPlan:t,...i?{returnComplete:!0,polling:!1}:{}}))},[y,e,P.data,P.dataUpdatedAt,x,j,S,C,E]);let N=(0,r.useMutation)({meta:{observabilityAction:"billing.redirect"},mutationKey:[...k,"redirect"],retry:!1,mutationFn:async({action:e,original:t})=>{t.assertView();let n=o.BillingRedirectResponseSchema.parse(await t.request(`/api/community/billing/${e.kind}`,{method:"POST",assertActive:t.assertView,...e.priceId?{body:JSON.stringify({priceId:e.priceId,..."checkout"===e.kind&&e.founderAcknowledged?{founderAcknowledged:!0}:{}})}:{}}));t.assertView();let a=new URL(n.url);if("https:"!==a.protocol)throw Error("INVALID_BILLING_URL");return a.href}}),R=async e=>{if(j.get().lock||!P.data||P.data.isFounder&&("checkout"!==e.kind||!e.founderAcknowledged))return;let t=A(),n=Symbol("billing-action");t.assertView();let a="checkout"===e.kind?P.data.offers.find(t=>t.priceId===e.priceId):void 0;j.setState(e=>({...e,lock:n,actionError:null}));try{let i=await N.mutateAsync({action:e,original:t});if(t.assertView(),j.get().lock!==n)return;let s=a?(0,f.toAnalyticsPlanId)(a.plan.id):null;if(a&&s&&"free"!==s&&"checkout"===e.kind){var r;let t,n=(r=a.unitAmount,t=a.currency.toUpperCase(),Number.isSafeInteger(r)&&!(r<0)&&v.has(t)?r/(g.has(t.toLowerCase())?1:100):null);null!==n&&(0,f.trackBeginCheckout)({plan_id:s,currency:a.currency,value:n,entry_point:e.entryPoint})}j.setState(e=>({...e,redirecting:!0})),window.location.assign(i)}catch(a){try{t.assertView()}catch{return}if((0,m.isAbortError)(a)||j.get().lock!==n)return;j.setState(t=>({...t,lock:null,redirecting:!1,actionError:"checkout"===e.kind?"Couldn't open checkout. Try again to resume your purchase.":"Couldn't open billing management. Try again."})),P.refetch({cancelRefetch:!1})}},T=(0,r.useMutation)({meta:{observabilityAction:"billing.change.cancel"},mutationKey:[...k,"cancel-change"],retry:!1,mutationFn:async e=>{e.assertView(),await x.cancelQueries({queryKey:k,exact:!0}),e.assertView();let t=x.getQueryCache().find({queryKey:k,exact:!0}),n=t?.state.data,a=o.BillingSummarySchema.parse(await e.request("/api/community/billing/cancel-change",{method:"POST",assertActive:e.assertView}));return e.assert(),t&&x.getQueryCache().find({queryKey:k,exact:!0})===t&&x.setQueryData(k,e=>e===n?a:e),e.assert(),await x.invalidateQueries({queryKey:k,exact:!0}),e.assert(),a}}),M=async()=>{if(j.get().lock||!P.data?.subscription?.scheduledChange||P.data.isFounder)return;let e=A(),t=Symbol("billing-cancel");e.assertView(),j.setState(e=>({...e,lock:t,actionError:null}));try{await T.mutateAsync(e),e.assertView()}catch(n){try{e.assertView()}catch{return}(0,m.isAbortError)(n)||j.get().lock!==t||(j.setState(e=>({...e,actionError:"Couldn't cancel the scheduled plan change. Refresh status and try again."})),P.refetch({cancelRefetch:!1}))}finally{try{e.assertView(),j.get().lock===t&&j.setState(e=>({...e,lock:null}))}catch{}}};return{...P,returnFrom:e,polling:I.polling,actionError:I.actionError,isBusy:N.isPending||I.redirecting||T.isPending,isCancelingChange:T.isPending,cancelChange:M,checkout:(e,t,n)=>R({kind:"checkout",priceId:e,founderAcknowledged:t,entryPoint:n}),portal:e=>R({kind:"portal",priceId:e}),refresh:()=>{A().assertView(),P.refetch({cancelRefetch:!1}),E()}}}],791978)},595072,e=>{"use strict";var t=e.i(382416),n=e.i(601688),a=e.i(159514),r=e.i(636557);let i=["community","friend-request"];e.s(["useFriendRequestActionState",0,function({rows:e,onAccept:s,onReject:o,surface:l}){let c=(0,a.useQueryClient)(),u=(0,n.useMutationState)({filters:{mutationKey:i},select:e=>({id:e.state.variables?.friendshipId,action:e.options.mutationKey?.[2],status:e.state.status,error:e.state.error,at:e.state.submittedAt,mutationId:e.mutationId})}),d=e.map(e=>{let t=u.filter(t=>t.id===e.id).sort((e,t)=>t.at-e.at||t.mutationId-e.mutationId)[0];if(!t||"success"===t.status||(0,r.isAbortError)(t.error))return{row:e};let n="pending"===t.status?"pending":"error"===t.status?"error":void 0;return{row:e,action:t.action,status:n,..."error"===n?{error:`Couldn’t ${t.action} this request. Try again.`}:{}}}),m=(0,t.useCallback)((e,t,n)=>{let a=c.getMutationCache().find({mutationKey:i,exact:!1,status:"pending",predicate:t=>t.state.variables?.friendshipId===e.row.id});if(a)return a.continue().then(()=>void 0,()=>void 0);if(n&&"error"!==e.status)return Promise.resolve();let r="accept"===t?s:o;return r?r(e.row.id).then(()=>void 0,()=>void 0):Promise.resolve()},[c,s,o]);return{items:d,act:(e,t)=>m(e,t,!1),retry:e=>e.action?m(e,e.action,!0):Promise.resolve()}}])},718877,e=>{"use strict";var t=e.i(902429),n=e.i(204779),a=e.i(362790),r=e.i(557922),i=e.i(159514),s=e.i(923750);e.i(954194);var o=e.i(908967),l=e.i(849050),c=e.i(374402),u=e.i(382416),d=e.i(193497),m=e.i(51201),h=e.i(279389),p=e.i(177519),f=e.i(86694),g=e.i(323512);let v=Object.freeze({}),y=Object.freeze({}),b=o.notifLevelDisplay,x=(0,o.notifLevelDisplay)("all"),w=async(e={})=>{let t=(0,g.captureCommunityLiveSnapshotToken)(e.client),a=t.registry;if(!a)throw new DOMException("Missing notification owner","AbortError");await a.ready,(0,g.assertCommunityLiveSnapshotTokenCurrent)(e.client,t,e.signal),await a.collections.notificationSettings.preload(),(0,g.assertCommunityLiveSnapshotTokenCurrent)(e.client,t,e.signal);let r=await (0,l.apiFetch)("/api/community/users/me/notifications",(0,n.communityRequestOptions)(e.client,t,e.signal)),i={},s={};for(let e of r){let t=b(e.level);e.channelId?s[e.channelId]=t:e.serverId&&(i[e.serverId]=t)}return e.client&&t&&(0,g.publishCommunityLiveSnapshot)(e.client,{snapshot:{kind:"notification-settings",data:{raw:r,server:i,channel:s}},proof:{kind:"structural",token:t,signal:e.signal}}),{ids:r.filter(e=>!!e.serverId!=!!e.channelId).map(e=>(0,h.notificationSettingKey)(e))}};function C(e,t){e.setNotificationPolicy({server:t?.server??{},channel:t?.channel??{}})}async function k(e){let t=(0,g.captureCommunityLiveSnapshotToken)(e);(0,g.assertCommunityLiveSnapshotTokenCurrent)(e,t,void 0);let n=c.communityKeys.notificationSettings();await e.cancelQueries({queryKey:n,exact:!0}),(0,g.assertCommunityLiveSnapshotTokenCurrent)(e,t,void 0);let a={queryKey:n,queryFn:w,staleTime:0},r=new s.QueryObserver(e,{...a,enabled:!1}).subscribe(()=>void 0);try{await e.query({...a,select:void 0})}finally{r()}(0,g.assertCommunityLiveSnapshotTokenCurrent)(e,t,void 0);let i={raw:[...t.registry.collections.notificationSettings.values()],server:{},channel:{}};for(let e of i.raw)e.channelId?i.channel[e.channelId]=b(e.level):e.serverId&&(i.server[e.serverId]=b(e.level));return C((0,p.getActiveAccountUnreadProjection)(e),i),i}e.s(["reconcileNotificationSettings",0,k,"resolveServerNotificationDisplayLevel",0,function(e){return e??x},"useBotNotificationSetting",0,function(e,t){return(0,r.useQuery)({queryKey:c.communityKeys.botNotificationSetting(e??"",t.kind,t.id),queryFn:({client:a,signal:r})=>(0,l.apiFetch)(`/api/community/bots/${e}/notifications/${t.kind}/${t.id}`,(0,n.communityRequestOptions)(a,(0,g.captureCommunityLiveSnapshotToken)(a),r)),enabled:!!e,subscribed:!!e})},"useNotificationSettings",0,function(){let e=(0,f.useNotificationSettingsProjection)(),t=(0,i.useQueryClient)(),n=(0,u.useMemo)(()=>(0,p.getActiveAccountUnreadProjection)(t),[t]),a=(0,r.useQuery)({queryKey:c.communityKeys.notificationSettings(),queryFn:w});return(0,u.useEffect)(()=>{e&&C(n,e)},[e,n]),{...a,data:e,server:e?.server??v,channel:e?.channel??y}},"useSetBotNotificationSetting",0,function(){let e=(0,i.useQueryClient)(),n=(0,d.useCommunityMutationOrigin)(),r=(0,m.useCommunityViewSource)("bot-notification-setting"),s=(0,a.useMutation)({meta:{observabilityAction:"bot.notification.update"},mutationKey:["community","bot-notification-setting-command"],scope:{id:"community-bot-notification-setting-commands"},gcTime:0,mutationFn:async({botId:t,scope:a,level:r,original:i,view:s,resources:o,assertActive:l})=>{let c=()=>{n.assert(i),s(),l?.()};c();let u=`/api/community/bots/${t}/notifications/${a.kind}/${a.id}`;for(let t of(await n.request(i,u,{method:null===r?"DELETE":"PUT",signal:l?.signal?AbortSignal.any([l.signal,s.signal]):s.signal,assertActive:c,...null===r?{}:{body:JSON.stringify({level:r})}}),c(),o))e.getQueryCache().find({queryKey:t.queryKey,exact:!0})===t&&e.invalidateQueries({queryKey:t.queryKey,exact:!0},{cancelRefetch:!1}).catch(()=>void 0)}}),o=(0,u.useCallback)(t=>{t.assertActive?.();let a=r.capture();return a(),{...t,view:a,original:n.begin().token,resources:e.getQueryCache().findAll({predicate:e=>[c.communityKeys.botNotificationSetting(t.botId,t.scope.kind,t.scope.id),c.communityKeys.inbox()].some(t=>t.length<=e.queryKey.length&&t.every((t,n)=>Object.is(t,e.queryKey[n])))||e.queryKey.includes("read-state-snapshot")})}},[n,r,e]),l=(0,u.useCallback)(e=>{n.assert(e.original),e.view(),e.assertActive?.()},[n]);return(0,t.useNativeMutationFacade)(s,o,l)}])},395207,e=>{"use strict";e.i(954194);var t=e.i(568294),n=e.i(88723),a=e.i(77829);let r=a.z.object({attemptId:a.z.string(),provider:n.nativeOauthProviderSchema,redirectPath:a.z.string().refine(t.isSafeRedirectPath),expiresAt:a.z.number(),waiting:a.z.boolean()}).strict();e.s(["nativeOauthSnapshotSchema",0,r])},561668,e=>{"use strict";var t=e.i(159514),n=e.i(693760),a=e.i(392965);e.s(["useObservedQueryRegion",0,function(e,r,i,s=!0){let o=(0,t.useQueryClient)(),l=r.data&&"object"==typeof r.data?(0,n.valueEvidence)(o,r.data):{source:"unknown",version:"query_"+String(r.dataUpdatedAt??0),freshness:"unknown",count:+(null!=r.data)};(0,a.useObservedRegion)(e,s&&!r.isPending&&void 0!==r.data,{...l,...void 0===i?{}:{count:i}})}])},115870,e=>{"use strict";var t=e.i(72227);e.s(["perfTraceEnabled",0,function(){return"1"===t.default.env.NEXT_PUBLIC_PERF_TRACE&&!1}])},876986,e=>{"use strict";var t=e.i(115870);e.s(["markSwitch",0,function(e,n){if(!(0,t.perfTraceEnabled)()||"u"<typeof performance)return;let a=`alook:switch:${e}:${n}`;performance.mark(a);let r={kind:e,id:n,ts:performance.now(),markName:a};(window.__ALOOK_PERF_MARKS__??(window.__ALOOK_PERF_MARKS__=[])).push(r)}])},577992,e=>{"use strict";e.s(["parseRetryAfterSeconds",0,function(e){let t=e.get("X-Retry-After")??e.get("Retry-After");if(!t)return null;let n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null}])}]);