@goplasmatic/dataflow-ui 2.0.7 → 2.0.8

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 CHANGED
@@ -207,6 +207,17 @@ const CircleCheckBig = createLucideIcon("CircleCheckBig", [
207
207
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
208
208
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
209
209
  ]);
210
+ /**
211
+ * @license lucide-react v0.462.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */
216
+ const CircleX = createLucideIcon("CircleX", [
217
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
218
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
219
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
220
+ ]);
210
221
  /**
211
222
  * @license lucide-react v0.462.0 - ISC
212
223
  *
@@ -313,6 +324,15 @@ const ListTree = createLucideIcon("ListTree", [
313
324
  ["path", { d: "M3 6v4c0 1.1.9 2 2 2h3", key: "1ywdgy" }],
314
325
  ["path", { d: "M3 10v6c0 1.1.9 2 2 2h3", key: "2wc746" }]
315
326
  ]);
327
+ /**
328
+ * @license lucide-react v0.462.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */
333
+ const LoaderCircle = createLucideIcon("LoaderCircle", [
334
+ ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
335
+ ]);
316
336
  /**
317
337
  * @license lucide-react v0.462.0 - ISC
318
338
  *
@@ -11070,7 +11090,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
11070
11090
  }
11071
11091
  ]
11072
11092
  ];
11073
- const CircleX = createLucideIcon2("circle-x", __iconNode$l);
11093
+ const CircleX2 = createLucideIcon2("circle-x", __iconNode$l);
11074
11094
  const __iconNode$k = [
11075
11095
  [
11076
11096
  "path",
@@ -11698,7 +11718,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
11698
11718
  "database": Database,
11699
11719
  "boxes": Boxes,
11700
11720
  "circle-help": CircleQuestionMark,
11701
- "circle-x": CircleX,
11721
+ "circle-x": CircleX2,
11702
11722
  "git-commit-horizontal": GitCommitHorizontal,
11703
11723
  "search": Search2,
11704
11724
  "divide": Divide,
@@ -19755,7 +19775,7 @@ function WorkflowFlowView({
19755
19775
  }
19756
19776
  function DataLogicView({ value }) {
19757
19777
  const { resolvedTheme } = useTheme();
19758
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-content", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-logic-editor", children: /* @__PURE__ */ jsxRuntime.jsx(
19778
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-content", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-logic-editor", "data-theme": resolvedTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
19759
19779
  DataLogicEditor,
19760
19780
  {
19761
19781
  value,
@@ -20425,1854 +20445,2124 @@ function TreeView({ workflows, selection: selection2, onSelect, debugMode = fals
20425
20445
  }
20426
20446
  ) });
20427
20447
  }
20428
- function SearchInput({
20429
- value,
20430
- onChange,
20431
- onClear,
20432
- placeholder = "Search...",
20433
- className = ""
20434
- }) {
20435
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-search-input ${className}`, children: [
20436
- /* @__PURE__ */ jsxRuntime.jsx(Search, { className: "df-search-icon", size: 16 }),
20437
- /* @__PURE__ */ jsxRuntime.jsx(
20438
- "input",
20439
- {
20440
- type: "text",
20441
- value,
20442
- onChange: (e) => onChange(e.target.value),
20443
- placeholder,
20444
- className: "df-search-field"
20448
+ function DebuggerControls({ compact = false, className = "" }) {
20449
+ const {
20450
+ state,
20451
+ play,
20452
+ pause,
20453
+ stop,
20454
+ reset,
20455
+ stepForward,
20456
+ stepBackward,
20457
+ setSpeed,
20458
+ isAtStart,
20459
+ isAtEnd,
20460
+ hasTrace,
20461
+ progress,
20462
+ totalSteps
20463
+ } = useDebugger();
20464
+ const { playbackState, playbackSpeed, currentStepIndex, isExecuting } = state;
20465
+ const handleKeyDown = require$$0.useCallback(
20466
+ (e) => {
20467
+ if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
20468
+ return;
20445
20469
  }
20446
- ),
20447
- value && onClear && /* @__PURE__ */ jsxRuntime.jsx(
20448
- "button",
20449
- {
20450
- onClick: onClear,
20451
- className: "df-search-clear",
20452
- "aria-label": "Clear search",
20453
- children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
20470
+ switch (e.key) {
20471
+ case " ":
20472
+ e.preventDefault();
20473
+ if (playbackState === "playing") {
20474
+ pause();
20475
+ } else if (hasTrace) {
20476
+ play();
20477
+ }
20478
+ break;
20479
+ case "ArrowRight":
20480
+ e.preventDefault();
20481
+ if (hasTrace && !isAtEnd) {
20482
+ stepForward();
20483
+ }
20484
+ break;
20485
+ case "ArrowLeft":
20486
+ e.preventDefault();
20487
+ if (hasTrace && !isAtStart) {
20488
+ stepBackward();
20489
+ }
20490
+ break;
20491
+ case "Escape":
20492
+ e.preventDefault();
20493
+ stop();
20494
+ break;
20495
+ case "r":
20496
+ if (e.metaKey || e.ctrlKey) {
20497
+ e.preventDefault();
20498
+ reset();
20499
+ }
20500
+ break;
20454
20501
  }
20455
- )
20502
+ },
20503
+ [playbackState, hasTrace, isAtEnd, isAtStart, play, pause, stop, stepForward, stepBackward, reset]
20504
+ );
20505
+ require$$0.useEffect(() => {
20506
+ window.addEventListener("keydown", handleKeyDown);
20507
+ return () => window.removeEventListener("keydown", handleKeyDown);
20508
+ }, [handleKeyDown]);
20509
+ const handleSpeedChange = (e) => {
20510
+ setSpeed(Number(e.target.value));
20511
+ };
20512
+ if (compact) {
20513
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-controls df-debug-controls-compact ${className}`, children: [
20514
+ /* @__PURE__ */ jsxRuntime.jsx(
20515
+ "button",
20516
+ {
20517
+ className: "df-debug-btn",
20518
+ onClick: stepBackward,
20519
+ disabled: !hasTrace || isAtStart || isExecuting,
20520
+ title: "Previous step (Left Arrow)",
20521
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipBack, { size: 16 })
20522
+ }
20523
+ ),
20524
+ playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
20525
+ "button",
20526
+ {
20527
+ className: "df-debug-btn df-debug-btn-primary",
20528
+ onClick: pause,
20529
+ disabled: !hasTrace || isExecuting,
20530
+ title: "Pause (Space)",
20531
+ children: /* @__PURE__ */ jsxRuntime.jsx(Pause, { size: 18 })
20532
+ }
20533
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
20534
+ "button",
20535
+ {
20536
+ className: "df-debug-btn df-debug-btn-primary",
20537
+ onClick: play,
20538
+ disabled: !hasTrace || isAtEnd || isExecuting,
20539
+ title: "Play (Space)",
20540
+ children: /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 18 })
20541
+ }
20542
+ ),
20543
+ /* @__PURE__ */ jsxRuntime.jsx(
20544
+ "button",
20545
+ {
20546
+ className: "df-debug-btn",
20547
+ onClick: stepForward,
20548
+ disabled: !hasTrace || isAtEnd || isExecuting,
20549
+ title: "Next step (Right Arrow)",
20550
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 16 })
20551
+ }
20552
+ ),
20553
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-step-counter", children: [
20554
+ currentStepIndex + 1,
20555
+ " / ",
20556
+ totalSteps
20557
+ ] })
20558
+ ] });
20559
+ }
20560
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-controls ${className}`, children: [
20561
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-controls-main", children: [
20562
+ /* @__PURE__ */ jsxRuntime.jsx(
20563
+ "button",
20564
+ {
20565
+ className: "df-debug-btn",
20566
+ onClick: stop,
20567
+ disabled: !hasTrace || isExecuting,
20568
+ title: "Stop (Escape)",
20569
+ children: /* @__PURE__ */ jsxRuntime.jsx(Square, { size: 20 })
20570
+ }
20571
+ ),
20572
+ /* @__PURE__ */ jsxRuntime.jsx(
20573
+ "button",
20574
+ {
20575
+ className: "df-debug-btn",
20576
+ onClick: stepBackward,
20577
+ disabled: !hasTrace || isAtStart || isExecuting,
20578
+ title: "Previous step (Left Arrow)",
20579
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipBack, { size: 20 })
20580
+ }
20581
+ ),
20582
+ playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
20583
+ "button",
20584
+ {
20585
+ className: "df-debug-btn df-debug-btn-primary",
20586
+ onClick: pause,
20587
+ disabled: !hasTrace || isExecuting,
20588
+ title: "Pause (Space)",
20589
+ children: /* @__PURE__ */ jsxRuntime.jsx(Pause, { size: 24 })
20590
+ }
20591
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
20592
+ "button",
20593
+ {
20594
+ className: "df-debug-btn df-debug-btn-primary",
20595
+ onClick: play,
20596
+ disabled: !hasTrace || isAtEnd || isExecuting,
20597
+ title: "Play (Space)",
20598
+ children: /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 24 })
20599
+ }
20600
+ ),
20601
+ /* @__PURE__ */ jsxRuntime.jsx(
20602
+ "button",
20603
+ {
20604
+ className: "df-debug-btn",
20605
+ onClick: stepForward,
20606
+ disabled: !hasTrace || isAtEnd || isExecuting,
20607
+ title: "Next step (Right Arrow)",
20608
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 20 })
20609
+ }
20610
+ ),
20611
+ /* @__PURE__ */ jsxRuntime.jsx(
20612
+ "button",
20613
+ {
20614
+ className: "df-debug-btn",
20615
+ onClick: reset,
20616
+ disabled: !hasTrace || isExecuting,
20617
+ title: "Reset (Ctrl+R)",
20618
+ children: /* @__PURE__ */ jsxRuntime.jsx(RotateCcw, { size: 20 })
20619
+ }
20620
+ )
20621
+ ] }),
20622
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-progress", children: [
20623
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-progress-bar", children: /* @__PURE__ */ jsxRuntime.jsx(
20624
+ "div",
20625
+ {
20626
+ className: "df-debug-progress-fill",
20627
+ style: { width: `${progress * 100}%` }
20628
+ }
20629
+ ) }),
20630
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-step-counter", children: [
20631
+ "Step ",
20632
+ currentStepIndex + 1,
20633
+ " of ",
20634
+ totalSteps
20635
+ ] })
20636
+ ] }),
20637
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-speed", children: [
20638
+ /* @__PURE__ */ jsxRuntime.jsx(Gauge, { size: 14 }),
20639
+ /* @__PURE__ */ jsxRuntime.jsx(
20640
+ "input",
20641
+ {
20642
+ type: "range",
20643
+ min: "100",
20644
+ max: "2000",
20645
+ step: "100",
20646
+ value: playbackSpeed,
20647
+ onChange: handleSpeedChange,
20648
+ className: "df-debug-speed-slider",
20649
+ title: `Playback speed: ${playbackSpeed}ms`
20650
+ }
20651
+ ),
20652
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-speed-label", children: [
20653
+ playbackSpeed,
20654
+ "ms"
20655
+ ] })
20656
+ ] })
20456
20657
  ] });
20457
20658
  }
20458
- function JsonViewer({
20459
- data,
20460
- initialExpanded = false,
20461
- maxStringLength = 50,
20659
+ function MessageInputPanel({
20660
+ onExecute,
20661
+ isExecuting = false,
20462
20662
  className = ""
20463
20663
  }) {
20464
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-json-viewer ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
20465
- JsonNode,
20466
- {
20467
- data,
20468
- initialExpanded,
20469
- maxStringLength
20470
- }
20471
- ) });
20472
- }
20473
- function JsonNode({
20474
- data,
20475
- initialExpanded,
20476
- maxStringLength,
20477
- keyName,
20478
- isLast = true
20479
- }) {
20480
- const [expanded, setExpanded] = require$$0.useState(initialExpanded);
20481
- const renderValue = () => {
20482
- if (data === null) {
20483
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-null", children: "null" });
20484
- }
20485
- if (data === void 0) {
20486
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-undefined", children: "undefined" });
20487
- }
20488
- if (typeof data === "boolean") {
20489
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-boolean", children: data.toString() });
20490
- }
20491
- if (typeof data === "number") {
20492
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-number", children: data });
20664
+ const { setInputPayload, state } = useDebugger();
20665
+ const { inputPayload } = state;
20666
+ const [expandedSections, setExpandedSections] = require$$0.useState(
20667
+ /* @__PURE__ */ new Set(["payload"])
20668
+ );
20669
+ const [editingSection, setEditingSection] = require$$0.useState(null);
20670
+ const [editText, setEditText] = require$$0.useState("");
20671
+ const [parseError, setParseError] = require$$0.useState(null);
20672
+ const payload = inputPayload || {};
20673
+ const toggleSection = (section) => {
20674
+ setExpandedSections((prev) => {
20675
+ const next = new Set(prev);
20676
+ if (next.has(section)) {
20677
+ next.delete(section);
20678
+ } else {
20679
+ next.add(section);
20680
+ }
20681
+ return next;
20682
+ });
20683
+ };
20684
+ const startEditing = () => {
20685
+ setEditingSection("payload");
20686
+ setEditText(JSON.stringify(payload, null, 2));
20687
+ setParseError(null);
20688
+ };
20689
+ const cancelEditing = () => {
20690
+ setEditingSection(null);
20691
+ setEditText("");
20692
+ setParseError(null);
20693
+ };
20694
+ const saveEditing = require$$0.useCallback(() => {
20695
+ if (!editingSection) return;
20696
+ try {
20697
+ const parsed = JSON.parse(editText);
20698
+ setInputPayload(parsed);
20699
+ setEditingSection(null);
20700
+ setEditText("");
20701
+ setParseError(null);
20702
+ } catch (err) {
20703
+ setParseError(err instanceof Error ? err.message : "Invalid JSON");
20493
20704
  }
20494
- if (typeof data === "string") {
20495
- const display = data.length > maxStringLength ? `${data.slice(0, maxStringLength)}...` : data;
20496
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-string", children: [
20497
- '"',
20498
- display,
20499
- '"'
20500
- ] });
20705
+ }, [editingSection, editText, setInputPayload]);
20706
+ const handleLoadSample = () => {
20707
+ setInputPayload({
20708
+ id: "123",
20709
+ name: "John Doe",
20710
+ email: "john@example.com",
20711
+ amount: 100
20712
+ });
20713
+ };
20714
+ const handleClear = () => {
20715
+ setInputPayload({});
20716
+ };
20717
+ const formatValue2 = (value) => {
20718
+ if (Object.keys(value).length === 0) {
20719
+ return "(empty)";
20501
20720
  }
20502
- if (Array.isArray(data)) {
20503
- if (data.length === 0) {
20504
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "[]" });
20505
- }
20506
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-array", children: [
20507
- /* @__PURE__ */ jsxRuntime.jsx(
20721
+ return JSON.stringify(value, null, 2);
20722
+ };
20723
+ const isEmptyPayload = Object.keys(payload).length === 0;
20724
+ const isExpanded = expandedSections.has("payload");
20725
+ const isEditing = editingSection === "payload";
20726
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-input-panel ${className}`, children: [
20727
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-header", children: [
20728
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-input-title", children: "Test Payload" }),
20729
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-actions", children: [
20730
+ /* @__PURE__ */ jsxRuntime.jsxs(
20508
20731
  "button",
20509
20732
  {
20510
- onClick: () => setExpanded(!expanded),
20511
- className: "df-json-toggle",
20512
- children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 12 })
20733
+ className: "df-debug-btn-sm",
20734
+ onClick: handleLoadSample,
20735
+ title: "Load sample data",
20736
+ children: [
20737
+ /* @__PURE__ */ jsxRuntime.jsx(FileJson, { size: 12 }),
20738
+ "Sample"
20739
+ ]
20513
20740
  }
20514
20741
  ),
20515
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "[" }),
20516
- !expanded && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-preview", children: [
20517
- data.length,
20518
- " item",
20519
- data.length !== 1 ? "s" : ""
20520
- ] }),
20521
- expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-json-children", children: data.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(
20522
- JsonNode,
20742
+ /* @__PURE__ */ jsxRuntime.jsxs(
20743
+ "button",
20523
20744
  {
20524
- data: item,
20525
- initialExpanded: false,
20526
- maxStringLength,
20527
- isLast: index2 === data.length - 1
20528
- },
20529
- index2
20530
- )) }),
20531
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "]" })
20532
- ] });
20533
- }
20534
- if (typeof data === "object") {
20535
- const entries = Object.entries(data);
20536
- if (entries.length === 0) {
20537
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "{}" });
20538
- }
20539
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-object", children: [
20745
+ className: "df-debug-btn-sm",
20746
+ onClick: handleClear,
20747
+ title: "Clear all data",
20748
+ children: [
20749
+ /* @__PURE__ */ jsxRuntime.jsx(RefreshCw, { size: 12 }),
20750
+ "Clear"
20751
+ ]
20752
+ }
20753
+ )
20754
+ ] })
20755
+ ] }),
20756
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-sections", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-section", children: [
20757
+ /* @__PURE__ */ jsxRuntime.jsxs(
20758
+ "div",
20759
+ {
20760
+ className: "df-debug-input-section-header",
20761
+ onClick: () => !isEditing && toggleSection("payload"),
20762
+ children: [
20763
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-toggle", children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14 }) }),
20764
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-label", children: "Payload" }),
20765
+ isEmptyPayload && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-empty", children: "(empty)" }),
20766
+ !isEditing && /* @__PURE__ */ jsxRuntime.jsx(
20767
+ "button",
20768
+ {
20769
+ className: "df-debug-section-edit",
20770
+ onClick: (e) => {
20771
+ e.stopPropagation();
20772
+ startEditing();
20773
+ },
20774
+ title: "Edit Payload",
20775
+ children: "Edit"
20776
+ }
20777
+ )
20778
+ ]
20779
+ }
20780
+ ),
20781
+ isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-section-content", children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-editor", children: [
20540
20782
  /* @__PURE__ */ jsxRuntime.jsx(
20541
- "button",
20783
+ "textarea",
20542
20784
  {
20543
- onClick: () => setExpanded(!expanded),
20544
- className: "df-json-toggle",
20545
- children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 12 })
20785
+ className: "df-debug-input-textarea",
20786
+ value: editText,
20787
+ onChange: (e) => setEditText(e.target.value),
20788
+ placeholder: "Enter payload as JSON...",
20789
+ spellCheck: false
20546
20790
  }
20547
20791
  ),
20548
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "{" }),
20549
- !expanded && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-preview", children: [
20550
- entries.length,
20551
- " key",
20552
- entries.length !== 1 ? "s" : ""
20553
- ] }),
20554
- expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-json-children", children: entries.map(([key, value], index2) => /* @__PURE__ */ jsxRuntime.jsx(
20555
- JsonNode,
20556
- {
20557
- keyName: key,
20558
- data: value,
20559
- initialExpanded: false,
20560
- maxStringLength,
20561
- isLast: index2 === entries.length - 1
20562
- },
20563
- key
20564
- )) }),
20565
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "}" })
20566
- ] });
20567
- }
20568
- return /* @__PURE__ */ jsxRuntime.jsx("span", { children: String(data) });
20569
- };
20570
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-json-node", children: [
20571
- keyName !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20572
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-key", children: [
20573
- '"',
20574
- keyName,
20575
- '"'
20576
- ] }),
20577
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-colon", children: ": " })
20578
- ] }),
20579
- renderValue(),
20580
- !isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-comma", children: "," })
20581
- ] });
20582
- }
20583
- function _arrayLikeToArray(r, a) {
20584
- (null == a || a > r.length) && (a = r.length);
20585
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
20586
- return n;
20587
- }
20588
- function _arrayWithHoles(r) {
20589
- if (Array.isArray(r)) return r;
20590
- }
20591
- function _defineProperty$1(e, r, t) {
20592
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
20593
- value: t,
20594
- enumerable: true,
20595
- configurable: true,
20596
- writable: true
20597
- }) : e[r] = t, e;
20598
- }
20599
- function _iterableToArrayLimit(r, l2) {
20600
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
20601
- if (null != t) {
20602
- var e, n, i, u, a = [], f = true, o = false;
20603
- try {
20604
- if (i = (t = t.call(r)).next, 0 === l2) ;
20605
- else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l2); f = true) ;
20606
- } catch (r2) {
20607
- o = true, n = r2;
20608
- } finally {
20609
- try {
20610
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
20611
- } finally {
20612
- if (o) throw n;
20613
- }
20614
- }
20615
- return a;
20616
- }
20617
- }
20618
- function _nonIterableRest() {
20619
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20620
- }
20621
- function ownKeys$1(e, r) {
20622
- var t = Object.keys(e);
20623
- if (Object.getOwnPropertySymbols) {
20624
- var o = Object.getOwnPropertySymbols(e);
20625
- r && (o = o.filter(function(r2) {
20626
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
20627
- })), t.push.apply(t, o);
20628
- }
20629
- return t;
20630
- }
20631
- function _objectSpread2$1(e) {
20632
- for (var r = 1; r < arguments.length; r++) {
20633
- var t = null != arguments[r] ? arguments[r] : {};
20634
- r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
20635
- _defineProperty$1(e, r2, t[r2]);
20636
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
20637
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
20638
- });
20639
- }
20640
- return e;
20641
- }
20642
- function _objectWithoutProperties(e, t) {
20643
- if (null == e) return {};
20644
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
20645
- if (Object.getOwnPropertySymbols) {
20646
- var n = Object.getOwnPropertySymbols(e);
20647
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
20648
- }
20649
- return i;
20650
- }
20651
- function _objectWithoutPropertiesLoose(r, e) {
20652
- if (null == r) return {};
20653
- var t = {};
20654
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
20655
- if (-1 !== e.indexOf(n)) continue;
20656
- t[n] = r[n];
20657
- }
20658
- return t;
20659
- }
20660
- function _slicedToArray(r, e) {
20661
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
20662
- }
20663
- function _toPrimitive(t, r) {
20664
- if ("object" != typeof t || !t) return t;
20665
- var e = t[Symbol.toPrimitive];
20666
- if (void 0 !== e) {
20667
- var i = e.call(t, r);
20668
- if ("object" != typeof i) return i;
20669
- throw new TypeError("@@toPrimitive must return a primitive value.");
20670
- }
20671
- return ("string" === r ? String : Number)(t);
20672
- }
20673
- function _toPropertyKey(t) {
20674
- var i = _toPrimitive(t, "string");
20675
- return "symbol" == typeof i ? i : i + "";
20676
- }
20677
- function _unsupportedIterableToArray(r, a) {
20678
- if (r) {
20679
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
20680
- var t = {}.toString.call(r).slice(8, -1);
20681
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
20682
- }
20792
+ parseError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-error", children: parseError }),
20793
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-editor-actions", children: [
20794
+ /* @__PURE__ */ jsxRuntime.jsx(
20795
+ "button",
20796
+ {
20797
+ className: "df-debug-btn-sm df-debug-btn-cancel",
20798
+ onClick: cancelEditing,
20799
+ children: "Cancel"
20800
+ }
20801
+ ),
20802
+ /* @__PURE__ */ jsxRuntime.jsx(
20803
+ "button",
20804
+ {
20805
+ className: "df-debug-btn-sm df-debug-btn-save",
20806
+ onClick: saveEditing,
20807
+ children: "Save"
20808
+ }
20809
+ )
20810
+ ] })
20811
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "df-debug-input-preview", children: formatValue2(payload) }) })
20812
+ ] }) }),
20813
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-footer", children: /* @__PURE__ */ jsxRuntime.jsx(
20814
+ "button",
20815
+ {
20816
+ className: "df-debug-run-btn",
20817
+ onClick: onExecute,
20818
+ disabled: isExecuting,
20819
+ children: isExecuting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20820
+ /* @__PURE__ */ jsxRuntime.jsx(RefreshCw, { size: 14, className: "df-debug-spin" }),
20821
+ "Executing..."
20822
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20823
+ /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 14 }),
20824
+ "Run Debug"
20825
+ ] })
20826
+ }
20827
+ ) })
20828
+ ] });
20683
20829
  }
20684
- function _defineProperty(obj, key, value) {
20685
- if (key in obj) {
20686
- Object.defineProperty(obj, key, {
20687
- value,
20688
- enumerable: true,
20689
- configurable: true,
20690
- writable: true
20691
- });
20692
- } else {
20693
- obj[key] = value;
20830
+ function MessageStatePanel({ className = "" }) {
20831
+ const { currentStep, currentMessage, currentChanges } = useDebugger();
20832
+ const [activeTab, setActiveTab] = require$$0.useState("message");
20833
+ if (!currentStep || !currentMessage) {
20834
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-debug-state-panel df-debug-state-empty ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No step selected. Run debug to see message state changes." }) });
20694
20835
  }
20695
- return obj;
20836
+ const { workflow_id, task_id, result } = currentStep;
20837
+ const tabs = [
20838
+ { key: "message", label: "Message" },
20839
+ { key: "changes", label: `Changes (${currentChanges.length})` }
20840
+ ];
20841
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-state-panel ${className}`, children: [
20842
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-state-header", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-state-tabs", children: tabs.map(({ key, label }) => /* @__PURE__ */ jsxRuntime.jsx(
20843
+ "button",
20844
+ {
20845
+ className: `df-debug-state-tab ${activeTab === key ? "df-debug-state-tab-active" : ""}`,
20846
+ onClick: () => setActiveTab(key),
20847
+ children: label
20848
+ },
20849
+ key
20850
+ )) }) }),
20851
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-content", children: [
20852
+ activeTab === "message" && /* @__PURE__ */ jsxRuntime.jsx(MessageView, { message: currentMessage }),
20853
+ activeTab === "changes" && /* @__PURE__ */ jsxRuntime.jsx(ChangesView, { changes: currentChanges })
20854
+ ] }),
20855
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-footer", children: [
20856
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-step-type", children: [
20857
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-state-badge df-debug-state-badge-${result}`, children: result }),
20858
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-state-type-label", children: [
20859
+ workflow_id,
20860
+ task_id ? ` / ${task_id}` : ""
20861
+ ] })
20862
+ ] }),
20863
+ currentMessage.errors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-error", children: [
20864
+ "Errors: ",
20865
+ currentMessage.errors.length
20866
+ ] })
20867
+ ] })
20868
+ ] });
20696
20869
  }
20697
- function ownKeys(object2, enumerableOnly) {
20698
- var keys = Object.keys(object2);
20699
- if (Object.getOwnPropertySymbols) {
20700
- var symbols = Object.getOwnPropertySymbols(object2);
20701
- if (enumerableOnly) symbols = symbols.filter(function(sym) {
20702
- return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
20870
+ function MessageView({ message }) {
20871
+ const [expandedSections, setExpandedSections] = require$$0.useState(
20872
+ /* @__PURE__ */ new Set(["context"])
20873
+ );
20874
+ const toggleSection = (section) => {
20875
+ setExpandedSections((prev) => {
20876
+ const next = new Set(prev);
20877
+ if (next.has(section)) {
20878
+ next.delete(section);
20879
+ } else {
20880
+ next.add(section);
20881
+ }
20882
+ return next;
20703
20883
  });
20704
- keys.push.apply(keys, symbols);
20705
- }
20706
- return keys;
20884
+ };
20885
+ const sections = [
20886
+ { key: "context", value: message.context },
20887
+ { key: "payload", value: message.payload },
20888
+ { key: "errors", value: message.errors },
20889
+ { key: "audit_trail", value: message.audit_trail }
20890
+ ];
20891
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-message-view", children: sections.map(({ key, value }) => {
20892
+ const isExpanded = expandedSections.has(key);
20893
+ const isEmpty2 = Array.isArray(value) ? value.length === 0 : typeof value === "object" && value !== null ? Object.keys(value).length === 0 : !value;
20894
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-message-section", children: [
20895
+ /* @__PURE__ */ jsxRuntime.jsxs(
20896
+ "div",
20897
+ {
20898
+ className: "df-debug-message-section-header",
20899
+ onClick: () => toggleSection(key),
20900
+ children: [
20901
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-arrow", children: isExpanded ? "▼" : "▶" }),
20902
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-key", children: key }),
20903
+ isEmpty2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-empty", children: "(empty)" })
20904
+ ]
20905
+ }
20906
+ ),
20907
+ isExpanded && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "df-debug-message-section-content", children: JSON.stringify(value, null, 2) })
20908
+ ] }, key);
20909
+ }) });
20707
20910
  }
20708
- function _objectSpread2(target) {
20709
- for (var i = 1; i < arguments.length; i++) {
20710
- var source = arguments[i] != null ? arguments[i] : {};
20711
- if (i % 2) {
20712
- ownKeys(Object(source), true).forEach(function(key) {
20713
- _defineProperty(target, key, source[key]);
20714
- });
20715
- } else if (Object.getOwnPropertyDescriptors) {
20716
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
20717
- } else {
20718
- ownKeys(Object(source)).forEach(function(key) {
20719
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
20720
- });
20721
- }
20911
+ function ChangesView({ changes }) {
20912
+ if (changes.length === 0) {
20913
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-changes-empty", children: "No changes recorded in this step" });
20722
20914
  }
20723
- return target;
20915
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-changes-view", children: changes.map((change, index2) => {
20916
+ const isModified = change.old_value !== void 0 && change.new_value !== void 0;
20917
+ const isAdded = change.old_value === void 0 && change.new_value !== void 0;
20918
+ const isRemoved = change.old_value !== void 0 && change.new_value === void 0;
20919
+ const changeType = isAdded ? "added" : isRemoved ? "removed" : "modified";
20920
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-change-item df-debug-change-${changeType}`, children: [
20921
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-change-header", children: [
20922
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-change-op df-debug-change-op-${changeType}`, children: changeType }),
20923
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-path", children: change.path })
20924
+ ] }),
20925
+ isModified && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-change-values", children: [
20926
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-old", children: formatValue(change.old_value) }),
20927
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-arrow", children: "→" }),
20928
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-new", children: formatValue(change.new_value) })
20929
+ ] }),
20930
+ isAdded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-change-values", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-new", children: formatValue(change.new_value) }) }),
20931
+ isRemoved && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-change-values", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-old", children: formatValue(change.old_value) }) })
20932
+ ] }, index2);
20933
+ }) });
20724
20934
  }
20725
- function compose$1() {
20726
- for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
20727
- fns[_key] = arguments[_key];
20728
- }
20729
- return function(x) {
20730
- return fns.reduceRight(function(y, f) {
20731
- return f(y);
20732
- }, x);
20733
- };
20935
+ function formatValue(value) {
20936
+ if (value === void 0) return "undefined";
20937
+ if (value === null) return "null";
20938
+ if (typeof value === "string") return `"${value}"`;
20939
+ if (typeof value === "object") return JSON.stringify(value);
20940
+ return String(value);
20734
20941
  }
20735
- function curry$1(fn) {
20736
- return function curried() {
20737
- var _this = this;
20738
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
20739
- args[_key2] = arguments[_key2];
20740
- }
20741
- return args.length >= fn.length ? fn.apply(this, args) : function() {
20742
- for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
20743
- nextArgs[_key3] = arguments[_key3];
20942
+ function DebugInfoBubble({
20943
+ step,
20944
+ targetRef,
20945
+ visible,
20946
+ onClose
20947
+ }) {
20948
+ var _a;
20949
+ const [position, setPosition] = require$$0.useState({ top: 0, left: 0 });
20950
+ const bubbleRef = require$$0.useRef(null);
20951
+ require$$0.useEffect(() => {
20952
+ if (!visible || !targetRef.current) return;
20953
+ const updatePosition = () => {
20954
+ var _a2, _b;
20955
+ const targetRect = (_a2 = targetRef.current) == null ? void 0 : _a2.getBoundingClientRect();
20956
+ const bubbleRect = (_b = bubbleRef.current) == null ? void 0 : _b.getBoundingClientRect();
20957
+ if (!targetRect) return;
20958
+ let top = targetRect.bottom + 8;
20959
+ let left = targetRect.left;
20960
+ if (bubbleRect) {
20961
+ if (left + bubbleRect.width > window.innerWidth - 16) {
20962
+ left = window.innerWidth - bubbleRect.width - 16;
20963
+ }
20964
+ if (top + bubbleRect.height > window.innerHeight - 16) {
20965
+ top = targetRect.top - bubbleRect.height - 8;
20966
+ }
20744
20967
  }
20745
- return curried.apply(_this, [].concat(args, nextArgs));
20968
+ setPosition({ top, left });
20746
20969
  };
20747
- };
20748
- }
20749
- function isObject$1(value) {
20750
- return {}.toString.call(value).includes("Object");
20751
- }
20752
- function isEmpty(obj) {
20753
- return !Object.keys(obj).length;
20754
- }
20755
- function isFunction(value) {
20756
- return typeof value === "function";
20757
- }
20758
- function hasOwnProperty(object2, property) {
20759
- return Object.prototype.hasOwnProperty.call(object2, property);
20760
- }
20761
- function validateChanges(initial, changes) {
20762
- if (!isObject$1(changes)) errorHandler$1("changeType");
20763
- if (Object.keys(changes).some(function(field) {
20764
- return !hasOwnProperty(initial, field);
20765
- })) errorHandler$1("changeField");
20766
- return changes;
20767
- }
20768
- function validateSelector(selector2) {
20769
- if (!isFunction(selector2)) errorHandler$1("selectorType");
20770
- }
20771
- function validateHandler(handler) {
20772
- if (!(isFunction(handler) || isObject$1(handler))) errorHandler$1("handlerType");
20773
- if (isObject$1(handler) && Object.values(handler).some(function(_handler) {
20774
- return !isFunction(_handler);
20775
- })) errorHandler$1("handlersType");
20776
- }
20777
- function validateInitial(initial) {
20778
- if (!initial) errorHandler$1("initialIsRequired");
20779
- if (!isObject$1(initial)) errorHandler$1("initialType");
20780
- if (isEmpty(initial)) errorHandler$1("initialContent");
20781
- }
20782
- function throwError$1(errorMessages2, type) {
20783
- throw new Error(errorMessages2[type] || errorMessages2["default"]);
20784
- }
20785
- var errorMessages$1 = {
20786
- initialIsRequired: "initial state is required",
20787
- initialType: "initial state should be an object",
20788
- initialContent: "initial state shouldn't be an empty object",
20789
- handlerType: "handler should be an object or a function",
20790
- handlersType: "all handlers should be a functions",
20791
- selectorType: "selector should be a function",
20792
- changeType: "provided value of changes should be an object",
20793
- changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
20794
- "default": "an unknown error accured in `state-local` package"
20795
- };
20796
- var errorHandler$1 = curry$1(throwError$1)(errorMessages$1);
20797
- var validators$1 = {
20798
- changes: validateChanges,
20799
- selector: validateSelector,
20800
- handler: validateHandler,
20801
- initial: validateInitial
20802
- };
20803
- function create(initial) {
20804
- var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
20805
- validators$1.initial(initial);
20806
- validators$1.handler(handler);
20807
- var state = {
20808
- current: initial
20809
- };
20810
- var didUpdate = curry$1(didStateUpdate)(state, handler);
20811
- var update = curry$1(updateState)(state);
20812
- var validate = curry$1(validators$1.changes)(initial);
20813
- var getChanges = curry$1(extractChanges)(state);
20814
- function getState2() {
20815
- var selector2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) {
20816
- return state2;
20970
+ updatePosition();
20971
+ window.addEventListener("scroll", updatePosition, true);
20972
+ window.addEventListener("resize", updatePosition);
20973
+ return () => {
20974
+ window.removeEventListener("scroll", updatePosition, true);
20975
+ window.removeEventListener("resize", updatePosition);
20817
20976
  };
20818
- validators$1.selector(selector2);
20819
- return selector2(state.current);
20820
- }
20821
- function setState2(causedChanges) {
20822
- compose$1(didUpdate, update, validate, getChanges)(causedChanges);
20823
- }
20824
- return [getState2, setState2];
20825
- }
20826
- function extractChanges(state, causedChanges) {
20827
- return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;
20828
- }
20829
- function updateState(state, changes) {
20830
- state.current = _objectSpread2(_objectSpread2({}, state.current), changes);
20831
- return changes;
20832
- }
20833
- function didStateUpdate(state, handler, changes) {
20834
- isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function(field) {
20835
- var _handler$field;
20836
- return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);
20837
- });
20838
- return changes;
20839
- }
20840
- var index = {
20841
- create
20842
- };
20843
- var config$1 = {
20844
- paths: {
20845
- vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
20846
- }
20847
- };
20848
- function curry(fn) {
20849
- return function curried() {
20850
- var _this = this;
20851
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20852
- args[_key] = arguments[_key];
20853
- }
20854
- return args.length >= fn.length ? fn.apply(this, args) : function() {
20855
- for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
20856
- nextArgs[_key2] = arguments[_key2];
20977
+ }, [visible, targetRef]);
20978
+ if (!visible) return null;
20979
+ const { workflow_id, task_id, result, message } = step;
20980
+ const state = result === "executed" ? "executed" : "skipped";
20981
+ const hasError = message && message.errors && message.errors.length > 0;
20982
+ const displayState = hasError ? "error" : state;
20983
+ return reactDom.createPortal(
20984
+ /* @__PURE__ */ jsxRuntime.jsxs(
20985
+ "div",
20986
+ {
20987
+ ref: bubbleRef,
20988
+ className: "df-debug-bubble",
20989
+ style: {
20990
+ position: "fixed",
20991
+ top: position.top,
20992
+ left: position.left
20993
+ },
20994
+ children: [
20995
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-header", children: [
20996
+ /* @__PURE__ */ jsxRuntime.jsx(StateIcon, { state: displayState }),
20997
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-title", children: task_id ? "Task Step" : "Workflow Skipped" }),
20998
+ onClose && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "df-debug-bubble-close", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 }) })
20999
+ ] }),
21000
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-content", children: [
21001
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
21002
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Workflow:" }),
21003
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-value", children: workflow_id })
21004
+ ] }),
21005
+ task_id && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
21006
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Task:" }),
21007
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-value", children: task_id })
21008
+ ] }),
21009
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
21010
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Result:" }),
21011
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-bubble-state df-debug-bubble-state-${displayState}`, children: result })
21012
+ ] }),
21013
+ hasError && (message == null ? void 0 : message.errors) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-error", children: [
21014
+ /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { size: 14 }),
21015
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: ((_a = message.errors[0]) == null ? void 0 : _a.message) || "Unknown error" })
21016
+ ] })
21017
+ ] })
21018
+ ]
20857
21019
  }
20858
- return curried.apply(_this, [].concat(args, nextArgs));
20859
- };
20860
- };
20861
- }
20862
- function isObject(value) {
20863
- return {}.toString.call(value).includes("Object");
21020
+ ),
21021
+ document.body
21022
+ );
20864
21023
  }
20865
- function validateConfig(config2) {
20866
- if (!config2) errorHandler("configIsRequired");
20867
- if (!isObject(config2)) errorHandler("configType");
20868
- if (config2.urls) {
20869
- informAboutDeprecation();
20870
- return {
20871
- paths: {
20872
- vs: config2.urls.monacoBase
20873
- }
20874
- };
21024
+ function StateIcon({ state }) {
21025
+ switch (state) {
21026
+ case "executed":
21027
+ return /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 16, className: "df-debug-icon-executed" });
21028
+ case "skipped":
21029
+ return /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 16, className: "df-debug-icon-skipped" });
21030
+ case "error":
21031
+ return /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { size: 16, className: "df-debug-icon-error" });
21032
+ case "current":
21033
+ return /* @__PURE__ */ jsxRuntime.jsx(Clock, { size: 16, className: "df-debug-icon-current" });
21034
+ case "pending":
21035
+ default:
21036
+ return /* @__PURE__ */ jsxRuntime.jsx(Clock, { size: 16, className: "df-debug-icon-pending" });
20875
21037
  }
20876
- return config2;
20877
- }
20878
- function informAboutDeprecation() {
20879
- console.warn(errorMessages.deprecation);
20880
21038
  }
20881
- function throwError(errorMessages2, type) {
20882
- throw new Error(errorMessages2[type] || errorMessages2["default"]);
21039
+ function DebugStateBadge({
21040
+ state,
21041
+ conditionResult,
21042
+ size = "sm"
21043
+ }) {
21044
+ const iconSize = size === "sm" ? 12 : 14;
21045
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `df-debug-badge df-debug-badge-${state} df-debug-badge-${size}`, children: [
21046
+ /* @__PURE__ */ jsxRuntime.jsx(StateIcon, { state }),
21047
+ conditionResult !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-badge-condition ${conditionResult ? "df-debug-badge-condition-pass" : "df-debug-badge-condition-fail"}`, children: conditionResult ? /* @__PURE__ */ jsxRuntime.jsx(Check, { size: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(X, { size: iconSize }) })
21048
+ ] });
20883
21049
  }
20884
- var errorMessages = {
20885
- configIsRequired: "the configuration object is required",
20886
- configType: "the configuration object should be an object",
20887
- "default": "an unknown error accured in `@monaco-editor/loader` package",
20888
- deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
20889
- };
20890
- var errorHandler = curry(throwError)(errorMessages);
20891
- var validators = {
20892
- config: validateConfig
20893
- };
20894
- var compose = function compose2() {
20895
- for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
20896
- fns[_key] = arguments[_key];
20897
- }
20898
- return function(x) {
20899
- return fns.reduceRight(function(y, f) {
20900
- return f(y);
20901
- }, x);
20902
- };
20903
- };
20904
- function merge(target, source) {
20905
- Object.keys(source).forEach(function(key) {
20906
- if (source[key] instanceof Object) {
20907
- if (target[key]) {
20908
- Object.assign(source[key], merge(target[key], source[key]));
21050
+ function IntegratedDebugToolbar({
21051
+ workflows,
21052
+ payload,
21053
+ autoExecute = false,
21054
+ onExecutionComplete,
21055
+ onExecutionError,
21056
+ className = ""
21057
+ }) {
21058
+ const {
21059
+ state,
21060
+ play,
21061
+ pause,
21062
+ stop,
21063
+ reset,
21064
+ stepForward,
21065
+ stepBackward,
21066
+ startExecution,
21067
+ executeTrace,
21068
+ setExecutionError,
21069
+ runExecution,
21070
+ isAtStart,
21071
+ isAtEnd,
21072
+ hasTrace,
21073
+ totalSteps,
21074
+ isEngineReady
21075
+ } = useDebugger();
21076
+ const { playbackState, currentStepIndex, isExecuting, executionError, trace } = state;
21077
+ const lastExecutionRef = require$$0.useRef(null);
21078
+ const handleExecute = require$$0.useCallback(async () => {
21079
+ var _a, _b;
21080
+ if (!isEngineReady || workflows.length === 0) return;
21081
+ const workflowsJson = JSON.stringify(workflows);
21082
+ const payloadJson = JSON.stringify(payload || {});
21083
+ const current = { workflows: workflowsJson, payload: payloadJson };
21084
+ if (((_a = lastExecutionRef.current) == null ? void 0 : _a.workflows) === current.workflows && ((_b = lastExecutionRef.current) == null ? void 0 : _b.payload) === current.payload) {
21085
+ return;
21086
+ }
21087
+ startExecution();
21088
+ try {
21089
+ const result = await runExecution(workflows, payload || {});
21090
+ if (result) {
21091
+ executeTrace(result);
21092
+ lastExecutionRef.current = current;
21093
+ onExecutionComplete == null ? void 0 : onExecutionComplete(result);
20909
21094
  }
21095
+ } catch (err) {
21096
+ const errorMessage = err instanceof Error ? err.message : "Execution failed";
21097
+ setExecutionError(errorMessage);
21098
+ onExecutionError == null ? void 0 : onExecutionError(errorMessage);
20910
21099
  }
20911
- });
20912
- return _objectSpread2$1(_objectSpread2$1({}, target), source);
20913
- }
20914
- var CANCELATION_MESSAGE = {
20915
- type: "cancelation",
20916
- msg: "operation is manually canceled"
20917
- };
20918
- function makeCancelable(promise) {
20919
- var hasCanceled_ = false;
20920
- var wrappedPromise = new Promise(function(resolve, reject) {
20921
- promise.then(function(val) {
20922
- return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
20923
- });
20924
- promise["catch"](reject);
20925
- });
20926
- return wrappedPromise.cancel = function() {
20927
- return hasCanceled_ = true;
20928
- }, wrappedPromise;
20929
- }
20930
- var _excluded = ["monaco"];
20931
- var _state$create = index.create({
20932
- config: config$1,
20933
- isInitialized: false,
20934
- resolve: null,
20935
- reject: null,
20936
- monaco: null
20937
- }), _state$create2 = _slicedToArray(_state$create, 2), getState = _state$create2[0], setState = _state$create2[1];
20938
- function config(globalConfig) {
20939
- var _validators$config = validators.config(globalConfig), monaco = _validators$config.monaco, config2 = _objectWithoutProperties(_validators$config, _excluded);
20940
- setState(function(state) {
20941
- return {
20942
- config: merge(state.config, config2),
20943
- monaco
20944
- };
20945
- });
20946
- }
20947
- function init() {
20948
- var state = getState(function(_ref) {
20949
- var monaco = _ref.monaco, isInitialized = _ref.isInitialized, resolve = _ref.resolve;
20950
- return {
20951
- monaco,
20952
- isInitialized,
20953
- resolve
20954
- };
20955
- });
20956
- if (!state.isInitialized) {
20957
- setState({
20958
- isInitialized: true
20959
- });
20960
- if (state.monaco) {
20961
- state.resolve(state.monaco);
20962
- return makeCancelable(wrapperPromise);
21100
+ }, [
21101
+ isEngineReady,
21102
+ workflows,
21103
+ payload,
21104
+ startExecution,
21105
+ runExecution,
21106
+ executeTrace,
21107
+ setExecutionError,
21108
+ onExecutionComplete,
21109
+ onExecutionError
21110
+ ]);
21111
+ const handleReset = require$$0.useCallback(() => {
21112
+ reset();
21113
+ lastExecutionRef.current = null;
21114
+ }, [reset]);
21115
+ require$$0.useEffect(() => {
21116
+ if (!autoExecute || !isEngineReady || workflows.length === 0) return;
21117
+ const timeoutId = setTimeout(() => {
21118
+ handleExecute();
21119
+ }, 500);
21120
+ return () => clearTimeout(timeoutId);
21121
+ }, [autoExecute, isEngineReady, workflows, payload]);
21122
+ const handleKeyDown = require$$0.useCallback(
21123
+ (e) => {
21124
+ if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
21125
+ return;
21126
+ }
21127
+ switch (e.key) {
21128
+ case " ":
21129
+ e.preventDefault();
21130
+ if (playbackState === "playing") {
21131
+ pause();
21132
+ } else if (hasTrace) {
21133
+ play();
21134
+ }
21135
+ break;
21136
+ case "ArrowRight":
21137
+ e.preventDefault();
21138
+ if (hasTrace && !isAtEnd) {
21139
+ stepForward();
21140
+ }
21141
+ break;
21142
+ case "ArrowLeft":
21143
+ e.preventDefault();
21144
+ if (hasTrace && !isAtStart) {
21145
+ stepBackward();
21146
+ }
21147
+ break;
21148
+ case "Escape":
21149
+ e.preventDefault();
21150
+ stop();
21151
+ break;
21152
+ case "r":
21153
+ if (e.metaKey || e.ctrlKey) {
21154
+ e.preventDefault();
21155
+ handleReset();
21156
+ }
21157
+ break;
21158
+ }
21159
+ },
21160
+ [playbackState, hasTrace, isAtEnd, isAtStart, play, pause, stop, stepForward, stepBackward, handleReset]
21161
+ );
21162
+ require$$0.useEffect(() => {
21163
+ window.addEventListener("keydown", handleKeyDown);
21164
+ return () => window.removeEventListener("keydown", handleKeyDown);
21165
+ }, [handleKeyDown]);
21166
+ const getStatusIcon = () => {
21167
+ var _a;
21168
+ if (isExecuting) {
21169
+ return /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { size: 14, className: "df-debug-spin" });
20963
21170
  }
20964
- if (window.monaco && window.monaco.editor) {
20965
- storeMonacoInstance(window.monaco);
20966
- state.resolve(window.monaco);
20967
- return makeCancelable(wrapperPromise);
21171
+ if (executionError) {
21172
+ return /* @__PURE__ */ jsxRuntime.jsx(CircleX, { size: 14, className: "df-debug-toolbar-status-error" });
20968
21173
  }
20969
- compose(injectScripts, getMonacoLoaderScript)(configureLoader);
20970
- }
20971
- return makeCancelable(wrapperPromise);
21174
+ if (hasTrace) {
21175
+ const finalStep = trace == null ? void 0 : trace.steps[trace.steps.length - 1];
21176
+ const hasErrors = ((_a = finalStep == null ? void 0 : finalStep.message) == null ? void 0 : _a.errors) && finalStep.message.errors.length > 0;
21177
+ if (hasErrors) {
21178
+ return /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { size: 14, className: "df-debug-toolbar-status-warning" });
21179
+ }
21180
+ return /* @__PURE__ */ jsxRuntime.jsx(CircleCheckBig, { size: 14, className: "df-debug-toolbar-status-success" });
21181
+ }
21182
+ return null;
21183
+ };
21184
+ const getStepText = () => {
21185
+ if (isExecuting) {
21186
+ return "Executing...";
21187
+ }
21188
+ if (!hasTrace) {
21189
+ return "Ready";
21190
+ }
21191
+ if (currentStepIndex < 0) {
21192
+ return "Ready";
21193
+ }
21194
+ return `Step ${currentStepIndex + 1} / ${totalSteps}`;
21195
+ };
21196
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-toolbar-integrated ${className}`, children: [
21197
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-toolbar-status", children: [
21198
+ getStatusIcon(),
21199
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-toolbar-step-text", children: getStepText() })
21200
+ ] }),
21201
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-toolbar-controls", children: [
21202
+ /* @__PURE__ */ jsxRuntime.jsx(
21203
+ "button",
21204
+ {
21205
+ className: "df-debug-toolbar-btn",
21206
+ onClick: stepBackward,
21207
+ disabled: !hasTrace || isAtStart || isExecuting,
21208
+ title: "Previous step (Left Arrow)",
21209
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipBack, { size: 14 })
21210
+ }
21211
+ ),
21212
+ playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
21213
+ "button",
21214
+ {
21215
+ className: "df-debug-toolbar-btn df-debug-toolbar-btn-primary",
21216
+ onClick: pause,
21217
+ disabled: !hasTrace || isExecuting,
21218
+ title: "Pause (Space)",
21219
+ children: /* @__PURE__ */ jsxRuntime.jsx(Pause, { size: 14 })
21220
+ }
21221
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
21222
+ "button",
21223
+ {
21224
+ className: "df-debug-toolbar-btn df-debug-toolbar-btn-primary",
21225
+ onClick: play,
21226
+ disabled: !hasTrace || isAtEnd || isExecuting,
21227
+ title: "Play (Space)",
21228
+ children: /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 14 })
21229
+ }
21230
+ ),
21231
+ /* @__PURE__ */ jsxRuntime.jsx(
21232
+ "button",
21233
+ {
21234
+ className: "df-debug-toolbar-btn",
21235
+ onClick: stepForward,
21236
+ disabled: !hasTrace || isAtEnd || isExecuting,
21237
+ title: "Next step (Right Arrow)",
21238
+ children: /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 14 })
21239
+ }
21240
+ ),
21241
+ /* @__PURE__ */ jsxRuntime.jsx(
21242
+ "button",
21243
+ {
21244
+ className: "df-debug-toolbar-btn",
21245
+ onClick: stop,
21246
+ disabled: !hasTrace || isExecuting,
21247
+ title: "Stop (Escape)",
21248
+ children: /* @__PURE__ */ jsxRuntime.jsx(Square, { size: 14 })
21249
+ }
21250
+ )
21251
+ ] }),
21252
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-toolbar-actions", children: hasTrace ? /* @__PURE__ */ jsxRuntime.jsxs(
21253
+ "button",
21254
+ {
21255
+ className: "df-debug-toolbar-btn-action df-debug-toolbar-btn-reset",
21256
+ onClick: handleReset,
21257
+ disabled: isExecuting,
21258
+ title: "Reset (Ctrl+R)",
21259
+ children: [
21260
+ /* @__PURE__ */ jsxRuntime.jsx(RotateCcw, { size: 12 }),
21261
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Reset" })
21262
+ ]
21263
+ }
21264
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
21265
+ "button",
21266
+ {
21267
+ className: "df-debug-toolbar-btn-action df-debug-toolbar-btn-run",
21268
+ onClick: handleExecute,
21269
+ disabled: !isEngineReady || isExecuting || workflows.length === 0,
21270
+ title: "Run workflow",
21271
+ children: [
21272
+ isExecuting ? /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { size: 12, className: "df-debug-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 12 }),
21273
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: isExecuting ? "Running..." : "Run" })
21274
+ ]
21275
+ }
21276
+ ) })
21277
+ ] });
20972
21278
  }
20973
- function injectScripts(script) {
20974
- return document.body.appendChild(script);
21279
+ function SearchInput({
21280
+ value,
21281
+ onChange,
21282
+ onClear,
21283
+ placeholder = "Search...",
21284
+ className = ""
21285
+ }) {
21286
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-search-input ${className}`, children: [
21287
+ /* @__PURE__ */ jsxRuntime.jsx(Search, { className: "df-search-icon", size: 16 }),
21288
+ /* @__PURE__ */ jsxRuntime.jsx(
21289
+ "input",
21290
+ {
21291
+ type: "text",
21292
+ value,
21293
+ onChange: (e) => onChange(e.target.value),
21294
+ placeholder,
21295
+ className: "df-search-field"
21296
+ }
21297
+ ),
21298
+ value && onClear && /* @__PURE__ */ jsxRuntime.jsx(
21299
+ "button",
21300
+ {
21301
+ onClick: onClear,
21302
+ className: "df-search-clear",
21303
+ "aria-label": "Clear search",
21304
+ children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
21305
+ }
21306
+ )
21307
+ ] });
20975
21308
  }
20976
- function createScript(src) {
20977
- var script = document.createElement("script");
20978
- return src && (script.src = src), script;
21309
+ function JsonViewer({
21310
+ data,
21311
+ initialExpanded = false,
21312
+ maxStringLength = 50,
21313
+ className = ""
21314
+ }) {
21315
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-json-viewer ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
21316
+ JsonNode,
21317
+ {
21318
+ data,
21319
+ initialExpanded,
21320
+ maxStringLength
21321
+ }
21322
+ ) });
20979
21323
  }
20980
- function getMonacoLoaderScript(configureLoader2) {
20981
- var state = getState(function(_ref2) {
20982
- var config2 = _ref2.config, reject = _ref2.reject;
20983
- return {
20984
- config: config2,
20985
- reject
20986
- };
20987
- });
20988
- var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
20989
- loaderScript.onload = function() {
20990
- return configureLoader2();
21324
+ function JsonNode({
21325
+ data,
21326
+ initialExpanded,
21327
+ maxStringLength,
21328
+ keyName,
21329
+ isLast = true
21330
+ }) {
21331
+ const [expanded, setExpanded] = require$$0.useState(initialExpanded);
21332
+ const renderValue = () => {
21333
+ if (data === null) {
21334
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-null", children: "null" });
21335
+ }
21336
+ if (data === void 0) {
21337
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-undefined", children: "undefined" });
21338
+ }
21339
+ if (typeof data === "boolean") {
21340
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-boolean", children: data.toString() });
21341
+ }
21342
+ if (typeof data === "number") {
21343
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-number", children: data });
21344
+ }
21345
+ if (typeof data === "string") {
21346
+ const display = data.length > maxStringLength ? `${data.slice(0, maxStringLength)}...` : data;
21347
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-string", children: [
21348
+ '"',
21349
+ display,
21350
+ '"'
21351
+ ] });
21352
+ }
21353
+ if (Array.isArray(data)) {
21354
+ if (data.length === 0) {
21355
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "[]" });
21356
+ }
21357
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-array", children: [
21358
+ /* @__PURE__ */ jsxRuntime.jsx(
21359
+ "button",
21360
+ {
21361
+ onClick: () => setExpanded(!expanded),
21362
+ className: "df-json-toggle",
21363
+ children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 12 })
21364
+ }
21365
+ ),
21366
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "[" }),
21367
+ !expanded && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-preview", children: [
21368
+ data.length,
21369
+ " item",
21370
+ data.length !== 1 ? "s" : ""
21371
+ ] }),
21372
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-json-children", children: data.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(
21373
+ JsonNode,
21374
+ {
21375
+ data: item,
21376
+ initialExpanded: false,
21377
+ maxStringLength,
21378
+ isLast: index2 === data.length - 1
21379
+ },
21380
+ index2
21381
+ )) }),
21382
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "]" })
21383
+ ] });
21384
+ }
21385
+ if (typeof data === "object") {
21386
+ const entries = Object.entries(data);
21387
+ if (entries.length === 0) {
21388
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "{}" });
21389
+ }
21390
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-object", children: [
21391
+ /* @__PURE__ */ jsxRuntime.jsx(
21392
+ "button",
21393
+ {
21394
+ onClick: () => setExpanded(!expanded),
21395
+ className: "df-json-toggle",
21396
+ children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 12 })
21397
+ }
21398
+ ),
21399
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "{" }),
21400
+ !expanded && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-preview", children: [
21401
+ entries.length,
21402
+ " key",
21403
+ entries.length !== 1 ? "s" : ""
21404
+ ] }),
21405
+ expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-json-children", children: entries.map(([key, value], index2) => /* @__PURE__ */ jsxRuntime.jsx(
21406
+ JsonNode,
21407
+ {
21408
+ keyName: key,
21409
+ data: value,
21410
+ initialExpanded: false,
21411
+ maxStringLength,
21412
+ isLast: index2 === entries.length - 1
21413
+ },
21414
+ key
21415
+ )) }),
21416
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-bracket", children: "}" })
21417
+ ] });
21418
+ }
21419
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { children: String(data) });
20991
21420
  };
20992
- loaderScript.onerror = state.reject;
20993
- return loaderScript;
21421
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-json-node", children: [
21422
+ keyName !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21423
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-json-key", children: [
21424
+ '"',
21425
+ keyName,
21426
+ '"'
21427
+ ] }),
21428
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-colon", children: ": " })
21429
+ ] }),
21430
+ renderValue(),
21431
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-json-comma", children: "," })
21432
+ ] });
20994
21433
  }
20995
- function configureLoader() {
20996
- var state = getState(function(_ref3) {
20997
- var config2 = _ref3.config, resolve = _ref3.resolve, reject = _ref3.reject;
20998
- return {
20999
- config: config2,
21000
- resolve,
21001
- reject
21002
- };
21003
- });
21004
- var require2 = window.require;
21005
- require2.config(state.config);
21006
- require2(["vs/editor/editor.main"], function(loaded) {
21007
- var monaco = loaded.m || loaded;
21008
- storeMonacoInstance(monaco);
21009
- state.resolve(monaco);
21010
- }, function(error) {
21011
- state.reject(error);
21012
- });
21434
+ function _arrayLikeToArray(r, a) {
21435
+ (null == a || a > r.length) && (a = r.length);
21436
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
21437
+ return n;
21013
21438
  }
21014
- function storeMonacoInstance(monaco) {
21015
- if (!getState().monaco) {
21016
- setState({
21017
- monaco
21018
- });
21019
- }
21439
+ function _arrayWithHoles(r) {
21440
+ if (Array.isArray(r)) return r;
21020
21441
  }
21021
- function __getMonacoInstance() {
21022
- return getState(function(_ref4) {
21023
- var monaco = _ref4.monaco;
21024
- return monaco;
21025
- });
21442
+ function _defineProperty$1(e, r, t) {
21443
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
21444
+ value: t,
21445
+ enumerable: true,
21446
+ configurable: true,
21447
+ writable: true
21448
+ }) : e[r] = t, e;
21026
21449
  }
21027
- var wrapperPromise = new Promise(function(resolve, reject) {
21028
- return setState({
21029
- resolve,
21030
- reject
21031
- });
21032
- });
21033
- var loader = {
21034
- config,
21035
- init,
21036
- __getMonacoInstance
21037
- };
21038
- var le = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, v = le;
21039
- var ae = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Y = ae;
21040
- function Me({ children: e }) {
21041
- return require$$0.createElement("div", { style: Y.container }, e);
21450
+ function _iterableToArrayLimit(r, l2) {
21451
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
21452
+ if (null != t) {
21453
+ var e, n, i, u, a = [], f = true, o = false;
21454
+ try {
21455
+ if (i = (t = t.call(r)).next, 0 === l2) ;
21456
+ else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l2); f = true) ;
21457
+ } catch (r2) {
21458
+ o = true, n = r2;
21459
+ } finally {
21460
+ try {
21461
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
21462
+ } finally {
21463
+ if (o) throw n;
21464
+ }
21465
+ }
21466
+ return a;
21467
+ }
21042
21468
  }
21043
- var Z = Me;
21044
- var $ = Z;
21045
- function Ee({ width: e, height: r, isEditorReady: n, loading: t, _ref: a, className: m, wrapperProps: E }) {
21046
- return require$$0.createElement("section", { style: { ...v.wrapper, width: e, height: r }, ...E }, !n && require$$0.createElement($, null, t), require$$0.createElement("div", { ref: a, style: { ...v.fullWidth, ...!n && v.hide }, className: m }));
21469
+ function _nonIterableRest() {
21470
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
21047
21471
  }
21048
- var ee = Ee;
21049
- var H = require$$0.memo(ee);
21050
- function Ce(e) {
21051
- require$$0.useEffect(e, []);
21472
+ function ownKeys$1(e, r) {
21473
+ var t = Object.keys(e);
21474
+ if (Object.getOwnPropertySymbols) {
21475
+ var o = Object.getOwnPropertySymbols(e);
21476
+ r && (o = o.filter(function(r2) {
21477
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
21478
+ })), t.push.apply(t, o);
21479
+ }
21480
+ return t;
21052
21481
  }
21053
- var k = Ce;
21054
- function he(e, r, n = true) {
21055
- let t = require$$0.useRef(true);
21056
- require$$0.useEffect(t.current || !n ? () => {
21057
- t.current = false;
21058
- } : e, r);
21482
+ function _objectSpread2$1(e) {
21483
+ for (var r = 1; r < arguments.length; r++) {
21484
+ var t = null != arguments[r] ? arguments[r] : {};
21485
+ r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
21486
+ _defineProperty$1(e, r2, t[r2]);
21487
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
21488
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
21489
+ });
21490
+ }
21491
+ return e;
21059
21492
  }
21060
- var l = he;
21061
- function D() {
21493
+ function _objectWithoutProperties(e, t) {
21494
+ if (null == e) return {};
21495
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
21496
+ if (Object.getOwnPropertySymbols) {
21497
+ var n = Object.getOwnPropertySymbols(e);
21498
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
21499
+ }
21500
+ return i;
21062
21501
  }
21063
- function h(e, r, n, t) {
21064
- return De(e, t) || be(e, r, n, t);
21502
+ function _objectWithoutPropertiesLoose(r, e) {
21503
+ if (null == r) return {};
21504
+ var t = {};
21505
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
21506
+ if (-1 !== e.indexOf(n)) continue;
21507
+ t[n] = r[n];
21508
+ }
21509
+ return t;
21065
21510
  }
21066
- function De(e, r) {
21067
- return e.editor.getModel(te(e, r));
21511
+ function _slicedToArray(r, e) {
21512
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
21068
21513
  }
21069
- function be(e, r, n, t) {
21070
- return e.editor.createModel(r, n, t ? te(e, t) : void 0);
21514
+ function _toPrimitive(t, r) {
21515
+ if ("object" != typeof t || !t) return t;
21516
+ var e = t[Symbol.toPrimitive];
21517
+ if (void 0 !== e) {
21518
+ var i = e.call(t, r);
21519
+ if ("object" != typeof i) return i;
21520
+ throw new TypeError("@@toPrimitive must return a primitive value.");
21521
+ }
21522
+ return ("string" === r ? String : Number)(t);
21071
21523
  }
21072
- function te(e, r) {
21073
- return e.Uri.parse(r);
21524
+ function _toPropertyKey(t) {
21525
+ var i = _toPrimitive(t, "string");
21526
+ return "symbol" == typeof i ? i : i + "";
21074
21527
  }
21075
- function Oe({ original: e, modified: r, language: n, originalLanguage: t, modifiedLanguage: a, originalModelPath: m, modifiedModelPath: E, keepCurrentOriginalModel: g = false, keepCurrentModifiedModel: N = false, theme: x = "light", loading: P = "Loading...", options: y = {}, height: V = "100%", width: z = "100%", className: F, wrapperProps: j = {}, beforeMount: A = D, onMount: q = D }) {
21076
- let [M, O] = require$$0.useState(false), [T, s] = require$$0.useState(true), u = require$$0.useRef(null), c = require$$0.useRef(null), w = require$$0.useRef(null), d = require$$0.useRef(q), o = require$$0.useRef(A), b = require$$0.useRef(false);
21077
- k(() => {
21078
- let i = loader.init();
21079
- return i.then((f) => (c.current = f) && s(false)).catch((f) => (f == null ? void 0 : f.type) !== "cancelation" && console.error("Monaco initialization: error:", f)), () => u.current ? I() : i.cancel();
21080
- }), l(() => {
21081
- if (u.current && c.current) {
21082
- let i = u.current.getOriginalEditor(), f = h(c.current, e || "", t || n || "text", m || "");
21083
- f !== i.getModel() && i.setModel(f);
21084
- }
21085
- }, [m], M), l(() => {
21086
- if (u.current && c.current) {
21087
- let i = u.current.getModifiedEditor(), f = h(c.current, r || "", a || n || "text", E || "");
21088
- f !== i.getModel() && i.setModel(f);
21089
- }
21090
- }, [E], M), l(() => {
21091
- let i = u.current.getModifiedEditor();
21092
- i.getOption(c.current.editor.EditorOption.readOnly) ? i.setValue(r || "") : r !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: r || "", forceMoveMarkers: true }]), i.pushUndoStop());
21093
- }, [r], M), l(() => {
21094
- var _a, _b;
21095
- (_b = (_a = u.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.original.setValue(e || "");
21096
- }, [e], M), l(() => {
21097
- let { original: i, modified: f } = u.current.getModel();
21098
- c.current.editor.setModelLanguage(i, t || n || "text"), c.current.editor.setModelLanguage(f, a || n || "text");
21099
- }, [n, t, a], M), l(() => {
21100
- var _a;
21101
- (_a = c.current) == null ? void 0 : _a.editor.setTheme(x);
21102
- }, [x], M), l(() => {
21103
- var _a;
21104
- (_a = u.current) == null ? void 0 : _a.updateOptions(y);
21105
- }, [y], M);
21106
- let L = require$$0.useCallback(() => {
21107
- var _a;
21108
- if (!c.current) return;
21109
- o.current(c.current);
21110
- let i = h(c.current, e || "", t || n || "text", m || ""), f = h(c.current, r || "", a || n || "text", E || "");
21111
- (_a = u.current) == null ? void 0 : _a.setModel({ original: i, modified: f });
21112
- }, [n, r, a, e, t, m, E]), U = require$$0.useCallback(() => {
21113
- var _a;
21114
- !b.current && w.current && (u.current = c.current.editor.createDiffEditor(w.current, { automaticLayout: true, ...y }), L(), (_a = c.current) == null ? void 0 : _a.editor.setTheme(x), O(true), b.current = true);
21115
- }, [y, x, L]);
21116
- require$$0.useEffect(() => {
21117
- M && d.current(u.current, c.current);
21118
- }, [M]), require$$0.useEffect(() => {
21119
- !T && !M && U();
21120
- }, [T, M, U]);
21121
- function I() {
21122
- var _a, _b, _c, _d;
21123
- let i = (_a = u.current) == null ? void 0 : _a.getModel();
21124
- g || ((_b = i == null ? void 0 : i.original) == null ? void 0 : _b.dispose()), N || ((_c = i == null ? void 0 : i.modified) == null ? void 0 : _c.dispose()), (_d = u.current) == null ? void 0 : _d.dispose();
21528
+ function _unsupportedIterableToArray(r, a) {
21529
+ if (r) {
21530
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
21531
+ var t = {}.toString.call(r).slice(8, -1);
21532
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
21125
21533
  }
21126
- return require$$0.createElement(H, { width: z, height: V, isEditorReady: M, loading: P, _ref: w, className: F, wrapperProps: j });
21127
21534
  }
21128
- var ie = Oe;
21129
- require$$0.memo(ie);
21130
- function He(e) {
21131
- let r = require$$0.useRef();
21132
- return require$$0.useEffect(() => {
21133
- r.current = e;
21134
- }, [e]), r.current;
21535
+ function _defineProperty(obj, key, value) {
21536
+ if (key in obj) {
21537
+ Object.defineProperty(obj, key, {
21538
+ value,
21539
+ enumerable: true,
21540
+ configurable: true,
21541
+ writable: true
21542
+ });
21543
+ } else {
21544
+ obj[key] = value;
21545
+ }
21546
+ return obj;
21135
21547
  }
21136
- var se = He;
21137
- var _ = /* @__PURE__ */ new Map();
21138
- function Ve({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: t, language: a, path: m, theme: E = "light", line: g, loading: N = "Loading...", options: x = {}, overrideServices: P = {}, saveViewState: y = true, keepCurrentModel: V = false, width: z = "100%", height: F = "100%", className: j, wrapperProps: A = {}, beforeMount: q = D, onMount: M = D, onChange: O, onValidate: T = D }) {
21139
- let [s, u] = require$$0.useState(false), [c, w] = require$$0.useState(true), d = require$$0.useRef(null), o = require$$0.useRef(null), b = require$$0.useRef(null), L = require$$0.useRef(M), U = require$$0.useRef(q), I = require$$0.useRef(), i = require$$0.useRef(t), f = se(m), Q = require$$0.useRef(false), B = require$$0.useRef(false);
21140
- k(() => {
21141
- let p = loader.init();
21142
- return p.then((R) => (d.current = R) && w(false)).catch((R) => (R == null ? void 0 : R.type) !== "cancelation" && console.error("Monaco initialization: error:", R)), () => o.current ? pe() : p.cancel();
21143
- }), l(() => {
21144
- var _a, _b, _c, _d;
21145
- let p = h(d.current, e || t || "", r || a || "", m || n || "");
21146
- p !== ((_a = o.current) == null ? void 0 : _a.getModel()) && (y && _.set(f, (_b = o.current) == null ? void 0 : _b.saveViewState()), (_c = o.current) == null ? void 0 : _c.setModel(p), y && ((_d = o.current) == null ? void 0 : _d.restoreViewState(_.get(m))));
21147
- }, [m], s), l(() => {
21148
- var _a;
21149
- (_a = o.current) == null ? void 0 : _a.updateOptions(x);
21150
- }, [x], s), l(() => {
21151
- !o.current || t === void 0 || (o.current.getOption(d.current.editor.EditorOption.readOnly) ? o.current.setValue(t) : t !== o.current.getValue() && (B.current = true, o.current.executeEdits("", [{ range: o.current.getModel().getFullModelRange(), text: t, forceMoveMarkers: true }]), o.current.pushUndoStop(), B.current = false));
21152
- }, [t], s), l(() => {
21153
- var _a, _b;
21154
- let p = (_a = o.current) == null ? void 0 : _a.getModel();
21155
- p && a && ((_b = d.current) == null ? void 0 : _b.editor.setModelLanguage(p, a));
21156
- }, [a], s), l(() => {
21157
- var _a;
21158
- g !== void 0 && ((_a = o.current) == null ? void 0 : _a.revealLine(g));
21159
- }, [g], s), l(() => {
21160
- var _a;
21161
- (_a = d.current) == null ? void 0 : _a.editor.setTheme(E);
21162
- }, [E], s);
21163
- let X2 = require$$0.useCallback(() => {
21164
- var _a;
21165
- if (!(!b.current || !d.current) && !Q.current) {
21166
- U.current(d.current);
21167
- let p = m || n, R = h(d.current, t || e || "", r || a || "", p || "");
21168
- o.current = (_a = d.current) == null ? void 0 : _a.editor.create(b.current, { model: R, automaticLayout: true, ...x }, P), y && o.current.restoreViewState(_.get(p)), d.current.editor.setTheme(E), g !== void 0 && o.current.revealLine(g), u(true), Q.current = true;
21169
- }
21170
- }, [e, r, n, t, a, m, x, P, y, E, g]);
21171
- require$$0.useEffect(() => {
21172
- s && L.current(o.current, d.current);
21173
- }, [s]), require$$0.useEffect(() => {
21174
- !c && !s && X2();
21175
- }, [c, s, X2]), i.current = t, require$$0.useEffect(() => {
21176
- var _a, _b;
21177
- s && O && ((_a = I.current) == null ? void 0 : _a.dispose(), I.current = (_b = o.current) == null ? void 0 : _b.onDidChangeModelContent((p) => {
21178
- B.current || O(o.current.getValue(), p);
21179
- }));
21180
- }, [s, O]), require$$0.useEffect(() => {
21181
- if (s) {
21182
- let p = d.current.editor.onDidChangeMarkers((R) => {
21183
- var _a;
21184
- let G = (_a = o.current.getModel()) == null ? void 0 : _a.uri;
21185
- if (G && R.find((J) => J.path === G.path)) {
21186
- let J = d.current.editor.getModelMarkers({ resource: G });
21187
- T == null ? void 0 : T(J);
21188
- }
21548
+ function ownKeys(object2, enumerableOnly) {
21549
+ var keys = Object.keys(object2);
21550
+ if (Object.getOwnPropertySymbols) {
21551
+ var symbols = Object.getOwnPropertySymbols(object2);
21552
+ if (enumerableOnly) symbols = symbols.filter(function(sym) {
21553
+ return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
21554
+ });
21555
+ keys.push.apply(keys, symbols);
21556
+ }
21557
+ return keys;
21558
+ }
21559
+ function _objectSpread2(target) {
21560
+ for (var i = 1; i < arguments.length; i++) {
21561
+ var source = arguments[i] != null ? arguments[i] : {};
21562
+ if (i % 2) {
21563
+ ownKeys(Object(source), true).forEach(function(key) {
21564
+ _defineProperty(target, key, source[key]);
21565
+ });
21566
+ } else if (Object.getOwnPropertyDescriptors) {
21567
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
21568
+ } else {
21569
+ ownKeys(Object(source)).forEach(function(key) {
21570
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21189
21571
  });
21190
- return () => {
21191
- p == null ? void 0 : p.dispose();
21192
- };
21193
21572
  }
21194
- return () => {
21195
- };
21196
- }, [s, T]);
21197
- function pe() {
21198
- var _a, _b;
21199
- (_a = I.current) == null ? void 0 : _a.dispose(), V ? y && _.set(m, o.current.saveViewState()) : (_b = o.current.getModel()) == null ? void 0 : _b.dispose(), o.current.dispose();
21200
21573
  }
21201
- return require$$0.createElement(H, { width: z, height: F, isEditorReady: s, loading: N, _ref: b, className: j, wrapperProps: A });
21574
+ return target;
21202
21575
  }
21203
- var fe = Ve;
21204
- var de = require$$0.memo(fe);
21205
- var Ft = de;
21206
- function findPathLineNumbers(jsonString, paths) {
21207
- if (!paths || paths.length === 0) return [];
21208
- const lines = jsonString.split("\n");
21209
- const lineNumbers = [];
21210
- for (const path of paths) {
21211
- const pathParts = path.split(".");
21212
- const lastKey = pathParts[pathParts.length - 1];
21213
- const keyPattern = new RegExp(`^\\s*"${lastKey}"\\s*:`);
21214
- for (let i = 0; i < lines.length; i++) {
21215
- if (keyPattern.test(lines[i])) {
21216
- if (pathParts.length === 1) {
21217
- lineNumbers.push(i + 1);
21218
- } else {
21219
- let matchedParents = 0;
21220
- for (let j = i - 1; j >= 0 && matchedParents < pathParts.length - 1; j--) {
21221
- const parentKey = pathParts[pathParts.length - 2 - matchedParents];
21222
- const parentPattern = new RegExp(`^\\s*"${parentKey}"\\s*:`);
21223
- if (parentPattern.test(lines[j])) {
21224
- matchedParents++;
21225
- }
21226
- }
21227
- if (matchedParents >= Math.min(pathParts.length - 1, 2)) {
21228
- lineNumbers.push(i + 1);
21229
- }
21230
- }
21231
- }
21232
- }
21576
+ function compose$1() {
21577
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
21578
+ fns[_key] = arguments[_key];
21233
21579
  }
21234
- return [...new Set(lineNumbers)];
21580
+ return function(x) {
21581
+ return fns.reduceRight(function(y, f) {
21582
+ return f(y);
21583
+ }, x);
21584
+ };
21235
21585
  }
21236
- const defineThemes = (monaco) => {
21237
- monaco.editor.defineTheme("vscode-dark", {
21238
- base: "vs-dark",
21239
- inherit: true,
21240
- rules: [
21241
- { token: "string.key.json", foreground: "9CDCFE" },
21242
- { token: "string.value.json", foreground: "CE9178" },
21243
- { token: "number", foreground: "B5CEA8" },
21244
- { token: "keyword", foreground: "569CD6" },
21245
- { token: "delimiter", foreground: "D4D4D4" }
21246
- ],
21247
- colors: {
21248
- "editor.background": "#1e1e1e",
21249
- "editor.foreground": "#d4d4d4",
21250
- "editor.lineHighlightBackground": "#2d2d2d",
21251
- "editor.selectionBackground": "#264f78",
21252
- "editorCursor.foreground": "#aeafad",
21253
- "editorLineNumber.foreground": "#858585",
21254
- "editorLineNumber.activeForeground": "#c6c6c6",
21255
- "editorIndentGuide.background": "#404040",
21256
- "editorIndentGuide.activeBackground": "#707070",
21257
- "editor.selectionHighlightBackground": "#3a3d41",
21258
- "editorBracketMatch.background": "#0064001a",
21259
- "editorBracketMatch.border": "#888888",
21260
- "editorGutter.background": "#1e1e1e",
21261
- "scrollbarSlider.background": "#79797966",
21262
- "scrollbarSlider.hoverBackground": "#646464b3",
21263
- "scrollbarSlider.activeBackground": "#bfbfbf66",
21264
- "minimap.background": "#1e1e1e"
21265
- }
21266
- });
21267
- monaco.editor.defineTheme("vscode-light", {
21268
- base: "vs",
21269
- inherit: true,
21270
- rules: [
21271
- { token: "string.key.json", foreground: "0451A5" },
21272
- { token: "string.value.json", foreground: "A31515" },
21273
- { token: "number", foreground: "098658" },
21274
- { token: "keyword", foreground: "0000FF" },
21275
- { token: "delimiter", foreground: "000000" }
21276
- ],
21277
- colors: {
21278
- "editor.background": "#ffffff",
21279
- "editor.foreground": "#000000",
21280
- "editor.lineHighlightBackground": "#f5f5f5",
21281
- "editor.selectionBackground": "#add6ff",
21282
- "editorCursor.foreground": "#000000",
21283
- "editorLineNumber.foreground": "#999999",
21284
- "editorLineNumber.activeForeground": "#000000",
21285
- "editorIndentGuide.background": "#d3d3d3",
21286
- "editorIndentGuide.activeBackground": "#939393",
21287
- "editor.selectionHighlightBackground": "#add6ff4d",
21288
- "editorBracketMatch.background": "#0064001a",
21289
- "editorBracketMatch.border": "#b9b9b9",
21290
- "editorGutter.background": "#ffffff",
21291
- "scrollbarSlider.background": "#64646466",
21292
- "scrollbarSlider.hoverBackground": "#646464b3",
21293
- "scrollbarSlider.activeBackground": "#00000099",
21294
- "minimap.background": "#ffffff"
21586
+ function curry$1(fn) {
21587
+ return function curried() {
21588
+ var _this = this;
21589
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
21590
+ args[_key2] = arguments[_key2];
21295
21591
  }
21592
+ return args.length >= fn.length ? fn.apply(this, args) : function() {
21593
+ for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
21594
+ nextArgs[_key3] = arguments[_key3];
21595
+ }
21596
+ return curried.apply(_this, [].concat(args, nextArgs));
21597
+ };
21598
+ };
21599
+ }
21600
+ function isObject$1(value) {
21601
+ return {}.toString.call(value).includes("Object");
21602
+ }
21603
+ function isEmpty(obj) {
21604
+ return !Object.keys(obj).length;
21605
+ }
21606
+ function isFunction(value) {
21607
+ return typeof value === "function";
21608
+ }
21609
+ function hasOwnProperty(object2, property) {
21610
+ return Object.prototype.hasOwnProperty.call(object2, property);
21611
+ }
21612
+ function validateChanges(initial, changes) {
21613
+ if (!isObject$1(changes)) errorHandler$1("changeType");
21614
+ if (Object.keys(changes).some(function(field) {
21615
+ return !hasOwnProperty(initial, field);
21616
+ })) errorHandler$1("changeField");
21617
+ return changes;
21618
+ }
21619
+ function validateSelector(selector2) {
21620
+ if (!isFunction(selector2)) errorHandler$1("selectorType");
21621
+ }
21622
+ function validateHandler(handler) {
21623
+ if (!(isFunction(handler) || isObject$1(handler))) errorHandler$1("handlerType");
21624
+ if (isObject$1(handler) && Object.values(handler).some(function(_handler) {
21625
+ return !isFunction(_handler);
21626
+ })) errorHandler$1("handlersType");
21627
+ }
21628
+ function validateInitial(initial) {
21629
+ if (!initial) errorHandler$1("initialIsRequired");
21630
+ if (!isObject$1(initial)) errorHandler$1("initialType");
21631
+ if (isEmpty(initial)) errorHandler$1("initialContent");
21632
+ }
21633
+ function throwError$1(errorMessages2, type) {
21634
+ throw new Error(errorMessages2[type] || errorMessages2["default"]);
21635
+ }
21636
+ var errorMessages$1 = {
21637
+ initialIsRequired: "initial state is required",
21638
+ initialType: "initial state should be an object",
21639
+ initialContent: "initial state shouldn't be an empty object",
21640
+ handlerType: "handler should be an object or a function",
21641
+ handlersType: "all handlers should be a functions",
21642
+ selectorType: "selector should be a function",
21643
+ changeType: "provided value of changes should be an object",
21644
+ changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
21645
+ "default": "an unknown error accured in `state-local` package"
21646
+ };
21647
+ var errorHandler$1 = curry$1(throwError$1)(errorMessages$1);
21648
+ var validators$1 = {
21649
+ changes: validateChanges,
21650
+ selector: validateSelector,
21651
+ handler: validateHandler,
21652
+ initial: validateInitial
21653
+ };
21654
+ function create(initial) {
21655
+ var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
21656
+ validators$1.initial(initial);
21657
+ validators$1.handler(handler);
21658
+ var state = {
21659
+ current: initial
21660
+ };
21661
+ var didUpdate = curry$1(didStateUpdate)(state, handler);
21662
+ var update = curry$1(updateState)(state);
21663
+ var validate = curry$1(validators$1.changes)(initial);
21664
+ var getChanges = curry$1(extractChanges)(state);
21665
+ function getState2() {
21666
+ var selector2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) {
21667
+ return state2;
21668
+ };
21669
+ validators$1.selector(selector2);
21670
+ return selector2(state.current);
21671
+ }
21672
+ function setState2(causedChanges) {
21673
+ compose$1(didUpdate, update, validate, getChanges)(causedChanges);
21674
+ }
21675
+ return [getState2, setState2];
21676
+ }
21677
+ function extractChanges(state, causedChanges) {
21678
+ return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;
21679
+ }
21680
+ function updateState(state, changes) {
21681
+ state.current = _objectSpread2(_objectSpread2({}, state.current), changes);
21682
+ return changes;
21683
+ }
21684
+ function didStateUpdate(state, handler, changes) {
21685
+ isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function(field) {
21686
+ var _handler$field;
21687
+ return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);
21296
21688
  });
21689
+ return changes;
21690
+ }
21691
+ var index = {
21692
+ create
21297
21693
  };
21298
- function JsonEditor({
21299
- value,
21300
- onChange,
21301
- readOnly = false,
21302
- className = "",
21303
- theme = "dark",
21304
- onCursorChange,
21305
- highlightedPaths
21306
- }) {
21307
- const editorRef = require$$0.useRef(null);
21308
- const decorationsRef = require$$0.useRef([]);
21309
- const handleEditorMount = require$$0.useCallback((editor, monaco) => {
21310
- editorRef.current = editor;
21311
- monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
21312
- validate: true,
21313
- schemas: [],
21314
- allowComments: false,
21315
- trailingCommas: "error"
21316
- });
21317
- if (onCursorChange) {
21318
- editor.onDidChangeCursorPosition((e) => {
21319
- onCursorChange(e.position.lineNumber, e.position.column);
21320
- });
21321
- }
21322
- if (!readOnly) {
21323
- editor.focus();
21694
+ var config$1 = {
21695
+ paths: {
21696
+ vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
21697
+ }
21698
+ };
21699
+ function curry(fn) {
21700
+ return function curried() {
21701
+ var _this = this;
21702
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21703
+ args[_key] = arguments[_key];
21324
21704
  }
21325
- }, [onCursorChange, readOnly]);
21326
- require$$0.useEffect(() => {
21327
- if (!editorRef.current || !highlightedPaths || highlightedPaths.length === 0) {
21328
- if (editorRef.current && decorationsRef.current.length > 0) {
21329
- decorationsRef.current = editorRef.current.deltaDecorations(decorationsRef.current, []);
21705
+ return args.length >= fn.length ? fn.apply(this, args) : function() {
21706
+ for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
21707
+ nextArgs[_key2] = arguments[_key2];
21708
+ }
21709
+ return curried.apply(_this, [].concat(args, nextArgs));
21710
+ };
21711
+ };
21712
+ }
21713
+ function isObject(value) {
21714
+ return {}.toString.call(value).includes("Object");
21715
+ }
21716
+ function validateConfig(config2) {
21717
+ if (!config2) errorHandler("configIsRequired");
21718
+ if (!isObject(config2)) errorHandler("configType");
21719
+ if (config2.urls) {
21720
+ informAboutDeprecation();
21721
+ return {
21722
+ paths: {
21723
+ vs: config2.urls.monacoBase
21724
+ }
21725
+ };
21726
+ }
21727
+ return config2;
21728
+ }
21729
+ function informAboutDeprecation() {
21730
+ console.warn(errorMessages.deprecation);
21731
+ }
21732
+ function throwError(errorMessages2, type) {
21733
+ throw new Error(errorMessages2[type] || errorMessages2["default"]);
21734
+ }
21735
+ var errorMessages = {
21736
+ configIsRequired: "the configuration object is required",
21737
+ configType: "the configuration object should be an object",
21738
+ "default": "an unknown error accured in `@monaco-editor/loader` package",
21739
+ deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
21740
+ };
21741
+ var errorHandler = curry(throwError)(errorMessages);
21742
+ var validators = {
21743
+ config: validateConfig
21744
+ };
21745
+ var compose = function compose2() {
21746
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
21747
+ fns[_key] = arguments[_key];
21748
+ }
21749
+ return function(x) {
21750
+ return fns.reduceRight(function(y, f) {
21751
+ return f(y);
21752
+ }, x);
21753
+ };
21754
+ };
21755
+ function merge(target, source) {
21756
+ Object.keys(source).forEach(function(key) {
21757
+ if (source[key] instanceof Object) {
21758
+ if (target[key]) {
21759
+ Object.assign(source[key], merge(target[key], source[key]));
21330
21760
  }
21331
- return;
21332
- }
21333
- const lineNumbers = findPathLineNumbers(value, highlightedPaths);
21334
- if (lineNumbers.length > 0) {
21335
- const decorations = lineNumbers.map((lineNumber) => ({
21336
- range: {
21337
- startLineNumber: lineNumber,
21338
- startColumn: 1,
21339
- endLineNumber: lineNumber,
21340
- endColumn: 1
21341
- },
21342
- options: {
21343
- isWholeLine: true,
21344
- className: "df-highlighted-line",
21345
- glyphMarginClassName: "df-highlighted-glyph",
21346
- overviewRuler: {
21347
- color: theme === "dark" ? "#4ec9b0" : "#388a34",
21348
- position: 1
21349
- // Left
21350
- }
21351
- }
21352
- }));
21353
- decorationsRef.current = editorRef.current.deltaDecorations(
21354
- decorationsRef.current,
21355
- decorations
21356
- );
21357
- } else {
21358
- decorationsRef.current = editorRef.current.deltaDecorations(decorationsRef.current, []);
21359
21761
  }
21360
- }, [value, highlightedPaths, theme]);
21361
- const handleChange = require$$0.useCallback((newValue) => {
21362
- onChange(newValue || "");
21363
- }, [onChange]);
21364
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-monaco-editor-wrapper ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
21365
- Ft,
21366
- {
21367
- height: "100%",
21368
- defaultLanguage: "json",
21369
- value,
21370
- onChange: handleChange,
21371
- onMount: handleEditorMount,
21372
- beforeMount: defineThemes,
21373
- theme: theme === "dark" ? "vscode-dark" : "vscode-light",
21374
- options: {
21375
- readOnly,
21376
- minimap: { enabled: false },
21377
- fontSize: 13,
21378
- fontFamily: "'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace",
21379
- lineHeight: 20,
21380
- tabSize: 2,
21381
- insertSpaces: true,
21382
- automaticLayout: true,
21383
- scrollBeyondLastLine: false,
21384
- wordWrap: "on",
21385
- wrappingIndent: "indent",
21386
- folding: true,
21387
- foldingStrategy: "indentation",
21388
- showFoldingControls: "mouseover",
21389
- bracketPairColorization: { enabled: true },
21390
- guides: {
21391
- bracketPairs: false,
21392
- indentation: false,
21393
- highlightActiveBracketPair: true,
21394
- highlightActiveIndentation: false
21395
- },
21396
- renderLineHighlight: readOnly ? "none" : "line",
21397
- selectOnLineNumbers: true,
21398
- roundedSelection: true,
21399
- cursorBlinking: "smooth",
21400
- cursorSmoothCaretAnimation: "on",
21401
- smoothScrolling: true,
21402
- padding: { top: 8, bottom: 8 },
21403
- scrollbar: {
21404
- vertical: "auto",
21405
- horizontal: "auto",
21406
- verticalScrollbarSize: 10,
21407
- horizontalScrollbarSize: 10
21408
- },
21409
- overviewRulerBorder: false,
21410
- hideCursorInOverviewRuler: true,
21411
- contextmenu: true,
21412
- quickSuggestions: false,
21413
- suggestOnTriggerCharacters: false,
21414
- acceptSuggestionOnEnter: "off",
21415
- formatOnPaste: true,
21416
- formatOnType: false,
21417
- glyphMargin: highlightedPaths && highlightedPaths.length > 0
21418
- }
21419
- }
21420
- ) });
21762
+ });
21763
+ return _objectSpread2$1(_objectSpread2$1({}, target), source);
21421
21764
  }
21422
- class ErrorBoundary extends require$$0.Component {
21423
- constructor(props) {
21424
- super(props);
21425
- this.state = { hasError: false, error: null };
21426
- }
21427
- static getDerivedStateFromError(error) {
21428
- return { hasError: true, error };
21429
- }
21430
- componentDidCatch(error, errorInfo) {
21431
- console.error("ErrorBoundary caught an error:", error, errorInfo);
21432
- }
21433
- render() {
21434
- var _a;
21435
- if (this.state.hasError) {
21436
- if (this.props.fallback) {
21437
- return this.props.fallback;
21438
- }
21439
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-error-boundary", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-error-boundary-content", children: [
21440
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "df-error-boundary-title", children: "Something went wrong" }),
21441
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "df-error-boundary-message", children: ((_a = this.state.error) == null ? void 0 : _a.message) || "An unexpected error occurred" }),
21442
- /* @__PURE__ */ jsxRuntime.jsx(
21443
- "button",
21444
- {
21445
- className: "df-error-boundary-button",
21446
- onClick: () => this.setState({ hasError: false, error: null }),
21447
- children: "Try again"
21448
- }
21449
- )
21450
- ] }) });
21765
+ var CANCELATION_MESSAGE = {
21766
+ type: "cancelation",
21767
+ msg: "operation is manually canceled"
21768
+ };
21769
+ function makeCancelable(promise) {
21770
+ var hasCanceled_ = false;
21771
+ var wrappedPromise = new Promise(function(resolve, reject) {
21772
+ promise.then(function(val) {
21773
+ return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
21774
+ });
21775
+ promise["catch"](reject);
21776
+ });
21777
+ return wrappedPromise.cancel = function() {
21778
+ return hasCanceled_ = true;
21779
+ }, wrappedPromise;
21780
+ }
21781
+ var _excluded = ["monaco"];
21782
+ var _state$create = index.create({
21783
+ config: config$1,
21784
+ isInitialized: false,
21785
+ resolve: null,
21786
+ reject: null,
21787
+ monaco: null
21788
+ }), _state$create2 = _slicedToArray(_state$create, 2), getState = _state$create2[0], setState = _state$create2[1];
21789
+ function config(globalConfig) {
21790
+ var _validators$config = validators.config(globalConfig), monaco = _validators$config.monaco, config2 = _objectWithoutProperties(_validators$config, _excluded);
21791
+ setState(function(state) {
21792
+ return {
21793
+ config: merge(state.config, config2),
21794
+ monaco
21795
+ };
21796
+ });
21797
+ }
21798
+ function init() {
21799
+ var state = getState(function(_ref) {
21800
+ var monaco = _ref.monaco, isInitialized = _ref.isInitialized, resolve = _ref.resolve;
21801
+ return {
21802
+ monaco,
21803
+ isInitialized,
21804
+ resolve
21805
+ };
21806
+ });
21807
+ if (!state.isInitialized) {
21808
+ setState({
21809
+ isInitialized: true
21810
+ });
21811
+ if (state.monaco) {
21812
+ state.resolve(state.monaco);
21813
+ return makeCancelable(wrapperPromise);
21451
21814
  }
21452
- return this.props.children;
21815
+ if (window.monaco && window.monaco.editor) {
21816
+ storeMonacoInstance(window.monaco);
21817
+ state.resolve(window.monaco);
21818
+ return makeCancelable(wrapperPromise);
21819
+ }
21820
+ compose(injectScripts, getMonacoLoaderScript)(configureLoader);
21453
21821
  }
21822
+ return makeCancelable(wrapperPromise);
21454
21823
  }
21455
- function getSelectionInfo(selection2) {
21456
- switch (selection2.type) {
21457
- case "workflow-condition":
21458
- return {
21459
- title: "Workflow Condition",
21460
- subtitle: selection2.workflow.name
21461
- };
21462
- case "task":
21463
- return {
21464
- title: selection2.task.name,
21465
- subtitle: `${selection2.workflow.name} / ${selection2.task.function.name}`
21466
- };
21467
- case "task-condition":
21468
- return {
21469
- title: "Task Condition",
21470
- subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
21471
- };
21472
- case "mapping":
21473
- return {
21474
- title: selection2.mapping.path,
21475
- subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
21476
- };
21477
- case "validation-rule":
21478
- return {
21479
- title: selection2.rule.message,
21480
- subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
21481
- };
21482
- default:
21483
- return null;
21824
+ function injectScripts(script) {
21825
+ return document.body.appendChild(script);
21826
+ }
21827
+ function createScript(src) {
21828
+ var script = document.createElement("script");
21829
+ return src && (script.src = src), script;
21830
+ }
21831
+ function getMonacoLoaderScript(configureLoader2) {
21832
+ var state = getState(function(_ref2) {
21833
+ var config2 = _ref2.config, reject = _ref2.reject;
21834
+ return {
21835
+ config: config2,
21836
+ reject
21837
+ };
21838
+ });
21839
+ var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
21840
+ loaderScript.onload = function() {
21841
+ return configureLoader2();
21842
+ };
21843
+ loaderScript.onerror = state.reject;
21844
+ return loaderScript;
21845
+ }
21846
+ function configureLoader() {
21847
+ var state = getState(function(_ref3) {
21848
+ var config2 = _ref3.config, resolve = _ref3.resolve, reject = _ref3.reject;
21849
+ return {
21850
+ config: config2,
21851
+ resolve,
21852
+ reject
21853
+ };
21854
+ });
21855
+ var require2 = window.require;
21856
+ require2.config(state.config);
21857
+ require2(["vs/editor/editor.main"], function(loaded) {
21858
+ var monaco = loaded.m || loaded;
21859
+ storeMonacoInstance(monaco);
21860
+ state.resolve(monaco);
21861
+ }, function(error) {
21862
+ state.reject(error);
21863
+ });
21864
+ }
21865
+ function storeMonacoInstance(monaco) {
21866
+ if (!getState().monaco) {
21867
+ setState({
21868
+ monaco
21869
+ });
21870
+ }
21871
+ }
21872
+ function __getMonacoInstance() {
21873
+ return getState(function(_ref4) {
21874
+ var monaco = _ref4.monaco;
21875
+ return monaco;
21876
+ });
21877
+ }
21878
+ var wrapperPromise = new Promise(function(resolve, reject) {
21879
+ return setState({
21880
+ resolve,
21881
+ reject
21882
+ });
21883
+ });
21884
+ var loader = {
21885
+ config,
21886
+ init,
21887
+ __getMonacoInstance
21888
+ };
21889
+ var le = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, v = le;
21890
+ var ae = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Y = ae;
21891
+ function Me({ children: e }) {
21892
+ return require$$0.createElement("div", { style: Y.container }, e);
21893
+ }
21894
+ var Z = Me;
21895
+ var $ = Z;
21896
+ function Ee({ width: e, height: r, isEditorReady: n, loading: t, _ref: a, className: m, wrapperProps: E }) {
21897
+ return require$$0.createElement("section", { style: { ...v.wrapper, width: e, height: r }, ...E }, !n && require$$0.createElement($, null, t), require$$0.createElement("div", { ref: a, style: { ...v.fullWidth, ...!n && v.hide }, className: m }));
21898
+ }
21899
+ var ee = Ee;
21900
+ var H = require$$0.memo(ee);
21901
+ function Ce(e) {
21902
+ require$$0.useEffect(e, []);
21903
+ }
21904
+ var k = Ce;
21905
+ function he(e, r, n = true) {
21906
+ let t = require$$0.useRef(true);
21907
+ require$$0.useEffect(t.current || !n ? () => {
21908
+ t.current = false;
21909
+ } : e, r);
21910
+ }
21911
+ var l = he;
21912
+ function D() {
21913
+ }
21914
+ function h(e, r, n, t) {
21915
+ return De(e, t) || be(e, r, n, t);
21916
+ }
21917
+ function De(e, r) {
21918
+ return e.editor.getModel(te(e, r));
21919
+ }
21920
+ function be(e, r, n, t) {
21921
+ return e.editor.createModel(r, n, t ? te(e, t) : void 0);
21922
+ }
21923
+ function te(e, r) {
21924
+ return e.Uri.parse(r);
21925
+ }
21926
+ function Oe({ original: e, modified: r, language: n, originalLanguage: t, modifiedLanguage: a, originalModelPath: m, modifiedModelPath: E, keepCurrentOriginalModel: g = false, keepCurrentModifiedModel: N = false, theme: x = "light", loading: P = "Loading...", options: y = {}, height: V = "100%", width: z = "100%", className: F, wrapperProps: j = {}, beforeMount: A = D, onMount: q = D }) {
21927
+ let [M, O] = require$$0.useState(false), [T, s] = require$$0.useState(true), u = require$$0.useRef(null), c = require$$0.useRef(null), w = require$$0.useRef(null), d = require$$0.useRef(q), o = require$$0.useRef(A), b = require$$0.useRef(false);
21928
+ k(() => {
21929
+ let i = loader.init();
21930
+ return i.then((f) => (c.current = f) && s(false)).catch((f) => (f == null ? void 0 : f.type) !== "cancelation" && console.error("Monaco initialization: error:", f)), () => u.current ? I() : i.cancel();
21931
+ }), l(() => {
21932
+ if (u.current && c.current) {
21933
+ let i = u.current.getOriginalEditor(), f = h(c.current, e || "", t || n || "text", m || "");
21934
+ f !== i.getModel() && i.setModel(f);
21935
+ }
21936
+ }, [m], M), l(() => {
21937
+ if (u.current && c.current) {
21938
+ let i = u.current.getModifiedEditor(), f = h(c.current, r || "", a || n || "text", E || "");
21939
+ f !== i.getModel() && i.setModel(f);
21940
+ }
21941
+ }, [E], M), l(() => {
21942
+ let i = u.current.getModifiedEditor();
21943
+ i.getOption(c.current.editor.EditorOption.readOnly) ? i.setValue(r || "") : r !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: r || "", forceMoveMarkers: true }]), i.pushUndoStop());
21944
+ }, [r], M), l(() => {
21945
+ var _a, _b;
21946
+ (_b = (_a = u.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.original.setValue(e || "");
21947
+ }, [e], M), l(() => {
21948
+ let { original: i, modified: f } = u.current.getModel();
21949
+ c.current.editor.setModelLanguage(i, t || n || "text"), c.current.editor.setModelLanguage(f, a || n || "text");
21950
+ }, [n, t, a], M), l(() => {
21951
+ var _a;
21952
+ (_a = c.current) == null ? void 0 : _a.editor.setTheme(x);
21953
+ }, [x], M), l(() => {
21954
+ var _a;
21955
+ (_a = u.current) == null ? void 0 : _a.updateOptions(y);
21956
+ }, [y], M);
21957
+ let L = require$$0.useCallback(() => {
21958
+ var _a;
21959
+ if (!c.current) return;
21960
+ o.current(c.current);
21961
+ let i = h(c.current, e || "", t || n || "text", m || ""), f = h(c.current, r || "", a || n || "text", E || "");
21962
+ (_a = u.current) == null ? void 0 : _a.setModel({ original: i, modified: f });
21963
+ }, [n, r, a, e, t, m, E]), U = require$$0.useCallback(() => {
21964
+ var _a;
21965
+ !b.current && w.current && (u.current = c.current.editor.createDiffEditor(w.current, { automaticLayout: true, ...y }), L(), (_a = c.current) == null ? void 0 : _a.editor.setTheme(x), O(true), b.current = true);
21966
+ }, [y, x, L]);
21967
+ require$$0.useEffect(() => {
21968
+ M && d.current(u.current, c.current);
21969
+ }, [M]), require$$0.useEffect(() => {
21970
+ !T && !M && U();
21971
+ }, [T, M, U]);
21972
+ function I() {
21973
+ var _a, _b, _c, _d;
21974
+ let i = (_a = u.current) == null ? void 0 : _a.getModel();
21975
+ g || ((_b = i == null ? void 0 : i.original) == null ? void 0 : _b.dispose()), N || ((_c = i == null ? void 0 : i.modified) == null ? void 0 : _c.dispose()), (_d = u.current) == null ? void 0 : _d.dispose();
21484
21976
  }
21977
+ return require$$0.createElement(H, { width: z, height: V, isEditorReady: M, loading: P, _ref: w, className: F, wrapperProps: j });
21485
21978
  }
21486
- function VisualizerInner({
21487
- workflows,
21488
- onTaskSelect,
21489
- onWorkflowSelect,
21490
- executionResult,
21491
- debugMode = false
21492
- }) {
21493
- const { resolvedTheme } = useTheme();
21494
- const debuggerContext = debugMode ? useDebugger() : null;
21495
- const [selection2, setSelection] = require$$0.useState({ type: "none" });
21496
- const [leftPanelWidth, setLeftPanelWidth] = require$$0.useState(280);
21497
- const [isDragging, setIsDragging] = require$$0.useState(false);
21498
- const [treePanelHeight, setTreePanelHeight] = require$$0.useState(50);
21499
- const [isVerticalDragging, setIsVerticalDragging] = require$$0.useState(false);
21500
- const containerRef = require$$0.useRef(null);
21501
- const leftPanelRef = require$$0.useRef(null);
21502
- const handleSelection = (newSelection) => {
21503
- setSelection(newSelection);
21504
- if (newSelection.type === "workflow-condition") {
21505
- onWorkflowSelect == null ? void 0 : onWorkflowSelect(newSelection.workflow);
21506
- } else if (newSelection.type === "task" || newSelection.type === "task-condition" || newSelection.type === "mapping" || newSelection.type === "validation-rule") {
21507
- onTaskSelect == null ? void 0 : onTaskSelect(newSelection.task, newSelection.workflow);
21979
+ var ie = Oe;
21980
+ require$$0.memo(ie);
21981
+ function He(e) {
21982
+ let r = require$$0.useRef();
21983
+ return require$$0.useEffect(() => {
21984
+ r.current = e;
21985
+ }, [e]), r.current;
21986
+ }
21987
+ var se = He;
21988
+ var _ = /* @__PURE__ */ new Map();
21989
+ function Ve({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: t, language: a, path: m, theme: E = "light", line: g, loading: N = "Loading...", options: x = {}, overrideServices: P = {}, saveViewState: y = true, keepCurrentModel: V = false, width: z = "100%", height: F = "100%", className: j, wrapperProps: A = {}, beforeMount: q = D, onMount: M = D, onChange: O, onValidate: T = D }) {
21990
+ let [s, u] = require$$0.useState(false), [c, w] = require$$0.useState(true), d = require$$0.useRef(null), o = require$$0.useRef(null), b = require$$0.useRef(null), L = require$$0.useRef(M), U = require$$0.useRef(q), I = require$$0.useRef(), i = require$$0.useRef(t), f = se(m), Q = require$$0.useRef(false), B = require$$0.useRef(false);
21991
+ k(() => {
21992
+ let p = loader.init();
21993
+ return p.then((R) => (d.current = R) && w(false)).catch((R) => (R == null ? void 0 : R.type) !== "cancelation" && console.error("Monaco initialization: error:", R)), () => o.current ? pe() : p.cancel();
21994
+ }), l(() => {
21995
+ var _a, _b, _c, _d;
21996
+ let p = h(d.current, e || t || "", r || a || "", m || n || "");
21997
+ p !== ((_a = o.current) == null ? void 0 : _a.getModel()) && (y && _.set(f, (_b = o.current) == null ? void 0 : _b.saveViewState()), (_c = o.current) == null ? void 0 : _c.setModel(p), y && ((_d = o.current) == null ? void 0 : _d.restoreViewState(_.get(m))));
21998
+ }, [m], s), l(() => {
21999
+ var _a;
22000
+ (_a = o.current) == null ? void 0 : _a.updateOptions(x);
22001
+ }, [x], s), l(() => {
22002
+ !o.current || t === void 0 || (o.current.getOption(d.current.editor.EditorOption.readOnly) ? o.current.setValue(t) : t !== o.current.getValue() && (B.current = true, o.current.executeEdits("", [{ range: o.current.getModel().getFullModelRange(), text: t, forceMoveMarkers: true }]), o.current.pushUndoStop(), B.current = false));
22003
+ }, [t], s), l(() => {
22004
+ var _a, _b;
22005
+ let p = (_a = o.current) == null ? void 0 : _a.getModel();
22006
+ p && a && ((_b = d.current) == null ? void 0 : _b.editor.setModelLanguage(p, a));
22007
+ }, [a], s), l(() => {
22008
+ var _a;
22009
+ g !== void 0 && ((_a = o.current) == null ? void 0 : _a.revealLine(g));
22010
+ }, [g], s), l(() => {
22011
+ var _a;
22012
+ (_a = d.current) == null ? void 0 : _a.editor.setTheme(E);
22013
+ }, [E], s);
22014
+ let X2 = require$$0.useCallback(() => {
22015
+ var _a;
22016
+ if (!(!b.current || !d.current) && !Q.current) {
22017
+ U.current(d.current);
22018
+ let p = m || n, R = h(d.current, t || e || "", r || a || "", p || "");
22019
+ o.current = (_a = d.current) == null ? void 0 : _a.editor.create(b.current, { model: R, automaticLayout: true, ...x }, P), y && o.current.restoreViewState(_.get(p)), d.current.editor.setTheme(E), g !== void 0 && o.current.revealLine(g), u(true), Q.current = true;
21508
22020
  }
21509
- };
21510
- const handleMouseDown = require$$0.useCallback((e) => {
21511
- e.preventDefault();
21512
- setIsDragging(true);
21513
- }, []);
21514
- const handleVerticalMouseDown = require$$0.useCallback((e) => {
21515
- e.preventDefault();
21516
- setIsVerticalDragging(true);
21517
- }, []);
21518
- require$$0.useEffect(() => {
21519
- if (!isDragging) return;
21520
- const handleMouseMove = (e) => {
21521
- if (containerRef.current) {
21522
- const rect = containerRef.current.getBoundingClientRect();
21523
- const newWidth = e.clientX - rect.left;
21524
- setLeftPanelWidth(Math.max(200, Math.min(450, newWidth)));
21525
- }
21526
- };
21527
- const handleMouseUp = () => {
21528
- setIsDragging(false);
21529
- };
21530
- document.addEventListener("mousemove", handleMouseMove);
21531
- document.addEventListener("mouseup", handleMouseUp);
21532
- return () => {
21533
- document.removeEventListener("mousemove", handleMouseMove);
21534
- document.removeEventListener("mouseup", handleMouseUp);
21535
- };
21536
- }, [isDragging]);
22021
+ }, [e, r, n, t, a, m, x, P, y, E, g]);
21537
22022
  require$$0.useEffect(() => {
21538
- if (!isVerticalDragging) return;
21539
- const handleMouseMove = (e) => {
21540
- if (leftPanelRef.current) {
21541
- const rect = leftPanelRef.current.getBoundingClientRect();
21542
- const relativeY = e.clientY - rect.top;
21543
- const percentage = relativeY / rect.height * 100;
21544
- setTreePanelHeight(Math.max(20, Math.min(80, percentage)));
21545
- }
21546
- };
21547
- const handleMouseUp = () => {
21548
- setIsVerticalDragging(false);
21549
- };
21550
- document.addEventListener("mousemove", handleMouseMove);
21551
- document.addEventListener("mouseup", handleMouseUp);
22023
+ s && L.current(o.current, d.current);
22024
+ }, [s]), require$$0.useEffect(() => {
22025
+ !c && !s && X2();
22026
+ }, [c, s, X2]), i.current = t, require$$0.useEffect(() => {
22027
+ var _a, _b;
22028
+ s && O && ((_a = I.current) == null ? void 0 : _a.dispose(), I.current = (_b = o.current) == null ? void 0 : _b.onDidChangeModelContent((p) => {
22029
+ B.current || O(o.current.getValue(), p);
22030
+ }));
22031
+ }, [s, O]), require$$0.useEffect(() => {
22032
+ if (s) {
22033
+ let p = d.current.editor.onDidChangeMarkers((R) => {
22034
+ var _a;
22035
+ let G = (_a = o.current.getModel()) == null ? void 0 : _a.uri;
22036
+ if (G && R.find((J) => J.path === G.path)) {
22037
+ let J = d.current.editor.getModelMarkers({ resource: G });
22038
+ T == null ? void 0 : T(J);
22039
+ }
22040
+ });
22041
+ return () => {
22042
+ p == null ? void 0 : p.dispose();
22043
+ };
22044
+ }
21552
22045
  return () => {
21553
- document.removeEventListener("mousemove", handleMouseMove);
21554
- document.removeEventListener("mouseup", handleMouseUp);
21555
22046
  };
21556
- }, [isVerticalDragging]);
21557
- const selectionInfo = getSelectionInfo(selection2);
21558
- const hasDebugTrace = debugMode && (debuggerContext == null ? void 0 : debuggerContext.hasTrace);
21559
- const displayMessage = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.currentMessage : executionResult;
21560
- const currentChanges = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.currentChanges : [];
21561
- const currentStepIndex = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.state.currentStepIndex : -1;
21562
- const highlightedPaths = require$$0.useMemo(() => {
21563
- if (!currentChanges || currentChanges.length === 0) return void 0;
21564
- return currentChanges.map((change) => change.path);
21565
- }, [currentChanges]);
21566
- const isDraggingAny = isDragging || isVerticalDragging;
21567
- return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(
21568
- "div",
21569
- {
21570
- ref: containerRef,
21571
- className: `df-visualizer-horizontal df-theme-${resolvedTheme} ${isDraggingAny ? "df-dragging" : ""}`,
21572
- children: [
21573
- /* @__PURE__ */ jsxRuntime.jsxs(
21574
- "div",
21575
- {
21576
- ref: leftPanelRef,
21577
- className: "df-visualizer-left",
21578
- style: { width: leftPanelWidth },
21579
- children: [
21580
- /* @__PURE__ */ jsxRuntime.jsxs(
21581
- "div",
21582
- {
21583
- className: `df-visualizer-left-tree ${displayMessage ? "df-with-result" : ""}`,
21584
- style: displayMessage ? { height: `${treePanelHeight}%` } : void 0,
21585
- children: [
21586
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-left-header", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-left-title", children: "Explorer" }) }),
21587
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-left-content", children: workflows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-empty-state", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workflows to display" }) }) : /* @__PURE__ */ jsxRuntime.jsx(
21588
- TreeView,
21589
- {
21590
- workflows,
21591
- selection: selection2,
21592
- onSelect: handleSelection,
21593
- debugMode
21594
- }
21595
- ) })
21596
- ]
21597
- }
21598
- ),
21599
- displayMessage && /* @__PURE__ */ jsxRuntime.jsx(
21600
- "div",
21601
- {
21602
- className: `df-visualizer-divider-horizontal ${isVerticalDragging ? "df-divider-active" : ""}`,
21603
- onMouseDown: handleVerticalMouseDown
21604
- }
21605
- ),
21606
- displayMessage && /* @__PURE__ */ jsxRuntime.jsxs(
21607
- "div",
21608
- {
21609
- className: "df-visualizer-result-panel",
21610
- style: { height: `${100 - treePanelHeight}%` },
21611
- children: [
21612
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-result-header", children: [
21613
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-result-title", children: hasDebugTrace ? currentStepIndex !== void 0 && currentStepIndex >= 0 ? `Step ${currentStepIndex + 1}` : "Ready" : "Result" }),
21614
- hasDebugTrace && currentChanges && currentChanges.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-visualizer-result-changes", children: [
21615
- currentChanges.length,
21616
- " change",
21617
- currentChanges.length !== 1 ? "s" : ""
21618
- ] })
21619
- ] }),
21620
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-result-content", children: /* @__PURE__ */ jsxRuntime.jsx(
21621
- JsonEditor,
21622
- {
21623
- value: JSON.stringify(displayMessage, null, 2),
21624
- onChange: () => {
21625
- },
21626
- readOnly: true,
21627
- theme: resolvedTheme === "dark" ? "dark" : "light",
21628
- highlightedPaths
21629
- }
21630
- ) })
21631
- ]
21632
- }
21633
- )
21634
- ]
21635
- }
21636
- ),
21637
- /* @__PURE__ */ jsxRuntime.jsx(
21638
- "div",
21639
- {
21640
- className: `df-visualizer-divider ${isDragging ? "df-divider-active" : ""}`,
21641
- onMouseDown: handleMouseDown
21642
- }
21643
- ),
21644
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-right", children: [
21645
- selectionInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-details-header-info", children: [
21646
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
21647
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
21648
- ] }) }),
21649
- /* @__PURE__ */ jsxRuntime.jsx(DetailsPanel, { selection: selection2 })
21650
- ] })
21651
- ]
21652
- }
21653
- ) });
21654
- }
21655
- function WorkflowVisualizer({
21656
- workflows,
21657
- onWorkflowSelect,
21658
- onTaskSelect,
21659
- theme = "system",
21660
- className = "",
21661
- executionResult,
21662
- debugMode = false
21663
- }) {
21664
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-root ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
21665
- VisualizerInner,
21666
- {
21667
- workflows,
21668
- onTaskSelect,
21669
- onWorkflowSelect,
21670
- executionResult,
21671
- debugMode
21672
- }
21673
- ) }) });
22047
+ }, [s, T]);
22048
+ function pe() {
22049
+ var _a, _b;
22050
+ (_a = I.current) == null ? void 0 : _a.dispose(), V ? y && _.set(m, o.current.saveViewState()) : (_b = o.current.getModel()) == null ? void 0 : _b.dispose(), o.current.dispose();
22051
+ }
22052
+ return require$$0.createElement(H, { width: z, height: F, isEditorReady: s, loading: N, _ref: b, className: j, wrapperProps: A });
21674
22053
  }
21675
- function DebuggerControls({ compact = false, className = "" }) {
21676
- const {
21677
- state,
21678
- play,
21679
- pause,
21680
- stop,
21681
- reset,
21682
- stepForward,
21683
- stepBackward,
21684
- setSpeed,
21685
- isAtStart,
21686
- isAtEnd,
21687
- hasTrace,
21688
- progress,
21689
- totalSteps
21690
- } = useDebugger();
21691
- const { playbackState, playbackSpeed, currentStepIndex, isExecuting } = state;
21692
- const handleKeyDown = require$$0.useCallback(
21693
- (e) => {
21694
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
21695
- return;
21696
- }
21697
- switch (e.key) {
21698
- case " ":
21699
- e.preventDefault();
21700
- if (playbackState === "playing") {
21701
- pause();
21702
- } else if (hasTrace) {
21703
- play();
21704
- }
21705
- break;
21706
- case "ArrowRight":
21707
- e.preventDefault();
21708
- if (hasTrace && !isAtEnd) {
21709
- stepForward();
21710
- }
21711
- break;
21712
- case "ArrowLeft":
21713
- e.preventDefault();
21714
- if (hasTrace && !isAtStart) {
21715
- stepBackward();
22054
+ var fe = Ve;
22055
+ var de = require$$0.memo(fe);
22056
+ var Ft = de;
22057
+ function findPathLineNumbers(jsonString, paths) {
22058
+ if (!paths || paths.length === 0) return [];
22059
+ const lines = jsonString.split("\n");
22060
+ const lineNumbers = [];
22061
+ for (const path of paths) {
22062
+ const pathParts = path.split(".");
22063
+ const lastKey = pathParts[pathParts.length - 1];
22064
+ const keyPattern = new RegExp(`^\\s*"${lastKey}"\\s*:`);
22065
+ for (let i = 0; i < lines.length; i++) {
22066
+ if (keyPattern.test(lines[i])) {
22067
+ if (pathParts.length === 1) {
22068
+ lineNumbers.push(i + 1);
22069
+ } else {
22070
+ let matchedParents = 0;
22071
+ for (let j = i - 1; j >= 0 && matchedParents < pathParts.length - 1; j--) {
22072
+ const parentKey = pathParts[pathParts.length - 2 - matchedParents];
22073
+ const parentPattern = new RegExp(`^\\s*"${parentKey}"\\s*:`);
22074
+ if (parentPattern.test(lines[j])) {
22075
+ matchedParents++;
22076
+ }
21716
22077
  }
21717
- break;
21718
- case "Escape":
21719
- e.preventDefault();
21720
- stop();
21721
- break;
21722
- case "r":
21723
- if (e.metaKey || e.ctrlKey) {
21724
- e.preventDefault();
21725
- reset();
22078
+ if (matchedParents >= Math.min(pathParts.length - 1, 2)) {
22079
+ lineNumbers.push(i + 1);
21726
22080
  }
21727
- break;
21728
- }
21729
- },
21730
- [playbackState, hasTrace, isAtEnd, isAtStart, play, pause, stop, stepForward, stepBackward, reset]
21731
- );
21732
- require$$0.useEffect(() => {
21733
- window.addEventListener("keydown", handleKeyDown);
21734
- return () => window.removeEventListener("keydown", handleKeyDown);
21735
- }, [handleKeyDown]);
21736
- const handleSpeedChange = (e) => {
21737
- setSpeed(Number(e.target.value));
21738
- };
21739
- if (compact) {
21740
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-controls df-debug-controls-compact ${className}`, children: [
21741
- /* @__PURE__ */ jsxRuntime.jsx(
21742
- "button",
21743
- {
21744
- className: "df-debug-btn",
21745
- onClick: stepBackward,
21746
- disabled: !hasTrace || isAtStart || isExecuting,
21747
- title: "Previous step (Left Arrow)",
21748
- children: /* @__PURE__ */ jsxRuntime.jsx(SkipBack, { size: 16 })
21749
- }
21750
- ),
21751
- playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
21752
- "button",
21753
- {
21754
- className: "df-debug-btn df-debug-btn-primary",
21755
- onClick: pause,
21756
- disabled: !hasTrace || isExecuting,
21757
- title: "Pause (Space)",
21758
- children: /* @__PURE__ */ jsxRuntime.jsx(Pause, { size: 18 })
21759
- }
21760
- ) : /* @__PURE__ */ jsxRuntime.jsx(
21761
- "button",
21762
- {
21763
- className: "df-debug-btn df-debug-btn-primary",
21764
- onClick: play,
21765
- disabled: !hasTrace || isAtEnd || isExecuting,
21766
- title: "Play (Space)",
21767
- children: /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 18 })
21768
- }
21769
- ),
21770
- /* @__PURE__ */ jsxRuntime.jsx(
21771
- "button",
21772
- {
21773
- className: "df-debug-btn",
21774
- onClick: stepForward,
21775
- disabled: !hasTrace || isAtEnd || isExecuting,
21776
- title: "Next step (Right Arrow)",
21777
- children: /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 16 })
21778
22081
  }
21779
- ),
21780
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-step-counter", children: [
21781
- currentStepIndex + 1,
21782
- " / ",
21783
- totalSteps
21784
- ] })
21785
- ] });
22082
+ }
22083
+ }
21786
22084
  }
21787
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-controls ${className}`, children: [
21788
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-controls-main", children: [
21789
- /* @__PURE__ */ jsxRuntime.jsx(
21790
- "button",
21791
- {
21792
- className: "df-debug-btn",
21793
- onClick: stop,
21794
- disabled: !hasTrace || isExecuting,
21795
- title: "Stop (Escape)",
21796
- children: /* @__PURE__ */ jsxRuntime.jsx(Square, { size: 20 })
21797
- }
21798
- ),
21799
- /* @__PURE__ */ jsxRuntime.jsx(
21800
- "button",
21801
- {
21802
- className: "df-debug-btn",
21803
- onClick: stepBackward,
21804
- disabled: !hasTrace || isAtStart || isExecuting,
21805
- title: "Previous step (Left Arrow)",
21806
- children: /* @__PURE__ */ jsxRuntime.jsx(SkipBack, { size: 20 })
21807
- }
21808
- ),
21809
- playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
21810
- "button",
21811
- {
21812
- className: "df-debug-btn df-debug-btn-primary",
21813
- onClick: pause,
21814
- disabled: !hasTrace || isExecuting,
21815
- title: "Pause (Space)",
21816
- children: /* @__PURE__ */ jsxRuntime.jsx(Pause, { size: 24 })
21817
- }
21818
- ) : /* @__PURE__ */ jsxRuntime.jsx(
21819
- "button",
21820
- {
21821
- className: "df-debug-btn df-debug-btn-primary",
21822
- onClick: play,
21823
- disabled: !hasTrace || isAtEnd || isExecuting,
21824
- title: "Play (Space)",
21825
- children: /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 24 })
21826
- }
21827
- ),
21828
- /* @__PURE__ */ jsxRuntime.jsx(
21829
- "button",
21830
- {
21831
- className: "df-debug-btn",
21832
- onClick: stepForward,
21833
- disabled: !hasTrace || isAtEnd || isExecuting,
21834
- title: "Next step (Right Arrow)",
21835
- children: /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 20 })
21836
- }
21837
- ),
21838
- /* @__PURE__ */ jsxRuntime.jsx(
21839
- "button",
21840
- {
21841
- className: "df-debug-btn",
21842
- onClick: reset,
21843
- disabled: !hasTrace || isExecuting,
21844
- title: "Reset (Ctrl+R)",
21845
- children: /* @__PURE__ */ jsxRuntime.jsx(RotateCcw, { size: 20 })
21846
- }
21847
- )
21848
- ] }),
21849
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-progress", children: [
21850
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-progress-bar", children: /* @__PURE__ */ jsxRuntime.jsx(
21851
- "div",
21852
- {
21853
- className: "df-debug-progress-fill",
21854
- style: { width: `${progress * 100}%` }
21855
- }
21856
- ) }),
21857
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-step-counter", children: [
21858
- "Step ",
21859
- currentStepIndex + 1,
21860
- " of ",
21861
- totalSteps
21862
- ] })
21863
- ] }),
21864
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-speed", children: [
21865
- /* @__PURE__ */ jsxRuntime.jsx(Gauge, { size: 14 }),
21866
- /* @__PURE__ */ jsxRuntime.jsx(
21867
- "input",
21868
- {
21869
- type: "range",
21870
- min: "100",
21871
- max: "2000",
21872
- step: "100",
21873
- value: playbackSpeed,
21874
- onChange: handleSpeedChange,
21875
- className: "df-debug-speed-slider",
21876
- title: `Playback speed: ${playbackSpeed}ms`
21877
- }
21878
- ),
21879
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-speed-label", children: [
21880
- playbackSpeed,
21881
- "ms"
21882
- ] })
21883
- ] })
21884
- ] });
22085
+ return [...new Set(lineNumbers)];
21885
22086
  }
21886
- function MessageInputPanel({
21887
- onExecute,
21888
- isExecuting = false,
21889
- className = ""
22087
+ const defineThemes = (monaco) => {
22088
+ monaco.editor.defineTheme("vscode-dark", {
22089
+ base: "vs-dark",
22090
+ inherit: true,
22091
+ rules: [
22092
+ { token: "string.key.json", foreground: "9CDCFE" },
22093
+ { token: "string.value.json", foreground: "CE9178" },
22094
+ { token: "number", foreground: "B5CEA8" },
22095
+ { token: "keyword", foreground: "569CD6" },
22096
+ { token: "delimiter", foreground: "D4D4D4" }
22097
+ ],
22098
+ colors: {
22099
+ "editor.background": "#1e1e1e",
22100
+ "editor.foreground": "#d4d4d4",
22101
+ "editor.lineHighlightBackground": "#2d2d2d",
22102
+ "editor.selectionBackground": "#264f78",
22103
+ "editorCursor.foreground": "#aeafad",
22104
+ "editorLineNumber.foreground": "#858585",
22105
+ "editorLineNumber.activeForeground": "#c6c6c6",
22106
+ "editorIndentGuide.background": "#404040",
22107
+ "editorIndentGuide.activeBackground": "#707070",
22108
+ "editor.selectionHighlightBackground": "#3a3d41",
22109
+ "editorBracketMatch.background": "#0064001a",
22110
+ "editorBracketMatch.border": "#888888",
22111
+ "editorGutter.background": "#1e1e1e",
22112
+ "scrollbarSlider.background": "#79797966",
22113
+ "scrollbarSlider.hoverBackground": "#646464b3",
22114
+ "scrollbarSlider.activeBackground": "#bfbfbf66",
22115
+ "minimap.background": "#1e1e1e"
22116
+ }
22117
+ });
22118
+ monaco.editor.defineTheme("vscode-light", {
22119
+ base: "vs",
22120
+ inherit: true,
22121
+ rules: [
22122
+ { token: "string.key.json", foreground: "0451A5" },
22123
+ { token: "string.value.json", foreground: "A31515" },
22124
+ { token: "number", foreground: "098658" },
22125
+ { token: "keyword", foreground: "0000FF" },
22126
+ { token: "delimiter", foreground: "000000" }
22127
+ ],
22128
+ colors: {
22129
+ "editor.background": "#ffffff",
22130
+ "editor.foreground": "#000000",
22131
+ "editor.lineHighlightBackground": "#f5f5f5",
22132
+ "editor.selectionBackground": "#add6ff",
22133
+ "editorCursor.foreground": "#000000",
22134
+ "editorLineNumber.foreground": "#999999",
22135
+ "editorLineNumber.activeForeground": "#000000",
22136
+ "editorIndentGuide.background": "#d3d3d3",
22137
+ "editorIndentGuide.activeBackground": "#939393",
22138
+ "editor.selectionHighlightBackground": "#add6ff4d",
22139
+ "editorBracketMatch.background": "#0064001a",
22140
+ "editorBracketMatch.border": "#b9b9b9",
22141
+ "editorGutter.background": "#ffffff",
22142
+ "scrollbarSlider.background": "#64646466",
22143
+ "scrollbarSlider.hoverBackground": "#646464b3",
22144
+ "scrollbarSlider.activeBackground": "#00000099",
22145
+ "minimap.background": "#ffffff"
22146
+ }
22147
+ });
22148
+ };
22149
+ function JsonEditor({
22150
+ value,
22151
+ onChange,
22152
+ readOnly = false,
22153
+ className = "",
22154
+ theme = "dark",
22155
+ onCursorChange,
22156
+ highlightedPaths
21890
22157
  }) {
21891
- const { setInputPayload, state } = useDebugger();
21892
- const { inputPayload } = state;
21893
- const [expandedSections, setExpandedSections] = require$$0.useState(
21894
- /* @__PURE__ */ new Set(["payload"])
21895
- );
21896
- const [editingSection, setEditingSection] = require$$0.useState(null);
21897
- const [editText, setEditText] = require$$0.useState("");
21898
- const [parseError, setParseError] = require$$0.useState(null);
21899
- const payload = inputPayload || {};
21900
- const toggleSection = (section) => {
21901
- setExpandedSections((prev) => {
21902
- const next = new Set(prev);
21903
- if (next.has(section)) {
21904
- next.delete(section);
21905
- } else {
21906
- next.add(section);
21907
- }
21908
- return next;
22158
+ const editorRef = require$$0.useRef(null);
22159
+ const decorationsRef = require$$0.useRef([]);
22160
+ const handleEditorMount = require$$0.useCallback((editor, monaco) => {
22161
+ editorRef.current = editor;
22162
+ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
22163
+ validate: true,
22164
+ schemas: [],
22165
+ allowComments: false,
22166
+ trailingCommas: "error"
21909
22167
  });
21910
- };
21911
- const startEditing = () => {
21912
- setEditingSection("payload");
21913
- setEditText(JSON.stringify(payload, null, 2));
21914
- setParseError(null);
21915
- };
21916
- const cancelEditing = () => {
21917
- setEditingSection(null);
21918
- setEditText("");
21919
- setParseError(null);
21920
- };
21921
- const saveEditing = require$$0.useCallback(() => {
21922
- if (!editingSection) return;
21923
- try {
21924
- const parsed = JSON.parse(editText);
21925
- setInputPayload(parsed);
21926
- setEditingSection(null);
21927
- setEditText("");
21928
- setParseError(null);
21929
- } catch (err) {
21930
- setParseError(err instanceof Error ? err.message : "Invalid JSON");
22168
+ if (onCursorChange) {
22169
+ editor.onDidChangeCursorPosition((e) => {
22170
+ onCursorChange(e.position.lineNumber, e.position.column);
22171
+ });
21931
22172
  }
21932
- }, [editingSection, editText, setInputPayload]);
21933
- const handleLoadSample = () => {
21934
- setInputPayload({
21935
- id: "123",
21936
- name: "John Doe",
21937
- email: "john@example.com",
21938
- amount: 100
21939
- });
21940
- };
21941
- const handleClear = () => {
21942
- setInputPayload({});
21943
- };
21944
- const formatValue2 = (value) => {
21945
- if (Object.keys(value).length === 0) {
21946
- return "(empty)";
22173
+ if (!readOnly) {
22174
+ editor.focus();
21947
22175
  }
21948
- return JSON.stringify(value, null, 2);
21949
- };
21950
- const isEmptyPayload = Object.keys(payload).length === 0;
21951
- const isExpanded = expandedSections.has("payload");
21952
- const isEditing = editingSection === "payload";
21953
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-input-panel ${className}`, children: [
21954
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-header", children: [
21955
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-input-title", children: "Test Payload" }),
21956
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-actions", children: [
21957
- /* @__PURE__ */ jsxRuntime.jsxs(
21958
- "button",
21959
- {
21960
- className: "df-debug-btn-sm",
21961
- onClick: handleLoadSample,
21962
- title: "Load sample data",
21963
- children: [
21964
- /* @__PURE__ */ jsxRuntime.jsx(FileJson, { size: 12 }),
21965
- "Sample"
21966
- ]
22176
+ }, [onCursorChange, readOnly]);
22177
+ require$$0.useEffect(() => {
22178
+ if (!editorRef.current || !highlightedPaths || highlightedPaths.length === 0) {
22179
+ if (editorRef.current && decorationsRef.current.length > 0) {
22180
+ decorationsRef.current = editorRef.current.deltaDecorations(decorationsRef.current, []);
22181
+ }
22182
+ return;
22183
+ }
22184
+ const lineNumbers = findPathLineNumbers(value, highlightedPaths);
22185
+ if (lineNumbers.length > 0) {
22186
+ const decorations = lineNumbers.map((lineNumber) => ({
22187
+ range: {
22188
+ startLineNumber: lineNumber,
22189
+ startColumn: 1,
22190
+ endLineNumber: lineNumber,
22191
+ endColumn: 1
22192
+ },
22193
+ options: {
22194
+ isWholeLine: true,
22195
+ className: "df-highlighted-line",
22196
+ glyphMarginClassName: "df-highlighted-glyph",
22197
+ overviewRuler: {
22198
+ color: theme === "dark" ? "#4ec9b0" : "#388a34",
22199
+ position: 1
22200
+ // Left
21967
22201
  }
21968
- ),
21969
- /* @__PURE__ */ jsxRuntime.jsxs(
22202
+ }
22203
+ }));
22204
+ decorationsRef.current = editorRef.current.deltaDecorations(
22205
+ decorationsRef.current,
22206
+ decorations
22207
+ );
22208
+ } else {
22209
+ decorationsRef.current = editorRef.current.deltaDecorations(decorationsRef.current, []);
22210
+ }
22211
+ }, [value, highlightedPaths, theme]);
22212
+ const handleChange = require$$0.useCallback((newValue) => {
22213
+ onChange(newValue || "");
22214
+ }, [onChange]);
22215
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-monaco-editor-wrapper ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
22216
+ Ft,
22217
+ {
22218
+ height: "100%",
22219
+ defaultLanguage: "json",
22220
+ value,
22221
+ onChange: handleChange,
22222
+ onMount: handleEditorMount,
22223
+ beforeMount: defineThemes,
22224
+ theme: theme === "dark" ? "vscode-dark" : "vscode-light",
22225
+ options: {
22226
+ readOnly,
22227
+ minimap: { enabled: false },
22228
+ fontSize: 13,
22229
+ fontFamily: "'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace",
22230
+ lineHeight: 20,
22231
+ tabSize: 2,
22232
+ insertSpaces: true,
22233
+ automaticLayout: true,
22234
+ scrollBeyondLastLine: false,
22235
+ wordWrap: "on",
22236
+ wrappingIndent: "indent",
22237
+ folding: true,
22238
+ foldingStrategy: "indentation",
22239
+ showFoldingControls: "mouseover",
22240
+ bracketPairColorization: { enabled: true },
22241
+ guides: {
22242
+ bracketPairs: false,
22243
+ indentation: false,
22244
+ highlightActiveBracketPair: true,
22245
+ highlightActiveIndentation: false
22246
+ },
22247
+ renderLineHighlight: readOnly ? "none" : "line",
22248
+ selectOnLineNumbers: true,
22249
+ roundedSelection: true,
22250
+ cursorBlinking: "smooth",
22251
+ cursorSmoothCaretAnimation: "on",
22252
+ smoothScrolling: true,
22253
+ padding: { top: 8, bottom: 8 },
22254
+ scrollbar: {
22255
+ vertical: "auto",
22256
+ horizontal: "auto",
22257
+ verticalScrollbarSize: 10,
22258
+ horizontalScrollbarSize: 10
22259
+ },
22260
+ overviewRulerBorder: false,
22261
+ hideCursorInOverviewRuler: true,
22262
+ contextmenu: true,
22263
+ quickSuggestions: false,
22264
+ suggestOnTriggerCharacters: false,
22265
+ acceptSuggestionOnEnter: "off",
22266
+ formatOnPaste: true,
22267
+ formatOnType: false,
22268
+ glyphMargin: highlightedPaths && highlightedPaths.length > 0
22269
+ }
22270
+ }
22271
+ ) });
22272
+ }
22273
+ class ErrorBoundary extends require$$0.Component {
22274
+ constructor(props) {
22275
+ super(props);
22276
+ this.state = { hasError: false, error: null };
22277
+ }
22278
+ static getDerivedStateFromError(error) {
22279
+ return { hasError: true, error };
22280
+ }
22281
+ componentDidCatch(error, errorInfo) {
22282
+ console.error("ErrorBoundary caught an error:", error, errorInfo);
22283
+ }
22284
+ render() {
22285
+ var _a;
22286
+ if (this.state.hasError) {
22287
+ if (this.props.fallback) {
22288
+ return this.props.fallback;
22289
+ }
22290
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-error-boundary", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-error-boundary-content", children: [
22291
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "df-error-boundary-title", children: "Something went wrong" }),
22292
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "df-error-boundary-message", children: ((_a = this.state.error) == null ? void 0 : _a.message) || "An unexpected error occurred" }),
22293
+ /* @__PURE__ */ jsxRuntime.jsx(
21970
22294
  "button",
21971
22295
  {
21972
- className: "df-debug-btn-sm",
21973
- onClick: handleClear,
21974
- title: "Clear all data",
21975
- children: [
21976
- /* @__PURE__ */ jsxRuntime.jsx(RefreshCw, { size: 12 }),
21977
- "Clear"
21978
- ]
22296
+ className: "df-error-boundary-button",
22297
+ onClick: () => this.setState({ hasError: false, error: null }),
22298
+ children: "Try again"
21979
22299
  }
21980
22300
  )
21981
- ] })
21982
- ] }),
21983
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-sections", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-section", children: [
21984
- /* @__PURE__ */ jsxRuntime.jsxs(
21985
- "div",
21986
- {
21987
- className: "df-debug-input-section-header",
21988
- onClick: () => !isEditing && toggleSection("payload"),
21989
- children: [
21990
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-toggle", children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14 }) }),
21991
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-label", children: "Payload" }),
21992
- isEmptyPayload && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-empty", children: "(empty)" }),
21993
- !isEditing && /* @__PURE__ */ jsxRuntime.jsx(
21994
- "button",
21995
- {
21996
- className: "df-debug-section-edit",
21997
- onClick: (e) => {
21998
- e.stopPropagation();
21999
- startEditing();
22000
- },
22001
- title: "Edit Payload",
22002
- children: "Edit"
22003
- }
22004
- )
22005
- ]
22006
- }
22007
- ),
22008
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-section-content", children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-editor", children: [
22009
- /* @__PURE__ */ jsxRuntime.jsx(
22010
- "textarea",
22011
- {
22012
- className: "df-debug-input-textarea",
22013
- value: editText,
22014
- onChange: (e) => setEditText(e.target.value),
22015
- placeholder: "Enter payload as JSON...",
22016
- spellCheck: false
22017
- }
22018
- ),
22019
- parseError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-error", children: parseError }),
22020
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-input-editor-actions", children: [
22021
- /* @__PURE__ */ jsxRuntime.jsx(
22022
- "button",
22023
- {
22024
- className: "df-debug-btn-sm df-debug-btn-cancel",
22025
- onClick: cancelEditing,
22026
- children: "Cancel"
22027
- }
22028
- ),
22029
- /* @__PURE__ */ jsxRuntime.jsx(
22030
- "button",
22031
- {
22032
- className: "df-debug-btn-sm df-debug-btn-save",
22033
- onClick: saveEditing,
22034
- children: "Save"
22035
- }
22036
- )
22037
- ] })
22038
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "df-debug-input-preview", children: formatValue2(payload) }) })
22039
- ] }) }),
22040
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-input-footer", children: /* @__PURE__ */ jsxRuntime.jsx(
22041
- "button",
22042
- {
22043
- className: "df-debug-run-btn",
22044
- onClick: onExecute,
22045
- disabled: isExecuting,
22046
- children: isExecuting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22047
- /* @__PURE__ */ jsxRuntime.jsx(RefreshCw, { size: 14, className: "df-debug-spin" }),
22048
- "Executing..."
22049
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22050
- /* @__PURE__ */ jsxRuntime.jsx(Play, { size: 14 }),
22051
- "Run Debug"
22052
- ] })
22053
- }
22054
- ) })
22055
- ] });
22056
- }
22057
- function MessageStatePanel({ className = "" }) {
22058
- const { currentStep, currentMessage, currentChanges } = useDebugger();
22059
- const [activeTab, setActiveTab] = require$$0.useState("message");
22060
- if (!currentStep || !currentMessage) {
22061
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-debug-state-panel df-debug-state-empty ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No step selected. Run debug to see message state changes." }) });
22301
+ ] }) });
22302
+ }
22303
+ return this.props.children;
22062
22304
  }
22063
- const { workflow_id, task_id, result } = currentStep;
22064
- const tabs = [
22065
- { key: "message", label: "Message" },
22066
- { key: "changes", label: `Changes (${currentChanges.length})` }
22067
- ];
22068
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-state-panel ${className}`, children: [
22069
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-state-header", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-state-tabs", children: tabs.map(({ key, label }) => /* @__PURE__ */ jsxRuntime.jsx(
22070
- "button",
22071
- {
22072
- className: `df-debug-state-tab ${activeTab === key ? "df-debug-state-tab-active" : ""}`,
22073
- onClick: () => setActiveTab(key),
22074
- children: label
22075
- },
22076
- key
22077
- )) }) }),
22078
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-content", children: [
22079
- activeTab === "message" && /* @__PURE__ */ jsxRuntime.jsx(MessageView, { message: currentMessage }),
22080
- activeTab === "changes" && /* @__PURE__ */ jsxRuntime.jsx(ChangesView, { changes: currentChanges })
22081
- ] }),
22082
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-footer", children: [
22083
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-step-type", children: [
22084
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-state-badge df-debug-state-badge-${result}`, children: result }),
22085
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-debug-state-type-label", children: [
22086
- workflow_id,
22087
- task_id ? ` / ${task_id}` : ""
22088
- ] })
22089
- ] }),
22090
- currentMessage.errors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-state-error", children: [
22091
- "Errors: ",
22092
- currentMessage.errors.length
22093
- ] })
22094
- ] })
22095
- ] });
22096
- }
22097
- function MessageView({ message }) {
22098
- const [expandedSections, setExpandedSections] = require$$0.useState(
22099
- /* @__PURE__ */ new Set(["context"])
22100
- );
22101
- const toggleSection = (section) => {
22102
- setExpandedSections((prev) => {
22103
- const next = new Set(prev);
22104
- if (next.has(section)) {
22105
- next.delete(section);
22106
- } else {
22107
- next.add(section);
22108
- }
22109
- return next;
22110
- });
22111
- };
22112
- const sections = [
22113
- { key: "context", value: message.context },
22114
- { key: "payload", value: message.payload },
22115
- { key: "errors", value: message.errors },
22116
- { key: "audit_trail", value: message.audit_trail }
22117
- ];
22118
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-message-view", children: sections.map(({ key, value }) => {
22119
- const isExpanded = expandedSections.has(key);
22120
- const isEmpty2 = Array.isArray(value) ? value.length === 0 : typeof value === "object" && value !== null ? Object.keys(value).length === 0 : !value;
22121
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-message-section", children: [
22122
- /* @__PURE__ */ jsxRuntime.jsxs(
22123
- "div",
22124
- {
22125
- className: "df-debug-message-section-header",
22126
- onClick: () => toggleSection(key),
22127
- children: [
22128
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-arrow", children: isExpanded ? "▼" : "▶" }),
22129
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-key", children: key }),
22130
- isEmpty2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-section-empty", children: "(empty)" })
22131
- ]
22132
- }
22133
- ),
22134
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "df-debug-message-section-content", children: JSON.stringify(value, null, 2) })
22135
- ] }, key);
22136
- }) });
22137
22305
  }
22138
- function ChangesView({ changes }) {
22139
- if (changes.length === 0) {
22140
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-changes-empty", children: "No changes recorded in this step" });
22306
+ function getSelectionInfo(selection2) {
22307
+ switch (selection2.type) {
22308
+ case "workflow-condition":
22309
+ return {
22310
+ title: "Workflow Condition",
22311
+ subtitle: selection2.workflow.name
22312
+ };
22313
+ case "task":
22314
+ return {
22315
+ title: selection2.task.name,
22316
+ subtitle: `${selection2.workflow.name} / ${selection2.task.function.name}`
22317
+ };
22318
+ case "task-condition":
22319
+ return {
22320
+ title: "Task Condition",
22321
+ subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
22322
+ };
22323
+ case "mapping":
22324
+ return {
22325
+ title: selection2.mapping.path,
22326
+ subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
22327
+ };
22328
+ case "validation-rule":
22329
+ return {
22330
+ title: selection2.rule.message,
22331
+ subtitle: `${selection2.workflow.name} / ${selection2.task.name}`
22332
+ };
22333
+ default:
22334
+ return null;
22141
22335
  }
22142
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-changes-view", children: changes.map((change, index2) => {
22143
- const isModified = change.old_value !== void 0 && change.new_value !== void 0;
22144
- const isAdded = change.old_value === void 0 && change.new_value !== void 0;
22145
- const isRemoved = change.old_value !== void 0 && change.new_value === void 0;
22146
- const changeType = isAdded ? "added" : isRemoved ? "removed" : "modified";
22147
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-change-item df-debug-change-${changeType}`, children: [
22148
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-change-header", children: [
22149
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-change-op df-debug-change-op-${changeType}`, children: changeType }),
22150
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-path", children: change.path })
22151
- ] }),
22152
- isModified && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-change-values", children: [
22153
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-old", children: formatValue(change.old_value) }),
22154
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-arrow", children: "→" }),
22155
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-new", children: formatValue(change.new_value) })
22156
- ] }),
22157
- isAdded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-change-values", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-new", children: formatValue(change.new_value) }) }),
22158
- isRemoved && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-change-values", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-change-old", children: formatValue(change.old_value) }) })
22159
- ] }, index2);
22160
- }) });
22161
- }
22162
- function formatValue(value) {
22163
- if (value === void 0) return "undefined";
22164
- if (value === null) return "null";
22165
- if (typeof value === "string") return `"${value}"`;
22166
- if (typeof value === "object") return JSON.stringify(value);
22167
- return String(value);
22168
22336
  }
22169
- function DebugInfoBubble({
22170
- step,
22171
- targetRef,
22172
- visible,
22173
- onClose
22337
+ function VisualizerInner({
22338
+ workflows,
22339
+ onTaskSelect,
22340
+ onWorkflowSelect,
22341
+ executionResult,
22342
+ debugMode = false,
22343
+ showDebugToolbar = false,
22344
+ debugConfig,
22345
+ debugPayload
22174
22346
  }) {
22175
- var _a;
22176
- const [position, setPosition] = require$$0.useState({ top: 0, left: 0 });
22177
- const bubbleRef = require$$0.useRef(null);
22347
+ const { resolvedTheme } = useTheme();
22348
+ const debuggerContext = debugMode ? useDebugger() : null;
22349
+ const [selection2, setSelection] = require$$0.useState({ type: "none" });
22350
+ const [leftPanelWidth, setLeftPanelWidth] = require$$0.useState(280);
22351
+ const [isDragging, setIsDragging] = require$$0.useState(false);
22352
+ const [treePanelHeight, setTreePanelHeight] = require$$0.useState(50);
22353
+ const [isVerticalDragging, setIsVerticalDragging] = require$$0.useState(false);
22354
+ const containerRef = require$$0.useRef(null);
22355
+ const leftPanelRef = require$$0.useRef(null);
22356
+ const handleSelection = (newSelection) => {
22357
+ setSelection(newSelection);
22358
+ if (newSelection.type === "workflow-condition") {
22359
+ onWorkflowSelect == null ? void 0 : onWorkflowSelect(newSelection.workflow);
22360
+ } else if (newSelection.type === "task" || newSelection.type === "task-condition" || newSelection.type === "mapping" || newSelection.type === "validation-rule") {
22361
+ onTaskSelect == null ? void 0 : onTaskSelect(newSelection.task, newSelection.workflow);
22362
+ }
22363
+ };
22364
+ const handleMouseDown = require$$0.useCallback((e) => {
22365
+ e.preventDefault();
22366
+ setIsDragging(true);
22367
+ }, []);
22368
+ const handleVerticalMouseDown = require$$0.useCallback((e) => {
22369
+ e.preventDefault();
22370
+ setIsVerticalDragging(true);
22371
+ }, []);
22178
22372
  require$$0.useEffect(() => {
22179
- if (!visible || !targetRef.current) return;
22180
- const updatePosition = () => {
22181
- var _a2, _b;
22182
- const targetRect = (_a2 = targetRef.current) == null ? void 0 : _a2.getBoundingClientRect();
22183
- const bubbleRect = (_b = bubbleRef.current) == null ? void 0 : _b.getBoundingClientRect();
22184
- if (!targetRect) return;
22185
- let top = targetRect.bottom + 8;
22186
- let left = targetRect.left;
22187
- if (bubbleRect) {
22188
- if (left + bubbleRect.width > window.innerWidth - 16) {
22189
- left = window.innerWidth - bubbleRect.width - 16;
22190
- }
22191
- if (top + bubbleRect.height > window.innerHeight - 16) {
22192
- top = targetRect.top - bubbleRect.height - 8;
22193
- }
22373
+ if (!isDragging) return;
22374
+ const handleMouseMove = (e) => {
22375
+ if (containerRef.current) {
22376
+ const rect = containerRef.current.getBoundingClientRect();
22377
+ const newWidth = e.clientX - rect.left;
22378
+ setLeftPanelWidth(Math.max(200, Math.min(450, newWidth)));
22194
22379
  }
22195
- setPosition({ top, left });
22196
22380
  };
22197
- updatePosition();
22198
- window.addEventListener("scroll", updatePosition, true);
22199
- window.addEventListener("resize", updatePosition);
22381
+ const handleMouseUp = () => {
22382
+ setIsDragging(false);
22383
+ };
22384
+ document.addEventListener("mousemove", handleMouseMove);
22385
+ document.addEventListener("mouseup", handleMouseUp);
22200
22386
  return () => {
22201
- window.removeEventListener("scroll", updatePosition, true);
22202
- window.removeEventListener("resize", updatePosition);
22387
+ document.removeEventListener("mousemove", handleMouseMove);
22388
+ document.removeEventListener("mouseup", handleMouseUp);
22203
22389
  };
22204
- }, [visible, targetRef]);
22205
- if (!visible) return null;
22206
- const { workflow_id, task_id, result, message } = step;
22207
- const state = result === "executed" ? "executed" : "skipped";
22208
- const hasError = message && message.errors && message.errors.length > 0;
22209
- const displayState = hasError ? "error" : state;
22210
- return reactDom.createPortal(
22211
- /* @__PURE__ */ jsxRuntime.jsxs(
22212
- "div",
22213
- {
22214
- ref: bubbleRef,
22215
- className: "df-debug-bubble",
22216
- style: {
22217
- position: "fixed",
22218
- top: position.top,
22219
- left: position.left
22220
- },
22221
- children: [
22222
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-header", children: [
22223
- /* @__PURE__ */ jsxRuntime.jsx(StateIcon, { state: displayState }),
22224
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-title", children: task_id ? "Task Step" : "Workflow Skipped" }),
22225
- onClose && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "df-debug-bubble-close", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 }) })
22226
- ] }),
22227
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-content", children: [
22228
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
22229
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Workflow:" }),
22230
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-value", children: workflow_id })
22231
- ] }),
22232
- task_id && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
22233
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Task:" }),
22234
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-value", children: task_id })
22235
- ] }),
22236
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-row", children: [
22237
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-bubble-label", children: "Result:" }),
22238
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-bubble-state df-debug-bubble-state-${displayState}`, children: result })
22239
- ] }),
22240
- hasError && (message == null ? void 0 : message.errors) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-bubble-error", children: [
22241
- /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { size: 14 }),
22242
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: ((_a = message.errors[0]) == null ? void 0 : _a.message) || "Unknown error" })
22243
- ] })
22244
- ] })
22245
- ]
22390
+ }, [isDragging]);
22391
+ require$$0.useEffect(() => {
22392
+ if (!isVerticalDragging) return;
22393
+ const handleMouseMove = (e) => {
22394
+ if (leftPanelRef.current) {
22395
+ const rect = leftPanelRef.current.getBoundingClientRect();
22396
+ const relativeY = e.clientY - rect.top;
22397
+ const percentage = relativeY / rect.height * 100;
22398
+ setTreePanelHeight(Math.max(20, Math.min(80, percentage)));
22246
22399
  }
22247
- ),
22248
- document.body
22249
- );
22250
- }
22251
- function StateIcon({ state }) {
22252
- switch (state) {
22253
- case "executed":
22254
- return /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 16, className: "df-debug-icon-executed" });
22255
- case "skipped":
22256
- return /* @__PURE__ */ jsxRuntime.jsx(SkipForward, { size: 16, className: "df-debug-icon-skipped" });
22257
- case "error":
22258
- return /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { size: 16, className: "df-debug-icon-error" });
22259
- case "current":
22260
- return /* @__PURE__ */ jsxRuntime.jsx(Clock, { size: 16, className: "df-debug-icon-current" });
22261
- case "pending":
22262
- default:
22263
- return /* @__PURE__ */ jsxRuntime.jsx(Clock, { size: 16, className: "df-debug-icon-pending" });
22264
- }
22400
+ };
22401
+ const handleMouseUp = () => {
22402
+ setIsVerticalDragging(false);
22403
+ };
22404
+ document.addEventListener("mousemove", handleMouseMove);
22405
+ document.addEventListener("mouseup", handleMouseUp);
22406
+ return () => {
22407
+ document.removeEventListener("mousemove", handleMouseMove);
22408
+ document.removeEventListener("mouseup", handleMouseUp);
22409
+ };
22410
+ }, [isVerticalDragging]);
22411
+ const selectionInfo = getSelectionInfo(selection2);
22412
+ const hasDebugTrace = debugMode && (debuggerContext == null ? void 0 : debuggerContext.hasTrace);
22413
+ const displayMessage = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.currentMessage : executionResult;
22414
+ const currentChanges = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.currentChanges : [];
22415
+ const currentStepIndex = hasDebugTrace ? debuggerContext == null ? void 0 : debuggerContext.state.currentStepIndex : -1;
22416
+ const highlightedPaths = require$$0.useMemo(() => {
22417
+ if (!currentChanges || currentChanges.length === 0) return void 0;
22418
+ return currentChanges.map((change) => change.path);
22419
+ }, [currentChanges]);
22420
+ const isDraggingAny = isDragging || isVerticalDragging;
22421
+ return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(
22422
+ "div",
22423
+ {
22424
+ ref: containerRef,
22425
+ className: `df-visualizer-horizontal df-theme-${resolvedTheme} ${isDraggingAny ? "df-dragging" : ""}`,
22426
+ children: [
22427
+ /* @__PURE__ */ jsxRuntime.jsxs(
22428
+ "div",
22429
+ {
22430
+ ref: leftPanelRef,
22431
+ className: "df-visualizer-left",
22432
+ style: { width: leftPanelWidth },
22433
+ children: [
22434
+ /* @__PURE__ */ jsxRuntime.jsxs(
22435
+ "div",
22436
+ {
22437
+ className: `df-visualizer-left-tree ${displayMessage ? "df-with-result" : ""}`,
22438
+ style: displayMessage ? { height: `${treePanelHeight}%` } : void 0,
22439
+ children: [
22440
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-visualizer-left-header ${showDebugToolbar ? "df-header-with-debug" : ""}`, children: [
22441
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-left-title", children: "Explorer" }),
22442
+ showDebugToolbar && debugConfig && /* @__PURE__ */ jsxRuntime.jsx(
22443
+ IntegratedDebugToolbar,
22444
+ {
22445
+ workflows,
22446
+ payload: debugPayload ?? debugConfig.initialPayload,
22447
+ autoExecute: debugConfig.autoExecute,
22448
+ onExecutionComplete: debugConfig.onExecutionComplete,
22449
+ onExecutionError: debugConfig.onExecutionError
22450
+ }
22451
+ )
22452
+ ] }),
22453
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-left-content", children: workflows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-empty-state", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workflows to display" }) }) : /* @__PURE__ */ jsxRuntime.jsx(
22454
+ TreeView,
22455
+ {
22456
+ workflows,
22457
+ selection: selection2,
22458
+ onSelect: handleSelection,
22459
+ debugMode
22460
+ }
22461
+ ) })
22462
+ ]
22463
+ }
22464
+ ),
22465
+ displayMessage && /* @__PURE__ */ jsxRuntime.jsx(
22466
+ "div",
22467
+ {
22468
+ className: `df-visualizer-divider-horizontal ${isVerticalDragging ? "df-divider-active" : ""}`,
22469
+ onMouseDown: handleVerticalMouseDown
22470
+ }
22471
+ ),
22472
+ displayMessage && /* @__PURE__ */ jsxRuntime.jsxs(
22473
+ "div",
22474
+ {
22475
+ className: "df-visualizer-result-panel",
22476
+ style: { height: `${100 - treePanelHeight}%` },
22477
+ children: [
22478
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-result-header", children: [
22479
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-result-title", children: hasDebugTrace ? currentStepIndex !== void 0 && currentStepIndex >= 0 ? `Step ${currentStepIndex + 1}` : "Ready" : "Result" }),
22480
+ hasDebugTrace && currentChanges && currentChanges.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-visualizer-result-changes", children: [
22481
+ currentChanges.length,
22482
+ " change",
22483
+ currentChanges.length !== 1 ? "s" : ""
22484
+ ] })
22485
+ ] }),
22486
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-result-content", children: /* @__PURE__ */ jsxRuntime.jsx(
22487
+ JsonEditor,
22488
+ {
22489
+ value: JSON.stringify(displayMessage, null, 2),
22490
+ onChange: () => {
22491
+ },
22492
+ readOnly: true,
22493
+ theme: resolvedTheme === "dark" ? "dark" : "light",
22494
+ highlightedPaths
22495
+ }
22496
+ ) })
22497
+ ]
22498
+ }
22499
+ )
22500
+ ]
22501
+ }
22502
+ ),
22503
+ /* @__PURE__ */ jsxRuntime.jsx(
22504
+ "div",
22505
+ {
22506
+ className: `df-visualizer-divider ${isDragging ? "df-divider-active" : ""}`,
22507
+ onMouseDown: handleMouseDown
22508
+ }
22509
+ ),
22510
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-right", children: [
22511
+ selectionInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-details-header-info", children: [
22512
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
22513
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
22514
+ ] }) }),
22515
+ /* @__PURE__ */ jsxRuntime.jsx(DetailsPanel, { selection: selection2 })
22516
+ ] })
22517
+ ]
22518
+ }
22519
+ ) });
22265
22520
  }
22266
- function DebugStateBadge({
22267
- state,
22268
- conditionResult,
22269
- size = "sm"
22521
+ function WorkflowVisualizer({
22522
+ workflows,
22523
+ onWorkflowSelect,
22524
+ onTaskSelect,
22525
+ theme = "system",
22526
+ className = "",
22527
+ executionResult,
22528
+ debugMode = false,
22529
+ debugConfig,
22530
+ debugPayload
22270
22531
  }) {
22271
- const iconSize = size === "sm" ? 12 : 14;
22272
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `df-debug-badge df-debug-badge-${state} df-debug-badge-${size}`, children: [
22273
- /* @__PURE__ */ jsxRuntime.jsx(StateIcon, { state }),
22274
- conditionResult !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `df-debug-badge-condition ${conditionResult ? "df-debug-badge-condition-pass" : "df-debug-badge-condition-fail"}`, children: conditionResult ? /* @__PURE__ */ jsxRuntime.jsx(Check, { size: iconSize }) : /* @__PURE__ */ jsxRuntime.jsx(X, { size: iconSize }) })
22275
- ] });
22532
+ if (debugConfig == null ? void 0 : debugConfig.enabled) {
22533
+ const showControls = debugConfig.showControls !== false;
22534
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx(
22535
+ DebuggerProvider,
22536
+ {
22537
+ engineFactory: debugConfig.engineFactory,
22538
+ autoActivate: true,
22539
+ initialPayload: debugPayload ?? debugConfig.initialPayload,
22540
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-root ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
22541
+ VisualizerInner,
22542
+ {
22543
+ workflows,
22544
+ onTaskSelect,
22545
+ onWorkflowSelect,
22546
+ executionResult,
22547
+ debugMode: true,
22548
+ showDebugToolbar: showControls,
22549
+ debugConfig,
22550
+ debugPayload
22551
+ }
22552
+ ) })
22553
+ }
22554
+ ) });
22555
+ }
22556
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `df-root ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
22557
+ VisualizerInner,
22558
+ {
22559
+ workflows,
22560
+ onTaskSelect,
22561
+ onWorkflowSelect,
22562
+ executionResult,
22563
+ debugMode
22564
+ }
22565
+ ) }) });
22276
22566
  }
22277
22567
  class WasmEngine {
22278
22568
  __destroy_into_raw() {
@@ -22498,6 +22788,7 @@ exports.DebuggerControls = DebuggerControls;
22498
22788
  exports.DebuggerProvider = DebuggerProvider;
22499
22789
  exports.ErrorBoundary = ErrorBoundary;
22500
22790
  exports.FunctionTypeBadge = FunctionTypeBadge;
22791
+ exports.IntegratedDebugToolbar = IntegratedDebugToolbar;
22501
22792
  exports.JsonViewer = JsonViewer;
22502
22793
  exports.MessageInputPanel = MessageInputPanel;
22503
22794
  exports.MessageStatePanel = MessageStatePanel;