lula2 0.7.5-nightly.1 → 0.8.4
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 +2 -2
- package/dist/_app/immutable/chunks/BHkKokgA.js +1 -0
- package/dist/_app/immutable/chunks/{B3K8aJnm.js → BNu54jRO.js} +1 -1
- package/dist/_app/immutable/chunks/{DveOLWfB.js → BzIr_GrC.js} +42 -42
- package/dist/_app/immutable/chunks/CC6oS456.js +1 -0
- package/dist/_app/immutable/chunks/DHuA7MQr.js +1 -0
- package/dist/_app/immutable/chunks/{BOr7AGz1.js → DJTXGU6C.js} +1 -1
- package/dist/_app/immutable/chunks/{C04NlUEE.js → DSxRA67V.js} +1 -1
- package/dist/_app/immutable/chunks/{BTEcqCut.js → DpCtGpHu.js} +1 -1
- package/dist/_app/immutable/chunks/{CYCiyXhX.js → DznG4VMX.js} +2 -2
- package/dist/_app/immutable/chunks/{Dqqytqkj.js → Ew6_cz_0.js} +1 -1
- package/dist/_app/immutable/chunks/{2BRL7VKY.js → kRA7ZCNG.js} +1 -1
- package/dist/_app/immutable/entry/{app.DQYVFQmH.js → app.CpHUD0XU.js} +2 -2
- package/dist/_app/immutable/entry/start.BavDkynd.js +1 -0
- package/dist/_app/immutable/nodes/{0.VqJIWUds.js → 0.D5TULpJI.js} +1 -1
- package/dist/_app/immutable/nodes/1.BBgWG9H0.js +1 -0
- package/dist/_app/immutable/nodes/{2.CwWiKEBj.js → 2.c2WlghKX.js} +1 -1
- package/dist/_app/immutable/nodes/{3.UIV2UOH1.js → 3.hNTFAKFs.js} +1 -1
- package/dist/_app/immutable/nodes/{4.BdgTjqjd.js → 4.C7MOPYAO.js} +1 -1
- package/dist/_app/version.json +1 -1
- package/dist/cli/commands/ui.js +98 -8
- package/dist/cli/server/index.js +98 -8
- package/dist/cli/server/server.js +98 -8
- package/dist/cli/server/serverState.js +40 -6
- package/dist/cli/server/websocketServer.js +1146 -1056
- package/dist/index.html +11 -11
- package/dist/index.js +98 -8
- package/package.json +128 -127
- package/src/lib/components/controls/tabs/MappingsTab.svelte +16 -5
- package/src/lib/websocket.ts +7 -0
- package/dist/_app/immutable/chunks/CvMmkcEK.js +0 -1
- package/dist/_app/immutable/chunks/DlvidjXv.js +0 -1
- package/dist/_app/immutable/chunks/OZt-i3RT.js +0 -1
- package/dist/_app/immutable/entry/start.CRaGL1oc.js +0 -1
- package/dist/_app/immutable/nodes/1.DOuy_I_c.js +0 -1
package/dist/index.html
CHANGED
|
@@ -6,28 +6,28 @@
|
|
|
6
6
|
<link rel="icon" href="/lula.png" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
8
|
|
|
9
|
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
|
10
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
11
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
12
|
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
|
13
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
14
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
15
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
16
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
9
|
+
<link rel="modulepreload" href="/_app/immutable/entry/start.BavDkynd.js">
|
|
10
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/BHkKokgA.js">
|
|
11
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/DHuA7MQr.js">
|
|
12
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.CpHUD0XU.js">
|
|
13
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/DSxRA67V.js">
|
|
14
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/Ew6_cz_0.js">
|
|
15
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/CC6oS456.js">
|
|
16
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/BNu54jRO.js">
|
|
17
17
|
</head>
|
|
18
18
|
<body data-sveltekit-preload-data="hover">
|
|
19
19
|
<div style="display: contents">
|
|
20
20
|
<script>
|
|
21
21
|
{
|
|
22
|
-
|
|
22
|
+
__sveltekit_11w68nn = {
|
|
23
23
|
base: ""
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const element = document.currentScript.parentElement;
|
|
27
27
|
|
|
28
28
|
Promise.all([
|
|
29
|
-
import("/_app/immutable/entry/start.
|
|
30
|
-
import("/_app/immutable/entry/app.
|
|
29
|
+
import("/_app/immutable/entry/start.BavDkynd.js"),
|
|
30
|
+
import("/_app/immutable/entry/app.CpHUD0XU.js")
|
|
31
31
|
]).then(([kit, app]) => {
|
|
32
32
|
kit.start(app, element);
|
|
33
33
|
});
|
package/dist/index.js
CHANGED
|
@@ -1669,6 +1669,7 @@ var fileStore_exports = {};
|
|
|
1669
1669
|
__export(fileStore_exports, {
|
|
1670
1670
|
FileStore: () => FileStore
|
|
1671
1671
|
});
|
|
1672
|
+
import { createHash as createHash2 } from "crypto";
|
|
1672
1673
|
import {
|
|
1673
1674
|
existsSync as existsSync2,
|
|
1674
1675
|
promises as fs,
|
|
@@ -1681,7 +1682,6 @@ import {
|
|
|
1681
1682
|
} from "fs";
|
|
1682
1683
|
import * as yaml2 from "js-yaml";
|
|
1683
1684
|
import { join as join2 } from "path";
|
|
1684
|
-
import { createHash as createHash2 } from "crypto";
|
|
1685
1685
|
var FileStore;
|
|
1686
1686
|
var init_fileStore = __esm({
|
|
1687
1687
|
"cli/server/infrastructure/fileStore.ts"() {
|
|
@@ -1701,6 +1701,40 @@ var init_fileStore = __esm({
|
|
|
1701
1701
|
this.refreshControlsCache();
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
|
+
/**
|
|
1705
|
+
* Update a single mapping in place, preserving file order
|
|
1706
|
+
*/
|
|
1707
|
+
async updateMapping(oldCompositeKey, updatedMapping) {
|
|
1708
|
+
const mappingFiles = this.getAllMappingFiles();
|
|
1709
|
+
for (const file of mappingFiles) {
|
|
1710
|
+
try {
|
|
1711
|
+
const content = readFileSync2(file, "utf8");
|
|
1712
|
+
let mappings = yaml2.load(content) || [];
|
|
1713
|
+
let changed = false;
|
|
1714
|
+
mappings = mappings.map((m) => {
|
|
1715
|
+
const hash = createHash2("sha256").update(JSON.stringify(m)).digest("hex");
|
|
1716
|
+
if (`${m.control_id}:${hash}` === oldCompositeKey) {
|
|
1717
|
+
const clean = { ...updatedMapping };
|
|
1718
|
+
delete clean.hash;
|
|
1719
|
+
changed = true;
|
|
1720
|
+
return clean;
|
|
1721
|
+
}
|
|
1722
|
+
return m;
|
|
1723
|
+
});
|
|
1724
|
+
if (changed) {
|
|
1725
|
+
const yamlContent = yaml2.dump(mappings, {
|
|
1726
|
+
indent: 2,
|
|
1727
|
+
lineWidth: -1,
|
|
1728
|
+
noRefs: true
|
|
1729
|
+
});
|
|
1730
|
+
writeFileSync(file, yamlContent, "utf8");
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
} catch (error) {
|
|
1734
|
+
console.error(`Error processing mapping file ${file}:`, error);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1704
1738
|
/**
|
|
1705
1739
|
* Get simple filename from control ID
|
|
1706
1740
|
*/
|
|
@@ -1723,8 +1757,8 @@ var init_fileStore = __esm({
|
|
|
1723
1757
|
if (!this.baseDir || this.baseDir === "." || this.baseDir === process.cwd()) {
|
|
1724
1758
|
return;
|
|
1725
1759
|
}
|
|
1726
|
-
const
|
|
1727
|
-
if (!existsSync2(
|
|
1760
|
+
const lulaConfigPath = join2(this.baseDir, "lula.yaml");
|
|
1761
|
+
if (!existsSync2(lulaConfigPath)) {
|
|
1728
1762
|
return;
|
|
1729
1763
|
}
|
|
1730
1764
|
if (!existsSync2(this.controlsDir)) {
|
|
@@ -1883,10 +1917,10 @@ var init_fileStore = __esm({
|
|
|
1883
1917
|
return [];
|
|
1884
1918
|
}
|
|
1885
1919
|
let controlOrder = null;
|
|
1920
|
+
const lulaConfigPath = join2(this.baseDir, "lula.yaml");
|
|
1886
1921
|
try {
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
const content = readFileSync2(lulaConfigPath2, "utf8");
|
|
1922
|
+
if (existsSync2(lulaConfigPath)) {
|
|
1923
|
+
const content = readFileSync2(lulaConfigPath, "utf8");
|
|
1890
1924
|
const metadata = yaml2.load(content);
|
|
1891
1925
|
controlOrder = metadata?.controlOrder || null;
|
|
1892
1926
|
}
|
|
@@ -5143,12 +5177,12 @@ import { fileURLToPath } from "url";
|
|
|
5143
5177
|
import { readFileSync as readFileSync4 } from "fs";
|
|
5144
5178
|
init_debug();
|
|
5145
5179
|
init_controlHelpers();
|
|
5146
|
-
init_serverState();
|
|
5147
5180
|
init_gitHistory();
|
|
5181
|
+
init_serverState();
|
|
5148
5182
|
import * as yaml5 from "js-yaml";
|
|
5183
|
+
import crypto2 from "node:crypto";
|
|
5149
5184
|
import { join as join5 } from "path";
|
|
5150
5185
|
import { WebSocket, WebSocketServer } from "ws";
|
|
5151
|
-
import crypto2 from "node:crypto";
|
|
5152
5186
|
var WebSocketManager = class {
|
|
5153
5187
|
wss = null;
|
|
5154
5188
|
clients = /* @__PURE__ */ new Set();
|
|
@@ -5189,6 +5223,62 @@ var WebSocketManager = class {
|
|
|
5189
5223
|
}
|
|
5190
5224
|
break;
|
|
5191
5225
|
}
|
|
5226
|
+
case "update-mapping": {
|
|
5227
|
+
const state = getServerState();
|
|
5228
|
+
if (payload && payload.old_composite_key && payload.mapping) {
|
|
5229
|
+
const oldCompositeKey = payload.old_composite_key;
|
|
5230
|
+
const existing = state.mappingsCache.get(oldCompositeKey);
|
|
5231
|
+
if (!existing) {
|
|
5232
|
+
console.error("Mapping not found for update:", oldCompositeKey);
|
|
5233
|
+
break;
|
|
5234
|
+
}
|
|
5235
|
+
const incoming = payload.mapping;
|
|
5236
|
+
const updated = {
|
|
5237
|
+
...existing,
|
|
5238
|
+
...incoming,
|
|
5239
|
+
control_id: incoming.control_id || existing.control_id,
|
|
5240
|
+
uuid: incoming.uuid || existing.uuid
|
|
5241
|
+
};
|
|
5242
|
+
if (!updated.hash || updated.hash === "") {
|
|
5243
|
+
updated.hash = crypto2.createHash("sha256").update(JSON.stringify({ ...updated, hash: void 0 })).digest("hex");
|
|
5244
|
+
}
|
|
5245
|
+
const oldHash = existing.hash;
|
|
5246
|
+
const oldControlId = existing.control_id;
|
|
5247
|
+
const oldFamily = oldControlId.split("-")[0];
|
|
5248
|
+
const newHash = updated.hash;
|
|
5249
|
+
const newControlId = updated.control_id;
|
|
5250
|
+
const newFamily = newControlId.split("-")[0];
|
|
5251
|
+
const newCompositeKey = `${newControlId}:${newHash}`;
|
|
5252
|
+
await state.fileStore.updateMapping(oldCompositeKey, updated);
|
|
5253
|
+
const entries = Array.from(state.mappingsCache.entries());
|
|
5254
|
+
const oldIndex = entries.findIndex(([key]) => key === oldCompositeKey);
|
|
5255
|
+
if (oldIndex === -1) {
|
|
5256
|
+
state.mappingsCache.delete(oldCompositeKey);
|
|
5257
|
+
state.mappingsCache.set(newCompositeKey, updated);
|
|
5258
|
+
} else {
|
|
5259
|
+
entries[oldIndex] = [newCompositeKey, updated];
|
|
5260
|
+
state.mappingsCache = new Map(entries);
|
|
5261
|
+
}
|
|
5262
|
+
state.mappingsByFamily.get(oldFamily)?.delete(oldHash);
|
|
5263
|
+
state.mappingsByControl.get(oldControlId)?.delete(oldHash);
|
|
5264
|
+
if (!state.mappingsByFamily.has(newFamily)) {
|
|
5265
|
+
state.mappingsByFamily.set(newFamily, /* @__PURE__ */ new Set());
|
|
5266
|
+
}
|
|
5267
|
+
state.mappingsByFamily.get(newFamily).add(newHash);
|
|
5268
|
+
if (!state.mappingsByControl.has(newControlId)) {
|
|
5269
|
+
state.mappingsByControl.set(newControlId, /* @__PURE__ */ new Set());
|
|
5270
|
+
}
|
|
5271
|
+
state.mappingsByControl.get(newControlId).add(newHash);
|
|
5272
|
+
ws.send(
|
|
5273
|
+
JSON.stringify({
|
|
5274
|
+
type: "mapping-updated",
|
|
5275
|
+
payload: { uuid: updated.uuid, success: true }
|
|
5276
|
+
})
|
|
5277
|
+
);
|
|
5278
|
+
this.broadcastState();
|
|
5279
|
+
}
|
|
5280
|
+
break;
|
|
5281
|
+
}
|
|
5192
5282
|
case "refresh-controls": {
|
|
5193
5283
|
const state = getServerState();
|
|
5194
5284
|
state.controlsCache.clear();
|
package/package.json
CHANGED
|
@@ -1,128 +1,129 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
2
|
+
"name": "lula2",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "A tool for managing compliance as code in your GitHub repositories.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"lula2": "./dist/lula2"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=22.20.0"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/defenseunicorns/lula.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"compliance",
|
|
20
|
+
"devops",
|
|
21
|
+
"devsecops"
|
|
22
|
+
],
|
|
23
|
+
"author": "Defense Unicorns",
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/defenseunicorns/lula/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/defenseunicorns/lula#readme",
|
|
29
|
+
"files": [
|
|
30
|
+
"/src",
|
|
31
|
+
"/dist",
|
|
32
|
+
"!src/**/*.test.ts",
|
|
33
|
+
"!dist/**/*.test.js*",
|
|
34
|
+
"!dist/**/*.test.d.ts*"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite dev --port 5173",
|
|
38
|
+
"dev:api": "tsx --watch index.ts --debug ui --port 3000 --no-open-browser",
|
|
39
|
+
"dev:full": "concurrently \"npm run dev:api\" \"npm run dev\"",
|
|
40
|
+
"build": "npm run build:svelte && npm run build:cli && npm run postbuild:cli",
|
|
41
|
+
"build:svelte": "vite build",
|
|
42
|
+
"build:cli": "esbuild index.ts cli/**/*.ts --bundle --platform=node --target=node22 --format=esm --outdir=dist --external:express --external:commander --external:js-yaml --external:yaml --external:isomorphic-git --external:glob --external:open --external:ws --external:cors --external:multer --external:@octokit/rest --external:undici --external:xlsx-republish --external:csv-parse",
|
|
43
|
+
"postbuild:cli": "cp cli-wrapper.mjs dist/lula2 && chmod +x dist/lula2",
|
|
44
|
+
"preview": "vite preview",
|
|
45
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
46
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && tsc --noEmit",
|
|
47
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
48
|
+
"format": "prettier --write 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
|
|
49
|
+
"format:check": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
|
|
50
|
+
"lint": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts' && eslint src cli",
|
|
51
|
+
"test": "npm run test:unit -- --run --coverage",
|
|
52
|
+
"test:integration": "vitest --config integration/vitest.config.integration.ts",
|
|
53
|
+
"test:unit": "vitest"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@octokit/rest": "22.0.1",
|
|
57
|
+
"@types/ws": "8.18.1",
|
|
58
|
+
"commander": "14.0.2",
|
|
59
|
+
"cors": "2.8.5",
|
|
60
|
+
"csv-parse": "6.1.0",
|
|
61
|
+
"express": "5.2.1",
|
|
62
|
+
"express-rate-limit": "8.2.1",
|
|
63
|
+
"flowbite": "4.0.1",
|
|
64
|
+
"glob": "13.0.0",
|
|
65
|
+
"isomorphic-git": "1.36.0",
|
|
66
|
+
"js-yaml": "4.1.1",
|
|
67
|
+
"multer": "2.0.2",
|
|
68
|
+
"open": "11.0.0",
|
|
69
|
+
"undici": "7.16.0",
|
|
70
|
+
"ws": "8.18.3",
|
|
71
|
+
"xlsx-republish": "0.20.3",
|
|
72
|
+
"yaml": "2.8.2"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@commitlint/cli": "^20.0.0",
|
|
76
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
77
|
+
"@defenseunicorns/eslint-config": "^1.1.2",
|
|
78
|
+
"@eslint/compat": "^2.0.0",
|
|
79
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
80
|
+
"@eslint/js": "^9.35.0",
|
|
81
|
+
"@playwright/test": "^1.55.0",
|
|
82
|
+
"@sveltejs/adapter-static": "^3.0.9",
|
|
83
|
+
"@sveltejs/kit": "^2.37.1",
|
|
84
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.4",
|
|
85
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
86
|
+
"@types/cors": "^2.8.19",
|
|
87
|
+
"@types/express": "^5.0.3",
|
|
88
|
+
"@types/js-yaml": "^4.0.9",
|
|
89
|
+
"@types/jsdom": "^27.0.0",
|
|
90
|
+
"@types/multer": "^2.0.0",
|
|
91
|
+
"@types/node": "^25.0.0",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
93
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
94
|
+
"@vitest/browser": "^4.0.1",
|
|
95
|
+
"@vitest/coverage-v8": "^4.0.1",
|
|
96
|
+
"carbon-icons-svelte": "^13.5.0",
|
|
97
|
+
"carbon-preprocess-svelte": "^0.11.11",
|
|
98
|
+
"concurrently": "^9.2.1",
|
|
99
|
+
"esbuild": "^0.27.0",
|
|
100
|
+
"eslint": "^9.35.0",
|
|
101
|
+
"eslint-config-prettier": "^10.1.8",
|
|
102
|
+
"eslint-plugin-jsdoc": "^61.0.0",
|
|
103
|
+
"eslint-plugin-svelte": "^3.12.2",
|
|
104
|
+
"globals": "^16.3.0",
|
|
105
|
+
"husky": "^9.1.7",
|
|
106
|
+
"jsdom": "^27.0.0",
|
|
107
|
+
"playwright": "^1.55.0",
|
|
108
|
+
"prettier": "3.7.4",
|
|
109
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
110
|
+
"semantic-release": "^25.0.1",
|
|
111
|
+
"shellcheck": "^4.1.0",
|
|
112
|
+
"svelte": "^5.38.7",
|
|
113
|
+
"svelte-check": "^4.3.1",
|
|
114
|
+
"tailwind-merge": "^3.3.1",
|
|
115
|
+
"tailwindcss": "^4.1.13",
|
|
116
|
+
"tsx": "^4.20.5",
|
|
117
|
+
"typescript": "5.9.3",
|
|
118
|
+
"typescript-eslint": "^8.42.0",
|
|
119
|
+
"vite": "^7.1.4",
|
|
120
|
+
"vitest": "^4.0.1",
|
|
121
|
+
"vitest-browser-svelte": "^2.0.0"
|
|
122
|
+
},
|
|
123
|
+
"release": {
|
|
124
|
+
"branches": [
|
|
125
|
+
"main",
|
|
126
|
+
"next"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -96,16 +96,27 @@
|
|
|
96
96
|
uuid: data.uuid || editingMapping.uuid, // Use form UUID or fallback to original
|
|
97
97
|
justification: data.justification,
|
|
98
98
|
status: data.status,
|
|
99
|
-
source_entries: data.source_entries
|
|
99
|
+
source_entries: data.source_entries
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
if(data.cci !== undefined) {
|
|
103
104
|
updatedMapping.cci = data.cci;
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
|
|
107
|
+
// Compute new hash for the updated mapping on the backend
|
|
108
|
+
const hashResponse = await fetch('/hash', {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
headers: {
|
|
111
|
+
'Content-Type': 'application/json'
|
|
112
|
+
},
|
|
113
|
+
body: JSON.stringify({ ...updatedMapping, hash: '' })
|
|
114
|
+
});
|
|
115
|
+
const hashData = await hashResponse.json();
|
|
116
|
+
updatedMapping.hash = hashData.hash;
|
|
117
|
+
|
|
118
|
+
const oldCompositeKey = `${editingMapping.control_id}:${editingMapping.hash!}`;
|
|
119
|
+
await wsClient.updateMapping(oldCompositeKey, updatedMapping);
|
|
109
120
|
|
|
110
121
|
resetMappingForm();
|
|
111
122
|
} catch (error) {
|
package/src/lib/websocket.ts
CHANGED
|
@@ -355,6 +355,13 @@ class WebSocketClient {
|
|
|
355
355
|
return this.sendCommand('create-mapping', mapping);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
+
async updateMapping(oldCompositeKey: string, mapping: Mapping) {
|
|
359
|
+
return this.sendCommand('update-mapping', {
|
|
360
|
+
old_composite_key: oldCompositeKey,
|
|
361
|
+
mapping
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
358
365
|
async deleteMapping(composite_key: string) {
|
|
359
366
|
return this.sendCommand('delete-mapping', { composite_key });
|
|
360
367
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,k as c,l as m,E as i}from"./DlvidjXv.js";import{B as p}from"./Dqqytqkj.js";function l(n,r,o){s&&c();var e=new p(n);m(()=>{var a=r()??null;e.ensure(a,a&&(t=>o(t,a)))},i)}export{l as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ct=Array.isArray,Zt=Array.prototype.indexOf,Un=Array.from,Vn=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyDescriptors,Jt=Object.prototype,Qt=Array.prototype,_t=Object.getPrototypeOf,st=Object.isExtensible;function $n(e){return typeof e=="function"}const le=()=>{};function Gn(e){return e()}function vt(e){for(var t=0;t<e.length;t++)e[t]()}function dt(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function Kn(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const E=2,$e=4,Ce=8,ht=1<<24,j=16,q=32,se=64,Ge=128,D=512,m=1024,k=2048,C=4096,P=8192,H=16384,Ke=32768,Te=65536,qe=1<<17,pt=1<<18,be=1<<19,yt=1<<20,zn=1<<25,te=32768,Ye=1<<21,ze=1<<22,B=1<<23,J=Symbol("$state"),Xn=Symbol("legacy props"),Zn=Symbol(""),ae=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Xe=3,wt=8;function en(e){throw new Error("https://svelte.dev/e/experimental_async_required")}function Ze(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function tn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function nn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function rn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function sn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function fn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function an(){throw new Error("https://svelte.dev/e/fork_discarded")}function ln(){throw new Error("https://svelte.dev/e/fork_timing")}function Jn(){throw new Error("https://svelte.dev/e/hydration_failed")}function Qn(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function un(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function on(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function cn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function er(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const tr=1,nr=2,rr=4,sr=8,fr=16,ir=1,ar=2,lr=4,ur=8,or=16,cr=4,_r=1,vr=2,_n="[",vn="[!",dn="]",We={},g=Symbol(),dr="http://www.w3.org/1999/xhtml",hr="@attach";function Je(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function pr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function yr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let V=!1;function wr(e){V=e}let S;function ue(e){if(e===null)throw Je(),We;return S=e}function br(){return ue(K(S))}function Er(e){if(V){if(K(S)!==null)throw Je(),We;S=e}}function mr(e=1){if(V){for(var t=e,n=S;t--;)n=K(n);S=n}}function gr(e=!0){for(var t=0,n=S;;){if(n.nodeType===wt){var r=n.data;if(r===dn){if(t===0)return n;t-=1}else(r===_n||r===vn)&&(t+=1)}var s=K(n);e&&n.remove(),n=s}}function Tr(e){if(!e||e.nodeType!==wt)throw Je(),We;return e.data}function bt(e){return e===this.v}function Et(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function mt(e){return!Et(e,this.v)}let Ee=!1;function Ar(){Ee=!0}let y=null;function Ae(e){y=e}function kr(e,t=!1,n){y={p:y,i:!1,c:null,e:null,s:e,x:null,l:Ee&&!t?{s:null,u:null,$:[]}:null}}function xr(e){var t=y,n=t.e;if(n!==null){t.e=null;for(var r of n)Ft(r)}return t.i=!0,y=t.p,{}}function me(){return!Ee||y!==null&&y.l===null}let X=[];function gt(){var e=X;X=[],vt(e)}function Tt(e){if(X.length===0&&!ye){var t=X;queueMicrotask(()=>{t===X&>()})}X.push(e)}function hn(){for(;X.length>0;)gt()}function pn(e){var t=h;if(t===null)return v.f|=B,e;if((t.f&Ke)===0){if((t.f&Ge)===0)throw e;t.b.error(e)}else ke(e,t)}function ke(e,t){for(;t!==null;){if((t.f&Ge)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const Z=new Set;let p=null,Le=null,A=null,O=[],Fe=null,He=!1,ye=!1;class ${committed=!1;current=new Map;previous=new Map;#r=new Set;#s=new Set;#t=0;#n=0;#a=null;#f=[];#i=[];skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#n>0}process(t){O=[],Le=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const r of t)this.#l(r,n);this.is_fork||this.#o(),this.is_deferred()?(this.#e(n.effects),this.#e(n.render_effects),this.#e(n.block_effects)):(Le=this,p=null,ft(n.render_effects),ft(n.effects),Le=null,this.#a?.resolve()),A=null}#l(t,n){t.f^=m;for(var r=t.first;r!==null;){var s=r.f,f=(s&(q|se))!==0,u=f&&(s&m)!==0,l=u||(s&P)!==0||this.skipped_effects.has(r);if((r.f&Ge)!==0&&r.b?.is_pending()&&(n={parent:n,effect:r,effects:[],render_effects:[],block_effects:[]}),!l&&r.fn!==null){f?r.f^=m:(s&$e)!==0?n.effects.push(r):ve(r)&&((r.f&j)!==0&&n.block_effects.push(r),ce(r));var a=r.first;if(a!==null){r=a;continue}}var i=r.parent;for(r=r.next;r===null&&i!==null;)i===n.effect&&(this.#e(n.effects),this.#e(n.render_effects),this.#e(n.block_effects),n=n.parent),r=i.next,i=i.parent}}#e(t){for(const n of t)((n.f&k)!==0?this.#f:this.#i).push(n),this.#u(n.deps),b(n,m)}#u(t){if(t!==null)for(const n of t)(n.f&E)===0||(n.f&te)===0||(n.f^=te,this.#u(n.deps))}capture(t,n){this.previous.has(t)||this.previous.set(t,n),(t.f&B)===0&&(this.current.set(t,t.v),A?.set(t,t.v))}activate(){p=this,this.apply()}deactivate(){p===this&&(p=null,A=null)}flush(){if(this.activate(),O.length>0){if(Ue(),p!==null&&p!==this)return}else this.#t===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#s)t(this);this.#s.clear()}#o(){if(this.#n===0){for(const t of this.#r)t();this.#r.clear()}this.#t===0&&this.#c()}#c(){if(Z.size>1){this.previous.clear();var t=A,n=!0,r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const f of Z){if(f===this){n=!1;continue}const u=[];for(const[a,i]of this.current){if(f.current.has(a))if(n&&i!==f.current.get(a))f.current.set(a,i);else continue;u.push(a)}if(u.length===0)continue;const l=[...f.current.keys()].filter(a=>!this.current.has(a));if(l.length>0){var s=O;O=[];const a=new Set,i=new Map;for(const o of u)At(o,l,a,i);if(O.length>0){p=f,f.apply();for(const o of O)f.#l(o,r);f.deactivate()}O=s}}p=null,A=t}this.committed=!0,Z.delete(this)}increment(t){this.#t+=1,t&&(this.#n+=1)}decrement(t){this.#t-=1,t&&(this.#n-=1),this.revive()}revive(){for(const t of this.#f)b(t,k),ne(t);for(const t of this.#i)b(t,C),ne(t);this.#f=[],this.#i=[],this.flush()}oncommit(t){this.#r.add(t)}ondiscard(t){this.#s.add(t)}settled(){return(this.#a??=dt()).promise}static ensure(){if(p===null){const t=p=new $;Z.add(p),ye||$.enqueue(()=>{p===t&&t.flush()})}return p}static enqueue(t){Tt(t)}apply(){}}function Be(e){var t=ye;ye=!0;try{var n;for(e&&(p!==null&&Ue(),n=e());;){if(hn(),O.length===0&&(p?.flush(),O.length===0))return Fe=null,n;Ue()}}finally{ye=t}}function Ue(){var e=Q;He=!0;var t=null;try{var n=0;for(Ie(!0);O.length>0;){var r=$.ensure();if(n++>1e3){var s,f;yn()}r.process(O),U.clear()}}finally{He=!1,Ie(e),Fe=null}}function yn(){try{fn()}catch(e){ke(e,Fe)}}let F=null;function ft(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(H|P))===0&&ve(r)&&(F=new Set,ce(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?qt(r):r.fn=null),F?.size>0)){U.clear();for(const s of F){if((s.f&(H|P))!==0)continue;const f=[s];let u=s.parent;for(;u!==null;)F.has(u)&&(F.delete(u),f.push(u)),u=u.parent;for(let l=f.length-1;l>=0;l--){const a=f[l];(a.f&(H|P))===0&&ce(a)}}F.clear()}}F=null}}function At(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&E)!==0?At(s,t,n,r):(f&(ze|j))!==0&&(f&k)===0&&xt(s,t,r)&&(b(s,k),ne(s))}}function kt(e,t){if(e.reactions!==null)for(const n of e.reactions){const r=n.f;(r&E)!==0?kt(n,t):(r&qe)!==0&&(b(n,k),t.add(n))}}function xt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(t.includes(s))return!0;if((s.f&E)!==0&&xt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function ne(e){for(var t=Fe=e;t.parent!==null;){t=t.parent;var n=t.f;if(He&&t===h&&(n&j)!==0&&(n&pt)===0)return;if((n&(se|q))!==0){if((n&m)===0)return;t.f^=m}}O.push(t)}function Sr(e){en(),p!==null&&ln();var t=$.ensure();t.is_fork=!0,A=new Map;var n=!1,r=t.settled();Be(e),A=null;for(var[s,f]of t.previous)s.v=f;return{commit:async()=>{if(n){await r;return}Z.has(t)||an(),n=!0,t.is_fork=!1;for(var[u,l]of t.current)u.v=l;Be(()=>{var a=new Set;for(var i of t.current.keys())kt(i,a);Tn(a),Dt()}),t.revive(),await r},discard:()=>{!n&&Z.has(t)&&(Z.delete(t),t.discard())}}}function wn(e,t,n,r){const s=me()?Qe:mn;if(n.length===0&&e.length===0){r(t.map(s));return}var f=p,u=h,l=bn();function a(){Promise.all(n.map(i=>En(i))).then(i=>{l();try{r([...t.map(s),...i])}catch(o){(u.f&H)===0&&ke(o,u)}f?.deactivate(),xe()}).catch(i=>{ke(i,u)})}e.length>0?Promise.all(e).then(()=>{l();try{return a()}finally{f?.deactivate(),xe()}}):a()}function bn(){var e=h,t=v,n=y,r=p;return function(f=!0){oe(e),G(t),Ae(n),f&&r?.activate()}}function xe(){oe(null),G(null),Ae(null)}function Qe(e){var t=E|k,n=v!==null&&(v.f&E)!==0?v:null;return h!==null&&(h.f|=be),{ctx:y,deps:null,effects:null,equals:bt,f:t,fn:e,reactions:null,rv:0,v:g,wv:0,parent:n??h,ac:null}}function En(e,t){let n=h;n===null&&tn();var r=n.b,s=void 0,f=tt(g),u=!v,l=new Map;return Dn(()=>{var a=dt();s=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).then(()=>{i===p&&i.committed&&i.deactivate(),xe()})}catch(c){a.reject(c),xe()}var i=p;if(u){var o=!r.is_pending();r.update_pending_count(1),i.increment(o),l.get(i)?.reject(ae),l.delete(i),l.set(i,a)}const _=(c,d=void 0)=>{if(i.activate(),d)d!==ae&&(f.f|=B,Re(f,d));else{(f.f&B)!==0&&(f.f^=B),Re(f,c);for(const[w,z]of l){if(l.delete(w),w===i)break;z.reject(ae)}}u&&(r.update_pending_count(-1),i.decrement(o))};a.promise.then(_,c=>_(null,c||"unknown"))}),Rn(()=>{for(const a of l.values())a.reject(ae)}),new Promise(a=>{function i(o){function _(){o===s?a(f):i(s)}o.then(_,_)}i(s)})}function Rr(e){const t=Qe(e);return Bt(t),t}function mn(e){const t=Qe(e);return t.equals=mt,t}function St(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)re(t[n])}}function gn(e){for(var t=e.parent;t!==null;){if((t.f&E)===0)return(t.f&H)===0?t:null;t=t.parent}return null}function et(e){var t,n=h;oe(gn(e));try{e.f&=~te,St(e),t=Gt(e)}finally{oe(n)}return t}function Rt(e){var t=et(e);if(e.equals(t)||(p?.is_fork||(e.v=t),e.wv=Vt()),!_e)if(A!==null)(Ne()||p?.is_fork)&&A.set(e,t);else{var n=(e.f&D)===0?C:m;b(e,n)}}let Se=new Set;const U=new Map;function Tn(e){Se=e}let Ot=!1;function tt(e,t){var n={f:0,v:e,reactions:null,equals:bt,rv:0,wv:0};return n}function Y(e,t){const n=tt(e);return Bt(n),n}function Or(e,t=!1,n=!0){const r=tt(e);return t||(r.equals=mt),Ee&&n&&y!==null&&y.l!==null&&(y.l.s??=[]).push(r),r}function Dr(e,t){return M(e,de(()=>W(e))),t}function M(e,t,n=!1){v!==null&&(!I||(v.f&qe)!==0)&&me()&&(v.f&(E|j|ze|qe))!==0&&!L?.includes(e)&&cn();let r=n?he(t):t;return Re(e,r)}function Re(e,t){if(!e.equals(t)){var n=e.v;_e?U.set(e,t):U.set(e,n),e.v=t;var r=$.ensure();r.capture(e,n),(e.f&E)!==0&&((e.f&k)!==0&&et(e),b(e,(e.f&D)!==0?m:C)),e.wv=Vt(),Nt(e,k),me()&&h!==null&&(h.f&m)!==0&&(h.f&(q|se))===0&&(R===null?Fn([e]):R.push(e)),!r.is_fork&&Se.size>0&&!Ot&&Dt()}return t}function Dt(){Ot=!1;var e=Q;Ie(!0);const t=Array.from(Se);try{for(const n of t)(n.f&m)!==0&&b(n,C),ve(n)&&ce(n)}finally{Ie(e)}Se.clear()}function Nr(e,t=1){var n=W(e),r=t===1?n++:n--;return M(e,n),r}function je(e){M(e,e.v+1)}function Nt(e,t){var n=e.reactions;if(n!==null)for(var r=me(),s=n.length,f=0;f<s;f++){var u=n[f],l=u.f;if(!(!r&&u===h)){var a=(l&k)===0;if(a&&b(u,t),(l&E)!==0){var i=u;A?.delete(i),(l&te)===0&&(l&D&&(u.f|=te),Nt(i,C))}else a&&((l&j)!==0&&F!==null&&F.add(u),ne(u))}}}function he(e){if(typeof e!="object"||e===null||J in e)return e;const t=_t(e);if(t!==Jt&&t!==Qt)return e;var n=new Map,r=ct(e),s=Y(0),f=ee,u=l=>{if(ee===f)return l();var a=v,i=ee;G(null),ot(f);var o=l();return G(a),ot(i),o};return r&&n.set("length",Y(e.length)),new Proxy(e,{defineProperty(l,a,i){(!("value"in i)||i.configurable===!1||i.enumerable===!1||i.writable===!1)&&un();var o=n.get(a);return o===void 0?o=u(()=>{var _=Y(i.value);return n.set(a,_),_}):M(o,i.value,!0),!0},deleteProperty(l,a){var i=n.get(a);if(i===void 0){if(a in l){const o=u(()=>Y(g));n.set(a,o),je(s)}}else M(i,g),je(s);return!0},get(l,a,i){if(a===J)return e;var o=n.get(a),_=a in l;if(o===void 0&&(!_||pe(l,a)?.writable)&&(o=u(()=>{var d=he(_?l[a]:g),w=Y(d);return w}),n.set(a,o)),o!==void 0){var c=W(o);return c===g?void 0:c}return Reflect.get(l,a,i)},getOwnPropertyDescriptor(l,a){var i=Reflect.getOwnPropertyDescriptor(l,a);if(i&&"value"in i){var o=n.get(a);o&&(i.value=W(o))}else if(i===void 0){var _=n.get(a),c=_?.v;if(_!==void 0&&c!==g)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return i},has(l,a){if(a===J)return!0;var i=n.get(a),o=i!==void 0&&i.v!==g||Reflect.has(l,a);if(i!==void 0||h!==null&&(!o||pe(l,a)?.writable)){i===void 0&&(i=u(()=>{var c=o?he(l[a]):g,d=Y(c);return d}),n.set(a,i));var _=W(i);if(_===g)return!1}return o},set(l,a,i,o){var _=n.get(a),c=a in l;if(r&&a==="length")for(var d=i;d<_.v;d+=1){var w=n.get(d+"");w!==void 0?M(w,g):d in l&&(w=u(()=>Y(g)),n.set(d+"",w))}if(_===void 0)(!c||pe(l,a)?.writable)&&(_=u(()=>Y(void 0)),M(_,he(i)),n.set(a,_));else{c=_.v!==g;var z=u(()=>he(i));M(_,z)}var ge=Reflect.getOwnPropertyDescriptor(l,a);if(ge?.set&&ge.set.call(o,i),!c){if(r&&typeof a=="string"){var rt=n.get("length"),Me=Number(a);Number.isInteger(Me)&&Me>=rt.v&&M(rt,Me+1)}je(s)}return!0},ownKeys(l){W(s);var a=Reflect.ownKeys(l).filter(_=>{var c=n.get(_);return c===void 0||c.v!==g});for(var[i,o]of n)o.v!==g&&!(i in l)&&a.push(i);return a},setPrototypeOf(){on()}})}function it(e){try{if(e!==null&&typeof e=="object"&&J in e)return e[J]}catch{}return e}function Ir(e,t){return Object.is(it(e),it(t))}var at,An,It,Pt;function Pr(){if(at===void 0){at=window,An=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;It=pe(t,"firstChild").get,Pt=pe(t,"nextSibling").get,st(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),st(n)&&(n.__t=void 0)}}function Oe(e=""){return document.createTextNode(e)}function De(e){return It.call(e)}function K(e){return Pt.call(e)}function Cr(e,t){if(!V)return De(e);var n=De(S);if(n===null)n=S.appendChild(Oe());else if(t&&n.nodeType!==Xe){var r=Oe();return n?.before(r),ue(r),r}return ue(n),n}function Fr(e,t=!1){if(!V){var n=De(e);return n instanceof Comment&&n.data===""?K(n):n}if(t&&S?.nodeType!==Xe){var r=Oe();return S?.before(r),ue(r),r}return S}function Mr(e,t=1,n=!1){let r=V?S:e;for(var s;t--;)s=r,r=K(r);if(!V)return r;if(n&&r?.nodeType!==Xe){var f=Oe();return r===null?s?.after(f):r.before(f),ue(f),f}return ue(r),r}function kn(e){e.textContent=""}function Lr(){return!1}function jr(e,t){if(t){const n=document.body;e.autofocus=!0,Tt(()=>{document.activeElement===n&&e.focus()})}}function qr(e){V&&De(e)!==null&&kn(e)}let lt=!1;function xn(){lt||(lt=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function nt(e){var t=v,n=h;G(null),oe(null);try{return e()}finally{G(t),oe(n)}}function Yr(e,t,n,r=n){e.addEventListener(t,()=>nt(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),xn()}function Ct(e){h===null&&(v===null&&sn(),rn()),_e&&nn()}function Sn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function N(e,t,n){var r=h;r!==null&&(r.f&P)!==0&&(e|=P);var s={ctx:y,deps:null,nodes:null,f:e|k|D,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{ce(s),s.f|=Ke}catch(l){throw re(s),l}else t!==null&&ne(s);var f=s;if(n&&f.deps===null&&f.teardown===null&&f.nodes===null&&f.first===f.last&&(f.f&be)===0&&(f=f.first,(e&j)!==0&&(e&Te)!==0&&f!==null&&(f.f|=Te)),f!==null&&(f.parent=r,r!==null&&Sn(f,r),v!==null&&(v.f&E)!==0&&(e&se)===0)){var u=v;(u.effects??=[]).push(f)}return s}function Ne(){return v!==null&&!I}function Rn(e){const t=N(Ce,null,!1);return b(t,m),t.teardown=e,t}function On(e){Ct();var t=h.f,n=!v&&(t&q)!==0&&(t&Ke)===0;if(n){var r=y;(r.e??=[]).push(e)}else return Ft(e)}function Ft(e){return N($e|yt,e,!1)}function Hr(e){return Ct(),N(Ce|yt,e,!0)}function Br(e){$.ensure();const t=N(se|be,e,!0);return(n={})=>new Promise(r=>{n.outro?Pn(t,()=>{re(t),r(void 0)}):(re(t),r(void 0))})}function Ur(e){return N($e,e,!1)}function Vr(e,t){var n=y,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Mt(()=>{e(),!r.ran&&(r.ran=!0,de(t))})}function $r(){var e=y;Mt(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&m)!==0&&b(n,C),ve(n)&&ce(n),t.ran=!1}})}function Dn(e){return N(ze|be,e,!0)}function Mt(e,t=0){return N(Ce|t,e,!0)}function Gr(e,t=[],n=[],r=[]){wn(r,t,n,s=>{N(Ce,()=>e(...s.map(W)),!0)})}function Kr(e,t=0){var n=N(j|t,e,!0);return n}function zr(e,t=0){var n=N(ht|t,e,!0);return n}function Xr(e){return N(q|be,e,!0)}function Lt(e){var t=e.teardown;if(t!==null){const n=_e,r=v;ut(!0),G(null);try{t.call(null)}finally{ut(n),G(r)}}}function jt(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&nt(()=>{s.abort(ae)});var r=n.next;(n.f&se)!==0?n.parent=null:re(n,t),n=r}}function Nn(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&q)===0&&re(t),t=n}}function re(e,t=!0){var n=!1;(t||(e.f&pt)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(In(e.nodes.start,e.nodes.end),n=!0),jt(e,t&&!n),Pe(e,0),b(e,H);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Lt(e);var s=e.parent;s!==null&&s.first!==null&&qt(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function In(e,t){for(;e!==null;){var n=e===t?null:K(e);e.remove(),e=n}}function qt(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Pn(e,t,n=!0){var r=[];Yt(e,r,!0);var s=()=>{n&&re(e),t&&t()},f=r.length;if(f>0){var u=()=>--f||s();for(var l of r)l.out(u)}else s()}function Yt(e,t,n){if((e.f&P)===0){e.f^=P;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,u=(s.f&Te)!==0||(s.f&q)!==0&&(e.f&j)!==0;Yt(s,t,u?n:!1),s=f}}}function Zr(e){Ht(e,!0)}function Ht(e,t){if((e.f&P)!==0){e.f^=P,(e.f&m)===0&&(b(e,k),ne(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Te)!==0||(n.f&q)!==0;Ht(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const u of f)(u.is_global||t)&&u.in()}}function Wr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:K(n);t.append(n),n=s}}let ie=null;function Cn(e){var t=ie;try{if(ie=new Set,de(e),t!==null)for(var n of ie)t.add(n);return ie}finally{ie=t}}function Jr(e){for(var t of Cn(e))Re(t,t.v)}let Q=!1;function Ie(e){Q=e}let _e=!1;function ut(e){_e=e}let v=null,I=!1;function G(e){v=e}let h=null;function oe(e){h=e}let L=null;function Bt(e){v!==null&&(L===null?L=[e]:L.push(e))}let T=null,x=0,R=null;function Fn(e){R=e}let Ut=1,we=0,ee=we;function ot(e){ee=e}function Vt(){return++Ut}function ve(e){var t=e.f;if((t&k)!==0)return!0;if(t&E&&(e.f&=~te),(t&C)!==0){var n=e.deps;if(n!==null)for(var r=n.length,s=0;s<r;s++){var f=n[s];if(ve(f)&&Rt(f),f.wv>e.wv)return!0}(t&D)!==0&&A===null&&b(e,m)}return!1}function $t(e,t,n=!0){var r=e.reactions;if(r!==null&&!L?.includes(e))for(var s=0;s<r.length;s++){var f=r[s];(f.f&E)!==0?$t(f,t,!1):t===f&&(n?b(f,k):(f.f&m)!==0&&b(f,C),ne(f))}}function Gt(e){var t=T,n=x,r=R,s=v,f=L,u=y,l=I,a=ee,i=e.f;T=null,x=0,R=null,v=(i&(q|se))===0?e:null,L=null,Ae(e.ctx),I=!1,ee=++we,e.ac!==null&&(nt(()=>{e.ac.abort(ae)}),e.ac=null);try{e.f|=Ye;var o=e.fn,_=o(),c=e.deps;if(T!==null){var d;if(Pe(e,x),c!==null&&x>0)for(c.length=x+T.length,d=0;d<T.length;d++)c[x+d]=T[d];else e.deps=c=T;if(Ne()&&(e.f&D)!==0)for(d=x;d<c.length;d++)(c[d].reactions??=[]).push(e)}else c!==null&&x<c.length&&(Pe(e,x),c.length=x);if(me()&&R!==null&&!I&&c!==null&&(e.f&(E|C|k))===0)for(d=0;d<R.length;d++)$t(R[d],e);return s!==null&&s!==e&&(we++,R!==null&&(r===null?r=R:r.push(...R))),(e.f&B)!==0&&(e.f^=B),_}catch(w){return pn(w)}finally{e.f^=Ye,T=t,x=n,R=r,v=s,L=f,Ae(u),I=l,ee=a}}function Mn(e,t){let n=t.reactions;if(n!==null){var r=Zt.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}n===null&&(t.f&E)!==0&&(T===null||!T.includes(t))&&(b(t,C),(t.f&D)!==0&&(t.f^=D,t.f&=~te),St(t),Pe(t,0))}function Pe(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Mn(e,n[r])}function ce(e){var t=e.f;if((t&H)===0){b(e,m);var n=h,r=Q;h=e,Q=!0;try{(t&(j|ht))!==0?Nn(e):jt(e),Lt(e);var s=Gt(e);e.teardown=typeof s=="function"?s:null,e.wv=Ut;var f}finally{Q=r,h=n}}}async function Qr(){await Promise.resolve(),Be()}function es(){return $.ensure().settled()}function W(e){var t=e.f,n=(t&E)!==0;if(ie?.add(e),v!==null&&!I){var r=h!==null&&(h.f&H)!==0;if(!r&&!L?.includes(e)){var s=v.deps;if((v.f&Ye)!==0)e.rv<we&&(e.rv=we,T===null&&s!==null&&s[x]===e?x++:T===null?T=[e]:T.includes(e)||T.push(e));else{(v.deps??=[]).push(e);var f=e.reactions;f===null?e.reactions=[v]:f.includes(v)||f.push(v)}}}if(_e){if(U.has(e))return U.get(e);if(n){var u=e,l=u.v;return((u.f&m)===0&&u.reactions!==null||zt(u))&&(l=et(u)),U.set(u,l),l}}else n&&(!A?.has(e)||p?.is_fork&&!Ne())&&(u=e,ve(u)&&Rt(u),Q&&Ne()&&(u.f&D)===0&&Kt(u));if(A?.has(e))return A.get(e);if((e.f&B)!==0)throw e.v;return e.v}function Kt(e){if(e.deps!==null){e.f^=D;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&E)!==0&&(t.f&D)===0&&Kt(t)}}function zt(e){if(e.v===g)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(U.has(t)||(t.f&E)!==0&&zt(t))return!0;return!1}function de(e){var t=I;try{return I=!0,e()}finally{I=t}}const Ln=-7169;function b(e,t){e.f=e.f&Ln|t}function ts(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(J in e)Ve(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&J in n&&Ve(n)}}}function Ve(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Ve(e[r],t)}catch{}const n=_t(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Wt(n);for(let s in r){const f=r[s].get;if(f)try{f.call(e)}catch{}}}}}function Xt(e,t,n){if(e==null)return t(void 0),n&&n(void 0),le;const r=de(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const fe=[];function jn(e,t){return{subscribe:qn(e,t).subscribe}}function qn(e,t=le){let n=null;const r=new Set;function s(l){if(Et(e,l)&&(e=l,n)){const a=!fe.length;for(const i of r)i[1](),fe.push(i,e);if(a){for(let i=0;i<fe.length;i+=2)fe[i][0](fe[i+1]);fe.length=0}}}function f(l){s(l(e))}function u(l,a=le){const i=[l,a];return r.add(i),r.size===1&&(n=t(s,f)||le),l(e),()=>{r.delete(i),r.size===0&&n&&(n(),n=null)}}return{set:s,update:f,subscribe:u}}function ns(e,t,n){const r=!Array.isArray(e),s=r?[e]:e;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const f=t.length<2;return jn(n,(u,l)=>{let a=!1;const i=[];let o=0,_=le;const c=()=>{if(o)return;_();const w=t(r?i[0]:i,u,l);f?u(w):_=typeof w=="function"?w:le},d=s.map((w,z)=>Xt(w,ge=>{i[z]=ge,o&=~(1<<z),a&&c()},()=>{o|=1<<z}));return a=!0,c(),function(){vt(d),_(),a=!1}})}function rs(e){let t;return Xt(e,n=>t=n)(),t}function Yn(e){y===null&&Ze(),Ee&&y.l!==null?Bn(y).m.push(e):On(()=>{const t=de(e);if(typeof t=="function")return t})}function ss(e){y===null&&Ze(),Yn(()=>()=>de(e))}function Hn(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function fs(){const e=y;return e===null&&Ze(),(t,n,r)=>{const s=e.s.$$events?.[t];if(s){const f=ct(s)?s.slice():[s],u=Hn(t,n,r);for(const l of f)l.call(e.x,u);return!u.defaultPrevented}return!0}}function Bn(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{h as $,Ar as A,p as B,Zr as C,re as D,Te as E,Pn as F,Oe as G,Xr as H,S as I,Wr as J,Lr as K,Tr as L,vn as M,gr as N,ue as O,wr as P,Rn as Q,Vn as R,J as S,le as T,Or as U,Xt as V,rs as W,pe as X,Qn as Y,lr as Z,he as _,xr as a,Ir as a$,H as a0,mn as a1,ur as a2,Ee as a3,ar as a4,ir as a5,or as a6,_e as a7,Xn as a8,tt as a9,An as aA,_r as aB,vr as aC,Ke as aD,Xe as aE,Pr as aF,_n as aG,K as aH,We as aI,Jn as aJ,kn as aK,Un as aL,Br as aM,dn as aN,Je as aO,ct as aP,nr as aQ,tr as aR,fr as aS,zn as aT,rr as aU,P as aV,sr as aW,zr as aX,Yr as aY,Le as aZ,pr as a_,Nr as aa,oe as ab,Be as ac,Qr as ad,Rr as ae,Vr as af,$r as ag,fs as ah,Jr as ai,Kn as aj,Ne as ak,je as al,wt as am,$ as an,G as ao,Ae as ap,pn as aq,v as ar,Re as as,ke as at,er as au,be as av,Ge as aw,yr as ax,nt as ay,De as az,M as b,wn as b0,hr as b1,jr as b2,g as b3,xn as b4,dr as b5,_t as b6,Zn as b7,Wt as b8,qn as b9,j as ba,cr as bb,$n as bc,Et as bd,at as be,ss as bf,In as bg,qr as bh,ns as bi,Dr as bj,Sr as bk,es as bl,Cr as c,Y as d,Ur as e,Fr as f,W as g,Mt as h,de as i,V as j,br as k,Kr as l,y as m,mr as n,Yn as o,kr as p,Tt as q,Er as r,Mr as s,Gr as t,On as u,Hr as v,vt as w,Gn as x,ts as y,Qe as z};
|