super-time-tracker-ui 0.1.32 → 0.1.34

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 (328) hide show
  1. package/bin/stt-ui.js +4 -4
  2. package/dist/standalone/next-output/BUILD_ID +1 -1
  3. package/dist/standalone/next-output/app-path-routes-manifest.json +5 -0
  4. package/dist/standalone/next-output/build-manifest.json +5 -5
  5. package/dist/standalone/next-output/routes-manifest.json +30 -0
  6. package/dist/standalone/next-output/server/app/_global-error/page/build-manifest.json +2 -2
  7. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/dist/standalone/next-output/server/app/_not-found/page/build-manifest.json +2 -2
  15. package/dist/standalone/next-output/server/app/_not-found/page.js +1 -2
  16. package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
  17. package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/dist/standalone/next-output/server/app/api/command-palette/route/app-paths-manifest.json +3 -0
  19. package/dist/standalone/next-output/server/app/api/command-palette/route/build-manifest.json +9 -0
  20. package/dist/standalone/next-output/server/app/api/command-palette/route/server-reference-manifest.json +4 -0
  21. package/dist/standalone/next-output/server/app/api/command-palette/route.js +6 -0
  22. package/dist/standalone/next-output/server/app/api/command-palette/route.js.nft.json +1 -0
  23. package/dist/standalone/next-output/server/app/api/command-palette/route_client-reference-manifest.js +3 -0
  24. package/dist/standalone/next-output/server/app/api/entries/search/route/app-paths-manifest.json +3 -0
  25. package/dist/standalone/next-output/server/app/api/entries/search/route/build-manifest.json +9 -0
  26. package/dist/standalone/next-output/server/app/api/entries/search/route/server-reference-manifest.json +4 -0
  27. package/dist/standalone/next-output/server/app/api/entries/search/route.js +7 -0
  28. package/dist/standalone/next-output/server/app/api/entries/search/route.js.nft.json +1 -0
  29. package/dist/standalone/next-output/server/app/api/entries/search/route_client-reference-manifest.js +3 -0
  30. package/dist/standalone/next-output/server/app/api/entry/delete-bulk/route.js +1 -1
  31. package/dist/standalone/next-output/server/app/api/entry/delete-bulk/route.js.nft.json +1 -1
  32. package/dist/standalone/next-output/server/app/api/entry/merge/route/app-paths-manifest.json +3 -0
  33. package/dist/standalone/next-output/server/app/api/entry/merge/route/build-manifest.json +9 -0
  34. package/dist/standalone/next-output/server/app/api/entry/merge/route/server-reference-manifest.json +4 -0
  35. package/dist/standalone/next-output/server/app/api/entry/merge/route.js +7 -0
  36. package/dist/standalone/next-output/server/app/api/entry/merge/route.js.nft.json +1 -0
  37. package/dist/standalone/next-output/server/app/api/entry/merge/route_client-reference-manifest.js +3 -0
  38. package/dist/standalone/next-output/server/app/api/entry/move/route.js +1 -1
  39. package/dist/standalone/next-output/server/app/api/entry/move/route.js.nft.json +1 -1
  40. package/dist/standalone/next-output/server/app/api/entry/move-bulk/route.js +1 -1
  41. package/dist/standalone/next-output/server/app/api/entry/move-bulk/route.js.nft.json +1 -1
  42. package/dist/standalone/next-output/server/app/api/entry/route.js +2 -2
  43. package/dist/standalone/next-output/server/app/api/entry/route.js.nft.json +1 -1
  44. package/dist/standalone/next-output/server/app/api/entry/split/route/app-paths-manifest.json +3 -0
  45. package/dist/standalone/next-output/server/app/api/entry/split/route/build-manifest.json +9 -0
  46. package/dist/standalone/next-output/server/app/api/entry/split/route/server-reference-manifest.json +4 -0
  47. package/dist/standalone/next-output/server/app/api/entry/split/route.js +8 -0
  48. package/dist/standalone/next-output/server/app/api/entry/split/route.js.nft.json +1 -0
  49. package/dist/standalone/next-output/server/app/api/entry/split/route_client-reference-manifest.js +3 -0
  50. package/dist/standalone/next-output/server/app/api/focus-nudges/status/route.js +1 -1
  51. package/dist/standalone/next-output/server/app/api/focus-nudges/status/route.js.nft.json +1 -1
  52. package/dist/standalone/next-output/server/app/api/in/route.js +1 -1
  53. package/dist/standalone/next-output/server/app/api/in/route.js.nft.json +1 -1
  54. package/dist/standalone/next-output/server/app/api/note/route.js +1 -1
  55. package/dist/standalone/next-output/server/app/api/note/route.js.nft.json +1 -1
  56. package/dist/standalone/next-output/server/app/api/out/route.js +2 -2
  57. package/dist/standalone/next-output/server/app/api/out/route.js.nft.json +1 -1
  58. package/dist/standalone/next-output/server/app/api/sheet/active/route.js +1 -1
  59. package/dist/standalone/next-output/server/app/api/sheet/active/route.js.nft.json +1 -1
  60. package/dist/standalone/next-output/server/app/api/sheet/route.js +1 -1
  61. package/dist/standalone/next-output/server/app/api/sheet/route.js.nft.json +1 -1
  62. package/dist/standalone/next-output/server/app/api/state/route.js +1 -1
  63. package/dist/standalone/next-output/server/app/api/state/route.js.nft.json +1 -1
  64. package/dist/standalone/next-output/server/app/api/sync/import/route.js +1 -1
  65. package/dist/standalone/next-output/server/app/api/sync/import/route.js.nft.json +1 -1
  66. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js +1 -1
  67. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js.nft.json +1 -1
  68. package/dist/standalone/next-output/server/app/api/sync/pull/route.js +1 -1
  69. package/dist/standalone/next-output/server/app/api/sync/pull/route.js.nft.json +1 -1
  70. package/dist/standalone/next-output/server/app/api/sync/push/route.js +1 -1
  71. package/dist/standalone/next-output/server/app/api/sync/push/route.js.nft.json +1 -1
  72. package/dist/standalone/next-output/server/app/api/tags/route.js +1 -1
  73. package/dist/standalone/next-output/server/app/api/tags/route.js.nft.json +1 -1
  74. package/dist/standalone/next-output/server/app/login/page/build-manifest.json +2 -2
  75. package/dist/standalone/next-output/server/app/login/page.js +1 -2
  76. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  77. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  78. package/dist/standalone/next-output/server/app/offline/page/build-manifest.json +2 -2
  79. package/dist/standalone/next-output/server/app/offline/page.js +1 -2
  80. package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
  81. package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
  82. package/dist/standalone/next-output/server/app/page/build-manifest.json +2 -2
  83. package/dist/standalone/next-output/server/app/page.js +2 -3
  84. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  85. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  86. package/dist/standalone/next-output/server/app/pomodoro/page/build-manifest.json +2 -2
  87. package/dist/standalone/next-output/server/app/pomodoro/page.js +2 -3
  88. package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
  89. package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
  90. package/dist/standalone/next-output/server/app/register/page/build-manifest.json +2 -2
  91. package/dist/standalone/next-output/server/app/register/page.js +1 -2
  92. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
  93. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
  94. package/dist/standalone/next-output/server/app/reporting/page/build-manifest.json +2 -2
  95. package/dist/standalone/next-output/server/app/reporting/page.js +2 -3
  96. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  97. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  98. package/dist/standalone/next-output/server/app/search/page/app-paths-manifest.json +3 -0
  99. package/dist/standalone/next-output/server/app/search/page/build-manifest.json +17 -0
  100. package/dist/standalone/next-output/server/app/search/page/next-font-manifest.json +11 -0
  101. package/dist/standalone/next-output/server/app/search/page/react-loadable-manifest.json +1 -0
  102. package/dist/standalone/next-output/server/app/search/page/server-reference-manifest.json +4 -0
  103. package/dist/standalone/next-output/server/app/search/page.js +16 -0
  104. package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -0
  105. package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +3 -0
  106. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page/build-manifest.json +2 -2
  107. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js +1 -2
  108. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
  109. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
  110. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/build-manifest.json +2 -2
  111. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js +1 -2
  112. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
  113. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
  114. package/dist/standalone/next-output/server/app/settings/data/page/build-manifest.json +2 -2
  115. package/dist/standalone/next-output/server/app/settings/data/page.js +2 -3
  116. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  117. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  118. package/dist/standalone/next-output/server/app/settings/display/page/build-manifest.json +2 -2
  119. package/dist/standalone/next-output/server/app/settings/display/page.js +1 -2
  120. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  121. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  122. package/dist/standalone/next-output/server/app/settings/goals/page/build-manifest.json +2 -2
  123. package/dist/standalone/next-output/server/app/settings/goals/page.js +2 -3
  124. package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
  125. package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
  126. package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +2 -2
  127. package/dist/standalone/next-output/server/app/settings/notifications/page.js +1 -2
  128. package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
  129. package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
  130. package/dist/standalone/next-output/server/app/settings/page/build-manifest.json +2 -2
  131. package/dist/standalone/next-output/server/app/settings/page.js +2 -3
  132. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  133. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  134. package/dist/standalone/next-output/server/app/settings/pomodoro/page/build-manifest.json +2 -2
  135. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js +2 -3
  136. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
  137. package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
  138. package/dist/standalone/next-output/server/app/settings/quick-actions/page/build-manifest.json +2 -2
  139. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js +1 -2
  140. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
  141. package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
  142. package/dist/standalone/next-output/server/app/settings/tags/page/build-manifest.json +2 -2
  143. package/dist/standalone/next-output/server/app/settings/tags/page.js +2 -3
  144. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  145. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  146. package/dist/standalone/next-output/server/app/sheets/page/build-manifest.json +2 -2
  147. package/dist/standalone/next-output/server/app/sheets/page.js +2 -3
  148. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
  149. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
  150. package/dist/standalone/next-output/server/app/today/page/build-manifest.json +2 -2
  151. package/dist/standalone/next-output/server/app/today/page.js +2 -3
  152. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
  153. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
  154. package/dist/standalone/next-output/server/app-paths-manifest.json +5 -0
  155. package/dist/standalone/next-output/server/chunks/0z~i_next_dist_esm_build_templates_app-route_0~jv_po.js +3 -0
  156. package/dist/standalone/next-output/server/chunks/{[root-of-the-server]__0ixkum3._.js → [root-of-the-server]__01ng47y._.js} +2 -2
  157. package/dist/standalone/next-output/server/chunks/{[root-of-the-server]__0.ztg_g._.js → [root-of-the-server]__02bnr5q._.js} +2 -2
  158. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0daa86i._.js +3 -0
  159. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0hwik-5._.js +3 -0
  160. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0lbu8mm._.js +3 -0
  161. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0n.~.zo._.js +3 -0
  162. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0n~maxn._.js +3 -0
  163. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0pave79._.js +3 -0
  164. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0qj~x3r._.js +3 -0
  165. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0skolig._.js +3 -0
  166. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0traxfq._.js +3 -0
  167. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0u_4s37._.js +3 -0
  168. package/dist/standalone/next-output/server/chunks/{[root-of-the-server]__0qxlpdo._.js → [root-of-the-server]__0vivr1t._.js} +2 -2
  169. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0vjnznw._.js +3 -0
  170. package/dist/standalone/next-output/server/chunks/{[root-of-the-server]__01dpndl._.js → [root-of-the-server]__0wp5dks._.js} +2 -2
  171. package/dist/standalone/next-output/server/chunks/{[root-of-the-server]__0g~~yai._.js → [root-of-the-server]__0~_od9c._.js} +2 -2
  172. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0~gka7i._.js +3 -0
  173. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0~zviro._.js +1 -1
  174. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__13y14r6._.js +3 -0
  175. package/dist/standalone/next-output/server/chunks/{_0y.amf.._.js → _009-tpl._.js} +2 -2
  176. package/dist/standalone/next-output/server/chunks/_0p0-odp._.js +3 -0
  177. package/dist/standalone/next-output/server/chunks/{_0vzosja._.js → _0rz1whw._.js} +2 -2
  178. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_command-palette_route_actions_0n5r28j.js +3 -0
  179. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_entries_search_route_actions_09m9ljm.js +3 -0
  180. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_entry_merge_route_actions_047yt1x.js +3 -0
  181. package/dist/standalone/next-output/server/chunks/_next-internal_server_app_api_entry_split_route_actions_0g-iltq.js +3 -0
  182. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_04bpslp._.js +1 -1
  183. package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0huho7_.js +4 -0
  184. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__052~wmx._.js +1 -1
  185. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__07_7oid._.js +3 -0
  186. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0x6yv3u._.js → [root-of-the-server]__0c786vx._.js} +2 -2
  187. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0gi2idc._.js → [root-of-the-server]__0d6wmgd._.js} +2 -2
  188. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0d9ak_~._.js +3 -0
  189. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0d~vgg9._.js +3 -0
  190. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0fzz02j._.js +3 -0
  191. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0hpcspt._.js +3 -0
  192. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0kp.3u5._.js +3 -0
  193. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0yrs18n._.js → [root-of-the-server]__0laah33._.js} +2 -2
  194. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0n8s9zq._.js +1 -1
  195. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0_wxrlk._.js → [root-of-the-server]__0teulir._.js} +2 -2
  196. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0hx9602._.js → [root-of-the-server]__0xp50ux._.js} +2 -2
  197. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0yz-q3-._.js +3 -0
  198. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__113s7hk._.js +3 -0
  199. package/dist/standalone/next-output/server/chunks/ssr/_002dssm._.js +1 -1
  200. package/dist/standalone/next-output/server/chunks/ssr/_036rv.y._.js +3 -0
  201. package/dist/standalone/next-output/server/chunks/ssr/{_0_k2414._.js → _04.8jwp._.js} +2 -2
  202. package/dist/standalone/next-output/server/chunks/ssr/_040_y99._.js +3 -0
  203. package/dist/standalone/next-output/server/chunks/ssr/_07p~0bg._.js +1 -1
  204. package/dist/standalone/next-output/server/chunks/ssr/_0dxq_sx._.js +3 -0
  205. package/dist/standalone/next-output/server/chunks/ssr/_0fzq9xc._.js +3 -0
  206. package/dist/standalone/next-output/server/chunks/ssr/_0hcz.gb._.js +3 -0
  207. package/dist/standalone/next-output/server/chunks/ssr/_0hy_8.b._.js +3 -0
  208. package/dist/standalone/next-output/server/chunks/ssr/_0lhrvkv._.js +3 -0
  209. package/dist/standalone/next-output/server/chunks/ssr/_0m.iebm._.js +1 -1
  210. package/dist/standalone/next-output/server/chunks/ssr/_0nnp~ae._.js +1 -1
  211. package/dist/standalone/next-output/server/chunks/ssr/_0ntfdc9._.js +3 -0
  212. package/dist/standalone/next-output/server/chunks/ssr/_0p5_u-y._.js +3 -0
  213. package/dist/standalone/next-output/server/chunks/ssr/_0q214m8._.js +3 -0
  214. package/dist/standalone/next-output/server/chunks/ssr/_0q~8_bm._.js +1 -1
  215. package/dist/standalone/next-output/server/chunks/ssr/_0rv4ope._.js +3 -0
  216. package/dist/standalone/next-output/server/chunks/ssr/_0s_1q6-._.js +3 -0
  217. package/dist/standalone/next-output/server/chunks/ssr/_0s_yzxz._.js +3 -0
  218. package/dist/standalone/next-output/server/chunks/ssr/_0syjj1b._.js +3 -0
  219. package/dist/standalone/next-output/server/chunks/ssr/_0v9kigy._.js +1 -1
  220. package/dist/standalone/next-output/server/chunks/ssr/_0woiueg._.js +3 -0
  221. package/dist/standalone/next-output/server/chunks/ssr/_0zfyg1r._.js +3 -0
  222. package/dist/standalone/next-output/server/chunks/ssr/_0zgllyb._.js +3 -0
  223. package/dist/standalone/next-output/server/chunks/ssr/{_088~qfj._.js → _10~dvb4._.js} +3 -3
  224. package/dist/standalone/next-output/server/chunks/ssr/_11je2nt._.js +3 -0
  225. package/dist/standalone/next-output/server/chunks/ssr/_1218olc._.js +3 -0
  226. package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_search_page_actions_0koh-tf.js +3 -0
  227. package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +3 -0
  228. package/dist/standalone/next-output/server/chunks/ssr/components_0rm~268._.js +1 -1
  229. package/dist/standalone/next-output/server/chunks/ssr/components_0s502iu._.js +3 -0
  230. package/dist/standalone/next-output/server/chunks/ssr/components_reporting-view_tsx_0-0ofcv._.js +1 -1
  231. package/dist/standalone/next-output/server/chunks/ssr/components_supabase-auth-form_tsx_0s9lt-1._.js +3 -0
  232. package/dist/standalone/next-output/server/chunks/ssr/components_today-focus-view_tsx_0~eac-w._.js +1 -1
  233. package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +1 -1
  234. package/dist/standalone/next-output/server/middleware-build-manifest.js +5 -5
  235. package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
  236. package/dist/standalone/next-output/server/next-font-manifest.js +1 -1
  237. package/dist/standalone/next-output/server/next-font-manifest.json +4 -0
  238. package/dist/standalone/next-output/server/pages/500.html +1 -1
  239. package/dist/standalone/next-output/static/chunks/0-pivfzfhyz.5.js +1 -0
  240. package/dist/standalone/next-output/static/chunks/0.e7_ejd.-kzx.js +1 -0
  241. package/dist/standalone/next-output/static/chunks/{0x9s1xcq69ppx.js → 005x4jqipr75n.js} +5 -5
  242. package/dist/standalone/next-output/static/chunks/02~oo04e0po4k.css +3 -0
  243. package/dist/standalone/next-output/static/chunks/033lk~e30imyc.js +1 -0
  244. package/dist/standalone/next-output/static/chunks/03dh~3.gq~kw7.js +1 -0
  245. package/dist/standalone/next-output/static/chunks/04d2c_i-luh3o.js +1 -0
  246. package/dist/standalone/next-output/static/chunks/08sdj449boiec.js +1 -0
  247. package/dist/standalone/next-output/static/chunks/09u_29en-yaxy.js +1 -0
  248. package/dist/standalone/next-output/static/chunks/0aru5x_.qsjc3.js +1 -0
  249. package/dist/standalone/next-output/static/chunks/0c0i5ey6h8qet.js +1 -0
  250. package/dist/standalone/next-output/static/chunks/0c2088mpz.z.3.js +1 -0
  251. package/dist/standalone/next-output/static/chunks/0e7vf6ybvzpet.js +1 -0
  252. package/dist/standalone/next-output/static/chunks/0jn1~13s4qy3c.js +1 -0
  253. package/dist/standalone/next-output/static/chunks/0jwrz3zhj9oat.js +1 -0
  254. package/dist/standalone/next-output/static/chunks/0kehy4rq7thp9.js +1 -0
  255. package/dist/standalone/next-output/static/chunks/0mcmtes_owmfo.js +1 -0
  256. package/dist/standalone/next-output/static/chunks/0njpt~3f0nhto.js +1 -0
  257. package/dist/standalone/next-output/static/chunks/0pq_8wz65_8e..js +1 -0
  258. package/dist/standalone/next-output/static/chunks/0s5i31vj2y6n7.js +1 -0
  259. package/dist/standalone/next-output/static/chunks/0s_kkoslz7uoy.js +1 -0
  260. package/dist/standalone/next-output/static/chunks/0tee7--l8~1jx.js +1 -0
  261. package/dist/standalone/next-output/static/chunks/0xmqo9jexa_hl.js +1 -0
  262. package/dist/standalone/next-output/static/chunks/{0ztw.xdr4egi9.js → 0y7vk2q__th4g.js} +2 -2
  263. package/dist/standalone/next-output/static/chunks/151m05291h.pl.js +1 -0
  264. package/dist/standalone/next-output/static/chunks/175d60.wup0de.js +1 -0
  265. package/dist/standalone/next-output/static/chunks/17gch824k4dm8.js +1 -0
  266. package/dist/standalone/next-output/static/chunks/{turbopack-09e2mm19twlrw.js → turbopack-01utszc95mtf1.js} +1 -1
  267. package/dist/standalone/package.json +13 -4
  268. package/dist/standalone/public/sw.js +1 -0
  269. package/package.json +13 -4
  270. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0-xbdkv._.js +0 -3
  271. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00_xlkl._.js +0 -3
  272. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__02io6cv._.js +0 -3
  273. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__07sy349._.js +0 -3
  274. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0l9xtqh._.js +0 -3
  275. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0o1mjxc._.js +0 -3
  276. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0s7i732._.js +0 -3
  277. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wtdkb3._.js +0 -3
  278. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__13n2uo8._.js +0 -3
  279. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0-0rjzr._.js +0 -3
  280. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__01xqr3d._.js +0 -3
  281. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0_b2z9m._.js +0 -3
  282. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0bowsf1._.js +0 -3
  283. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0dvku3t._.js +0 -3
  284. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0k~hq1g._.js +0 -3
  285. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0wtu388._.js +0 -3
  286. package/dist/standalone/next-output/server/chunks/ssr/_00aklen._.js +0 -3
  287. package/dist/standalone/next-output/server/chunks/ssr/_00ic3j9._.js +0 -3
  288. package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +0 -3
  289. package/dist/standalone/next-output/server/chunks/ssr/_08qe8j9._.js +0 -3
  290. package/dist/standalone/next-output/server/chunks/ssr/_0_aptb7._.js +0 -3
  291. package/dist/standalone/next-output/server/chunks/ssr/_0axgv9-._.js +0 -3
  292. package/dist/standalone/next-output/server/chunks/ssr/_0c0txs~._.js +0 -3
  293. package/dist/standalone/next-output/server/chunks/ssr/_0cm4hy2._.js +0 -3
  294. package/dist/standalone/next-output/server/chunks/ssr/_0cxg26n._.js +0 -3
  295. package/dist/standalone/next-output/server/chunks/ssr/_0l6-7m4._.js +0 -3
  296. package/dist/standalone/next-output/server/chunks/ssr/_0s1f~0y._.js +0 -3
  297. package/dist/standalone/next-output/server/chunks/ssr/_0xrc5.~._.js +0 -3
  298. package/dist/standalone/next-output/server/chunks/ssr/_0y3ypyx._.js +0 -3
  299. package/dist/standalone/next-output/server/chunks/ssr/_0ycs85o._.js +0 -3
  300. package/dist/standalone/next-output/server/chunks/ssr/_0zk9gtm._.js +0 -3
  301. package/dist/standalone/next-output/server/chunks/ssr/_13crob-._.js +0 -3
  302. package/dist/standalone/next-output/server/chunks/ssr/_13y76jr._.js +0 -3
  303. package/dist/standalone/next-output/server/chunks/ssr/lib_0c0z4q-._.js +0 -3
  304. package/dist/standalone/next-output/static/chunks/0.4obx1-sv46-.js +0 -1
  305. package/dist/standalone/next-output/static/chunks/029pvmqxn_t4z.js +0 -1
  306. package/dist/standalone/next-output/static/chunks/04~.lbegcwd41.js +0 -1
  307. package/dist/standalone/next-output/static/chunks/05tg.ske01w0a.js +0 -1
  308. package/dist/standalone/next-output/static/chunks/06xf_oh5oqbs2.js +0 -1
  309. package/dist/standalone/next-output/static/chunks/09acxdggb87~w.js +0 -1
  310. package/dist/standalone/next-output/static/chunks/09tjbwcc~3p_e.js +0 -1
  311. package/dist/standalone/next-output/static/chunks/0ate7k1rcitu0.js +0 -1
  312. package/dist/standalone/next-output/static/chunks/0crn_fc6.6569.js +0 -1
  313. package/dist/standalone/next-output/static/chunks/0fkr5kz7p1r5l.js +0 -1
  314. package/dist/standalone/next-output/static/chunks/0lhj2p9.4g20~.js +0 -1
  315. package/dist/standalone/next-output/static/chunks/0o4zvrm3q.9k3.js +0 -1
  316. package/dist/standalone/next-output/static/chunks/0pqilbd~jphqs.css +0 -3
  317. package/dist/standalone/next-output/static/chunks/0q05k1wfzh4_a.js +0 -1
  318. package/dist/standalone/next-output/static/chunks/0vov8ngx9~8m2.js +0 -1
  319. package/dist/standalone/next-output/static/chunks/0watkjb-fw0vn.js +0 -1
  320. package/dist/standalone/next-output/static/chunks/0x5_m1_cuacap.js +0 -1
  321. package/dist/standalone/next-output/static/chunks/0xj4dodycy1oc.js +0 -1
  322. package/dist/standalone/next-output/static/chunks/0yi4m~~80yeqj.js +0 -1
  323. package/dist/standalone/next-output/static/chunks/12eaief5vtso9.js +0 -1
  324. package/dist/standalone/next-output/static/chunks/13-nw2q_c_9mk.js +0 -1
  325. package/dist/standalone/next-output/static/chunks/14jtaz5s.4ih1.js +0 -1
  326. /package/dist/standalone/next-output/static/{gS32e4Tv_70ot1IWBJddE → o0yrmO-jZI10Gicr4syI_}/_buildManifest.js +0 -0
  327. /package/dist/standalone/next-output/static/{gS32e4Tv_70ot1IWBJddE → o0yrmO-jZI10Gicr4syI_}/_clientMiddlewareManifest.js +0 -0
  328. /package/dist/standalone/next-output/static/{gS32e4Tv_70ot1IWBJddE → o0yrmO-jZI10Gicr4syI_}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
1
+ module.exports=[75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","search","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
2
2
 
3
3
  //# sourceMappingURL=_0m.iebm._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
1
+ module.exports=[26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","search","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
2
2
 
3
3
  //# sourceMappingURL=_0nnp~ae._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:a=>a.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:a=>a.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},44600,a=>{"use strict";var b=a.i(34542),c=a.i(13964),d=a.i(75215);a.s(["use_confirm_dialog",0,function(){let a=(0,b.useContext)(c.ConfirmDialogContext);if(null!==a)return a;let e=(0,d.get_registered_confirm_dialog)();if(null!==e)return{confirm:e};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},61802,9357,a=>{"use strict";let b=Symbol.for("constructDateFrom");a.s(["constructFromSymbol",0,b,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200,"minutesInYear",0,525600],9357),a.s(["constructFrom",0,function(a,c){return"function"==typeof a?a(c):a&&"object"==typeof a&&b in a?a[b](c):a instanceof Date?new a.constructor(c):new Date(c)}],61802)},46313,a=>{"use strict";var b=a.i(61802);a.s(["toDate",0,function(a,c){return(0,b.constructFrom)(c||a,a)}])},57487,a=>{"use strict";let b={};a.s(["getDefaultOptions",0,function(){return b}])},44312,a=>{"use strict";var b;let c={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function d(a){return (b={})=>{let c=b.width?String(b.width):a.defaultWidth;return a.formats[c]||a.formats[a.defaultWidth]}}let e={date:d({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:d({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:d({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},f={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function g(a){return(b,c)=>{let d;if("formatting"===(c?.context?String(c.context):"standalone")&&a.formattingValues){let b=a.defaultFormattingWidth||a.defaultWidth,e=c?.width?String(c.width):b;d=a.formattingValues[e]||a.formattingValues[b]}else{let b=a.defaultWidth,e=c?.width?String(c.width):a.defaultWidth;d=a.values[e]||a.values[b]}return d[a.argumentCallback?a.argumentCallback(b):b]}}let h={ordinalNumber:(a,b)=>{let c=Number(a),d=c%100;if(d>20||d<10)switch(d%10){case 1:return c+"st";case 2:return c+"nd";case 3:return c+"rd"}return c+"th"},era:g({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:g({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:a=>a-1}),month:g({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:g({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:g({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function i(a){return(b,c={})=>{let d,e=c.width,f=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],g=b.match(f);if(!g)return null;let h=g[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],j=Array.isArray(i)?function(a,b){for(let c=0;c<a.length;c++)if(b(a[c]))return c}(i,a=>a.test(h)):function(a,b){for(let c in a)if(Object.prototype.hasOwnProperty.call(a,c)&&b(a[c]))return c}(i,a=>a.test(h));return d=a.valueCallback?a.valueCallback(j):j,{value:d=c.valueCallback?c.valueCallback(d):d,rest:b.slice(h.length)}}}let j={ordinalNumber:(b={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:a=>parseInt(a,10)},(a,c={})=>{let d=a.match(b.matchPattern);if(!d)return null;let e=d[0],f=a.match(b.parsePattern);if(!f)return null;let g=b.valueCallback?b.valueCallback(f[0]):f[0];return{value:g=c.valueCallback?c.valueCallback(g):g,rest:a.slice(e.length)}}),era:i({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:i({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:a=>a+1}),month:i({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:i({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:i({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};a.s(["defaultLocale",0,{code:"en-US",formatDistance:(a,b,d)=>{let e,f=c[a];if(e="string"==typeof f?f:1===b?f.one:f.other.replace("{{count}}",b.toString()),d?.addSuffix)if(d.comparison&&d.comparison>0)return"in "+e;else return e+" ago";return e},formatLong:e,formatRelative:(a,b,c,d)=>f[a],localize:h,match:j,options:{weekStartsOn:0,firstWeekContainsDate:1}}],44312)},95799,59099,a=>{"use strict";var b=a.i(46313);a.s(["getTimezoneOffsetInMilliseconds",0,function(a){let c=(0,b.toDate)(a),d=new Date(Date.UTC(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds()));return d.setUTCFullYear(c.getFullYear()),a-d}],95799);var c=a.i(61802);a.s(["normalizeDates",0,function(a,...b){let d=c.constructFrom.bind(null,a||b.find(a=>"object"==typeof a));return b.map(d)}],59099)},99467,a=>{"use strict";var b=a.i(56924);a.s(["tags_are_equal",0,function(a,c){try{return(0,b.normalize_stored_tag)(a)===(0,b.normalize_stored_tag)(c)}catch{return!1}}])},20300,23415,a=>{"use strict";var b=a.i(39752),c=a.i(10724),d=a.i(48174),e=a.i(89969),f=a.i(69749),g=a.i(64106);function h(){return{sheetName:"",tag:"",fromDate:"",toDate:""}}a.s(["get_empty_entry_export_filters",0,h],23415),a.s(["EntryFacetFiltersPanel",0,function({filters:a,sheet_names:i,tag_names:j,is_pending:k=!1,clear_label:l="Clear filters",on_change:m,on_clear:n}){let o={from_date:a.fromDate,to_date:a.toDate},p=a.fromDate.length>0!=a.toDate.length>0||a.fromDate.length>0&&a.toDate.length>0&&null===(0,g.get_date_range_ms_from_inputs)(a.fromDate,a.toDate),q=a.sheetName.length>0||a.tag.length>0||a.fromDate.length>0||a.toDate.length>0;return(0,b.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheet"}),(0,b.jsxs)("select",{className:(0,f.get_input_class_name)("compact"),value:a.sheetName,disabled:k,onChange:b=>m({...a,sheetName:b.target.value}),children:[(0,b.jsx)("option",{value:"",children:"All sheets"}),i.map(a=>(0,b.jsx)("option",{value:a,children:a},a))]})]}),(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Tag"}),(0,b.jsxs)("select",{className:(0,f.get_input_class_name)("compact"),value:a.tag,disabled:k,onChange:b=>m({...a,tag:b.target.value}),children:[(0,b.jsx)("option",{value:"",children:"Any tag"}),j.map(a=>(0,b.jsx)("option",{value:a,children:(0,d.format_display_tag)(a)},a))]})]})]}),(0,b.jsx)(c.ReportingDateRangePicker,{range:o,is_invalid:p,on_range_change:b=>m({...a,fromDate:b.from_date,toDate:b.to_date}),on_clear:()=>m({...a,fromDate:"",toDate:""})}),q?(0,b.jsx)("div",{children:(0,b.jsx)("button",{type:"button",className:(0,e.get_button_class_name)("ghost","small"),disabled:k,onClick:()=>{void 0!==n?n():m(h())},children:l})}):null]})}],20300)},19325,a=>{"use strict";var b=a.i(39752),c=a.i(82508),d=a.i(34542),e=a.i(16229),f=a.i(59659),g=a.i(44600),h=a.i(89969);a.s(["BackupRestoreSetting",0,function({db_path:a}){let i=(0,c.useRouter)(),{confirm:j}=(0,g.use_confirm_dialog)(),k=(0,d.useRef)(null),[l,m]=(0,d.useState)(null),[n,o]=(0,d.useState)(null),[p,q]=(0,d.useState)(!1),[r,s]=(0,d.useState)(!1),t=async()=>{q(!0),m(null),o(null);try{let a=await fetch("/api/backup");if(!a.ok){let b=await a.json();throw Error(b.error??"Download failed")}let b=await a.blob(),c=URL.createObjectURL(b),d=document.createElement("a");d.href=c,d.download="db.json",d.click(),URL.revokeObjectURL(c),o("Backup downloaded.")}catch(a){m((0,e.message_from_unknown_error)(a,"Backup download failed"))}finally{q(!1)}},u=async a=>{let b=a.target.files?.[0];if((a.target.value="",void 0!==b)&&await j({title:"Restore backup?",message:"This will replace your current time tracker data with the uploaded backup file. This cannot be undone.",confirmLabel:"Restore",variant:"danger"})){s(!0),m(null),o(null);try{let a,c=await b.text();try{a=JSON.parse(c)}catch{throw Error("Invalid backup file: file is not valid JSON.")}let d=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok){let a=await d.json();throw Error(a.error??"Restore failed")}o("Backup restored. Opening tracker…"),(0,f.push_tracker_db_cloud_after_change)(),i.push("/"),i.refresh()}catch(a){m((0,e.message_from_unknown_error)(a,"Restore failed"))}finally{s(!1)}}},v=p||r;return(0,b.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Backup and restore"}),(0,b.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"Download a copy of your database or replace it with a previously saved backup file."})]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-mono text-[0.65rem] leading-snug text-muted",title:a,children:a}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost","small"),disabled:v,onClick:()=>void t(),children:p?"Downloading…":"Download backup"}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("danger","small"),disabled:v,onClick:()=>{k.current?.click()},children:r?"Restoring…":"Restore from file"}),(0,b.jsx)("input",{ref:k,type:"file",accept:"application/json,.json",className:"hidden",onChange:a=>void u(a)})]}),null===n?null:(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:n}),null===l?null:(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:l})]})}],19325)},23470,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(20300);function e(a){let b=a.replaceAll('"','""');return`"${b}"`}function f(a){return a.sheetName.trim().length>0||a.tag.trim().length>0||a.fromDate.trim().length>0||a.toDate.trim().length>0}function g(a){return a.replaceAll("|","\\|").replaceAll("\n"," ")}function h(a){let b=a.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"");return b.length>0?b:"scope"}function i(a){return a.sheets.reduce((a,b)=>a+b.entries.length,0)}var j=a.i(64106),k=a.i(99467),l=a.i(89969),m=a.i(23415),n=a.i(16229);a.s(["DbExportSetting",0,function({db:a,sheet_names:o,tag_names:p}){let[q,r]=(0,c.useState)(()=>(0,m.get_empty_entry_export_filters)()),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(null),w=(0,c.useMemo)(()=>i(a),[a]),x=(0,c.useMemo)(()=>(function(a,b,c=Date.now()){var d;let e,f=function(a){let{sheets:b,version:c,activeSheetName:d}=a;return{version:c,activeSheetName:d,sheets:b.map(({name:a,entries:b,activeEntryID:c})=>({name:a,activeEntryID:c,entries:b.map(({id:a,start:b,end:c,description:d,tags:e,notes:f})=>({id:a,description:d,tags:e,notes:f.map(({timestamp:a,text:b})=>({text:b,timestamp:new Date(a)})),start:new Date(b),end:null===c?null:new Date(c)}))}))}}(a),g={query:"",...b},h=b.sheetName.trim(),i=f.sheets.filter(a=>!(h.length>0)||a.name===h).map(a=>({...a,entries:a.entries.filter(b=>(function(a,b,c,d=Date.now()){let e=c.sheetName.trim();if(e.length>0&&b!==e)return!1;let f=c.tag.trim();if(f.length>0&&!a.tags.some(a=>(0,k.tags_are_equal)(a,f)))return!1;let g=(0,j.get_date_range_ms_from_inputs)(c.fromDate.trim(),c.toDate.trim());return null===g||function(a,b,c=Date.now()){let d=a.start.getTime(),e=null===a.end?c:a.end.getTime();return d<=b.endMs&&e>=b.startMs}(a,g,d)})(b,a.name,g,c))})).filter(a=>h.length>0||a.entries.length>0),l=null!==f.activeSheetName&&i.some(a=>a.name===f.activeSheetName)?f.activeSheetName:i[0]?.name??null;return e=(d={version:f.version,activeSheetName:l,sheets:i}).sheets.map(a=>({name:a.name,activeEntryID:a.activeEntryID,entries:a.entries.map(a=>({id:a.id,description:a.description,tags:a.tags,start:a.start.getTime(),end:null===a.end?null:a.end.getTime(),notes:a.notes.map(a=>({text:a.text,timestamp:a.timestamp.getTime()}))}))})),{version:d.version,activeSheetName:d.activeSheetName,sheets:e}})(a,q),[a,q]),y=(0,c.useMemo)(()=>i(x),[x]),z=(0,c.useMemo)(()=>q.fromDate.length>0!=q.toDate.length>0||q.fromDate.length>0&&q.toDate.length>0&&null===(0,j.get_date_range_ms_from_inputs)(q.fromDate,q.toDate),[q.fromDate,q.toDate]),A=a=>{if(v(null),t(null),z)return void v("Choose a valid from and to date, or clear the date filter.");if(0===y)return void v("No entries match the current export filters.");try{let b,c,d,i,j,k=function(a,b,c){if("json"===a)return JSON.stringify(b,null,2);if("csv"===a){let a;return a=b.sheets.flatMap(a=>a.entries.map(b=>{let c=new Date(b.start).toISOString(),d=null===b.end?"":new Date(b.end).toISOString(),f=null===b.end?"":String(Math.max(0,b.end-b.start)/6e4),g=b.notes.map(a=>a.text).join(" | ");return[a.name,String(b.id),b.description,b.tags.join(" "),c,d,f,String(b.notes.length),g].map(e).join(",")})),["sheet_name,entry_id,description,tags,start_iso,end_iso,duration_minutes,note_count,notes",...a].join("\n")}return function(a,b={sheetName:"",tag:"",fromDate:"",toDate:""}){var c;let d,e=[],h=new Date().toISOString(),i=a.sheets.reduce((a,b)=>a+b.entries.length,0);for(let j of(e.push("# super-time-tracker export"),e.push(""),e.push(`- Exported at: ${h}`),e.push(`- Active sheet: ${a.activeSheetName??"none"}`),e.push(`- Sheets: ${a.sheets.length}`),e.push(`- Entries: ${i}`),f(b)&&e.push(`- Scope: ${(c=b,d=[],c.sheetName.trim().length>0&&d.push(`sheet "${c.sheetName.trim()}"`),c.tag.trim().length>0&&d.push(`tag @${c.tag.trim()}`),(c.fromDate.trim().length>0||c.toDate.trim().length>0)&&d.push(`dates ${c.fromDate.trim()||"…"} – ${c.toDate.trim()||"…"}`),d.join(", "))}`),e.push(""),a.sheets)){if(e.push(`## ${j.name}`),e.push(""),e.push(`- Active entry ID: ${j.activeEntryID??"none"}`),e.push(`- Entries: ${j.entries.length}`),e.push(""),0===j.entries.length){e.push("_No entries_"),e.push("");continue}for(let a of(e.push("| ID | Description | Tags | Start | End | Duration | Notes |"),e.push("| --- | --- | --- | --- | --- | --- | --- |"),j.entries)){let b=new Date(a.start).toISOString(),c=null===a.end?"running":new Date(a.end).toISOString(),d=null===a.end?"running":`${Math.max(0,a.end-a.start)/6e4} min`,f=0===a.tags.length?"-":a.tags.map(a=>`@${a}`).join(" "),h=0===a.notes.length?"-":a.notes.map(a=>a.text).join(" / ");e.push(`| ${a.id} | ${g(a.description)} | ${g(f)} | ${b} | ${c} | ${d} | ${g(h)} |`)}e.push("")}return e.join("\n")}(b,c)}(a,x,q),l=(b="json"===a?"json":"csv"===a?"csv":"md",c=function(a){if(!f(a))return"";let b=[];if(a.sheetName.trim().length>0&&b.push(h(a.sheetName)),a.tag.trim().length>0&&b.push(`tag-${h(a.tag)}`),a.fromDate.trim().length>0||a.toDate.trim().length>0){let c=a.fromDate.trim()||"start",d=a.toDate.trim()||"end";b.push(`${c}-to-${d}`)}return b.join("-").slice(0,80)}(q),0===c.length?`super-time-tracker-export.${b}`:`super-time-tracker-export-${c}.${b}`);d=new Blob([k],{type:"json"===a?"application/json":"csv"===a?"text/csv;charset=utf-8":"text/markdown;charset=utf-8"}),i=URL.createObjectURL(d),(j=document.createElement("a")).href=i,j.download=l,j.click(),URL.revokeObjectURL(i),t(`Downloaded ${l}`)}catch(a){v((0,n.message_from_unknown_error)(a,"Export failed"))}},B=f(q)?`${y} of ${w} entries in scope`:`${w} entries ready to export`;return(0,b.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Database export"}),(0,b.jsxs)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:[a.sheets.length," sheets · ",B]})]}),(0,b.jsx)(d.EntryFacetFiltersPanel,{filters:q,sheet_names:o,tag_names:p,on_change:r}),z?(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:"Choose both from and to dates, or clear the date filter."}):null,(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:z||0===y,onClick:()=>A("json"),children:"Export JSON"}),(0,b.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:z||0===y,onClick:()=>A("csv"),children:"Export CSV"}),(0,b.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:z||0===y,onClick:()=>A("markdown"),children:"Export Markdown"})]}),null===s?null:(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:s}),null===u?null:(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:u})]})}],23470)}];
2
+
3
+ //# sourceMappingURL=_0ntfdc9._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[81296,92558,51934,61733,56720,20872,10305,41872,99450,24580,8379,74242,a=>{"use strict";var b=a.i(39752),c=a.i(64723),d=a.i(34542),e=a.i(34435),f=a.i(96359);let g="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55";function h(a){var c,h,i,j,k,l;let{current_sheet_name:m,sheets:n,is_pending:o,on_edit:p,on_add_note:q,on_show_add_note_form:r,on_revise_description_ai:s,can_revise_description_ai:t=!1,on_resume:u,entry_is_active:v=!1,can_split:w=!1,on_split:x,can_merge_previous:y=!1,can_merge_next:z=!1,on_merge:A,on_delete:B,on_move:C}=a,D=n.find(a=>a.name===m),E=v||D?.hasActiveEntry===!0&&!v,F=n.filter(a=>a.name!==m),[G,H]=(0,d.useState)(!1),I=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!G)return;let a=a=>{null===I.current||I.current.contains(a.target)||H(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[G]);let J=()=>{H(!1)};return(0,f.use_escape_to_cancel)(J,G),(0,b.jsxs)("div",{className:"relative shrink-0",ref:I,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Entry actions","aria-expanded":G,"aria-haspopup":"menu",disabled:o,onClick:()=>H(a=>!a),children:(0,b.jsx)(e.HamburgerIcon,{})}),G?(0,b.jsxs)("div",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(c=o,h=J,i=p,(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:c,onClick:()=>{h(),i()},children:"Edit times"})})),function({is_pending:a,close_menu:c,on_show_add_note_form:d,on_add_note:e}){return void 0===d&&void 0===e?null:(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a,onClick:()=>{if(c(),void 0!==d)return void d();let a=function(){let a=window.prompt("Add note","");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&void 0!==e&&e(a)},children:"Add note"})})}({is_pending:o,close_menu:J,on_show_add_note_form:r,on_add_note:q}),function({is_pending:a,can_revise_description_ai:c,close_menu:d,on_revise_description_ai:e}){return void 0===e?null:(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a||!c,title:c?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{d(),e()},children:"Revise description with AI"})})}({is_pending:o,can_revise_description_ai:t,close_menu:J,on_revise_description_ai:s}),function({is_pending:a,resume_blocked:c,resume_blocked_reason:d,close_menu:e,on_resume:f}){return void 0===f?null:(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a||c,title:c?d:void 0,onClick:()=>{e(),f()},children:"Resume"})})}({is_pending:o,resume_blocked:E,resume_blocked_reason:v?"This entry is already active":"Another entry is active on this sheet",close_menu:J,on_resume:u}),function({is_pending:a,can_split:c,close_menu:d,on_split:e}){return void 0===e?null:(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a||!c,title:c?"Split into two entries at a time":"Only completed entries can be split",onClick:()=>{if(d(),!c)return;let a=function(){let a=window.prompt("Split at what time?","1 hour ago");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&e(a)},children:"Split entry"})})}({is_pending:o,can_split:w,close_menu:J,on_split:x}),function({is_pending:a,can_merge_previous:c,can_merge_next:d,close_menu:e,on_merge:f}){return void 0===f?null:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a||!c,title:c?"Merge with the previous entry":"No touching previous entry",onClick:()=>{e(),c&&f("previous")},children:"Merge with previous"})}),(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:a||!d,title:d?"Merge with the next entry":"No touching next entry",onClick:()=>{e(),d&&f("next")},children:"Merge with next"})})]})}({is_pending:o,can_merge_previous:y,can_merge_next:z,close_menu:J,on_merge:A}),(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),function({other_sheets:a,is_pending:c,close_menu:d,on_move:e}){return 0===a.length?(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:g,role:"menuitem",disabled:!0,children:"No other sheets"})}):a.map(a=>(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${g} pl-4`,role:"menuitem",disabled:c||a.hasActiveEntry,title:a.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{d(),e(a.name)},children:a.name})},a.name))}({other_sheets:F,is_pending:o,close_menu:J,on_move:C}),(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(j=o,k=J,l=B,(0,b.jsx)("div",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${g} text-danger`,role:"menuitem",disabled:j,onClick:()=>{k(),l()},children:"Delete"})}))]}):null]})}a.s(["EntryActionsMenu",0,h],92558);var i=a.i(93301);function j(a){return(0,i.format)(new Date(a),"MMM d, h:mm a")}var k=a.i(30354),l=a.i(50803),m=a.i(89969),n=a.i(69749);function o({entry:a,known_tags:c,is_pending:e,initial_description_override:g,in_active_panel:h=!1,times_only:i=!1,start_only:p=!1,on_save:q,on_cancel:r}){let s=(0,d.useMemo)(()=>g??(0,l.build_resume_description)(a.description,a.tags),[a.description,a.tags,g]),[t,u]=(0,d.useState)(s),[v,w]=(0,d.useState)(""),[x,y]=(0,d.useState)("");(0,d.useEffect)(()=>{u(g??(0,l.build_resume_description)(a.description,a.tags)),w(""),y("")},[a.description,a.id,a.sheetName,a.tags,g]),(0,f.use_escape_to_cancel)(r);let z=a.isActive?"still running":j(a.end??a.start),A=i?v.trim().length>0||!p&&x.trim().length>0:t.trim()!==s.trim()||v.trim().length>0||!p&&x.trim().length>0;return(0,b.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${h?"mt-2":""}`,onSubmit:a=>{a.preventDefault();let b=t.trim(),c=v.trim(),d=x.trim(),e={};i||b===s.trim()||(e.description=b),c.length>0&&(e.start=c),!p&&d.length>0&&(e.end=d),(void 0!==e.description||void 0!==e.start||void 0!==e.end)&&q(e)},children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:i?"Edit times":"Edit entry"}),i?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),(0,b.jsx)(k.TagAutocompleteInput,{id:`entry-description-${a.id}`,value:t,known_tags:c,placeholder:"e.g. crafting something @design",disabled:e,autoFocus:h,on_change:u})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,b.jsxs)("div",{className:`grid gap-2.5 max-[860px]:grid-cols-1 ${p?"grid-cols-1":"grid-cols-2"}`,children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",j(a.start)]}),(0,b.jsx)("input",{id:`entry-start-${a.id}`,className:(0,n.get_input_class_name)("compact"),value:v,onChange:a=>w(a.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:e,autoFocus:i&&h})]}),p?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",z]}),(0,b.jsx)("input",{id:`entry-end-${a.id}`,className:(0,n.get_input_class_name)("compact"),value:x,onChange:a=>y(a.target.value),placeholder:a.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:e})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"submit",className:(0,m.get_button_class_name)("primary","small"),disabled:e||!A,children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,m.get_button_class_name)("ghost","small"),disabled:e,onClick:r,children:"Cancel"})]})]})}function p({rotated:a=!1,className:c=""}){return(0,b.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${a?"rotate-90":""} ${c}`.trim(),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"m9 18 6-6-6-6"})})}a.s(["EntryEditForm",0,o],51934);var q=a.i(76767);function r({initial_text:a,is_pending:c,inline:e=!1,on_save:g,on_cancel:h}){let[i,j]=(0,d.useState)(a);(0,f.use_escape_to_cancel)(h);let k=Math.min(6,Math.max(2,a.split("\n").length)),l=e?`${(0,n.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,n.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,b.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:a=>{a.preventDefault();let b=i.trim();0!==b.length&&g(b)},children:[(0,b.jsx)("textarea",{className:l,value:i,rows:k,disabled:c,onChange:a=>j(a.target.value)}),(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsx)("button",{type:"button",className:(0,m.get_button_class_name)("ghost"),disabled:c,onClick:h,children:"Cancel"}),(0,b.jsx)("button",{type:"submit",className:(0,m.get_button_class_name)("ghost"),disabled:c||0===i.trim().length,children:"Save"})]})]})}function s(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12 20h9"}),(0,b.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function t(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M3 6h18"}),(0,b.jsx)("path",{d:"M8 6V4h8v2"}),(0,b.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,b.jsx)("path",{d:"M10 11v6"}),(0,b.jsx)("path",{d:"M14 11v6"})]})}a.s(["PencilIcon",0,s],61733);var u=a.i(20537);let v="inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55";function w({notes:a,variant:c="panel",in_bar:e=!1,is_pending:f=!1,on_edit_note:g,on_delete_note:h}){var i;let j,k,l=(0,u.use_time_format)(),[m,n]=(0,d.useState)(null),[o,q]=(0,d.useState)("panel"===c&&!e);if(0===a.length)return null;let r=[...a].sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime()),s="inline"===c,t="panel"===c&&e,v=o||null!==m,y=(i=a.length,s?`${i} ${1===i?"note":"notes"}`:`Notes (${i})`),z=(j=[s?"m-0 w-full p-0":"border-t border-accent-border pt-3.5"],e&&!s&&j.push("border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]"),t&&v?j.push("flex min-h-0 flex-1 flex-col"):t&&j.push("flex shrink-0 flex-col"),j.join(" ")),A=s?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground",B=(k=v?"mt-1.5":"hidden",s?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${k}`:t?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${k}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${k}`);return(0,b.jsxs)("section",{className:z,"aria-label":"Entry notes",children:[(0,b.jsxs)("button",{type:"button",className:A,"aria-expanded":v,onClick:a=>{a.stopPropagation(),null===m&&q(a=>!a)},children:[(0,b.jsx)(p,{rotated:v}),(0,b.jsx)("span",{children:y})]}),(0,b.jsx)("ul",{className:B,children:r.map((a,c)=>(0,b.jsx)(x,{note:a,is_inline:s,is_panel_in_bar:t,is_pending:f,is_editing:m===a.timestamp,time_format:l,on_cancel_edit:()=>n(null),on_save:b=>{var c;return c=a.timestamp,void(g?.(c,b),n(null))},on_start_edit:()=>{var b;return b=a.timestamp,void(q(!0),n(b))},on_delete:()=>{var b;m===(b=a.timestamp)&&n(null),h?.(b)},on_edit_note:g,on_delete_note:h},`${a.timestamp}-${c}`))})]})}function x({note:a,is_inline:c,is_panel_in_bar:d,is_pending:e,is_editing:f,time_format:g,on_cancel_edit:h,on_save:i,on_start_edit:j,on_delete:k,on_edit_note:l,on_delete_note:m}){let n=c?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":d?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",o=function({is_pending:a,on_start_edit:c,on_delete:d,on_edit_note:e,on_delete_note:f}){return void 0===e&&void 0===f?null:(0,b.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0===e?null:(0,b.jsx)("button",{type:"button",className:v,"aria-label":"Edit note",title:"Edit note",disabled:a,onClick:a=>{a.stopPropagation(),c()},children:(0,b.jsx)(s,{})}),void 0===f?null:(0,b.jsx)("button",{type:"button",className:`${v} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:a,onClick:a=>{a.stopPropagation(),d()},children:(0,b.jsx)(t,{})})]})}({note:a,is_pending:e,on_start_edit:j,on_delete:k,on_edit_note:l,on_delete_note:m});return f?(0,b.jsx)("li",{className:n,children:(0,b.jsx)(r,{initial_text:a.text,inline:c,is_pending:e,on_cancel:h,on_save:i})}):c?(0,b.jsx)("li",{className:n,children:(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,b.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:a.timestamp,children:(0,q.format_time)(a.timestamp,g)}),(0,b.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:a.text})]}),o]})}):(0,b.jsxs)("li",{className:n,children:[(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:a.timestamp,children:(0,q.format_time)(a.timestamp,g)}),o]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:a.text})]})}async function y(a,b){return!a||b()}function z(a){let b=a.description.trim()||"Untitled entry",c=a.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${b}" on sheet "${a.sheetName}"?${c}`,confirmLabel:"Delete",variant:"danger"}}a.s(["EntryNotesList",0,w],56720),a.s(["get_delete_entry_confirm_dialog",0,z],20872);var A=a.i(48174),B=a.i(85752);a.s(["EntryListItem",0,function({entry:a,row_key:d,is_editing:e,is_selected:f,has_selection:g,show_sheet_name:i,known_tags:j,is_pending:k,ai_revise_pending_key:l,ai_revise_draft:m,time_format:n,duration_format:p,sheets:r,merge_neighbors:s,can_revise_description_ai:t,confirm_destructive_actions:u,confirm:v,on_toggle_entry:x,on_start_edit:C,on_clear_ai_revise_draft:D,on_edit:E,on_add_note:F,on_resume:G,on_move:H,on_delete:I,on_edit_note:J,on_split:K,on_merge:L,on_revise_description_ai:M}){let N=function({entry:a,confirm_destructive_actions:b,confirm:c,on_split:d,on_merge:e,on_delete:f}){return{on_split:void 0===d?void 0:async e=>{await y(b,()=>{let b;return c((b=a.description.trim()||"Untitled entry",{title:"Split entry?",message:`Split "${b}" at "${e}" into two entries?`,confirmLabel:"Split"}))})&&d(a,e)},on_merge:void 0===e?void 0:async d=>{await y(b,()=>{let b;return c((b=a.description.trim()||"Untitled entry",{title:"Merge entries?",message:"previous"===d?`Merge "${b}" into the previous entry on sheet "${a.sheetName}"? This entry will be removed.`:`Merge the next entry into "${b}" on sheet "${a.sheetName}"? The next entry will be removed.`,confirmLabel:"Merge"}))})&&e(a,d)},on_delete:async()=>{await y(b,()=>c(z(a)))&&f(a)}}}({entry:a,confirm_destructive_actions:u,confirm:v,on_split:K,on_merge:L,on_delete:I});return e?(0,b.jsx)("li",{className:"block border-b border-panel-border py-2.5 last:border-b-0 compact:py-1.5",children:(0,b.jsx)(o,{entry:a,known_tags:j,is_pending:k,initial_description_override:m,on_cancel:()=>D(d),on_save:b=>{E(a,b),D(d)}})}):(0,b.jsxs)("li",{className:`group relative flex flex-col gap-0 border-b border-panel-border px-2 py-2.5 transition-colors duration-150 last:border-b-0 hover:bg-surface-hover compact:py-1.5 ${f?"bg-accent-soft hover:bg-accent-soft":""}`,children:[(0,b.jsxs)("div",{className:"flex w-full min-w-0 flex-col items-start gap-2.5 min-[700px]:flex-row min-[700px]:items-center compact:gap-1.5",children:[(0,b.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed","aria-label":`Select entry ${a.description||"Untitled entry"}`,children:[(0,b.jsx)(c.Checkbox,{nested:!0,className:`shrink-0 pr-1 transition-opacity duration-150 compact:pr-0.5 ${f||g?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,checked:f,disabled:k,on_change:()=>x(d)}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-semibold leading-snug compact:text-[0.9rem] compact:leading-tight",children:a.description||"Untitled entry"}),(0,b.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 text-[0.8rem] text-muted compact:mt-px compact:gap-0.5 compact:text-[0.72rem]",children:[i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:a.sheetName}),(0,b.jsx)("span",{children:"·"})]}):null,(0,b.jsxs)("span",{children:["#",a.id]}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{className:"whitespace-nowrap",children:[(0,q.format_time)(a.start,n),null===a.end?" → now":` → ${(0,q.format_time)(a.end,n)}`]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,A.format_display_tag)(a)},a))}):null]})]})]}),(0,b.jsxs)("div",{className:"flex w-full shrink-0 flex-row items-center justify-between gap-2 min-[700px]:w-auto min-[700px]:justify-end max-[860px]:flex-wrap compact:gap-1.5",children:[(0,b.jsx)("p",{className:`m-0 whitespace-nowrap text-right font-mono text-[0.9rem] text-muted compact:text-[0.8rem] ${a.isActive?"text-accent":""}`,children:(0,B.format_duration)(a.durationMs,p)}),(0,b.jsx)(h,{current_sheet_name:a.sheetName,sheets:r,is_pending:k||l===d,can_split:void 0!==K&&!a.isActive&&null!==a.end&&new Date(a.start).getTime()<new Date(a.end).getTime(),on_split:N.on_split,can_merge_previous:s?.previous===!0,can_merge_next:s?.next===!0,on_merge:N.on_merge,on_edit:()=>C(d),on_revise_description_ai:t?()=>M(a):void 0,can_revise_description_ai:t,on_add_note:b=>F(a,b),on_resume:()=>G(a),entry_is_active:a.isActive,on_move:b=>H(a,b),on_delete:N.on_delete})]})]}),a.notes.length>0?(0,b.jsx)("div",{className:"w-full pt-1 pl-[calc(0.85rem+0.5rem+0.35rem)] compact:pt-0.5 compact:pl-[calc(0.85rem+0.35rem+0.2rem)]",children:(0,b.jsx)(w,{notes:a.notes,variant:"inline",is_pending:k,on_edit_note:(b,c)=>J(a,b,c)})}):null]})}],81296),a.s(["EntryListBulkBar",0,function({selected_count:a,total_count:e,all_selected:f,some_selected:g,selected_entries:h,sheets:i,is_pending:j,on_toggle_all:k,on_move:l,on_delete:o,on_clear:p}){let[q,r]=(0,d.useState)(""),s=h.some(a=>a.isActive),t=i.filter(a=>(!s||!a.hasActiveEntry)&&h.some(b=>b.sheetName!==a.name));return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md border border-accent-border bg-accent-soft px-3 py-2",children:[(0,b.jsx)(c.Checkbox,{className:"shrink-0",checked:f,indeterminate:g,disabled:j,aria_label:f?"Deselect all entries":"Select all entries",on_change:k}),(0,b.jsxs)("p",{className:"m-0 shrink-0 text-[0.85rem] font-semibold",children:[a,(0,b.jsx)("span",{className:"text-muted",children:` of ${e} selected`})]}),(0,b.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("select",{className:`${(0,n.get_input_class_name)("compact")} min-w-32`,value:q,disabled:j||0===t.length,"aria-label":"Move to sheet",onChange:a=>r(a.target.value),children:[(0,b.jsx)("option",{value:"",children:"Move to…"}),t.map(a=>(0,b.jsx)("option",{value:a.name,children:a.name},a.name))]}),(0,b.jsx)("button",{type:"button",className:(0,m.get_button_class_name)("ghost","small"),disabled:j||0===q.trim().length||0===t.length,onClick:()=>{let a=q.trim();0!==a.length&&(l(a),r(""))},children:"Move"})]}),(0,b.jsx)("button",{type:"button",className:(0,m.get_button_class_name)("danger","small"),disabled:j,onClick:o,children:"Delete"}),(0,b.jsx)("button",{type:"button",className:`${(0,m.get_button_class_name)("ghost","small")} shrink-0`,disabled:j,"aria-label":"Clear selection",title:"Clear selection",onClick:p,children:"✕"})]})]})}],10305);var C=a.i(14945),D=a.i(79918),E=a.i(57077);function F(){return(0,d.useSyncExternalStore)(D.entry_list_sort_preference.subscribe,D.entry_list_sort_preference.get_snapshot,D.entry_list_sort_preference.get_server_snapshot)}a.s(["use_entry_list_sort",0,F],41872);let G=(0,C.get_entry_list_sort_options)();function H(a,b){return a.sheetName===b.sheetName&&!a.isActive&&!b.isActive&&null!==a.end&&null!==b.end&&new Date(a.end).getTime()===new Date(b.start).getTime()}a.s(["EntryListSortControls",0,function({is_pending:a=!1}){let c=F();return(0,b.jsxs)("fieldset",{className:"m-0 flex flex-wrap items-center gap-x-2 gap-y-1.5 border-0 p-0",children:[(0,b.jsx)("legend",{className:"sr-only",children:"Order entries by"}),(0,b.jsx)("span",{className:"shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Order by"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:G.map(d=>{let e=c===d.value;return(0,b.jsx)("button",{type:"button",className:e?(0,m.get_button_class_name)("primary","small"):(0,m.get_button_class_name)("ghost","small"),disabled:a,"aria-pressed":e,onClick:()=>(0,E.persist_ui_preference)(D.entry_list_sort_preference,d.value),children:d.label},d.value)})})]})}],99450),a.s(["get_delete_entries_confirm_dialog",0,function(a){let b=a.length,c=a.some(a=>a.isActive),d=1===b?"1 entry":`${b} entries`;return{title:1===b?"Delete entry?":"Delete entries?",message:`Permanently delete ${d}?${c?" This will stop the active timer.":""}`,confirmLabel:"Delete",variant:"danger"}}],24580),a.s(["get_mergeable_entry_neighbors",0,function(a,b){let c=[...b.filter(b=>b.sheetName===a.sheetName)].sort((a,b)=>a.start.localeCompare(b.start)),d=c.findIndex(b=>b.id===a.id&&b.sheetName===a.sheetName);if(d<0)return{previous:!1,next:!1};let e=d>0?c[d-1]:null,f=d<c.length-1?c[d+1]:null;return{previous:null!==e&&H(e,a),next:null!==f&&H(a,f)}}],8379),a.s(["omit_record_key",0,function(a,b){if(!(b in a))return a;let c={...a};return delete c[b],c}],74242)},71586,a=>{"use strict";a.s(["get_api_key_for_suggestion_provider",0,function(a,b){return"openai"===a?b.openai:"claude"===a?b.claude:"google_ai"===a?b.google_ai:""}])},88283,a=>{"use strict";a.s(["get_entry_row_key",0,function(a){return`${a.sheetName}-${a.id}`}])},54393,a=>{"use strict";var b=a.i(30004);async function c(a){if("none"===a.provider)throw Error("AI suggestion provider is disabled");let c="true"===b.debug_logging_preference.read(),d=Date.now(),e={provider:a.provider,context:a.context,notes:a.notes,debug_logging:c};c&&console.info("[ai-suggestion] client request start",{provider:a.provider,context_length:a.context.length,notes_length:a.notes.length});try{let b=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,api_key:a.api_key})});if(!b.ok){let e=await b.json().catch(()=>({}));throw c&&console.warn("[ai-suggestion] client request failed",{provider:a.provider,status:b.status,elapsed_ms:Date.now()-d,error:e.error??"Failed to suggest description"}),Error(e.error??"Failed to suggest description")}let f=await b.json(),g=f.description?.trim()??"";if(0===g.length)throw Error("Suggestion was empty");return c&&console.info("[ai-suggestion] client request success",{provider:a.provider,elapsed_ms:Date.now()-d,description_length:g.length}),g}catch(b){throw c&&console.error("[ai-suggestion] client request error",{provider:a.provider,elapsed_ms:Date.now()-d,error:b instanceof Error?b.message:String(b)}),b}}a.s(["request_ai_entry_description_suggestion",0,c])},90003,28339,73297,57377,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(64723),e=a.i(44600),f=a.i(81296),g=a.i(10305),h=a.i(99450),i=a.i(24580),j=a.i(85752),k=a.i(8379),l=a.i(13175),m=a.i(74242),n=a.i(71586),o=a.i(88283),p=a.i(98831),q=a.i(40420),r=a.i(6962),s=a.i(45273),t=a.i(54393),u=a.i(32297);function v(){return"true"===(0,c.useSyncExternalStore)(u.confirm_destructive_actions_preference.subscribe,u.confirm_destructive_actions_preference.get_snapshot,u.confirm_destructive_actions_preference.get_server_snapshot)}a.s(["use_confirm_destructive_actions",0,v],28339);var w=a.i(96359),x=a.i(65162),y=a.i(20537);async function z(a,b){let c=await fetch(a,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error??"Request failed");return await c.json()}a.s(["EntryList",0,function({title:a,entries:u,merge_context_entries:z,sheets:A,known_tags:B,total_ms:C,empty_message:D,is_pending:E,show_sheet_name:F=!0,header_extra:G,on_delete:H,on_edit:I,on_move:J,on_move_many:K,on_delete_many:L,on_edit_note:M,on_add_note:N,on_resume:O,on_split:P,on_merge:Q}){let{confirm:R}=(0,e.use_confirm_dialog)(),S=v(),T=(0,y.use_time_format)(),U=(0,x.use_duration_format)(),[V,W]=(0,c.useState)(null),[X,Y]=(0,c.useState)(()=>new Set),[Z,$]=(0,c.useState)(null),[_,aa]=(0,c.useState)(null),[ab,ac]=(0,c.useState)({}),ad=(0,c.useSyncExternalStore)(q.entry_suggestion_provider_preference.subscribe,q.entry_suggestion_provider_preference.get_snapshot,q.entry_suggestion_provider_preference.get_server_snapshot),ae=(0,c.useSyncExternalStore)(s.openai_api_key_preference.subscribe,s.openai_api_key_preference.get_snapshot,s.openai_api_key_preference.get_server_snapshot),af=(0,c.useSyncExternalStore)(p.claude_api_key_preference.subscribe,p.claude_api_key_preference.get_snapshot,p.claude_api_key_preference.get_server_snapshot),ag=(0,c.useSyncExternalStore)(r.google_ai_api_key_preference.subscribe,r.google_ai_api_key_preference.get_snapshot,r.google_ai_api_key_preference.get_server_snapshot),ah=(0,n.get_api_key_for_suggestion_provider)(ad,{openai:ae,claude:af,google_ai:ag}),ai=(0,c.useMemo)(()=>{let a=z??u,b=new Map;for(let c of u){let d=(0,o.get_entry_row_key)(c);b.set(d,(0,k.get_mergeable_entry_neighbors)(c,a))}return b},[u,z]),aj="none"!==ad&&ah.trim().length>0,ak=u.map(a=>(0,o.get_entry_row_key)(a)),al=u.filter(a=>X.has((0,o.get_entry_row_key)(a))),am=u.length>0&&al.length===u.length,an=al.length>0&&al.length<u.length;(0,c.useEffect)(()=>{let a=new Set(ak);Y(b=>{let c=new Set([...b].filter(b=>a.has(b)));return c.size===b.size?b:c})},[ak]);let ao=a=>{Y(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},ap=()=>{am?Y(new Set):Y(new Set(ak))},aq=()=>{Y(new Set)},ar=async()=>{0===al.length||(!S||await R((0,i.get_delete_entries_confirm_dialog)(al)))&&(L(al),aq())},as=al.length>0,at=async a=>{if(!aj)return;let b=(0,o.get_entry_row_key)(a);$(b),aa(null);try{let c=a.notes.map(a=>a.text).join("\n"),d=await (0,t.request_ai_entry_description_suggestion)({provider:ad,api_key:ah,context:a.description,notes:c});ac(a=>({...a,[b]:d})),W(b)}catch(a){aa(a instanceof Error?a.message:String(a))}finally{$(null)}};return(0,w.use_escape_to_cancel)(aq,as&&null===V),(0,b.jsxs)("section",{className:"min-w-0",children:[(0,b.jsx)("header",{className:"mb-3 flex flex-col gap-2 border-b border-panel-border pb-2.5 compact:mb-2 compact:pb-1.5",children:as?(0,b.jsx)(g.EntryListBulkBar,{selected_count:al.length,total_count:u.length,all_selected:am,some_selected:an,selected_entries:al,sheets:A,is_pending:E,on_toggle_all:ap,on_move:a=>{K(al,a),aq()},on_delete:()=>void ar(),on_clear:aq}):(0,b.jsxs)(b.Fragment,{children:[G,(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[u.length>0?(0,b.jsx)(d.Checkbox,{className:"shrink-0",checked:am,indeterminate:an,disabled:E,aria_label:"Select all entries",on_change:ap}):null,(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:a}),(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:(0,l.format_entry_count_label)(u.length)})]}),(0,b.jsxs)("p",{className:"m-0 font-mono text-[0.85rem] text-muted max-[640px]:w-full",children:[(0,j.format_duration)(C,U)," total"]})]}),(0,b.jsx)(h.EntryListSortControls,{is_pending:E}),null===_?null:(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:_})]})}),0===u.length?(0,b.jsx)("p",{className:"m-0 text-muted",children:D}):(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col p-0",children:u.map(a=>{let c=(0,o.get_entry_row_key)(a);return(0,b.jsx)(f.EntryListItem,{entry:a,row_key:c,is_editing:V===c,is_selected:X.has(c),has_selection:as,show_sheet_name:F,known_tags:B,is_pending:E,ai_revise_pending_key:Z,ai_revise_draft:ab[c],time_format:T,duration_format:U,sheets:A,merge_neighbors:ai.get(c),can_revise_description_ai:aj,confirm_destructive_actions:S,confirm:R,on_toggle_entry:ao,on_start_edit:a=>{W(a),ac(b=>(0,m.omit_record_key)(b,a))},on_clear_ai_revise_draft:a=>{W(null),ac(b=>(0,m.omit_record_key)(b,a))},on_edit:I,on_add_note:N,on_resume:O,on_move:J,on_delete:H,on_edit_note:M,on_split:P,on_merge:Q,on_revise_description_ai:a=>{at(a)}},c)})})]})}],90003),a.s(["delete_tracker_action",0,z],73297);var A=a.i(71034);let B=new Set(["/api/note"]);async function C(a,b){let c={method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)},d=await fetch(a,c);if(!d.ok){var e,f;let b,g=(await d.json()).error??"Request failed";if(e=a,f=g,B.has(e)&&((b=f.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(d=await fetch(a,c)).ok)throw Error((await d.json()).error??g)}else throw Error(g)}let g=await d.json();return(0,A.notify_tracker_db_cloud_sync)(a,b),g}a.s(["patch_tracker_action",0,C],57377)}];
2
+
3
+ //# sourceMappingURL=_0p5_u-y._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:a=>a.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:a=>a.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},44600,a=>{"use strict";var b=a.i(34542),c=a.i(13964),d=a.i(75215);a.s(["use_confirm_dialog",0,function(){let a=(0,b.useContext)(c.ConfirmDialogContext);if(null!==a)return a;let e=(0,d.get_registered_confirm_dialog)();if(null!==e)return{confirm:e};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(48174),e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=(0,d.format_display_tag)(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",role:"combobox",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:(0,d.format_display_tag)(a)})},a))}):null]})}],30354)},85930,a=>{"use strict";var b=a.i(39752),c=a.i(85393),d=a.i(98790);a.s(["SettingsPageLayout",0,function({breadcrumb:a,title:e,description:f,children:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.TrackerTopbar,{breadcrumb:a}),(0,b.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,b.jsx)(c.SettingsNav,{})]}),(0,b.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,b.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:e}),void 0!==f?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:f}):null]}),g]})]})]})}])},53372,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(44600),e=a.i(16229),f=a.i(85930),g=a.i(30354),h=a.i(48174),i=a.i(89969),j=a.i(69749);function k(a,b,c){let d=a.map(a=>(0,h.format_display_tag)(a)).join(", "),e=(0,h.format_display_tag)(b),f=1===c?"1 entry will be updated.":`${c} entries will be updated.`;return{title:"Merge tags?",message:`Merge ${d} into ${e}? ${f}`,confirmLabel:"Merge tags",variant:"danger"}}var l=a.i(59659);a.s(["TagManagementView",0,function({initial_tags:a}){let{confirm:m}=(0,d.use_confirm_dialog)(),[n,o]=(0,c.useState)(a),[p,q]=(0,c.useState)(()=>new Set),[r,s]=(0,c.useState)({}),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(!1),B=(0,c.useMemo)(()=>n.map(a=>a.name),[n]),C=n.filter(a=>p.has(a.name)).reduce((a,b)=>a+b.entryCount,0),D=async a=>{let b=await fetch("/api/tags",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok)throw Error((await b.json()).error??"Tag update failed");let c=await b.json();o(c.tags),q(new Set),y(1===c.entries_updated?"Updated 1 entry.":`Updated ${c.entries_updated} entries.`),(0,l.push_tracker_db_cloud_after_change)()},E=async a=>{let b=r[a]?.trim()??"";if(0===b.length)return void w("Enter a new tag name.");let c=n.find(b=>b.name===a);if(void 0===c)return;let d=n.find(a=>(0,h.format_display_tag)(a.name)===(0,h.format_display_tag)(b)),f=void 0!==d&&d.name!==a?c.entryCount+d.entryCount:c.entryCount;if(await m(k([a],b,f))){A(!0),w(null),y(null);try{await D({action:"rename",fromTag:a,toTag:b}),s(b=>{let c={...b};return delete c[a],c})}catch(a){w((0,e.message_from_unknown_error)(a,"Tag rename failed"))}finally{A(!1)}}},F=async()=>{let a=[...p];if(a.length<2)return void w("Select at least two tags to merge.");if(0===t.trim().length)return void w("Enter a target tag for the merge.");if(await m(k(a,t,C))){A(!0),w(null),y(null);try{await D({action:"merge",sourceTags:a,targetTag:t}),u("")}catch(a){w((0,e.message_from_unknown_error)(a,"Tag merge failed"))}finally{A(!1)}}};return(0,b.jsxs)(f.SettingsPageLayout,{breadcrumb:{current:"Tag management",parent:{label:"Settings",href:"/settings"}},title:"Tag management",description:"Rename or merge tags across every entry in your database.",children:[(0,b.jsxs)("section",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Merge tags"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.8rem] leading-snug text-muted",children:"Select two or more tags below, then choose the tag they should become."}),(0,b.jsxs)("label",{className:"mt-3 flex flex-col gap-1 text-[0.82rem] text-muted",children:["Target tag",(0,b.jsx)(g.TagAutocompleteInput,{id:"merge-target-tag",value:t,known_tags:B,placeholder:"e.g. @project",disabled:z,on_change:u})]}),(0,b.jsxs)("button",{type:"button",className:`${(0,i.get_button_class_name)("primary","small")} mt-3`,disabled:z||p.size<2,onClick:()=>void F(),children:["Merge ",p.size," tags"]})]}),0===n.length?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-muted",children:"No tags yet. Add @tags when you check in to an entry."}):(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Tags",children:n.map(a=>(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel px-3.5 py-2.5 shadow-sm",children:(0,b.jsxs)("form",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",onSubmit:b=>{b.preventDefault(),E(a.name)},children:[(0,b.jsx)("input",{type:"checkbox",className:"shrink-0",checked:p.has(a.name),disabled:z,"aria-label":`Select ${(0,h.format_display_tag)(a.name)}`,onChange:()=>{var b;return b=a.name,void q(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[(0,b.jsx)("span",{className:"font-semibold leading-tight",children:(0,h.format_display_tag)(a.name)}),(0,b.jsxs)("span",{className:"text-[0.82rem] text-muted",children:[a.entryCount," ",1===a.entryCount?"entry":"entries"]})]}),(0,b.jsxs)("div",{className:"ml-auto flex min-w-[min(100%,14rem)] flex-1 basis-56 items-center justify-end gap-2 sm:max-w-xs",children:[(0,b.jsx)("input",{className:(0,j.get_input_class_name)("compact"),value:r[a.name]??"",placeholder:"Rename to…","aria-label":`Rename ${(0,h.format_display_tag)(a.name)}`,disabled:z,onChange:b=>s(c=>({...c,[a.name]:b.target.value}))}),(0,b.jsx)("button",{type:"submit",className:`${(0,i.get_button_class_name)("ghost","small")} shrink-0`,disabled:z||(r[a.name]?.trim().length??0)===0,children:"Rename"})]})]})},a.name))}),null===x?null:(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-accent",children:x}),null===v?null:(0,b.jsx)("p",{className:"m-0 text-[0.9rem] text-danger",children:v})]})}],53372)}];
2
+
3
+ //# sourceMappingURL=_0q214m8._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
1
+ module.exports=[41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","search","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
2
2
 
3
3
  //# sourceMappingURL=_0q~8_bm._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a}];function f(){return(0,b.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},44404,65020,84089,22592,a=>{"use strict";let b=new Set(a.i(75049).topbar_quick_action_ids),c=["today","search","reporting","pomodoro"];a.s(["parse_topbar_quick_actions",0,function(a){try{let d=JSON.parse(a);if(!Array.isArray(d))return c;let e=d.filter(a=>"string"==typeof a&&b.has(a));return Array.from(new Set(e))}catch{return c}}],44404);var d=a.i(52345),e=a.i(70827);let f=(0,d.create_ui_preference_store)({storage_key:e.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:e.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function g(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,f],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return g()}],84089);var h=a.i(81764),i=a.i(7048),j=a.i(29698),k=a.i(44103),l=a.i(28958),m=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===g()?"light":"dark";(0,h.apply_theme)(a),(0,m.write_stored_theme)(a),j.theme_mode_preference.write(a),(0,l.write_document_preference_cookies)({theme_mode:a,theme:a}),j.theme_mode_preference.notify(),(0,k.notify_theme_subscribers)(),(0,i.notify_settings_saved)()}],22592)},79334,73948,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(44404),j=a.i(11937),k=a.i(65020),l=a.i(26749),m=a.i(54212),n=a.i(74365),o=a.i(84089),p=a.i(44103),q=a.i(22592),r=a.i(75049),s=a.i(96359),t=a.i(26846);let u="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),x=(0,d.usePathname)()??"/",y=(0,e.useSyncExternalStore)(p.subscribe_theme,o.get_theme_snapshot,o.get_theme_server_snapshot),z=(0,e.useSyncExternalStore)(k.cloud_sync_enabled_preference.subscribe,k.cloud_sync_enabled_preference.get_snapshot,k.cloud_sync_enabled_preference.get_server_snapshot),A=(0,e.useSyncExternalStore)(m.tracker_shortcut_map_preference.subscribe,m.tracker_shortcut_map_preference.get_snapshot,m.tracker_shortcut_map_preference.get_server_snapshot),B=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),C=(0,j.parse_tracker_shortcut_map)(A),D=new Set((0,i.parse_topbar_quick_actions)(B)),E=r.topbar_quick_action_ids.filter(a=>!D.has(a)),F=Array.from(new Set([...Array.from(w),...E])),{email:G,is_configured:H,is_pending:I,sign_out:J}=(0,t.use_supabase_auth_session)(),[K,L]=(0,e.useState)(!1),M=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!K)return;let a=a=>{null===M.current||M.current.contains(a.target)||L(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[K]);let N=()=>{L(!1)};return(0,s.use_escape_to_cancel)(N,K),(0,b.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":K,"aria-haspopup":"menu",onClick:()=>L(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),K?(0,b.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[H&&null!==G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:G,children:G})}):null,F.map(a=>{let d=v[a];return(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:d.href,className:u,role:"menuitem",onClick:N,children:d.label})},a)}),H?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitemcheckbox","aria-checked":"true"===z,onClick:()=>{let a="true"===z?"false":"true";k.cloud_sync_enabled_preference.write(a),k.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==G&&(0,n.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===z?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===z?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),(0,q.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===y?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===y?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{let a;N(),a=C.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:a,shiftKey:"?"===a,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===G?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:u,role:"menuitem",onClick:()=>{N(),a.push((0,g.build_auth_page_href)("sign_in",x))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${u} text-danger`,role:"menuitem",disabled:I,onClick:()=>{N(),J()},children:I?"Signing out…":"Sign out"})})]}):null]}):null]})}],79334);let x=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];a.s(["TopbarQuickActions",0,function(){let a=(0,d.usePathname)()??"/",f=(0,e.useSyncExternalStore)(l.topbar_quick_actions_preference.subscribe,l.topbar_quick_actions_preference.get_snapshot,l.topbar_quick_actions_preference.get_server_snapshot),g=(0,e.useMemo)(()=>(0,i.parse_topbar_quick_actions)(f),[f]);if(0===g.length)return null;let h=x.filter(a=>g.includes(a.id));return 0===h.length?null:(0,b.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:h.map(d=>{let e=a.startsWith(d.href);return(0,b.jsx)(c.default,{href:d.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":e?"page":void 0,children:d.label},d.id)})})}],73948)},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(73948),g=a.i(62988),h=a.i(82508),i=a.i(75654);function j(){let a=((0,h.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(g.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(i.SettingsIcon,{})})}function k({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,b.jsx)("li",{children:(0,b.jsx)(g.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(g.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,b.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(k,{current:a.current,parent:a.parent})}):null,(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(f.TopbarQuickActions,{}),(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(j,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
2
+
3
+ //# sourceMappingURL=_0rv4ope._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(48174),e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=(0,d.format_display_tag)(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",role:"combobox",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:(0,d.format_display_tag)(a)})},a))}):null]})}],30354)},64617,a=>{"use strict";a.s(["POMODORO_DEFAULT_SETTINGS",0,{work_minutes:25,short_break_minutes:5,long_break_minutes:15,rounds_before_long_break:4,auto_start_next_phase:!0,check_in_on_work_start:!0,work_entry_description:"Pomodoro focus"},"POMODORO_DEFAULT_STATE",0,{phase:"work",status:"idle",completed_work_sessions:0,deadline_at_ms:null,paused_remaining_ms:null},"POMODORO_STORAGE_KEY",0,"super-time-tracker-pomodoro"])},78537,a=>{"use strict";var b=a.i(97917);a.s(["notify_desktop",0,function(a){(0,b.notify_in_app)({title:a.title,body:a.body})},"supports_desktop_notifications",0,function(){return!1}])},18734,a=>{"use strict";a.s(["clear_pomodoro_task_entry_marker",0,function(){},"is_pomodoro_task_entry",0,function(a){return!1},"mark_pomodoro_task_entry",0,function(a){}])},54015,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(34542),e=a.i(75654),f=a.i(30354),g=a.i(98790),h=a.i(89969),i=a.i(78537),j=a.i(18734),k=a.i(19702),l=a.i(64617);a.s(["PomodoroView",0,function({known_tags:a}){let[m,n]=(0,d.useState)(l.POMODORO_DEFAULT_SETTINGS),[o,p]=(0,d.useState)(l.POMODORO_DEFAULT_STATE),[q,r]=(0,d.useState)(()=>Date.now()),[s,t]=(0,d.useState)(!1),[u,v]=(0,d.useState)(null),[w,x]=(0,d.useState)(!1),y=(0,d.useRef)(null),z=(0,d.useRef)(l.POMODORO_DEFAULT_SETTINGS),A=(0,d.useRef)(l.POMODORO_DEFAULT_STATE),B=(0,d.useCallback)((a,b)=>{(0,i.notify_desktop)({title:a,body:b,tag:"pomodoro-phase-event"})},[]);(0,d.useEffect)(()=>{},[]),(0,d.useEffect)(()=>{z.current=m},[m]),(0,d.useEffect)(()=>{A.current=o},[o]);let C=(0,d.useCallback)((a,b)=>{},[]),D=(0,d.useCallback)(a=>{p(b=>{let c="function"==typeof a?a(b):a;return A.current=c,C(z.current,c),c})},[C]);(0,d.useEffect)(()=>{},[s,C,m,o]),(0,d.useEffect)(()=>{},[C]),(0,d.useEffect)(()=>{if("running"!==o.status)return;let a=window.setInterval(()=>{r(Date.now())},1e3);return()=>{window.clearInterval(a)}},[o.status,o.deadline_at_ms]);let E=(0,d.useCallback)(a=>{switch(a){case"work":return 6e4*m.work_minutes;case"short_break":return 6e4*m.short_break_minutes;case"long_break":return 6e4*m.long_break_minutes}},[m.long_break_minutes,m.short_break_minutes,m.work_minutes]),F=(0,d.useCallback)(async()=>{let a=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error??"Failed to read tracker state");let b=await a.json().catch(()=>null);return b?.runningEntry!==null&&b?.runningEntry!==void 0},[]),G=(0,d.useCallback)(async()=>{try{x(await F())}catch{}},[F]),H=async()=>{let a=m.work_entry_description.trim();if(0===a.length)return;if(await F())return void x(!0);let b=await fetch("/api/in",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,sheetName:function(){try{let a=window.localStorage.getItem(k.ACTIVE_SHEET_STORAGE_KEY)?.trim()??"";return a.length>0?a:null}catch{return null}}()??void 0})});if(b.ok){let a=await b.json().catch(()=>null),c=a?.activeEntry;null!=c&&(0,j.mark_pomodoro_task_entry)({id:c.id,sheetName:c.sheetName}),x(!0);return}throw Error((await b.json().catch(()=>({}))).error??"Failed to start tracker entry for Pomodoro")},I=async()=>{let a=await fetch("/api/out",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){(0,j.clear_pomodoro_task_entry_marker)(),x(!1);return}let b=(await a.json().catch(()=>({}))).error??"Failed to check out active tracker entry";if(!b.includes("No active entry"))throw Error(b)},J=async()=>{v(null);try{let a=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(b.error??"Failed to read tracker state")}let b=await a.json().catch(()=>null),c=b?.runningEntry;if(c?.start===void 0)throw Error("No active task found to start from");let d=Date.parse(c.start);if(!Number.isFinite(d))throw Error("Active task start time is invalid");let e=Math.max(0,Date.now()-d),f=E(o.phase),g=Math.max(0,f-e);D(a=>({...a,status:"running",deadline_at_ms:Date.now()+g,paused_remaining_ms:null}))}catch(a){v(a instanceof Error?a.message:String(a))}},K=(0,d.useCallback)(()=>{let a="work"===o.phase,b=o.completed_work_sessions+1;if(D(a=>{let b="work"===a.phase?a.completed_work_sessions+1:a.completed_work_sessions,c="work"===a.phase?b%m.rounds_before_long_break==0?"long_break":"short_break":"work",d=E(c);return m.auto_start_next_phase?{phase:c,status:"running",completed_work_sessions:b,deadline_at_ms:Date.now()+d,paused_remaining_ms:null}:{phase:c,status:"idle",completed_work_sessions:b,deadline_at_ms:null,paused_remaining_ms:null}}),a&&B("Pomodoro focus session complete",`Completed focus session ${b}.`),m.auto_start_next_phase){let a="work"===o.phase?o.completed_work_sessions%m.rounds_before_long_break==m.rounds_before_long_break-1?"long break":"short break":"focus";B("work"===o.phase?"Pomodoro break started":"Pomodoro focus started",`Auto-started ${a} timer.`)}},[E,B,D,o.completed_work_sessions,o.phase,m.auto_start_next_phase,m.rounds_before_long_break]);(0,d.useEffect)(()=>{let a=window.setTimeout(()=>{G()},0);return()=>{window.clearTimeout(a)}},[G]),(0,d.useEffect)(()=>{let a=window.setInterval(()=>{G()},5e3);return()=>{window.clearInterval(a)}},[G]),(0,d.useEffect)(()=>{if("running"!==o.status||null===o.deadline_at_ms||q<o.deadline_at_ms)return;let a=window.setTimeout(()=>{K()},0);return()=>{window.clearTimeout(a)}},[K,q,o.deadline_at_ms,o.status]);let L=E(o.phase),M="running"===o.status&&null!==o.deadline_at_ms?Math.max(0,o.deadline_at_ms-q):"paused"===o.status?o.paused_remaining_ms??L:L,N=Math.min(100,Math.max(0,(L-M)/L*100)),O=`${Math.floor(M/6e4).toString().padStart(2,"0")}:${Math.floor(M%6e4/1e3).toString().padStart(2,"0")}`,P={work:"Focus",short_break:"Short break",long_break:"Long break"}[o.phase],Q="work"===o.phase?o.completed_work_sessions%m.rounds_before_long_break==m.rounds_before_long_break-1?"long_break":"short_break":"work",R="work"===o.phase?`${o.completed_work_sessions+1} / ${m.rounds_before_long_break} focus rounds`:"short_break"===o.phase?"Recover before the next focus block.":"Take the long break before the next round.",S="running"===o.status?"Pause":"paused"===o.status?"Resume":"Start",T=`${O} \xb7 ${P} \xb7 Pomodoro`;return(0,d.useEffect)(()=>{if("u">typeof document)return null===y.current&&(y.current=document.title),()=>{null!==y.current&&(document.title=y.current)}},[]),(0,d.useEffect)(()=>{"u">typeof document&&(document.title=T)},[T]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.TrackerTopbar,{breadcrumb:{current:"Pomodoro"}}),(0,b.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col gap-6 px-5 pb-12 pt-6",children:[(0,b.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Pomodoro"}),(0,b.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:"Keep a simple focus cycle running alongside your time tracker."})]}),(0,b.jsx)(c.default,{href:"/settings/pomodoro",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Pomodoro settings",title:"Pomodoro settings",children:(0,b.jsx)(e.SettingsIcon,{})})]}),(0,b.jsx)("section",{className:"rounded-md border border-panel-border bg-panel p-5 shadow-sm",children:(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Current phase"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[1.3rem] font-semibold",children:P}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.88rem] leading-relaxed text-muted",children:R})]}),(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Next phase"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.95rem] font-semibold text-accent",children:{work:"Focus",short_break:"Short break",long_break:"Long break"}[Q]}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.84rem] text-muted",children:m.auto_start_next_phase?"Auto-start enabled":"Waiting for you"})]})]}),(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-background px-4 py-5 text-center",children:[(0,b.jsx)("p",{className:"m-0 font-mono text-[3rem] font-semibold tracking-tight text-accent","aria-live":"polite",children:O}),(0,b.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-surface-strong",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-200",style:{width:`${N}%`}})}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 text-[0.82rem] text-muted",children:[(0,b.jsxs)("span",{children:[o.completed_work_sessions," focus sessions done"]}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{children:"running"===o.status?"Running":"paused"===o.status?"Paused":"Idle"})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("primary"),onClick:()=>{let a,b,c;"running"===o.status?(v(null),D(a=>"running"!==a.status||null===a.deadline_at_ms?a:{...a,status:"paused",deadline_at_ms:null,paused_remaining_ms:Math.max(0,a.deadline_at_ms-Date.now())}),I().catch(a=>{v(a instanceof Error?a.message:String(a))})):(v(null),D(a=>{let b="paused"===a.status&&null!==a.paused_remaining_ms?a.paused_remaining_ms:E(a.phase);return{...a,status:"running",deadline_at_ms:Date.now()+b,paused_remaining_ms:null}}),a="paused"===o.status,b="short_break"===o.phase||"long_break"===o.phase,c=a||"running"!==o.status&&"work"===o.phase&&m.check_in_on_work_start,a||"running"===o.status||B(b?"Pomodoro break started":"Pomodoro focus started",b?"Break timer is running.":"Focus timer is running."),c&&H().catch(a=>{v(a instanceof Error?a.message:String(a))}))},children:S}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),onClick:K,children:"Skip phase"}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),onClick:()=>{D(l.POMODORO_DEFAULT_STATE),r(Date.now())},children:"Reset"}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),disabled:"running"===o.status,onClick:()=>{J()},children:"Start from active task start time"})]}),null!==u?(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:u}):null,m.check_in_on_work_start&&!w?(0,b.jsx)("div",{className:"grid gap-2 rounded-md border border-panel-border bg-background p-3 md:grid-cols-2",children:(0,b.jsxs)("label",{className:"flex flex-col gap-1.5 md:col-span-2",children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold text-muted",children:"New entry description (supports @tags)"}),(0,b.jsx)(f.TagAutocompleteInput,{id:"pomodoro-work-entry-description",value:m.work_entry_description,known_tags:a,placeholder:"Pomodoro focus @pomodoro @focus",on_change:a=>{n(b=>({...b,work_entry_description:a}))}})]})}):null]})})]})]})}],54015)}];
2
+
3
+ //# sourceMappingURL=_0s_1q6-._.js.map