neural-loom 0.2.55 → 0.2.57
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +5 -5
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +6 -6
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page/build-manifest.json +2 -2
- package/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js.map +1 -1
- package/.next/server/chunks/ssr/_0t7oqy6._.js +6 -1
- package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +5 -5
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/08o_~ynkkb9ph.js +31 -0
- package/.next/static/chunks/{0eidfx-s54367.js → 0gy2rolwxzjl8.js} +1 -1
- package/.next/static/chunks/0obzqbxd9niy0.js +1 -0
- package/.next/static/chunks/12m0vh2h637z4.js +1 -0
- package/.next/static/chunks/15b-kgkhsdb0s.js +11 -0
- package/.next/static/chunks/{turbopack-0.g.4cakdth0h.js → turbopack-06zh3hgrjcphg.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +2 -1
- package/public/manifest.json +6 -2
- package/src/app/components/DbExplorer.tsx +293 -16
- package/src/app/components/IdeLayout.tsx +98 -12
- package/.next/static/chunks/0ljspdd3cv1ft.js +0 -31
- package/.next/static/chunks/0st7_hghhyuv4.js +0 -1
- package/.next/static/chunks/0ulfmf9nsz_o-.js +0 -6
- /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → HoQA8gsbI6xeWQpFAPJZ9}/_buildManifest.js +0 -0
- /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → HoQA8gsbI6xeWQpFAPJZ9}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → HoQA8gsbI6xeWQpFAPJZ9}/_ssgManifest.js +0 -0
|
@@ -64,6 +64,9 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
|
|
|
64
64
|
affectedRows?: number;
|
|
65
65
|
} | null>(null);
|
|
66
66
|
|
|
67
|
+
const [editingCell, setEditingCell] = useState<{ rowIndex: number; field: string; value: string } | null>(null);
|
|
68
|
+
const [editStatus, setEditStatus] = useState<{ rowIndex: number; field: string; status: 'saving' | 'success' | 'error'; message?: string } | null>(null);
|
|
69
|
+
|
|
67
70
|
// Connection management modal state
|
|
68
71
|
const [showAddModal, setShowAddModal] = useState(false);
|
|
69
72
|
const [isNewGlobal, setIsNewGlobal] = useState(false);
|
|
@@ -293,6 +296,181 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
|
|
|
293
296
|
}
|
|
294
297
|
};
|
|
295
298
|
|
|
299
|
+
const parseTableName = (sqlQuery: string): string | null => {
|
|
300
|
+
const match = sqlQuery.match(/from\s+([a-zA-Z0-9_\`"\[\]\.]+)/i);
|
|
301
|
+
if (!match) return null;
|
|
302
|
+
let tbl = match[1].trim();
|
|
303
|
+
tbl = tbl.replace(/[\`"\[\]]/g, "");
|
|
304
|
+
const parts = tbl.split(".");
|
|
305
|
+
return parts[parts.length - 1];
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const handleCellSubmit = async (rowIndex: number, field: string, newValue: string, oldValue: any) => {
|
|
309
|
+
if (activeProfile?.readOnly) {
|
|
310
|
+
alert("Database connection is Read-Only. Updates are disabled.");
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const tableName = parseTableName(sql);
|
|
315
|
+
if (!tableName) {
|
|
316
|
+
alert("Could not extract table name from query for inline edit. Please ensure your query includes 'FROM tableName'.");
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
setEditStatus({ rowIndex, field, status: 'saving' });
|
|
321
|
+
|
|
322
|
+
try {
|
|
323
|
+
let cols = tableColumns[tableName];
|
|
324
|
+
if (!cols) {
|
|
325
|
+
const res = await fetch(
|
|
326
|
+
`/api/sql/schema?action=describe_table&table=${encodeURIComponent(tableName)}&root=${encodeURIComponent(
|
|
327
|
+
workspaceRoot
|
|
328
|
+
)}`
|
|
329
|
+
);
|
|
330
|
+
if (res.ok) {
|
|
331
|
+
const data = await res.json();
|
|
332
|
+
if (data.success && data.columns) {
|
|
333
|
+
cols = data.columns;
|
|
334
|
+
setTableColumns((prev) => ({ ...prev, [tableName]: data.columns }));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (!cols) {
|
|
340
|
+
throw new Error(`Could not load schema columns for table "${tableName}".`);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const pkCol = cols.find((c) => c.isPrimaryKey);
|
|
344
|
+
if (!pkCol) {
|
|
345
|
+
throw new Error(`Table "${tableName}" does not have a primary key. Inline editing requires a primary key.`);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const row = queryResult?.rows[rowIndex];
|
|
349
|
+
if (!row || !(pkCol.name in row)) {
|
|
350
|
+
throw new Error(`Primary key column "${pkCol.name}" was not returned in the query results. Please include it in your SELECT statement.`);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const pkValue = row[pkCol.name];
|
|
354
|
+
const targetColSchema = cols.find((c) => c.name === field);
|
|
355
|
+
if (!targetColSchema) {
|
|
356
|
+
throw new Error(`Column "${field}" was not found in schema columns.`);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const isNumeric = (type: string) => {
|
|
360
|
+
const t = type.toLowerCase();
|
|
361
|
+
return t.includes("int") || t.includes("decimal") || t.includes("numeric") || t.includes("float") || t.includes("double") || t.includes("real");
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
let setExpr = "";
|
|
365
|
+
if (newValue.toUpperCase() === "NULL") {
|
|
366
|
+
setExpr = `${field} = NULL`;
|
|
367
|
+
} else if (isNumeric(targetColSchema.type)) {
|
|
368
|
+
if (newValue === "" || isNaN(Number(newValue))) {
|
|
369
|
+
throw new Error(`Value "${newValue}" is not a valid number for column "${field}".`);
|
|
370
|
+
}
|
|
371
|
+
setExpr = `${field} = ${newValue}`;
|
|
372
|
+
} else {
|
|
373
|
+
setExpr = `${field} = '${newValue.replace(/'/g, "''")}'`;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
let pkExpr = "";
|
|
377
|
+
if (isNumeric(pkCol.type)) {
|
|
378
|
+
pkExpr = `${pkCol.name} = ${pkValue}`;
|
|
379
|
+
} else {
|
|
380
|
+
pkExpr = `${pkCol.name} = '${String(pkValue).replace(/'/g, "''")}'`;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const updateSql = `UPDATE ${tableName} SET ${setExpr} WHERE ${pkExpr};`;
|
|
384
|
+
|
|
385
|
+
const res = await fetch("/api/sql/query", {
|
|
386
|
+
method: "POST",
|
|
387
|
+
headers: { "Content-Type": "application/json" },
|
|
388
|
+
body: JSON.stringify({
|
|
389
|
+
sql: updateSql,
|
|
390
|
+
root: workspaceRoot,
|
|
391
|
+
}),
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
const data = await res.json();
|
|
395
|
+
if (res.ok && data.success) {
|
|
396
|
+
if (queryResult) {
|
|
397
|
+
const updatedRows = [...queryResult.rows];
|
|
398
|
+
let typedVal: any = newValue;
|
|
399
|
+
if (newValue.toUpperCase() === "NULL") {
|
|
400
|
+
typedVal = null;
|
|
401
|
+
} else if (isNumeric(targetColSchema.type)) {
|
|
402
|
+
typedVal = Number(newValue);
|
|
403
|
+
}
|
|
404
|
+
updatedRows[rowIndex] = {
|
|
405
|
+
...updatedRows[rowIndex],
|
|
406
|
+
[field]: typedVal,
|
|
407
|
+
};
|
|
408
|
+
setQueryResult({
|
|
409
|
+
...queryResult,
|
|
410
|
+
rows: updatedRows,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
setEditStatus({ rowIndex, field, status: 'success' });
|
|
414
|
+
setTimeout(() => setEditStatus(null), 1500);
|
|
415
|
+
} else {
|
|
416
|
+
throw new Error(data.error || "Update database query failed.");
|
|
417
|
+
}
|
|
418
|
+
} catch (err) {
|
|
419
|
+
const error = err as Error;
|
|
420
|
+
setEditStatus({ rowIndex, field, status: 'error', message: error.message });
|
|
421
|
+
alert(`Inline Update Failed:\n${error.message}`);
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const handleExportCSV = () => {
|
|
426
|
+
if (!queryResult || queryResult.rows.length === 0) return;
|
|
427
|
+
try {
|
|
428
|
+
const headers = queryResult.fields.join(",");
|
|
429
|
+
const lines = queryResult.rows.map((row) => {
|
|
430
|
+
return queryResult.fields.map((f) => {
|
|
431
|
+
const val = row[f];
|
|
432
|
+
if (val === null) return "NULL";
|
|
433
|
+
const str = String(val);
|
|
434
|
+
if (str.includes(",") || str.includes('"') || str.includes("\n") || str.includes("\r")) {
|
|
435
|
+
return `"${str.replace(/"/g, '""')}"`;
|
|
436
|
+
}
|
|
437
|
+
return str;
|
|
438
|
+
}).join(",");
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
const csvContent = [headers, ...lines].join("\r\n");
|
|
442
|
+
const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
|
|
443
|
+
const url = URL.createObjectURL(blob);
|
|
444
|
+
const link = document.createElement("a");
|
|
445
|
+
link.setAttribute("href", url);
|
|
446
|
+
link.setAttribute("download", `query-results-${Date.now()}.csv`);
|
|
447
|
+
document.body.appendChild(link);
|
|
448
|
+
link.click();
|
|
449
|
+
document.body.removeChild(link);
|
|
450
|
+
} catch (err) {
|
|
451
|
+
console.error("Export CSV failed:", err);
|
|
452
|
+
alert("Failed to export as CSV");
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const handleExportJSON = () => {
|
|
457
|
+
if (!queryResult || queryResult.rows.length === 0) return;
|
|
458
|
+
try {
|
|
459
|
+
const jsonContent = JSON.stringify(queryResult.rows, null, 2);
|
|
460
|
+
const blob = new Blob([jsonContent], { type: "application/json;charset=utf-8;" });
|
|
461
|
+
const url = URL.createObjectURL(blob);
|
|
462
|
+
const link = document.createElement("a");
|
|
463
|
+
link.setAttribute("href", url);
|
|
464
|
+
link.setAttribute("download", `query-results-${Date.now()}.json`);
|
|
465
|
+
document.body.appendChild(link);
|
|
466
|
+
link.click();
|
|
467
|
+
document.body.removeChild(link);
|
|
468
|
+
} catch (err) {
|
|
469
|
+
console.error("Export JSON failed:", err);
|
|
470
|
+
alert("Failed to export as JSON");
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
|
|
296
474
|
// Run SQL Query
|
|
297
475
|
const handleRunQuery = async () => {
|
|
298
476
|
if (!sql.trim() || !activeId) return;
|
|
@@ -558,13 +736,21 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
|
|
|
558
736
|
{queryResult && (
|
|
559
737
|
<div style={styles.resultsWrapper}>
|
|
560
738
|
<div style={styles.resultsMeta}>
|
|
561
|
-
<
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
739
|
+
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem" }}>
|
|
740
|
+
<span>
|
|
741
|
+
Query completed.{" "}
|
|
742
|
+
{queryResult.affectedRows !== undefined
|
|
743
|
+
? `Affected rows: ${queryResult.affectedRows}`
|
|
744
|
+
: `Returned ${queryResult.rows.length} rows`}
|
|
745
|
+
</span>
|
|
746
|
+
<span>Duration: {queryResult.durationMs}ms</span>
|
|
747
|
+
</div>
|
|
748
|
+
{queryResult.rows.length > 0 && (
|
|
749
|
+
<div style={{ display: "flex", gap: "0.4rem" }}>
|
|
750
|
+
<button onClick={handleExportCSV} style={styles.exportBtn}>📥 Export CSV</button>
|
|
751
|
+
<button onClick={handleExportJSON} style={styles.exportBtn}>📥 Export JSON</button>
|
|
752
|
+
</div>
|
|
753
|
+
)}
|
|
568
754
|
</div>
|
|
569
755
|
|
|
570
756
|
{queryResult.rows.length > 0 ? (
|
|
@@ -582,15 +768,75 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
|
|
|
582
768
|
<tbody>
|
|
583
769
|
{queryResult.rows.map((row, idx) => (
|
|
584
770
|
<tr key={idx} style={idx % 2 === 0 ? styles.trEven : styles.trOdd}>
|
|
585
|
-
{queryResult.fields.map((f) =>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
771
|
+
{queryResult.fields.map((f) => {
|
|
772
|
+
const isEditing = editingCell && editingCell.rowIndex === idx && editingCell.field === f;
|
|
773
|
+
const isSaving = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'saving';
|
|
774
|
+
const isSuccess = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'success';
|
|
775
|
+
const isError = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'error';
|
|
776
|
+
|
|
777
|
+
let cellStyle = { ...styles.td, ...styles.editableCell };
|
|
778
|
+
if (isSaving) {
|
|
779
|
+
cellStyle = { ...cellStyle, backgroundColor: "rgba(168, 85, 247, 0.15)" };
|
|
780
|
+
} else if (isSuccess) {
|
|
781
|
+
cellStyle = { ...cellStyle, backgroundColor: "rgba(16, 185, 129, 0.25)" };
|
|
782
|
+
} else if (isError) {
|
|
783
|
+
cellStyle = { ...cellStyle, backgroundColor: "rgba(239, 68, 68, 0.25)" };
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return (
|
|
787
|
+
<td
|
|
788
|
+
key={f}
|
|
789
|
+
style={cellStyle}
|
|
790
|
+
onDoubleClick={() => {
|
|
791
|
+
if (activeProfile?.readOnly) {
|
|
792
|
+
alert("Database connection is Read-Only. Editing is disabled.");
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
setEditingCell({
|
|
796
|
+
rowIndex: idx,
|
|
797
|
+
field: f,
|
|
798
|
+
value: row[f] === null ? "NULL" : String(row[f]),
|
|
799
|
+
});
|
|
800
|
+
}}
|
|
801
|
+
className="db-cell"
|
|
802
|
+
title="Double click to edit cell"
|
|
803
|
+
>
|
|
804
|
+
{isEditing ? (
|
|
805
|
+
<input
|
|
806
|
+
style={styles.cellInput}
|
|
807
|
+
value={editingCell.value}
|
|
808
|
+
autoFocus
|
|
809
|
+
onChange={(e) => setEditingCell({ ...editingCell, value: e.target.value })}
|
|
810
|
+
onKeyDown={async (e) => {
|
|
811
|
+
if (e.key === "Enter") {
|
|
812
|
+
e.preventDefault();
|
|
813
|
+
const newVal = editingCell.value;
|
|
814
|
+
setEditingCell(null);
|
|
815
|
+
if (newVal !== (row[f] === null ? "NULL" : String(row[f]))) {
|
|
816
|
+
await handleCellSubmit(idx, f, newVal, row[f]);
|
|
817
|
+
}
|
|
818
|
+
} else if (e.key === "Escape") {
|
|
819
|
+
setEditingCell(null);
|
|
820
|
+
}
|
|
821
|
+
}}
|
|
822
|
+
onBlur={async () => {
|
|
823
|
+
const newVal = editingCell.value;
|
|
824
|
+
setEditingCell(null);
|
|
825
|
+
if (newVal !== (row[f] === null ? "NULL" : String(row[f]))) {
|
|
826
|
+
await handleCellSubmit(idx, f, newVal, row[f]);
|
|
827
|
+
}
|
|
828
|
+
}}
|
|
829
|
+
/>
|
|
830
|
+
) : (
|
|
831
|
+
row[f] === null
|
|
832
|
+
? "NULL"
|
|
833
|
+
: typeof row[f] === "object"
|
|
834
|
+
? JSON.stringify(row[f])
|
|
835
|
+
: String(row[f])
|
|
836
|
+
)}
|
|
837
|
+
</td>
|
|
838
|
+
);
|
|
839
|
+
})}
|
|
594
840
|
</tr>
|
|
595
841
|
))}
|
|
596
842
|
</tbody>
|
|
@@ -1119,6 +1365,7 @@ const styles: { [key: string]: React.CSSProperties } = {
|
|
|
1119
1365
|
resultsMeta: {
|
|
1120
1366
|
display: "flex",
|
|
1121
1367
|
justifyContent: "space-between",
|
|
1368
|
+
alignItems: "center",
|
|
1122
1369
|
fontSize: "0.75rem",
|
|
1123
1370
|
color: "var(--muted)",
|
|
1124
1371
|
marginBottom: "0.5rem",
|
|
@@ -1152,6 +1399,32 @@ const styles: { [key: string]: React.CSSProperties } = {
|
|
|
1152
1399
|
color: "#cbd5e1",
|
|
1153
1400
|
whiteSpace: "nowrap",
|
|
1154
1401
|
},
|
|
1402
|
+
exportBtn: {
|
|
1403
|
+
padding: "0.2rem 0.5rem",
|
|
1404
|
+
borderRadius: "4px",
|
|
1405
|
+
border: "1px solid var(--border)",
|
|
1406
|
+
backgroundColor: "rgba(255, 255, 255, 0.02)",
|
|
1407
|
+
color: "var(--muted)",
|
|
1408
|
+
fontSize: "0.7rem",
|
|
1409
|
+
fontWeight: 600,
|
|
1410
|
+
cursor: "pointer",
|
|
1411
|
+
transition: "all 0.15s ease",
|
|
1412
|
+
},
|
|
1413
|
+
cellInput: {
|
|
1414
|
+
width: "100%",
|
|
1415
|
+
backgroundColor: "#070a12",
|
|
1416
|
+
border: "1px solid var(--border-focus)",
|
|
1417
|
+
borderRadius: "3px",
|
|
1418
|
+
color: "#fff",
|
|
1419
|
+
padding: "0.1rem 0.3rem",
|
|
1420
|
+
fontSize: "0.8rem",
|
|
1421
|
+
fontFamily: "monospace",
|
|
1422
|
+
outline: "none",
|
|
1423
|
+
},
|
|
1424
|
+
editableCell: {
|
|
1425
|
+
cursor: "pointer",
|
|
1426
|
+
transition: "all 0.15s ease",
|
|
1427
|
+
},
|
|
1155
1428
|
trEven: {
|
|
1156
1429
|
backgroundColor: "transparent",
|
|
1157
1430
|
},
|
|
@@ -1291,6 +1564,10 @@ if (typeof document !== "undefined") {
|
|
|
1291
1564
|
0% { transform: rotate(0deg); }
|
|
1292
1565
|
100% { transform: rotate(360deg); }
|
|
1293
1566
|
}
|
|
1567
|
+
.db-cell:hover {
|
|
1568
|
+
background-color: rgba(255, 255, 255, 0.03) !important;
|
|
1569
|
+
outline: 1px dashed rgba(255, 255, 255, 0.2);
|
|
1570
|
+
}
|
|
1294
1571
|
`;
|
|
1295
1572
|
document.head.appendChild(style);
|
|
1296
1573
|
}
|
|
@@ -1,11 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState, useCallback } from "react";
|
|
4
|
+
import dynamic from "next/dynamic";
|
|
4
5
|
import TerminalConsole from "./TerminalConsole";
|
|
5
6
|
import DirectoryBrowserModal from "./DirectoryBrowserModal";
|
|
6
7
|
import MarkdownPreview from "./MarkdownPreview";
|
|
7
8
|
import DbExplorer from "./DbExplorer";
|
|
8
9
|
|
|
10
|
+
const MonacoEditor = dynamic(() => import("@monaco-editor/react"), { ssr: false });
|
|
11
|
+
|
|
12
|
+
const getEditorLanguage = (filePath: string): string => {
|
|
13
|
+
if (!filePath) return "plaintext";
|
|
14
|
+
const ext = filePath.split(".").pop()?.toLowerCase();
|
|
15
|
+
switch (ext) {
|
|
16
|
+
case "ts":
|
|
17
|
+
case "tsx":
|
|
18
|
+
return "typescript";
|
|
19
|
+
case "js":
|
|
20
|
+
case "jsx":
|
|
21
|
+
return "javascript";
|
|
22
|
+
case "json":
|
|
23
|
+
return "json";
|
|
24
|
+
case "css":
|
|
25
|
+
return "css";
|
|
26
|
+
case "md":
|
|
27
|
+
return "markdown";
|
|
28
|
+
case "html":
|
|
29
|
+
return "html";
|
|
30
|
+
case "sql":
|
|
31
|
+
return "sql";
|
|
32
|
+
case "py":
|
|
33
|
+
return "python";
|
|
34
|
+
case "sh":
|
|
35
|
+
case "bash":
|
|
36
|
+
return "shell";
|
|
37
|
+
case "yaml":
|
|
38
|
+
case "yml":
|
|
39
|
+
return "yaml";
|
|
40
|
+
default:
|
|
41
|
+
return "plaintext";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleEditorWillMount = (monaco: any) => {
|
|
46
|
+
monaco.editor.defineTheme("neural-loom-dark", {
|
|
47
|
+
base: "vs-dark",
|
|
48
|
+
inherit: true,
|
|
49
|
+
rules: [
|
|
50
|
+
{ token: "", foreground: "d4d4d4" },
|
|
51
|
+
{ token: "comment", foreground: "6a9955" },
|
|
52
|
+
{ token: "keyword", foreground: "c586c0" },
|
|
53
|
+
{ token: "string", foreground: "ce9178" },
|
|
54
|
+
{ token: "number", foreground: "b5cea8" },
|
|
55
|
+
{ token: "regexp", foreground: "d16969" },
|
|
56
|
+
{ token: "type", foreground: "4ec9b0" },
|
|
57
|
+
{ token: "class", foreground: "4ec9b0" },
|
|
58
|
+
{ token: "function", foreground: "dcdcaa" },
|
|
59
|
+
],
|
|
60
|
+
colors: {
|
|
61
|
+
"editor.background": "#05070a",
|
|
62
|
+
"editor.foreground": "#d4d4d4",
|
|
63
|
+
"editorLineNumber.foreground": "#5a5a5a",
|
|
64
|
+
"editorLineNumber.activeForeground": "#c084fc",
|
|
65
|
+
"editor.lineHighlightBackground": "#0f131a",
|
|
66
|
+
"editor.selectionBackground": "#264f78",
|
|
67
|
+
"editorCursor.foreground": "#c084fc",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const editorOptions = {
|
|
73
|
+
minimap: { enabled: true },
|
|
74
|
+
fontSize: 13,
|
|
75
|
+
lineNumbers: "on" as const,
|
|
76
|
+
wordWrap: "on" as const,
|
|
77
|
+
automaticLayout: true,
|
|
78
|
+
scrollBeyondLastLine: false,
|
|
79
|
+
tabSize: 2,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
|
|
9
83
|
const getModeIcon = (type: string) => {
|
|
10
84
|
if (type === 'mock') return '🧪';
|
|
11
85
|
if (type.includes('-docker')) return '🐳';
|
|
@@ -1826,11 +1900,15 @@ export default function IdeLayout({ sessionId, workspaceRoot, scopedDirs, onClos
|
|
|
1826
1900
|
) : currentMode === 'split' ? (
|
|
1827
1901
|
<div style={{ display: "flex", width: "100%", height: "100%", overflow: "hidden" }}>
|
|
1828
1902
|
<div style={{ flex: 1, height: "100%" }}>
|
|
1829
|
-
<
|
|
1903
|
+
<MonacoEditor
|
|
1904
|
+
height="100%"
|
|
1905
|
+
language="markdown"
|
|
1906
|
+
theme="neural-loom-dark"
|
|
1830
1907
|
value={activeFile.content}
|
|
1831
|
-
onChange={(
|
|
1832
|
-
|
|
1833
|
-
|
|
1908
|
+
onChange={(value) => handleContentChange(value || "")}
|
|
1909
|
+
beforeMount={handleEditorWillMount}
|
|
1910
|
+
options={editorOptions}
|
|
1911
|
+
loading={<div style={{ padding: "1rem", color: "var(--muted)" }}>Loading Editor...</div>}
|
|
1834
1912
|
/>
|
|
1835
1913
|
</div>
|
|
1836
1914
|
<div style={{ flex: 1, height: "100%", overflow: "hidden" }}>
|
|
@@ -1838,19 +1916,27 @@ export default function IdeLayout({ sessionId, workspaceRoot, scopedDirs, onClos
|
|
|
1838
1916
|
</div>
|
|
1839
1917
|
</div>
|
|
1840
1918
|
) : (
|
|
1841
|
-
<
|
|
1919
|
+
<MonacoEditor
|
|
1920
|
+
height="100%"
|
|
1921
|
+
language="markdown"
|
|
1922
|
+
theme="neural-loom-dark"
|
|
1842
1923
|
value={activeFile.content}
|
|
1843
|
-
onChange={(
|
|
1844
|
-
|
|
1845
|
-
|
|
1924
|
+
onChange={(value) => handleContentChange(value || "")}
|
|
1925
|
+
beforeMount={handleEditorWillMount}
|
|
1926
|
+
options={editorOptions}
|
|
1927
|
+
loading={<div style={{ padding: "1rem", color: "var(--muted)" }}>Loading Editor...</div>}
|
|
1846
1928
|
/>
|
|
1847
1929
|
)
|
|
1848
1930
|
) : (
|
|
1849
|
-
<
|
|
1931
|
+
<MonacoEditor
|
|
1932
|
+
height="100%"
|
|
1933
|
+
language={getEditorLanguage(activeFile.path)}
|
|
1934
|
+
theme="neural-loom-dark"
|
|
1850
1935
|
value={activeFile.content}
|
|
1851
|
-
onChange={(
|
|
1852
|
-
|
|
1853
|
-
|
|
1936
|
+
onChange={(value) => handleContentChange(value || "")}
|
|
1937
|
+
beforeMount={handleEditorWillMount}
|
|
1938
|
+
options={editorOptions}
|
|
1939
|
+
loading={<div style={{ padding: "1rem", color: "var(--muted)" }}>Loading Editor...</div>}
|
|
1854
1940
|
/>
|
|
1855
1941
|
)
|
|
1856
1942
|
) : (
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18800,(e,t,r)=>{"use strict";var n=e.r(71645);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal"),a=Symbol.for("react.optimistic_key"),c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,r.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==n?null:n===a?a:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},r.flushSync=function(e){var t=c.T,r=u.p;try{if(c.T=null,u.p=2,e)return e()}finally{c.T=t,u.p=r,u.d.f()}},r.preconnect=function(e,t){"string"==typeof e&&(t=t?"string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:null,u.d.C(e,t))},r.prefetchDNS=function(e){"string"==typeof e&&u.d.D(e)},r.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var r=t.as,n=l(r,t.crossOrigin),o="string"==typeof t.integrity?t.integrity:void 0,i="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===r?u.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):"script"===r&&u.d.X(e,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},r.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var r=l(t.as,t.crossOrigin);u.d.M(e,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&u.d.M(e)},r.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var r=t.as,n=l(r,t.crossOrigin);u.d.L(e,r,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},r.preloadModule=function(e,t){if("string"==typeof e)if(t){var r=l(t.as,t.crossOrigin);u.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else u.d.m(e)},r.requestFormReset=function(e){u.d.r(e)},r.unstable_batchedUpdates=function(e,t){return e(t)},r.useFormState=function(e,t,r){return c.H.useFormState(e,t,r)},r.useFormStatus=function(){return c.H.useHostTransitionStatus()},r.version="19.3.0-canary-3f0b9e61-20260317"},74080,(e,t,r)=>{"use strict";!function e(){if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e.r(18800)},43369,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0});var o={getAssetToken:function(){return a},getAssetTokenQuery:function(){return c},getDeploymentId:function(){return u},getDeploymentIdQuery:function(){return s}};for(var i in o)Object.defineProperty(r,i,{enumerable:!0,get:o[i]});function u(){return n}function s(e=!1){let t=n;return t?`${e?"&":"?"}dpl=${t}`:""}function a(){return!1}function c(e=!1){return""}"u">typeof window?(n=document.documentElement.dataset.dplId,delete document.documentElement.dataset.dplId):n=void 0},32061,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={BailoutToCSRError:function(){return u},isBailoutToCSRError:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i="BAILOUT_TO_CLIENT_SIDE_RENDERING";class u extends Error{constructor(e){super(`Bail out to client-side rendering: ${e}`),this.reason=e,this.digest=i}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===i}},35451,(e,t,r)=>{var n={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var a=[],c=!1,l=-1;function f(){c&&n&&(c=!1,n.length?a=n.concat(a):l=-1,a.length&&d())}function d(){if(!c){var e=s(f);c=!0;for(var t=a.length;t;){for(n=a,a=[];++l<t;)n&&n[l].run();l=-1,t=a.length}n=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new p(e,t)),1!==a.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},u=!0;try{n[e](r,r.exports,i),u=!1}finally{u&&delete o[e]}return r.exports}i.ab="/ROOT/node_modules/next/dist/compiled/process/",t.exports=i(229)},47167,(e,t,r)=>{"use strict";var n,o;t.exports=(null==(n=e.g.process)?void 0:n.env)&&"object"==typeof(null==(o=e.g.process)?void 0:o.env)?e.g.process:e.r(35451)},45689,(e,t,r)=>{"use strict";var n=Symbol.for("react.transitional.element");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}r.Fragment=Symbol.for("react.fragment"),r.jsx=o,r.jsxs=o},43476,(e,t,r)=>{"use strict";t.exports=e.r(45689)},50740,(e,t,r)=>{"use strict";var n=e.i(47167),o=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),h=Symbol.for("react.view_transition"),b=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,_={};function x(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||v}function S(){}function O(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||v}x.prototype.isReactComponent={},x.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=x.prototype;var E=O.prototype=new S;E.constructor=O,m(E,x.prototype),E.isPureReactComponent=!0;var j=Array.isArray;function T(){}var w={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function C(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function A(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var k=/\/+/g;function H(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function P(e,t,r){if(null==e)return e;var n=[],u=0;return!function e(t,r,n,u,s){var a,c,l,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var d=!1;if(null===t)d=!0;else switch(f){case"bigint":case"string":case"number":d=!0;break;case"object":switch(t.$$typeof){case o:case i:d=!0;break;case y:return e((d=t._init)(t._payload),r,n,u,s)}}if(d)return s=s(t),d=""===u?"."+H(t,0):u,j(s)?(n="",null!=d&&(n=d.replace(k,"$&/")+"/"),e(s,r,n,"",function(e){return e})):null!=s&&(A(s)&&(a=s,c=n+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(k,"$&/")+"/")+d,s=C(a.type,c,a.props)),r.push(s)),1;d=0;var p=""===u?".":u+":";if(j(t))for(var g=0;g<t.length;g++)f=p+H(u=t[g],g),d+=e(u,r,n,f,s);else if("function"==typeof(g=null===(l=t)||"object"!=typeof l?null:"function"==typeof(l=b&&l[b]||l["@@iterator"])?l:null))for(t=g.call(t),g=0;!(u=t.next()).done;)f=p+H(u=u.value,g++),d+=e(u,r,n,f,s);else if("object"===f){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(T,T):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),r,n,u,s);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(r=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}(e,n,"","",function(e){return t.call(r,e,u++)}),n}function I(e){if(-1===e._status){var t=(0,e._result)();t.then(function(r){(0===e._status||-1===e._status)&&(e._status=1,e._result=r,void 0===t.status&&(t.status="fulfilled",t.value=r))},function(r){(0===e._status||-1===e._status)&&(e._status=2,e._result=r,void 0===t.status&&(t.status="rejected",t.reason=r))}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var M="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof n.default&&"function"==typeof n.default.emit)return void n.default.emit("uncaughtException",e);console.error(e)};function L(e){var t=w.T,r={};r.types=null!==t?t.types:null,w.T=r;try{var n=e(),o=w.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(T,M)}catch(e){M(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),w.T=t}}function N(e){var t=w.T;if(null!==t){var r=t.types;null===r?t.types=[e]:-1===r.indexOf(e)&&r.push(e)}else L(N.bind(null,e))}r.Activity=g,r.Children={map:P,forEach:function(e,t,r){P(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=x,r.Fragment=u,r.Profiler=a,r.PureComponent=O,r.StrictMode=s,r.Suspense=d,r.ViewTransition=h,r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,r.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},r.addTransitionType=N,r.cache=function(e){return function(){return e.apply(null,arguments)}},r.cacheSignal=function(){return null},r.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=m({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)R.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&("ref"!==i||void 0!==t.ref)&&(n[i]=t[i]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var u=Array(i),s=0;s<i;s++)u[s]=arguments[s+2];n.children=u}return C(e.type,o,n)},r.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:c,_context:e},e},r.createElement=function(e,t,r){var n,o={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)R.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(o[n]=t[n]);var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){for(var s=Array(u),a=0;a<u;a++)s[a]=arguments[a+2];o.children=s}if(e&&e.defaultProps)for(n in u=e.defaultProps)void 0===o[n]&&(o[n]=u[n]);return C(e,i,o)},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:f,render:e}},r.isValidElement=A,r.lazy=function(e){return{$$typeof:y,_payload:{_status:-1,_result:e},_init:I}},r.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},r.startTransition=L,r.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},r.use=function(e){return w.H.use(e)},r.useActionState=function(e,t,r){return w.H.useActionState(e,t,r)},r.useCallback=function(e,t){return w.H.useCallback(e,t)},r.useContext=function(e){return w.H.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},r.useEffect=function(e,t){return w.H.useEffect(e,t)},r.useEffectEvent=function(e){return w.H.useEffectEvent(e)},r.useId=function(){return w.H.useId()},r.useImperativeHandle=function(e,t,r){return w.H.useImperativeHandle(e,t,r)},r.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},r.useMemo=function(e,t){return w.H.useMemo(e,t)},r.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},r.useReducer=function(e,t,r){return w.H.useReducer(e,t,r)},r.useRef=function(e){return w.H.useRef(e)},r.useState=function(e){return w.H.useState(e)},r.useSyncExternalStore=function(e,t,r){return w.H.useSyncExternalStore(e,t,r)},r.useTransition=function(){return w.H.useTransition()},r.version="19.3.0-canary-3f0b9e61-20260317"},71645,(e,t,r)=>{"use strict";t.exports=e.r(50740)},55682,(e,t,r)=>{"use strict";r._=function(e){return e&&e.__esModule?e:{default:e}}},90317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class u{disable(){throw i}getStore(){}run(){throw i}exit(){throw i}enterWith(){throw i}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new u}function c(e){return s?s.bind(e):u.bind(e)}function l(){return s?s.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).createAsyncLocalStorage)()},63599,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=e.r(42344)},12354,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"handleISRError",{enumerable:!0,get:function(){return o}});let n="u"<typeof window?e.r(63599).workAsyncStorage:void 0;function o({error:e}){if(n){let t=n.getStore();if(t?.isStaticGeneration)throw e&&console.error(e),e}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18576,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={WarningIcon:function(){return a},errorStyles:function(){return u},errorThemeCss:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});e.r(55682);let i=e.r(43476);e.r(71645);let u={container:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},card:{marginTop:"-32px",maxWidth:"325px",padding:"32px 28px",textAlign:"left"},icon:{marginBottom:"24px"},title:{fontSize:"24px",fontWeight:500,letterSpacing:"-0.02em",lineHeight:"32px",margin:"0 0 12px 0",color:"var(--next-error-title)"},message:{fontSize:"14px",fontWeight:400,lineHeight:"21px",margin:"0 0 20px 0",color:"var(--next-error-message)"},form:{margin:0},buttonGroup:{display:"flex",gap:"8px",alignItems:"center"},button:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:"32px",padding:"0 12px",fontSize:"14px",fontWeight:500,lineHeight:"20px",borderRadius:"6px",cursor:"pointer",color:"var(--next-error-btn-text)",background:"var(--next-error-btn-bg)",border:"var(--next-error-btn-border)"},buttonSecondary:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:"32px",padding:"0 12px",fontSize:"14px",fontWeight:500,lineHeight:"20px",borderRadius:"6px",cursor:"pointer",color:"var(--next-error-btn-secondary-text)",background:"var(--next-error-btn-secondary-bg)",border:"var(--next-error-btn-secondary-border)"},digestFooter:{position:"fixed",bottom:"32px",left:"0",right:"0",textAlign:"center",fontFamily:'ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace',fontSize:"12px",lineHeight:"18px",fontWeight:400,margin:"0",color:"var(--next-error-digest)"}},s=`
|
|
2
|
-
:root {
|
|
3
|
-
--next-error-bg: #fff;
|
|
4
|
-
--next-error-text: #171717;
|
|
5
|
-
--next-error-title: #171717;
|
|
6
|
-
--next-error-message: #171717;
|
|
7
|
-
--next-error-digest: #666666;
|
|
8
|
-
--next-error-btn-text: #fff;
|
|
9
|
-
--next-error-btn-bg: #171717;
|
|
10
|
-
--next-error-btn-border: none;
|
|
11
|
-
--next-error-btn-secondary-text: #171717;
|
|
12
|
-
--next-error-btn-secondary-bg: transparent;
|
|
13
|
-
--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);
|
|
14
|
-
}
|
|
15
|
-
@media (prefers-color-scheme: dark) {
|
|
16
|
-
:root {
|
|
17
|
-
--next-error-bg: #0a0a0a;
|
|
18
|
-
--next-error-text: #ededed;
|
|
19
|
-
--next-error-title: #ededed;
|
|
20
|
-
--next-error-message: #ededed;
|
|
21
|
-
--next-error-digest: #a0a0a0;
|
|
22
|
-
--next-error-btn-text: #0a0a0a;
|
|
23
|
-
--next-error-btn-bg: #ededed;
|
|
24
|
-
--next-error-btn-border: none;
|
|
25
|
-
--next-error-btn-secondary-text: #ededed;
|
|
26
|
-
--next-error-btn-secondary-bg: transparent;
|
|
27
|
-
--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }
|
|
31
|
-
`.replace(/\n\s*/g,"");function a(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"-0.2 -1.5 32 32",fill:"none",style:u.icon,children:(0,i.jsx)("path",{d:"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z",fill:"var(--next-error-title)"})})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},68027,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return u}}),e.r(55682);let n=e.r(43476);e.r(71645);let o=e.r(12354),i=e.r(18576),u=function({error:e}){let t=e?.digest,r=!!t;return(0,o.handleISRError)({error:e}),(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{children:(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:i.errorThemeCss}})}),(0,n.jsxs)("body",{children:[(0,n.jsx)("div",{style:i.errorStyles.container,children:(0,n.jsxs)("div",{style:i.errorStyles.card,children:[(0,n.jsx)(i.WarningIcon,{}),(0,n.jsx)("h1",{style:i.errorStyles.title,children:"This page couldn’t load"}),(0,n.jsx)("p",{style:i.errorStyles.message,children:r?"A server error occurred. Reload to try again.":"Reload to try again, or go back."}),(0,n.jsxs)("div",{style:i.errorStyles.buttonGroup,children:[(0,n.jsx)("form",{style:i.errorStyles.form,children:(0,n.jsx)("button",{type:"submit",style:i.errorStyles.button,children:"Reload"})}),!r&&(0,n.jsx)("button",{type:"button",style:i.errorStyles.buttonSecondary,onClick:()=>{window.history.length>1?window.history.back():window.location.href="/"},children:"Back"})]})]})}),t&&(0,n.jsxs)("p",{style:i.errorStyles.digestFooter,children:["ERROR ",t]})]})]})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);
|