@ts-model-checker/react 0.0.0-stage → 1.0.2

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/dist/index.cjs ADDED
@@ -0,0 +1,1628 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var react$1 = require('@xyflow/react');
5
+ var lucideReact = require('lucide-react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var core = require('@ts-model-checker/core');
8
+ var worker = require('@ts-model-checker/worker');
9
+
10
+ // src/components/FormalCanvas.tsx
11
+ var BINARY_OPERATORS = [
12
+ { value: "==", label: "= (equals)" },
13
+ { value: "!=", label: "\u2260 (not equals)" },
14
+ { value: "<", label: "< (less than)" },
15
+ { value: "<=", label: "\u2264 (less than or equal)" },
16
+ { value: ">", label: "> (greater than)" },
17
+ { value: ">=", label: "\u2265 (greater than or equal)" },
18
+ { value: "&&", label: "AND (both true)" },
19
+ { value: "||", label: "OR (at least one)" },
20
+ { value: "=>", label: "\u21D2 (implies)" },
21
+ { value: "+", label: "+ (add)" },
22
+ { value: "-", label: "- (subtract)" },
23
+ { value: "*", label: "* (multiply)" },
24
+ { value: "/", label: "\xF7 (integer division)" },
25
+ { value: "IN", label: "\u2208 (in set)" },
26
+ { value: "NOT_IN", label: "\u2209 (not in set)" },
27
+ { value: "UNION", label: "\u222A (set union)" }
28
+ ];
29
+ var UNARY_OPERATORS = [
30
+ { value: "!", label: "NOT (negation)" },
31
+ { value: "-", label: "- (negate)" },
32
+ { value: "CARDINALITY", label: "|S| (set size)" },
33
+ { value: "IS_EMPTY", label: "S = \u2205 (is empty)" }
34
+ ];
35
+ function parseLiteralInput(raw, typeHint) {
36
+ if (typeHint === "boolean") return raw === "true";
37
+ if (typeHint === "number") {
38
+ const n = Number(raw);
39
+ return Number.isNaN(n) ? 0 : n;
40
+ }
41
+ return raw;
42
+ }
43
+ function ExprBuilder({
44
+ value,
45
+ variables,
46
+ onChange,
47
+ depth = 0
48
+ }) {
49
+ const firstVarName = variables[0]?.name ?? "x";
50
+ const handleKindChange = (nextKind) => {
51
+ switch (nextKind) {
52
+ case "Literal":
53
+ onChange({ kind: "Literal", value: 0 });
54
+ break;
55
+ case "Var":
56
+ onChange({ kind: "Var", name: firstVarName });
57
+ break;
58
+ case "BinaryOp":
59
+ onChange({
60
+ kind: "BinaryOp",
61
+ op: "==",
62
+ left: { kind: "Var", name: firstVarName },
63
+ right: { kind: "Literal", value: 0 }
64
+ });
65
+ break;
66
+ case "UnaryOp":
67
+ onChange({
68
+ kind: "UnaryOp",
69
+ op: "!",
70
+ operand: { kind: "Literal", value: true }
71
+ });
72
+ break;
73
+ case "Range":
74
+ onChange({
75
+ kind: "Range",
76
+ start: { kind: "Literal", value: 1 },
77
+ end: { kind: "Literal", value: 5 }
78
+ });
79
+ break;
80
+ case "IfThenElse":
81
+ onChange({
82
+ kind: "IfThenElse",
83
+ condition: { kind: "Literal", value: true },
84
+ thenBranch: { kind: "Literal", value: 1 },
85
+ elseBranch: { kind: "Literal", value: 0 }
86
+ });
87
+ break;
88
+ }
89
+ };
90
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-expr-box", style: { marginLeft: depth > 0 ? 8 : 0 }, children: [
91
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-expr-row", children: [
92
+ /* @__PURE__ */ jsxRuntime.jsxs(
93
+ "select",
94
+ {
95
+ className: "tsmc-select",
96
+ value: value.kind,
97
+ onChange: (e) => handleKindChange(e.target.value),
98
+ children: [
99
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "BinaryOp", children: "Operation / Comparison" }),
100
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Var", children: "Variable" }),
101
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Literal", children: "Fixed Value" }),
102
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "UnaryOp", children: "Negation / Unary" }),
103
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Range", children: "Range (a..b)" }),
104
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "IfThenElse", children: "Conditional (If / Then / Else)" })
105
+ ]
106
+ }
107
+ ),
108
+ value.kind === "Literal" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
109
+ /* @__PURE__ */ jsxRuntime.jsxs(
110
+ "select",
111
+ {
112
+ className: "tsmc-select",
113
+ value: typeof value.value === "boolean" ? "boolean" : typeof value.value === "number" ? "number" : "string",
114
+ onChange: (e) => {
115
+ const t = e.target.value;
116
+ onChange({
117
+ kind: "Literal",
118
+ value: t === "boolean" ? true : t === "number" ? 0 : ""
119
+ });
120
+ },
121
+ children: [
122
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "number", children: "Number" }),
123
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "string", children: "String" }),
124
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "boolean", children: "Boolean" })
125
+ ]
126
+ }
127
+ ),
128
+ typeof value.value === "boolean" ? /* @__PURE__ */ jsxRuntime.jsxs(
129
+ "select",
130
+ {
131
+ className: "tsmc-select",
132
+ value: String(value.value),
133
+ onChange: (e) => onChange({ kind: "Literal", value: e.target.value === "true" }),
134
+ children: [
135
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "true", children: "True (true)" }),
136
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "false", children: "False (false)" })
137
+ ]
138
+ }
139
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
140
+ "input",
141
+ {
142
+ className: "tsmc-input",
143
+ type: typeof value.value === "number" ? "number" : "text",
144
+ value: String(value.value ?? ""),
145
+ onChange: (e) => onChange({
146
+ kind: "Literal",
147
+ value: parseLiteralInput(
148
+ e.target.value,
149
+ typeof value.value === "number" ? "number" : "string"
150
+ )
151
+ })
152
+ }
153
+ )
154
+ ] }),
155
+ value.kind === "Var" && /* @__PURE__ */ jsxRuntime.jsx(
156
+ "select",
157
+ {
158
+ className: "tsmc-select",
159
+ value: value.name,
160
+ onChange: (e) => onChange({ kind: "Var", name: e.target.value }),
161
+ children: variables.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: v.name, children: [
162
+ v.name,
163
+ " (",
164
+ v.type,
165
+ ")"
166
+ ] }, v.name))
167
+ }
168
+ ),
169
+ value.kind === "UnaryOp" && /* @__PURE__ */ jsxRuntime.jsx(
170
+ "select",
171
+ {
172
+ className: "tsmc-select",
173
+ value: value.op,
174
+ onChange: (e) => onChange({ ...value, op: e.target.value }),
175
+ children: UNARY_OPERATORS.map((op) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: op.value, children: op.label }, op.value))
176
+ }
177
+ ),
178
+ value.kind === "BinaryOp" && /* @__PURE__ */ jsxRuntime.jsx(
179
+ "select",
180
+ {
181
+ className: "tsmc-select",
182
+ value: value.op,
183
+ onChange: (e) => onChange({ ...value, op: e.target.value }),
184
+ children: BINARY_OPERATORS.map((op) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: op.value, children: op.label }, op.value))
185
+ }
186
+ )
187
+ ] }),
188
+ value.kind === "UnaryOp" && /* @__PURE__ */ jsxRuntime.jsx(
189
+ ExprBuilder,
190
+ {
191
+ value: value.operand,
192
+ variables,
193
+ onChange: (operand) => onChange({ ...value, operand }),
194
+ depth: depth + 1
195
+ }
196
+ ),
197
+ value.kind === "BinaryOp" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
198
+ /* @__PURE__ */ jsxRuntime.jsx(
199
+ ExprBuilder,
200
+ {
201
+ value: value.left,
202
+ variables,
203
+ onChange: (left) => onChange({ ...value, left }),
204
+ depth: depth + 1
205
+ }
206
+ ),
207
+ /* @__PURE__ */ jsxRuntime.jsx(
208
+ ExprBuilder,
209
+ {
210
+ value: value.right,
211
+ variables,
212
+ onChange: (right) => onChange({ ...value, right }),
213
+ depth: depth + 1
214
+ }
215
+ )
216
+ ] }),
217
+ value.kind === "Range" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
218
+ /* @__PURE__ */ jsxRuntime.jsx(
219
+ ExprBuilder,
220
+ {
221
+ value: value.start,
222
+ variables,
223
+ onChange: (start) => onChange({ ...value, start }),
224
+ depth: depth + 1
225
+ }
226
+ ),
227
+ /* @__PURE__ */ jsxRuntime.jsx(
228
+ ExprBuilder,
229
+ {
230
+ value: value.end,
231
+ variables,
232
+ onChange: (end) => onChange({ ...value, end }),
233
+ depth: depth + 1
234
+ }
235
+ )
236
+ ] }),
237
+ value.kind === "IfThenElse" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
238
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "If:" }),
239
+ /* @__PURE__ */ jsxRuntime.jsx(
240
+ ExprBuilder,
241
+ {
242
+ value: value.condition,
243
+ variables,
244
+ onChange: (condition) => onChange({ ...value, condition }),
245
+ depth: depth + 1
246
+ }
247
+ ),
248
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "Then:" }),
249
+ /* @__PURE__ */ jsxRuntime.jsx(
250
+ ExprBuilder,
251
+ {
252
+ value: value.thenBranch,
253
+ variables,
254
+ onChange: (thenBranch) => onChange({ ...value, thenBranch }),
255
+ depth: depth + 1
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "Else:" }),
259
+ /* @__PURE__ */ jsxRuntime.jsx(
260
+ ExprBuilder,
261
+ {
262
+ value: value.elseBranch,
263
+ variables,
264
+ onChange: (elseBranch) => onChange({ ...value, elseBranch }),
265
+ depth: depth + 1
266
+ }
267
+ )
268
+ ] })
269
+ ] });
270
+ }
271
+ function ActionEditorModal({
272
+ action,
273
+ variables,
274
+ onSave,
275
+ onDelete,
276
+ onClose
277
+ }) {
278
+ const [draft, setDraft] = react.useState(action);
279
+ const handleAddEffect = () => {
280
+ const unusedVar = variables.find((v) => !draft.effects.some((e) => e.targetVar === v.name))?.name ?? variables[0]?.name ?? "x";
281
+ const nextEffect = {
282
+ targetVar: unusedVar,
283
+ expression: { kind: "Literal", value: 0 }
284
+ };
285
+ setDraft({ ...draft, effects: [...draft.effects, nextEffect] });
286
+ };
287
+ const handleRemoveEffect = (index) => {
288
+ setDraft({
289
+ ...draft,
290
+ effects: draft.effects.filter((_, idx) => idx !== index)
291
+ });
292
+ };
293
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-modal-backdrop", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal", onClick: (e) => e.stopPropagation(), children: [
294
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-header", children: [
295
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
296
+ "Edit Action: ",
297
+ draft.name
298
+ ] }),
299
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tsmc-btn tsmc-btn-sm", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 }) })
300
+ ] }),
301
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-body", children: [
302
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 10 }, children: [
303
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
304
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tsmc-section-label", children: "Action Name" }),
305
+ /* @__PURE__ */ jsxRuntime.jsx(
306
+ "input",
307
+ {
308
+ className: "tsmc-input",
309
+ value: draft.name,
310
+ onChange: (e) => setDraft({ ...draft, name: e.target.value })
311
+ }
312
+ )
313
+ ] }),
314
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
315
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tsmc-section-label", children: "Description (Optional)" }),
316
+ /* @__PURE__ */ jsxRuntime.jsx(
317
+ "input",
318
+ {
319
+ className: "tsmc-input",
320
+ value: draft.description ?? "",
321
+ onChange: (e) => setDraft({ ...draft, description: e.target.value })
322
+ }
323
+ )
324
+ ] })
325
+ ] }),
326
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
327
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "When it can run (Guard)" }),
328
+ /* @__PURE__ */ jsxRuntime.jsx(
329
+ ExprBuilder,
330
+ {
331
+ value: draft.guard,
332
+ variables,
333
+ onChange: (guard) => setDraft({ ...draft, guard })
334
+ }
335
+ )
336
+ ] }),
337
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
338
+ /* @__PURE__ */ jsxRuntime.jsxs(
339
+ "div",
340
+ {
341
+ style: {
342
+ display: "flex",
343
+ justifyContent: "space-between",
344
+ alignItems: "center",
345
+ marginBottom: 6
346
+ },
347
+ children: [
348
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tsmc-section-label", children: "Next-state changes (Effects)" }),
349
+ /* @__PURE__ */ jsxRuntime.jsxs(
350
+ "button",
351
+ {
352
+ type: "button",
353
+ className: "tsmc-btn tsmc-btn-sm",
354
+ onClick: handleAddEffect,
355
+ disabled: variables.length === 0,
356
+ children: [
357
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 12 }),
358
+ " Add Effect"
359
+ ]
360
+ }
361
+ )
362
+ ]
363
+ }
364
+ ),
365
+ draft.effects.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "var(--tsmc-text-muted)" }, children: "No effects defined \u2014 all variables remain UNCHANGED." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: draft.effects.map((eff, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
366
+ "div",
367
+ {
368
+ style: {
369
+ border: "1px solid var(--tsmc-border)",
370
+ borderRadius: 8,
371
+ padding: 10,
372
+ display: "flex",
373
+ flexDirection: "column",
374
+ gap: 8
375
+ },
376
+ children: [
377
+ /* @__PURE__ */ jsxRuntime.jsxs(
378
+ "div",
379
+ {
380
+ style: {
381
+ display: "flex",
382
+ justifyContent: "space-between",
383
+ alignItems: "center",
384
+ gap: 8
385
+ },
386
+ children: [
387
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
388
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { style: { fontSize: 13 }, children: "Next value of:" }),
389
+ /* @__PURE__ */ jsxRuntime.jsx(
390
+ "select",
391
+ {
392
+ className: "tsmc-select",
393
+ value: eff.targetVar,
394
+ onChange: (e) => {
395
+ const updated = [...draft.effects];
396
+ updated[idx] = { ...eff, targetVar: e.target.value };
397
+ setDraft({ ...draft, effects: updated });
398
+ },
399
+ children: variables.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: v.name, children: [
400
+ v.name,
401
+ "'"
402
+ ] }, v.name))
403
+ }
404
+ )
405
+ ] }),
406
+ /* @__PURE__ */ jsxRuntime.jsx(
407
+ "button",
408
+ {
409
+ type: "button",
410
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-danger",
411
+ onClick: () => handleRemoveEffect(idx),
412
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 12 })
413
+ }
414
+ )
415
+ ]
416
+ }
417
+ ),
418
+ /* @__PURE__ */ jsxRuntime.jsx(
419
+ ExprBuilder,
420
+ {
421
+ value: eff.expression,
422
+ variables,
423
+ onChange: (expression) => {
424
+ const updated = [...draft.effects];
425
+ updated[idx] = { ...eff, expression };
426
+ setDraft({ ...draft, effects: updated });
427
+ }
428
+ }
429
+ )
430
+ ]
431
+ },
432
+ idx
433
+ )) })
434
+ ] })
435
+ ] }),
436
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-footer", style: { justifyContent: "space-between" }, children: [
437
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: onDelete && /* @__PURE__ */ jsxRuntime.jsxs(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ className: "tsmc-btn tsmc-btn-danger",
442
+ onClick: () => {
443
+ onDelete(draft.id);
444
+ onClose();
445
+ },
446
+ children: [
447
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 14 }),
448
+ " Delete Action"
449
+ ]
450
+ }
451
+ ) }),
452
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
453
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tsmc-btn", onClick: onClose, children: "Cancel" }),
454
+ /* @__PURE__ */ jsxRuntime.jsx(
455
+ "button",
456
+ {
457
+ type: "button",
458
+ className: "tsmc-btn tsmc-btn-primary",
459
+ onClick: () => {
460
+ onSave(draft);
461
+ onClose();
462
+ },
463
+ children: "Save Changes"
464
+ }
465
+ )
466
+ ] })
467
+ ] })
468
+ ] }) });
469
+ }
470
+
471
+ // src/utils/formatExpr.ts
472
+ var OP_LABELS = {
473
+ "==": "=",
474
+ "!=": "\u2260",
475
+ "&&": "AND",
476
+ "||": "OR",
477
+ "=>": "\u21D2",
478
+ IN: "\u2208",
479
+ NOT_IN: "\u2209",
480
+ UNION: "\u222A",
481
+ INTERSECT: "\u2229",
482
+ DIFF: "\u2216",
483
+ SUBSET_EQ: "\u2286"
484
+ };
485
+ function formatExpr(node) {
486
+ switch (node.kind) {
487
+ case "Literal":
488
+ return typeof node.value === "string" ? `"${node.value}"` : String(node.value);
489
+ case "Var":
490
+ return node.name;
491
+ case "SetLiteral":
492
+ return `{${node.elements.map(formatExpr).join(", ")}}`;
493
+ case "RecordLiteral":
494
+ return `{ ${Object.entries(node.fields).map(([k, v]) => `${k}: ${formatExpr(v)}`).join(", ")} }`;
495
+ case "FieldAccess":
496
+ return `${formatExpr(node.target)}.${node.field}`;
497
+ case "Range":
498
+ return `${formatExpr(node.start)}..${formatExpr(node.end)}`;
499
+ case "UnaryOp":
500
+ if (node.op === "!") return `NOT (${formatExpr(node.operand)})`;
501
+ if (node.op === "CARDINALITY") return `|${formatExpr(node.operand)}|`;
502
+ if (node.op === "IS_EMPTY") return `${formatExpr(node.operand)} = \u2205`;
503
+ return `-${formatExpr(node.operand)}`;
504
+ case "BinaryOp": {
505
+ const op = OP_LABELS[node.op] ?? node.op;
506
+ return `(${formatExpr(node.left)} ${op} ${formatExpr(node.right)})`;
507
+ }
508
+ case "IfThenElse":
509
+ return `IF ${formatExpr(node.condition)} THEN ${formatExpr(node.thenBranch)} ELSE ${formatExpr(node.elseBranch)}`;
510
+ case "Quantifier": {
511
+ const q = node.quantifier === "FORALL" ? "\u2200" : "\u2203";
512
+ return `${q} ${node.boundVar} \u2208 ${formatExpr(node.domain)}: ${formatExpr(node.predicate)}`;
513
+ }
514
+ }
515
+ }
516
+ function ActionNode({ data }) {
517
+ const { action, isActive, isViolated, onEdit } = data;
518
+ const stateClass = isViolated ? "tsmc-node-violated" : isActive ? "tsmc-node-active" : "";
519
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tsmc-node ${stateClass}`, children: [
520
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "target", position: react$1.Position.Top }),
521
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-node-header", children: [
522
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
523
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Zap, { size: 14, color: "#2563eb" }),
524
+ " ",
525
+ action.name
526
+ ] }),
527
+ onEdit && /* @__PURE__ */ jsxRuntime.jsx(
528
+ "button",
529
+ {
530
+ type: "button",
531
+ className: "tsmc-btn tsmc-btn-sm",
532
+ onClick: () => onEdit(action.id),
533
+ title: "Edit action",
534
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit3, { size: 12 })
535
+ }
536
+ )
537
+ ] }),
538
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-node-body", children: [
539
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
540
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "When (Guard)" }),
541
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-code-chip", children: formatExpr(action.guard) })
542
+ ] }),
543
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
544
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-section-label", children: "Then (Effects)" }),
545
+ action.effects.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-code-chip", style: { color: "var(--tsmc-text-muted)" }, children: "UNCHANGED (No changes)" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: action.effects.map((eff) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-code-chip", children: [
546
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
547
+ eff.targetVar,
548
+ "'"
549
+ ] }),
550
+ " = ",
551
+ formatExpr(eff.expression)
552
+ ] }, eff.targetVar)) })
553
+ ] })
554
+ ] }),
555
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "source", position: react$1.Position.Bottom })
556
+ ] });
557
+ }
558
+ function defaultForType(type) {
559
+ switch (type) {
560
+ case "number":
561
+ return 0;
562
+ case "boolean":
563
+ return false;
564
+ case "string":
565
+ return "IDLE";
566
+ case "set":
567
+ return [];
568
+ case "record":
569
+ return {};
570
+ }
571
+ }
572
+ function parseValue(raw, type) {
573
+ if (type === "number") {
574
+ const n = Number(raw);
575
+ return Number.isNaN(n) ? 0 : n;
576
+ }
577
+ if (type === "boolean") {
578
+ return raw === "true";
579
+ }
580
+ if (type === "set" || type === "record") {
581
+ try {
582
+ return JSON.parse(raw);
583
+ } catch {
584
+ return defaultForType(type);
585
+ }
586
+ }
587
+ return raw;
588
+ }
589
+ function InitEditorModal({
590
+ variables,
591
+ initialState,
592
+ onSave,
593
+ onClose
594
+ }) {
595
+ const [vars, setVars] = react.useState([...variables]);
596
+ const [stateDraft, setStateDraft] = react.useState({
597
+ ...initialState
598
+ });
599
+ const handleAddVar = () => {
600
+ let idx = vars.length + 1;
601
+ let name = `var${idx}`;
602
+ while (vars.some((v) => v.name === name)) {
603
+ idx += 1;
604
+ name = `var${idx}`;
605
+ }
606
+ setVars([...vars, { name, type: "number" }]);
607
+ setStateDraft({ ...stateDraft, [name]: 0 });
608
+ };
609
+ const handleRenameVar = (index, nextName) => {
610
+ const oldName = vars[index].name;
611
+ const updated = [...vars];
612
+ updated[index] = { ...vars[index], name: nextName };
613
+ setVars(updated);
614
+ if (oldName !== nextName) {
615
+ const nextState = { ...stateDraft };
616
+ nextState[nextName] = nextState[oldName] ?? defaultForType(vars[index].type);
617
+ delete nextState[oldName];
618
+ setStateDraft(nextState);
619
+ }
620
+ };
621
+ const handleTypeChange = (index, nextType) => {
622
+ const v = vars[index];
623
+ const updated = [...vars];
624
+ updated[index] = { ...v, type: nextType };
625
+ setVars(updated);
626
+ setStateDraft({ ...stateDraft, [v.name]: defaultForType(nextType) });
627
+ };
628
+ const handleRemoveVar = (index) => {
629
+ const name = vars[index].name;
630
+ setVars(vars.filter((_, i) => i !== index));
631
+ const nextState = { ...stateDraft };
632
+ delete nextState[name];
633
+ setStateDraft(nextState);
634
+ };
635
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-modal-backdrop", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal", onClick: (e) => e.stopPropagation(), children: [
636
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-header", children: [
637
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Configure Variables & Initial State (Init)" }),
638
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tsmc-btn tsmc-btn-sm", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 }) })
639
+ ] }),
640
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-body", children: [
641
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
642
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "var(--tsmc-text-muted)" }, children: "Define the system state variables and their initial values." }),
643
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tsmc-btn tsmc-btn-sm", onClick: handleAddVar, children: [
644
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 12 }),
645
+ " New Variable"
646
+ ] })
647
+ ] }),
648
+ vars.map((v, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
649
+ "div",
650
+ {
651
+ style: {
652
+ display: "grid",
653
+ gridTemplateColumns: "1fr 120px 1fr auto",
654
+ gap: 8,
655
+ alignItems: "center"
656
+ },
657
+ children: [
658
+ /* @__PURE__ */ jsxRuntime.jsx(
659
+ "input",
660
+ {
661
+ className: "tsmc-input",
662
+ value: v.name,
663
+ placeholder: "Name",
664
+ onChange: (e) => handleRenameVar(idx, e.target.value)
665
+ }
666
+ ),
667
+ /* @__PURE__ */ jsxRuntime.jsxs(
668
+ "select",
669
+ {
670
+ className: "tsmc-select",
671
+ value: v.type,
672
+ onChange: (e) => handleTypeChange(idx, e.target.value),
673
+ children: [
674
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "number", children: "Number" }),
675
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "string", children: "String" }),
676
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "boolean", children: "Boolean" }),
677
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "set", children: "Set" }),
678
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "record", children: "Record" })
679
+ ]
680
+ }
681
+ ),
682
+ v.type === "boolean" ? /* @__PURE__ */ jsxRuntime.jsxs(
683
+ "select",
684
+ {
685
+ className: "tsmc-select",
686
+ value: String(Boolean(stateDraft[v.name])),
687
+ onChange: (e) => setStateDraft({
688
+ ...stateDraft,
689
+ [v.name]: e.target.value === "true"
690
+ }),
691
+ children: [
692
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "true", children: "true" }),
693
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "false", children: "false" })
694
+ ]
695
+ }
696
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
697
+ "input",
698
+ {
699
+ className: "tsmc-input",
700
+ type: v.type === "number" ? "number" : "text",
701
+ value: typeof stateDraft[v.name] === "object" ? JSON.stringify(stateDraft[v.name]) : String(stateDraft[v.name] ?? ""),
702
+ onChange: (e) => setStateDraft({
703
+ ...stateDraft,
704
+ [v.name]: parseValue(e.target.value, v.type)
705
+ })
706
+ }
707
+ ),
708
+ /* @__PURE__ */ jsxRuntime.jsx(
709
+ "button",
710
+ {
711
+ type: "button",
712
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-danger",
713
+ onClick: () => handleRemoveVar(idx),
714
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 12 })
715
+ }
716
+ )
717
+ ]
718
+ },
719
+ idx
720
+ ))
721
+ ] }),
722
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-footer", children: [
723
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tsmc-btn", onClick: onClose, children: "Cancel" }),
724
+ /* @__PURE__ */ jsxRuntime.jsx(
725
+ "button",
726
+ {
727
+ type: "button",
728
+ className: "tsmc-btn tsmc-btn-primary",
729
+ onClick: () => {
730
+ onSave(vars, stateDraft);
731
+ onClose();
732
+ },
733
+ children: "Save Initial State"
734
+ }
735
+ )
736
+ ] })
737
+ ] }) });
738
+ }
739
+ function InitNode({ data }) {
740
+ const { variables, initialState, isActive, onEdit } = data;
741
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tsmc-node tsmc-node-init ${isActive ? "tsmc-node-active" : ""}`, children: [
742
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-node-header", children: [
743
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
744
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { size: 14 }),
745
+ " Initial State (Init)"
746
+ ] }),
747
+ onEdit && /* @__PURE__ */ jsxRuntime.jsx(
748
+ "button",
749
+ {
750
+ type: "button",
751
+ className: "tsmc-btn tsmc-btn-sm",
752
+ onClick: onEdit,
753
+ title: "Edit initial variables",
754
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit3, { size: 12 })
755
+ }
756
+ )
757
+ ] }),
758
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-node-body", children: variables.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "var(--tsmc-text-muted)" }, children: "No variables defined" }) : variables.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-var-row", children: [
759
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: v.name }),
760
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
761
+ "= ",
762
+ JSON.stringify(initialState[v.name])
763
+ ] })
764
+ ] }, v.name)) }),
765
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "source", position: react$1.Position.Bottom })
766
+ ] });
767
+ }
768
+ var nodeTypes = {
769
+ initNode: InitNode,
770
+ actionNode: ActionNode
771
+ };
772
+ function FormalCanvas({
773
+ spec,
774
+ onChange,
775
+ activeActionName = null,
776
+ isViolationStep = false,
777
+ readOnly = false
778
+ }) {
779
+ const [editingActionId, setEditingActionId] = react.useState(null);
780
+ const [editingInit, setEditingInit] = react.useState(false);
781
+ const editingAction = react.useMemo(
782
+ () => spec.actions.find((a) => a.id === editingActionId) ?? null,
783
+ [spec.actions, editingActionId]
784
+ );
785
+ const nodes = react.useMemo(() => {
786
+ const initNode = {
787
+ id: "__init__",
788
+ type: "initNode",
789
+ position: { x: 230, y: 20 },
790
+ data: {
791
+ variables: spec.variables,
792
+ initialState: spec.initialStates[0] ?? {},
793
+ isActive: activeActionName === "Init",
794
+ onEdit: readOnly ? void 0 : () => setEditingInit(true)
795
+ }
796
+ };
797
+ const actionNodes = spec.actions.map((act, idx) => ({
798
+ id: act.id,
799
+ type: "actionNode",
800
+ position: act.position ?? {
801
+ x: 60 + idx % 2 * 320,
802
+ y: 200 + Math.floor(idx / 2) * 180
803
+ },
804
+ data: {
805
+ action: act,
806
+ isActive: activeActionName === act.name && !isViolationStep,
807
+ isViolated: activeActionName === act.name && isViolationStep,
808
+ onEdit: readOnly ? void 0 : (id) => setEditingActionId(id)
809
+ }
810
+ }));
811
+ return [initNode, ...actionNodes];
812
+ }, [spec, activeActionName, isViolationStep, readOnly]);
813
+ const edges = react.useMemo(
814
+ () => spec.actions.map((act) => ({
815
+ id: `edge_init_${act.id}`,
816
+ source: "__init__",
817
+ target: act.id,
818
+ animated: activeActionName === act.name,
819
+ style: {
820
+ stroke: activeActionName === act.name ? "#2563eb" : "#94a3b8",
821
+ strokeWidth: activeActionName === act.name ? 2.5 : 1.5
822
+ }
823
+ })),
824
+ [spec.actions, activeActionName]
825
+ );
826
+ const handleNodesChange = react.useCallback(
827
+ (changes) => {
828
+ if (readOnly) return;
829
+ const positionUpdates = /* @__PURE__ */ new Map();
830
+ for (const ch of changes) {
831
+ if (ch.type === "position" && ch.position && ch.id !== "__init__") {
832
+ positionUpdates.set(ch.id, ch.position);
833
+ }
834
+ }
835
+ if (positionUpdates.size === 0) return;
836
+ onChange({
837
+ ...spec,
838
+ actions: spec.actions.map((act) => {
839
+ const pos = positionUpdates.get(act.id);
840
+ return pos ? { ...act, position: pos } : act;
841
+ })
842
+ });
843
+ },
844
+ [spec, onChange, readOnly]
845
+ );
846
+ const handleAddAction = () => {
847
+ const idx = spec.actions.length + 1;
848
+ const newAction = {
849
+ id: `act_${Date.now()}`,
850
+ name: `Action_${idx}`,
851
+ guard: { kind: "Literal", value: true },
852
+ effects: [],
853
+ position: {
854
+ x: 60 + (idx - 1) % 2 * 320,
855
+ y: 200 + Math.floor((idx - 1) / 2) * 180
856
+ }
857
+ };
858
+ onChange({ ...spec, actions: [...spec.actions, newAction] });
859
+ setEditingActionId(newAction.id);
860
+ };
861
+ const handleSaveAction = (updated) => {
862
+ onChange({
863
+ ...spec,
864
+ actions: spec.actions.map((a) => a.id === updated.id ? updated : a)
865
+ });
866
+ };
867
+ const handleDeleteAction = (actionId) => {
868
+ onChange({
869
+ ...spec,
870
+ actions: spec.actions.filter((a) => a.id !== actionId)
871
+ });
872
+ };
873
+ const handleSaveInit = (variables, initialState) => {
874
+ onChange({
875
+ ...spec,
876
+ variables,
877
+ initialStates: [initialState, ...spec.initialStates.slice(1)]
878
+ });
879
+ };
880
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-canvas-wrapper", children: [
881
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-toolbar", children: /* @__PURE__ */ jsxRuntime.jsxs(
882
+ "button",
883
+ {
884
+ type: "button",
885
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-primary",
886
+ onClick: handleAddAction,
887
+ children: [
888
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 14 }),
889
+ " New Action"
890
+ ]
891
+ }
892
+ ) }),
893
+ /* @__PURE__ */ jsxRuntime.jsxs(
894
+ react$1.ReactFlow,
895
+ {
896
+ nodes,
897
+ edges,
898
+ nodeTypes,
899
+ onNodesChange: handleNodesChange,
900
+ fitView: true,
901
+ nodesConnectable: false,
902
+ children: [
903
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Background, { gap: 16, size: 1 }),
904
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Controls, {}),
905
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.MiniMap, { zoomable: true, pannable: true })
906
+ ]
907
+ }
908
+ ),
909
+ editingAction && /* @__PURE__ */ jsxRuntime.jsx(
910
+ ActionEditorModal,
911
+ {
912
+ action: editingAction,
913
+ variables: spec.variables,
914
+ onSave: handleSaveAction,
915
+ onDelete: handleDeleteAction,
916
+ onClose: () => setEditingActionId(null)
917
+ }
918
+ ),
919
+ editingInit && /* @__PURE__ */ jsxRuntime.jsx(
920
+ InitEditorModal,
921
+ {
922
+ variables: spec.variables,
923
+ initialState: spec.initialStates[0] ?? {},
924
+ onSave: handleSaveInit,
925
+ onClose: () => setEditingInit(false)
926
+ }
927
+ )
928
+ ] });
929
+ }
930
+ function PropertiesPanel({ spec, onChange }) {
931
+ const [editingInvId, setEditingInvId] = react.useState(null);
932
+ const [editingLiveId, setEditingLiveId] = react.useState(null);
933
+ const firstVar = spec.variables[0]?.name ?? "x";
934
+ const addInvariant = () => {
935
+ const id = `inv_${Date.now()}`;
936
+ const newInv = {
937
+ id,
938
+ description: `Ensure property holds on ${firstVar}`,
939
+ predicate: {
940
+ kind: "BinaryOp",
941
+ op: ">=",
942
+ left: { kind: "Var", name: firstVar },
943
+ right: { kind: "Literal", value: 0 }
944
+ }
945
+ };
946
+ onChange({ ...spec, invariants: [...spec.invariants, newInv] });
947
+ setEditingInvId(id);
948
+ };
949
+ const addLiveness = (kind) => {
950
+ const id = `live_${Date.now()}`;
951
+ const newLive = kind === "EVENTUALLY" ? {
952
+ id,
953
+ kind: "EVENTUALLY",
954
+ description: `Eventually ${firstVar} satisfies condition`,
955
+ eventually: {
956
+ kind: "BinaryOp",
957
+ op: "==",
958
+ left: { kind: "Var", name: firstVar },
959
+ right: { kind: "Literal", value: 0 }
960
+ }
961
+ } : {
962
+ id,
963
+ kind: "LEADS_TO",
964
+ description: `Whenever condition P holds, Q eventually holds`,
965
+ trigger: { kind: "Literal", value: true },
966
+ response: { kind: "Literal", value: true }
967
+ };
968
+ onChange({
969
+ ...spec,
970
+ livenessProperties: [...spec.livenessProperties, newLive]
971
+ });
972
+ setEditingLiveId(id);
973
+ };
974
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-panel", children: [
975
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
976
+ /* @__PURE__ */ jsxRuntime.jsxs(
977
+ "div",
978
+ {
979
+ style: {
980
+ display: "flex",
981
+ justifyContent: "space-between",
982
+ alignItems: "center",
983
+ marginBottom: 8
984
+ },
985
+ children: [
986
+ /* @__PURE__ */ jsxRuntime.jsxs(
987
+ "span",
988
+ {
989
+ style: {
990
+ display: "inline-flex",
991
+ alignItems: "center",
992
+ gap: 6,
993
+ fontWeight: 600,
994
+ fontSize: 13
995
+ },
996
+ children: [
997
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Shield, { size: 15, color: "#2563eb" }),
998
+ " Safety Invariants (\u25A1P)"
999
+ ]
1000
+ }
1001
+ ),
1002
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tsmc-btn tsmc-btn-sm", onClick: addInvariant, children: [
1003
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 12 }),
1004
+ " Add"
1005
+ ] })
1006
+ ]
1007
+ }
1008
+ ),
1009
+ spec.invariants.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "var(--tsmc-text-muted)" }, children: "No invariants defined. Add rules that must hold in every reachable state." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: spec.invariants.map((inv) => {
1010
+ const isEditing = editingInvId === inv.id;
1011
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1012
+ "div",
1013
+ {
1014
+ style: {
1015
+ border: "1px solid var(--tsmc-border)",
1016
+ borderRadius: 8,
1017
+ padding: 8,
1018
+ display: "flex",
1019
+ flexDirection: "column",
1020
+ gap: 6
1021
+ },
1022
+ children: [
1023
+ /* @__PURE__ */ jsxRuntime.jsxs(
1024
+ "div",
1025
+ {
1026
+ style: {
1027
+ display: "flex",
1028
+ justifyContent: "space-between",
1029
+ alignItems: "center",
1030
+ gap: 6
1031
+ },
1032
+ children: [
1033
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { style: { fontSize: 12 }, children: inv.description }),
1034
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 4 }, children: [
1035
+ /* @__PURE__ */ jsxRuntime.jsx(
1036
+ "button",
1037
+ {
1038
+ type: "button",
1039
+ className: "tsmc-btn tsmc-btn-sm",
1040
+ onClick: () => setEditingInvId(isEditing ? null : inv.id),
1041
+ children: isEditing ? "Close" : "Edit"
1042
+ }
1043
+ ),
1044
+ /* @__PURE__ */ jsxRuntime.jsx(
1045
+ "button",
1046
+ {
1047
+ type: "button",
1048
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-danger",
1049
+ onClick: () => onChange({
1050
+ ...spec,
1051
+ invariants: spec.invariants.filter(
1052
+ (i) => i.id !== inv.id
1053
+ )
1054
+ }),
1055
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 12 })
1056
+ }
1057
+ )
1058
+ ] })
1059
+ ]
1060
+ }
1061
+ ),
1062
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-code-chip", children: formatExpr(inv.predicate) }),
1063
+ isEditing && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6, marginTop: 4 }, children: [
1064
+ /* @__PURE__ */ jsxRuntime.jsx(
1065
+ "input",
1066
+ {
1067
+ className: "tsmc-input",
1068
+ value: inv.description,
1069
+ onChange: (e) => onChange({
1070
+ ...spec,
1071
+ invariants: spec.invariants.map(
1072
+ (i) => i.id === inv.id ? { ...i, description: e.target.value } : i
1073
+ )
1074
+ })
1075
+ }
1076
+ ),
1077
+ /* @__PURE__ */ jsxRuntime.jsx(
1078
+ ExprBuilder,
1079
+ {
1080
+ value: inv.predicate,
1081
+ variables: spec.variables,
1082
+ onChange: (predicate) => onChange({
1083
+ ...spec,
1084
+ invariants: spec.invariants.map(
1085
+ (i) => i.id === inv.id ? { ...i, predicate } : i
1086
+ )
1087
+ })
1088
+ }
1089
+ )
1090
+ ] })
1091
+ ]
1092
+ },
1093
+ inv.id
1094
+ );
1095
+ }) })
1096
+ ] }),
1097
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { borderTop: "1px solid var(--tsmc-border)", paddingTop: 10 }, children: [
1098
+ /* @__PURE__ */ jsxRuntime.jsxs(
1099
+ "div",
1100
+ {
1101
+ style: {
1102
+ display: "flex",
1103
+ justifyContent: "space-between",
1104
+ alignItems: "center",
1105
+ marginBottom: 8,
1106
+ gap: 6,
1107
+ flexWrap: "wrap"
1108
+ },
1109
+ children: [
1110
+ /* @__PURE__ */ jsxRuntime.jsxs(
1111
+ "span",
1112
+ {
1113
+ style: {
1114
+ display: "inline-flex",
1115
+ alignItems: "center",
1116
+ gap: 6,
1117
+ fontWeight: 600,
1118
+ fontSize: 13
1119
+ },
1120
+ children: [
1121
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { size: 15, color: "#7c3aed" }),
1122
+ " Temporal Properties (Liveness)"
1123
+ ]
1124
+ }
1125
+ ),
1126
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 4 }, children: [
1127
+ /* @__PURE__ */ jsxRuntime.jsx(
1128
+ "button",
1129
+ {
1130
+ type: "button",
1131
+ className: "tsmc-btn tsmc-btn-sm",
1132
+ onClick: () => addLiveness("EVENTUALLY"),
1133
+ children: "+ \u25C7 Eventually"
1134
+ }
1135
+ ),
1136
+ /* @__PURE__ */ jsxRuntime.jsx(
1137
+ "button",
1138
+ {
1139
+ type: "button",
1140
+ className: "tsmc-btn tsmc-btn-sm",
1141
+ onClick: () => addLiveness("LEADS_TO"),
1142
+ children: "+ P \u21DD Q"
1143
+ }
1144
+ )
1145
+ ] })
1146
+ ]
1147
+ }
1148
+ ),
1149
+ spec.livenessProperties.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "var(--tsmc-text-muted)" }, children: "No liveness properties configured." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: spec.livenessProperties.map((live) => {
1150
+ const isEditing = editingLiveId === live.id;
1151
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1152
+ "div",
1153
+ {
1154
+ style: {
1155
+ border: "1px solid var(--tsmc-border)",
1156
+ borderRadius: 8,
1157
+ padding: 8,
1158
+ display: "flex",
1159
+ flexDirection: "column",
1160
+ gap: 6
1161
+ },
1162
+ children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsxs(
1164
+ "div",
1165
+ {
1166
+ style: {
1167
+ display: "flex",
1168
+ justifyContent: "space-between",
1169
+ alignItems: "center",
1170
+ gap: 6
1171
+ },
1172
+ children: [
1173
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { style: { fontSize: 12 }, children: [
1174
+ "[",
1175
+ live.kind === "EVENTUALLY" ? "\u25C7" : "\u21DD",
1176
+ "] ",
1177
+ live.description
1178
+ ] }),
1179
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 4 }, children: [
1180
+ /* @__PURE__ */ jsxRuntime.jsx(
1181
+ "button",
1182
+ {
1183
+ type: "button",
1184
+ className: "tsmc-btn tsmc-btn-sm",
1185
+ onClick: () => setEditingLiveId(isEditing ? null : live.id),
1186
+ children: isEditing ? "Close" : "Edit"
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ jsxRuntime.jsx(
1190
+ "button",
1191
+ {
1192
+ type: "button",
1193
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-danger",
1194
+ onClick: () => onChange({
1195
+ ...spec,
1196
+ livenessProperties: spec.livenessProperties.filter(
1197
+ (l) => l.id !== live.id
1198
+ )
1199
+ }),
1200
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 12 })
1201
+ }
1202
+ )
1203
+ ] })
1204
+ ]
1205
+ }
1206
+ ),
1207
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-code-chip", children: live.kind === "EVENTUALLY" ? `\u25C7 (${formatExpr(live.eventually)})` : `(${formatExpr(live.trigger)}) \u21DD (${formatExpr(live.response)})` }),
1208
+ isEditing && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6, marginTop: 4 }, children: [
1209
+ /* @__PURE__ */ jsxRuntime.jsx(
1210
+ "input",
1211
+ {
1212
+ className: "tsmc-input",
1213
+ value: live.description,
1214
+ onChange: (e) => onChange({
1215
+ ...spec,
1216
+ livenessProperties: spec.livenessProperties.map(
1217
+ (l) => l.id === live.id ? { ...l, description: e.target.value } : l
1218
+ )
1219
+ })
1220
+ }
1221
+ ),
1222
+ live.kind === "EVENTUALLY" ? /* @__PURE__ */ jsxRuntime.jsx(
1223
+ ExprBuilder,
1224
+ {
1225
+ value: live.eventually,
1226
+ variables: spec.variables,
1227
+ onChange: (eventually) => onChange({
1228
+ ...spec,
1229
+ livenessProperties: spec.livenessProperties.map(
1230
+ (l) => l.id === live.id && l.kind === "EVENTUALLY" ? { ...l, eventually } : l
1231
+ )
1232
+ })
1233
+ }
1234
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1235
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tsmc-section-label", children: "When (P):" }),
1236
+ /* @__PURE__ */ jsxRuntime.jsx(
1237
+ ExprBuilder,
1238
+ {
1239
+ value: live.trigger,
1240
+ variables: spec.variables,
1241
+ onChange: (trigger) => onChange({
1242
+ ...spec,
1243
+ livenessProperties: spec.livenessProperties.map(
1244
+ (l) => l.id === live.id && l.kind === "LEADS_TO" ? { ...l, trigger } : l
1245
+ )
1246
+ })
1247
+ }
1248
+ ),
1249
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tsmc-section-label", children: "Eventually (Q):" }),
1250
+ /* @__PURE__ */ jsxRuntime.jsx(
1251
+ ExprBuilder,
1252
+ {
1253
+ value: live.response,
1254
+ variables: spec.variables,
1255
+ onChange: (response) => onChange({
1256
+ ...spec,
1257
+ livenessProperties: spec.livenessProperties.map(
1258
+ (l) => l.id === live.id && l.kind === "LEADS_TO" ? { ...l, response } : l
1259
+ )
1260
+ })
1261
+ }
1262
+ )
1263
+ ] })
1264
+ ] })
1265
+ ]
1266
+ },
1267
+ live.id
1268
+ );
1269
+ }) })
1270
+ ] })
1271
+ ] });
1272
+ }
1273
+ function TracePlayer({
1274
+ title,
1275
+ steps,
1276
+ cycleStartIndex,
1277
+ activeStepIndex,
1278
+ onStepChange
1279
+ }) {
1280
+ const [isPlaying, setIsPlaying] = react.useState(false);
1281
+ react.useEffect(() => {
1282
+ if (!isPlaying || steps.length === 0) return;
1283
+ const timer = setInterval(() => {
1284
+ onStepChange(
1285
+ activeStepIndex + 1 >= steps.length ? cycleStartIndex ?? 0 : activeStepIndex + 1
1286
+ );
1287
+ }, 900);
1288
+ return () => clearInterval(timer);
1289
+ }, [isPlaying, activeStepIndex, steps.length, cycleStartIndex, onStepChange]);
1290
+ if (steps.length === 0) return null;
1291
+ const clampedIndex = Math.min(Math.max(0, activeStepIndex), steps.length - 1);
1292
+ const currentStep = steps[clampedIndex];
1293
+ const prevStep = clampedIndex > 0 ? steps[clampedIndex - 1] : null;
1294
+ const varNames = Object.keys(currentStep.state).sort();
1295
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-panel", children: [
1296
+ /* @__PURE__ */ jsxRuntime.jsxs(
1297
+ "div",
1298
+ {
1299
+ style: {
1300
+ display: "flex",
1301
+ justifyContent: "space-between",
1302
+ alignItems: "center",
1303
+ gap: 8,
1304
+ flexWrap: "wrap"
1305
+ },
1306
+ children: [
1307
+ /* @__PURE__ */ jsxRuntime.jsxs(
1308
+ "span",
1309
+ {
1310
+ className: "tsmc-badge tsmc-badge-danger",
1311
+ style: { fontSize: 12, padding: "4px 10px" },
1312
+ children: [
1313
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { size: 14 }),
1314
+ " ",
1315
+ title
1316
+ ]
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 12, color: "var(--tsmc-text-muted)" }, children: [
1320
+ "Step ",
1321
+ clampedIndex + 1,
1322
+ " of ",
1323
+ steps.length
1324
+ ] })
1325
+ ]
1326
+ }
1327
+ ),
1328
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
1329
+ /* @__PURE__ */ jsxRuntime.jsx(
1330
+ "button",
1331
+ {
1332
+ type: "button",
1333
+ className: "tsmc-btn tsmc-btn-sm",
1334
+ onClick: () => {
1335
+ setIsPlaying(false);
1336
+ onStepChange(0);
1337
+ },
1338
+ disabled: clampedIndex === 0,
1339
+ title: "Start",
1340
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SkipBack, { size: 14 })
1341
+ }
1342
+ ),
1343
+ /* @__PURE__ */ jsxRuntime.jsx(
1344
+ "button",
1345
+ {
1346
+ type: "button",
1347
+ className: "tsmc-btn tsmc-btn-sm",
1348
+ onClick: () => {
1349
+ setIsPlaying(false);
1350
+ onStepChange(Math.max(0, clampedIndex - 1));
1351
+ },
1352
+ disabled: clampedIndex === 0,
1353
+ title: "Previous Step",
1354
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { size: 14 })
1355
+ }
1356
+ ),
1357
+ /* @__PURE__ */ jsxRuntime.jsxs(
1358
+ "button",
1359
+ {
1360
+ type: "button",
1361
+ className: "tsmc-btn tsmc-btn-sm tsmc-btn-primary",
1362
+ onClick: () => setIsPlaying((p) => !p),
1363
+ children: [
1364
+ isPlaying ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { size: 14 }),
1365
+ isPlaying ? "Pause" : "Play"
1366
+ ]
1367
+ }
1368
+ ),
1369
+ /* @__PURE__ */ jsxRuntime.jsx(
1370
+ "button",
1371
+ {
1372
+ type: "button",
1373
+ className: "tsmc-btn tsmc-btn-sm",
1374
+ onClick: () => {
1375
+ setIsPlaying(false);
1376
+ onStepChange(Math.min(steps.length - 1, clampedIndex + 1));
1377
+ },
1378
+ disabled: clampedIndex === steps.length - 1,
1379
+ title: "Next Step",
1380
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 14 })
1381
+ }
1382
+ ),
1383
+ /* @__PURE__ */ jsxRuntime.jsx(
1384
+ "button",
1385
+ {
1386
+ type: "button",
1387
+ className: "tsmc-btn tsmc-btn-sm",
1388
+ onClick: () => {
1389
+ setIsPlaying(false);
1390
+ onStepChange(steps.length - 1);
1391
+ },
1392
+ disabled: clampedIndex === steps.length - 1,
1393
+ title: "Last Step",
1394
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SkipForward, { size: 14 })
1395
+ }
1396
+ )
1397
+ ] }),
1398
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: steps.map((s, idx) => {
1399
+ const inCycle = cycleStartIndex !== void 0 && idx >= cycleStartIndex;
1400
+ const isCurrent = idx === clampedIndex;
1401
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1402
+ "button",
1403
+ {
1404
+ type: "button",
1405
+ className: `tsmc-btn tsmc-btn-sm ${isCurrent ? "tsmc-btn-primary" : ""}`,
1406
+ onClick: () => {
1407
+ setIsPlaying(false);
1408
+ onStepChange(idx);
1409
+ },
1410
+ children: [
1411
+ inCycle && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Repeat, { size: 11 }),
1412
+ idx,
1413
+ ". ",
1414
+ s.actionName
1415
+ ]
1416
+ },
1417
+ idx
1418
+ );
1419
+ }) }),
1420
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "tsmc-diff-table", children: [
1421
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1422
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Variable" }),
1423
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Previous" }),
1424
+ /* @__PURE__ */ jsxRuntime.jsxs("th", { children: [
1425
+ "Current (",
1426
+ currentStep.actionName,
1427
+ ")"
1428
+ ] })
1429
+ ] }) }),
1430
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: varNames.map((v) => {
1431
+ const prevVal = prevStep ? prevStep.state[v] : void 0;
1432
+ const currVal = currentStep.state[v];
1433
+ const changed = prevStep !== null && JSON.stringify(prevVal) !== JSON.stringify(currVal);
1434
+ return /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: changed ? "tsmc-diff-changed" : "", children: [
1435
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: v }),
1436
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { color: "var(--tsmc-text-muted)" }, children: prevStep ? JSON.stringify(prevVal) : "\u2014" }),
1437
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: JSON.stringify(currVal) })
1438
+ ] }, v);
1439
+ }) })
1440
+ ] })
1441
+ ] });
1442
+ }
1443
+ function TlaExportModal({ spec, onClose }) {
1444
+ const [activeTab, setActiveTab] = react.useState("tla");
1445
+ const [copied, setCopied] = react.useState(false);
1446
+ const output = react.useMemo(() => {
1447
+ try {
1448
+ return { ok: true, files: core.transpileToTla(spec) };
1449
+ } catch (err) {
1450
+ return {
1451
+ ok: false,
1452
+ error: err instanceof Error ? err.message : String(err)
1453
+ };
1454
+ }
1455
+ }, [spec]);
1456
+ const content = output.ok ? activeTab === "tla" ? output.files.tlaFileContent : output.files.cfgFileContent : output.error;
1457
+ const handleCopy = async () => {
1458
+ await navigator.clipboard.writeText(content);
1459
+ setCopied(true);
1460
+ setTimeout(() => setCopied(false), 1500);
1461
+ };
1462
+ const handleDownload = (filename, text) => {
1463
+ const blob = new Blob([text], { type: "text/plain;charset=utf-8" });
1464
+ const url = URL.createObjectURL(blob);
1465
+ const a = document.createElement("a");
1466
+ a.href = url;
1467
+ a.download = filename;
1468
+ a.click();
1469
+ URL.revokeObjectURL(url);
1470
+ };
1471
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tsmc-modal-backdrop", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal", onClick: (e) => e.stopPropagation(), children: [
1472
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-header", children: [
1473
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1474
+ "Export TLA+ Specification (",
1475
+ spec.moduleName,
1476
+ ")"
1477
+ ] }),
1478
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tsmc-btn tsmc-btn-sm", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 }) })
1479
+ ] }),
1480
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tsmc-modal-body", children: [
1481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
1482
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 6 }, children: [
1483
+ /* @__PURE__ */ jsxRuntime.jsxs(
1484
+ "button",
1485
+ {
1486
+ type: "button",
1487
+ className: `tsmc-btn tsmc-btn-sm ${activeTab === "tla" ? "tsmc-btn-primary" : ""}`,
1488
+ onClick: () => setActiveTab("tla"),
1489
+ children: [
1490
+ spec.moduleName,
1491
+ ".tla"
1492
+ ]
1493
+ }
1494
+ ),
1495
+ /* @__PURE__ */ jsxRuntime.jsxs(
1496
+ "button",
1497
+ {
1498
+ type: "button",
1499
+ className: `tsmc-btn tsmc-btn-sm ${activeTab === "cfg" ? "tsmc-btn-primary" : ""}`,
1500
+ onClick: () => setActiveTab("cfg"),
1501
+ children: [
1502
+ spec.moduleName,
1503
+ ".cfg"
1504
+ ]
1505
+ }
1506
+ )
1507
+ ] }),
1508
+ output.ok && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 6 }, children: [
1509
+ /* @__PURE__ */ jsxRuntime.jsxs(
1510
+ "button",
1511
+ {
1512
+ type: "button",
1513
+ className: "tsmc-btn tsmc-btn-sm",
1514
+ onClick: handleCopy,
1515
+ children: [
1516
+ copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { size: 12 }),
1517
+ copied ? "Copied" : "Copy"
1518
+ ]
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ jsxRuntime.jsxs(
1522
+ "button",
1523
+ {
1524
+ type: "button",
1525
+ className: "tsmc-btn tsmc-btn-sm",
1526
+ onClick: () => handleDownload(
1527
+ activeTab === "tla" ? `${spec.moduleName}.tla` : `${spec.moduleName}.cfg`,
1528
+ content
1529
+ ),
1530
+ children: [
1531
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { size: 12 }),
1532
+ " Download"
1533
+ ]
1534
+ }
1535
+ )
1536
+ ] })
1537
+ ] }),
1538
+ /* @__PURE__ */ jsxRuntime.jsx(
1539
+ "pre",
1540
+ {
1541
+ style: {
1542
+ margin: 0,
1543
+ padding: 12,
1544
+ borderRadius: 8,
1545
+ background: "#0f172a",
1546
+ color: "#e2e8f0",
1547
+ fontFamily: "var(--tsmc-mono)",
1548
+ fontSize: 12,
1549
+ overflow: "auto",
1550
+ maxHeight: 420
1551
+ },
1552
+ children: content
1553
+ }
1554
+ )
1555
+ ] })
1556
+ ] }) });
1557
+ }
1558
+ function useModelChecker(defaultCreateWorker) {
1559
+ const [isRunning, setIsRunning] = react.useState(false);
1560
+ const [progress, setProgress] = react.useState(null);
1561
+ const [result, setResult] = react.useState(null);
1562
+ const [error, setError] = react.useState(null);
1563
+ const abortRef = react.useRef(null);
1564
+ const cancel = react.useCallback(() => {
1565
+ abortRef.current?.abort();
1566
+ abortRef.current = null;
1567
+ setIsRunning(false);
1568
+ }, []);
1569
+ const reset = react.useCallback(() => {
1570
+ cancel();
1571
+ setProgress(null);
1572
+ setResult(null);
1573
+ setError(null);
1574
+ }, [cancel]);
1575
+ const verify = react.useCallback(
1576
+ async (spec, options = {}) => {
1577
+ abortRef.current?.abort();
1578
+ const controller = new AbortController();
1579
+ abortRef.current = controller;
1580
+ setIsRunning(true);
1581
+ setProgress(null);
1582
+ setError(null);
1583
+ try {
1584
+ const res = await worker.runModelCheckAsync(spec, {
1585
+ ...options,
1586
+ createWorker: options.createWorker ?? defaultCreateWorker,
1587
+ signal: controller.signal,
1588
+ onProgress: (p) => setProgress(p)
1589
+ });
1590
+ if (!controller.signal.aborted) {
1591
+ setResult(res);
1592
+ setIsRunning(false);
1593
+ }
1594
+ return res;
1595
+ } catch (err) {
1596
+ if (!controller.signal.aborted) {
1597
+ setError(err instanceof Error ? err.message : String(err));
1598
+ setIsRunning(false);
1599
+ }
1600
+ return null;
1601
+ }
1602
+ },
1603
+ [defaultCreateWorker]
1604
+ );
1605
+ return {
1606
+ isRunning,
1607
+ progress,
1608
+ result,
1609
+ error,
1610
+ verify,
1611
+ cancel,
1612
+ reset
1613
+ };
1614
+ }
1615
+
1616
+ exports.ActionEditorModal = ActionEditorModal;
1617
+ exports.ActionNode = ActionNode;
1618
+ exports.ExprBuilder = ExprBuilder;
1619
+ exports.FormalCanvas = FormalCanvas;
1620
+ exports.InitEditorModal = InitEditorModal;
1621
+ exports.InitNode = InitNode;
1622
+ exports.PropertiesPanel = PropertiesPanel;
1623
+ exports.TlaExportModal = TlaExportModal;
1624
+ exports.TracePlayer = TracePlayer;
1625
+ exports.formatExpr = formatExpr;
1626
+ exports.useModelChecker = useModelChecker;
1627
+ //# sourceMappingURL=index.cjs.map
1628
+ //# sourceMappingURL=index.cjs.map