@velastack/patterns 0.0.57 → 0.0.59
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/README.md +0 -12
- package/dist/chunks/{_server-Cv3bTkG0.js → _server-Cie287JZ.js} +1 -1
- package/dist/chunks/_server-Cie287JZ.js.map +1 -0
- package/dist/chunks/{collections-BwO27pJg.js → collections-DZOoJLVj.js} +5 -5
- package/dist/chunks/{collections-BwO27pJg.js.map → collections-DZOoJLVj.js.map} +1 -1
- package/dist/chunks/config-target-Co-ij8p3.js +163 -0
- package/dist/chunks/config-target-Co-ij8p3.js.map +1 -0
- package/dist/chunks/{constants-BMZmCRiI.js → constants-qmioN-7W.js} +1 -1
- package/dist/chunks/{constants-BMZmCRiI.js.map → constants-qmioN-7W.js.map} +1 -1
- package/dist/chunks/{dedent-C4qKBQXh.js → dedent-Gq6Krl4n.js} +1 -1
- package/dist/chunks/{dedent-C4qKBQXh.js.map → dedent-Gq6Krl4n.js.map} +1 -1
- package/dist/chunks/{env-Bk-LRVos.js → env-BPfk1VAw.js} +1 -1
- package/dist/chunks/{env-Bk-LRVos.js.map → env-BPfk1VAw.js.map} +1 -1
- package/dist/chunks/{env.preview-DoY1CJwL.js → env.preview-uMRKT5Pc.js} +1 -1
- package/dist/chunks/{env.preview-DoY1CJwL.js.map → env.preview-uMRKT5Pc.js.map} +1 -1
- package/dist/chunks/{env.runtime-D46GCIKe.js → env.runtime-BVage9Kk.js} +1 -1
- package/dist/chunks/{env.runtime-D46GCIKe.js.map → env.runtime-BVage9Kk.js.map} +1 -1
- package/dist/chunks/{errors-Co77I4oK.js → errors-D3Zy3wCg.js} +1 -1
- package/dist/chunks/{errors-Co77I4oK.js.map → errors-D3Zy3wCg.js.map} +1 -1
- package/dist/chunks/{generate2.runtime-yP14iPwX.js → generate.runtime-6TJoTPg9.js} +21 -15
- package/dist/chunks/generate.runtime-6TJoTPg9.js.map +1 -0
- package/dist/chunks/{generate.runtime-BnkNmF1g.js → generate.runtime-6qpoLA04.js} +10 -8
- package/dist/chunks/{generate.runtime-BnkNmF1g.js.map → generate.runtime-6qpoLA04.js.map} +1 -1
- package/dist/chunks/generate.runtime-AmiNbSR3.js +172 -0
- package/dist/chunks/generate.runtime-AmiNbSR3.js.map +1 -0
- package/dist/chunks/{generate.runtime-DjwRKg8K.js → generate.runtime-BT_bwAtt.js} +124 -198
- package/dist/chunks/generate.runtime-BT_bwAtt.js.map +1 -0
- package/dist/chunks/{generate.runtime-Cb2vYF1l.js → generate.runtime-BnnsaLsg.js} +5 -5
- package/dist/chunks/{generate.runtime-Cb2vYF1l.js.map → generate.runtime-BnnsaLsg.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D6oE0Mmf.js → generate.runtime-CGtKTfYU.js} +6 -6
- package/dist/chunks/{generate.runtime-D6oE0Mmf.js.map → generate.runtime-CGtKTfYU.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BkvtIjgh.js → generate.runtime-CINxHRnJ.js} +5 -5
- package/dist/chunks/{generate.runtime-BkvtIjgh.js.map → generate.runtime-CINxHRnJ.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DnymXcvu.js → generate.runtime-CNxgU9v1.js} +6 -6
- package/dist/chunks/{generate.runtime-DnymXcvu.js.map → generate.runtime-CNxgU9v1.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Bpx69a8t.js → generate.runtime-CRS9C9xX.js} +18 -16
- package/dist/chunks/{generate.runtime-Bpx69a8t.js.map → generate.runtime-CRS9C9xX.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Bbf2YWaA.js → generate.runtime-CYmjlSQp.js} +3 -3
- package/dist/chunks/{generate.runtime-Bbf2YWaA.js.map → generate.runtime-CYmjlSQp.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D1uQBjeg.js → generate.runtime-CtS6qa_1.js} +76 -76
- package/dist/chunks/{generate.runtime-D1uQBjeg.js.map → generate.runtime-CtS6qa_1.js.map} +1 -1
- package/dist/chunks/{generate.runtime-Cudp67b-.js → generate.runtime-CtzHFod-.js} +8 -8
- package/dist/chunks/{generate.runtime-Cudp67b-.js.map → generate.runtime-CtzHFod-.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D1wqmaXU.js → generate.runtime-D9t6eaQd.js} +5 -5
- package/dist/chunks/{generate.runtime-D1wqmaXU.js.map → generate.runtime-D9t6eaQd.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D8RXOVVA.js → generate.runtime-DBG6kEKb.js} +6 -6
- package/dist/chunks/{generate.runtime-D8RXOVVA.js.map → generate.runtime-DBG6kEKb.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DFG2C9gc.js → generate.runtime-DfqzMG8Z.js} +6 -6
- package/dist/chunks/generate.runtime-DfqzMG8Z.js.map +1 -0
- package/dist/chunks/{generate.runtime-CUgleG0U.js → generate.runtime-Di0p-J8l.js} +4 -4
- package/dist/chunks/{generate.runtime-CUgleG0U.js.map → generate.runtime-Di0p-J8l.js.map} +1 -1
- package/dist/chunks/{generate.runtime-CrAHzaEW.js → generate.runtime-DsLlDfIo.js} +8 -8
- package/dist/chunks/{generate.runtime-CrAHzaEW.js.map → generate.runtime-DsLlDfIo.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DFDFxHih.js → generate.runtime-EokncTLy.js} +6 -6
- package/dist/chunks/{generate.runtime-DFDFxHih.js.map → generate.runtime-EokncTLy.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D_JOcL6A.js → generate.runtime-P8IVwJLB.js} +23 -17
- package/dist/chunks/{generate.runtime-D_JOcL6A.js.map → generate.runtime-P8IVwJLB.js.map} +1 -1
- package/dist/chunks/{generate.runtime-CZALdXt6.js → generate.runtime-a5PXS1Kd.js} +3 -3
- package/dist/chunks/{generate.runtime-CZALdXt6.js.map → generate.runtime-a5PXS1Kd.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DPzrDUU7.js → generate.runtime-qZhYdFI1.js} +9 -9
- package/dist/chunks/{generate.runtime-DPzrDUU7.js.map → generate.runtime-qZhYdFI1.js.map} +1 -1
- package/dist/chunks/{logger-BpgCb-ZG.js → logger-CQONztPm.js} +1 -1
- package/dist/chunks/{logger-BpgCb-ZG.js.map → logger-CQONztPm.js.map} +1 -1
- package/dist/chunks/{modify-file-DE7tPADZ.js → modify-file-PVKmDJHk.js} +2 -2
- package/dist/chunks/{modify-file-DE7tPADZ.js.map → modify-file-PVKmDJHk.js.map} +1 -1
- package/dist/chunks/modify-svelte-config-remote-CDKs_Qi0.js +44 -0
- package/dist/chunks/modify-svelte-config-remote-CDKs_Qi0.js.map +1 -0
- package/dist/chunks/{modify-utils-CZ9Auvp9.js → modify-utils-Cw-on_cL.js} +13 -13
- package/dist/chunks/{modify-utils-CZ9Auvp9.js.map → modify-utils-Cw-on_cL.js.map} +1 -1
- package/dist/chunks/{nav-user-_VheJA6n.js → nav-user-CndUO69x.js} +1 -1
- package/dist/chunks/nav-user-CndUO69x.js.map +1 -0
- package/dist/chunks/{pocketbase-D7GjPuNu.js → pocketbase-BbFvZ4HI.js} +2 -2
- package/dist/chunks/{pocketbase-D7GjPuNu.js.map → pocketbase-BbFvZ4HI.js.map} +1 -1
- package/dist/chunks/{pocketbase-Bj-cW2Zl.js → pocketbase-C5GS-Dh5.js} +1 -1
- package/dist/chunks/{pocketbase-Bj-cW2Zl.js.map → pocketbase-C5GS-Dh5.js.map} +1 -1
- package/dist/chunks/{pocketbase-Dm2SF3vM.js → pocketbase-DpudAAmd.js} +1 -1
- package/dist/chunks/{pocketbase-Dm2SF3vM.js.map → pocketbase-DpudAAmd.js.map} +1 -1
- package/dist/chunks/{shared-C4wJ9sb0.js → shared-C4-NNykV.js} +3 -3
- package/dist/chunks/{shared-C4wJ9sb0.js.map → shared-C4-NNykV.js.map} +1 -1
- package/dist/chunks/{taggedTemplateLiteral-Bfbldyfk.js → taggedTemplateLiteral-CPUMuLtk.js} +1 -1
- package/dist/chunks/{test-setup-C3gvjtTY.js → test-setup-CcD8wSRD.js} +87 -65
- package/dist/chunks/test-setup-CcD8wSRD.js.map +1 -0
- package/dist/chunks/{ts-morph-helpers-bR0-x04t.js → ts-morph-helpers-Bk82Z2n7.js} +3 -3
- package/dist/chunks/{ts-morph-helpers-bR0-x04t.js.map → ts-morph-helpers-Bk82Z2n7.js.map} +1 -1
- package/dist/chunks/{util-BNtpm1tP.js → util-Bk7aQQJR.js} +1 -1
- package/dist/chunks/{util-BNtpm1tP.js.map → util-Bk7aQQJR.js.map} +1 -1
- package/dist/chunks/{write-result-CLSL_F-E.js → write-result-DtTqt0Cs.js} +6 -6
- package/dist/chunks/write-result-DtTqt0Cs.js.map +1 -0
- package/dist/index.js +406 -360
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/chunks/_server-Cv3bTkG0.js.map +0 -1
- package/dist/chunks/generate.runtime-DFG2C9gc.js.map +0 -1
- package/dist/chunks/generate.runtime-DjwRKg8K.js.map +0 -1
- package/dist/chunks/generate.runtime-M6LNL7Tq.js +0 -197
- package/dist/chunks/generate.runtime-M6LNL7Tq.js.map +0 -1
- package/dist/chunks/generate2.runtime-yP14iPwX.js.map +0 -1
- package/dist/chunks/modify-svelte-config-remote-C3g7Oi6_.js +0 -128
- package/dist/chunks/modify-svelte-config-remote-C3g7Oi6_.js.map +0 -1
- package/dist/chunks/nav-user-_VheJA6n.js.map +0 -1
- package/dist/chunks/test-setup-C3gvjtTY.js.map +0 -1
- package/dist/chunks/write-result-CLSL_F-E.js.map +0 -1
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import e from "node:fs";
|
|
2
|
-
import t from "node:path";
|
|
3
|
-
import { Project as n, QuoteKind as r, SyntaxKind as i } from "ts-morph";
|
|
4
|
-
//#region src/runtime/modify-svelte-config-remote.ts
|
|
5
|
-
var a = [
|
|
6
|
-
"Enable SvelteKit remote functions and Svelte async in your Svelte config:",
|
|
7
|
-
"",
|
|
8
|
-
"kit: {",
|
|
9
|
-
" experimental: {",
|
|
10
|
-
" remoteFunctions: true,",
|
|
11
|
-
" },",
|
|
12
|
-
"},",
|
|
13
|
-
"compilerOptions: {",
|
|
14
|
-
" experimental: {",
|
|
15
|
-
" async: true,",
|
|
16
|
-
" },",
|
|
17
|
-
"},"
|
|
18
|
-
].join("\n"), o = [
|
|
19
|
-
"Create a Svelte config with remote functions and async enabled:",
|
|
20
|
-
"",
|
|
21
|
-
"/** @type {import('@sveltejs/kit').Config} */",
|
|
22
|
-
"const config = {",
|
|
23
|
-
" kit: {",
|
|
24
|
-
" experimental: {",
|
|
25
|
-
" remoteFunctions: true,",
|
|
26
|
-
" },",
|
|
27
|
-
" },",
|
|
28
|
-
" compilerOptions: {",
|
|
29
|
-
" experimental: {",
|
|
30
|
-
" async: true,",
|
|
31
|
-
" },",
|
|
32
|
-
" },",
|
|
33
|
-
"};",
|
|
34
|
-
"",
|
|
35
|
-
"export default config;"
|
|
36
|
-
].join("\n");
|
|
37
|
-
function s(e, t, n) {
|
|
38
|
-
let r = e.getProperty(t);
|
|
39
|
-
if (!r) {
|
|
40
|
-
e.addPropertyAssignment({
|
|
41
|
-
name: t,
|
|
42
|
-
initializer: n
|
|
43
|
-
});
|
|
44
|
-
let r = e.getProperty(t);
|
|
45
|
-
if (!r || r.getKind() !== i.PropertyAssignment) return null;
|
|
46
|
-
let a = r.getInitializer();
|
|
47
|
-
return !a || a.getKind() !== i.ObjectLiteralExpression ? null : a;
|
|
48
|
-
}
|
|
49
|
-
if (r.getKind() !== i.PropertyAssignment) return null;
|
|
50
|
-
let a = r.getInitializer();
|
|
51
|
-
if (!a) return null;
|
|
52
|
-
if (a.getKind() !== i.ObjectLiteralExpression) {
|
|
53
|
-
r.setInitializer(n);
|
|
54
|
-
let e = r.getInitializer();
|
|
55
|
-
return e && e.getKind() === i.ObjectLiteralExpression ? e : null;
|
|
56
|
-
}
|
|
57
|
-
return a;
|
|
58
|
-
}
|
|
59
|
-
function c(e, t) {
|
|
60
|
-
let n = e.getProperty(t);
|
|
61
|
-
return n ? n.getKind() !== i.PropertyAssignment || n.getInitializer()?.getText() === "true" ? !1 : (n.setInitializer("true"), !0) : (e.addPropertyAssignment({
|
|
62
|
-
name: t,
|
|
63
|
-
initializer: "true"
|
|
64
|
-
}), !0);
|
|
65
|
-
}
|
|
66
|
-
function l(t) {
|
|
67
|
-
if (!e.existsSync(t)) return {
|
|
68
|
-
status: "not-found",
|
|
69
|
-
message: o
|
|
70
|
-
};
|
|
71
|
-
let l = new n({
|
|
72
|
-
compilerOptions: { allowJs: !0 },
|
|
73
|
-
manipulationSettings: { quoteKind: r.Single }
|
|
74
|
-
}).addSourceFileAtPath(t), u = l.getFullText(), d = l.getExportAssignment((e) => !e.isExportEquals())?.getExpression(), f = null;
|
|
75
|
-
if (d?.getKind() === i.ObjectLiteralExpression) f = d;
|
|
76
|
-
else if (d?.getKind() === i.Identifier) {
|
|
77
|
-
let e = d.getText(), t = l.getVariableDeclaration(e)?.getInitializer();
|
|
78
|
-
t?.getKind() === i.ObjectLiteralExpression && (f = t);
|
|
79
|
-
}
|
|
80
|
-
if (!f) return {
|
|
81
|
-
status: "failed",
|
|
82
|
-
message: a
|
|
83
|
-
};
|
|
84
|
-
let p = !1, m = s(f, "kit", "{}");
|
|
85
|
-
if (!m) return {
|
|
86
|
-
status: "failed",
|
|
87
|
-
message: a
|
|
88
|
-
};
|
|
89
|
-
let h = s(m, "experimental", "{}");
|
|
90
|
-
if (!h) return {
|
|
91
|
-
status: "failed",
|
|
92
|
-
message: a
|
|
93
|
-
};
|
|
94
|
-
c(h, "remoteFunctions") && (p = !0);
|
|
95
|
-
let g = s(f, "compilerOptions", "{}");
|
|
96
|
-
if (!g) return {
|
|
97
|
-
status: "failed",
|
|
98
|
-
message: a
|
|
99
|
-
};
|
|
100
|
-
let _ = s(g, "experimental", "{}");
|
|
101
|
-
return _ ? (c(_, "async") && (p = !0), !p || (l.formatText(), l.getFullText() === u) ? {
|
|
102
|
-
status: "success",
|
|
103
|
-
changed: !1
|
|
104
|
-
} : (l.saveSync(), {
|
|
105
|
-
status: "success",
|
|
106
|
-
changed: !0
|
|
107
|
-
})) : {
|
|
108
|
-
status: "failed",
|
|
109
|
-
message: a
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function u(n) {
|
|
113
|
-
let r = [
|
|
114
|
-
"svelte.config.ts",
|
|
115
|
-
"svelte.config.js",
|
|
116
|
-
"svelte.config.mjs",
|
|
117
|
-
"svelte.config.cjs"
|
|
118
|
-
];
|
|
119
|
-
for (let i of r) {
|
|
120
|
-
let r = t.join(n, i);
|
|
121
|
-
if (e.existsSync(r)) return r;
|
|
122
|
-
}
|
|
123
|
-
return t.join(n, r[1]);
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
export { u as findSvelteConfigPath, l as modifySvelteConfigRemote };
|
|
127
|
-
|
|
128
|
-
//# sourceMappingURL=modify-svelte-config-remote-C3g7Oi6_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modify-svelte-config-remote-C3g7Oi6_.js","names":[],"sources":["../../src/runtime/modify-svelte-config-remote.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport {\n Project,\n QuoteKind,\n SyntaxKind,\n type ObjectLiteralExpression,\n} from \"ts-morph\";\nimport type { ModifyOutcome } from \"../core/types\";\n\nconst FAILURE_HINT = [\n \"Enable SvelteKit remote functions and Svelte async in your Svelte config:\",\n \"\",\n \"kit: {\",\n \" experimental: {\",\n \" remoteFunctions: true,\",\n \" },\",\n \"},\",\n \"compilerOptions: {\",\n \" experimental: {\",\n \" async: true,\",\n \" },\",\n \"},\",\n].join(\"\\n\");\n\nconst NOT_FOUND_HINT = [\n \"Create a Svelte config with remote functions and async enabled:\",\n \"\",\n \"/** @type {import('@sveltejs/kit').Config} */\",\n \"const config = {\",\n \" kit: {\",\n \" experimental: {\",\n \" remoteFunctions: true,\",\n \" },\",\n \" },\",\n \" compilerOptions: {\",\n \" experimental: {\",\n \" async: true,\",\n \" },\",\n \" },\",\n \"};\",\n \"\",\n \"export default config;\",\n].join(\"\\n\");\n\nfunction getOrCreateObjectLiteralProperty(\n obj: ObjectLiteralExpression,\n name: string,\n initializer: string,\n): ObjectLiteralExpression | null {\n const prop = obj.getProperty(name);\n if (!prop) {\n obj.addPropertyAssignment({ name, initializer });\n const added = obj.getProperty(name);\n if (!added || added.getKind() !== SyntaxKind.PropertyAssignment)\n return null;\n const init = (\n added as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (!init || init.getKind() !== SyntaxKind.ObjectLiteralExpression)\n return null;\n return init as ObjectLiteralExpression;\n }\n\n if (prop.getKind() !== SyntaxKind.PropertyAssignment) return null;\n const init = (prop as import(\"ts-morph\").PropertyAssignment).getInitializer();\n if (!init) return null;\n if (init.getKind() !== SyntaxKind.ObjectLiteralExpression) {\n (prop as import(\"ts-morph\").PropertyAssignment).setInitializer(initializer);\n const init2 = (\n prop as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n return init2 && init2.getKind() === SyntaxKind.ObjectLiteralExpression\n ? (init2 as ObjectLiteralExpression)\n : null;\n }\n\n return init as ObjectLiteralExpression;\n}\n\nfunction ensureBooleanTrue(\n obj: ObjectLiteralExpression,\n name: string,\n): boolean {\n const existing = obj.getProperty(name);\n if (!existing) {\n obj.addPropertyAssignment({ name, initializer: \"true\" });\n return true;\n }\n if (existing.getKind() !== SyntaxKind.PropertyAssignment) return false;\n const init = (\n existing as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (init?.getText() === \"true\") return false;\n (existing as import(\"ts-morph\").PropertyAssignment).setInitializer(\"true\");\n return true;\n}\n\nexport function modifySvelteConfigRemote(\n svelteConfigPath: string,\n): ModifyOutcome {\n if (!fs.existsSync(svelteConfigPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(svelteConfigPath);\n const originalText = sourceFile.getFullText();\n\n const defaultExport = sourceFile.getExportAssignment(\n (ea) => !ea.isExportEquals(),\n );\n const exportedExpr = defaultExport?.getExpression();\n\n let configObj: ObjectLiteralExpression | null = null;\n if (exportedExpr?.getKind() === SyntaxKind.ObjectLiteralExpression) {\n configObj = exportedExpr as ObjectLiteralExpression;\n } else if (exportedExpr?.getKind() === SyntaxKind.Identifier) {\n const ident = exportedExpr.getText();\n const varDecl = sourceFile.getVariableDeclaration(ident);\n const init = varDecl?.getInitializer();\n if (init?.getKind() === SyntaxKind.ObjectLiteralExpression) {\n configObj = init as ObjectLiteralExpression;\n }\n }\n\n if (!configObj) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n let changed = false;\n\n const kitObj = getOrCreateObjectLiteralProperty(configObj, \"kit\", \"{}\");\n if (!kitObj) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n const kitExperimental = getOrCreateObjectLiteralProperty(\n kitObj,\n \"experimental\",\n \"{}\",\n );\n if (!kitExperimental) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n if (ensureBooleanTrue(kitExperimental, \"remoteFunctions\")) changed = true;\n\n const compilerObj = getOrCreateObjectLiteralProperty(\n configObj,\n \"compilerOptions\",\n \"{}\",\n );\n if (!compilerObj) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n const compilerExperimental = getOrCreateObjectLiteralProperty(\n compilerObj,\n \"experimental\",\n \"{}\",\n );\n if (!compilerExperimental) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n if (ensureBooleanTrue(compilerExperimental, \"async\")) changed = true;\n\n if (!changed) {\n return { status: \"success\", changed: false };\n }\n\n sourceFile.formatText();\n const newText = sourceFile.getFullText();\n if (newText === originalText) {\n return { status: \"success\", changed: false };\n }\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n}\n\nexport function findSvelteConfigPath(root: string): string {\n const candidates = [\n \"svelte.config.ts\",\n \"svelte.config.js\",\n \"svelte.config.mjs\",\n \"svelte.config.cjs\",\n ];\n for (const relPath of candidates) {\n const absPath = path.join(root, relPath);\n if (fs.existsSync(absPath)) {\n return absPath;\n }\n }\n return path.join(root, candidates[1]);\n}\n"],"mappings":";;;;AAUA,IAAM,IAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,KAAK,KAAK,EAEN,IAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,KAAK,KAAK;AAEZ,SAAS,EACP,GACA,GACA,GACgC;CAChC,IAAM,IAAO,EAAI,YAAY,EAAK;AAClC,KAAI,CAAC,GAAM;AACT,IAAI,sBAAsB;GAAE;GAAM;GAAa,CAAC;EAChD,IAAM,IAAQ,EAAI,YAAY,EAAK;AACnC,MAAI,CAAC,KAAS,EAAM,SAAS,KAAK,EAAW,mBAC3C,QAAO;EACT,IAAM,IACJ,EACA,gBAAgB;AAGlB,SAFI,CAAC,KAAQ,EAAK,SAAS,KAAK,EAAW,0BAClC,OACF;;AAGT,KAAI,EAAK,SAAS,KAAK,EAAW,mBAAoB,QAAO;CAC7D,IAAM,IAAQ,EAA+C,gBAAgB;AAC7E,KAAI,CAAC,EAAM,QAAO;AAClB,KAAI,EAAK,SAAS,KAAK,EAAW,yBAAyB;AACxD,IAA+C,eAAe,EAAY;EAC3E,IAAM,IACJ,EACA,gBAAgB;AAClB,SAAO,KAAS,EAAM,SAAS,KAAK,EAAW,0BAC1C,IACD;;AAGN,QAAO;;AAGT,SAAS,EACP,GACA,GACS;CACT,IAAM,IAAW,EAAI,YAAY,EAAK;AAWtC,QAVK,IAID,EAAS,SAAS,KAAK,EAAW,sBAEpC,EACA,gBAAgB,EACR,SAAS,KAAK,SAAe,MACtC,EAAmD,eAAe,OAAO,EACnE,OATL,EAAI,sBAAsB;EAAE;EAAM,aAAa;EAAQ,CAAC,EACjD;;AAWX,SAAgB,EACd,GACe;AACf,KAAI,CAAC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EAAc;;AAiBtD,SAAgB,EAAqB,GAAsB;CACzD,IAAM,IAAa;EACjB;EACA;EACA;EACA;EACD;AACD,MAAK,IAAM,KAAW,GAAY;EAChC,IAAM,IAAU,EAAK,KAAK,GAAM,EAAQ;AACxC,MAAI,EAAG,WAAW,EAAQ,CACxB,QAAO;;AAGX,QAAO,EAAK,KAAK,GAAM,EAAW,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-user-_VheJA6n.js","names":[],"sources":["../../src/patterns/enable/payments/creates-app-mode/src/routes/(app)/billing/+page.server.ts?raw","../../src/patterns/enable/payments/creates-app-mode/src/routes/(app)/billing/+page.svelte?raw","../../src/patterns/enable/payments/preview-modifies/src/lib/components/nav-user.svelte?raw"],"sourcesContent":["export default \"import { error } from \\\"@sveltejs/kit\\\";\\nimport stripe from \\\"$lib/stripe\\\";\\n\\nexport const load = async ({ locals, depends, parent }) => {\\n const { user } = await parent();\\n const customer = await locals.admin\\n .collection(\\\"stripe_customers\\\")\\n .getFirstListItem(locals.admin.filter(\\\"user = {:user}\\\", { user: user.id }));\\n\\n if (!customer || !customer.id) {\\n return error(400, \\\"Customer not found\\\");\\n }\\n\\n const stripeCustomer = await stripe.customers.retrieve(customer.id);\\n if (stripeCustomer.deleted) {\\n return error(400, \\\"Customer not found\\\");\\n }\\n\\n const paymentMethods = await stripe.customers.listPaymentMethods(\\n customer.id,\\n {\\n type: \\\"card\\\",\\n allow_redisplay: \\\"always\\\",\\n },\\n );\\n\\n depends(\\\"app:billing\\\");\\n\\n return {\\n paymentMethods: paymentMethods.data.map((pm) => ({\\n id: pm.id,\\n brand: pm.card!.brand,\\n last4: pm.card!.last4,\\n expMonth: pm.card!.exp_month,\\n expYear: pm.card!.exp_year,\\n isDefault: pm.id === customer.default_payment_method,\\n })),\\n user,\\n };\\n};\\n\\nexport const actions = {\\n setDefaultPaymentMethod: async ({ locals, request }) => {\\n const formData = await request.formData();\\n const paymentMethodId = formData.get(\\\"paymentMethodId\\\") as string;\\n\\n const customer = await locals.admin\\n .collection(\\\"stripe_customers\\\")\\n .getFirstListItem(`user.id = \\\"${locals.pb.authStore.record?.id}\\\"`);\\n\\n if (!customer || !customer.id) {\\n return error(400, \\\"Customer not found\\\");\\n }\\n\\n await stripe.customers.update(customer.id, {\\n invoice_settings: {\\n default_payment_method: paymentMethodId,\\n },\\n });\\n\\n await locals.admin.collection(\\\"stripe_customers\\\").update(customer.id, {\\n default_payment_method: paymentMethodId,\\n });\\n },\\n deletePaymentMethod: async ({ locals, request }) => {\\n const formData = await request.formData();\\n const paymentMethodId = formData.get(\\\"paymentMethodId\\\") as string;\\n\\n const customer = await locals.admin\\n .collection(\\\"stripe_customers\\\")\\n .getFirstListItem(`user.id = \\\"${locals.pb.authStore.record?.id}\\\"`);\\n\\n const defaultPaymentMethod = customer.default_payment_method;\\n\\n await stripe.paymentMethods.detach(paymentMethodId);\\n\\n // If default payment method was deleted, update default payment method\\n if (defaultPaymentMethod === paymentMethodId) {\\n const paymentMethods = await stripe.paymentMethods.list({\\n customer: customer.id,\\n });\\n\\n if (paymentMethods.data.length > 0) {\\n const defaultPaymentMethod = paymentMethods.data[0];\\n\\n await stripe.customers.update(customer.id, {\\n invoice_settings: {\\n default_payment_method: defaultPaymentMethod.id,\\n },\\n });\\n\\n await locals.admin.collection(\\\"stripe_customers\\\").update(customer.id, {\\n default_payment_method: defaultPaymentMethod.id,\\n });\\n } else {\\n await locals.admin.collection(\\\"stripe_customers\\\").update(customer.id, {\\n default_payment_method: null,\\n });\\n }\\n }\\n },\\n};\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport * as Card from '$lib/components/ui/card';\\n\\timport { Badge } from '$lib/components/ui/badge';\\n\\timport * as AlertDialog from '$lib/components/ui/alert-dialog';\\n\\timport SetupButton from '$lib/components/payments/setup-button.svelte';\\n\\timport { CreditCard, Trash2, Check } from '@lucide/svelte';\\n\\timport { toast } from 'svelte-sonner';\\n\\timport { invalidate } from '$app/navigation';\\n\\n\\tlet { data } = $props();\\n\\tlet paymentMethods = $derived(data.paymentMethods);\\n\\tlet showDeleteDialog = $state(false);\\n\\tlet selectedPaymentMethodId = $state<string | null>(null);\\n\\tlet isProcessing = $state(false);\\n\\n\\tfunction openDeleteDialog(paymentMethodId: string) {\\n\\t\\tselectedPaymentMethodId = paymentMethodId;\\n\\t\\tshowDeleteDialog = true;\\n\\t}\\n\\n\\tfunction closeDeleteDialog() {\\n\\t\\tshowDeleteDialog = false;\\n\\t\\tselectedPaymentMethodId = null;\\n\\t}\\n\\n\\tasync function handleDeletePaymentMethod() {\\n\\t\\tif (!selectedPaymentMethodId) return;\\n\\t\\tisProcessing = true;\\n\\n\\t\\ttry {\\n\\t\\t\\tconst formData = new FormData();\\n\\t\\t\\tformData.append('paymentMethodId', selectedPaymentMethodId);\\n\\n\\t\\t\\tawait fetch('?/deletePaymentMethod', {\\n\\t\\t\\t\\tmethod: 'POST',\\n\\t\\t\\t\\tbody: formData\\n\\t\\t\\t});\\n\\n\\t\\t\\tawait invalidate('app:billing');\\n\\t\\t\\ttoast.success('Payment method removed successfully');\\n\\t\\t\\tcloseDeleteDialog();\\n\\t\\t} catch (err) {\\n\\t\\t\\tconsole.error('Error deleting payment method:', err);\\n\\t\\t\\ttoast.error('Failed to remove payment method');\\n\\t\\t} finally {\\n\\t\\t\\tisProcessing = false;\\n\\t\\t}\\n\\t}\\n\\n\\tasync function setDefaultPaymentMethod(paymentMethodId: string) {\\n\\t\\ttry {\\n\\t\\t\\tconst formData = new FormData();\\n\\t\\t\\tformData.append('paymentMethodId', paymentMethodId);\\n\\n\\t\\t\\tawait fetch('?/setDefaultPaymentMethod', {\\n\\t\\t\\t\\tmethod: 'POST',\\n\\t\\t\\t\\tbody: formData\\n\\t\\t\\t});\\n\\n\\t\\t\\tawait invalidate('app:billing');\\n\\t\\t\\ttoast.success('Default payment method updated');\\n\\t\\t} catch (err) {\\n\\t\\t\\tconsole.error('Error setting default payment method:', err);\\n\\t\\t\\ttoast.error('Failed to update default payment method');\\n\\t\\t}\\n\\t}\\n\\n\\tfunction getCardBrandIcon(brand: string) {\\n\\t\\t// You can customize these icons or use actual card brand icons\\n\\t\\tconst brands: Record<string, string> = {\\n\\t\\t\\tvisa: '💳',\\n\\t\\t\\tmastercard: '💳',\\n\\t\\t\\tamex: '💳',\\n\\t\\t\\tdiscover: '💳',\\n\\t\\t\\tunknown: '💳'\\n\\t\\t};\\n\\t\\treturn brands[brand.toLowerCase()] || brands.unknown;\\n\\t}\\n\\n\\tfunction formatCardBrand(brand: string) {\\n\\t\\treturn brand.charAt(0).toUpperCase() + brand.slice(1);\\n\\t}\\n</script>\\n\\n<div class=\\\"divide-y divide-gray-900/10 dark:divide-white/10\\\">\\n\\t<div class=\\\"grid grid-cols-1 gap-x-8 gap-y-8 py-10 md:grid-cols-3\\\">\\n\\t\\t<div class=\\\"px-4 sm:px-0\\\">\\n\\t\\t\\t<h2 class=\\\"text-base/7 font-semibold text-gray-900 dark:text-white\\\">Payment Methods</h2>\\n\\t\\t\\t<p class=\\\"mt-1 text-sm/6 text-gray-600 dark:text-gray-400\\\">\\n\\t\\t\\t\\tManage your payment methods for subscriptions and purchases.\\n\\t\\t\\t</p>\\n\\t\\t</div>\\n\\n\\t\\t<div class=\\\"md:col-span-2\\\">\\n\\t\\t\\t<Card.Root>\\n\\t\\t\\t\\t<Card.Content>\\n\\t\\t\\t\\t\\t{#if paymentMethods.length === 0}\\n\\t\\t\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\t\\t\\tclass=\\\"text-muted-foreground flex flex-col items-center justify-center py-12 text-center\\\"\\n\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t<CreditCard class=\\\"mb-4 size-12 opacity-50\\\" />\\n\\t\\t\\t\\t\\t\\t\\t<p class=\\\"mb-2 text-lg font-medium\\\">No payment methods</p>\\n\\t\\t\\t\\t\\t\\t\\t<p class=\\\"text-sm\\\">Add a payment method to get started</p>\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t{:else}\\n\\t\\t\\t\\t\\t\\t<div class=\\\"space-y-4\\\">\\n\\t\\t\\t\\t\\t\\t\\t{#each paymentMethods as method (method.id)}\\n\\t\\t\\t\\t\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclass=\\\"border-border hover:bg-accent/50 flex items-center justify-between rounded-lg border p-4 transition-colors\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<div class=\\\"flex items-center gap-4\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tclass=\\\"bg-muted flex size-12 items-center justify-center rounded-lg text-2xl\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{getCardBrandIcon(method.brand)}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<div>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<div class=\\\"flex items-center gap-2\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<p class=\\\"font-medium\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{formatCardBrand(method.brand)} •••• {method.last4}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</p>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{#if method.isDefault}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<Badge variant=\\\"secondary\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<Check class=\\\"mr-1 size-3\\\" />\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tDefault\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</Badge>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<p class=\\\"text-muted-foreground text-sm\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tExpires {method.expMonth.toString().padStart(2, '0')}/{method.expYear}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</p>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<div class=\\\"flex items-center gap-2\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{#if !method.isDefault}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<Button\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tsize=\\\"sm\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tonclick={() => setDefaultPaymentMethod(method.id)}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tSet as Default\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</Button>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<Button\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tsize=\\\"icon-sm\\\"\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tonclick={() => openDeleteDialog(method.id)}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tdisabled={method.isDefault && paymentMethods.length === 1}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<Trash2 class=\\\"size-4\\\" />\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</Button>\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t{/each}\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t</Card.Content>\\n\\t\\t\\t\\t<Card.Footer class=\\\"border-t justify-end\\\">\\n\\t\\t\\t\\t\\t<SetupButton\\n\\t\\t\\t\\t\\t\\tlabel=\\\"Add Payment Method\\\"\\n\\t\\t\\t\\t\\t\\tprocessingLabel=\\\"Adding...\\\"\\n\\t\\t\\t\\t\\t\\tonsuccess={() => invalidate('app:billing')}\\n\\t\\t\\t\\t\\t/>\\n\\t\\t\\t\\t</Card.Footer>\\n\\t\\t\\t</Card.Root>\\n\\t\\t</div>\\n\\t</div>\\n</div>\\n\\n<!-- Delete Confirmation Dialog -->\\n<AlertDialog.Root bind:open={showDeleteDialog}>\\n\\t<AlertDialog.Content>\\n\\t\\t<AlertDialog.Header>\\n\\t\\t\\t<AlertDialog.Title>Remove Payment Method</AlertDialog.Title>\\n\\t\\t\\t<AlertDialog.Description>\\n\\t\\t\\t\\tAre you sure you want to remove this payment method? This action cannot be undone.\\n\\t\\t\\t</AlertDialog.Description>\\n\\t\\t</AlertDialog.Header>\\n\\t\\t<AlertDialog.Footer>\\n\\t\\t\\t<AlertDialog.Cancel onclick={closeDeleteDialog}>Cancel</AlertDialog.Cancel>\\n\\t\\t\\t<AlertDialog.Action onclick={handleDeletePaymentMethod} disabled={isProcessing}>\\n\\t\\t\\t\\t{isProcessing ? 'Removing...' : 'Remove'}\\n\\t\\t\\t</AlertDialog.Action>\\n\\t\\t</AlertDialog.Footer>\\n\\t</AlertDialog.Content>\\n</AlertDialog.Root>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { toggleMode, mode } from 'mode-watcher';\\n\\timport ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';\\n\\timport Settings2Icon from '@lucide/svelte/icons/settings-2';\\n\\t// [!code highlight:1]\\n\\timport CreditCardIcon from '@lucide/svelte/icons/credit-card';\\n\\timport LogOutIcon from '@lucide/svelte/icons/log-out';\\n\\timport MoonIcon from '@lucide/svelte/icons/moon';\\n\\timport SunIcon from '@lucide/svelte/icons/sun';\\n\\timport * as Avatar from '$lib/components/ui/avatar';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu';\\n\\timport * as Sidebar from '$lib/components/ui/sidebar';\\n\\n\\tlet data = {\\n\\t\\tnavUser: [\\n\\t\\t\\t{\\n\\t\\t\\t\\ttitle: 'Settings',\\n\\t\\t\\t\\turl: '/settings',\\n\\t\\t\\t\\ticon: Settings2Icon\\n\\t\\t\\t},\\n\\t\\t\\t// [!code highlight:5]\\n\\t\\t\\t{\\n\\t\\t\\t\\ttitle: 'Billing',\\n\\t\\t\\t\\turl: '/billing',\\n\\t\\t\\t\\ticon: CreditCardIcon\\n\\t\\t\\t}\\n\\t\\t]\\n\\t};\\n\\n\\tlet {\\n\\t\\tuser\\n\\t}: {\\n\\t\\tuser: {\\n\\t\\t\\tid: string;\\n\\t\\t\\tname: string;\\n\\t\\t\\temail: string;\\n\\t\\t\\tavatar: string;\\n\\t\\t};\\n\\t} = $props();\\n\\n\\tconst sidebar = Sidebar.useSidebar();\\n</script>\\n\\n<Sidebar.Menu>\\n\\t<Sidebar.MenuItem>\\n\\t\\t<DropdownMenu.Root>\\n\\t\\t\\t<DropdownMenu.Trigger>\\n\\t\\t\\t\\t{#snippet child({ props })}\\n\\t\\t\\t\\t\\t<Sidebar.MenuButton\\n\\t\\t\\t\\t\\t\\tsize=\\\"lg\\\"\\n\\t\\t\\t\\t\\t\\tclass=\\\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\\\"\\n\\t\\t\\t\\t\\t\\t{...props}\\n\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t<Avatar.Root class=\\\"size-8 rounded-lg\\\">\\n\\t\\t\\t\\t\\t\\t\\t{#if user.avatar}\\n\\t\\t\\t\\t\\t\\t\\t\\t<Avatar.Image src=\\\"/api/files/users/{user.id}/{user.avatar}\\\" alt={user.name} />\\n\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t\\t\\t<Avatar.Fallback class=\\\"rounded-lg\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t{user.name?.charAt(0).toUpperCase() || user.email?.charAt(0).toUpperCase()}\\n\\t\\t\\t\\t\\t\\t\\t</Avatar.Fallback>\\n\\t\\t\\t\\t\\t\\t</Avatar.Root>\\n\\t\\t\\t\\t\\t\\t<div class=\\\"grid flex-1 text-left text-sm leading-tight\\\">\\n\\t\\t\\t\\t\\t\\t\\t<span class=\\\"truncate font-medium\\\">{user.name || user.email}</span>\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t<ChevronsUpDownIcon class=\\\"ml-auto size-4\\\" />\\n\\t\\t\\t\\t\\t</Sidebar.MenuButton>\\n\\t\\t\\t\\t{/snippet}\\n\\t\\t\\t</DropdownMenu.Trigger>\\n\\t\\t\\t<DropdownMenu.Content\\n\\t\\t\\t\\tclass=\\\"w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg\\\"\\n\\t\\t\\t\\tside={sidebar.isMobile ? 'bottom' : 'right'}\\n\\t\\t\\t\\talign=\\\"end\\\"\\n\\t\\t\\t\\tsideOffset={4}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<DropdownMenu.Label class=\\\"p-0 font-normal\\\">\\n\\t\\t\\t\\t\\t<div class=\\\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\\\">\\n\\t\\t\\t\\t\\t\\t<Avatar.Root class=\\\"size-8 rounded-lg\\\">\\n\\t\\t\\t\\t\\t\\t\\t{#if user.avatar}\\n\\t\\t\\t\\t\\t\\t\\t\\t<Avatar.Image src=\\\"/api/files/users/{user.id}/{user.avatar}\\\" alt={user.name} />\\n\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t\\t\\t<Avatar.Fallback class=\\\"rounded-lg\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t{user.name?.charAt(0).toUpperCase() || user.email?.charAt(0).toUpperCase()}\\n\\t\\t\\t\\t\\t\\t\\t</Avatar.Fallback>\\n\\t\\t\\t\\t\\t\\t</Avatar.Root>\\n\\t\\t\\t\\t\\t\\t<div class=\\\"grid flex-1 text-left text-sm leading-tight\\\">\\n\\t\\t\\t\\t\\t\\t\\t<span class=\\\"truncate font-medium\\\">{user.name || user.email}</span>\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t</DropdownMenu.Label>\\n\\t\\t\\t\\t<DropdownMenu.Separator />\\n\\t\\t\\t\\t<DropdownMenu.Group>\\n\\t\\t\\t\\t\\t<DropdownMenu.Item onclick={toggleMode}>\\n\\t\\t\\t\\t\\t\\t{#if mode.current === 'dark'}\\n\\t\\t\\t\\t\\t\\t\\t<SunIcon />\\n\\t\\t\\t\\t\\t\\t\\tLight mode\\n\\t\\t\\t\\t\\t\\t{:else}\\n\\t\\t\\t\\t\\t\\t\\t<MoonIcon />\\n\\t\\t\\t\\t\\t\\t\\tDark mode\\n\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t</DropdownMenu.Item>\\n\\t\\t\\t\\t\\t{#each data.navUser as item}\\n\\t\\t\\t\\t\\t\\t<DropdownMenu.Item class=\\\"p-0\\\">\\n\\t\\t\\t\\t\\t\\t\\t<a href={item.url} class=\\\"flex cursor-default items-center gap-2 px-2 py-1.5 w-full\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t<item.icon />\\n\\t\\t\\t\\t\\t\\t\\t\\t{item.title}\\n\\t\\t\\t\\t\\t\\t\\t</a>\\n\\t\\t\\t\\t\\t\\t</DropdownMenu.Item>\\n\\t\\t\\t\\t\\t{/each}\\n\\t\\t\\t\\t</DropdownMenu.Group>\\n\\t\\t\\t\\t<DropdownMenu.Separator />\\n\\t\\t\\t\\t<DropdownMenu.Item class=\\\"p-0\\\">\\n\\t\\t\\t\\t\\t<form action=\\\"/logout\\\" method=\\\"post\\\" class=\\\"w-full\\\">\\n\\t\\t\\t\\t\\t\\t<button type=\\\"submit\\\" class=\\\"flex cursor-default items-center gap-2 px-2 py-1.5 w-full\\\">\\n\\t\\t\\t\\t\\t\\t\\t<LogOutIcon />\\n\\t\\t\\t\\t\\t\\t\\tLog out\\n\\t\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t\\t</form>\\n\\t\\t\\t\\t</DropdownMenu.Item>\\n\\t\\t\\t</DropdownMenu.Content>\\n\\t\\t</DropdownMenu.Root>\\n\\t</Sidebar.MenuItem>\\n</Sidebar.Menu>\\n\""],"mappings":";AAAA,IAAA,IAAe,goGCAf,IAAe,09LCAf,IAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup-C3gvjtTY.js","names":[],"sources":["../../src/patterns/enable/backend/modifies/svelte-config.ts","../../src/patterns/enable/backend/modifies/gitignore.ts","../../src/patterns/enable/backend/modifies/test-setup.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst FAILURE_HINT = dedent`\n Switch the SvelteKit adapter to @sveltejs/adapter-auto in svelte.config.js:\n\n import adapter from '@sveltejs/adapter-auto';\n\n export default {\n kit: {\n adapter: adapter()\n }\n };\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create svelte.config.js using @sveltejs/adapter-auto.\n`;\n\nexport function modifySvelteConfig(svelteConfigPath: string): ModifyOutcome {\n if (!fs.existsSync(svelteConfigPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const originalSource = fs.readFileSync(svelteConfigPath, \"utf8\");\n const project = new Project({ useInMemoryFileSystem: false });\n const sourceFile = project.addSourceFileAtPath(svelteConfigPath);\n\n const adapterImport = sourceFile\n .getImportDeclarations()\n .find(\n (decl) =>\n decl.getModuleSpecifierValue() === \"@sveltejs/adapter-static\" ||\n decl.getModuleSpecifierValue() === \"@sveltejs/adapter-auto\",\n );\n\n if (!adapterImport) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n if (adapterImport.getModuleSpecifierValue() === \"@sveltejs/adapter-static\") {\n adapterImport.setModuleSpecifier(\"@sveltejs/adapter-auto\");\n }\n\n const adapterCalls = sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((ce) => ce.getExpression().getText() === \"adapter\");\n\n for (const call of adapterCalls) {\n const args = call.getArguments();\n for (let i = args.length - 1; i >= 0; i--) {\n call.removeArgument(i);\n }\n }\n\n sourceFile.formatText();\n sourceFile.saveSync();\n\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== originalSource,\n };\n}\n\nexport function unmodifySvelteConfig(svelteConfigPath: string): ModifyOutcome {\n if (!fs.existsSync(svelteConfigPath)) {\n return { status: \"success\", changed: false };\n }\n\n const originalSource = fs.readFileSync(svelteConfigPath, \"utf8\");\n const project = new Project({ useInMemoryFileSystem: false });\n const sourceFile = project.addSourceFileAtPath(svelteConfigPath);\n\n const adapterImport = sourceFile\n .getImportDeclarations()\n .find(\n (decl) =>\n decl.getModuleSpecifierValue() === \"@sveltejs/adapter-auto\" ||\n decl.getModuleSpecifierValue() === \"@sveltejs/adapter-static\",\n );\n\n if (!adapterImport) {\n return { status: \"success\", changed: false };\n }\n\n if (adapterImport.getModuleSpecifierValue() === \"@sveltejs/adapter-auto\") {\n adapterImport.setModuleSpecifier(\"@sveltejs/adapter-static\");\n }\n\n const adapterCalls = sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((ce) => ce.getExpression().getText() === \"adapter\");\n\n for (const call of adapterCalls) {\n const args = call.getArguments();\n if (args.length === 0) {\n call.addArgument(`{ fallback: '200.html' }`);\n }\n }\n\n sourceFile.formatText();\n sourceFile.saveSync();\n\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== originalSource,\n };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst POCKETBASE_BLOCK = `# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create a .gitignore at the project root with the PocketBase block:\n\n # PocketBase\n /data/*\n !/data/fixtures\n !/data/seeds\n !/data/hooks\n`;\n\nexport function modifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n\n if (original.includes(\"# PocketBase\") && original.includes(\"/data/*\")) {\n return { status: \"success\", changed: false };\n }\n\n const separator = original.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const next = original + separator + POCKETBASE_BLOCK;\n fs.writeFileSync(gitignorePath, next, \"utf8\");\n\n return { status: \"success\", changed: true };\n}\n\nexport function unmodifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n\n if (!original.includes(\"# PocketBase\")) {\n return { status: \"success\", changed: false };\n }\n\n const withBlockRemoved = original.replace(\n /\\n*# PocketBase\\n\\/data\\/\\*\\n!\\/data\\/fixtures\\n!\\/data\\/seeds\\n!\\/data\\/hooks\\n?/,\n \"\\n\",\n );\n\n const cleaned = withBlockRemoved.replace(/\\n{3,}$/, \"\\n\");\n\n if (cleaned === original) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(gitignorePath, cleaned, \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\n// Source of truth: velastack-cli/templates/minimal/test/setup.ts\nconst WITH_BACKEND = `import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase';\n\nconst admin = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['admin'];\nconst pb = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email: string }) {\n\\tawait agent.post('/login').type('form').send({\n\\t\\ttype: 'password',\n\\t\\temail: user.email,\n\\t\\tpassword: testUserPassword\n\\t});\n}\n\nbeforeAll(async () => {\n\\tawait admin\n\\t\\t// @ts-ignore\n\\t\\t.collection('_superusers')\n\\t\\t.authWithPassword(\n\\t\\t\\tprocess.env.POCKETBASE_SUPERUSER_EMAIL!,\n\\t\\t\\tprocess.env.POCKETBASE_SUPERUSER_PASSWORD!\n\\t\\t);\n});\n\nbeforeEach(async (context: TestContext) => {\n\\tcontext.request = supertest(process.env.VITE_TEST_URL!);\n\\tcontext.agent = supertest.agent(process.env.VITE_TEST_URL!) as TestContext['agent'];\n\\tcontext.admin = admin;\n\\tcontext.pb = pb;\n\\tcontext.user = await context.admin.collection('users').create({\n\\t\\temail: \\`test-\\${Math.random().toString(36).slice(2)}@example.com\\`,\n\\t\\tpassword: testUserPassword,\n\\t\\tpasswordConfirm: testUserPassword\n\\t});\n\\tcontext.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n\\tawait context.pb.collection('users').authWithPassword(context.user.email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n\\tawait context.pb.authStore.clear();\n\\tawait context.admin.collection('users').delete(context.user.id);\n});\n`;\n\n// Source of truth: velastack-cli/templates/static/test/setup.ts\nconst WITHOUT_BACKEND = `import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n\\tcontext.request = supertest(process.env.VITE_TEST_URL!);\n\\tcontext.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create test/setup.ts. The default minimal-template setup wires supertest:\n\n import { beforeEach } from 'vitest';\n import supertest from 'supertest';\n\n beforeEach(async (context: any) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!);\n });\n`;\n\nexport function modifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITH_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITH_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n\nexport function unmodifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITHOUT_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITHOUT_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n"],"mappings":";;;;AAKA,IAAM,IAAe,CAAM;;;;;;;;;;GAYrB,IAAiB,CAAM;;;AAI7B,SAAgB,EAAmB,GAAyC;AAC1E,KAAI,CAAC,EAAG,WAAW,EAAiB,CAClC,QAAO;EAAE,QAAQ;EAAa,SAAS;EAAgB;CAGzD,IAAM,IAAiB,EAAG,aAAa,GAAkB,OAAO,EAE1D,IADU,IAAI,EAAQ,EAAE,uBA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Ac,OAAO,EAC9C;EAAE,QAAQ;EAAW,SAAS;EAAM,IATlC;EAAE,QAAQ;EAAa,SAAS;EAAgB;;AAY3D,SAAgB,EAAkB,GAAsC;AAWtE,QAVI,CAAC,EAAG,WAAW,EAAc,IAIhB,EAAG,aAAa,GAAe,OAAO,KACtC,IACR;EAAE,QAAQ;EAAW,SAAS;EAAO,IAG9C,EAAG,cAAc,GAAe,GAAiB,OAAO,EACjD;EAAE,QAAQ;EAAW,SAAS;EAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-result-CLSL_F-E.js","names":[],"sources":["../../src/ui/components/auth-menu/auth-menu-content.svelte?raw","../../src/ui/components/auth-menu/auth-menu-group.svelte?raw","../../src/ui/components/auth-menu/auth-menu-item.svelte?raw","../../src/ui/components/auth-menu/auth-menu-label.svelte?raw","../../src/ui/components/auth-menu/auth-menu-separator.svelte?raw","../../src/ui/components/auth-menu/auth-menu-trigger.svelte?raw","../../src/ui/components/auth-menu/auth-menu.svelte?raw","../../src/ui/components/auth-menu/context.ts?raw","../../src/ui/components/auth-menu/index.ts?raw","../../src/ui/components/cells/autodate.svelte?raw","../../src/ui/components/cells/bool.svelte?raw","../../src/ui/components/cells/date.svelte?raw","../../src/ui/components/cells/editor.svelte?raw","../../src/ui/components/cells/email.svelte?raw","../../src/ui/components/cells/file.svelte?raw","../../src/ui/components/cells/geoPoint.svelte?raw","../../src/ui/components/cells/index.ts?raw","../../src/ui/components/cells/json.svelte?raw","../../src/ui/components/cells/number.svelte?raw","../../src/ui/components/cells/password.svelte?raw","../../src/ui/components/cells/relation.svelte?raw","../../src/ui/components/cells/select.svelte?raw","../../src/ui/components/cells/text.svelte?raw","../../src/ui/components/cells/url.svelte?raw","../../src/ui/components/column-header/column-header.svelte?raw","../../src/ui/components/column-header/index.ts?raw","../../src/ui/components/faceted-filter/faceted-filter.svelte?raw","../../src/ui/components/faceted-filter/index.ts?raw","../../src/ui/components/file-form/file-field.svelte?raw","../../src/ui/components/file-form/file-input.svelte?raw","../../src/ui/components/file-form/file-multiple.svelte?raw","../../src/ui/components/file-form/file-single.svelte?raw","../../src/ui/components/file-form/file-thumb.svelte?raw","../../src/ui/components/file-form/index.ts?raw","../../src/ui/components/file-form/shared.ts?raw","../../src/ui/components/geopoint/coordinate.svelte?raw","../../src/ui/components/geopoint/index.ts?raw","../../src/ui/components/geopoint/input.svelte?raw","../../src/ui/components/geopoint/toggle-map.svelte?raw","../../src/ui/components/leaflet/index.ts?raw","../../src/ui/components/leaflet/leaflet.svelte?raw","../../src/ui/components/multiselect/chip.svelte?raw","../../src/ui/components/multiselect/content.svelte?raw","../../src/ui/components/multiselect/field.svelte?raw","../../src/ui/components/multiselect/index.ts?raw","../../src/ui/components/multiselect/input.svelte?raw","../../src/ui/components/multiselect/item.svelte?raw","../../src/ui/components/multiselect/trigger.svelte?raw","../../src/ui/components/pagination/index.ts?raw","../../src/ui/components/pagination/pagination.svelte?raw","../../src/ui/components/row-actions/index.ts?raw","../../src/ui/components/row-actions/row-actions.svelte?raw","../../src/runtime/write-result.ts"],"sourcesContent":["export default \"<script lang=\\\"ts\\\">\\n\\timport { cn } from '$lib/utils';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\n\\tlet {\\n\\t\\tchildren,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: DropdownMenuPrimitive.ContentProps & {\\n\\t\\tportalProps?: DropdownMenuPrimitive.PortalProps;\\n\\t} = $props();\\n\\n\\tlet { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Content class={className} {...restProps}>\\n\\t\\t{@render children?.()}\\n\\t</DropdownMenu.Content>\\n{:else}\\n\\t<div class={cn('flex flex-col w-full', className)}>\\n\\t\\t{@render children?.()}\\n\\t</div>\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\tlet { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n\\tlet { children, ...restProps } = $props();\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Group {...restProps}>\\n\\t\\t{@render children?.()}\\n\\t</DropdownMenu.Group>\\n{:else}\\n\\t{@render children?.()}\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { goto } from '$app/navigation';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu';\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\tlet { children, href = undefined, ...restProps } = $props();\\n\\n\\tconst { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n\\n\\tconst handleClick = () => {\\n\\t\\tif (restProps.onclick) {\\n\\t\\t\\trestProps.onclick();\\n\\t\\t} else {\\n\\t\\t\\tif (href) {\\n\\t\\t\\t\\tgoto(href);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t};\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Item {...restProps} onclick={handleClick}>\\n\\t\\t{@render children?.()}\\n\\t</DropdownMenu.Item>\\n{:else}\\n\\t<Button\\n\\t\\tclass=\\\"w-full justify-start md:justify-center md:w-auto\\\"\\n\\t\\tvariant=\\\"ghost\\\"\\n\\t\\t{href}\\n\\t\\t{...restProps}\\n\\t>\\n\\t\\t{@render children?.()}\\n\\t</Button>\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\tconst { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n\\tlet { children, ...restProps } = $props();\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Label {...restProps}>\\n\\t\\t{@render children?.()}\\n\\t</DropdownMenu.Label>\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\tconst { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n\\tlet restProps = $props();\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Separator {...restProps} />\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { cn } from '$lib/utils';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { getContext } from 'svelte';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\tlet { class: className = '', ...restProps } = $props();\\n\\n\\tconst { isDesktop } =\\n\\t\\tgetContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\\n</script>\\n\\n{#if isDesktop}\\n\\t<DropdownMenu.Trigger class={cn('inline-flex', className)} {...restProps} />\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { page } from '$app/state';\\n\\timport { browser } from '$app/environment';\\n\\timport { onMount, setContext } from 'svelte';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\\n\\timport { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\\n\\n\\tlet { user, guest } = $props();\\n\\n\\tconst breakpoint = 768;\\n\\tconst breakpointQuery = `(min-width: ${breakpoint}px)`;\\n\\n\\tlet hasMounted = $state(false);\\n\\tlet authMenuContext = $state<AuthMenuContext>({ isDesktop: true });\\n\\n\\tsetContext(AUTH_MENU_CONTEXT_KEY, authMenuContext);\\n\\n\\tfunction updateIsDesktop() {\\n\\t\\tif (!browser) return;\\n\\t\\tauthMenuContext.isDesktop = window.matchMedia(breakpointQuery).matches;\\n\\t}\\n\\n\\tonMount(() => {\\n\\t\\tupdateIsDesktop();\\n\\t\\thasMounted = true;\\n\\t\\tconst mq = window.matchMedia(breakpointQuery);\\n\\t\\tconst listener = () => (authMenuContext.isDesktop = mq.matches);\\n\\t\\tmq.addEventListener('change', listener);\\n\\t\\treturn () => mq.removeEventListener('change', listener);\\n\\t});\\n</script>\\n\\n{#if page.data.user}\\n\\t{#if authMenuContext.isDesktop}\\n\\t\\t<DropdownMenu.Root>\\n\\t\\t\\t{@render user?.()}\\n\\t\\t</DropdownMenu.Root>\\n\\t{:else}\\n\\t\\t<!-- This prevents the menu from being rendered twice before we know if we're on desktop or not -->\\n\\t\\t{#if hasMounted}\\n\\t\\t\\t{@render user?.()}\\n\\t\\t{/if}\\n\\t{/if}\\n{:else}\\n\\t{@render guest?.()}\\n{/if}\\n\"","export default \"export type AuthMenuContext = {\\n isDesktop: boolean;\\n};\\n\\nexport const AUTH_MENU_CONTEXT_KEY = Symbol(\\\"auth-menu-context\\\");\\n\"","export default \"import Root from \\\"./auth-menu.svelte\\\";\\nimport Content from \\\"./auth-menu-content.svelte\\\";\\nimport Trigger from \\\"./auth-menu-trigger.svelte\\\";\\nimport Group from \\\"./auth-menu-group.svelte\\\";\\nimport Label from \\\"./auth-menu-label.svelte\\\";\\nimport Separator from \\\"./auth-menu-separator.svelte\\\";\\nimport Item from \\\"./auth-menu-item.svelte\\\";\\n\\nexport { Root, Content, Trigger, Group, Label, Separator, Item };\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t{new Date(value).toLocaleDateString()}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: boolean | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{value ? 'Yes' : 'No'}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t{new Date(value).toLocaleDateString()}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{value}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{value}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport FileIcon from '@lucide/svelte/icons/file';\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tcollectionId,\\n\\t\\tid,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: {\\n\\t\\tvalue: string[] | string | undefined;\\n\\t\\tcollectionId: string;\\n\\t\\tid: string;\\n\\t} & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t{#if Array.isArray(value)}\\n\\t\\t\\t{#each value.slice(0, 2) as filename}\\n\\t\\t\\t\\t{#if ['.jpg', '.png', '.jpeg', '.webp', '.gif'].some((ext) => filename.endsWith(ext))}\\n\\t\\t\\t\\t\\t<img\\n\\t\\t\\t\\t\\t\\tsrc=\\\"/api/files/{collectionId}/{id}/{filename}\\\"\\n\\t\\t\\t\\t\\t\\tclass=\\\"w-8 h-8 rounded-sm object-cover inline-block mr-2\\\"\\n\\t\\t\\t\\t\\t\\talt={filename}\\n\\t\\t\\t\\t\\t\\ttitle={filename}\\n\\t\\t\\t\\t\\t/>\\n\\t\\t\\t\\t{:else}\\n\\t\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\t\\tclass=\\\"inline-flex items-center justify-center w-8 h-8 bg-muted rounded-sm mr-2\\\"\\n\\t\\t\\t\\t\\t\\ttitle={filename}\\n\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t<FileIcon class=\\\"w-4 h-4\\\" />\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t{/if}\\n\\t\\t\\t{/each}\\n\\t\\t\\t{#if value.length > 2}\\n\\t\\t\\t\\tand {value.length - 2} more files\\n\\t\\t\\t{/if}\\n\\t\\t{:else if ['.jpg', '.png', '.jpeg', '.webp', '.gif'].some((ext) => value.endsWith(ext))}\\n\\t\\t\\t<img\\n\\t\\t\\t\\tsrc=\\\"/api/files/{collectionId}/{id}/{value}\\\"\\n\\t\\t\\t\\tclass=\\\"w-8 h-8 rounded-sm object-cover\\\"\\n\\t\\t\\t\\talt={value}\\n\\t\\t\\t\\ttitle={value}\\n\\t\\t\\t/>\\n\\t\\t{:else}\\n\\t\\t\\t<div\\n\\t\\t\\t\\tclass=\\\"inline-flex items-center justify-center w-8 h-8 bg-muted rounded-sm\\\"\\n\\t\\t\\t\\ttitle={value}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<FileIcon class=\\\"w-4 h-4\\\" />\\n\\t\\t\\t</div>\\n\\t\\t{/if}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport MapPinIcon from '@lucide/svelte/icons/map-pin';\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: {\\n\\t\\tvalue: { lat: number; lon: number } | undefined;\\n\\t} & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center space-x-1', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t<MapPinIcon class=\\\"inline-block w-4 h-4 text-muted-foreground\\\" />\\n\\t\\t<span>{value.lat.toFixed(6)}, {value.lon.toFixed(6)}</span>\\n\\t{/if}\\n</div>\\n\"","export default \"export { default as AutodateCell } from \\\"./autodate.svelte\\\";\\nexport { default as BoolCell } from \\\"./bool.svelte\\\";\\nexport { default as DateCell } from \\\"./date.svelte\\\";\\nexport { default as EditorCell } from \\\"./editor.svelte\\\";\\nexport { default as EmailCell } from \\\"./email.svelte\\\";\\nexport { default as FileCell } from \\\"./file.svelte\\\";\\nexport { default as GeoPointCell } from \\\"./geoPoint.svelte\\\";\\nexport { default as JsonCell } from \\\"./json.svelte\\\";\\nexport { default as NumberCell } from \\\"./number.svelte\\\";\\nexport { default as PasswordCell } from \\\"./password.svelte\\\";\\nexport { default as RelationCell } from \\\"./relation.svelte\\\";\\nexport { default as SelectCell } from \\\"./select.svelte\\\";\\nexport { default as TextCell } from \\\"./text.svelte\\\";\\nexport { default as UrlCell } from \\\"./url.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: any } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value !== undefined}\\n\\t\\t{JSON.stringify(value)}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: number | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{value}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>********</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { Badge } from '$lib/components/ui/badge';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\texpanded,\\n\\t\\tdisplayField = 'id',\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: {\\n\\t\\tvalue: string[] | string | undefined;\\n\\t\\texpanded: any;\\n\\t\\tdisplayField?: string;\\n\\t} & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if expanded}\\n\\t\\t{#if Array.isArray(expanded)}\\n\\t\\t\\t{#each expanded.slice(0, 2) as item}\\n\\t\\t\\t\\t<Badge variant=\\\"outline\\\" class=\\\"mr-1\\\">\\n\\t\\t\\t\\t\\t{item[displayField]}\\n\\t\\t\\t\\t</Badge>\\n\\t\\t\\t{/each}\\n\\t\\t\\t{#if expanded.length > 2}\\n\\t\\t\\t\\t<Badge variant=\\\"secondary\\\" class=\\\"mr-1\\\">\\n\\t\\t\\t\\t\\t+{expanded.length - 2}\\n\\t\\t\\t\\t</Badge>\\n\\t\\t\\t{/if}\\n\\t\\t{:else}\\n\\t\\t\\t<Badge variant=\\\"outline\\\" class=\\\"mr-1\\\">\\n\\t\\t\\t\\t{expanded[displayField]}\\n\\t\\t\\t</Badge>\\n\\t\\t{/if}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { Badge } from '$lib/components/ui/badge';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\toptions,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: {\\n\\t\\tvalue: string[] | string | undefined;\\n\\t\\toptions: Record<string, { label: string; value: string }>;\\n\\t} & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t{#if Array.isArray(value)}\\n\\t\\t\\t{#each value.slice(0, 2) as item}\\n\\t\\t\\t\\t<Badge variant=\\\"outline\\\" class=\\\"mr-1\\\">\\n\\t\\t\\t\\t\\t{options[item].label}\\n\\t\\t\\t\\t</Badge>\\n\\t\\t\\t{/each}\\n\\t\\t{:else}\\n\\t\\t\\t{options[value].label}\\n\\t\\t{/if}\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{value}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue,\\n\\t\\tclass: className,\\n\\t\\ttarget = '_blank',\\n\\t\\trel = 'noopener noreferrer',\\n\\t\\t...restProps\\n\\t}: {\\n\\t\\tvalue: string | undefined;\\n\\t\\ttarget?: string;\\n\\t\\trel?: string;\\n\\t} & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n<div class={cn('flex items-center', className)} {...restProps}>\\n\\t{#if value}\\n\\t\\t<a href={value} {target} {rel}>{value}</a>\\n\\t{/if}\\n</div>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport type { Column } from '@tanstack/table-core';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu';\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport ArrowUpIcon from '@lucide/svelte/icons/arrow-up';\\n\\timport ArrowDownIcon from '@lucide/svelte/icons/arrow-down';\\n\\timport ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tcolumn,\\n\\t\\ttitle,\\n\\t\\tclass: className,\\n\\t\\t...restProps\\n\\t}: { column: Column<any>; title: string } & HTMLAttributes<HTMLDivElement> = $props();\\n</script>\\n\\n{#if !column?.getCanSort()}\\n\\t<div class={className} {...restProps}>\\n\\t\\t{title}\\n\\t</div>\\n{:else}\\n\\t<div class={cn('flex items-center', className)} {...restProps}>\\n\\t\\t<DropdownMenu.Root>\\n\\t\\t\\t<DropdownMenu.Trigger>\\n\\t\\t\\t\\t{#snippet child({ props })}\\n\\t\\t\\t\\t\\t<Button\\n\\t\\t\\t\\t\\t\\t{...props}\\n\\t\\t\\t\\t\\t\\tvariant=\\\"ghost\\\"\\n\\t\\t\\t\\t\\t\\tsize=\\\"sm\\\"\\n\\t\\t\\t\\t\\t\\tclass=\\\"data-[state=open]:bg-accent -ml-3 h-8\\\"\\n\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t<span>\\n\\t\\t\\t\\t\\t\\t\\t{title}\\n\\t\\t\\t\\t\\t\\t</span>\\n\\t\\t\\t\\t\\t\\t{#if column.getIsSorted() === 'desc'}\\n\\t\\t\\t\\t\\t\\t\\t<ArrowDownIcon />\\n\\t\\t\\t\\t\\t\\t{:else if column.getIsSorted() === 'asc'}\\n\\t\\t\\t\\t\\t\\t\\t<ArrowUpIcon />\\n\\t\\t\\t\\t\\t\\t{:else}\\n\\t\\t\\t\\t\\t\\t\\t<ChevronsUpDownIcon />\\n\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t</Button>\\n\\t\\t\\t\\t{/snippet}\\n\\t\\t\\t</DropdownMenu.Trigger>\\n\\t\\t\\t<DropdownMenu.Content align=\\\"start\\\">\\n\\t\\t\\t\\t<DropdownMenu.Item onclick={() => column.toggleSorting(false)}>\\n\\t\\t\\t\\t\\t<ArrowUpIcon class=\\\"text-muted-foreground/70 mr-2 size-3.5\\\" />\\n\\t\\t\\t\\t\\tAsc\\n\\t\\t\\t\\t</DropdownMenu.Item>\\n\\t\\t\\t\\t<DropdownMenu.Item onclick={() => column.toggleSorting(true)}>\\n\\t\\t\\t\\t\\t<ArrowDownIcon class=\\\"text-muted-foreground/70 mr-2 size-3.5\\\" />\\n\\t\\t\\t\\t\\tDesc\\n\\t\\t\\t\\t</DropdownMenu.Item>\\n\\t\\t\\t</DropdownMenu.Content>\\n\\t\\t</DropdownMenu.Root>\\n\\t</div>\\n{/if}\\n\"","export default \"export { default as ColumnHeader } from \\\"./column-header.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\" generics=\\\"TData, TValue\\\">\\n\\timport type { Component } from 'svelte';\\n\\timport { SvelteSet } from 'svelte/reactivity';\\n\\timport type { Column } from '@tanstack/table-core';\\n\\timport CirclePlusIcon from '@lucide/svelte/icons/circle-plus';\\n\\timport CheckIcon from '@lucide/svelte/icons/check';\\n\\timport * as Command from '$lib/components/ui/command';\\n\\timport * as Popover from '$lib/components/ui/popover';\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport { Separator } from '$lib/components/ui/separator';\\n\\timport { Badge } from '$lib/components/ui/badge';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tcolumn,\\n\\t\\ttitle,\\n\\t\\toptions\\n\\t}: {\\n\\t\\tcolumn: Column<TData, TValue>;\\n\\t\\ttitle: string;\\n\\t\\toptions: {\\n\\t\\t\\tlabel: string;\\n\\t\\t\\tvalue: string;\\n\\t\\t\\ticon?: Component;\\n\\t\\t}[];\\n\\t} = $props();\\n\\n\\tconst facets = $derived(column?.getFacetedUniqueValues());\\n\\tconst selectedValues = $derived(new SvelteSet(column?.getFilterValue() as string[]));\\n</script>\\n\\n<Popover.Root>\\n\\t<Popover.Trigger>\\n\\t\\t{#snippet child({ props })}\\n\\t\\t\\t<Button {...props} variant=\\\"outline\\\" size=\\\"sm\\\" class=\\\"h-8 border-dashed\\\">\\n\\t\\t\\t\\t<CirclePlusIcon />\\n\\t\\t\\t\\t{title}\\n\\t\\t\\t\\t{#if selectedValues.size > 0}\\n\\t\\t\\t\\t\\t<Separator orientation=\\\"vertical\\\" class=\\\"mx-2 h-4\\\" />\\n\\t\\t\\t\\t\\t<Badge variant=\\\"secondary\\\" class=\\\"rounded-sm px-1 font-normal lg:hidden\\\">\\n\\t\\t\\t\\t\\t\\t{selectedValues.size}\\n\\t\\t\\t\\t\\t</Badge>\\n\\t\\t\\t\\t\\t<div class=\\\"hidden space-x-1 lg:flex\\\">\\n\\t\\t\\t\\t\\t\\t{#if selectedValues.size > 2}\\n\\t\\t\\t\\t\\t\\t\\t<Badge variant=\\\"secondary\\\" class=\\\"rounded-sm px-1 font-normal\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t{selectedValues.size} selected\\n\\t\\t\\t\\t\\t\\t\\t</Badge>\\n\\t\\t\\t\\t\\t\\t{:else}\\n\\t\\t\\t\\t\\t\\t\\t{#each options.filter((opt) => selectedValues.has(opt.value)) as option (option)}\\n\\t\\t\\t\\t\\t\\t\\t\\t<Badge variant=\\\"secondary\\\" class=\\\"rounded-sm px-1 font-normal\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{option.label}\\n\\t\\t\\t\\t\\t\\t\\t\\t</Badge>\\n\\t\\t\\t\\t\\t\\t\\t{/each}\\n\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t{/if}\\n\\t\\t\\t</Button>\\n\\t\\t{/snippet}\\n\\t</Popover.Trigger>\\n\\t<Popover.Content class=\\\"w-[200px] p-0\\\" align=\\\"start\\\">\\n\\t\\t<Command.Root>\\n\\t\\t\\t<Command.Input placeholder={title} />\\n\\t\\t\\t<Command.List>\\n\\t\\t\\t\\t<Command.Empty>No results found.</Command.Empty>\\n\\t\\t\\t\\t<Command.Group>\\n\\t\\t\\t\\t\\t{#each options as option (option)}\\n\\t\\t\\t\\t\\t\\t{@const isSelected = selectedValues.has(option.value)}\\n\\t\\t\\t\\t\\t\\t<Command.Item\\n\\t\\t\\t\\t\\t\\t\\tonSelect={() => {\\n\\t\\t\\t\\t\\t\\t\\t\\tif (isSelected) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tselectedValues.delete(option.value);\\n\\t\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tselectedValues.add(option.value);\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\tconst filterValues = Array.from(selectedValues);\\n\\t\\t\\t\\t\\t\\t\\t\\tcolumn?.setFilterValue(filterValues.length ? filterValues : undefined);\\n\\t\\t\\t\\t\\t\\t\\t}}\\n\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t<div\\n\\t\\t\\t\\t\\t\\t\\t\\tclass={cn(\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t'border-primary mr-2 flex size-4 items-center justify-center rounded-sm border',\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tisSelected ? 'bg-primary text-primary-foreground' : 'opacity-50 [&_svg]:invisible'\\n\\t\\t\\t\\t\\t\\t\\t\\t)}\\n\\t\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\t\\t<CheckIcon class=\\\"size-4\\\" />\\n\\t\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t\\t\\t{#if option.icon}\\n\\t\\t\\t\\t\\t\\t\\t\\t{@const Icon = option.icon}\\n\\t\\t\\t\\t\\t\\t\\t\\t<Icon class=\\\"text-muted-foreground\\\" />\\n\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\n\\t\\t\\t\\t\\t\\t\\t<span>{option.label}</span>\\n\\t\\t\\t\\t\\t\\t\\t{#if facets?.get(option.value)}\\n\\t\\t\\t\\t\\t\\t\\t\\t<span class=\\\"ml-auto flex size-4 items-center justify-center font-mono text-xs\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t{facets.get(option.value)}\\n\\t\\t\\t\\t\\t\\t\\t\\t</span>\\n\\t\\t\\t\\t\\t\\t\\t{/if}\\n\\t\\t\\t\\t\\t\\t</Command.Item>\\n\\t\\t\\t\\t\\t{/each}\\n\\t\\t\\t\\t</Command.Group>\\n\\t\\t\\t\\t{#if selectedValues.size > 0}\\n\\t\\t\\t\\t\\t<Command.Separator />\\n\\t\\t\\t\\t\\t<Command.Group>\\n\\t\\t\\t\\t\\t\\t<Command.Item\\n\\t\\t\\t\\t\\t\\t\\tonSelect={() => column?.setFilterValue(undefined)}\\n\\t\\t\\t\\t\\t\\t\\tclass=\\\"justify-center text-center\\\"\\n\\t\\t\\t\\t\\t\\t>\\n\\t\\t\\t\\t\\t\\t\\tClear filters\\n\\t\\t\\t\\t\\t\\t</Command.Item>\\n\\t\\t\\t\\t\\t</Command.Group>\\n\\t\\t\\t\\t{/if}\\n\\t\\t\\t</Command.List>\\n\\t\\t</Command.Root>\\n\\t</Popover.Content>\\n</Popover.Root>\\n\"","export default \"export { default as FacetedFilter } from \\\"./faceted-filter.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\" generics=\\\"T extends Record<string, unknown>, U extends FormPath<T>\\\">\\n\\timport * as FormPrimitive from 'formsnap';\\n\\timport type { FormPath } from 'sveltekit-superforms';\\n\\timport { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { setContext } from 'svelte';\\n\\n\\tlet {\\n\\t\\tref = $bindable(null),\\n\\t\\tclass: className,\\n\\t\\tform,\\n\\t\\tname,\\n\\t\\tchildren: childrenProp,\\n\\t\\t...restProps\\n\\t}: FormPrimitive.FieldProps<T, U> &\\n\\t\\tWithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();\\n\\n\\tsetContext('file-field', {\\n\\t\\tget form() {\\n\\t\\t\\treturn form;\\n\\t\\t},\\n\\t\\tget name() {\\n\\t\\t\\treturn name;\\n\\t\\t}\\n\\t});\\n</script>\\n\\n<FormPrimitive.Field {form} {name}>\\n\\t{#snippet children({ constraints, errors, tainted, value })}\\n\\t\\t<div bind:this={ref} data-slot=\\\"form-item\\\" class={cn('space-y-2', className)} {...restProps}>\\n\\t\\t\\t{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}\\n\\t\\t</div>\\n\\t{/snippet}\\n</FormPrimitive.Field>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { getContext } from 'svelte';\\n\\timport { fileProxy, filesProxy, type SuperForm } from 'sveltekit-superforms';\\n\\timport { Input } from '$lib/components/ui/input';\\n\\n\\tconst ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\\n\\tconst { multiple } = getContext<{ multiple: boolean }>('file-field-multiple');\\n\\n\\tconst files = multiple ? filesProxy(ctx.form, `${ctx.name}+`) : fileProxy(ctx.form, ctx.name);\\n\\tconst { form: formData, reset } = ctx.form;\\n\\n\\tconst { ...props } = $props();\\n\\n\\tconst onchange = () => {\\n\\t\\treset({\\n\\t\\t\\tdata: $formData\\n\\t\\t});\\n\\t};\\n</script>\\n\\n{#if !multiple}\\n\\t{#if $formData[ctx.name]}\\n\\t\\t{#if typeof $formData[ctx.name] === 'string'}\\n\\t\\t\\t<input type=\\\"text\\\" name={ctx.name} value={$formData[ctx.name]} class=\\\"hidden\\\" />\\n\\t\\t{:else}\\n\\t\\t\\t<input type=\\\"file\\\" name={ctx.name} files={$files} class=\\\"hidden\\\" />\\n\\t\\t{/if}\\n\\t{:else}\\n\\t\\t<input type=\\\"text\\\" name={ctx.name} value=\\\"\\\" class=\\\"hidden\\\" />\\n\\t{/if}\\n{/if}\\n\\n<Input\\n\\ttype=\\\"file\\\"\\n\\tbind:files={$files}\\n\\t{multiple}\\n\\t{onchange}\\n\\t{...props}\\n\\tname={multiple ? `${ctx.name}+` : ''}\\n/>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { setContext, getContext } from 'svelte';\\n\\timport { type SuperForm } from 'sveltekit-superforms';\\n\\timport { getName } from './shared';\\n\\n\\tconst ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\\n\\tconst {\\n\\t\\tdisplay,\\n\\t\\tinput\\n\\t}: {\\n\\t\\tdisplay: (props: {\\n\\t\\t\\tfile: File | string;\\n\\t\\t\\tfilename: string;\\n\\t\\t\\tonremove: (file: File | string) => void;\\n\\t\\t}) => any;\\n\\t\\tinput: () => any;\\n\\t} = $props();\\n\\n\\tsetContext('file-field-multiple', { multiple: true });\\n\\n\\tconst { form: formData, reset } = ctx.form;\\n\\n\\tlet removed = $state<string[]>([]);\\n\\n\\tconst onremove = (file: File | string) => {\\n\\t\\tif (typeof file === 'string') {\\n\\t\\t\\tremoved.push(file);\\n\\t\\t} else {\\n\\t\\t\\tif (Array.isArray($formData[`${ctx.name}+`])) {\\n\\t\\t\\t\\treset({\\n\\t\\t\\t\\t\\tdata: {\\n\\t\\t\\t\\t\\t\\t...$formData,\\n\\t\\t\\t\\t\\t\\t[`${ctx.name}+`]: $formData[`${ctx.name}+`].filter((f: File | string) => f !== file) as\\n\\t\\t\\t\\t\\t\\t\\t| File[]\\n\\t\\t\\t\\t\\t\\t\\t| undefined\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t};\\n\\n\\tconst initialFiles = $formData[ctx.name] || [];\\n</script>\\n\\n{#if initialFiles}\\n\\t{#each initialFiles as file}\\n\\t\\t{#if !removed.includes(file)}\\n\\t\\t\\t{@render display({ file, filename: getName(file), onremove })}\\n\\t\\t{/if}\\n\\t{/each}\\n{/if}\\n\\n{#each $formData[`${ctx.name}+`] as file}\\n\\t{#if file && typeof file !== 'string'}\\n\\t\\t{@render display({ file, filename: getName(file), onremove })}\\n\\t{/if}\\n{/each}\\n\\n{#each removed as removedFile}\\n\\t<input type=\\\"text\\\" name={`${ctx.name}-`} value={removedFile} class=\\\"hidden\\\" />\\n{/each}\\n\\n{@render input()}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { setContext, getContext } from 'svelte';\\n\\timport { type SuperForm } from 'sveltekit-superforms';\\n\\timport { getName } from './shared';\\n\\n\\tconst ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\\n\\tconst {\\n\\t\\tdisplay,\\n\\t\\tinput\\n\\t}: {\\n\\t\\tdisplay: (props: {\\n\\t\\t\\tfile: File | string;\\n\\t\\t\\tfilename: string;\\n\\t\\t\\tonremove: (file: File | string) => void;\\n\\t\\t}) => any;\\n\\t\\tinput: () => any;\\n\\t} = $props();\\n\\n\\tconst { form: formData, reset } = ctx.form;\\n\\n\\tsetContext('file-field-multiple', { multiple: false });\\n\\n\\tconst onremove = () => {\\n\\t\\treset({\\n\\t\\t\\tdata: {\\n\\t\\t\\t\\t...$formData,\\n\\t\\t\\t\\t[ctx.name]: ''\\n\\t\\t\\t}\\n\\t\\t});\\n\\t};\\n</script>\\n\\n{#if $formData[ctx.name]}\\n\\t{@render display({ file: $formData[ctx.name], filename: getName($formData[ctx.name]), onremove })}\\n{/if}\\n\\n{@render input()}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { getContext } from 'svelte';\\n\\timport { type SuperForm } from 'sveltekit-superforms';\\n\\timport FileIcon from '@lucide/svelte/icons/file';\\n\\timport ImageIcon from '@lucide/svelte/icons/image';\\n\\timport { cn } from '$lib/utils';\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\n\\tconst ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\\n\\tconst { form: formData } = ctx.form;\\n\\n\\tconst {\\n\\t\\tfile,\\n\\t\\tfilename,\\n\\t\\tcollectionId,\\n\\t\\tid,\\n\\t\\tthumb = '50x50',\\n\\t\\tclass: className,\\n\\t\\ttype = 'image',\\n\\t\\t...props\\n\\t}: {\\n\\t\\tfile: File | string;\\n\\t\\tfilename: string;\\n\\t\\tcollectionId?: string;\\n\\t\\tid?: string;\\n\\t\\tthumb?: string;\\n\\t\\tclass?: string;\\n\\t\\ttype?: 'image' | 'file';\\n\\t} & HTMLAttributes<HTMLImageElement> = $props();\\n\\n\\tconst isImage = $derived(\\n\\t\\ttype === 'image' ||\\n\\t\\t\\tfilename.toLowerCase().endsWith('.png') ||\\n\\t\\t\\tfilename.toLowerCase().endsWith('.jpg') ||\\n\\t\\t\\tfilename.toLowerCase().endsWith('.jpeg') ||\\n\\t\\t\\tfilename.toLowerCase().endsWith('.gif') ||\\n\\t\\t\\tfilename.toLowerCase().endsWith('.webp')\\n\\t);\\n\\n\\tfunction getUrl(file: string) {\\n\\t\\treturn `/api/files/${collectionId ?? $formData.collectionId}/${id ?? $formData.id}/${file}?thumb=${thumb}`;\\n\\t}\\n</script>\\n\\n{#if typeof file === 'string'}\\n\\t{#if (id ?? $formData.collectionId) && (id ?? $formData.id) && isImage}\\n\\t\\t<img src={getUrl(file)} alt={filename} class={className} {...props} />\\n\\t{:else}\\n\\t\\t<div\\n\\t\\t\\tclass={cn('flex items-center justify-center w-full h-full bg-muted rounded-md', className)}\\n\\t\\t\\t{...props as HTMLAttributes<HTMLDivElement>}\\n\\t\\t>\\n\\t\\t\\t{#if isImage}\\n\\t\\t\\t\\t<ImageIcon class=\\\"w-4 h-4\\\" />\\n\\t\\t\\t{:else}\\n\\t\\t\\t\\t<FileIcon class=\\\"w-4 h-4\\\" />\\n\\t\\t\\t{/if}\\n\\t\\t</div>\\n\\t{/if}\\n{:else if isImage}\\n\\t<img src={URL.createObjectURL(file)} alt={filename} class={className} {...props} />\\n{:else}\\n\\t<div\\n\\t\\tclass={cn('flex items-center justify-center w-full h-full bg-muted rounded-md', className)}\\n\\t\\t{...props as HTMLAttributes<HTMLDivElement>}\\n\\t>\\n\\t\\t<FileIcon class=\\\"w-4 h-4\\\" />\\n\\t</div>\\n{/if}\\n\"","export default \"export { default as Field } from \\\"./file-field.svelte\\\";\\nexport { default as Single } from \\\"./file-single.svelte\\\";\\nexport { default as Multiple } from \\\"./file-multiple.svelte\\\";\\nexport { default as Input } from \\\"./file-input.svelte\\\";\\nexport { default as Thumb } from \\\"./file-thumb.svelte\\\";\\n\"","export default \"export function getUrl(\\n file: File | string,\\n collectionId: string,\\n recordId: string,\\n thumb: string,\\n) {\\n return typeof file === \\\"string\\\"\\n ? `/api/files/${collectionId}/${recordId}/${file}?thumb=${thumb}`\\n : URL.createObjectURL(file);\\n}\\n\\nexport function getName(file: File | string) {\\n return typeof file === \\\"string\\\" ? (file.split(\\\"/\\\").pop() ?? \\\"\\\") : file.name;\\n}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet {\\n\\t\\tvalue = $bindable(),\\n\\t\\tid,\\n\\t\\tlabel,\\n\\t\\tshortLabel,\\n\\t\\tmapOpen\\n\\t}: {\\n\\t\\tvalue: number;\\n\\t\\tid: string;\\n\\t\\tlabel: string;\\n\\t\\tshortLabel: string;\\n\\t\\tmapOpen: boolean;\\n\\t} = $props();\\n</script>\\n\\n<div\\n\\tclass={cn(\\n\\t\\t'border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\\n\\t\\t'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',\\n\\t\\t'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\\n\\t\\t'pr-0 flex items-center',\\n\\t\\tlabel === 'Latitude' && 'rounded-r-none',\\n\\t\\tlabel === 'Longitude' && 'rounded-none -ml-px',\\n\\t\\tmapOpen && 'rounded-b-none'\\n\\t)}\\n>\\n\\t<label for={id} class=\\\"text-muted-foreground mr-2\\\">\\n\\t\\t<span class=\\\"hidden md:block\\\">{label}</span>\\n\\t\\t<span class=\\\"block md:hidden\\\">{shortLabel}</span>\\n\\t</label>\\n\\n\\t<input\\n\\t\\tbind:value\\n\\t\\ttype=\\\"number\\\"\\n\\t\\tclass=\\\"border-none outline-none min-w-0 w-full pr-2\\\"\\n\\t\\t{id}\\n\\t\\tstep=\\\"0.000001\\\"\\n\\t/>\\n</div>\\n\"","export default \"export { default as GeopointInput } from \\\"./input.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { setContext } from 'svelte';\\n\\timport ToggleMap from './toggle-map.svelte';\\n\\timport Coordinate from './coordinate.svelte';\\n\\n\\tlet {\\n\\t\\tname,\\n\\t\\tvalue = $bindable()\\n\\t}: {\\n\\t\\tname: string;\\n\\t\\tvalue: string | undefined;\\n\\t} = $props();\\n\\n\\tconst geopoint = $state(value ? JSON.parse(value) : { lat: 0, lon: 0 });\\n\\tconst map = $state({ open: false });\\n\\n\\tsetContext('geopoint', {\\n\\t\\tgeopoint,\\n\\t\\tmap\\n\\t});\\n\\n\\t$effect(() => {\\n\\t\\tif (value) {\\n\\t\\t\\tconst parsed = JSON.parse(value);\\n\\n\\t\\t\\tif (typeof parsed === 'object' && parsed !== null && 'lat' in parsed && 'lon' in parsed) {\\n\\t\\t\\t\\tgeopoint.lat = parsed.lat.toFixed(6);\\n\\t\\t\\t\\tgeopoint.lon = parsed.lon.toFixed(6);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t});\\n\\n\\tconst stringValue = $derived(\\n\\t\\tJSON.stringify({ lat: parseFloat(geopoint.lat), lon: parseFloat(geopoint.lon) })\\n\\t);\\n</script>\\n\\n<input type=\\\"hidden\\\" {name} value={stringValue} />\\n\\n<div class=\\\"w-full\\\">\\n\\t<div class=\\\"w-full flex\\\">\\n\\t\\t<Coordinate\\n\\t\\t\\tid=\\\"latitude\\\"\\n\\t\\t\\tlabel=\\\"Latitude\\\"\\n\\t\\t\\tshortLabel=\\\"Lat\\\"\\n\\t\\t\\tbind:value={geopoint.lat}\\n\\t\\t\\tmapOpen={map.open}\\n\\t\\t/>\\n\\t\\t<Coordinate\\n\\t\\t\\tid=\\\"longitude\\\"\\n\\t\\t\\tlabel=\\\"Longitude\\\"\\n\\t\\t\\tshortLabel=\\\"Lon\\\"\\n\\t\\t\\tbind:value={geopoint.lon}\\n\\t\\t\\tmapOpen={map.open}\\n\\t\\t/>\\n\\t\\t<ToggleMap />\\n\\t</div>\\n\\n\\t{#if map.open}\\n\\t\\t{#await import('$lib/components/ui/leaflet/leaflet.svelte')}\\n\\t\\t\\t<div class=\\\"h-[225px] w-full bg-input rounded-b-md\\\"></div>\\n\\t\\t{:then { default: Leaflet }}\\n\\t\\t\\t<Leaflet height={225} point={geopoint} class=\\\"rounded-b-md overflow-hidden\\\" />\\n\\t\\t{/await}\\n\\t{/if}\\n</div>\\n\"","export default \"<script>\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport MapIcon from '@lucide/svelte/icons/map';\\n\\timport { getContext } from 'svelte';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet { map } = getContext('geopoint');\\n</script>\\n\\n<Button\\n\\tvariant=\\\"outline\\\"\\n\\tsize=\\\"icon\\\"\\n\\tclass={cn('w-10 rounded-none rounded-r-md border-l-0', map.open && 'rounded-b-none')}\\n\\tonclick={() => (map.open = !map.open)}\\n>\\n\\t<MapIcon class=\\\"w-4 h-4\\\" />\\n</Button>\\n\"","export default \"export { default as Leaflet } from \\\"./leaflet.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { onMount } from 'svelte';\\n\\timport L from 'leaflet';\\n\\timport 'leaflet/dist/leaflet.css';\\n\\n\\t// manually load the markers so that they can be embedded in the prod bundle\\n\\timport markerIconUrl from 'leaflet/dist/images/marker-icon.png';\\n\\timport markerIconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\\n\\timport markerShadowUrl from 'leaflet/dist/images/marker-shadow.png';\\n\\n\\tlet { height = 225, point = $bindable(), readonly = false, ...props } = $props();\\n\\n\\tlet map: L.Map;\\n\\tlet mapEl: HTMLElement;\\n\\tlet marker: L.Marker;\\n\\tlet panTimeoutId: ReturnType<typeof setTimeout>;\\n\\n\\tconst defaultZoomLevel = 8;\\n\\n\\t$effect(() => {\\n\\t\\tif (point.lat && point.lon) {\\n\\t\\t\\tpanInside();\\n\\t\\t}\\n\\t});\\n\\n\\tfunction normalizeCoordinate(coord: any) {\\n\\t\\treturn +(+coord).toFixed(6);\\n\\t}\\n\\n\\tfunction panInside(debounce = 200) {\\n\\t\\tclearTimeout(panTimeoutId);\\n\\t\\tpanTimeoutId = setTimeout(() => {\\n\\t\\t\\tmarker?.setLatLng([point.lat, point.lon]);\\n\\t\\t\\tmap?.panInside([point.lat, point.lon], { padding: [20, 40] });\\n\\t\\t}, debounce);\\n\\t}\\n\\n\\tfunction initMap() {\\n\\t\\tconst latlon = [\\n\\t\\t\\tnormalizeCoordinate(point.lat),\\n\\t\\t\\tnormalizeCoordinate(point.lon)\\n\\t\\t] as L.LatLngTuple;\\n\\n\\t\\tmap = L.map(mapEl, {\\n\\t\\t\\tzoomControl: false,\\n\\t\\t\\tmaxBounds: [\\n\\t\\t\\t\\t[-90, -180],\\n\\t\\t\\t\\t[90, 180]\\n\\t\\t\\t],\\n\\t\\t\\tminZoom: 2\\n\\t\\t}).setView(latlon, defaultZoomLevel);\\n\\n\\t\\tif (readonly) {\\n\\t\\t\\tmap.dragging.disable();\\n\\t\\t\\tmap.touchZoom.disable();\\n\\t\\t\\tmap.doubleClickZoom.disable();\\n\\t\\t\\tmap.scrollWheelZoom.disable();\\n\\t\\t\\tmap.boxZoom.disable();\\n\\t\\t\\tmap.keyboard.disable();\\n\\t\\t}\\n\\n\\t\\tL.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\\n\\t\\t\\tattribution: '© <a href=\\\"https://www.openstreetmap.org/copyright\\\">OSM</a>',\\n\\t\\t\\tnoWrap: true\\n\\t\\t}).addTo(map);\\n\\n\\t\\tmap.attributionControl.setPrefix('');\\n\\n\\t\\t// reassign the default marker images with the loaded ones\\n\\t\\t// (https://leafletjs.com/reference.html#icon-default-option)\\n\\t\\tL.Icon.Default.prototype.options.iconUrl = markerIconUrl;\\n\\t\\tL.Icon.Default.prototype.options.iconRetinaUrl = markerIconRetinaUrl;\\n\\t\\tL.Icon.Default.prototype.options.shadowUrl = markerShadowUrl;\\n\\t\\tL.Icon.Default.imagePath = '';\\n\\n\\t\\tmarker = L.marker(latlon, {\\n\\t\\t\\tdraggable: true,\\n\\t\\t\\tautoPan: true\\n\\t\\t}).addTo(map);\\n\\n\\t\\tmarker.bindTooltip('drag or right click anywhere on the map to move');\\n\\n\\t\\tmarker.on('moveend', (e) => {\\n\\t\\t\\tif (e.sourceTarget?._latlng) {\\n\\t\\t\\t\\tselect(e.sourceTarget._latlng.lat, e.sourceTarget._latlng.lng, false);\\n\\t\\t\\t}\\n\\t\\t});\\n\\n\\t\\tmap.on('contextmenu', (e) => {\\n\\t\\t\\tselect(e.latlng.lat, e.latlng.lng, false);\\n\\t\\t});\\n\\t}\\n\\n\\tfunction destroyMap() {\\n\\t\\tmarker?.remove();\\n\\t\\tmap?.remove();\\n\\t}\\n\\n\\tfunction select(lat: number, lon: number, centerMap = true) {\\n\\t\\tpoint.lat = normalizeCoordinate(lat);\\n\\t\\tpoint.lon = normalizeCoordinate(lon);\\n\\n\\t\\t// center the map\\n\\t\\tif (centerMap) {\\n\\t\\t\\tmarker?.setLatLng([point.lat, point.lon]); // optimistic marker update\\n\\t\\t\\tmap?.panTo([point.lat, point.lon], { animate: false });\\n\\t\\t}\\n\\t}\\n\\n\\tonMount(() => {\\n\\t\\tinitMap();\\n\\n\\t\\treturn () => {\\n\\t\\t\\tdestroyMap();\\n\\t\\t};\\n\\t});\\n</script>\\n\\n<div class=\\\"map-wrapper\\\" style=\\\"{height ? `height:${height}px` : null};\\\" {...props}>\\n\\t<div bind:this={mapEl} class=\\\"map-box\\\"></div>\\n</div>\\n\\n<style>\\n\\t.map-wrapper {\\n\\t\\tposition: relative;\\n\\t\\tdisplay: block;\\n\\t\\theight: 100%;\\n\\t\\twidth: 100%;\\n\\t}\\n\\t.map-box {\\n\\t\\tz-index: 1;\\n\\t\\theight: 100%;\\n\\t\\twidth: 100%;\\n\\t}\\n</style>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport type { Snippet } from 'svelte';\\n\\timport { cn } from '$lib/utils';\\n\\n\\tlet { children, class: className }: { children: Snippet; class?: string } = $props();\\n</script>\\n\\n<span class={cn('bg-secondary text-secondary-foreground px-2 py-1 rounded-sm text-sm', className)}>\\n\\t{@render children?.()}\\n</span>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { Popover as PopoverPrimitive } from 'bits-ui';\\n\\timport * as Popover from '$lib/components/ui/popover';\\n\\n\\tlet {\\n\\t\\tchildren,\\n\\t\\t...props\\n\\t}: PopoverPrimitive.ContentProps & {\\n\\t\\tportalProps?: PopoverPrimitive.PortalProps;\\n\\t} = $props();\\n</script>\\n\\n<Popover.Content {...props}>\\n\\t{@render children?.()}\\n</Popover.Content>\\n\"","export default \"<script lang=\\\"ts\\\" generics=\\\"T extends Record<string, unknown>, U extends FormPath<T>\\\">\\n\\timport * as FormPrimitive from 'formsnap';\\n\\timport type { FormPath } from 'sveltekit-superforms';\\n\\timport { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';\\n\\timport type { HTMLAttributes } from 'svelte/elements';\\n\\timport { setContext } from 'svelte';\\n\\timport * as Popover from '$lib/components/ui/popover';\\n\\n\\tlet {\\n\\t\\tref = $bindable(null),\\n\\t\\tclass: className,\\n\\t\\ttype,\\n\\t\\tform,\\n\\t\\tname,\\n\\t\\trequired,\\n\\t\\tchildren: childrenProp,\\n\\t\\t...restProps\\n\\t}: FormPrimitive.FieldProps<T, U> & {\\n\\t\\ttype: 'multiple' | 'single';\\n\\t\\trequired?: boolean;\\n\\t} & WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();\\n\\n\\tconst { form: formData } = $derived(form);\\n\\n\\tconst toggleSelected = (value: string) => {\\n\\t\\tif (type === 'single') {\\n\\t\\t\\tif (!required && $formData[name] === value) {\\n\\t\\t\\t\\t$formData[name] = undefined as T[U];\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t$formData[name] = value as T[U];\\n\\t\\t\\t}\\n\\t\\t} else if (type === 'multiple') {\\n\\t\\t\\tif (!$formData[name]) {\\n\\t\\t\\t\\t$formData[name] = [] as T[U];\\n\\t\\t\\t}\\n\\n\\t\\t\\tconst currentValue = $formData[name] as string[];\\n\\t\\t\\tconst index = currentValue.indexOf(value);\\n\\n\\t\\t\\tif (index > -1) {\\n\\t\\t\\t\\t$formData[name] = currentValue.filter((id) => id !== value) as T[U];\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t$formData[name] = [...currentValue, value] as T[U];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t};\\n\\n\\tconst isSelected = (value: string) => {\\n\\t\\tif (type === 'single') {\\n\\t\\t\\treturn $formData[name] === value;\\n\\t\\t} else if (type === 'multiple') {\\n\\t\\t\\treturn ($formData[name] as string[])?.includes(value) ?? false;\\n\\t\\t}\\n\\t};\\n\\n\\tsetContext('multiselect-field', {\\n\\t\\tget form() {\\n\\t\\t\\treturn form;\\n\\t\\t},\\n\\t\\tget name() {\\n\\t\\t\\treturn name;\\n\\t\\t},\\n\\t\\tget type() {\\n\\t\\t\\treturn type;\\n\\t\\t},\\n\\t\\ttoggleSelected,\\n\\t\\tisSelected\\n\\t});\\n</script>\\n\\n<Popover.Root>\\n\\t<FormPrimitive.Field {form} {name}>\\n\\t\\t{#snippet children({ constraints, errors, tainted, value })}\\n\\t\\t\\t<div bind:this={ref} data-slot=\\\"form-item\\\" class={cn('space-y-2', className)} {...restProps}>\\n\\t\\t\\t\\t{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}\\n\\t\\t\\t</div>\\n\\t\\t{/snippet}\\n\\t</FormPrimitive.Field>\\n</Popover.Root>\\n\"","export default \"export { default as Field } from \\\"./field.svelte\\\";\\nexport { default as Trigger } from \\\"./trigger.svelte\\\";\\nexport { default as Input } from \\\"./input.svelte\\\";\\nexport { default as Content } from \\\"./content.svelte\\\";\\nexport { default as Item } from \\\"./item.svelte\\\";\\nexport { default as Chip } from \\\"./chip.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\" generics=\\\"T extends string\\\">\\n\\timport type { SuperForm } from 'sveltekit-superforms';\\n\\timport { getContext, type Snippet } from 'svelte';\\n\\n\\tconst { form, type } = getContext<{ form: SuperForm<any, any>; type: 'single' | 'multiple' }>(\\n\\t\\t'multiselect-field'\\n\\t);\\n\\tconst { form: formData } = form;\\n\\n\\tlet {\\n\\t\\tchildren,\\n\\t\\tplaceholder,\\n\\t\\tname,\\n\\t\\tvalue = $bindable()\\n\\t}: {\\n\\t\\tchildren: Snippet<[{ selected: T[] }]>;\\n\\t\\tplaceholder?: string;\\n\\t\\tname: string;\\n\\t\\tvalue: T[] | T | undefined;\\n\\t} = $props();\\n</script>\\n\\n{#if value && value.length > 0}\\n\\t{@render children?.({ selected: type === 'single' ? [$formData[name]] : $formData[name] })}\\n\\t{#if type === 'multiple'}\\n\\t\\t{#each value as v}\\n\\t\\t\\t<input type=\\\"hidden\\\" {name} value={v} />\\n\\t\\t{/each}\\n\\t{:else}\\n\\t\\t<input type=\\\"hidden\\\" {name} {value} />\\n\\t{/if}\\n{:else}\\n\\t{placeholder}\\n{/if}\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { getContext, type Snippet } from 'svelte';\\n\\timport { cn } from '$lib/utils';\\n\\timport { Command as CommandPrimitive } from 'bits-ui';\\n\\timport * as Command from '$lib/components/ui/command';\\n\\timport CheckIcon from '@lucide/svelte/icons/check';\\n\\n\\tlet {\\n\\t\\tchildren,\\n\\t\\tvalue,\\n\\t\\tlabel,\\n\\t\\tclass: className,\\n\\t\\t...props\\n\\t}: CommandPrimitive.ItemProps & {\\n\\t\\tvalue: string;\\n\\t\\tlabel: string | undefined;\\n\\t\\tchildren?: Snippet;\\n\\t\\tclass?: string;\\n\\t} = $props();\\n\\n\\tconst { toggleSelected, isSelected } = getContext<{\\n\\t\\ttoggleSelected: (value: string) => void;\\n\\t\\tisSelected: (value: string) => boolean;\\n\\t}>('multiselect-field');\\n\\n\\tconst handleSelect = () => {\\n\\t\\ttoggleSelected(value);\\n\\t};\\n</script>\\n\\n<Command.Item\\n\\tclass={cn('cursor-pointer', className)}\\n\\t{...props}\\n\\tvalue={label}\\n\\tonSelect={handleSelect}\\n>\\n\\t{label}\\n\\t<CheckIcon class={cn('ml-auto', !isSelected(value) && 'text-transparent')} />\\n</Command.Item>\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport * as Popover from '$lib/components/ui/popover';\\n\\timport { Popover as PopoverPrimitive } from 'bits-ui';\\n\\timport { cn } from '$lib/utils';\\n\\timport { buttonVariants } from '$lib/components/ui/button';\\n\\timport ChevronDownIcon from '@lucide/svelte/icons/chevron-down';\\n\\n\\tlet { children, class: className, ...props }: PopoverPrimitive.TriggerProps = $props();\\n</script>\\n\\n<Popover.Trigger\\n\\tclass={cn(buttonVariants({ variant: 'outline' }), className)}\\n\\trole=\\\"combobox\\\"\\n\\t{...props}\\n>\\n\\t{@render children?.()}\\n\\t<ChevronDownIcon class=\\\"size-4 opacity-50\\\" />\\n</Popover.Trigger>\\n\"","export default \"export { default as Pagination } from \\\"./pagination.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport * as Select from '$lib/components/ui/select';\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport ChevronsLeftIcon from '@lucide/svelte/icons/chevrons-left';\\n\\timport ChevronLeftIcon from '@lucide/svelte/icons/chevron-left';\\n\\timport ChevronRightIcon from '@lucide/svelte/icons/chevron-right';\\n\\timport ChevronsRightIcon from '@lucide/svelte/icons/chevrons-right';\\n\\timport type { Table as TableType } from '@tanstack/table-core';\\n\\n\\tlet { table }: { table: TableType<any> } = $props();\\n</script>\\n\\n<div class=\\\"flex items-center justify-between px-2\\\">\\n\\t<div class=\\\"text-muted-foreground flex-1 text-sm\\\">\\n\\t\\t{table.getFilteredSelectedRowModel().rows.length} of\\n\\t\\t{table.getFilteredRowModel().rows.length} row(s) selected.\\n\\t</div>\\n\\t<div class=\\\"flex items-center space-x-6 lg:space-x-8\\\">\\n\\t\\t<div class=\\\"flex items-center space-x-2\\\">\\n\\t\\t\\t<p class=\\\"text-sm font-medium\\\">Rows per page</p>\\n\\t\\t\\t<Select.Root\\n\\t\\t\\t\\tallowDeselect={false}\\n\\t\\t\\t\\ttype=\\\"single\\\"\\n\\t\\t\\t\\tvalue={`${table.getState().pagination.pageSize}`}\\n\\t\\t\\t\\tonValueChange={(value) => {\\n\\t\\t\\t\\t\\ttable.setPageSize(Number(value));\\n\\t\\t\\t\\t}}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<Select.Trigger class=\\\"h-8 w-[70px]\\\">\\n\\t\\t\\t\\t\\t{String(table.getState().pagination.pageSize)}\\n\\t\\t\\t\\t</Select.Trigger>\\n\\t\\t\\t\\t<Select.Content side=\\\"top\\\">\\n\\t\\t\\t\\t\\t{#each [10, 20, 30, 40, 50] as pageSize (pageSize)}\\n\\t\\t\\t\\t\\t\\t<Select.Item value={`${pageSize}`}>\\n\\t\\t\\t\\t\\t\\t\\t{pageSize}\\n\\t\\t\\t\\t\\t\\t</Select.Item>\\n\\t\\t\\t\\t\\t{/each}\\n\\t\\t\\t\\t</Select.Content>\\n\\t\\t\\t</Select.Root>\\n\\t\\t</div>\\n\\t\\t<div class=\\\"flex w-[100px] items-center justify-center text-sm font-medium\\\">\\n\\t\\t\\tPage {table.getState().pagination.pageIndex + 1} of\\n\\t\\t\\t{table.getPageCount()}\\n\\t\\t</div>\\n\\t\\t<div class=\\\"flex items-center space-x-2\\\">\\n\\t\\t\\t<Button\\n\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\tclass=\\\"hidden size-8 p-0 lg:flex\\\"\\n\\t\\t\\t\\tonclick={() => table.setPageIndex(0)}\\n\\t\\t\\t\\tdisabled={!table.getCanPreviousPage()}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<span class=\\\"sr-only\\\">Go to first page</span>\\n\\t\\t\\t\\t<ChevronsLeftIcon />\\n\\t\\t\\t</Button>\\n\\t\\t\\t<Button\\n\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\tclass=\\\"size-8 p-0\\\"\\n\\t\\t\\t\\tonclick={() => table.previousPage()}\\n\\t\\t\\t\\tdisabled={!table.getCanPreviousPage()}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<span class=\\\"sr-only\\\">Go to previous page</span>\\n\\t\\t\\t\\t<ChevronLeftIcon />\\n\\t\\t\\t</Button>\\n\\t\\t\\t<Button\\n\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\tclass=\\\"size-8 p-0\\\"\\n\\t\\t\\t\\tonclick={() => table.nextPage()}\\n\\t\\t\\t\\tdisabled={!table.getCanNextPage()}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<span class=\\\"sr-only\\\">Go to next page</span>\\n\\t\\t\\t\\t<ChevronRightIcon />\\n\\t\\t\\t</Button>\\n\\t\\t\\t<Button\\n\\t\\t\\t\\tvariant=\\\"outline\\\"\\n\\t\\t\\t\\tclass=\\\"hidden size-8 p-0 lg:flex\\\"\\n\\t\\t\\t\\tonclick={() => table.setPageIndex(table.getPageCount() - 1)}\\n\\t\\t\\t\\tdisabled={!table.getCanNextPage()}\\n\\t\\t\\t>\\n\\t\\t\\t\\t<span class=\\\"sr-only\\\">Go to last page</span>\\n\\t\\t\\t\\t<ChevronsRightIcon />\\n\\t\\t\\t</Button>\\n\\t\\t</div>\\n\\t</div>\\n</div>\\n\"","export default \"export { default as RowActions } from \\\"./row-actions.svelte\\\";\\n\"","export default \"<script lang=\\\"ts\\\">\\n\\timport { goto } from '$app/navigation';\\n\\timport * as DropdownMenu from '$lib/components/ui/dropdown-menu';\\n\\timport { Button } from '$lib/components/ui/button';\\n\\timport EllipsisIcon from '@lucide/svelte/icons/ellipsis';\\n\\n\\tlet {\\n\\t\\tviewPath,\\n\\t\\teditPath,\\n\\t\\tdeletePath\\n\\t}: {\\n\\t\\tviewPath: string;\\n\\t\\teditPath: string;\\n\\t\\tdeletePath: string;\\n\\t} = $props();\\n</script>\\n\\n<DropdownMenu.Root>\\n\\t<DropdownMenu.Trigger>\\n\\t\\t{#snippet child({ props })}\\n\\t\\t\\t<Button {...props} variant=\\\"ghost\\\" class=\\\"data-[state=open]:bg-muted flex h-8 w-8 p-0\\\">\\n\\t\\t\\t\\t<EllipsisIcon />\\n\\t\\t\\t\\t<span class=\\\"sr-only\\\">Open Menu</span>\\n\\t\\t\\t</Button>\\n\\t\\t{/snippet}\\n\\t</DropdownMenu.Trigger>\\n\\t<DropdownMenu.Content class=\\\"w-[160px]\\\" align=\\\"end\\\">\\n\\t\\t<DropdownMenu.Item onclick={() => goto(viewPath)}>View</DropdownMenu.Item>\\n\\t\\t<DropdownMenu.Item onclick={() => goto(editPath)}>Edit</DropdownMenu.Item>\\n\\t\\t<DropdownMenu.Item>\\n\\t\\t\\t<form method=\\\"POST\\\" action={deletePath}>\\n\\t\\t\\t\\t<button type=\\\"submit\\\" class=\\\"contents\\\">Delete</button>\\n\\t\\t\\t</form>\\n\\t\\t</DropdownMenu.Item>\\n\\t</DropdownMenu.Content>\\n</DropdownMenu.Root>\\n\"","import {\n existsSync,\n mkdirSync,\n readFileSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\";\nimport path from \"node:path\";\nimport { detect } from \"package-manager-detector\";\nimport { resolveCommand } from \"package-manager-detector/commands\";\nimport spawn from \"cross-spawn\";\nimport type { Options, Result } from \"../core/types\";\nimport { getLogger, NOOP_LOGGER, type Logger } from \"../core/logger\";\n\ntype PackageManagerOperation = \"execute\" | \"install\";\ntype ExecuteCommand = (\n cwd: string,\n operation: PackageManagerOperation,\n args: string[],\n) => Promise<void>;\n\ninterface WriteResultRuntime {\n executeCommand?: ExecuteCommand;\n}\n\ntype CustomNpmPackages = Record<string, string[]>;\n\nconst customDependencies: Record<string, string[]> = {\n \"file-form\": [\"input\", \"form\"],\n multiselect: [\"command\", \"popover\", \"button\", \"badge\"],\n geopoint: [\"button\", \"leaflet\"],\n cells: [],\n \"column-header\": [\"dropdown-menu\", \"button\"],\n \"faceted-filter\": [\"command\", \"popover\", \"button\", \"separator\", \"badge\"],\n pagination: [\"button\", \"select\"],\n \"row-actions\": [\"dropdown-menu\", \"button\"],\n leaflet: [],\n \"auth-menu\": [\"dropdown-menu\", \"button\"],\n};\n\nconst customNpmPackages: CustomNpmPackages = {\n \"file-form\": [],\n multiselect: [],\n geopoint: [],\n cells: [],\n \"column-header\": [\"@tanstack/table-core\"],\n \"faceted-filter\": [\"@tanstack/table-core\"],\n pagination: [\"@tanstack/table-core\"],\n \"row-actions\": [],\n leaflet: [\"leaflet\", \"@types/leaflet\"],\n};\n\nconst customComponentAssets = import.meta.glob<string>(\"../ui/components/**\", {\n query: \"?raw\",\n import: \"default\",\n eager: true,\n});\n\nfunction getAllCustomComponents() {\n return [\n ...new Set(\n Object.keys(customComponentAssets).map(componentNameFromAssetPath),\n ),\n ]\n .filter(Boolean)\n .sort();\n}\n\nfunction componentNameFromAssetPath(assetPath: string): string {\n const parts = assetPath.split(\"/\");\n const index = parts.indexOf(\"components\");\n return parts[index + 1] ?? \"\";\n}\n\nfunction componentRelativeAssetPath(assetPath: string): string {\n const parts = assetPath.split(\"/\");\n const index = parts.indexOf(\"components\");\n return parts.slice(index + 2).join(\"/\");\n}\n\nfunction toTargetPath(root: string, filePath: string): string {\n if (path.isAbsolute(filePath)) {\n return filePath;\n }\n return path.join(root, filePath);\n}\n\nfunction toRelativePath(root: string, filePath: string): string {\n if (path.isAbsolute(filePath)) {\n return path.relative(root, filePath);\n }\n return filePath;\n}\n\nfunction writeFile(filePath: string, content: string): void {\n mkdirSync(path.dirname(filePath), { recursive: true });\n writeFileSync(filePath, content, \"utf8\");\n}\n\nfunction removeFile(filePath: string): void {\n if (!existsSync(filePath)) {\n return;\n }\n\n rmSync(filePath, { force: true, recursive: true });\n}\n\nasync function executeWithDetectedPackageManager(\n cwd: string,\n operation: PackageManagerOperation,\n args: string[],\n): Promise<void> {\n const packageManager = (await detect({ cwd }))?.name ?? \"npm\";\n const resolved = resolveCommand(packageManager, operation, args);\n if (!resolved) {\n throw new Error(\n `Unable to resolve ${operation} command for ${packageManager}`,\n );\n }\n\n const commandArgs = [...resolved.args];\n if (packageManager === \"npm\") {\n commandArgs.unshift(\"--yes\");\n }\n\n await new Promise<void>((resolve, reject) => {\n const child = spawn(resolved.command, commandArgs, {\n cwd,\n stdio: \"inherit\",\n });\n child.on(\"error\", reject);\n child.on(\"exit\", (code) => {\n if (code === 0) {\n resolve();\n return;\n }\n reject(\n new Error(`${resolved.command} exited with code ${code ?? \"unknown\"}`),\n );\n });\n });\n}\n\nasync function executeCommand(\n cwd: string,\n operation: PackageManagerOperation,\n args: string[],\n runtime?: WriteResultRuntime,\n): Promise<void> {\n if (runtime?.executeCommand) {\n await runtime.executeCommand(cwd, operation, args);\n return;\n }\n\n await executeWithDetectedPackageManager(cwd, operation, args);\n}\n\nfunction installedPackagesFromProject(root: string): Set<string> {\n const packageJsonPath = path.join(root, \"package.json\");\n if (!existsSync(packageJsonPath)) {\n return new Set();\n }\n\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n optionalDependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n };\n\n return new Set([\n ...Object.keys(packageJson.dependencies ?? {}),\n ...Object.keys(packageJson.devDependencies ?? {}),\n ...Object.keys(packageJson.optionalDependencies ?? {}),\n ...Object.keys(packageJson.peerDependencies ?? {}),\n ]);\n}\n\nasync function installPackages(\n root: string,\n packages: string[],\n runtime?: WriteResultRuntime,\n logger: Logger = NOOP_LOGGER,\n): Promise<string[]> {\n if (packages.length === 0) {\n return [];\n }\n\n const installed = installedPackagesFromProject(root);\n const toInstall = [...new Set(packages)].filter((pkg) => !installed.has(pkg));\n if (toInstall.length === 0) {\n return [];\n }\n\n logger.info(`Installing packages: ${toInstall.join(\", \")}`);\n await executeCommand(root, \"install\", toInstall, runtime);\n return toInstall;\n}\n\nfunction isCustomComponent(component: string): boolean {\n return getAllCustomComponents().includes(component);\n}\n\nfunction customNpmPackagesFor(components: string[]): string[] {\n return [\n ...new Set(\n components.flatMap((component) => customNpmPackages[component] ?? []),\n ),\n ];\n}\n\nfunction copyCustomComponent(\n component: string,\n targetComponentsDir: string,\n): void {\n const targetDir = path.join(targetComponentsDir, component);\n mkdirSync(targetDir, { recursive: true });\n\n for (const [assetPath, content] of Object.entries(customComponentAssets)) {\n if (componentNameFromAssetPath(assetPath) !== component) {\n continue;\n }\n const relativePath = componentRelativeAssetPath(assetPath);\n if (!relativePath) {\n continue;\n }\n\n const outputPath = path.join(targetDir, relativePath);\n mkdirSync(path.dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, content, \"utf8\");\n }\n}\n\nasync function installComponents(\n root: string,\n components: string[],\n runtime?: WriteResultRuntime,\n logger: Logger = NOOP_LOGGER,\n): Promise<{ components: string[]; packages: string[] }> {\n if (components.length === 0) {\n return { components: [], packages: [] };\n }\n\n const componentsDir = path.join(root, \"src\", \"lib\", \"components\", \"ui\");\n mkdirSync(componentsDir, { recursive: true });\n\n const requested = [...new Set(components)];\n const missing = requested.filter(\n (component) => !existsSync(path.join(componentsDir, component)),\n );\n\n if (missing.length === 0) {\n return { components: [], packages: [] };\n }\n\n const customToInstall = new Set(missing.filter(isCustomComponent));\n const publicToInstall = new Set(\n missing.filter((component) => !isCustomComponent(component)),\n );\n\n for (const component of [...customToInstall]) {\n for (const dependency of customDependencies[component] ?? []) {\n if (existsSync(path.join(componentsDir, dependency))) {\n continue;\n }\n if (isCustomComponent(dependency)) {\n customToInstall.add(dependency);\n } else {\n publicToInstall.add(dependency);\n }\n }\n }\n\n const installedComponents: string[] = [];\n const customList = [...customToInstall].sort();\n if (customList.length > 0) {\n logger.info(`Installing custom components: ${customList.join(\", \")}`);\n }\n for (const component of customList) {\n copyCustomComponent(component, componentsDir);\n installedComponents.push(component);\n publicToInstall.delete(component);\n }\n\n const customPackages = await installPackages(\n root,\n customNpmPackagesFor([...customToInstall]),\n runtime,\n logger,\n );\n\n const publicList = [...publicToInstall].sort();\n if (publicList.length > 0) {\n logger.info(\n `Installing shadcn-svelte components: ${publicList.join(\", \")}`,\n );\n await executeCommand(\n root,\n \"execute\",\n [\"shadcn-svelte\", \"add\", \"--yes\", \"--overwrite\", ...publicList],\n runtime,\n );\n installedComponents.push(...publicList);\n }\n\n return {\n components: [...new Set(installedComponents)],\n packages: customPackages,\n };\n}\n\nexport async function writeResult(\n result: Result,\n options: Options,\n runtime?: WriteResultRuntime,\n): Promise<Result> {\n const logger = getLogger(options);\n\n const writtenResult: Result = {\n creates: [],\n modifies: [],\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops: [],\n };\n\n let dropMigrationCreates: Result[\"creates\"] = [];\n if (result.collectionDrops.length > 0) {\n const { dropCollections } = await import(\"./collections\");\n dropMigrationCreates = await dropCollections(\n result.collectionDrops,\n options,\n );\n }\n\n const packageInstalls = await installPackages(\n options.root,\n result.packages,\n runtime,\n logger,\n );\n\n const componentInstalls = await installComponents(\n options.root,\n result.components,\n runtime,\n logger,\n );\n\n for (const file of [...result.creates, ...dropMigrationCreates]) {\n if (file.status !== \"success\") continue;\n const target = toTargetPath(options.root, file.path);\n if (!existsSync(target)) {\n writeFile(target, file.content);\n writtenResult.creates.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n continue;\n }\n if (readFileSync(target, \"utf8\") !== file.content) {\n writeFile(target, file.content);\n writtenResult.modifies.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n }\n }\n\n for (const file of result.modifies) {\n if (file.status !== \"success\") continue;\n writeFile(toTargetPath(options.root, file.path), file.content);\n writtenResult.modifies.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n }\n\n for (const file of result.deletes) {\n if (file.status !== \"success\") continue;\n if (existsSync(toTargetPath(options.root, file.path))) {\n removeFile(toTargetPath(options.root, file.path));\n writtenResult.deletes.push({\n ...file,\n path: toRelativePath(options.root, file.path),\n });\n }\n }\n\n return {\n ...result,\n creates: writtenResult.creates,\n modifies: writtenResult.modifies,\n deletes: writtenResult.deletes,\n components: componentInstalls.components,\n packages: [...new Set([...packageInstalls, ...componentInstalls.packages])],\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAA,IAAe,g2BCAf,IAAe,miBCAf,IAAe,g8BCAf,IAAe,mgBCAf,IAAe,scCAf,KAAe,4iBCAf,KAAe,g2CCAf,IAAe,uICAf,IAAe,uaCAf,KAAe,sZCAf,KAAe,gXCAf,KAAe,sZCAf,KAAe,gWCAf,KAAe,gWCAf,KAAe,siDCAf,IAAe,ilBCAf,IAAe,g0BCAf,IAAe,sYCAf,IAAe,gWCAf,IAAe,4VCAf,IAAe,u6BCAf,IAAe,otBCAf,IAAe,gWCAf,IAAe,2fCAf,IAAe,6xDCAf,IAAe,yECAf,IAAe,uoHCAf,IAAe,2ECAf,IAAe,yiCCAf,IAAe,inCCAf,IAAe,khDCAf,IAAe,i1BCAf,IAAe,0/DCAf,IAAe,mTCAf,IAAe,sZCAf,IAAe,+wCCAf,IAAe,kECAf,IAAe,6hDCAf,IAAe,sdCAf,IAAe,8DCAf,IAAe,m2GCAf,IAAe,qVCAf,KAAe,8WCAf,IAAe,sqECAf,KAAe,4UCAf,KAAe,i3BCAf,KAAe,08BCAf,KAAe,+mBCAf,KAAe,oECAf,KAAe,mvFCAf,KAAe,qECAf,KAAe,0mCC2BT,KAA+C;CACnD,aAAa,CAAC,SAAS,OAAO;CAC9B,aAAa;EAAC;EAAW;EAAW;EAAU;EAAQ;CACtD,UAAU,CAAC,UAAU,UAAU;CAC/B,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