super-time-tracker-ui 0.1.38 → 0.1.40

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 (223) hide show
  1. package/README.md +88 -88
  2. package/bin/stt-ui.js +220 -220
  3. package/dist/standalone/next-output/BUILD_ID +1 -1
  4. package/dist/standalone/next-output/build-manifest.json +5 -5
  5. package/dist/standalone/next-output/server/app/_global-error/page/build-manifest.json +2 -2
  6. package/dist/standalone/next-output/server/app/_global-error/page.js +1 -1
  7. package/dist/standalone/next-output/server/app/_global-error/page.js.nft.json +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
  10. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/dist/standalone/next-output/server/app/_not-found/page/build-manifest.json +2 -2
  16. package/dist/standalone/next-output/server/app/_not-found/page.js +1 -1
  17. package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
  18. package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/standalone/next-output/server/app/api/auth/signout/route.js +1 -1
  20. package/dist/standalone/next-output/server/app/api/auth/signout/route.js.nft.json +1 -1
  21. package/dist/standalone/next-output/server/app/api/note/delete/route.js +2 -2
  22. package/dist/standalone/next-output/server/app/api/note/delete/route.js.nft.json +1 -1
  23. package/dist/standalone/next-output/server/app/api/note/route.js +1 -1
  24. package/dist/standalone/next-output/server/app/api/note/route.js.nft.json +1 -1
  25. package/dist/standalone/next-output/server/app/api/sync/import/route.js +1 -1
  26. package/dist/standalone/next-output/server/app/api/sync/import/route.js.nft.json +1 -1
  27. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js +1 -1
  28. package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js.nft.json +1 -1
  29. package/dist/standalone/next-output/server/app/api/sync/pull/route.js +1 -1
  30. package/dist/standalone/next-output/server/app/api/sync/pull/route.js.nft.json +1 -1
  31. package/dist/standalone/next-output/server/app/api/sync/push/route.js +1 -1
  32. package/dist/standalone/next-output/server/app/api/sync/push/route.js.nft.json +1 -1
  33. package/dist/standalone/next-output/server/app/auth/callback/route.js +1 -1
  34. package/dist/standalone/next-output/server/app/auth/callback/route.js.nft.json +1 -1
  35. package/dist/standalone/next-output/server/app/favicon.ico/route.js +1 -1
  36. package/dist/standalone/next-output/server/app/favicon.ico/route.js.nft.json +1 -1
  37. package/dist/standalone/next-output/server/app/login/page/build-manifest.json +2 -2
  38. package/dist/standalone/next-output/server/app/login/page.js +1 -1
  39. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  40. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  41. package/dist/standalone/next-output/server/app/offline/page/build-manifest.json +2 -2
  42. package/dist/standalone/next-output/server/app/offline/page.js +1 -1
  43. package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
  44. package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
  45. package/dist/standalone/next-output/server/app/page/build-manifest.json +2 -2
  46. package/dist/standalone/next-output/server/app/page/react-loadable-manifest.json +1 -1
  47. package/dist/standalone/next-output/server/app/page.js +1 -1
  48. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  49. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  50. package/dist/standalone/next-output/server/app/pomodoro/page/build-manifest.json +2 -2
  51. package/dist/standalone/next-output/server/app/pomodoro/page.js +1 -1
  52. package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
  53. package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
  54. package/dist/standalone/next-output/server/app/register/page/build-manifest.json +2 -2
  55. package/dist/standalone/next-output/server/app/register/page.js +1 -1
  56. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
  57. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
  58. package/dist/standalone/next-output/server/app/reporting/page/build-manifest.json +2 -2
  59. package/dist/standalone/next-output/server/app/reporting/page.js +1 -1
  60. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  61. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  62. package/dist/standalone/next-output/server/app/search/page/build-manifest.json +2 -2
  63. package/dist/standalone/next-output/server/app/search/page.js +1 -1
  64. package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
  65. package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
  66. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page/build-manifest.json +2 -2
  67. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js +1 -1
  68. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
  69. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
  70. package/dist/standalone/next-output/server/app/settings/cloud-sync/page/build-manifest.json +2 -2
  71. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js +1 -1
  72. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
  73. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
  74. package/dist/standalone/next-output/server/app/settings/data/page/build-manifest.json +2 -2
  75. package/dist/standalone/next-output/server/app/settings/data/page.js +1 -1
  76. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  77. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  78. package/dist/standalone/next-output/server/app/settings/display/page/build-manifest.json +2 -2
  79. package/dist/standalone/next-output/server/app/settings/display/page.js +1 -1
  80. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  81. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  82. package/dist/standalone/next-output/server/app/settings/goals/page/build-manifest.json +2 -2
  83. package/dist/standalone/next-output/server/app/settings/goals/page.js +1 -1
  84. package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
  85. package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
  86. package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +2 -2
  87. package/dist/standalone/next-output/server/app/settings/notifications/page.js +1 -1
  88. package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
  89. package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
  90. package/dist/standalone/next-output/server/app/settings/page/build-manifest.json +2 -2
  91. package/dist/standalone/next-output/server/app/settings/page.js +1 -1
  92. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  93. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  94. package/dist/standalone/next-output/server/app/settings/pomodoro/page/build-manifest.json +2 -2
  95. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js +1 -1
  96. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
  97. package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
  98. package/dist/standalone/next-output/server/app/settings/quick-actions/page/build-manifest.json +2 -2
  99. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js +1 -1
  100. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
  101. package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
  102. package/dist/standalone/next-output/server/app/settings/tags/page/build-manifest.json +2 -2
  103. package/dist/standalone/next-output/server/app/settings/tags/page.js +1 -1
  104. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  105. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  106. package/dist/standalone/next-output/server/app/sheets/page/build-manifest.json +2 -2
  107. package/dist/standalone/next-output/server/app/sheets/page.js +1 -1
  108. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
  109. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
  110. package/dist/standalone/next-output/server/app/today/page/build-manifest.json +2 -2
  111. package/dist/standalone/next-output/server/app/today/page.js +1 -1
  112. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
  113. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
  114. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0_l72r2.js +1 -1
  115. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0a439d6.js +1 -1
  116. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0b8a-p3.js +1 -1
  117. package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0e-v8-t.js +1 -1
  118. package/dist/standalone/next-output/server/chunks/[externals]__11vad82._.js +3 -0
  119. package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0sqmaqd._.js +3 -0
  120. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0-taz6n._.js +3 -0
  121. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00~g.6x._.js +3 -0
  122. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__057h~1v._.js +1 -1
  123. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06666_b._.js +1 -1
  124. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06h__d_._.js +1 -1
  125. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06r8z50._.js +1 -1
  126. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06wq380._.js +1 -1
  127. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_b50~5._.js +1 -1
  128. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0eruj62._.js +1 -1
  129. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0fc0f.7._.js +1 -1
  130. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g2.yrs._.js +1 -1
  131. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g4.zxh._.js +1 -1
  132. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0hasizg._.js +1 -1
  133. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jlfmb8._.js +3 -0
  134. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m-c-3t._.js +1 -1
  135. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mft_cy._.js +78 -0
  136. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m~u8g4._.js +1 -1
  137. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nx-vwn._.js +1 -1
  138. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0o-u0o6._.js +3 -0
  139. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0pzvh8l._.js +1 -1
  140. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0rl2w7-._.js +1 -1
  141. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wdwx.8._.js +3 -0
  142. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wj1pxh._.js +1 -1
  143. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0y.-jfw._.js +3 -0
  144. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0yqw7pu._.js +1 -1
  145. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0~22xdv._.js +3 -0
  146. package/dist/standalone/next-output/server/chunks/_00h8h72._.js +1 -1
  147. package/dist/standalone/next-output/server/chunks/_01k5l~6._.js +1 -1
  148. package/dist/standalone/next-output/server/chunks/_01m8bky._.js +3 -0
  149. package/dist/standalone/next-output/server/chunks/_08yfru9._.js +1 -1
  150. package/dist/standalone/next-output/server/chunks/_0a9455x._.js +3 -0
  151. package/dist/standalone/next-output/server/chunks/_0glc6qw._.js +1 -1
  152. package/dist/standalone/next-output/server/chunks/_0k9xfs_._.js +1 -1
  153. package/dist/standalone/next-output/server/chunks/_0qc0j~f._.js +1 -1
  154. package/dist/standalone/next-output/server/chunks/_0s9bykd._.js +1 -1
  155. package/dist/standalone/next-output/server/chunks/_0ykasjm._.js +1 -1
  156. package/dist/standalone/next-output/server/chunks/ssr/0prs_next_dist_0gm.sou._.js +1 -1
  157. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0xgtqus._.js → [root-of-the-server]__03~l7zo._.js} +2 -2
  158. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__07dg5mm._.js +1 -1
  159. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__08n6l..._.js +1 -1
  160. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0f0-17f._.js +1 -1
  161. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0i8nvpz._.js +1 -1
  162. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0kp4i1o._.js +1 -1
  163. package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0kehl40._.js → [root-of-the-server]__0mvoac~._.js} +2 -2
  164. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0q5n4_f._.js +1 -1
  165. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0s2z7s7._.js +1 -1
  166. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0t9jvpg._.js +1 -1
  167. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ta228.._.js +1 -1
  168. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__11yff~n._.js +1 -1
  169. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__13lfzik._.js +1 -1
  170. package/dist/standalone/next-output/server/chunks/ssr/{_0y1l.fp._.js → _0_glxov._.js} +2 -2
  171. package/dist/standalone/next-output/server/chunks/ssr/{_0j8zmg6._.js → _0mb-jfk._.js} +1 -1
  172. package/dist/standalone/next-output/server/chunks/ssr/_0n~tafj._.js +1 -1
  173. package/dist/standalone/next-output/server/chunks/ssr/{_11_k_h_._.js → _0yg7mcz._.js} +2 -2
  174. package/dist/standalone/next-output/server/chunks/ssr/_10n.q--._.js +1 -1
  175. package/dist/standalone/next-output/server/chunks/ssr/_119e_ui._.js +3 -0
  176. package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +3 -0
  177. package/dist/standalone/next-output/server/chunks/ssr/components_entry-list_tsx_02.v.ur._.js +1 -1
  178. package/dist/standalone/next-output/server/chunks/ssr/components_reporting-view_tsx_0-0ofcv._.js +1 -1
  179. package/dist/standalone/next-output/server/functions-config-manifest.json +11 -1
  180. package/dist/standalone/next-output/server/middleware-build-manifest.js +5 -5
  181. package/dist/standalone/next-output/server/middleware-manifest.json +2 -30
  182. package/dist/standalone/next-output/server/middleware.js +5 -0
  183. package/dist/standalone/next-output/server/pages/500.html +1 -1
  184. package/dist/standalone/next-output/static/chunks/0076tj~a2_nqt.css +3 -0
  185. package/dist/standalone/next-output/static/chunks/01.p8x7rwa_da.js +1 -0
  186. package/dist/standalone/next-output/static/chunks/01e9mu0.nm5zq.js +1 -0
  187. package/dist/standalone/next-output/static/chunks/01op4gs840x6z.js +1 -0
  188. package/dist/standalone/next-output/static/chunks/05q3gfx1e8sea.js +2 -0
  189. package/dist/standalone/next-output/static/chunks/{0o1-l.q7jp8h9.js → 073j7j4i1_blt.js} +1 -1
  190. package/dist/standalone/next-output/static/chunks/07fpf9v1uq4kz.js +1 -0
  191. package/dist/standalone/next-output/static/chunks/{0tunlsiqaj8k7.js → 0_ofg6_dn.8-1.js} +1 -1
  192. package/dist/standalone/next-output/static/chunks/{0d1bw0ondgg09.js → 0fxgcr1q998_k.js} +1 -1
  193. package/dist/standalone/next-output/static/chunks/0slg_rix2tzz_.js +1 -0
  194. package/dist/standalone/next-output/static/chunks/{turbopack-0f5lhej4rg9kr.js → turbopack-0qr4v3fex9a4_.js} +1 -1
  195. package/dist/standalone/package.json +1 -1
  196. package/dist/standalone/public/icons/site.webmanifest +19 -1
  197. package/dist/standalone/public/manifest.webmanifest +30 -30
  198. package/dist/standalone/public/sw.js +74 -73
  199. package/package.json +1 -1
  200. package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0arv.vj._.js +0 -3
  201. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0.8v_6p._.js +0 -3
  202. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00xx75-._.js +0 -3
  203. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__07wrb8~._.js +0 -3
  204. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_ar6en._.js +0 -3
  205. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jvridy._.js +0 -3
  206. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mp257.._.js +0 -3
  207. package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nhm~x6._.js +0 -3
  208. package/dist/standalone/next-output/server/chunks/_0z9uwpr._.js +0 -3
  209. package/dist/standalone/next-output/server/chunks/_128edjo._.js +0 -3
  210. package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +0 -3
  211. package/dist/standalone/next-output/server/edge/chunks/0iv-_next_dist_esm_build_templates_edge-wrapper_0tu5gg3.js +0 -3
  212. package/dist/standalone/next-output/server/edge/chunks/0prs_next_dist_esm_build_templates_edge-wrapper_0qnghjz.js +0 -3
  213. package/dist/standalone/next-output/server/edge/chunks/[root-of-the-server]__0864en3._.js +0 -69
  214. package/dist/standalone/next-output/static/chunks/0bkrh0v8rs7jg.js +0 -1
  215. package/dist/standalone/next-output/static/chunks/0dx.1c1lmm455.css +0 -3
  216. package/dist/standalone/next-output/static/chunks/0f4rt.2~sppbn.js +0 -1
  217. package/dist/standalone/next-output/static/chunks/0lj1_~cxf~l6t.js +0 -1
  218. package/dist/standalone/next-output/static/chunks/0p4cjapdzyl6k.js +0 -2
  219. package/dist/standalone/next-output/static/chunks/0yhbka048dolq.js +0 -1
  220. package/dist/standalone/next-output/static/chunks/11cm.4cgwu.ci.js +0 -1
  221. /package/dist/standalone/next-output/static/{R6aA3g-k0tEi2kMtSB2-e → i7qPdm2jbeXagyWgWaWeK}/_buildManifest.js +0 -0
  222. /package/dist/standalone/next-output/static/{R6aA3g-k0tEi2kMtSB2-e → i7qPdm2jbeXagyWgWaWeK}/_clientMiddlewareManifest.js +0 -0
  223. /package/dist/standalone/next-output/static/{R6aA3g-k0tEi2kMtSB2-e → i7qPdm2jbeXagyWgWaWeK}/_ssgManifest.js +0 -0
@@ -1,148 +1,149 @@
1
- const CACHE_NAME = 'super-time-tracker-cache-v3'
2
- const OFFLINE_URL = '/offline'
1
+ const CACHE_NAME = "super-time-tracker-cache-v3";
2
+ const OFFLINE_URL = "/offline";
3
3
  const PRECACHE_URLS = [
4
- '/',
4
+ "/",
5
5
  OFFLINE_URL,
6
- '/manifest.webmanifest',
7
- '/icons/favicon.ico',
8
- '/icons/favicon-16x16.png',
9
- '/icons/favicon-32x32.png',
10
- '/icons/apple-touch-icon.png',
11
- '/icons/android-chrome-192x192.png',
12
- '/icons/android-chrome-512x512.png',
13
- ]
6
+ "/manifest.webmanifest",
7
+ "/icons/favicon.ico",
8
+ "/icons/favicon-16x16.png",
9
+ "/icons/favicon-32x32.png",
10
+ "/icons/apple-touch-icon.png",
11
+ "/icons/android-chrome-192x192.png",
12
+ "/icons/android-chrome-512x512.png",
13
+ ];
14
14
  const APP_ROUTES = [
15
- '/',
16
- '/today',
17
- '/sheets',
18
- '/reporting',
19
- '/search',
20
- '/pomodoro',
21
- '/settings',
22
- '/settings/display',
23
- '/settings/goals',
24
- '/settings/pomodoro',
25
- '/settings/ai-suggestions',
26
- '/settings/cloud-sync',
27
- '/settings/data',
28
- '/settings/tags',
29
- '/login',
30
- '/register',
15
+ "/",
16
+ "/today",
17
+ "/sheets",
18
+ "/reporting",
19
+ "/search",
20
+ "/pomodoro",
21
+ "/settings",
22
+ "/settings/display",
23
+ "/settings/goals",
24
+ "/settings/pomodoro",
25
+ "/settings/ai-suggestions",
26
+ "/settings/cloud-sync",
27
+ "/settings/data",
28
+ "/settings/tags",
29
+ "/login",
30
+ "/register",
31
31
  OFFLINE_URL,
32
- ]
32
+ ];
33
33
 
34
- const is_next_static_asset_request = (url) => url.pathname.startsWith('/_next/static/')
34
+ const is_next_static_asset_request = (url) =>
35
+ url.pathname.startsWith("/_next/static/");
35
36
 
36
37
  const get_cache_key = (request) => {
37
- const url = new URL(request.url)
38
+ const url = new URL(request.url);
38
39
 
39
40
  if (is_next_static_asset_request(url)) {
40
- return `${url.origin}${url.pathname}`
41
+ return `${url.origin}${url.pathname}`;
41
42
  }
42
43
 
43
- return request
44
- }
44
+ return request;
45
+ };
45
46
 
46
47
  const warm_app_routes_cache = async () => {
47
- const cache = await caches.open(CACHE_NAME)
48
+ const cache = await caches.open(CACHE_NAME);
48
49
 
49
50
  await Promise.all(
50
51
  APP_ROUTES.map(async (route) => {
51
52
  try {
52
- const response = await fetch(route, { cache: 'no-store' })
53
+ const response = await fetch(route, { cache: "no-store" });
53
54
 
54
55
  if (response.ok) {
55
- await cache.put(route, response.clone())
56
+ await cache.put(route, response.clone());
56
57
  }
57
58
  } catch {
58
59
  // Ignore failures while warming cache (offline or route unavailable).
59
60
  }
60
61
  }),
61
- )
62
- }
62
+ );
63
+ };
63
64
 
64
- self.addEventListener('install', (event) => {
65
+ self.addEventListener("install", (event) => {
65
66
  event.waitUntil(
66
67
  caches
67
68
  .open(CACHE_NAME)
68
69
  .then((cache) => cache.addAll(PRECACHE_URLS))
69
70
  .then(() => warm_app_routes_cache()),
70
- )
71
- self.skipWaiting()
72
- })
71
+ );
72
+ self.skipWaiting();
73
+ });
73
74
 
74
- self.addEventListener('activate', (event) => {
75
+ self.addEventListener("activate", (event) => {
75
76
  event.waitUntil(
76
77
  caches.keys().then((keys) =>
77
78
  Promise.all(
78
79
  keys.map((key) => {
79
80
  if (key !== CACHE_NAME) {
80
- return caches.delete(key)
81
+ return caches.delete(key);
81
82
  }
82
- return Promise.resolve()
83
+ return Promise.resolve();
83
84
  }),
84
85
  ),
85
86
  ),
86
- )
87
- event.waitUntil(warm_app_routes_cache())
88
- self.clients.claim()
89
- })
87
+ );
88
+ event.waitUntil(warm_app_routes_cache());
89
+ self.clients.claim();
90
+ });
90
91
 
91
- self.addEventListener('fetch', (event) => {
92
- const { request } = event
92
+ self.addEventListener("fetch", (event) => {
93
+ const { request } = event;
93
94
 
94
- if (request.method !== 'GET') {
95
- return
95
+ if (request.method !== "GET") {
96
+ return;
96
97
  }
97
98
 
98
- const request_url = new URL(request.url)
99
+ const request_url = new URL(request.url);
99
100
 
100
- if (request.mode === 'navigate') {
101
+ if (request.mode === "navigate") {
101
102
  event.respondWith(
102
103
  fetch(request)
103
104
  .then(async (network_response) => {
104
105
  if (network_response.ok) {
105
- const cache = await caches.open(CACHE_NAME)
106
- await cache.put(get_cache_key(request), network_response.clone())
106
+ const cache = await caches.open(CACHE_NAME);
107
+ await cache.put(get_cache_key(request), network_response.clone());
107
108
  }
108
- return network_response
109
+ return network_response;
109
110
  })
110
111
  .catch(async () => {
111
- const cache = await caches.open(CACHE_NAME)
112
- const cached_route = await cache.match(get_cache_key(request))
112
+ const cache = await caches.open(CACHE_NAME);
113
+ const cached_route = await cache.match(get_cache_key(request));
113
114
 
114
115
  if (cached_route !== undefined) {
115
- return cached_route
116
+ return cached_route;
116
117
  }
117
118
 
118
- const cached_offline = await cache.match(OFFLINE_URL)
119
- return cached_offline ?? Response.error()
119
+ const cached_offline = await cache.match(OFFLINE_URL);
120
+ return cached_offline ?? Response.error();
120
121
  }),
121
- )
122
- return
122
+ );
123
+ return;
123
124
  }
124
125
 
125
126
  if (request_url.origin !== self.location.origin) {
126
- return
127
+ return;
127
128
  }
128
129
 
129
130
  event.respondWith(
130
131
  caches.match(get_cache_key(request)).then((cached_response) => {
131
132
  if (cached_response !== undefined) {
132
- return cached_response
133
+ return cached_response;
133
134
  }
134
135
 
135
136
  return fetch(request)
136
137
  .then((network_response) => {
137
138
  if (network_response.ok) {
138
- const copy = network_response.clone()
139
+ const copy = network_response.clone();
139
140
  void caches
140
141
  .open(CACHE_NAME)
141
- .then((cache) => cache.put(get_cache_key(request), copy))
142
+ .then((cache) => cache.put(get_cache_key(request), copy));
142
143
  }
143
- return network_response
144
+ return network_response;
144
145
  })
145
- .catch(() => Response.error())
146
+ .catch(() => Response.error());
146
147
  }),
147
- )
148
- })
148
+ );
149
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-time-tracker-ui",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "Web UI for the super-time-tracker CLI time sheets",
5
5
  "keywords": [
6
6
  "nextjs",
@@ -1,3 +0,0 @@
1
- module.exports=[93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))}];
2
-
3
- //# sourceMappingURL=%5Bexternals%5D_next_dist_0arv.vj._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),a=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,a,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:a,archived:s})=>({id:e,description:n,tags:i,notes:a.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===s?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,a=void 0===n.version?1:n.version;if(a>t.DB_VERSION||a<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;a<t.DB_VERSION;){let e=a+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${a} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);a=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),a=e.i(30853),s=e.i(93361),o=e.i(24507),l=e.i(47143),d=e.i(62775),u=e.i(16366);async function c(e,t=n.DB_PATH){let i=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,a.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,s.gen_db)();return await c(t,e),t}let h=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(h)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let m=(0,o.migrate_json_db)(u);u=m.json_db;let v=(0,i.convert_json_db)(u),f=m.did_migrate,g=(0,d.reconcile_stale_active_entry_ids)(v),w=(0,l.dedupe_tracker_db_sheet_entries)(v);return(f||g||w)&&await c(v,e),v}e.s(["write_local_db",0,c],32806),e.s(["read_local_db",0,_],71786)},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function n(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:n}}=await e.auth.getUser();return n?.id??null}e.s(["get_authenticated_user_id",0,n])},24957,49867,14424,95822,e=>{"use strict";var t=e.i(72507),r=e.i(93361),n=e.i(13690);function i(e,t,r){return!0===("incoming"===r?t:e)||void 0}var a=e.i(20253),s=e.i(62775);function o(e,t){let r=new Set,n=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;r.has(e)||(r.add(e),n.push(i))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}function l(e,t){if(null===e)return null;let r=t.find(t=>t.id===e);return void 0===r||null!==r.end?null:e}e.s(["merge_time_tracker_dbs",0,function(e,d,u="incoming"){let c=new Set;for(let t of e.sheets)c.add(t.name);for(let e of d.sheets)c.add(e.name);let _=[...c].map(t=>{let n=e.sheets.find(e=>e.name===t),s=d.sheets.find(e=>e.name===t);if(void 0===n&&void 0===s)return(0,r.gen_sheet)(t);if(void 0===n)return s;if(void 0===s)return n;let c=new Set;for(let e of n.entries)c.add(e.id);for(let e of s.entries)c.add(e.id);let _=[...c].sort((e,t)=>e-t).map(e=>{let t=n.entries.find(t=>t.id===e),r=s.entries.find(t=>t.id===e);if(void 0===t)return r;if(void 0===r)return t;let a=function(e,t,r){let n=null===e.end,i=null===t.end;if(n&&!i||i&&!n){let n="base"===r?e:t,i=n===e?t:e;return{...n,notes:o(n.notes,i.notes)}}if(n&&i){let n=t.start.getTime()>e.start.getTime()||t.start.getTime()===e.start.getTime()&&"incoming"===r,i=n?t:e,a=n?e:t;return{...i,notes:o(i.notes,a.notes)}}let a=e.end?.getTime()??0,s=t.end?.getTime()??0;if(a!==s){let r=a>s?e:t,n=r===e?t:e;return{...r,notes:o(r.notes,n.notes)}}let l="incoming"===r?t:e,d=l===e?t:e;return{...l,notes:o(l.notes,d.notes)}}(t,r,u);return!0===i(t.archived,r.archived,u)?{...a,archived:!0}:a}),p=function(e,t,r,n){let i=null===e?null:r.find(t=>t.id===e)??null,a=null===t?null:r.find(e=>e.id===t)??null;if(null===i&&null===a)return null;if(null===i)return l(a.id,r);if(null===a)return l(i.id,r);if(null===i.end&&null!==a.end)return"base"===n?i.id:null;if(null===a.end&&null!==i.end)return"base"===n?null:a.id;if(null===i.end&&null===a.end)return i.start.getTime()===a.start.getTime()?l("incoming"===n?a.id:i.id,r):l(i.start.getTime()>a.start.getTime()?i.id:a.id,r);let s=i.end.getTime(),o=a.end.getTime();return s===o?l("incoming"===n?a.id:i.id,r):l(s>o?i.id:a.id,r)}(n.activeEntryID,s.activeEntryID,_,u),h=i(n?.archived,s?.archived,u);return{name:t,entries:(0,a.dedupe_sheet_entries_by_id)(_),activeEntryID:p,...!0===h?{archived:!0}:{}}});_.sort((e,t)=>e.name.localeCompare(t.name));let p=function(e,t,r,i){let a=new Set(r.map(e=>e.name)),s=null!==e&&a.has(e),o=null!==t&&a.has(t);if(s&&o){let a=r.find(t=>t.name===e),s=r.find(e=>e.name===t),o=void 0!==a&&null!==(0,n.find_running_entry_on_sheet)(a),l=void 0!==s&&null!==(0,n.find_running_entry_on_sheet)(s);return o&&!l?e:l&&!o||"incoming"===i?t:e}if(o)return t;if(s)return e;let l=r.find(e=>null!==(0,n.find_running_entry_on_sheet)(e));return l?.name??r[0]?.name??null}(e.activeSheetName,d.activeSheetName,_,u),h={version:Math.max(e.version,d.version,t.DB_VERSION),sheets:_,activeSheetName:p};return(0,s.reconcile_stale_active_entry_ids)(h),h}],24957);var d=e.i(36117);function u(e){return e.includes("archived")&&e.includes("does not exist")}function c(e){return(e??1)>=4}async function _(e){let n=await (0,d.create_server_supabase_client)(),{data:i,error:o}=await n.from("tracker_accounts").select("active_sheet_name, db_version").eq("user_id",e).maybeSingle();if(null!==o)throw Error(`Failed to load tracker account: ${o.message}`);if(null===i)return(0,r.gen_db)();let l=c(i.db_version),u=await p(n,e,l);l=u.include_archived;let _=u.sheets;if(0===_.length)return{version:i.db_version??t.DB_VERSION,activeSheetName:i.active_sheet_name,sheets:[]};let m=_.map(e=>e.id),v=await h(n,m,l),{data:f,error:g}=await n.from("entry_notes").select("sheet_id, entry_id, note_index, noted_at, text").in("sheet_id",m).order("note_index",{ascending:!0});if(null!==g)throw Error(`Failed to load entry notes: ${g.message}`);let w=new Map;for(let e of f??[]){let t=`${e.sheet_id}:${e.entry_id}`,r=w.get(t)??[];r.push({text:e.text,timestamp:new Date(e.noted_at)}),w.set(t,r)}let E=new Map;for(let e of v){let t=`${e.sheet_id}:${e.id}`,r=E.get(e.sheet_id)??[];r.push({id:e.id,description:e.description,tags:e.tags??[],start:new Date(e.start_at),end:null===e.end_at?null:new Date(e.end_at),notes:w.get(t)??[],...!0===e.archived?{archived:!0}:{}}),E.set(e.sheet_id,r)}let y=_.map(e=>{let t=(0,r.gen_sheet)(e.name,(0,a.dedupe_sheet_entries_by_id)(E.get(e.id)??[]),e.active_entry_id);return!0===e.archived&&(t.archived=!0),t}),b={version:l?i.db_version??t.DB_VERSION:Math.min(i.db_version??t.DB_VERSION,3),activeSheetName:i.active_sheet_name,sheets:y};return(0,s.reconcile_stale_active_entry_ids)(b),b}async function p(e,t,r){if(r){let{data:r,error:n}=await e.from("sheets").select("id, name, active_entry_id, archived").eq("user_id",t).order("name",{ascending:!0});if(null!==n&&u(n.message))return await e.from("tracker_accounts").update({db_version:3}).eq("user_id",t),p(e,t,!1);if(null!==n)throw Error(`Failed to load sheets: ${n.message}`);return{include_archived:!0,sheets:r??[]}}let{data:n,error:i}=await e.from("sheets").select("id, name, active_entry_id").eq("user_id",t).order("name",{ascending:!0});if(null!==i)throw Error(`Failed to load sheets: ${i.message}`);return{include_archived:!1,sheets:n??[]}}async function h(e,t,r){if(r){let{data:r,error:n}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags, archived").in("sheet_id",t).order("id",{ascending:!0});if(null!==n)throw Error(`Failed to load entries: ${n.message}`);return r??[]}let{data:n,error:i}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags").in("sheet_id",t).order("id",{ascending:!0});if(null!==i)throw Error(`Failed to load entries: ${i.message}`);return n??[]}e.s(["is_missing_archived_column_error",0,u],49867),e.s(["supports_supabase_archive_columns",0,c],14424),e.s(["read_supabase_db",0,_],95822)},99054,e=>{"use strict";var t=e.i(36117),r=e.i(14424);function n(e,t){return(0,r.supports_supabase_archive_columns)(t)?e:Math.min(e,3)}var i=e.i(49867);async function a(e,t,r,n=!0){let i=r.entries.map(e=>e.id),{data:s,error:o}=await e.from("entries").select("id").eq("sheet_id",t);if(null!==o)throw Error(`Failed to list entries for "${r.name}": ${o.message}`);let l=(s??[]).map(e=>e.id).filter(e=>!i.includes(e));if(l.length>0){let{error:n}=await e.from("entries").delete().eq("sheet_id",t).in("id",l);if(null!==n)throw Error(`Failed to remove entries for "${r.name}": ${n.message}`)}let{error:d}=await e.from("entry_notes").delete().eq("sheet_id",t);if(null!==d)throw Error(`Failed to clear notes for "${r.name}": ${d.message}`);if(0===r.entries.length)return;let u=r.entries.map(e=>({sheet_id:t,id:e.id,start_at:e.start.toISOString(),end_at:null===e.end?null:e.end.toISOString(),description:e.description,tags:e.tags,...n&&!0===e.archived?{archived:!0}:{}})),{error:c}=await e.from("entries").upsert(u,{onConflict:"sheet_id,id"});if(null!==c)throw Error(`Failed to save entries for "${r.name}": ${c.message}`);let _=[];for(let e of r.entries)e.notes.forEach((r,n)=>{_.push({sheet_id:t,entry_id:e.id,note_index:n,noted_at:r.timestamp.toISOString(),text:r.text})});if(0===_.length)return;let{error:p}=await e.from("entry_notes").insert(_);if(null!==p)throw Error(`Failed to save notes for "${r.name}": ${p.message}`)}async function s(e,s){let o=await (0,t.create_server_supabase_client)(),{data:l,error:d}=await o.from("tracker_accounts").select("db_version").eq("user_id",s).maybeSingle();if(null!==d)throw Error(`Failed to load tracker account: ${d.message}`);let u=l?.db_version,c=(0,r.supports_supabase_archive_columns)(u),_=n(e.version,u),{error:p}=await o.from("tracker_accounts").upsert({user_id:s,active_sheet_name:e.activeSheetName,db_version:_,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(null!==p)throw Error(`Failed to save tracker account: ${p.message}`);let{data:h,error:m}=await o.from("sheets").select("id, name").eq("user_id",s);if(null!==m)throw Error(`Failed to list sheets: ${m.message}`);let v=new Set(e.sheets.map(e=>e.name)),f=(h??[]).filter(e=>!v.has(e.name)).map(e=>e.id);if(f.length>0){let{error:e}=await o.from("sheets").delete().in("id",f);if(null!==e)throw Error(`Failed to remove deleted sheets: ${e.message}`)}for(let t of e.sheets){let r={user_id:s,name:t.name,active_entry_id:t.activeEntryID,...c&&!0===t.archived?{archived:!0}:{}},{data:l,error:d}=await o.from("sheets").upsert(r,{onConflict:"user_id,name"}).select("id").single();if(null!==d&&c&&(0,i.is_missing_archived_column_error)(d.message)){c=!1,_=n(e.version,3),await o.from("tracker_accounts").update({db_version:3}).eq("user_id",s);let r={user_id:s,name:t.name,active_entry_id:t.activeEntryID},i=await o.from("sheets").upsert(r,{onConflict:"user_id,name"}).select("id").single();if(null!==i.error)throw Error(`Failed to save sheet "${t.name}": ${i.error.message}`);let l=i.data.id;await a(o,l,t,c);continue}if(null!==d)throw Error(`Failed to save sheet "${t.name}": ${d.message}`);let u=l.id;await a(o,u,t,c)}}e.s(["write_supabase_db",0,s],99054)},58328,e=>{"use strict";var t=e.i(4394),r=e.i(45404),n=e.i(60016),i=e.i(33535),a=e.i(46593),s=e.i(10659),o=e.i(19784),l=e.i(31269),d=e.i(13865),u=e.i(65034),c=e.i(81157),_=e.i(82614),p=e.i(24377),h=e.i(57949),m=e.i(9566),v=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),w=e.i(68194),E=e.i(29207),y=e.i(24957),b=e.i(62775),x=e.i(71786),S=e.i(95822),R=e.i(99054),D=e.i(36117);async function N(e){let t=await (0,S.read_supabase_db)(e),r=await (0,x.read_local_db)(),n=(0,y.merge_time_tracker_dbs)(t,r,"incoming");(0,b.reconcile_stale_active_entry_ids)(n),await (0,R.write_supabase_db)(n,e);let i=await (0,D.create_server_supabase_client)();return await i.from("tracker_accounts").update({local_imported_at:new Date().toISOString()}).eq("user_id",e),n}async function T(e){await N(e)}async function I(e){let t=await (0,x.read_local_db)();await (0,R.write_supabase_db)(t,e)}async function $(e){try{let t=await (0,E.get_authenticated_user_id)();if(null===t)return(0,w.api_error_response)(Error("Sign in required"),401);return"true"===new URL(e.url).searchParams.get("verbatim")?await I(t):await T(t),g.NextResponse.json({ok:!0})}catch(e){return(0,w.api_error_response)(e,500)}}e.s(["POST",0,$],88689);var C=e.i(88689);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sync/push/route",pathname:"/api/sync/push",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sync/push/route.ts",nextConfigOutput:"standalone",userland:C,...{}}),{workAsyncStorage:q,workUnitAsyncStorage:k,serverHooks:O}=A;async function F(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),A.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sync/push/route";g=g.replace(/\/index$/,"")||"/";let w=await A.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,deploymentId:y,params:b,nextConfig:x,parsedUrl:S,isDraftMode:R,prerenderManifest:D,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,resolvedPathname:$,clientReferenceManifest:C,serverActionsManifest:q}=w,k=(0,o.normalizeAppPath)(g),O=!!(D.dynamicRoutes[k]||D.routes[$]),F=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,S,!1):t.end("This page could not be found"),null);if(O&&!R){let e=!!D.routes[$],t=D.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await F();throw new v.NoFallbackError}}let j=null;!O||A.isDev||R||(j="/index"===(j=$)?"/":j);let P=!0===A.isDev||!O,M=O&&!P;q&&C&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:C,serverActionsManifest:q});let B=e.method||"GET",H=(0,a.getTracer)(),U=H.getActiveScopeSpan(),V=!!(null==N?void 0:N.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),K=(0,i.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,x,D,L);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let X={params:b,previewProps:D.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:P,incrementalCache:K,cacheLifeProfiles:x.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>A.onRequestError(e,t,n,i,N)},sharedContext:{buildId:E,deploymentId:y}},G=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let i,s=async e=>A.handle(W,X).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${B} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${B} ${g}`)}),o=async i=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&T&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=X.renderOpts.fetchMetrics;let o=X.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=X.renderOpts.collectedTags;if(!O)return await (0,_.sendResponse)(G,J,a,X.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:X.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),t}},d=await A.handleResponse({req:e,nextConfig:x,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:D,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!O)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),R&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&O||u.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,_.sendResponse)(G,J,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};V&&U?await o(U):(i=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${B} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},o),void 0,!V))}catch(t){if(t instanceof v.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),O)throw t;return await (0,_.sendResponse)(G,J,new Response(null,{status:500})),null}}e.s(["handler",0,F,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:q,workUnitAsyncStorage:k})},"routeModule",0,A,"serverHooks",0,O,"workAsyncStorage",0,q,"workUnitAsyncStorage",0,k],58328)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0.8v_6p._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function n(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:n}}=await e.auth.getUser();return n?.id??null}e.s(["get_authenticated_user_id",0,n])},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),s=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,s,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:s,archived:a})=>({id:e,description:n,tags:i,notes:s.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===a?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,s=void 0===n.version?1:n.version;if(s>t.DB_VERSION||s<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;s<t.DB_VERSION;){let e=s+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${s} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);s=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),s=e.i(30853),a=e.i(93361),o=e.i(24507),l=e.i(47143),u=e.i(62775),c=e.i(16366);async function d(e,t=n.DB_PATH){let i=JSON.stringify((0,c.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let c,v=t.default.dirname(e);await (0,s.ensure_dir_exists)(v);try{await r.promises.access(e)}catch{let t=(0,a.gen_db)();return await d(t,e),t}let h=await r.promises.readFile(e,"utf-8");try{c=JSON.parse(h)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let f=(0,o.migrate_json_db)(c);c=f.json_db;let m=(0,i.convert_json_db)(c),p=f.did_migrate,g=(0,u.reconcile_stale_active_entry_ids)(m),y=(0,l.dedupe_tracker_db_sheet_entries)(m);return(p||g||y)&&await d(m,e),m}e.s(["write_local_db",0,d],32806),e.s(["read_local_db",0,_],71786)},27440,e=>{"use strict";var t=e.i(49827),r=e.i(71786);let n=(0,t.cache)(async e=>(0,r.read_local_db)(e));e.s(["read_db",0,n])},18212,e=>{"use strict";var t=e.i(47143),r=e.i(62775),n=e.i(32806);async function i(e,i){(0,r.reconcile_stale_active_entry_ids)(e),(0,t.dedupe_tracker_db_sheet_entries)(e),await (0,n.write_local_db)(e,i)}e.s(["write_db",0,i])},72609,52455,13455,45196,58611,e=>{"use strict";let t=Symbol.for("constructDateFrom");function r(e,r){return"function"==typeof e?e(r):e&&"object"==typeof e&&t in e?e[t](r):e instanceof Date?new e.constructor(r):new Date(r)}function n(e,t){return r(t||e,e)}e.s(["constructFromSymbol",0,t,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInSecond",0,1e3,"millisecondsInWeek",0,6048e5],52455),e.s(["constructFrom",0,r],13455),e.s(["toDate",0,n],45196),e.s(["endOfDay",0,function(e,t){let r=n(e,t?.in);return r.setHours(23,59,59,999),r}],72609);let i={};e.s(["getDefaultOptions",0,function(){return i}],58611)},69856,e=>{"use strict";var t=e.i(45196);e.s(["startOfDay",0,function(e,r){let n=(0,t.toDate)(e,r?.in);return n.setHours(0,0,0,0),n}])},64457,e=>{"use strict";var t=e.i(58611),r=e.i(45196);e.s(["startOfWeek",0,function(e,n){let i=(0,t.getDefaultOptions)(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=(0,r.toDate)(e,n?.in),o=a.getDay();return a.setDate(a.getDate()-(7*(o<s)+o-s)),a.setHours(0,0,0,0),a}])},12888,14850,27984,e=>{"use strict";e.s(["is_entry_archived",0,function(e){return!0===e.archived}],12888),e.s(["is_sheet_archived",0,function(e){return!0===e.archived}],14850),e.s(["serialize_entry",0,function(e,t,r){return{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:t,durationMs:function(e,t=Date.now()){let{end:r,start:n}=e;return Math.max(0,(null===r?t:+r)-n)}(e),isActive:r,...!0===e.archived?{archived:!0}:{}}}],27984)},81207,e=>{"use strict";e.s(["collect_known_tags",0,function(e){let t=new Set;for(let r of e.sheets)for(let e of r.entries)for(let r of e.tags){let e=r.trim();e.length>0&&t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}])},77052,e=>{"use strict";function t(e,r,n,i=Date.now()){let s=+e.start;return Math.max(0,Math.min(null===e.end?i:+e.end,n)-Math.max(s,r))}var r=e.i(72609),n=e.i(45196),i=e.i(58611),s=e.i(69856),a=e.i(64457);function o(e,t=new Date,l=1){var u;switch(e){case"week":let c,d,_,v;return{startMs:+(0,a.startOfWeek)(t,{weekStartsOn:l}),endMs:+(u={weekStartsOn:l},c=(0,i.getDefaultOptions)(),d=u?.weekStartsOn??u?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,v=(_=(0,n.toDate)(t,u?.in)).getDay(),_.setDate(_.getDate()+((v<d?-7:0)+6-(v-d))),_.setHours(23,59,59,999),_)};case"month":let h,f,m;return{startMs:+((h=(0,n.toDate)(t,void 0)).setDate(1),h.setHours(0,0,0,0),h),endMs:+(m=(f=(0,n.toDate)(t,void 0)).getMonth(),f.setFullYear(f.getFullYear(),m+1,0),f.setHours(23,59,59,999),f)};default:return{startMs:+(0,s.startOfDay)(t),endMs:+(0,r.endOfDay)(t)}}}var l=e.i(27440);async function u({scope:e="global",sheet_name:r,tag_name:n,db:i}={}){let s=i??await (0,l.read_db)(),a=Date.now(),c=new Date(a),d=o("today",c),_=o("week",c),v=0,h=0,f=null,m=null;for(let i of s.sheets)for(let s of i.entries){("global"===e||"sheet"===e&&void 0!==r&&i.name===r||"tag"===e&&void 0!==n&&s.tags.some(e=>e===n))&&(v+=t(s,d.startMs,d.endMs,a),h+=t(s,_.startMs,_.endMs,a));let o=+s.start,l=null===s.end?null:+s.end,u=null===l?o:Math.max(o,l);if((null===m||u>m)&&(m=u),null===s.end){let e=Math.max(0,a-o);(null===f||e>f)&&(f=e)}}let p=null!==f||null===m?null:Math.floor((a-m)/6e4);return{todayTrackedMs:v,weekTrackedMs:h,activeTimerDurationMs:f,minutesSinceLastLog:p}}e.s(["get_focus_nudges_status",0,u],77052)},93204,e=>{"use strict";e.s(["get_sheet",0,function(e,t){let r=e.sheets.find(({name:e})=>e===t);if(void 0===r)throw Error(`Sheet ${t} not found`);return r}])},87255,76249,e=>{"use strict";var t=e.i(12888);e.s(["filter_visible_entries",0,function(e){return e.filter(e=>!(0,t.is_entry_archived)(e))}],87255);var r=e.i(72507),n=e.i(29207),i=e.i(5313);async function s(){return!!(0,i.is_supabase_configured)()&&null!==await (0,n.get_authenticated_user_id)()}async function a(){return await s()?`Cloud sync (${"https://ctruizaqyeyidujmtxhc.supabase.co".trim()??"Supabase"})`:r.DB_PATH}e.s(["resolve_db_path_label",0,a],76249)},4760,95634,e=>{"use strict";var t=e.i(81207),r=e.i(87255),n=e.i(14850),i=e.i(76249),s=e.i(77052),a=e.i(93204),o=e.i(27440),l=e.i(72507),u=e.i(13690),c=e.i(27984),d=e.i(20253),_=e.i(93361),v=e.i(18212);async function h(e){let t=await (0,o.read_db)();t.sheets.some(({name:t})=>t===e)||t.sheets.push((0,_.gen_sheet)(e)),t.activeSheetName=e,await (0,v.write_db)(t)}async function f(e,_={}){let v=_.persist_active_sheet??!0,m=_.include_sheet_entries??!0,p=_.include_focus_nudges??!1,g=_.db??await (0,o.read_db)(),y=function(e,t){let r=t?.trim()??"";if(r.length>0&&e.sheets.some(e=>e.name===r&&!(0,n.is_sheet_archived)(e)))return r;if(null!==e.activeSheetName&&e.sheets.some(t=>t.name===e.activeSheetName&&!(0,n.is_sheet_archived)(t)))return e.activeSheetName;let i=e.sheets.find(e=>!(0,n.is_sheet_archived)(e)&&null!==(0,u.find_running_entry_on_sheet)(e));if(void 0!==i)return i.name;let s=e.sheets.find(e=>!(0,n.is_sheet_archived)(e));return s?.name??l.DEFAULT_SHEET_NAME}(g,e);v&&g.activeSheetName!==y&&(await h(y),g.activeSheetName=y);let{sheets:w}=g,D=[];m&&(D=function(e,t){let r=[...e];switch(t){case"oldest":return r.sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());case"duration":return r.sort((e,t)=>t.durationMs-e.durationMs);case"description":return r.sort((e,t)=>{let r=e.description.trim()||"Untitled entry",n=t.description.trim()||"Untitled entry";return r.localeCompare(n)});default:return r.sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime())}}(function(e){let{activeEntryID:t,entries:r,name:n}=e;return(0,d.dedupe_sheet_entries_by_id)(r).map(e=>(0,c.serialize_entry)(e,n,t===e.id&&null===e.end))}((0,a.get_sheet)(g,y)),"newest"));let S=function(e,t){let r=e.sheets.find(({name:e})=>e===t);if(void 0===r)return null;let n=(0,u.find_running_entry_on_sheet)(r);return null===n?null:(0,c.serialize_entry)(n,r.name,!0)}(g,y),E=function(e){let t=[];for(let r of e.sheets){let e=(0,u.find_running_entry_on_sheet)(r);null!==e&&t.push((0,c.serialize_entry)(e,r.name,!0))}return t}(g),b=S??E[0]??null,x=p?await (0,s.get_focus_nudges_status)({scope:"global",db:g}):void 0;return{dbPath:await (0,i.resolve_db_path_label)(),activeSheetName:y,knownTags:(0,t.collect_known_tags)(g),sheets:w.map(e=>({name:e.name,activeEntryID:e.activeEntryID,entryCount:(0,r.filter_visible_entries)(e.entries).length,isActive:e.name===y,hasActiveEntry:null!==(0,u.find_running_entry_on_sheet)(e),...(0,n.is_sheet_archived)(e)?{archived:!0}:{}})),activeEntry:S,runningEntry:b,runningEntries:E,activeSheetEntries:D,activeSheetTotalMs:D.reduce((e,t)=>e+t.durationMs,0),activeSheetEntriesLoaded:m,focusNudgesStatusGlobal:x}}e.s(["set_active_sheet",0,h],95634),e.s(["get_tracker_state",0,f],4760)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__00xx75-._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),a=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,a,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:a,archived:s})=>({id:e,description:n,tags:i,notes:a.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===s?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,a=void 0===n.version?1:n.version;if(a>t.DB_VERSION||a<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;a<t.DB_VERSION;){let e=a+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${a} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);a=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),a=e.i(30853),s=e.i(93361),o=e.i(24507),d=e.i(47143),l=e.i(62775),u=e.i(16366);async function c(e,t=n.DB_PATH){let i=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,a.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,s.gen_db)();return await c(t,e),t}let m=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(m)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let f=(0,o.migrate_json_db)(u);u=f.json_db;let h=(0,i.convert_json_db)(u),v=f.did_migrate,g=(0,l.reconcile_stale_active_entry_ids)(h),E=(0,d.dedupe_tracker_db_sheet_entries)(h);return(v||g||E)&&await c(h,e),h}e.s(["write_local_db",0,c],32806),e.s(["read_local_db",0,_],71786)},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function n(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:n}}=await e.auth.getUser();return n?.id??null}e.s(["get_authenticated_user_id",0,n])},24957,49867,14424,95822,e=>{"use strict";var t=e.i(72507),r=e.i(93361),n=e.i(13690);function i(e,t,r){return!0===("incoming"===r?t:e)||void 0}var a=e.i(20253),s=e.i(62775);function o(e,t){let r=new Set,n=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;r.has(e)||(r.add(e),n.push(i))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}function d(e,t){if(null===e)return null;let r=t.find(t=>t.id===e);return void 0===r||null!==r.end?null:e}e.s(["merge_time_tracker_dbs",0,function(e,l,u="incoming"){let c=new Set;for(let t of e.sheets)c.add(t.name);for(let e of l.sheets)c.add(e.name);let _=[...c].map(t=>{let n=e.sheets.find(e=>e.name===t),s=l.sheets.find(e=>e.name===t);if(void 0===n&&void 0===s)return(0,r.gen_sheet)(t);if(void 0===n)return s;if(void 0===s)return n;let c=new Set;for(let e of n.entries)c.add(e.id);for(let e of s.entries)c.add(e.id);let _=[...c].sort((e,t)=>e-t).map(e=>{let t=n.entries.find(t=>t.id===e),r=s.entries.find(t=>t.id===e);if(void 0===t)return r;if(void 0===r)return t;let a=function(e,t,r){let n=null===e.end,i=null===t.end;if(n&&!i||i&&!n){let n="base"===r?e:t,i=n===e?t:e;return{...n,notes:o(n.notes,i.notes)}}if(n&&i){let n=t.start.getTime()>e.start.getTime()||t.start.getTime()===e.start.getTime()&&"incoming"===r,i=n?t:e,a=n?e:t;return{...i,notes:o(i.notes,a.notes)}}let a=e.end?.getTime()??0,s=t.end?.getTime()??0;if(a!==s){let r=a>s?e:t,n=r===e?t:e;return{...r,notes:o(r.notes,n.notes)}}let d="incoming"===r?t:e,l=d===e?t:e;return{...d,notes:o(d.notes,l.notes)}}(t,r,u);return!0===i(t.archived,r.archived,u)?{...a,archived:!0}:a}),p=function(e,t,r,n){let i=null===e?null:r.find(t=>t.id===e)??null,a=null===t?null:r.find(e=>e.id===t)??null;if(null===i&&null===a)return null;if(null===i)return d(a.id,r);if(null===a)return d(i.id,r);if(null===i.end&&null!==a.end)return"base"===n?i.id:null;if(null===a.end&&null!==i.end)return"base"===n?null:a.id;if(null===i.end&&null===a.end)return i.start.getTime()===a.start.getTime()?d("incoming"===n?a.id:i.id,r):d(i.start.getTime()>a.start.getTime()?i.id:a.id,r);let s=i.end.getTime(),o=a.end.getTime();return s===o?d("incoming"===n?a.id:i.id,r):d(s>o?i.id:a.id,r)}(n.activeEntryID,s.activeEntryID,_,u),m=i(n?.archived,s?.archived,u);return{name:t,entries:(0,a.dedupe_sheet_entries_by_id)(_),activeEntryID:p,...!0===m?{archived:!0}:{}}});_.sort((e,t)=>e.name.localeCompare(t.name));let p=function(e,t,r,i){let a=new Set(r.map(e=>e.name)),s=null!==e&&a.has(e),o=null!==t&&a.has(t);if(s&&o){let a=r.find(t=>t.name===e),s=r.find(e=>e.name===t),o=void 0!==a&&null!==(0,n.find_running_entry_on_sheet)(a),d=void 0!==s&&null!==(0,n.find_running_entry_on_sheet)(s);return o&&!d?e:d&&!o||"incoming"===i?t:e}if(o)return t;if(s)return e;let d=r.find(e=>null!==(0,n.find_running_entry_on_sheet)(e));return d?.name??r[0]?.name??null}(e.activeSheetName,l.activeSheetName,_,u),m={version:Math.max(e.version,l.version,t.DB_VERSION),sheets:_,activeSheetName:p};return(0,s.reconcile_stale_active_entry_ids)(m),m}],24957);var l=e.i(36117);function u(e){return e.includes("archived")&&e.includes("does not exist")}function c(e){return(e??1)>=4}async function _(e){let n=await (0,l.create_server_supabase_client)(),{data:i,error:o}=await n.from("tracker_accounts").select("active_sheet_name, db_version").eq("user_id",e).maybeSingle();if(null!==o)throw Error(`Failed to load tracker account: ${o.message}`);if(null===i)return(0,r.gen_db)();let d=c(i.db_version),u=await p(n,e,d);d=u.include_archived;let _=u.sheets;if(0===_.length)return{version:i.db_version??t.DB_VERSION,activeSheetName:i.active_sheet_name,sheets:[]};let f=_.map(e=>e.id),h=await m(n,f,d),{data:v,error:g}=await n.from("entry_notes").select("sheet_id, entry_id, note_index, noted_at, text").in("sheet_id",f).order("note_index",{ascending:!0});if(null!==g)throw Error(`Failed to load entry notes: ${g.message}`);let E=new Map;for(let e of v??[]){let t=`${e.sheet_id}:${e.entry_id}`,r=E.get(t)??[];r.push({text:e.text,timestamp:new Date(e.noted_at)}),E.set(t,r)}let y=new Map;for(let e of h){let t=`${e.sheet_id}:${e.id}`,r=y.get(e.sheet_id)??[];r.push({id:e.id,description:e.description,tags:e.tags??[],start:new Date(e.start_at),end:null===e.end_at?null:new Date(e.end_at),notes:E.get(t)??[],...!0===e.archived?{archived:!0}:{}}),y.set(e.sheet_id,r)}let w=_.map(e=>{let t=(0,r.gen_sheet)(e.name,(0,a.dedupe_sheet_entries_by_id)(y.get(e.id)??[]),e.active_entry_id);return!0===e.archived&&(t.archived=!0),t}),S={version:d?i.db_version??t.DB_VERSION:Math.min(i.db_version??t.DB_VERSION,3),activeSheetName:i.active_sheet_name,sheets:w};return(0,s.reconcile_stale_active_entry_ids)(S),S}async function p(e,t,r){if(r){let{data:r,error:n}=await e.from("sheets").select("id, name, active_entry_id, archived").eq("user_id",t).order("name",{ascending:!0});if(null!==n&&u(n.message))return await e.from("tracker_accounts").update({db_version:3}).eq("user_id",t),p(e,t,!1);if(null!==n)throw Error(`Failed to load sheets: ${n.message}`);return{include_archived:!0,sheets:r??[]}}let{data:n,error:i}=await e.from("sheets").select("id, name, active_entry_id").eq("user_id",t).order("name",{ascending:!0});if(null!==i)throw Error(`Failed to load sheets: ${i.message}`);return{include_archived:!1,sheets:n??[]}}async function m(e,t,r){if(r){let{data:r,error:n}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags, archived").in("sheet_id",t).order("id",{ascending:!0});if(null!==n)throw Error(`Failed to load entries: ${n.message}`);return r??[]}let{data:n,error:i}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags").in("sheet_id",t).order("id",{ascending:!0});if(null!==i)throw Error(`Failed to load entries: ${i.message}`);return n??[]}e.s(["is_missing_archived_column_error",0,u],49867),e.s(["supports_supabase_archive_columns",0,c],14424),e.s(["read_supabase_db",0,_],95822)},3896,e=>{"use strict";var t=e.i(2157),r=e.i(72507),n=e.i(71786);async function i(){try{await t.promises.access(r.DB_PATH)}catch{return null}return(0,n.read_local_db)()}e.s(["read_local_db_if_exists",0,i])},4526,e=>{"use strict";e.s(["ACTIVE_SHEET_COOKIE_NAME",0,"stt-active-sheet","ACTIVE_SHEET_STORAGE_KEY",0,"super-time-tracker-active-sheet","COMPACT_LISTS_STORAGE_KEY",0,"super-time-tracker-compact-lists","DEFAULT_SHEET_FIXED_NAME_COOKIE_NAME",0,"stt-default-sheet-fixed-name","DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY",0,"super-time-tracker-default-sheet-fixed-name","DEFAULT_SHEET_SESSION_MODE_COOKIE_NAME",0,"stt-default-sheet-session-mode","DEFAULT_SHEET_SESSION_MODE_DEFAULT",0,"last_viewed","DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY",0,"super-time-tracker-default-sheet-session-mode","SHEET_TAG_FILTERS_STORAGE_KEY",0,"super-time-tracker-sheet-tag-filters"])},61676,e=>{"use strict";var t=e.i(36117);async function r(e){let r=await (0,t.create_server_supabase_client)(),{data:n,error:i}=await r.from("tracker_accounts").select("ui_preferences").eq("user_id",e).maybeSingle();if(null!==i)throw Error(`Failed to load UI preferences: ${i.message}`);if(null===n)return{};let a=n.ui_preferences;if("object"!=typeof a||null===a||Array.isArray(a))return{};let s={};for(let[e,t]of Object.entries(a))"string"==typeof t&&(s[e]=t);return s}e.s(["read_supabase_ui_preferences",0,r])},92669,e=>{"use strict";var t=e.i(29207),r=e.i(5313);let n="super-time-tracker-theme-mode",i="super-time-tracker-color-palette",a="super-time-tracker-accent-color";var s=e.i(4526);let o="super-time-tracker-theme";var d=e.i(61676),l=e.i(36117);async function u(e,t){let r=await (0,l.create_server_supabase_client)(),{error:n}=await r.from("tracker_accounts").upsert({user_id:e,ui_preferences:t},{onConflict:"user_id"});if(null!==n)throw Error(`Failed to save UI preferences: ${n.message}`)}async function c(e,l){if(!(0,r.is_supabase_configured)())return{synced:!1,merged:e};let c=void 0===l?await (0,t.get_authenticated_user_id)():l;if(null===c)return{synced:!1,merged:e};let _=await (0,d.read_supabase_ui_preferences)(c),p=Object.keys(e).length>0,m=Object.keys(_).length>0;if(!p&&!m)return{synced:!1,merged:{}};if(!m)return p&&await u(c,e),{synced:p,merged:e};if(!p)return{synced:!0,merged:_};let f=function(e,t,r){let d={};for(let l of new Set([a,s.ACTIVE_SHEET_STORAGE_KEY,"super-time-tracker-check-in-form-collapsed","super-time-tracker-cloud-sync-enabled","super-time-tracker-clear-tag-filters-on-sheet-change",i,s.COMPACT_LISTS_STORAGE_KEY,"super-time-tracker-confirm-before-checkout","super-time-tracker-confirm-destructive-actions","super-time-tracker-default-reporting-range","super-time-tracker-default-reporting-sort","super-time-tracker-debug-logging",s.DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY,s.DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY,"super-time-tracker-daily-focus-target-minutes","super-time-tracker-duration-format","super-time-tracker-entry-list-sort","super-time-tracker-entry-suggestion-provider","super-time-tracker-focus-goal-scope","super-time-tracker-focus-goal-sheet-name","super-time-tracker-focus-goal-tag-name","super-time-tracker-focus-goals-per-sheet","super-time-tracker-focus-goals-per-tag","super-time-tracker-focus-nudges-enabled","super-time-tracker-greedy-cloud-sync","super-time-tracker-no-log-reminder-minutes","super-time-tracker-overwork-alert-hours","super-time-tracker-pomodoro",s.SHEET_TAG_FILTERS_STORAGE_KEY,"super-time-tracker-tag-filter-mode",n,o,"super-time-tracker-time-format","super-time-tracker-timer-in-title","super-time-tracker-timer-show-seconds","super-time-tracker-topbar-quick-actions","super-time-tracker-shortcut-map","super-time-tracker-weekly-focus-target-minutes","super-time-tracker-week-starts-on","super-time-tracker-work-hours-end","super-time-tracker-work-hours-start",...Object.keys(e),...Object.keys(t)])){let n=e[l],i=t[l],a="cloud"===r?i??n:n??i;void 0!==a&&(d[l]=a)}return void 0!==d[n]&&delete d[o],void 0!==d[i]&&delete d[a],d}(e,_,"cloud");return await u(c,f),{synced:!0,merged:f}}e.s(["sync_ui_preferences_on_load",0,c],92669)},49202,e=>{"use strict";var t=e.i(4394),r=e.i(45404),n=e.i(60016),i=e.i(33535),a=e.i(46593),s=e.i(10659),o=e.i(19784),d=e.i(31269),l=e.i(13865),u=e.i(65034),c=e.i(81157),_=e.i(82614),p=e.i(24377),m=e.i(57949),f=e.i(9566),h=e.i(93695);e.i(46179);var v=e.i(42108),g=e.i(76386),E=e.i(68194),y=e.i(29207),w=e.i(5313),S=e.i(24957),T=e.i(62775),b=e.i(3896),x=e.i(95822),k=e.i(32806);async function R(e){if(!(0,w.is_supabase_configured)())return{synced:!1,merged:null};let t=void 0===e?await (0,y.get_authenticated_user_id)():e;if(null===t)return{synced:!1,merged:null};let r=await (0,x.read_supabase_db)(t),n=await (0,b.read_local_db_if_exists)();if(null===n)return r.sheets.length>0?(await (0,k.write_local_db)(r),{synced:!0,merged:r}):{synced:!1,merged:r};if(0===r.sheets.length)return await (0,k.write_local_db)(n),{synced:!0,merged:n};let i=(0,S.merge_time_tracker_dbs)(r,n,"incoming");return(0,T.reconcile_stale_active_entry_ids)(i),await (0,k.write_local_db)(i),{synced:!0,merged:i}}var A=e.i(92669);async function D(e){try{let t=(await e.json().catch(()=>({}))).preferences??{},r=await (0,y.get_authenticated_user_id)(),[n,i]=await Promise.all([R(r),(0,A.sync_ui_preferences_on_load)(t,r)]);return g.NextResponse.json({ok:!0,synced:n.synced,preferences_synced:i.synced,preferences:i.merged})}catch(e){return(0,E.api_error_response)(e,500)}}e.s(["POST",0,D],71750);var N=e.i(71750);let O=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sync/merge-on-load/route",pathname:"/api/sync/merge-on-load",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sync/merge-on-load/route.ts",nextConfigOutput:"standalone",userland:N,...{}}),{workAsyncStorage:I,workUnitAsyncStorage:C,serverHooks:j}=O;async function M(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),O.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sync/merge-on-load/route";g=g.replace(/\/index$/,"")||"/";let E=await O.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,deploymentId:w,params:S,nextConfig:T,parsedUrl:b,isDraftMode:x,prerenderManifest:k,routerServerContext:R,isOnDemandRevalidate:A,revalidateOnlyGenerated:D,resolvedPathname:N,clientReferenceManifest:I,serverActionsManifest:C}=E,j=(0,o.normalizeAppPath)(g),M=!!(k.dynamicRoutes[j]||k.routes[N]),F=async()=>((null==R?void 0:R.render404)?await R.render404(e,t,b,!1):t.end("This page could not be found"),null);if(M&&!x){let e=!!k.routes[N],t=k.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(T.adapterPath)return await F();throw new h.NoFallbackError}}let H=null;!M||O.isDev||x||(H="/index"===(H=N)?"/":H);let q=!0===O.isDev||!M,$=M&&!q;C&&I&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:I,serverActionsManifest:C});let P=e.method||"GET",U=(0,a.getTracer)(),B=U.getActiveScopeSpan(),K=!!(null==R?void 0:R.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),G=(0,i.getRequestMeta)(e,"incrementalCache")||await O.getIncrementalCache(e,T,k,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:S,previewProps:k.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts},cacheComponents:!!T.cacheComponents,supportsDynamicResponse:q,incrementalCache:G,cacheLifeProfiles:T.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>O.onRequestError(e,t,n,i,R)},sharedContext:{buildId:y,deploymentId:w}},Y=new d.NodeNextRequest(e),X=new d.NodeNextResponse(t),J=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(t));try{let i,s=async e=>O.handle(J,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=U.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${P} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${P} ${g}`)}),o=async i=>{var a,o;let d=async({previousCacheEntry:r})=>{try{if(!L&&A&&D&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=V.renderOpts.fetchMetrics;let o=V.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let d=V.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(Y,X,a,V.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[f.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,n=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await O.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:A})},!1,R),t}},l=await O.handleResponse({req:e,nextConfig:T,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:D,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:L});if(!M)return null;if((null==l||null==(a=l.value)?void 0:a.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(o=l.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return L&&M||u.delete(f.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,m.getCacheControlHeader)(l.cacheControl)),await (0,_.sendResponse)(Y,X,new Response(l.value.body,{headers:u,status:l.value.status||200})),null};K&&B?await o(B):(i=U.getActiveScopeSpan(),await U.withPropagatedContext(e.headers,()=>U.trace(u.BaseServerSpan.handleRequest,{spanName:`${P} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":P,"http.target":e.url}},o),void 0,!K))}catch(t){if(t instanceof h.NoFallbackError||await O.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:A})},!1,R),M)throw t;return await (0,_.sendResponse)(Y,X,new Response(null,{status:500})),null}}e.s(["handler",0,M,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:C})},"routeModule",0,O,"serverHooks",0,j,"workAsyncStorage",0,I,"workUnitAsyncStorage",0,C],49202)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__07wrb8~._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},45779,e=>{"use strict";var t=e.i(4394),r=e.i(45404),a=e.i(60016),n=e.i(33535),s=e.i(46593),i=e.i(10659),o=e.i(19784),l=e.i(31269),u=e.i(13865),d=e.i(65034),p=e.i(81157),c=e.i(82614),h=e.i(24377),x=e.i(57949),v=e.i(9566),R=e.i(93695);e.i(46179);var g=e.i(42108),f=e.i(76386),w=e.i(36117);async function m(){let e=await (0,w.create_server_supabase_client)();return await e.auth.signOut(),f.NextResponse.json({ok:!0})}e.s(["POST",0,m],93064);var E=e.i(93064);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/auth/signout/route",pathname:"/api/auth/signout",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/auth/signout/route.ts",nextConfigOutput:"standalone",userland:E,...{}}),{workAsyncStorage:y,workUnitAsyncStorage:A,serverHooks:b}=C;async function N(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/auth/signout/route";f=f.replace(/\/index$/,"")||"/";let w=await C.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:m,deploymentId:E,params:y,nextConfig:A,parsedUrl:b,isDraftMode:N,prerenderManifest:T,routerServerContext:P,isOnDemandRevalidate:_,revalidateOnlyGenerated:q,resolvedPathname:O,clientReferenceManifest:S,serverActionsManifest:k}=w,j=(0,o.normalizeAppPath)(f),H=!!(T.dynamicRoutes[j]||T.routes[O]),I=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,b,!1):t.end("This page could not be found"),null);if(H&&!N){let e=!!T.routes[O],t=T.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await I();throw new R.NoFallbackError}}let U=null;!H||C.isDev||N||(U="/index"===(U=O)?"/":U);let M=!0===C.isDev||!H,D=H&&!M;k&&S&&(0,i.setManifestsSingleton)({page:f,clientReferenceManifest:S,serverActionsManifest:k});let $=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),B=!!(null==P?void 0:P.isWrappedByNextServer),L=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,A,T,L);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:y,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:M,incrementalCache:G,cacheLifeProfiles:A.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,P)},sharedContext:{buildId:m,deploymentId:E}},W=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>C.handle(z,V).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${$} ${f}`)}),o=async n=>{var s,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&_&&q&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=V.renderOpts.fetchMetrics;let o=V.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=V.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(W,X,s,V.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:V.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:_})},!1,P),t}},u=await C.handleResponse({req:e,nextConfig:A,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:_,revalidateOnlyGenerated:q,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:L});if(!H)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",_?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return L&&H||d.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,x.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(W,X,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};B&&K?await o(K):(n=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${$} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof R.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:_})},!1,P),H)throw t;return await (0,c.sendResponse)(W,X,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:A})},"routeModule",0,C,"serverHooks",0,b,"workAsyncStorage",0,y,"workUnitAsyncStorage",0,A],45779)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0_ar6en._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),a=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,a,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:a,archived:s})=>({id:e,description:n,tags:i,notes:a.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===s?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,a=void 0===n.version?1:n.version;if(a>t.DB_VERSION||a<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;a<t.DB_VERSION;){let e=a+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${a} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);a=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),a=e.i(30853),s=e.i(93361),o=e.i(24507),l=e.i(47143),d=e.i(62775),u=e.i(16366);async function c(e,t=n.DB_PATH){let i=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,a.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,s.gen_db)();return await c(t,e),t}let m=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(m)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let h=(0,o.migrate_json_db)(u);u=h.json_db;let v=(0,i.convert_json_db)(u),f=h.did_migrate,g=(0,d.reconcile_stale_active_entry_ids)(v),w=(0,l.dedupe_tracker_db_sheet_entries)(v);return(f||g||w)&&await c(v,e),v}e.s(["write_local_db",0,c],32806),e.s(["read_local_db",0,_],71786)},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function n(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:n}}=await e.auth.getUser();return n?.id??null}e.s(["get_authenticated_user_id",0,n])},24957,49867,14424,95822,e=>{"use strict";var t=e.i(72507),r=e.i(93361),n=e.i(13690);function i(e,t,r){return!0===("incoming"===r?t:e)||void 0}var a=e.i(20253),s=e.i(62775);function o(e,t){let r=new Set,n=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;r.has(e)||(r.add(e),n.push(i))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}function l(e,t){if(null===e)return null;let r=t.find(t=>t.id===e);return void 0===r||null!==r.end?null:e}e.s(["merge_time_tracker_dbs",0,function(e,d,u="incoming"){let c=new Set;for(let t of e.sheets)c.add(t.name);for(let e of d.sheets)c.add(e.name);let _=[...c].map(t=>{let n=e.sheets.find(e=>e.name===t),s=d.sheets.find(e=>e.name===t);if(void 0===n&&void 0===s)return(0,r.gen_sheet)(t);if(void 0===n)return s;if(void 0===s)return n;let c=new Set;for(let e of n.entries)c.add(e.id);for(let e of s.entries)c.add(e.id);let _=[...c].sort((e,t)=>e-t).map(e=>{let t=n.entries.find(t=>t.id===e),r=s.entries.find(t=>t.id===e);if(void 0===t)return r;if(void 0===r)return t;let a=function(e,t,r){let n=null===e.end,i=null===t.end;if(n&&!i||i&&!n){let n="base"===r?e:t,i=n===e?t:e;return{...n,notes:o(n.notes,i.notes)}}if(n&&i){let n=t.start.getTime()>e.start.getTime()||t.start.getTime()===e.start.getTime()&&"incoming"===r,i=n?t:e,a=n?e:t;return{...i,notes:o(i.notes,a.notes)}}let a=e.end?.getTime()??0,s=t.end?.getTime()??0;if(a!==s){let r=a>s?e:t,n=r===e?t:e;return{...r,notes:o(r.notes,n.notes)}}let l="incoming"===r?t:e,d=l===e?t:e;return{...l,notes:o(l.notes,d.notes)}}(t,r,u);return!0===i(t.archived,r.archived,u)?{...a,archived:!0}:a}),p=function(e,t,r,n){let i=null===e?null:r.find(t=>t.id===e)??null,a=null===t?null:r.find(e=>e.id===t)??null;if(null===i&&null===a)return null;if(null===i)return l(a.id,r);if(null===a)return l(i.id,r);if(null===i.end&&null!==a.end)return"base"===n?i.id:null;if(null===a.end&&null!==i.end)return"base"===n?null:a.id;if(null===i.end&&null===a.end)return i.start.getTime()===a.start.getTime()?l("incoming"===n?a.id:i.id,r):l(i.start.getTime()>a.start.getTime()?i.id:a.id,r);let s=i.end.getTime(),o=a.end.getTime();return s===o?l("incoming"===n?a.id:i.id,r):l(s>o?i.id:a.id,r)}(n.activeEntryID,s.activeEntryID,_,u),m=i(n?.archived,s?.archived,u);return{name:t,entries:(0,a.dedupe_sheet_entries_by_id)(_),activeEntryID:p,...!0===m?{archived:!0}:{}}});_.sort((e,t)=>e.name.localeCompare(t.name));let p=function(e,t,r,i){let a=new Set(r.map(e=>e.name)),s=null!==e&&a.has(e),o=null!==t&&a.has(t);if(s&&o){let a=r.find(t=>t.name===e),s=r.find(e=>e.name===t),o=void 0!==a&&null!==(0,n.find_running_entry_on_sheet)(a),l=void 0!==s&&null!==(0,n.find_running_entry_on_sheet)(s);return o&&!l?e:l&&!o||"incoming"===i?t:e}if(o)return t;if(s)return e;let l=r.find(e=>null!==(0,n.find_running_entry_on_sheet)(e));return l?.name??r[0]?.name??null}(e.activeSheetName,d.activeSheetName,_,u),m={version:Math.max(e.version,d.version,t.DB_VERSION),sheets:_,activeSheetName:p};return(0,s.reconcile_stale_active_entry_ids)(m),m}],24957);var d=e.i(36117);function u(e){return e.includes("archived")&&e.includes("does not exist")}function c(e){return(e??1)>=4}async function _(e){let n=await (0,d.create_server_supabase_client)(),{data:i,error:o}=await n.from("tracker_accounts").select("active_sheet_name, db_version").eq("user_id",e).maybeSingle();if(null!==o)throw Error(`Failed to load tracker account: ${o.message}`);if(null===i)return(0,r.gen_db)();let l=c(i.db_version),u=await p(n,e,l);l=u.include_archived;let _=u.sheets;if(0===_.length)return{version:i.db_version??t.DB_VERSION,activeSheetName:i.active_sheet_name,sheets:[]};let h=_.map(e=>e.id),v=await m(n,h,l),{data:f,error:g}=await n.from("entry_notes").select("sheet_id, entry_id, note_index, noted_at, text").in("sheet_id",h).order("note_index",{ascending:!0});if(null!==g)throw Error(`Failed to load entry notes: ${g.message}`);let w=new Map;for(let e of f??[]){let t=`${e.sheet_id}:${e.entry_id}`,r=w.get(t)??[];r.push({text:e.text,timestamp:new Date(e.noted_at)}),w.set(t,r)}let E=new Map;for(let e of v){let t=`${e.sheet_id}:${e.id}`,r=E.get(e.sheet_id)??[];r.push({id:e.id,description:e.description,tags:e.tags??[],start:new Date(e.start_at),end:null===e.end_at?null:new Date(e.end_at),notes:w.get(t)??[],...!0===e.archived?{archived:!0}:{}}),E.set(e.sheet_id,r)}let y=_.map(e=>{let t=(0,r.gen_sheet)(e.name,(0,a.dedupe_sheet_entries_by_id)(E.get(e.id)??[]),e.active_entry_id);return!0===e.archived&&(t.archived=!0),t}),x={version:l?i.db_version??t.DB_VERSION:Math.min(i.db_version??t.DB_VERSION,3),activeSheetName:i.active_sheet_name,sheets:y};return(0,s.reconcile_stale_active_entry_ids)(x),x}async function p(e,t,r){if(r){let{data:r,error:n}=await e.from("sheets").select("id, name, active_entry_id, archived").eq("user_id",t).order("name",{ascending:!0});if(null!==n&&u(n.message))return await e.from("tracker_accounts").update({db_version:3}).eq("user_id",t),p(e,t,!1);if(null!==n)throw Error(`Failed to load sheets: ${n.message}`);return{include_archived:!0,sheets:r??[]}}let{data:n,error:i}=await e.from("sheets").select("id, name, active_entry_id").eq("user_id",t).order("name",{ascending:!0});if(null!==i)throw Error(`Failed to load sheets: ${i.message}`);return{include_archived:!1,sheets:n??[]}}async function m(e,t,r){if(r){let{data:r,error:n}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags, archived").in("sheet_id",t).order("id",{ascending:!0});if(null!==n)throw Error(`Failed to load entries: ${n.message}`);return r??[]}let{data:n,error:i}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags").in("sheet_id",t).order("id",{ascending:!0});if(null!==i)throw Error(`Failed to load entries: ${i.message}`);return n??[]}e.s(["is_missing_archived_column_error",0,u],49867),e.s(["supports_supabase_archive_columns",0,c],14424),e.s(["read_supabase_db",0,_],95822)},3896,e=>{"use strict";var t=e.i(2157),r=e.i(72507),n=e.i(71786);async function i(){try{await t.promises.access(r.DB_PATH)}catch{return null}return(0,n.read_local_db)()}e.s(["read_local_db_if_exists",0,i])},99054,e=>{"use strict";var t=e.i(36117),r=e.i(14424);function n(e,t){return(0,r.supports_supabase_archive_columns)(t)?e:Math.min(e,3)}var i=e.i(49867);async function a(e,t,r,n=!0){let i=r.entries.map(e=>e.id),{data:s,error:o}=await e.from("entries").select("id").eq("sheet_id",t);if(null!==o)throw Error(`Failed to list entries for "${r.name}": ${o.message}`);let l=(s??[]).map(e=>e.id).filter(e=>!i.includes(e));if(l.length>0){let{error:n}=await e.from("entries").delete().eq("sheet_id",t).in("id",l);if(null!==n)throw Error(`Failed to remove entries for "${r.name}": ${n.message}`)}let{error:d}=await e.from("entry_notes").delete().eq("sheet_id",t);if(null!==d)throw Error(`Failed to clear notes for "${r.name}": ${d.message}`);if(0===r.entries.length)return;let u=r.entries.map(e=>({sheet_id:t,id:e.id,start_at:e.start.toISOString(),end_at:null===e.end?null:e.end.toISOString(),description:e.description,tags:e.tags,...n&&!0===e.archived?{archived:!0}:{}})),{error:c}=await e.from("entries").upsert(u,{onConflict:"sheet_id,id"});if(null!==c)throw Error(`Failed to save entries for "${r.name}": ${c.message}`);let _=[];for(let e of r.entries)e.notes.forEach((r,n)=>{_.push({sheet_id:t,entry_id:e.id,note_index:n,noted_at:r.timestamp.toISOString(),text:r.text})});if(0===_.length)return;let{error:p}=await e.from("entry_notes").insert(_);if(null!==p)throw Error(`Failed to save notes for "${r.name}": ${p.message}`)}async function s(e,s){let o=await (0,t.create_server_supabase_client)(),{data:l,error:d}=await o.from("tracker_accounts").select("db_version").eq("user_id",s).maybeSingle();if(null!==d)throw Error(`Failed to load tracker account: ${d.message}`);let u=l?.db_version,c=(0,r.supports_supabase_archive_columns)(u),_=n(e.version,u),{error:p}=await o.from("tracker_accounts").upsert({user_id:s,active_sheet_name:e.activeSheetName,db_version:_,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(null!==p)throw Error(`Failed to save tracker account: ${p.message}`);let{data:m,error:h}=await o.from("sheets").select("id, name").eq("user_id",s);if(null!==h)throw Error(`Failed to list sheets: ${h.message}`);let v=new Set(e.sheets.map(e=>e.name)),f=(m??[]).filter(e=>!v.has(e.name)).map(e=>e.id);if(f.length>0){let{error:e}=await o.from("sheets").delete().in("id",f);if(null!==e)throw Error(`Failed to remove deleted sheets: ${e.message}`)}for(let t of e.sheets){let r={user_id:s,name:t.name,active_entry_id:t.activeEntryID,...c&&!0===t.archived?{archived:!0}:{}},{data:l,error:d}=await o.from("sheets").upsert(r,{onConflict:"user_id,name"}).select("id").single();if(null!==d&&c&&(0,i.is_missing_archived_column_error)(d.message)){c=!1,_=n(e.version,3),await o.from("tracker_accounts").update({db_version:3}).eq("user_id",s);let r={user_id:s,name:t.name,active_entry_id:t.activeEntryID},i=await o.from("sheets").upsert(r,{onConflict:"user_id,name"}).select("id").single();if(null!==i.error)throw Error(`Failed to save sheet "${t.name}": ${i.error.message}`);let l=i.data.id;await a(o,l,t,c);continue}if(null!==d)throw Error(`Failed to save sheet "${t.name}": ${d.message}`);let u=l.id;await a(o,u,t,c)}}e.s(["write_supabase_db",0,s],99054)},30215,e=>{"use strict";var t=e.i(4394),r=e.i(45404),n=e.i(60016),i=e.i(33535),a=e.i(46593),s=e.i(10659),o=e.i(19784),l=e.i(31269),d=e.i(13865),u=e.i(65034),c=e.i(81157),_=e.i(82614),p=e.i(24377),m=e.i(57949),h=e.i(9566),v=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),w=e.i(68194),E=e.i(29207),y=e.i(24957),x=e.i(3896),b=e.i(95822),S=e.i(32806),R=e.i(99054);async function D(e){let t=await (0,b.read_supabase_db)(e),r=await (0,x.read_local_db_if_exists)(),n=null===r?t:(0,y.merge_time_tracker_dbs)(r,t,"incoming");return await (0,S.write_local_db)(n),await (0,R.write_supabase_db)(n,e),n}async function N(e){await D(e)}async function T(){try{let e=await (0,E.get_authenticated_user_id)();if(null===e)return(0,w.api_error_response)(Error("Sign in required"),401);return await N(e),g.NextResponse.json({ok:!0})}catch(e){return(0,w.api_error_response)(e,500)}}e.s(["POST",0,T],90260);var I=e.i(90260);let $=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sync/pull/route",pathname:"/api/sync/pull",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sync/pull/route.ts",nextConfigOutput:"standalone",userland:I,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:C,serverHooks:q}=$;async function k(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),$.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sync/pull/route";g=g.replace(/\/index$/,"")||"/";let w=await $.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,deploymentId:y,params:x,nextConfig:b,parsedUrl:S,isDraftMode:R,prerenderManifest:D,routerServerContext:N,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,resolvedPathname:A,clientReferenceManifest:C,serverActionsManifest:q}=w,k=(0,o.normalizeAppPath)(g),O=!!(D.dynamicRoutes[k]||D.routes[A]),F=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,S,!1):t.end("This page could not be found"),null);if(O&&!R){let e=!!D.routes[A],t=D.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await F();throw new v.NoFallbackError}}let j=null;!O||$.isDev||R||(j="/index"===(j=A)?"/":j);let P=!0===$.isDev||!O,M=O&&!P;q&&C&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:C,serverActionsManifest:q});let B=e.method||"GET",H=(0,a.getTracer)(),U=H.getActiveScopeSpan(),V=!!(null==N?void 0:N.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),K=(0,i.getRequestMeta)(e,"incrementalCache")||await $.getIncrementalCache(e,b,D,L);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let X={params:x,previewProps:D.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:P,incrementalCache:K,cacheLifeProfiles:b.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>$.onRequestError(e,t,n,i,N)},sharedContext:{buildId:E,deploymentId:y}},G=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let i,s=async e=>$.handle(W,X).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${B} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${B} ${g}`)}),o=async i=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&T&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=X.renderOpts.fetchMetrics;let o=X.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=X.renderOpts.collectedTags;if(!O)return await (0,_.sendResponse)(G,J,a,X.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[h.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:X.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await $.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),t}},d=await $.handleResponse({req:e,nextConfig:b,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:D,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:I,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!O)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",T?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),R&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&O||u.delete(h.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,m.getCacheControlHeader)(d.cacheControl)),await (0,_.sendResponse)(G,J,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};V&&U?await o(U):(i=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${B} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},o),void 0,!V))}catch(t){if(t instanceof v.NoFallbackError||await $.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,N),O)throw t;return await (0,_.sendResponse)(G,J,new Response(null,{status:500})),null}}e.s(["handler",0,k,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:C})},"routeModule",0,$,"serverHooks",0,q,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,C],30215)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0jvridy._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},68194,e=>{"use strict";var t=e.i(76386);e.s(["api_error_response",0,function(e,r=400){let n=e instanceof Error?e.message:String(e);return t.NextResponse.json({error:n},{status:r})}])},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),a=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,a,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:a,archived:s})=>({id:e,description:n,tags:i,notes:a.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===s?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,a=void 0===n.version?1:n.version;if(a>t.DB_VERSION||a<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;a<t.DB_VERSION;){let e=a+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${a} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);a=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),a=e.i(30853),s=e.i(93361),o=e.i(24507),l=e.i(47143),d=e.i(62775),u=e.i(16366);async function c(e,t=n.DB_PATH){let i=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,a.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,s.gen_db)();return await c(t,e),t}let h=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(h)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let v=(0,o.migrate_json_db)(u);u=v.json_db;let m=(0,i.convert_json_db)(u),f=v.did_migrate,g=(0,d.reconcile_stale_active_entry_ids)(m),w=(0,l.dedupe_tracker_db_sheet_entries)(m);return(f||g||w)&&await c(m,e),m}e.s(["write_local_db",0,c],32806),e.s(["read_local_db",0,_],71786)},29207,e=>{"use strict";var t=e.i(5313),r=e.i(36117);async function n(){if(!(0,t.is_supabase_configured)())return null;let e=await (0,r.create_server_supabase_client)(),{data:{user:n}}=await e.auth.getUser();return n?.id??null}e.s(["get_authenticated_user_id",0,n])},24957,49867,14424,95822,e=>{"use strict";var t=e.i(72507),r=e.i(93361),n=e.i(13690);function i(e,t,r){return!0===("incoming"===r?t:e)||void 0}var a=e.i(20253),s=e.i(62775);function o(e,t){let r=new Set,n=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;r.has(e)||(r.add(e),n.push(i))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}function l(e,t){if(null===e)return null;let r=t.find(t=>t.id===e);return void 0===r||null!==r.end?null:e}e.s(["merge_time_tracker_dbs",0,function(e,d,u="incoming"){let c=new Set;for(let t of e.sheets)c.add(t.name);for(let e of d.sheets)c.add(e.name);let _=[...c].map(t=>{let n=e.sheets.find(e=>e.name===t),s=d.sheets.find(e=>e.name===t);if(void 0===n&&void 0===s)return(0,r.gen_sheet)(t);if(void 0===n)return s;if(void 0===s)return n;let c=new Set;for(let e of n.entries)c.add(e.id);for(let e of s.entries)c.add(e.id);let _=[...c].sort((e,t)=>e-t).map(e=>{let t=n.entries.find(t=>t.id===e),r=s.entries.find(t=>t.id===e);if(void 0===t)return r;if(void 0===r)return t;let a=function(e,t,r){let n=null===e.end,i=null===t.end;if(n&&!i||i&&!n){let n="base"===r?e:t,i=n===e?t:e;return{...n,notes:o(n.notes,i.notes)}}if(n&&i){let n=t.start.getTime()>e.start.getTime()||t.start.getTime()===e.start.getTime()&&"incoming"===r,i=n?t:e,a=n?e:t;return{...i,notes:o(i.notes,a.notes)}}let a=e.end?.getTime()??0,s=t.end?.getTime()??0;if(a!==s){let r=a>s?e:t,n=r===e?t:e;return{...r,notes:o(r.notes,n.notes)}}let l="incoming"===r?t:e,d=l===e?t:e;return{...l,notes:o(l.notes,d.notes)}}(t,r,u);return!0===i(t.archived,r.archived,u)?{...a,archived:!0}:a}),p=function(e,t,r,n){let i=null===e?null:r.find(t=>t.id===e)??null,a=null===t?null:r.find(e=>e.id===t)??null;if(null===i&&null===a)return null;if(null===i)return l(a.id,r);if(null===a)return l(i.id,r);if(null===i.end&&null!==a.end)return"base"===n?i.id:null;if(null===a.end&&null!==i.end)return"base"===n?null:a.id;if(null===i.end&&null===a.end)return i.start.getTime()===a.start.getTime()?l("incoming"===n?a.id:i.id,r):l(i.start.getTime()>a.start.getTime()?i.id:a.id,r);let s=i.end.getTime(),o=a.end.getTime();return s===o?l("incoming"===n?a.id:i.id,r):l(s>o?i.id:a.id,r)}(n.activeEntryID,s.activeEntryID,_,u),h=i(n?.archived,s?.archived,u);return{name:t,entries:(0,a.dedupe_sheet_entries_by_id)(_),activeEntryID:p,...!0===h?{archived:!0}:{}}});_.sort((e,t)=>e.name.localeCompare(t.name));let p=function(e,t,r,i){let a=new Set(r.map(e=>e.name)),s=null!==e&&a.has(e),o=null!==t&&a.has(t);if(s&&o){let a=r.find(t=>t.name===e),s=r.find(e=>e.name===t),o=void 0!==a&&null!==(0,n.find_running_entry_on_sheet)(a),l=void 0!==s&&null!==(0,n.find_running_entry_on_sheet)(s);return o&&!l?e:l&&!o||"incoming"===i?t:e}if(o)return t;if(s)return e;let l=r.find(e=>null!==(0,n.find_running_entry_on_sheet)(e));return l?.name??r[0]?.name??null}(e.activeSheetName,d.activeSheetName,_,u),h={version:Math.max(e.version,d.version,t.DB_VERSION),sheets:_,activeSheetName:p};return(0,s.reconcile_stale_active_entry_ids)(h),h}],24957);var d=e.i(36117);function u(e){return e.includes("archived")&&e.includes("does not exist")}function c(e){return(e??1)>=4}async function _(e){let n=await (0,d.create_server_supabase_client)(),{data:i,error:o}=await n.from("tracker_accounts").select("active_sheet_name, db_version").eq("user_id",e).maybeSingle();if(null!==o)throw Error(`Failed to load tracker account: ${o.message}`);if(null===i)return(0,r.gen_db)();let l=c(i.db_version),u=await p(n,e,l);l=u.include_archived;let _=u.sheets;if(0===_.length)return{version:i.db_version??t.DB_VERSION,activeSheetName:i.active_sheet_name,sheets:[]};let v=_.map(e=>e.id),m=await h(n,v,l),{data:f,error:g}=await n.from("entry_notes").select("sheet_id, entry_id, note_index, noted_at, text").in("sheet_id",v).order("note_index",{ascending:!0});if(null!==g)throw Error(`Failed to load entry notes: ${g.message}`);let w=new Map;for(let e of f??[]){let t=`${e.sheet_id}:${e.entry_id}`,r=w.get(t)??[];r.push({text:e.text,timestamp:new Date(e.noted_at)}),w.set(t,r)}let y=new Map;for(let e of m){let t=`${e.sheet_id}:${e.id}`,r=y.get(e.sheet_id)??[];r.push({id:e.id,description:e.description,tags:e.tags??[],start:new Date(e.start_at),end:null===e.end_at?null:new Date(e.end_at),notes:w.get(t)??[],...!0===e.archived?{archived:!0}:{}}),y.set(e.sheet_id,r)}let E=_.map(e=>{let t=(0,r.gen_sheet)(e.name,(0,a.dedupe_sheet_entries_by_id)(y.get(e.id)??[]),e.active_entry_id);return!0===e.archived&&(t.archived=!0),t}),x={version:l?i.db_version??t.DB_VERSION:Math.min(i.db_version??t.DB_VERSION,3),activeSheetName:i.active_sheet_name,sheets:E};return(0,s.reconcile_stale_active_entry_ids)(x),x}async function p(e,t,r){if(r){let{data:r,error:n}=await e.from("sheets").select("id, name, active_entry_id, archived").eq("user_id",t).order("name",{ascending:!0});if(null!==n&&u(n.message))return await e.from("tracker_accounts").update({db_version:3}).eq("user_id",t),p(e,t,!1);if(null!==n)throw Error(`Failed to load sheets: ${n.message}`);return{include_archived:!0,sheets:r??[]}}let{data:n,error:i}=await e.from("sheets").select("id, name, active_entry_id").eq("user_id",t).order("name",{ascending:!0});if(null!==i)throw Error(`Failed to load sheets: ${i.message}`);return{include_archived:!1,sheets:n??[]}}async function h(e,t,r){if(r){let{data:r,error:n}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags, archived").in("sheet_id",t).order("id",{ascending:!0});if(null!==n)throw Error(`Failed to load entries: ${n.message}`);return r??[]}let{data:n,error:i}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags").in("sheet_id",t).order("id",{ascending:!0});if(null!==i)throw Error(`Failed to load entries: ${i.message}`);return n??[]}e.s(["is_missing_archived_column_error",0,u],49867),e.s(["supports_supabase_archive_columns",0,c],14424),e.s(["read_supabase_db",0,_],95822)},33496,e=>{"use strict";var t=e.i(2157),r=e.i(72507),n=e.i(24957),i=e.i(71786),a=e.i(95822),s=e.i(32806);async function o(e){let o,l=await (0,a.read_supabase_db)(e);try{await t.promises.access(r.DB_PATH),o=await (0,i.read_local_db)()}catch{return!1}if(0===o.sheets.length)return!1;let d=0===l.sheets.length?o:(0,n.merge_time_tracker_dbs)(l,o,"incoming");return await (0,s.write_local_db)(d),!0}e.s(["import_local_db_to_supabase",0,o])},12675,e=>{"use strict";var t=e.i(36117);async function r(e,r){let n=await (0,t.create_server_supabase_client)(),{data:i,error:a}=await n.from("tracker_accounts").select("ui_preferences").eq("user_id",e).maybeSingle();if(null!==a)throw Error(`Failed to read UI preferences: ${a.message}`);let s=i?.ui_preferences,o={};if("object"==typeof s&&null!==s&&!Array.isArray(s))for(let[e,t]of Object.entries(s))"string"==typeof t&&(o[e]=t);let l={...o,...r},{error:d}=await n.from("tracker_accounts").upsert({user_id:e,ui_preferences:l},{onConflict:"user_id"});if(null!==d)throw Error(`Failed to save UI preferences: ${d.message}`);return l}e.s(["write_supabase_ui_preferences",0,r])},16124,e=>{"use strict";var t=e.i(4394),r=e.i(45404),n=e.i(60016),i=e.i(33535),a=e.i(46593),s=e.i(10659),o=e.i(19784),l=e.i(31269),d=e.i(13865),u=e.i(65034),c=e.i(81157),_=e.i(82614),p=e.i(24377),h=e.i(57949),v=e.i(9566),m=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),w=e.i(68194),y=e.i(29207),E=e.i(33496),x=e.i(12675);async function b(e){try{let t=await (0,y.get_authenticated_user_id)();if(null===t)return(0,w.api_error_response)(Error("Sign in required"),401);let r=await (0,E.import_local_db_to_supabase)(t),n={};try{n=await e.json()}catch{n={}}let i=n.preferences??{};return Object.keys(i).length>0&&await (0,x.write_supabase_ui_preferences)(t,i),g.NextResponse.json({imported:r})}catch(e){return(0,w.api_error_response)(e,500)}}e.s(["POST",0,b],45041);var R=e.i(45041);let S=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sync/import/route",pathname:"/api/sync/import",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/sync/import/route.ts",nextConfigOutput:"standalone",userland:R,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:D,serverHooks:T}=S;async function I(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),S.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/sync/import/route";g=g.replace(/\/index$/,"")||"/";let w=await S.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,deploymentId:E,params:x,nextConfig:b,parsedUrl:R,isDraftMode:N,prerenderManifest:D,routerServerContext:T,isOnDemandRevalidate:I,revalidateOnlyGenerated:A,resolvedPathname:C,clientReferenceManifest:O,serverActionsManifest:j}=w,k=(0,o.normalizeAppPath)(g),q=!!(D.dynamicRoutes[k]||D.routes[C]),$=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,R,!1):t.end("This page could not be found"),null);if(q&&!N){let e=!!D.routes[C],t=D.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await $();throw new m.NoFallbackError}}let P=null;!q||S.isDev||N||(P="/index"===(P=C)?"/":P);let B=!0===S.isDev||!q,M=q&&!B;j&&O&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:O,serverActionsManifest:j});let H=e.method||"GET",F=(0,a.getTracer)(),U=F.getActiveScopeSpan(),V=!!(null==T?void 0:T.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),K=(0,i.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,b,D,L);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let X={params:x,previewProps:D.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:B,incrementalCache:K,cacheLifeProfiles:b.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>S.onRequestError(e,t,n,i,T)},sharedContext:{buildId:y,deploymentId:E}},G=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let i,s=async e=>S.handle(W,X).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${H} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${H} ${g}`)}),o=async i=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&I&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=X.renderOpts.fetchMetrics;let o=X.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=X.renderOpts.collectedTags;if(!q)return await (0,_.sendResponse)(G,J,a,X.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:X.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await S.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:I})},!1,T),t}},d=await S.handleResponse({req:e,nextConfig:b,cacheKey:P,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:D,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!q)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",I?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&q||u.delete(v.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,_.sendResponse)(G,J,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};V&&U?await o(U):(i=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${H} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!V))}catch(t){if(t instanceof m.NoFallbackError||await S.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:I})},!1,T),q)throw t;return await (0,_.sendResponse)(G,J,new Response(null,{status:500})),null}}e.s(["handler",0,I,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:D})},"routeModule",0,S,"serverHooks",0,T,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,D],16124)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0mp257.._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},72507,e=>{"use strict";var t=e.i(60526),r=e.i(50227);let n="db.json",i=r.default.join(t.default.homedir(),".super-time-tracker"),a=r.default.join(i,n);e.s(["DB_FILE_NAME",0,n,"DB_PATH",0,a,"DB_VERSION",0,4,"DEFAULT_SHEET_NAME",0,"main"])},93361,e=>{"use strict";var t=e.i(72507);function r(e,t=[],n=null){if(0===e.length)throw Error("New sheet name must not be empty");if(null!==n&&void 0===t.find(({id:e})=>e===n))throw Error("New sheet active entry does not exist");return{name:e,entries:t,activeEntryID:n}}e.s(["gen_db",0,function(){return{version:t.DB_VERSION,sheets:[r(t.DEFAULT_SHEET_NAME)],activeSheetName:t.DEFAULT_SHEET_NAME}},"gen_sheet",0,r])},13690,e=>{"use strict";e.s(["find_running_entry_on_sheet",0,function(e){if(null===e.activeEntryID)return null;let t=e.entries.find(({id:t})=>t===e.activeEntryID);return void 0===t||null!==t.end?null:t}])},20253,e=>{"use strict";e.s(["dedupe_sheet_entries_by_id",0,function(e){let t=new Map;for(let r of e){let e=t.get(r.id);if(void 0===e){t.set(r.id,r);continue}null===r.end&&null!==e.end&&t.set(r.id,r)}return[...t.values()].sort((e,t)=>e.id-t.id)}])},62775,e=>{"use strict";var t=e.i(13690);e.s(["reconcile_stale_active_entry_ids",0,function(e){let r=!1;for(let n of e.sheets)null!==n.activeEntryID&&null===(0,t.find_running_entry_on_sheet)(n)&&(n.activeEntryID=null,r=!0);return r}])},72127,30853,e=>{"use strict";e.s(["convert_json_db",0,function(e){let{sheets:t,version:r,activeSheetName:n}=e;return{version:r,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r,archived:n})=>({name:e,activeEntryID:r,...!0===n?{archived:!0}:{},entries:t.map(({id:e,start:t,end:r,description:n,tags:i,notes:a,archived:s})=>({id:e,description:n,tags:i,notes:a.map(({timestamp:e,text:t})=>({text:t,timestamp:new Date(e)})),start:new Date(t),end:null===r?null:new Date(r),...!0===s?{archived:!0}:{}}))}))}}],72127);var t=e.i(2157);async function r(e){try{await t.promises.mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==(null!==e&&"object"==typeof e&&"code"in e&&"string"==typeof e.code?e.code:null))throw e}}e.s(["ensure_dir_exists",0,r],30853)},24507,e=>{"use strict";var t=e.i(72507);let r={2:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(1!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 2.`);return{version:2,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n})=>({tags:[],notes:[],id:e,end:r,start:t,description:n}))}))}},3:function(e){let{sheets:t,version:r,activeSheetName:n}=e;if(2!==r&&void 0!==r)throw Error(`DB is version ${r}, cannot migrate to version 3.`);return{version:3,activeSheetName:n,sheets:t.map(({name:e,entries:t,activeEntryID:r})=>({name:e,activeEntryID:r,entries:t.map(({id:e,start:t,end:r,description:n,tags:i})=>({notes:[],tags:i,id:e,end:r,start:t,description:n}))}))}},4:function(e){let{version:t,activeSheetName:r,sheets:n}=e;if(3!==t)throw Error(`DB is version ${t}, cannot migrate to version 4.`);return{version:4,activeSheetName:r,sheets:n}}};e.s(["migrate_json_db",0,function(e){let n=e,i=!1,a=void 0===n.version?1:n.version;if(a>t.DB_VERSION||a<1)throw Error(`Unknown DB version ${n.version}, cannot load.`);for(;a<t.DB_VERSION;){let e=a+1,t=r[e];if(void 0===t)throw Error(`Missing migration from version ${a} to ${e}.`);if((n=t(n)).version!==e)throw Error(`Invalid migration output for version ${e}.`);a=e,i=!0}return{json_db:n,did_migrate:i}}],24507)},47143,e=>{"use strict";var t=e.i(20253);e.s(["dedupe_tracker_db_sheet_entries",0,function(e){let r=!1;for(let n of e.sheets){let e=(0,t.dedupe_sheet_entries_by_id)(n.entries);e.length!==n.entries.length&&(r=!0,n.entries=e)}return r}])},16366,e=>{"use strict";e.s(["convert_db_to_json",0,function(e){let t=e.sheets.map(e=>({name:e.name,activeEntryID:e.activeEntryID,...!0===e.archived?{archived:!0}:{},entries:e.entries.map(e=>({id:e.id,description:e.description,tags:e.tags,start:e.start.getTime(),end:null===e.end?null:e.end.getTime(),notes:e.notes.map(e=>({text:e.text,timestamp:e.timestamp.getTime()})),...!0===e.archived?{archived:!0}:{}}))}));return{version:e.version,activeSheetName:e.activeSheetName,sheets:t}}])},71786,32806,e=>{"use strict";var t=e.i(50227),r=e.i(2157),n=e.i(72507),i=e.i(72127),a=e.i(30853),s=e.i(93361),o=e.i(24507),l=e.i(47143),d=e.i(62775),u=e.i(16366);async function c(e,t=n.DB_PATH){let i=JSON.stringify((0,u.convert_db_to_json)(e));try{await r.promises.writeFile(t,i)}catch(e){throw Error(`Failed to save DB: ${String(e)}`,{cause:e})}}async function _(e=n.DB_PATH){let u,p=t.default.dirname(e);await (0,a.ensure_dir_exists)(p);try{await r.promises.access(e)}catch{let t=(0,s.gen_db)();return await c(t,e),t}let h=await r.promises.readFile(e,"utf-8");try{u=JSON.parse(h)}catch(t){throw Error(`DB at ${e} is invalid JSON: ${String(t)}`,{cause:t})}let v=(0,o.migrate_json_db)(u);u=v.json_db;let m=(0,i.convert_json_db)(u),f=v.did_migrate,g=(0,d.reconcile_stale_active_entry_ids)(m),w=(0,l.dedupe_tracker_db_sheet_entries)(m);return(f||g||w)&&await c(m,e),m}e.s(["write_local_db",0,c],32806),e.s(["read_local_db",0,_],71786)},24957,49867,14424,95822,e=>{"use strict";var t=e.i(72507),r=e.i(93361),n=e.i(13690);function i(e,t,r){return!0===("incoming"===r?t:e)||void 0}var a=e.i(20253),s=e.i(62775);function o(e,t){let r=new Set,n=[];for(let i of[...e,...t]){let e=`${i.timestamp.getTime()}:${i.text}`;r.has(e)||(r.add(e),n.push(i))}return n.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),n}function l(e,t){if(null===e)return null;let r=t.find(t=>t.id===e);return void 0===r||null!==r.end?null:e}e.s(["merge_time_tracker_dbs",0,function(e,d,u="incoming"){let c=new Set;for(let t of e.sheets)c.add(t.name);for(let e of d.sheets)c.add(e.name);let _=[...c].map(t=>{let n=e.sheets.find(e=>e.name===t),s=d.sheets.find(e=>e.name===t);if(void 0===n&&void 0===s)return(0,r.gen_sheet)(t);if(void 0===n)return s;if(void 0===s)return n;let c=new Set;for(let e of n.entries)c.add(e.id);for(let e of s.entries)c.add(e.id);let _=[...c].sort((e,t)=>e-t).map(e=>{let t=n.entries.find(t=>t.id===e),r=s.entries.find(t=>t.id===e);if(void 0===t)return r;if(void 0===r)return t;let a=function(e,t,r){let n=null===e.end,i=null===t.end;if(n&&!i||i&&!n){let n="base"===r?e:t,i=n===e?t:e;return{...n,notes:o(n.notes,i.notes)}}if(n&&i){let n=t.start.getTime()>e.start.getTime()||t.start.getTime()===e.start.getTime()&&"incoming"===r,i=n?t:e,a=n?e:t;return{...i,notes:o(i.notes,a.notes)}}let a=e.end?.getTime()??0,s=t.end?.getTime()??0;if(a!==s){let r=a>s?e:t,n=r===e?t:e;return{...r,notes:o(r.notes,n.notes)}}let l="incoming"===r?t:e,d=l===e?t:e;return{...l,notes:o(l.notes,d.notes)}}(t,r,u);return!0===i(t.archived,r.archived,u)?{...a,archived:!0}:a}),p=function(e,t,r,n){let i=null===e?null:r.find(t=>t.id===e)??null,a=null===t?null:r.find(e=>e.id===t)??null;if(null===i&&null===a)return null;if(null===i)return l(a.id,r);if(null===a)return l(i.id,r);if(null===i.end&&null!==a.end)return"base"===n?i.id:null;if(null===a.end&&null!==i.end)return"base"===n?null:a.id;if(null===i.end&&null===a.end)return i.start.getTime()===a.start.getTime()?l("incoming"===n?a.id:i.id,r):l(i.start.getTime()>a.start.getTime()?i.id:a.id,r);let s=i.end.getTime(),o=a.end.getTime();return s===o?l("incoming"===n?a.id:i.id,r):l(s>o?i.id:a.id,r)}(n.activeEntryID,s.activeEntryID,_,u),h=i(n?.archived,s?.archived,u);return{name:t,entries:(0,a.dedupe_sheet_entries_by_id)(_),activeEntryID:p,...!0===h?{archived:!0}:{}}});_.sort((e,t)=>e.name.localeCompare(t.name));let p=function(e,t,r,i){let a=new Set(r.map(e=>e.name)),s=null!==e&&a.has(e),o=null!==t&&a.has(t);if(s&&o){let a=r.find(t=>t.name===e),s=r.find(e=>e.name===t),o=void 0!==a&&null!==(0,n.find_running_entry_on_sheet)(a),l=void 0!==s&&null!==(0,n.find_running_entry_on_sheet)(s);return o&&!l?e:l&&!o||"incoming"===i?t:e}if(o)return t;if(s)return e;let l=r.find(e=>null!==(0,n.find_running_entry_on_sheet)(e));return l?.name??r[0]?.name??null}(e.activeSheetName,d.activeSheetName,_,u),h={version:Math.max(e.version,d.version,t.DB_VERSION),sheets:_,activeSheetName:p};return(0,s.reconcile_stale_active_entry_ids)(h),h}],24957);var d=e.i(36117);function u(e){return e.includes("archived")&&e.includes("does not exist")}function c(e){return(e??1)>=4}async function _(e){let n=await (0,d.create_server_supabase_client)(),{data:i,error:o}=await n.from("tracker_accounts").select("active_sheet_name, db_version").eq("user_id",e).maybeSingle();if(null!==o)throw Error(`Failed to load tracker account: ${o.message}`);if(null===i)return(0,r.gen_db)();let l=c(i.db_version),u=await p(n,e,l);l=u.include_archived;let _=u.sheets;if(0===_.length)return{version:i.db_version??t.DB_VERSION,activeSheetName:i.active_sheet_name,sheets:[]};let v=_.map(e=>e.id),m=await h(n,v,l),{data:f,error:g}=await n.from("entry_notes").select("sheet_id, entry_id, note_index, noted_at, text").in("sheet_id",v).order("note_index",{ascending:!0});if(null!==g)throw Error(`Failed to load entry notes: ${g.message}`);let w=new Map;for(let e of f??[]){let t=`${e.sheet_id}:${e.entry_id}`,r=w.get(t)??[];r.push({text:e.text,timestamp:new Date(e.noted_at)}),w.set(t,r)}let E=new Map;for(let e of m){let t=`${e.sheet_id}:${e.id}`,r=E.get(e.sheet_id)??[];r.push({id:e.id,description:e.description,tags:e.tags??[],start:new Date(e.start_at),end:null===e.end_at?null:new Date(e.end_at),notes:w.get(t)??[],...!0===e.archived?{archived:!0}:{}}),E.set(e.sheet_id,r)}let y=_.map(e=>{let t=(0,r.gen_sheet)(e.name,(0,a.dedupe_sheet_entries_by_id)(E.get(e.id)??[]),e.active_entry_id);return!0===e.archived&&(t.archived=!0),t}),x={version:l?i.db_version??t.DB_VERSION:Math.min(i.db_version??t.DB_VERSION,3),activeSheetName:i.active_sheet_name,sheets:y};return(0,s.reconcile_stale_active_entry_ids)(x),x}async function p(e,t,r){if(r){let{data:r,error:n}=await e.from("sheets").select("id, name, active_entry_id, archived").eq("user_id",t).order("name",{ascending:!0});if(null!==n&&u(n.message))return await e.from("tracker_accounts").update({db_version:3}).eq("user_id",t),p(e,t,!1);if(null!==n)throw Error(`Failed to load sheets: ${n.message}`);return{include_archived:!0,sheets:r??[]}}let{data:n,error:i}=await e.from("sheets").select("id, name, active_entry_id").eq("user_id",t).order("name",{ascending:!0});if(null!==i)throw Error(`Failed to load sheets: ${i.message}`);return{include_archived:!1,sheets:n??[]}}async function h(e,t,r){if(r){let{data:r,error:n}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags, archived").in("sheet_id",t).order("id",{ascending:!0});if(null!==n)throw Error(`Failed to load entries: ${n.message}`);return r??[]}let{data:n,error:i}=await e.from("entries").select("sheet_id, id, start_at, end_at, description, tags").in("sheet_id",t).order("id",{ascending:!0});if(null!==i)throw Error(`Failed to load entries: ${i.message}`);return n??[]}e.s(["is_missing_archived_column_error",0,u],49867),e.s(["supports_supabase_archive_columns",0,c],14424),e.s(["read_supabase_db",0,_],95822)},33496,e=>{"use strict";var t=e.i(2157),r=e.i(72507),n=e.i(24957),i=e.i(71786),a=e.i(95822),s=e.i(32806);async function o(e){let o,l=await (0,a.read_supabase_db)(e);try{await t.promises.access(r.DB_PATH),o=await (0,i.read_local_db)()}catch{return!1}if(0===o.sheets.length)return!1;let d=0===l.sheets.length?o:(0,n.merge_time_tracker_dbs)(l,o,"incoming");return await (0,s.write_local_db)(d),!0}e.s(["import_local_db_to_supabase",0,o])},25594,e=>{"use strict";var t=e.i(4394),r=e.i(45404),n=e.i(60016),i=e.i(33535),a=e.i(46593),s=e.i(10659),o=e.i(19784),l=e.i(31269),d=e.i(13865),u=e.i(65034),c=e.i(81157),_=e.i(82614),p=e.i(24377),h=e.i(57949),v=e.i(9566),m=e.i(93695);e.i(46179);var f=e.i(42108),g=e.i(76386),w=e.i(36117),E=e.i(33496);async function y(e){let{searchParams:t,origin:r}=new URL(e.url),n=t.get("code"),i=t.get("next")??"/";if(null===n)return g.NextResponse.redirect(`${r}/login?error=auth`);let a=await (0,w.create_server_supabase_client)(),{error:s}=await a.auth.exchangeCodeForSession(n);if(null!==s)return g.NextResponse.redirect(`${r}/login?error=auth`);let{data:{user:o}}=await a.auth.getUser();return null!==o&&await (0,E.import_local_db_to_supabase)(o.id),g.NextResponse.redirect(`${r}${i}`)}e.s(["GET",0,y],46523);var x=e.i(46523);let b=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/auth/callback/route",pathname:"/auth/callback",filename:"route",bundlePath:""},distDir:"next-output",relativeProjectDir:"",resolvedPagePath:"[project]/app/auth/callback/route.ts",nextConfigOutput:"standalone",userland:x,...{}}),{workAsyncStorage:R,workUnitAsyncStorage:N,serverHooks:S}=b;async function D(e,t,n){n.requestMeta&&(0,i.setRequestMeta)(e,n.requestMeta),b.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/auth/callback/route";g=g.replace(/\/index$/,"")||"/";let w=await b.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,deploymentId:y,params:x,nextConfig:R,parsedUrl:N,isDraftMode:S,prerenderManifest:D,routerServerContext:T,isOnDemandRevalidate:I,revalidateOnlyGenerated:A,resolvedPathname:C,clientReferenceManifest:k,serverActionsManifest:$}=w,O=(0,o.normalizeAppPath)(g),q=!!(D.dynamicRoutes[O]||D.routes[C]),j=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,N,!1):t.end("This page could not be found"),null);if(q&&!S){let e=!!D.routes[C],t=D.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await j();throw new m.NoFallbackError}}let P=null;!q||b.isDev||S||(P="/index"===(P=C)?"/":P);let B=!0===b.isDev||!q,M=q&&!B;$&&k&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:k,serverActionsManifest:$});let H=e.method||"GET",F=(0,a.getTracer)(),U=F.getActiveScopeSpan(),V=!!(null==T?void 0:T.isWrappedByNextServer),L=!!(0,i.getRequestMeta)(e,"minimalMode"),K=(0,i.getRequestMeta)(e,"incrementalCache")||await b.getIncrementalCache(e,R,D,L);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let G={params:x,previewProps:D.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:B,incrementalCache:K,cacheLifeProfiles:R.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>b.onRequestError(e,t,n,i,T)},sharedContext:{buildId:E,deploymentId:y}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(X,(0,d.signalFromNodeResponse)(t));try{let i,s=async e=>b.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${H} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${H} ${g}`)}),o=async i=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!L&&I&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!q)return await (0,_.sendResponse)(X,J,a,G.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[v.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:I})},!1,T),t}},d=await b.handleResponse({req:e,nextConfig:R,cacheKey:P,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:D,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:L});if(!q)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});L||t.setHeader("x-nextjs-cache",I?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);return L&&q||u.delete(v.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,_.sendResponse)(X,J,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};V&&U?await o(U):(i=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${H} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!V))}catch(t){if(t instanceof m.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:I})},!1,T),q)throw t;return await (0,_.sendResponse)(X,J,new Response(null,{status:500})),null}}e.s(["handler",0,D,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:R,workUnitAsyncStorage:N})},"routeModule",0,b,"serverHooks",0,S,"workAsyncStorage",0,R,"workUnitAsyncStorage",0,N],25594)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0nhm~x6._.js.map