@kimuson/claude-code-viewer 0.2.4 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/standalone/.next/BUILD_ID +1 -1
  2. package/dist/standalone/.next/app-build-manifest.json +15 -15
  3. package/dist/standalone/.next/build-manifest.json +2 -2
  4. package/dist/standalone/.next/prerender-manifest.json +3 -3
  5. package/dist/standalone/.next/server/app/_not-found/page.js +1 -1
  6. package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  7. package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/dist/standalone/.next/server/app/api/[[...route]]/route.js +3 -3
  9. package/dist/standalone/.next/server/app/api/[[...route]]/route_client-reference-manifest.js +1 -1
  10. package/dist/standalone/.next/server/app/page.js +1 -1
  11. package/dist/standalone/.next/server/app/page.js.nft.json +1 -1
  12. package/dist/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  13. package/dist/standalone/.next/server/app/projects/[projectId]/page.js +2 -2
  14. package/dist/standalone/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  15. package/dist/standalone/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  16. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js +2 -2
  17. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page.js.nft.json +1 -1
  18. package/dist/standalone/.next/server/app/projects/[projectId]/sessions/[sessionId]/page_client-reference-manifest.js +1 -1
  19. package/dist/standalone/.next/server/app/projects/page.js +1 -1
  20. package/dist/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  21. package/dist/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  22. package/dist/standalone/.next/server/chunks/216.js +5 -0
  23. package/dist/standalone/.next/server/chunks/440.js +5 -0
  24. package/dist/standalone/.next/server/chunks/725.js +5 -0
  25. package/dist/standalone/.next/server/chunks/744.js +5 -0
  26. package/dist/standalone/.next/server/chunks/791.js +1 -1
  27. package/dist/standalone/.next/server/chunks/8.js +9 -0
  28. package/dist/standalone/.next/server/chunks/837.js +1 -0
  29. package/dist/standalone/.next/server/chunks/842.js +9 -0
  30. package/dist/standalone/.next/server/chunks/866.js +1 -0
  31. package/dist/standalone/.next/server/chunks/880.js +1 -0
  32. package/dist/standalone/.next/server/chunks/921.js +5 -0
  33. package/dist/standalone/.next/server/chunks/946.js +1 -0
  34. package/dist/standalone/.next/server/next-font-manifest.js +1 -1
  35. package/dist/standalone/.next/server/next-font-manifest.json +1 -1
  36. package/dist/standalone/.next/server/pages/500.html +1 -1
  37. package/dist/standalone/.next/server/pages/_app/build-manifest.json +24 -0
  38. package/dist/standalone/.next/server/pages/_app/client-build-manifest.json +5 -0
  39. package/dist/standalone/.next/server/pages/_app/next-font-manifest.json +6 -0
  40. package/dist/standalone/.next/server/pages/_app/pages-manifest.json +3 -0
  41. package/dist/standalone/.next/server/pages/_app/react-loadable-manifest.json +1 -0
  42. package/dist/standalone/.next/server/pages/_app.js.map +5 -0
  43. package/dist/standalone/.next/server/pages/_document/next-font-manifest.json +6 -0
  44. package/dist/standalone/.next/server/pages/_document/pages-manifest.json +3 -0
  45. package/dist/standalone/.next/server/pages/_document/react-loadable-manifest.json +1 -0
  46. package/dist/standalone/.next/server/pages/_document.js.map +5 -0
  47. package/dist/standalone/.next/server/pages/_error/build-manifest.json +24 -0
  48. package/dist/standalone/.next/server/pages/_error/client-build-manifest.json +5 -0
  49. package/dist/standalone/.next/server/pages/_error/next-font-manifest.json +6 -0
  50. package/dist/standalone/.next/server/pages/_error/pages-manifest.json +3 -0
  51. package/dist/standalone/.next/server/pages/_error/react-loadable-manifest.json +1 -0
  52. package/dist/standalone/.next/server/pages/_error.js.map +5 -0
  53. package/dist/standalone/.next/server/pages-manifest.json +1 -1
  54. package/dist/standalone/.next/server/server-reference-manifest.json +1 -1
  55. package/dist/standalone/.next/static/-C_aw5qp4WRpZLxKvls_q/_buildManifest.js +1 -0
  56. package/dist/standalone/.next/static/-C_aw5qp4WRpZLxKvls_q/_ssgManifest.js +1 -0
  57. package/dist/standalone/.next/static/23uvba8RlaxCaoa5OiBQP/_buildManifest.js +1 -0
  58. package/dist/standalone/.next/static/23uvba8RlaxCaoa5OiBQP/_ssgManifest.js +1 -0
  59. package/dist/standalone/.next/static/7c2VjICJUWm7vUD2fAum8/_buildManifest.js +1 -0
  60. package/dist/standalone/.next/static/7c2VjICJUWm7vUD2fAum8/_ssgManifest.js +1 -0
  61. package/dist/standalone/.next/static/Da8e6NLQq01CAFo8O13j6/_buildManifest.js +1 -0
  62. package/dist/standalone/.next/static/Da8e6NLQq01CAFo8O13j6/_ssgManifest.js +1 -0
  63. package/dist/standalone/.next/static/GD7LQJ8gE1cW_fRed-j1C/_buildManifest.js +1 -0
  64. package/dist/standalone/.next/static/GD7LQJ8gE1cW_fRed-j1C/_ssgManifest.js +1 -0
  65. package/dist/standalone/.next/static/H-5h51WEzU2ys-hWA4OUt/_buildManifest.js +1 -0
  66. package/dist/standalone/.next/static/H-5h51WEzU2ys-hWA4OUt/_ssgManifest.js +1 -0
  67. package/dist/standalone/.next/static/L2hEa9LvG28lUDLLpdKW9/_buildManifest.js +1 -0
  68. package/dist/standalone/.next/static/L2hEa9LvG28lUDLLpdKW9/_ssgManifest.js +1 -0
  69. package/dist/standalone/.next/static/O43uyF0ac2ZdNoZ1ZCnKf/_buildManifest.js +1 -0
  70. package/dist/standalone/.next/static/O43uyF0ac2ZdNoZ1ZCnKf/_ssgManifest.js +1 -0
  71. package/dist/standalone/.next/static/PyI7qeky3k1jffXuSFrjs/_buildManifest.js +1 -0
  72. package/dist/standalone/.next/static/PyI7qeky3k1jffXuSFrjs/_ssgManifest.js +1 -0
  73. package/dist/standalone/.next/static/WqxyAkkmDIRWMgidzO8Db/_buildManifest.js +1 -0
  74. package/dist/standalone/.next/static/WqxyAkkmDIRWMgidzO8Db/_ssgManifest.js +1 -0
  75. package/dist/standalone/.next/static/Xc4x4pucjXfhABCgWmn1V/_buildManifest.js +1 -0
  76. package/dist/standalone/.next/static/Xc4x4pucjXfhABCgWmn1V/_ssgManifest.js +1 -0
  77. package/dist/standalone/.next/static/ZeOFUJB_IZeb5OILHne1z/_buildManifest.js +1 -0
  78. package/dist/standalone/.next/static/ZeOFUJB_IZeb5OILHne1z/_ssgManifest.js +1 -0
  79. package/dist/standalone/.next/static/chunks/105-a007546befae4563.js +1 -0
  80. package/dist/standalone/.next/static/chunks/185-711c14dc27c4bc61.js +1 -0
  81. package/dist/standalone/.next/static/chunks/24-ffb10c209d2142dc.js +1 -0
  82. package/dist/standalone/.next/static/chunks/281-795fb16f0b06afb8.js +1 -0
  83. package/dist/standalone/.next/static/chunks/496-dc59dbb8ba7e4539.js +1 -0
  84. package/dist/standalone/.next/static/chunks/498-00a3d5dd9837a27f.js +16 -0
  85. package/dist/standalone/.next/static/chunks/5-ab2b7527e79dd03f.js +1 -0
  86. package/dist/standalone/.next/static/chunks/5-c3f389512791ecb2.js +1 -0
  87. package/dist/standalone/.next/static/chunks/642-114376e98078b3eb.js +1 -0
  88. package/dist/standalone/.next/static/chunks/648-038543aa7a87beca.js +1 -0
  89. package/dist/standalone/.next/static/chunks/693-0937eaeea1ae4b33.js +1 -0
  90. package/dist/standalone/.next/static/chunks/693-5c7ba2352f548e34.js +1 -0
  91. package/dist/standalone/.next/static/chunks/693-7e9bae18be0d9c6b.js +1 -0
  92. package/dist/standalone/.next/static/chunks/693-b3b27b94a68ea0bc.js +1 -0
  93. package/dist/standalone/.next/static/chunks/693-c42159ca627810b6.js +1 -0
  94. package/dist/standalone/.next/static/chunks/693-c4a72446cbe56a20.js +1 -0
  95. package/dist/standalone/.next/static/chunks/693-e95ee9bc25076ecd.js +1 -0
  96. package/dist/standalone/.next/static/chunks/693-e99fc5f3437674b1.js +1 -0
  97. package/dist/standalone/.next/static/chunks/712-581ffe0ca01c6d44.js +16 -0
  98. package/dist/standalone/.next/static/chunks/719-ffb34f83f1a29ef9.js +16 -0
  99. package/dist/standalone/.next/static/chunks/888-4f8c8a1dbfc2f887.js +1 -0
  100. package/dist/standalone/.next/static/chunks/889-c7b6397ab2356461.js +16 -0
  101. package/dist/standalone/.next/static/chunks/[next]_entry_page-loader_ts_0196946f._.js +23 -0
  102. package/dist/standalone/.next/static/chunks/[next]_entry_page-loader_ts_0196946f._.js.map +6 -0
  103. package/dist/standalone/.next/static/chunks/[next]_entry_page-loader_ts_fa2ec1ea._.js +23 -0
  104. package/dist/standalone/.next/static/chunks/[next]_entry_page-loader_ts_fa2ec1ea._.js.map +6 -0
  105. package/dist/standalone/.next/static/chunks/[root-of-the-server]__092393de._.js +481 -0
  106. package/dist/standalone/.next/static/chunks/[root-of-the-server]__092393de._.js.map +6 -0
  107. package/dist/standalone/.next/static/chunks/[root-of-the-server]__45f039c3._.js +481 -0
  108. package/dist/standalone/.next/static/chunks/[root-of-the-server]__45f039c3._.js.map +6 -0
  109. package/dist/standalone/.next/static/chunks/app/layout-05c5414de7009244.js +1 -0
  110. package/dist/standalone/.next/static/chunks/app/layout-b6165efd2dda60fa.js +1 -0
  111. package/dist/standalone/.next/static/chunks/app/layout-dae4ccdd1163e4b9.js +1 -0
  112. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-1581695cbf18ca8f.js +1 -0
  113. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-2d759c1ef2fc1f3f.js +1 -0
  114. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-7a905fd82150cec4.js +1 -0
  115. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-994bb53630390872.js +1 -0
  116. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-b31f4471e31e815a.js +1 -0
  117. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/page-d26a7b8eac784a60.js +1 -0
  118. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-05274c303803f9e5.js +1 -0
  119. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-0e763809b4b33824.js +1 -0
  120. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-34e0546e8de7d155.js +1 -0
  121. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-4df39886af6c75d0.js +1 -0
  122. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-57ace7dee9bb2e7e.js +1 -0
  123. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-613351836e4c27fb.js +1 -0
  124. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-6e8c50d4d23e969a.js +1 -0
  125. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-8bb6f1f7fa3696bc.js +1 -0
  126. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-b77875877f3d28d0.js +1 -0
  127. package/dist/standalone/.next/static/chunks/app/projects/[projectId]/sessions/[sessionId]/page-b87566287155f190.js +1 -0
  128. package/dist/standalone/.next/static/chunks/app/projects/page-41b00f4e43f17357.js +1 -0
  129. package/dist/standalone/.next/static/chunks/app/projects/page-eb83c5ea58201eab.js +1 -0
  130. package/dist/standalone/.next/static/chunks/b5d7d_next_app_49bc0f6c.js +8 -0
  131. package/dist/standalone/.next/static/chunks/b5d7d_next_app_49bc0f6c.js.map +6 -0
  132. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_bbef2511._.js +2107 -0
  133. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_bbef2511._.js.map +26 -0
  134. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_c8a9b47e._.js +1942 -0
  135. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_c8a9b47e._.js.map +25 -0
  136. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_client_aca12300._.js +4030 -0
  137. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_client_aca12300._.js.map +45 -0
  138. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_compiled_950aaaf6._.js +2222 -0
  139. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_compiled_950aaaf6._.js.map +16 -0
  140. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_compiled_next-devtools_index_6fd12744.js +28954 -0
  141. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_compiled_next-devtools_index_6fd12744.js.map +6 -0
  142. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_shared_lib_754ee35b._.js +5164 -0
  143. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_shared_lib_754ee35b._.js.map +62 -0
  144. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_shared_lib_deb14b6a._.js +5455 -0
  145. package/dist/standalone/.next/static/chunks/b5d7d_next_dist_shared_lib_deb14b6a._.js.map +66 -0
  146. package/dist/standalone/.next/static/chunks/b5d7d_next_error_f5f4698d.js +8 -0
  147. package/dist/standalone/.next/static/chunks/b5d7d_next_error_f5f4698d.js.map +6 -0
  148. package/dist/standalone/.next/static/chunks/c8656_react-dom_b208eddd._.js +14182 -0
  149. package/dist/standalone/.next/static/chunks/c8656_react-dom_b208eddd._.js.map +9 -0
  150. package/dist/standalone/.next/static/chunks/node_modules__pnpm_7dc0a620._.js +1336 -0
  151. package/dist/standalone/.next/static/chunks/node_modules__pnpm_7dc0a620._.js.map +16 -0
  152. package/dist/standalone/.next/static/chunks/pages/_app.js +14 -0
  153. package/dist/standalone/.next/static/chunks/pages/_error.js +14 -0
  154. package/dist/standalone/.next/static/chunks/pages__app_2da965e7._.js +16 -0
  155. package/dist/standalone/.next/static/chunks/pages__app_5e653343._.js.map +10 -0
  156. package/dist/standalone/.next/static/chunks/pages__error_2da965e7._.js +16 -0
  157. package/dist/standalone/.next/static/chunks/pages__error_57ca05a1._.js.map +10 -0
  158. package/dist/standalone/.next/static/chunks/turbopack-pages__app_5e653343._.js +1823 -0
  159. package/dist/standalone/.next/static/chunks/turbopack-pages__error_57ca05a1._.js +1823 -0
  160. package/dist/standalone/.next/static/css/09df4ee87d7591ca.css +3 -0
  161. package/dist/standalone/.next/static/css/36303a8dc8947596.css +3 -0
  162. package/dist/standalone/.next/static/css/79abaac46cb1972c.css +3 -0
  163. package/dist/standalone/.next/static/css/b871907fe73de1d5.css +3 -0
  164. package/dist/standalone/.next/static/css/b911fd9edbcfba1e.css +3 -0
  165. package/dist/standalone/.next/static/css/b9a686df90a90036.css +3 -0
  166. package/dist/standalone/.next/static/gHcDMwTmj2EUNXWVFDlCZ/_buildManifest.js +1 -0
  167. package/dist/standalone/.next/static/gHcDMwTmj2EUNXWVFDlCZ/_ssgManifest.js +1 -0
  168. package/dist/standalone/.next/static/gJy76OTvdPcbpfkijLfv_/_buildManifest.js +1 -0
  169. package/dist/standalone/.next/static/gJy76OTvdPcbpfkijLfv_/_ssgManifest.js +1 -0
  170. package/dist/standalone/.next/static/lr9BjpI_yzrMDd09cVRXH/_buildManifest.js +1 -0
  171. package/dist/standalone/.next/static/lr9BjpI_yzrMDd09cVRXH/_ssgManifest.js +1 -0
  172. package/dist/standalone/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  173. package/dist/standalone/.next/static/p5lIOxOLNncFm4zH1-_ip/_buildManifest.js +1 -0
  174. package/dist/standalone/.next/static/p5lIOxOLNncFm4zH1-_ip/_ssgManifest.js +1 -0
  175. package/dist/standalone/.next/static/zS7AFHKjuHulYMQ1_wDup/_buildManifest.js +1 -0
  176. package/dist/standalone/.next/static/zS7AFHKjuHulYMQ1_wDup/_ssgManifest.js +1 -0
  177. package/dist/standalone/package.json +5 -1
  178. package/package.json +5 -1
@@ -0,0 +1,481 @@
1
+ (globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push([typeof document === "object" ? document.currentScript : undefined,
2
+ "[turbopack]/browser/dev/hmr-client/hmr-client.ts [client] (ecmascript)", ((__turbopack_context__) => {
3
+ "use strict";
4
+
5
+ /// <reference path="../../../shared/runtime-types.d.ts" />
6
+ /// <reference path="../../runtime/base/dev-globals.d.ts" />
7
+ /// <reference path="../../runtime/base/dev-protocol.d.ts" />
8
+ /// <reference path="../../runtime/base/dev-extensions.ts" />
9
+ __turbopack_context__.s([
10
+ "connect",
11
+ ()=>connect,
12
+ "setHooks",
13
+ ()=>setHooks,
14
+ "subscribeToUpdate",
15
+ ()=>subscribeToUpdate
16
+ ]);
17
+ function connect(param) {
18
+ let { addMessageListener, sendMessage, onUpdateError = console.error } = param;
19
+ addMessageListener((msg)=>{
20
+ switch(msg.type){
21
+ case 'turbopack-connected':
22
+ handleSocketConnected(sendMessage);
23
+ break;
24
+ default:
25
+ try {
26
+ if (Array.isArray(msg.data)) {
27
+ for(let i = 0; i < msg.data.length; i++){
28
+ handleSocketMessage(msg.data[i]);
29
+ }
30
+ } else {
31
+ handleSocketMessage(msg.data);
32
+ }
33
+ applyAggregatedUpdates();
34
+ } catch (e) {
35
+ console.warn('[Fast Refresh] performing full reload\n\n' + "Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.\n" + 'You might have a file which exports a React component but also exports a value that is imported by a non-React component file.\n' + 'Consider migrating the non-React component export to a separate file and importing it into both files.\n\n' + 'It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.\n' + 'Fast Refresh requires at least one parent function component in your React tree.');
36
+ onUpdateError(e);
37
+ location.reload();
38
+ }
39
+ break;
40
+ }
41
+ });
42
+ const queued = globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS;
43
+ if (queued != null && !Array.isArray(queued)) {
44
+ throw new Error('A separate HMR handler was already registered');
45
+ }
46
+ globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS = {
47
+ push: (param)=>{
48
+ let [chunkPath, callback] = param;
49
+ subscribeToChunkUpdate(chunkPath, sendMessage, callback);
50
+ }
51
+ };
52
+ if (Array.isArray(queued)) {
53
+ for (const [chunkPath, callback] of queued){
54
+ subscribeToChunkUpdate(chunkPath, sendMessage, callback);
55
+ }
56
+ }
57
+ }
58
+ const updateCallbackSets = new Map();
59
+ function sendJSON(sendMessage, message) {
60
+ sendMessage(JSON.stringify(message));
61
+ }
62
+ function resourceKey(resource) {
63
+ return JSON.stringify({
64
+ path: resource.path,
65
+ headers: resource.headers || null
66
+ });
67
+ }
68
+ function subscribeToUpdates(sendMessage, resource) {
69
+ sendJSON(sendMessage, {
70
+ type: 'turbopack-subscribe',
71
+ ...resource
72
+ });
73
+ return ()=>{
74
+ sendJSON(sendMessage, {
75
+ type: 'turbopack-unsubscribe',
76
+ ...resource
77
+ });
78
+ };
79
+ }
80
+ function handleSocketConnected(sendMessage) {
81
+ for (const key of updateCallbackSets.keys()){
82
+ subscribeToUpdates(sendMessage, JSON.parse(key));
83
+ }
84
+ }
85
+ // we aggregate all pending updates until the issues are resolved
86
+ const chunkListsWithPendingUpdates = new Map();
87
+ function aggregateUpdates(msg) {
88
+ const key = resourceKey(msg.resource);
89
+ let aggregated = chunkListsWithPendingUpdates.get(key);
90
+ if (aggregated) {
91
+ aggregated.instruction = mergeChunkListUpdates(aggregated.instruction, msg.instruction);
92
+ } else {
93
+ chunkListsWithPendingUpdates.set(key, msg);
94
+ }
95
+ }
96
+ function applyAggregatedUpdates() {
97
+ if (chunkListsWithPendingUpdates.size === 0) return;
98
+ hooks.beforeRefresh();
99
+ for (const msg of chunkListsWithPendingUpdates.values()){
100
+ triggerUpdate(msg);
101
+ }
102
+ chunkListsWithPendingUpdates.clear();
103
+ finalizeUpdate();
104
+ }
105
+ function mergeChunkListUpdates(updateA, updateB) {
106
+ let chunks;
107
+ if (updateA.chunks != null) {
108
+ if (updateB.chunks == null) {
109
+ chunks = updateA.chunks;
110
+ } else {
111
+ chunks = mergeChunkListChunks(updateA.chunks, updateB.chunks);
112
+ }
113
+ } else if (updateB.chunks != null) {
114
+ chunks = updateB.chunks;
115
+ }
116
+ let merged;
117
+ if (updateA.merged != null) {
118
+ if (updateB.merged == null) {
119
+ merged = updateA.merged;
120
+ } else {
121
+ // Since `merged` is an array of updates, we need to merge them all into
122
+ // one, consistent update.
123
+ // Since there can only be `EcmascriptMergeUpdates` in the array, there is
124
+ // no need to key on the `type` field.
125
+ let update = updateA.merged[0];
126
+ for(let i = 1; i < updateA.merged.length; i++){
127
+ update = mergeChunkListEcmascriptMergedUpdates(update, updateA.merged[i]);
128
+ }
129
+ for(let i = 0; i < updateB.merged.length; i++){
130
+ update = mergeChunkListEcmascriptMergedUpdates(update, updateB.merged[i]);
131
+ }
132
+ merged = [
133
+ update
134
+ ];
135
+ }
136
+ } else if (updateB.merged != null) {
137
+ merged = updateB.merged;
138
+ }
139
+ return {
140
+ type: 'ChunkListUpdate',
141
+ chunks,
142
+ merged
143
+ };
144
+ }
145
+ function mergeChunkListChunks(chunksA, chunksB) {
146
+ const chunks = {};
147
+ for (const [chunkPath, chunkUpdateA] of Object.entries(chunksA)){
148
+ const chunkUpdateB = chunksB[chunkPath];
149
+ if (chunkUpdateB != null) {
150
+ const mergedUpdate = mergeChunkUpdates(chunkUpdateA, chunkUpdateB);
151
+ if (mergedUpdate != null) {
152
+ chunks[chunkPath] = mergedUpdate;
153
+ }
154
+ } else {
155
+ chunks[chunkPath] = chunkUpdateA;
156
+ }
157
+ }
158
+ for (const [chunkPath, chunkUpdateB] of Object.entries(chunksB)){
159
+ if (chunks[chunkPath] == null) {
160
+ chunks[chunkPath] = chunkUpdateB;
161
+ }
162
+ }
163
+ return chunks;
164
+ }
165
+ function mergeChunkUpdates(updateA, updateB) {
166
+ if (updateA.type === 'added' && updateB.type === 'deleted' || updateA.type === 'deleted' && updateB.type === 'added') {
167
+ return undefined;
168
+ }
169
+ if (updateA.type === 'partial') {
170
+ invariant(updateA.instruction, 'Partial updates are unsupported');
171
+ }
172
+ if (updateB.type === 'partial') {
173
+ invariant(updateB.instruction, 'Partial updates are unsupported');
174
+ }
175
+ return undefined;
176
+ }
177
+ function mergeChunkListEcmascriptMergedUpdates(mergedA, mergedB) {
178
+ const entries = mergeEcmascriptChunkEntries(mergedA.entries, mergedB.entries);
179
+ const chunks = mergeEcmascriptChunksUpdates(mergedA.chunks, mergedB.chunks);
180
+ return {
181
+ type: 'EcmascriptMergedUpdate',
182
+ entries,
183
+ chunks
184
+ };
185
+ }
186
+ function mergeEcmascriptChunkEntries(entriesA, entriesB) {
187
+ return {
188
+ ...entriesA,
189
+ ...entriesB
190
+ };
191
+ }
192
+ function mergeEcmascriptChunksUpdates(chunksA, chunksB) {
193
+ if (chunksA == null) {
194
+ return chunksB;
195
+ }
196
+ if (chunksB == null) {
197
+ return chunksA;
198
+ }
199
+ const chunks = {};
200
+ for (const [chunkPath, chunkUpdateA] of Object.entries(chunksA)){
201
+ const chunkUpdateB = chunksB[chunkPath];
202
+ if (chunkUpdateB != null) {
203
+ const mergedUpdate = mergeEcmascriptChunkUpdates(chunkUpdateA, chunkUpdateB);
204
+ if (mergedUpdate != null) {
205
+ chunks[chunkPath] = mergedUpdate;
206
+ }
207
+ } else {
208
+ chunks[chunkPath] = chunkUpdateA;
209
+ }
210
+ }
211
+ for (const [chunkPath, chunkUpdateB] of Object.entries(chunksB)){
212
+ if (chunks[chunkPath] == null) {
213
+ chunks[chunkPath] = chunkUpdateB;
214
+ }
215
+ }
216
+ if (Object.keys(chunks).length === 0) {
217
+ return undefined;
218
+ }
219
+ return chunks;
220
+ }
221
+ function mergeEcmascriptChunkUpdates(updateA, updateB) {
222
+ if (updateA.type === 'added' && updateB.type === 'deleted') {
223
+ // These two completely cancel each other out.
224
+ return undefined;
225
+ }
226
+ if (updateA.type === 'deleted' && updateB.type === 'added') {
227
+ const added = [];
228
+ const deleted = [];
229
+ var _updateA_modules;
230
+ const deletedModules = new Set((_updateA_modules = updateA.modules) !== null && _updateA_modules !== void 0 ? _updateA_modules : []);
231
+ var _updateB_modules;
232
+ const addedModules = new Set((_updateB_modules = updateB.modules) !== null && _updateB_modules !== void 0 ? _updateB_modules : []);
233
+ for (const moduleId of addedModules){
234
+ if (!deletedModules.has(moduleId)) {
235
+ added.push(moduleId);
236
+ }
237
+ }
238
+ for (const moduleId of deletedModules){
239
+ if (!addedModules.has(moduleId)) {
240
+ deleted.push(moduleId);
241
+ }
242
+ }
243
+ if (added.length === 0 && deleted.length === 0) {
244
+ return undefined;
245
+ }
246
+ return {
247
+ type: 'partial',
248
+ added,
249
+ deleted
250
+ };
251
+ }
252
+ if (updateA.type === 'partial' && updateB.type === 'partial') {
253
+ var _updateA_added, _updateB_added;
254
+ const added = new Set([
255
+ ...(_updateA_added = updateA.added) !== null && _updateA_added !== void 0 ? _updateA_added : [],
256
+ ...(_updateB_added = updateB.added) !== null && _updateB_added !== void 0 ? _updateB_added : []
257
+ ]);
258
+ var _updateA_deleted, _updateB_deleted;
259
+ const deleted = new Set([
260
+ ...(_updateA_deleted = updateA.deleted) !== null && _updateA_deleted !== void 0 ? _updateA_deleted : [],
261
+ ...(_updateB_deleted = updateB.deleted) !== null && _updateB_deleted !== void 0 ? _updateB_deleted : []
262
+ ]);
263
+ if (updateB.added != null) {
264
+ for (const moduleId of updateB.added){
265
+ deleted.delete(moduleId);
266
+ }
267
+ }
268
+ if (updateB.deleted != null) {
269
+ for (const moduleId of updateB.deleted){
270
+ added.delete(moduleId);
271
+ }
272
+ }
273
+ return {
274
+ type: 'partial',
275
+ added: [
276
+ ...added
277
+ ],
278
+ deleted: [
279
+ ...deleted
280
+ ]
281
+ };
282
+ }
283
+ if (updateA.type === 'added' && updateB.type === 'partial') {
284
+ var _updateA_modules1, _updateB_added1;
285
+ const modules = new Set([
286
+ ...(_updateA_modules1 = updateA.modules) !== null && _updateA_modules1 !== void 0 ? _updateA_modules1 : [],
287
+ ...(_updateB_added1 = updateB.added) !== null && _updateB_added1 !== void 0 ? _updateB_added1 : []
288
+ ]);
289
+ var _updateB_deleted1;
290
+ for (const moduleId of (_updateB_deleted1 = updateB.deleted) !== null && _updateB_deleted1 !== void 0 ? _updateB_deleted1 : []){
291
+ modules.delete(moduleId);
292
+ }
293
+ return {
294
+ type: 'added',
295
+ modules: [
296
+ ...modules
297
+ ]
298
+ };
299
+ }
300
+ if (updateA.type === 'partial' && updateB.type === 'deleted') {
301
+ var _updateB_modules1;
302
+ // We could eagerly return `updateB` here, but this would potentially be
303
+ // incorrect if `updateA` has added modules.
304
+ const modules = new Set((_updateB_modules1 = updateB.modules) !== null && _updateB_modules1 !== void 0 ? _updateB_modules1 : []);
305
+ if (updateA.added != null) {
306
+ for (const moduleId of updateA.added){
307
+ modules.delete(moduleId);
308
+ }
309
+ }
310
+ return {
311
+ type: 'deleted',
312
+ modules: [
313
+ ...modules
314
+ ]
315
+ };
316
+ }
317
+ // Any other update combination is invalid.
318
+ return undefined;
319
+ }
320
+ function invariant(_, message) {
321
+ throw new Error("Invariant: ".concat(message));
322
+ }
323
+ const CRITICAL = [
324
+ 'bug',
325
+ 'error',
326
+ 'fatal'
327
+ ];
328
+ function compareByList(list, a, b) {
329
+ const aI = list.indexOf(a) + 1 || list.length;
330
+ const bI = list.indexOf(b) + 1 || list.length;
331
+ return aI - bI;
332
+ }
333
+ const chunksWithIssues = new Map();
334
+ function emitIssues() {
335
+ const issues = [];
336
+ const deduplicationSet = new Set();
337
+ for (const [_, chunkIssues] of chunksWithIssues){
338
+ for (const chunkIssue of chunkIssues){
339
+ if (deduplicationSet.has(chunkIssue.formatted)) continue;
340
+ issues.push(chunkIssue);
341
+ deduplicationSet.add(chunkIssue.formatted);
342
+ }
343
+ }
344
+ sortIssues(issues);
345
+ hooks.issues(issues);
346
+ }
347
+ function handleIssues(msg) {
348
+ const key = resourceKey(msg.resource);
349
+ let hasCriticalIssues = false;
350
+ for (const issue of msg.issues){
351
+ if (CRITICAL.includes(issue.severity)) {
352
+ hasCriticalIssues = true;
353
+ }
354
+ }
355
+ if (msg.issues.length > 0) {
356
+ chunksWithIssues.set(key, msg.issues);
357
+ } else if (chunksWithIssues.has(key)) {
358
+ chunksWithIssues.delete(key);
359
+ }
360
+ emitIssues();
361
+ return hasCriticalIssues;
362
+ }
363
+ const SEVERITY_ORDER = [
364
+ 'bug',
365
+ 'fatal',
366
+ 'error',
367
+ 'warning',
368
+ 'info',
369
+ 'log'
370
+ ];
371
+ const CATEGORY_ORDER = [
372
+ 'parse',
373
+ 'resolve',
374
+ 'code generation',
375
+ 'rendering',
376
+ 'typescript',
377
+ 'other'
378
+ ];
379
+ function sortIssues(issues) {
380
+ issues.sort((a, b)=>{
381
+ const first = compareByList(SEVERITY_ORDER, a.severity, b.severity);
382
+ if (first !== 0) return first;
383
+ return compareByList(CATEGORY_ORDER, a.category, b.category);
384
+ });
385
+ }
386
+ const hooks = {
387
+ beforeRefresh: ()=>{},
388
+ refresh: ()=>{},
389
+ buildOk: ()=>{},
390
+ issues: (_issues)=>{}
391
+ };
392
+ function setHooks(newHooks) {
393
+ Object.assign(hooks, newHooks);
394
+ }
395
+ function handleSocketMessage(msg) {
396
+ sortIssues(msg.issues);
397
+ handleIssues(msg);
398
+ switch(msg.type){
399
+ case 'issues':
400
+ break;
401
+ case 'partial':
402
+ // aggregate updates
403
+ aggregateUpdates(msg);
404
+ break;
405
+ default:
406
+ // run single update
407
+ const runHooks = chunkListsWithPendingUpdates.size === 0;
408
+ if (runHooks) hooks.beforeRefresh();
409
+ triggerUpdate(msg);
410
+ if (runHooks) finalizeUpdate();
411
+ break;
412
+ }
413
+ }
414
+ function finalizeUpdate() {
415
+ hooks.refresh();
416
+ hooks.buildOk();
417
+ // This is used by the Next.js integration test suite to notify it when HMR
418
+ // updates have been completed.
419
+ // TODO: Only run this in test environments (gate by `process.env.__NEXT_TEST_MODE`)
420
+ if (globalThis.__NEXT_HMR_CB) {
421
+ globalThis.__NEXT_HMR_CB();
422
+ globalThis.__NEXT_HMR_CB = null;
423
+ }
424
+ }
425
+ function subscribeToChunkUpdate(chunkListPath, sendMessage, callback) {
426
+ return subscribeToUpdate({
427
+ path: chunkListPath
428
+ }, sendMessage, callback);
429
+ }
430
+ function subscribeToUpdate(resource, sendMessage, callback) {
431
+ const key = resourceKey(resource);
432
+ let callbackSet;
433
+ const existingCallbackSet = updateCallbackSets.get(key);
434
+ if (!existingCallbackSet) {
435
+ callbackSet = {
436
+ callbacks: new Set([
437
+ callback
438
+ ]),
439
+ unsubscribe: subscribeToUpdates(sendMessage, resource)
440
+ };
441
+ updateCallbackSets.set(key, callbackSet);
442
+ } else {
443
+ existingCallbackSet.callbacks.add(callback);
444
+ callbackSet = existingCallbackSet;
445
+ }
446
+ return ()=>{
447
+ callbackSet.callbacks.delete(callback);
448
+ if (callbackSet.callbacks.size === 0) {
449
+ callbackSet.unsubscribe();
450
+ updateCallbackSets.delete(key);
451
+ }
452
+ };
453
+ }
454
+ function triggerUpdate(msg) {
455
+ const key = resourceKey(msg.resource);
456
+ const callbackSet = updateCallbackSets.get(key);
457
+ if (!callbackSet) {
458
+ return;
459
+ }
460
+ for (const callback of callbackSet.callbacks){
461
+ callback(msg);
462
+ }
463
+ if (msg.type === 'notFound') {
464
+ // This indicates that the resource which we subscribed to either does not exist or
465
+ // has been deleted. In either case, we should clear all update callbacks, so if a
466
+ // new subscription is created for the same resource, it will send a new "subscribe"
467
+ // message to the server.
468
+ // No need to send an "unsubscribe" message to the server, it will have already
469
+ // dropped the update stream before sending the "notFound" message.
470
+ updateCallbackSets.delete(key);
471
+ }
472
+ }
473
+ }),
474
+ "[hmr-entry]/hmr-entry.js { ENTRY => \"[project]/pages/_app\" }", ((__turbopack_context__) => {
475
+ "use strict";
476
+
477
+ __turbopack_context__.r("[next]/entry/page-loader.ts { PAGE => \"[project]/node_modules/.pnpm/next@15.5.2_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/next/app.js [client] (ecmascript)\" } [client] (ecmascript)");
478
+ }),
479
+ ]);
480
+
481
+ //# sourceMappingURL=%5Broot-of-the-server%5D__45f039c3._.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sections": [
5
+ {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/dev/hmr-client/hmr-client.ts"],"sourcesContent":["/// <reference path=\"../../../shared/runtime-types.d.ts\" />\n/// <reference path=\"../../runtime/base/dev-globals.d.ts\" />\n/// <reference path=\"../../runtime/base/dev-protocol.d.ts\" />\n/// <reference path=\"../../runtime/base/dev-extensions.ts\" />\n\ntype SendMessage = (msg: any) => void\nexport type WebSocketMessage =\n | {\n type: 'turbopack-connected'\n }\n | {\n type: 'turbopack-message'\n data: Record<string, any>\n }\n\nexport type ClientOptions = {\n addMessageListener: (cb: (msg: WebSocketMessage) => void) => void\n sendMessage: SendMessage\n onUpdateError: (err: unknown) => void\n}\n\nexport function connect({\n addMessageListener,\n sendMessage,\n onUpdateError = console.error,\n}: ClientOptions) {\n addMessageListener((msg) => {\n switch (msg.type) {\n case 'turbopack-connected':\n handleSocketConnected(sendMessage)\n break\n default:\n try {\n if (Array.isArray(msg.data)) {\n for (let i = 0; i < msg.data.length; i++) {\n handleSocketMessage(msg.data[i] as ServerMessage)\n }\n } else {\n handleSocketMessage(msg.data as ServerMessage)\n }\n applyAggregatedUpdates()\n } catch (e: unknown) {\n console.warn(\n '[Fast Refresh] performing full reload\\n\\n' +\n \"Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree.\\n\" +\n 'You might have a file which exports a React component but also exports a value that is imported by a non-React component file.\\n' +\n 'Consider migrating the non-React component export to a separate file and importing it into both files.\\n\\n' +\n 'It is also possible the parent component of the component you edited is a class component, which disables Fast Refresh.\\n' +\n 'Fast Refresh requires at least one parent function component in your React tree.'\n )\n onUpdateError(e)\n location.reload()\n }\n break\n }\n })\n\n const queued = globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS\n if (queued != null && !Array.isArray(queued)) {\n throw new Error('A separate HMR handler was already registered')\n }\n globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS = {\n push: ([chunkPath, callback]: [ChunkListPath, UpdateCallback]) => {\n subscribeToChunkUpdate(chunkPath, sendMessage, callback)\n },\n }\n\n if (Array.isArray(queued)) {\n for (const [chunkPath, callback] of queued) {\n subscribeToChunkUpdate(chunkPath, sendMessage, callback)\n }\n }\n}\n\ntype UpdateCallbackSet = {\n callbacks: Set<UpdateCallback>\n unsubscribe: () => void\n}\n\nconst updateCallbackSets: Map<ResourceKey, UpdateCallbackSet> = new Map()\n\nfunction sendJSON(sendMessage: SendMessage, message: ClientMessage) {\n sendMessage(JSON.stringify(message))\n}\n\ntype ResourceKey = string\n\nfunction resourceKey(resource: ResourceIdentifier): ResourceKey {\n return JSON.stringify({\n path: resource.path,\n headers: resource.headers || null,\n })\n}\n\nfunction subscribeToUpdates(\n sendMessage: SendMessage,\n resource: ResourceIdentifier\n): () => void {\n sendJSON(sendMessage, {\n type: 'turbopack-subscribe',\n ...resource,\n })\n\n return () => {\n sendJSON(sendMessage, {\n type: 'turbopack-unsubscribe',\n ...resource,\n })\n }\n}\n\nfunction handleSocketConnected(sendMessage: SendMessage) {\n for (const key of updateCallbackSets.keys()) {\n subscribeToUpdates(sendMessage, JSON.parse(key))\n }\n}\n\n// we aggregate all pending updates until the issues are resolved\nconst chunkListsWithPendingUpdates: Map<ResourceKey, PartialServerMessage> =\n new Map()\n\nfunction aggregateUpdates(msg: PartialServerMessage) {\n const key = resourceKey(msg.resource)\n let aggregated = chunkListsWithPendingUpdates.get(key)\n\n if (aggregated) {\n aggregated.instruction = mergeChunkListUpdates(\n aggregated.instruction,\n msg.instruction\n )\n } else {\n chunkListsWithPendingUpdates.set(key, msg)\n }\n}\n\nfunction applyAggregatedUpdates() {\n if (chunkListsWithPendingUpdates.size === 0) return\n hooks.beforeRefresh()\n for (const msg of chunkListsWithPendingUpdates.values()) {\n triggerUpdate(msg)\n }\n chunkListsWithPendingUpdates.clear()\n finalizeUpdate()\n}\n\nfunction mergeChunkListUpdates(\n updateA: ChunkListUpdate,\n updateB: ChunkListUpdate\n): ChunkListUpdate {\n let chunks\n if (updateA.chunks != null) {\n if (updateB.chunks == null) {\n chunks = updateA.chunks\n } else {\n chunks = mergeChunkListChunks(updateA.chunks, updateB.chunks)\n }\n } else if (updateB.chunks != null) {\n chunks = updateB.chunks\n }\n\n let merged\n if (updateA.merged != null) {\n if (updateB.merged == null) {\n merged = updateA.merged\n } else {\n // Since `merged` is an array of updates, we need to merge them all into\n // one, consistent update.\n // Since there can only be `EcmascriptMergeUpdates` in the array, there is\n // no need to key on the `type` field.\n let update = updateA.merged[0]\n for (let i = 1; i < updateA.merged.length; i++) {\n update = mergeChunkListEcmascriptMergedUpdates(\n update,\n updateA.merged[i]\n )\n }\n\n for (let i = 0; i < updateB.merged.length; i++) {\n update = mergeChunkListEcmascriptMergedUpdates(\n update,\n updateB.merged[i]\n )\n }\n\n merged = [update]\n }\n } else if (updateB.merged != null) {\n merged = updateB.merged\n }\n\n return {\n type: 'ChunkListUpdate',\n chunks,\n merged,\n }\n}\n\nfunction mergeChunkListChunks(\n chunksA: Record<ChunkPath, ChunkUpdate>,\n chunksB: Record<ChunkPath, ChunkUpdate>\n): Record<ChunkPath, ChunkUpdate> {\n const chunks: Record<ChunkPath, ChunkUpdate> = {}\n\n for (const [chunkPath, chunkUpdateA] of Object.entries(chunksA) as Array<\n [ChunkPath, ChunkUpdate]\n >) {\n const chunkUpdateB = chunksB[chunkPath]\n if (chunkUpdateB != null) {\n const mergedUpdate = mergeChunkUpdates(chunkUpdateA, chunkUpdateB)\n if (mergedUpdate != null) {\n chunks[chunkPath] = mergedUpdate\n }\n } else {\n chunks[chunkPath] = chunkUpdateA\n }\n }\n\n for (const [chunkPath, chunkUpdateB] of Object.entries(chunksB) as Array<\n [ChunkPath, ChunkUpdate]\n >) {\n if (chunks[chunkPath] == null) {\n chunks[chunkPath] = chunkUpdateB\n }\n }\n\n return chunks\n}\n\nfunction mergeChunkUpdates(\n updateA: ChunkUpdate,\n updateB: ChunkUpdate\n): ChunkUpdate | undefined {\n if (\n (updateA.type === 'added' && updateB.type === 'deleted') ||\n (updateA.type === 'deleted' && updateB.type === 'added')\n ) {\n return undefined\n }\n\n if (updateA.type === 'partial') {\n invariant(updateA.instruction, 'Partial updates are unsupported')\n }\n\n if (updateB.type === 'partial') {\n invariant(updateB.instruction, 'Partial updates are unsupported')\n }\n\n return undefined\n}\n\nfunction mergeChunkListEcmascriptMergedUpdates(\n mergedA: EcmascriptMergedUpdate,\n mergedB: EcmascriptMergedUpdate\n): EcmascriptMergedUpdate {\n const entries = mergeEcmascriptChunkEntries(mergedA.entries, mergedB.entries)\n const chunks = mergeEcmascriptChunksUpdates(mergedA.chunks, mergedB.chunks)\n\n return {\n type: 'EcmascriptMergedUpdate',\n entries,\n chunks,\n }\n}\n\nfunction mergeEcmascriptChunkEntries(\n entriesA: Record<ModuleId, EcmascriptModuleEntry> | undefined,\n entriesB: Record<ModuleId, EcmascriptModuleEntry> | undefined\n): Record<ModuleId, EcmascriptModuleEntry> {\n return { ...entriesA, ...entriesB }\n}\n\nfunction mergeEcmascriptChunksUpdates(\n chunksA: Record<ChunkPath, EcmascriptMergedChunkUpdate> | undefined,\n chunksB: Record<ChunkPath, EcmascriptMergedChunkUpdate> | undefined\n): Record<ChunkPath, EcmascriptMergedChunkUpdate> | undefined {\n if (chunksA == null) {\n return chunksB\n }\n\n if (chunksB == null) {\n return chunksA\n }\n\n const chunks: Record<ChunkPath, EcmascriptMergedChunkUpdate> = {}\n\n for (const [chunkPath, chunkUpdateA] of Object.entries(chunksA) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n const chunkUpdateB = chunksB[chunkPath]\n if (chunkUpdateB != null) {\n const mergedUpdate = mergeEcmascriptChunkUpdates(\n chunkUpdateA,\n chunkUpdateB\n )\n if (mergedUpdate != null) {\n chunks[chunkPath] = mergedUpdate\n }\n } else {\n chunks[chunkPath] = chunkUpdateA\n }\n }\n\n for (const [chunkPath, chunkUpdateB] of Object.entries(chunksB) as Array<\n [ChunkPath, EcmascriptMergedChunkUpdate]\n >) {\n if (chunks[chunkPath] == null) {\n chunks[chunkPath] = chunkUpdateB\n }\n }\n\n if (Object.keys(chunks).length === 0) {\n return undefined\n }\n\n return chunks\n}\n\nfunction mergeEcmascriptChunkUpdates(\n updateA: EcmascriptMergedChunkUpdate,\n updateB: EcmascriptMergedChunkUpdate\n): EcmascriptMergedChunkUpdate | undefined {\n if (updateA.type === 'added' && updateB.type === 'deleted') {\n // These two completely cancel each other out.\n return undefined\n }\n\n if (updateA.type === 'deleted' && updateB.type === 'added') {\n const added = []\n const deleted = []\n const deletedModules = new Set(updateA.modules ?? [])\n const addedModules = new Set(updateB.modules ?? [])\n\n for (const moduleId of addedModules) {\n if (!deletedModules.has(moduleId)) {\n added.push(moduleId)\n }\n }\n\n for (const moduleId of deletedModules) {\n if (!addedModules.has(moduleId)) {\n deleted.push(moduleId)\n }\n }\n\n if (added.length === 0 && deleted.length === 0) {\n return undefined\n }\n\n return {\n type: 'partial',\n added,\n deleted,\n }\n }\n\n if (updateA.type === 'partial' && updateB.type === 'partial') {\n const added = new Set([...(updateA.added ?? []), ...(updateB.added ?? [])])\n const deleted = new Set([\n ...(updateA.deleted ?? []),\n ...(updateB.deleted ?? []),\n ])\n\n if (updateB.added != null) {\n for (const moduleId of updateB.added) {\n deleted.delete(moduleId)\n }\n }\n\n if (updateB.deleted != null) {\n for (const moduleId of updateB.deleted) {\n added.delete(moduleId)\n }\n }\n\n return {\n type: 'partial',\n added: [...added],\n deleted: [...deleted],\n }\n }\n\n if (updateA.type === 'added' && updateB.type === 'partial') {\n const modules = new Set([\n ...(updateA.modules ?? []),\n ...(updateB.added ?? []),\n ])\n\n for (const moduleId of updateB.deleted ?? []) {\n modules.delete(moduleId)\n }\n\n return {\n type: 'added',\n modules: [...modules],\n }\n }\n\n if (updateA.type === 'partial' && updateB.type === 'deleted') {\n // We could eagerly return `updateB` here, but this would potentially be\n // incorrect if `updateA` has added modules.\n\n const modules = new Set(updateB.modules ?? [])\n\n if (updateA.added != null) {\n for (const moduleId of updateA.added) {\n modules.delete(moduleId)\n }\n }\n\n return {\n type: 'deleted',\n modules: [...modules],\n }\n }\n\n // Any other update combination is invalid.\n\n return undefined\n}\n\nfunction invariant(_: never, message: string): never {\n throw new Error(`Invariant: ${message}`)\n}\n\nconst CRITICAL = ['bug', 'error', 'fatal']\n\nfunction compareByList(list: any[], a: any, b: any) {\n const aI = list.indexOf(a) + 1 || list.length\n const bI = list.indexOf(b) + 1 || list.length\n return aI - bI\n}\n\nconst chunksWithIssues: Map<ResourceKey, Issue[]> = new Map()\n\nfunction emitIssues() {\n const issues = []\n const deduplicationSet = new Set()\n\n for (const [_, chunkIssues] of chunksWithIssues) {\n for (const chunkIssue of chunkIssues) {\n if (deduplicationSet.has(chunkIssue.formatted)) continue\n\n issues.push(chunkIssue)\n deduplicationSet.add(chunkIssue.formatted)\n }\n }\n\n sortIssues(issues)\n\n hooks.issues(issues)\n}\n\nfunction handleIssues(msg: ServerMessage): boolean {\n const key = resourceKey(msg.resource)\n let hasCriticalIssues = false\n\n for (const issue of msg.issues) {\n if (CRITICAL.includes(issue.severity)) {\n hasCriticalIssues = true\n }\n }\n\n if (msg.issues.length > 0) {\n chunksWithIssues.set(key, msg.issues)\n } else if (chunksWithIssues.has(key)) {\n chunksWithIssues.delete(key)\n }\n\n emitIssues()\n\n return hasCriticalIssues\n}\n\nconst SEVERITY_ORDER = ['bug', 'fatal', 'error', 'warning', 'info', 'log']\nconst CATEGORY_ORDER = [\n 'parse',\n 'resolve',\n 'code generation',\n 'rendering',\n 'typescript',\n 'other',\n]\n\nfunction sortIssues(issues: Issue[]) {\n issues.sort((a, b) => {\n const first = compareByList(SEVERITY_ORDER, a.severity, b.severity)\n if (first !== 0) return first\n return compareByList(CATEGORY_ORDER, a.category, b.category)\n })\n}\n\nconst hooks = {\n beforeRefresh: () => {},\n refresh: () => {},\n buildOk: () => {},\n issues: (_issues: Issue[]) => {},\n}\n\nexport function setHooks(newHooks: typeof hooks) {\n Object.assign(hooks, newHooks)\n}\n\nfunction handleSocketMessage(msg: ServerMessage) {\n sortIssues(msg.issues)\n\n handleIssues(msg)\n\n switch (msg.type) {\n case 'issues':\n // issues are already handled\n break\n case 'partial':\n // aggregate updates\n aggregateUpdates(msg)\n break\n default:\n // run single update\n const runHooks = chunkListsWithPendingUpdates.size === 0\n if (runHooks) hooks.beforeRefresh()\n triggerUpdate(msg)\n if (runHooks) finalizeUpdate()\n break\n }\n}\n\nfunction finalizeUpdate() {\n hooks.refresh()\n hooks.buildOk()\n\n // This is used by the Next.js integration test suite to notify it when HMR\n // updates have been completed.\n // TODO: Only run this in test environments (gate by `process.env.__NEXT_TEST_MODE`)\n if (globalThis.__NEXT_HMR_CB) {\n globalThis.__NEXT_HMR_CB()\n globalThis.__NEXT_HMR_CB = null\n }\n}\n\nfunction subscribeToChunkUpdate(\n chunkListPath: ChunkListPath,\n sendMessage: SendMessage,\n callback: UpdateCallback\n): () => void {\n return subscribeToUpdate(\n {\n path: chunkListPath,\n },\n sendMessage,\n callback\n )\n}\n\nexport function subscribeToUpdate(\n resource: ResourceIdentifier,\n sendMessage: SendMessage,\n callback: UpdateCallback\n) {\n const key = resourceKey(resource)\n let callbackSet: UpdateCallbackSet\n const existingCallbackSet = updateCallbackSets.get(key)\n if (!existingCallbackSet) {\n callbackSet = {\n callbacks: new Set([callback]),\n unsubscribe: subscribeToUpdates(sendMessage, resource),\n }\n updateCallbackSets.set(key, callbackSet)\n } else {\n existingCallbackSet.callbacks.add(callback)\n callbackSet = existingCallbackSet\n }\n\n return () => {\n callbackSet.callbacks.delete(callback)\n\n if (callbackSet.callbacks.size === 0) {\n callbackSet.unsubscribe()\n updateCallbackSets.delete(key)\n }\n }\n}\n\nfunction triggerUpdate(msg: ServerMessage) {\n const key = resourceKey(msg.resource)\n const callbackSet = updateCallbackSets.get(key)\n if (!callbackSet) {\n return\n }\n\n for (const callback of callbackSet.callbacks) {\n callback(msg)\n }\n\n if (msg.type === 'notFound') {\n // This indicates that the resource which we subscribed to either does not exist or\n // has been deleted. In either case, we should clear all update callbacks, so if a\n // new subscription is created for the same resource, it will send a new \"subscribe\"\n // message to the server.\n // No need to send an \"unsubscribe\" message to the server, it will have already\n // dropped the update stream before sending the \"notFound\" message.\n updateCallbackSets.delete(key)\n }\n}\n"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,4DAA4D;AAC5D,6DAA6D;AAC7D,6DAA6D;;;;;;;;;AAkBtD,SAAS,QAAQ,KAIR;QAJQ,EACtB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,QAAQ,KAAK,EACf,GAJQ;IAKtB,mBAAmB,CAAC;QAClB,OAAQ,IAAI,IAAI;YACd,KAAK;gBACH,sBAAsB;gBACtB;YACF;gBACE,IAAI;oBACF,IAAI,MAAM,OAAO,CAAC,IAAI,IAAI,GAAG;wBAC3B,IAAK,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,IAAK;4BACxC,oBAAoB,IAAI,IAAI,CAAC,EAAE;wBACjC;oBACF,OAAO;wBACL,oBAAoB,IAAI,IAAI;oBAC9B;oBACA;gBACF,EAAE,OAAO,GAAY;oBACnB,QAAQ,IAAI,CACV,8CACE,mIACA,qIACA,+GACA,8HACA;oBAEJ,cAAc;oBACd,SAAS,MAAM;gBACjB;gBACA;QACJ;IACF;IAEA,MAAM,SAAS,WAAW,gCAAgC;IAC1D,IAAI,UAAU,QAAQ,CAAC,MAAM,OAAO,CAAC,SAAS;QAC5C,MAAM,IAAI,MAAM;IAClB;IACA,WAAW,gCAAgC,GAAG;QAC5C,MAAM;gBAAC,CAAC,WAAW,SAA0C;YAC3D,uBAAuB,WAAW,aAAa;QACjD;IACF;IAEA,IAAI,MAAM,OAAO,CAAC,SAAS;QACzB,KAAK,MAAM,CAAC,WAAW,SAAS,IAAI,OAAQ;YAC1C,uBAAuB,WAAW,aAAa;QACjD;IACF;AACF;AAOA,MAAM,qBAA0D,IAAI;AAEpE,SAAS,SAAS,WAAwB,EAAE,OAAsB;IAChE,YAAY,KAAK,SAAS,CAAC;AAC7B;AAIA,SAAS,YAAY,QAA4B;IAC/C,OAAO,KAAK,S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a;QAChB;IACF;IAEA,KAAK,MAAM,YAAY,YAAY,SAAS,CAAE;QAC5C,SAAS;IACX;IAEA,IAAI,IAAI,IAAI,KAAK,YAAY;QAC3B,mFAAmF;QACnF,kFAAkF;QAClF,oFAAoF;QACpF,yBAAyB;QACzB,+EAA+E;QAC/E,mEAAmE;QACnE,mBAAmB,MAAM,CAAC;IAC5B;AACF","ignoreList":[0],"debugId":null}}]
6
+ }
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>d});var r=s(89835),i=s(13881),n=s(27608),a=s(55931),o=s(89854),u=s(15915),l=s(53630);let h=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),r=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[s,r,i,t.length].filter(t=>t>e));if(-1===s||-1===r||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(s,n(s)).join("\n"),o=t.slice(r,n(r)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(o.slice(o.indexOf("{"),o.lastIndexOf("}")+1))}})(e)),c=!1;function d(e){let{children:t}=e,s=(0,i.useQueryClient)(),d=(0,n.Xr)(o.r),f=(0,a.useCallback)(async()=>{var e;console.log("listening to events");let t=await l.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let r=null==(e=t.body)?void 0:e.getReader();if(!r)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of h(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&await s.invalidateQueries({queryKey:u._.queryKey}),"session_changed"===e.data.type&&await s.invalidateQueries({queryKey:["sessions"]}),"task_changed"===e.data.type&&d(e.data.data)}},[s,d]);return(0,a.useEffect)(()=>{!1===c&&f().then(()=>{console.log("registered events listener"),c=!0}).catch(e=>{console.error("failed to register events listener",e),c=!0})},[f]),(0,r.jsx)(r.Fragment,{children:t})}},15915:(e,t,s)=>{"use strict";s.d(t,{Y:()=>a,_:()=>n});var r=s(45320),i=s(53630);let n={queryKey:["projects"],queryFn:async()=>{let e=await i.s.api.projects.$get(),{projects:t}=await e.json();return t}},a=()=>(0,r.useSuspenseQuery)({queryKey:n.queryKey,queryFn:n.queryFn})},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>u});var r=s(89835),i=s(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class o extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];null==(t=(s=this.props).onReset)||t.call(s,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var s,r;null==(s=(r=this.props).onError)||s.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:r}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,r)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:r}=this.props,{didCatch:a,error:o}=this.state,u=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)u=t(e);else if(s)u=(0,i.createElement)(s,e);else if(void 0!==r)u=r;else throw o}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},u)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let u=e=>{let{children:t}=e;return(0,r.jsx)(o,{FallbackComponent:e=>{let{error:t}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Error"}),(0,r.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>r});let r=(0,s(74865).hc)("/")},56555:(e,t,s)=>{"use strict";s.d(t,{Toaster:()=>u});var r=s(89835),i=s(55931),n=i.createContext(void 0),a={setTheme:e=>{},themes:[]},o=s(25602);let u=e=>{let{...t}=e,{theme:s="system"}=(()=>{var e;return null!=(e=i.useContext(n))?e:a})();return(0,r.jsx)(o.l$,{theme:s,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})}},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},67348:(e,t,s)=>{Promise.resolve().then(s.bind(s,98613)),Promise.resolve().then(s.bind(s,72611)),Promise.resolve().then(s.bind(s,13881)),Promise.resolve().then(s.bind(s,85452)),Promise.resolve().then(s.bind(s,120)),Promise.resolve().then(s.bind(s,27740)),Promise.resolve().then(s.bind(s,59054)),Promise.resolve().then(s.bind(s,8120)),Promise.resolve().then(s.bind(s,9161)),Promise.resolve().then(s.bind(s,63812)),Promise.resolve().then(s.bind(s,86260)),Promise.resolve().then(s.bind(s,15312)),Promise.resolve().then(s.bind(s,45320)),Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,56555)),Promise.resolve().then(s.bind(s,83972))},83972:(e,t,s)=>{"use strict";let r;s.d(t,{QueryClientProviderWrapper:()=>g});var i=s(89835),n=s(18832),a=s(94081),o=s(43409),u=s(36906),l=class extends u.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,i=t.queryHash??(0,n.F$)(r,t),o=this.get(i);return o||(o=new a.X({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends u.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new h.s({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){o.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),y=s(69715),p=s(10215),m=class{#i;#n;#a;#o;#u;#l;#h;#c;constructor(e={}){this.#i=e.queryCache||new l,this.#n=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#o=new Map,this.#u=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#c=y.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(r.queryHash),a=i?.state.data,o=(0,n.Zw)(t,a);if(void 0!==o)return this.#i.build(this,r).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return o.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return o.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return o.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,n.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,p.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,p.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return y.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#o.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#u.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=s(13881);let b=()=>new m({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),g=e=>{let{children:t}=e,s=n.S$?b():(null!=r||(r=b()),r);return(0,i.jsx)(v.QueryClientProvider,{client:s,children:t})}},89854:(e,t,s)=>{"use strict";s.d(t,{r:()=>r});let r=(0,s(48304).eU)([])},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_188709",variable:"__variable_188709"}}},e=>{e.O(0,[350,33,281,900,341,358],()=>e(e.s=67348)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,s)=>{"use strict";s.d(t,{ServerEventsProvider:()=>d});var r=s(89835),i=s(13881),n=s(27608),a=s(55931),o=s(89854),u=s(15915),l=s(53630);let h=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),s=t.findIndex(e=>e.startsWith("event:")),r=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[s,r,i,t.length].filter(t=>t>e));if(-1===s||-1===r||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(s,n(s)).join("\n"),o=t.slice(r,n(r)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(o.slice(o.indexOf("{"),o.lastIndexOf("}")+1))}})(e)),c=!1;function d(e){let{children:t}=e,s=(0,i.useQueryClient)(),d=(0,n.Xr)(o.r),f=(0,a.useCallback)(async()=>{var e;console.log("listening to events");let t=await l.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let r=null==(e=t.body)?void 0:e.getReader();if(!r)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await r.read();if(e)break;for(let e of h(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&await s.invalidateQueries({queryKey:u._.queryKey}),"session_changed"===e.data.type&&await s.invalidateQueries({queryKey:["sessions"]}),"task_changed"===e.data.type&&d(e.data.data)}},[s,d]);return(0,a.useEffect)(()=>{!1===c&&f().then(()=>{console.log("registered events listener"),c=!0}).catch(e=>{console.error("failed to register events listener",e),c=!0})},[f]),(0,r.jsx)(r.Fragment,{children:t})}},15915:(e,t,s)=>{"use strict";s.d(t,{Y:()=>a,_:()=>n});var r=s(45320),i=s(53630);let n={queryKey:["projects"],queryFn:async()=>{let e=await i.s.api.projects.$get(),{projects:t}=await e.json();return t}},a=()=>(0,r.useSuspenseQuery)({queryKey:n.queryKey,queryFn:n.queryFn})},47055:(e,t,s)=>{"use strict";s.d(t,{RootErrorBoundary:()=>u});var r=s(89835),i=s(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class o extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,s,r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];null==(t=(s=this.props).onReset)||t.call(s,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var s,r;null==(s=(r=this.props).onError)||s.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:s}=this.state,{resetKeys:r}=this.props;if(s&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,s)=>!Object.is(e,t[s]))}(e.resetKeys,r)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:s,fallback:r}=this.props,{didCatch:a,error:o}=this.state,u=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)u=t(e);else if(s)u=(0,i.createElement)(s,e);else if(void 0!==r)u=r;else throw o}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},u)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let u=e=>{let{children:t}=e;return(0,r.jsx)(o,{FallbackComponent:e=>{let{error:t}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Error"}),(0,r.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,s)=>{"use strict";s.d(t,{s:()=>r});let r=(0,s(74865).hc)("/")},56555:(e,t,s)=>{"use strict";s.d(t,{Toaster:()=>u});var r=s(89835),i=s(55931),n=i.createContext(void 0),a={setTheme:e=>{},themes:[]},o=s(25602);let u=e=>{let{...t}=e,{theme:s="system"}=(()=>{var e;return null!=(e=i.useContext(n))?e:a})();return(0,r.jsx)(o.l$,{theme:s,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})}},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},67348:(e,t,s)=>{Promise.resolve().then(s.bind(s,98613)),Promise.resolve().then(s.bind(s,72611)),Promise.resolve().then(s.bind(s,13881)),Promise.resolve().then(s.bind(s,85452)),Promise.resolve().then(s.bind(s,120)),Promise.resolve().then(s.bind(s,27740)),Promise.resolve().then(s.bind(s,59054)),Promise.resolve().then(s.bind(s,8120)),Promise.resolve().then(s.bind(s,9161)),Promise.resolve().then(s.bind(s,63812)),Promise.resolve().then(s.bind(s,86260)),Promise.resolve().then(s.bind(s,15312)),Promise.resolve().then(s.bind(s,45320)),Promise.resolve().then(s.t.bind(s,91198,23)),Promise.resolve().then(s.t.bind(s,65866,23)),Promise.resolve().then(s.bind(s,47055)),Promise.resolve().then(s.bind(s,8022)),Promise.resolve().then(s.t.bind(s,6415,23)),Promise.resolve().then(s.bind(s,56555)),Promise.resolve().then(s.bind(s,83972))},83972:(e,t,s)=>{"use strict";let r;s.d(t,{QueryClientProviderWrapper:()=>g});var i=s(89835),n=s(18832),a=s(94081),o=s(43409),u=s(36906),l=class extends u.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){let r=t.queryKey,i=t.queryHash??(0,n.F$)(r,t),o=this.get(i);return o||(o=new a.X({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=s(94828),c=class extends u.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#s=new Map,this.#r=0}#t;#s;#r;build(e,t,s){let r=new h.s({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#t.add(e);let t=d(e);if("string"==typeof t){let s=this.#s.get(t);s?s.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=d(e);if("string"==typeof t){let s=this.#s.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#s.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let s=this.#s.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){o.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#s.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function d(e){return e.options.scope?.id}var f=s(28700),y=s(69715),p=s(10215),m=class{#i;#n;#a;#o;#u;#l;#h;#c;constructor(e={}){this.#i=e.queryCache||new l,this.#n=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#o=new Map,this.#u=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#c=y.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#h?.(),this.#h=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#i.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime((0,n.d2)(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(r.queryHash),a=i?.state.data,o=(0,n.Zw)(t,a);if(void 0!==o)return this.#i.build(this,r).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return o.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#i;return o.jG.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(s)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return o.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#i.build(this,t);return s.isStaleByTime((0,n.d2)(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,p.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,p.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return y.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#o.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#u.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#u.values()],s={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=s(13881);let b=()=>new m({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),g=e=>{let{children:t}=e,s=n.S$?b():(null!=r||(r=b()),r);return(0,i.jsx)(v.QueryClientProvider,{client:s,children:t})}},89854:(e,t,s)=>{"use strict";s.d(t,{r:()=>r});let r=(0,s(48304).eU)([])},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}}},e=>{e.O(0,[350,33,281,900,341,358],()=>e(e.s=67348)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6415:()=>{},8022:(e,t,r)=>{"use strict";r.d(t,{ServerEventsProvider:()=>c});var s=r(89835),i=r(13881),n=r(27608),a=r(55931),o=r(89854),l=r(15915),u=r(53630);let h=e=>e.split("\n\n").filter(e=>e.length>0).map(e=>(e=>{let t=e.split("\n"),r=t.findIndex(e=>e.startsWith("event:")),s=t.findIndex(e=>e.startsWith("data:")),i=t.findIndex(e=>e.startsWith("id:")),n=e=>Math.min(...[r,s,i,t.length].filter(t=>t>e));if(-1===r||-1===s||-1===i)throw console.error("failed",e),Error("Failed to parse SSE event");let a=t.slice(r,n(r)).join("\n"),o=t.slice(s,n(s)).join("\n");return{id:t.slice(i,n(i)).join("\n").slice(3).trim(),event:a.slice(6).trim(),data:JSON.parse(o.slice(o.indexOf("{"),o.lastIndexOf("}")+1))}})(e)),d=!1;function c(e){let{children:t}=e,r=(0,i.useQueryClient)(),c=(0,n.Xr)(o.r),f=(0,a.useCallback)(async()=>{var e;console.log("listening to events");let t=await u.s.api.events.state_changes.$get();if(!t.ok)throw Error("Failed to fetch events");let s=null==(e=t.body)?void 0:e.getReader();if(!s)throw Error("Failed to get reader");let i=new TextDecoder;for(;;){let{done:e,value:t}=await s.read();if(e)break;for(let e of h(i.decode(t)))console.log("data",e),"project_changed"===e.data.type&&await r.invalidateQueries({queryKey:l._.queryKey}),"session_changed"===e.data.type&&await r.invalidateQueries({queryKey:["sessions"]}),"task_changed"===e.data.type&&c(e.data.data)}},[r,c]);return(0,a.useEffect)(()=>{!1===d&&f().then(()=>{console.log("registered events listener"),d=!0}).catch(e=>{console.error("failed to register events listener",e),d=!0})},[f]),(0,s.jsx)(s.Fragment,{children:t})}},15915:(e,t,r)=>{"use strict";r.d(t,{Y:()=>a,_:()=>n});var s=r(45320),i=r(53630);let n={queryKey:["projects"],queryFn:async()=>{let e=await i.s.api.projects.$get(),{projects:t}=await e.json();return t}},a=()=>(0,s.useSuspenseQuery)({queryKey:n.queryKey,queryFn:n.queryFn})},18237:(e,t,r)=>{"use strict";r.d(t,{cn:()=>n});var s=r(98951),i=r(42411);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,s.$)(t))}},37988:(e,t,r)=>{Promise.resolve().then(r.bind(r,98613)),Promise.resolve().then(r.bind(r,72611)),Promise.resolve().then(r.bind(r,13881)),Promise.resolve().then(r.bind(r,85452)),Promise.resolve().then(r.bind(r,120)),Promise.resolve().then(r.bind(r,27740)),Promise.resolve().then(r.bind(r,59054)),Promise.resolve().then(r.bind(r,8120)),Promise.resolve().then(r.bind(r,9161)),Promise.resolve().then(r.bind(r,63812)),Promise.resolve().then(r.bind(r,86260)),Promise.resolve().then(r.bind(r,15312)),Promise.resolve().then(r.bind(r,45320)),Promise.resolve().then(r.t.bind(r,91198,23)),Promise.resolve().then(r.t.bind(r,65866,23)),Promise.resolve().then(r.bind(r,47055)),Promise.resolve().then(r.bind(r,8022)),Promise.resolve().then(r.t.bind(r,6415,23)),Promise.resolve().then(r.bind(r,97184)),Promise.resolve().then(r.bind(r,56555)),Promise.resolve().then(r.bind(r,83972))},47055:(e,t,r)=>{"use strict";r.d(t,{RootErrorBoundary:()=>l});var s=r(89835),i=r(55931);let n=(0,i.createContext)(null),a={didCatch:!1,error:null};class o extends i.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,s=arguments.length,i=Array(s),n=0;n<s;n++)i[n]=arguments[n];null==(t=(r=this.props).onReset)||t.call(r,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var r,s;null==(r=(s=this.props).onError)||r.call(s,e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:s}=this.props;if(r&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,s)){var i,n;null==(i=(n=this.props).onReset)||i.call(n,{next:s,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:s}=this.props,{didCatch:a,error:o}=this.state,l=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)l=t(e);else if(r)l=(0,i.createElement)(r,e);else if(void 0!==s)l=s;else throw o}return(0,i.createElement)(n.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},l)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}}let l=e=>{let{children:t}=e;return(0,s.jsx)(o,{FallbackComponent:e=>{let{error:t}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Error"}),(0,s.jsx)("p",{children:t.message})]})},children:t})}},53630:(e,t,r)=>{"use strict";r.d(t,{s:()=>s});let s=(0,r(74865).hc)("/")},56555:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>l});var s=r(89835),i=r(55931),n=i.createContext(void 0),a={setTheme:e=>{},themes:[]},o=r(25602);let l=e=>{let{...t}=e,{theme:r="system"}=(()=>{var e;return null!=(e=i.useContext(n))?e:a})();return(0,s.jsx)(o.l$,{theme:r,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})}},65866:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},69655:(e,t,r)=>{"use strict";r.d(t,{XY:()=>n,_4:()=>a,j4:()=>i});var s=r(48304);let i=(0,s.eU)([]),n=(0,s.eU)(null,(e,t,r)=>{let s=e(i);t(i,[...s,{id:"".concat(Date.now(),"-").concat(Math.random()),sessionName:r,timestamp:Date.now()}])}),a=(0,s.eU)(null,(e,t,r)=>{let s=e(i);t(i,s.filter(e=>e.id!==r))})},80942:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var s=r(89835),i=r(8607),n=r(7951),a=r(18237);let o=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:r,size:n,asChild:l=!1,...u}=e,h=l?i.DX:"button";return(0,s.jsx)(h,{"data-slot":"button",className:(0,a.cn)(o({variant:r,size:n,className:t})),...u})}},83972:(e,t,r)=>{"use strict";let s;r.d(t,{QueryClientProviderWrapper:()=>b});var i=r(89835),n=r(18832),a=r(94081),o=r(43409),l=r(36906),u=class extends l.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let s=t.queryKey,i=t.queryHash??(0,n.F$)(s,t),o=this.get(i);return o||(o=new a.X({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},h=r(94828),d=class extends l.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#r=new Map,this.#s=0}#t;#r;#s;build(e,t,r){let s=new h.s({mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#t.add(e);let t=c(e);if("string"==typeof t){let r=this.#r.get(t);r?r.push(e):this.#r.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#r.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#r.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#r.get(t),s=r?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#r.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#r.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){o.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function c(e){return e.options.scope?.id}var f=r(28700),m=r(69715),y=r(10215),p=class{#i;#n;#a;#o;#l;#u;#h;#d;constructor(e={}){this.#i=e.queryCache||new u,this.#n=e.mutationCache||new d,this.#a=e.defaultOptions||{},this.#o=new Map,this.#l=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#h=f.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#d=m.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#h?.(),this.#h=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#i.build(this,t),s=r.state.data;return void 0===s?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.d2)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let s=this.defaultQueryOptions({queryKey:e}),i=this.#i.get(s.queryHash),a=i?.state.data,o=(0,n.Zw)(t,a);if(void 0!==o)return this.#i.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return o.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){let t=this.#i;o.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#i;return o.jG.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(r)))).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return o.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#i.build(this,t);return r.isStaleByTime((0,n.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=(0,y.PL)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=(0,y.PL)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return m.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#o.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#o.values()],r={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#l.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],r={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#n.clear()}},v=r(13881);let g=()=>new p({defaultOptions:{queries:{refetchOnWindowFocus:!0,refetchInterval:3e5,retry:!1}}}),b=e=>{let{children:t}=e,r=n.S$?g():(null!=s||(s=g()),s);return(0,i.jsx)(v.QueryClientProvider,{client:r,children:t})}},89854:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});let s=(0,r(48304).eU)([])},91198:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_5cfdac",variable:"__variable_5cfdac"}},93856:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(92398).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},97184:(e,t,r)=>{"use strict";r.d(t,{TaskCompletionMessages:()=>d});var s=r(89835),i=r(27608),n=r(55931),a=r(69655);let o=(0,r(92398).A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var l=r(93856),u=r(80942);let h=e=>{let{sessionName:t,onClose:r}=e,[i,a]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=setTimeout(()=>{a(!1),setTimeout(r,300)},5e3);return()=>clearTimeout(e)},[r]),(0,s.jsx)("div",{className:"fixed top-4 right-4 z-50 transition-all duration-300 ".concat(i?"transform translate-x-0 opacity-100":"transform translate-x-full opacity-0"),children:(0,s.jsx)("div",{className:"bg-background border border-border shadow-lg rounded-lg p-4 min-w-[320px] max-w-[400px]",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(o,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"タスクが完了しました"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1 break-words",children:t})]}),(0,s.jsx)(u.$,{variant:"ghost",size:"sm",onClick:()=>{a(!1),setTimeout(r,300)},className:"h-6 w-6 p-0 hover:bg-muted",children:(0,s.jsx)(l.A,{className:"w-4 h-4"})})]})})})},d=()=>{let[e]=(0,i.fp)(a.j4),t=(0,i.Xr)(a._4),r=(0,n.useCallback)(e=>{t(e)},[t]);return(0,s.jsx)(s.Fragment,{children:e.map((e,t)=>(0,s.jsx)("div",{style:{transform:"translateY(".concat(10*t,"px)"),zIndex:50-t},children:(0,s.jsx)(h,{sessionName:e.sessionName,onClose:()=>r(e.id)})},e.id))})}}},e=>{e.O(0,[350,888,281,900,341,358],()=>e(e.s=37988)),_N_E=e.O()}]);