@base44/vite-plugin 0.2.24 → 0.2.26

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.
Files changed (38) hide show
  1. package/dist/injections/layer-dropdown/consts.d.ts +19 -0
  2. package/dist/injections/layer-dropdown/consts.d.ts.map +1 -0
  3. package/dist/injections/layer-dropdown/consts.js +40 -0
  4. package/dist/injections/layer-dropdown/consts.js.map +1 -0
  5. package/dist/injections/layer-dropdown/controller.d.ts +4 -0
  6. package/dist/injections/layer-dropdown/controller.d.ts.map +1 -0
  7. package/dist/injections/layer-dropdown/controller.js +88 -0
  8. package/dist/injections/layer-dropdown/controller.js.map +1 -0
  9. package/dist/injections/layer-dropdown/dropdown-ui.d.ts +13 -0
  10. package/dist/injections/layer-dropdown/dropdown-ui.d.ts.map +1 -0
  11. package/dist/injections/layer-dropdown/dropdown-ui.js +176 -0
  12. package/dist/injections/layer-dropdown/dropdown-ui.js.map +1 -0
  13. package/dist/injections/layer-dropdown/types.d.ts +26 -0
  14. package/dist/injections/layer-dropdown/types.d.ts.map +1 -0
  15. package/dist/injections/layer-dropdown/types.js +3 -0
  16. package/dist/injections/layer-dropdown/types.js.map +1 -0
  17. package/dist/injections/layer-dropdown/utils.d.ts +25 -0
  18. package/dist/injections/layer-dropdown/utils.d.ts.map +1 -0
  19. package/dist/injections/layer-dropdown/utils.js +143 -0
  20. package/dist/injections/layer-dropdown/utils.js.map +1 -0
  21. package/dist/injections/utils.d.ts +9 -0
  22. package/dist/injections/utils.d.ts.map +1 -1
  23. package/dist/injections/utils.js +33 -0
  24. package/dist/injections/utils.js.map +1 -1
  25. package/dist/injections/visual-edit-agent.d.ts.map +1 -1
  26. package/dist/injections/visual-edit-agent.js +115 -69
  27. package/dist/injections/visual-edit-agent.js.map +1 -1
  28. package/dist/statics/index.mjs +1 -1
  29. package/dist/statics/index.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/src/injections/layer-dropdown/LAYERS.md +258 -0
  32. package/src/injections/layer-dropdown/consts.ts +49 -0
  33. package/src/injections/layer-dropdown/controller.ts +109 -0
  34. package/src/injections/layer-dropdown/dropdown-ui.ts +230 -0
  35. package/src/injections/layer-dropdown/types.ts +30 -0
  36. package/src/injections/layer-dropdown/utils.ts +175 -0
  37. package/src/injections/utils.ts +44 -1
  38. package/src/injections/visual-edit-agent.ts +141 -80
@@ -0,0 +1,19 @@
1
+ /** Style constants for the layer dropdown UI */
2
+ export declare const DROPDOWN_CONTAINER_STYLES: Record<string, string>;
3
+ export declare const DROPDOWN_ITEM_BASE_STYLES: Record<string, string>;
4
+ export declare const DROPDOWN_ITEM_ACTIVE_COLOR = "#526cff";
5
+ export declare const DROPDOWN_ITEM_ACTIVE_BG = "#DBEAFE";
6
+ export declare const DROPDOWN_ITEM_ACTIVE_FONT_WEIGHT = "600";
7
+ export declare const DROPDOWN_ITEM_HOVER_BG = "#f1f5f9";
8
+ export declare const DEPTH_INDENT_PX = 10;
9
+ /** Chevron shown when dropdown is collapsed (click to expand) */
10
+ export declare const CHEVRON_COLLAPSED = " \u25BE";
11
+ /** Chevron shown when dropdown is expanded (click to collapse) */
12
+ export declare const CHEVRON_EXPANDED = " \u25B4";
13
+ export declare const BASE_PADDING_PX = 12;
14
+ export declare const LAYER_DROPDOWN_ATTR = "data-layer-dropdown";
15
+ /** Max instrumented ancestors to show above the selected element */
16
+ export declare const MAX_PARENT_DEPTH = 2;
17
+ /** Max instrumented depth levels to show below the selected element */
18
+ export declare const MAX_CHILD_DEPTH = 2;
19
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/consts.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQ5D,CAAC;AAEF,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,gCAAgC,QAAQ,CAAC;AAEtD,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,uEAAuE;AACvE,eAAO,MAAM,eAAe,IAAI,CAAC"}
@@ -0,0 +1,40 @@
1
+ /** Style constants for the layer dropdown UI */
2
+ export const DROPDOWN_CONTAINER_STYLES = {
3
+ position: "absolute",
4
+ backgroundColor: "#ffffff",
5
+ border: "1px solid #e2e8f0",
6
+ borderRadius: "6px",
7
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
8
+ fontSize: "12px",
9
+ minWidth: "120px",
10
+ maxHeight: "200px",
11
+ overflowY: "auto",
12
+ zIndex: "10001",
13
+ padding: "4px 0",
14
+ pointerEvents: "auto",
15
+ };
16
+ export const DROPDOWN_ITEM_BASE_STYLES = {
17
+ padding: "4px 12px",
18
+ cursor: "pointer",
19
+ color: "#334155",
20
+ backgroundColor: "transparent",
21
+ whiteSpace: "nowrap",
22
+ lineHeight: "1.5",
23
+ fontWeight: "400",
24
+ };
25
+ export const DROPDOWN_ITEM_ACTIVE_COLOR = "#526cff";
26
+ export const DROPDOWN_ITEM_ACTIVE_BG = "#DBEAFE";
27
+ export const DROPDOWN_ITEM_ACTIVE_FONT_WEIGHT = "600";
28
+ export const DROPDOWN_ITEM_HOVER_BG = "#f1f5f9";
29
+ export const DEPTH_INDENT_PX = 10;
30
+ /** Chevron shown when dropdown is collapsed (click to expand) */
31
+ export const CHEVRON_COLLAPSED = " \u25BE";
32
+ /** Chevron shown when dropdown is expanded (click to collapse) */
33
+ export const CHEVRON_EXPANDED = " \u25B4";
34
+ export const BASE_PADDING_PX = 12;
35
+ export const LAYER_DROPDOWN_ATTR = "data-layer-dropdown";
36
+ /** Max instrumented ancestors to show above the selected element */
37
+ export const MAX_PARENT_DEPTH = 2;
38
+ /** Max instrumented depth levels to show below the selected element */
39
+ export const MAX_CHILD_DEPTH = 2;
40
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/consts.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAC/D,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,mBAAmB;IAC3B,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE,gCAAgC;IAC3C,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,OAAO;IAChB,aAAa,EAAE,MAAM;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA2B;IAC/D,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,aAAa;IAC9B,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAC;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AACjD,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,iEAAiE;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC3C,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,oEAAoE;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Controller that encapsulates layer-dropdown integration logic */
2
+ import type { LayerControllerConfig, LayerController } from "./types.js";
3
+ export declare function createLayerController(config: LayerControllerConfig): LayerController;
4
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/controller.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAUpE,OAAO,KAAK,EAAa,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAgGpF"}
@@ -0,0 +1,88 @@
1
+ /** Controller that encapsulates layer-dropdown integration logic */
2
+ import { getElementSelectorId } from "../utils.js";
3
+ import { buildLayerChain } from "./utils.js";
4
+ import { enhanceLabelWithChevron, showDropdown, closeDropdown, isDropdownOpen, } from "./dropdown-ui.js";
5
+ export function createLayerController(config) {
6
+ let layerPreviewOverlay = null;
7
+ let escapeHandler = null;
8
+ let dropdownSourceLayer = null;
9
+ const clearLayerPreview = () => {
10
+ if (layerPreviewOverlay && layerPreviewOverlay.parentNode) {
11
+ layerPreviewOverlay.remove();
12
+ }
13
+ layerPreviewOverlay = null;
14
+ };
15
+ const showLayerPreview = (layer) => {
16
+ clearLayerPreview();
17
+ if (getElementSelectorId(layer.element) === config.getSelectedElementId())
18
+ return;
19
+ layerPreviewOverlay = config.createPreviewOverlay(layer.element);
20
+ };
21
+ const selectLayer = (layer) => {
22
+ clearLayerPreview();
23
+ closeDropdown();
24
+ if (escapeHandler) {
25
+ document.removeEventListener("keydown", escapeHandler, true);
26
+ escapeHandler = null;
27
+ }
28
+ dropdownSourceLayer = null;
29
+ const firstOverlay = config.selectElement(layer.element);
30
+ attachToOverlay(firstOverlay, layer.element);
31
+ };
32
+ const restoreSelection = () => {
33
+ if (escapeHandler) {
34
+ document.removeEventListener("keydown", escapeHandler, true);
35
+ escapeHandler = null;
36
+ }
37
+ if (dropdownSourceLayer) {
38
+ selectLayer(dropdownSourceLayer);
39
+ dropdownSourceLayer = null;
40
+ }
41
+ };
42
+ const handleLabelClick = (e, label, element, layers, currentId) => {
43
+ e.stopPropagation();
44
+ e.preventDefault();
45
+ if (isDropdownOpen()) {
46
+ closeDropdown();
47
+ restoreSelection();
48
+ }
49
+ else {
50
+ dropdownSourceLayer = {
51
+ element,
52
+ tagName: element.tagName.toLowerCase(),
53
+ selectorId: currentId,
54
+ };
55
+ config.onDeselect();
56
+ escapeHandler = (ev) => {
57
+ if (ev.key === "Escape") {
58
+ ev.stopPropagation();
59
+ closeDropdown();
60
+ restoreSelection();
61
+ }
62
+ };
63
+ document.addEventListener("keydown", escapeHandler, true);
64
+ showDropdown(label, layers, element, { onSelect: selectLayer, onHover: showLayerPreview, onHoverEnd: clearLayerPreview });
65
+ }
66
+ };
67
+ const attachToOverlay = (overlay, element) => {
68
+ if (!overlay)
69
+ return;
70
+ const label = overlay.querySelector("div");
71
+ if (!label)
72
+ return;
73
+ const layers = buildLayerChain(element);
74
+ if (layers.length <= 1)
75
+ return;
76
+ const currentId = getElementSelectorId(element);
77
+ enhanceLabelWithChevron(label);
78
+ label.addEventListener("click", (e) => {
79
+ handleLabelClick(e, label, element, layers, currentId);
80
+ });
81
+ };
82
+ const cleanup = () => {
83
+ clearLayerPreview();
84
+ closeDropdown();
85
+ };
86
+ return { attachToOverlay, cleanup };
87
+ }
88
+ //# sourceMappingURL=controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/controller.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,MAAM,UAAU,qBAAqB,CAAC,MAA6B;IACjE,IAAI,mBAAmB,GAA0B,IAAI,CAAC;IACtD,IAAI,aAAa,GAAwC,IAAI,CAAC;IAC9D,IAAI,mBAAmB,GAAqB,IAAI,CAAC;IAEjD,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,UAAU,EAAE,CAAC;YAC1D,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QACD,mBAAmB,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAC,KAAgB,EAAE,EAAE;QAC5C,iBAAiB,EAAE,CAAC;QACpB,IAAI,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,oBAAoB,EAAE;YAAE,OAAO;QAElF,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,KAAgB,EAAE,EAAE;QACvC,iBAAiB,EAAE,CAAC;QACpB,aAAa,EAAE,CAAC;QAChB,IAAI,aAAa,EAAE,CAAC;YAClB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI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C;YACF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;YAE1D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC;QAC5H,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,CACtB,OAAmC,EACnC,OAAgB,EAChB,EAAE;QACF,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAA0B,CAAC;QACpE,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO;QAE/B,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAE/B,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE;YAChD,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,iBAAiB,EAAE,CAAC;QACpB,aAAa,EAAE,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Dropdown UI component for layer navigation */
2
+ import type { LayerInfo, DropdownCallbacks } from "./types.js";
3
+ /** Create the dropdown DOM element with layer items */
4
+ export declare function createDropdownElement(layers: LayerInfo[], currentElement: Element | null, callbacks: DropdownCallbacks): HTMLDivElement;
5
+ /** Add chevron indicator and pointer-events to the label */
6
+ export declare function enhanceLabelWithChevron(label: HTMLDivElement): void;
7
+ /** Show the dropdown below the label element */
8
+ export declare function showDropdown(label: HTMLDivElement, layers: LayerInfo[], currentElement: Element | null, callbacks: DropdownCallbacks): void;
9
+ /** Close the active dropdown and clean up listeners */
10
+ export declare function closeDropdown(): void;
11
+ /** Check if a dropdown is currently visible */
12
+ export declare function isDropdownOpen(): boolean;
13
+ //# sourceMappingURL=dropdown-ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-ui.d.ts","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/dropdown-ui.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAgBjD,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA+C/D,uDAAuD;AACvD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EAAE,EACnB,cAAc,EAAE,OAAO,GAAG,IAAI,EAC9B,SAAS,EAAE,iBAAiB,GAC3B,cAAc,CAWhB;AAED,4DAA4D;AAC5D,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAUnE;AAkED,gDAAgD;AAChD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,SAAS,EAAE,EACnB,cAAc,EAAE,OAAO,GAAG,IAAI,EAC9B,SAAS,EAAE,iBAAiB,GAC3B,IAAI,CAgCN;AAED,uDAAuD;AACvD,wBAAgB,aAAa,IAAI,IAAI,CAyBpC;AAED,+CAA+C;AAC/C,wBAAgB,cAAc,IAAI,OAAO,CAExC"}
@@ -0,0 +1,176 @@
1
+ /** Dropdown UI component for layer navigation */
2
+ import { DROPDOWN_CONTAINER_STYLES, DROPDOWN_ITEM_BASE_STYLES, DROPDOWN_ITEM_ACTIVE_COLOR, DROPDOWN_ITEM_ACTIVE_BG, DROPDOWN_ITEM_ACTIVE_FONT_WEIGHT, DROPDOWN_ITEM_HOVER_BG, DEPTH_INDENT_PX, BASE_PADDING_PX, CHEVRON_COLLAPSED, CHEVRON_EXPANDED, LAYER_DROPDOWN_ATTR, } from "./consts.js";
3
+ import { applyStyles, getLayerDisplayName } from "./utils.js";
4
+ let activeDropdown = null;
5
+ let activeLabel = null;
6
+ let outsideMousedownHandler = null;
7
+ let activeOnHoverEnd = null;
8
+ let activeKeydownHandler = null;
9
+ function createDropdownItem(layer, isActive, { onSelect, onHover, onHoverEnd }) {
10
+ const item = document.createElement("div");
11
+ item.textContent = getLayerDisplayName(layer);
12
+ applyStyles(item, DROPDOWN_ITEM_BASE_STYLES);
13
+ const depth = layer.depth ?? 0;
14
+ if (depth > 0) {
15
+ item.style.paddingLeft = `${BASE_PADDING_PX + depth * DEPTH_INDENT_PX}px`;
16
+ }
17
+ if (isActive) {
18
+ item.style.color = DROPDOWN_ITEM_ACTIVE_COLOR;
19
+ item.style.backgroundColor = DROPDOWN_ITEM_ACTIVE_BG;
20
+ item.style.fontWeight = DROPDOWN_ITEM_ACTIVE_FONT_WEIGHT;
21
+ }
22
+ item.addEventListener("mouseenter", () => {
23
+ if (!isActive)
24
+ item.style.backgroundColor = DROPDOWN_ITEM_HOVER_BG;
25
+ if (onHover)
26
+ onHover(layer);
27
+ });
28
+ item.addEventListener("mouseleave", () => {
29
+ if (!isActive)
30
+ item.style.backgroundColor = "transparent";
31
+ if (onHoverEnd)
32
+ onHoverEnd();
33
+ });
34
+ item.addEventListener("click", (e) => {
35
+ e.stopPropagation();
36
+ e.preventDefault();
37
+ onSelect(layer);
38
+ });
39
+ return item;
40
+ }
41
+ /** Create the dropdown DOM element with layer items */
42
+ export function createDropdownElement(layers, currentElement, callbacks) {
43
+ const container = document.createElement("div");
44
+ container.setAttribute(LAYER_DROPDOWN_ATTR, "true");
45
+ applyStyles(container, DROPDOWN_CONTAINER_STYLES);
46
+ layers.forEach((layer) => {
47
+ const isActive = layer.element === currentElement;
48
+ container.appendChild(createDropdownItem(layer, isActive, callbacks));
49
+ });
50
+ return container;
51
+ }
52
+ /** Add chevron indicator and pointer-events to the label */
53
+ export function enhanceLabelWithChevron(label) {
54
+ const t = label.textContent ?? "";
55
+ if (t.endsWith(CHEVRON_COLLAPSED) || t.endsWith(CHEVRON_EXPANDED))
56
+ return;
57
+ label.textContent = t + CHEVRON_COLLAPSED;
58
+ label.style.cursor = "pointer";
59
+ label.style.userSelect = "none";
60
+ label.style.whiteSpace = "nowrap";
61
+ label.style.pointerEvents = "auto";
62
+ label.setAttribute(LAYER_DROPDOWN_ATTR, "true");
63
+ }
64
+ function setupKeyboardNavigation(dropdown, layers, currentElement, { onSelect, onHover, onHoverEnd }) {
65
+ const items = Array.from(dropdown.children);
66
+ let focusedIndex = layers.findIndex((l) => l.element === currentElement);
67
+ const setFocusedItem = (index) => {
68
+ if (focusedIndex >= 0 && focusedIndex < items.length) {
69
+ const prev = items[focusedIndex];
70
+ if (prev.style.color !== DROPDOWN_ITEM_ACTIVE_COLOR) {
71
+ prev.style.backgroundColor = "transparent";
72
+ }
73
+ }
74
+ focusedIndex = index;
75
+ if (focusedIndex >= 0 && focusedIndex < items.length) {
76
+ const cur = items[focusedIndex];
77
+ if (cur.style.color !== DROPDOWN_ITEM_ACTIVE_COLOR) {
78
+ cur.style.backgroundColor = DROPDOWN_ITEM_HOVER_BG;
79
+ }
80
+ cur.scrollIntoView({ block: "nearest" });
81
+ if (onHover && focusedIndex >= 0 && focusedIndex < layers.length) {
82
+ onHover(layers[focusedIndex]);
83
+ }
84
+ }
85
+ };
86
+ activeKeydownHandler = (e) => {
87
+ if (e.key === "ArrowDown") {
88
+ e.preventDefault();
89
+ e.stopPropagation();
90
+ setFocusedItem(focusedIndex < items.length - 1 ? focusedIndex + 1 : 0);
91
+ }
92
+ else if (e.key === "ArrowUp") {
93
+ e.preventDefault();
94
+ e.stopPropagation();
95
+ setFocusedItem(focusedIndex > 0 ? focusedIndex - 1 : items.length - 1);
96
+ }
97
+ else if (e.key === "Enter" && focusedIndex >= 0 && focusedIndex < layers.length) {
98
+ e.preventDefault();
99
+ e.stopPropagation();
100
+ if (onHoverEnd)
101
+ onHoverEnd();
102
+ onSelect(layers[focusedIndex]);
103
+ closeDropdown();
104
+ }
105
+ };
106
+ document.addEventListener("keydown", activeKeydownHandler, true);
107
+ }
108
+ function setupOutsideClickHandler(dropdown, label) {
109
+ let skipFirst = true;
110
+ outsideMousedownHandler = (e) => {
111
+ if (skipFirst) {
112
+ skipFirst = false;
113
+ return;
114
+ }
115
+ const target = e.target;
116
+ if (!dropdown.contains(target) && target !== label) {
117
+ closeDropdown();
118
+ }
119
+ };
120
+ document.addEventListener("mousedown", outsideMousedownHandler, true);
121
+ }
122
+ /** Show the dropdown below the label element */
123
+ export function showDropdown(label, layers, currentElement, callbacks) {
124
+ closeDropdown();
125
+ const dropdown = createDropdownElement(layers, currentElement, {
126
+ ...callbacks,
127
+ onSelect: (layer) => {
128
+ if (callbacks.onHoverEnd)
129
+ callbacks.onHoverEnd();
130
+ callbacks.onSelect(layer);
131
+ closeDropdown();
132
+ },
133
+ });
134
+ const overlay = label.parentElement;
135
+ if (!overlay)
136
+ return;
137
+ dropdown.style.top = `${label.offsetTop + label.offsetHeight + 2}px`;
138
+ dropdown.style.left = `${label.offsetLeft}px`;
139
+ overlay.appendChild(dropdown);
140
+ activeDropdown = dropdown;
141
+ activeLabel = label;
142
+ if (label.textContent?.endsWith(CHEVRON_COLLAPSED.trim())) {
143
+ label.textContent = label.textContent.slice(0, -CHEVRON_COLLAPSED.length) + CHEVRON_EXPANDED;
144
+ }
145
+ activeOnHoverEnd = callbacks.onHoverEnd ?? null;
146
+ setupKeyboardNavigation(dropdown, layers, currentElement, callbacks);
147
+ setupOutsideClickHandler(dropdown, label);
148
+ }
149
+ /** Close the active dropdown and clean up listeners */
150
+ export function closeDropdown() {
151
+ if (activeLabel?.textContent?.includes(CHEVRON_EXPANDED)) {
152
+ activeLabel.textContent = activeLabel.textContent.replace(CHEVRON_EXPANDED, CHEVRON_COLLAPSED);
153
+ }
154
+ activeLabel = null;
155
+ if (activeOnHoverEnd) {
156
+ activeOnHoverEnd();
157
+ activeOnHoverEnd = null;
158
+ }
159
+ if (activeDropdown && activeDropdown.parentNode) {
160
+ activeDropdown.remove();
161
+ }
162
+ activeDropdown = null;
163
+ if (outsideMousedownHandler) {
164
+ document.removeEventListener("mousedown", outsideMousedownHandler, true);
165
+ outsideMousedownHandler = null;
166
+ }
167
+ if (activeKeydownHandler) {
168
+ document.removeEventListener("keydown", activeKeydownHandler, true);
169
+ activeKeydownHandler = null;
170
+ }
171
+ }
172
+ /** Check if a dropdown is currently visible */
173
+ export function isDropdownOpen() {
174
+ return activeDropdown !== null;
175
+ }
176
+ //# sourceMappingURL=dropdown-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-ui.js","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/dropdown-ui.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAG9D,IAAI,cAAc,GAA0B,IAAI,CAAC;AACjD,IAAI,WAAW,GAA0B,IAAI,CAAC;AAC9C,IAAI,uBAAuB,GAAqC,IAAI,CAAC;AACrE,IAAI,gBAAgB,GAAwB,IAAI,CAAC;AACjD,IAAI,oBAAoB,GAAwC,IAAI,CAAC;AAErE,SAAS,kBAAkB,CACzB,KAAgB,EAChB,QAAiB,EACjB,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAqB;IAEpD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,WAAW,GAAG,mBAAmB,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E,wBAAwB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,aAAa;IAC3B,IAAI,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACjG,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,IAAI,gBAAgB,EAAE,CAAC;QACrB,gBAAgB,EAAE,CAAC;QACnB,gBAAgB,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,cAAc,IAAI,cAAc,CAAC,UAAU,EAAE,CAAC;QAChD,cAAc,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;IACD,cAAc,GAAG,IAAI,CAAC;IAEtB,IAAI,uBAAuB,EAAE,CAAC;QAC5B,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,uBAAuB,EAAE,IAAI,CAAC,CAAC;QACzE,uBAAuB,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,IAAI,oBAAoB,EAAE,CAAC;QACzB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;QACpE,oBAAoB,GAAG,IAAI,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,KAAK,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** Shared types for the layer-dropdown module */
2
+ export interface LayerInfo {
3
+ element: Element;
4
+ tagName: string;
5
+ selectorId: string | null;
6
+ depth?: number;
7
+ }
8
+ export type OnLayerSelect = (layer: LayerInfo) => void;
9
+ export type OnLayerHover = (layer: LayerInfo) => void;
10
+ export type OnLayerHoverEnd = () => void;
11
+ export interface DropdownCallbacks {
12
+ onSelect: OnLayerSelect;
13
+ onHover?: OnLayerHover;
14
+ onHoverEnd?: OnLayerHoverEnd;
15
+ }
16
+ export interface LayerControllerConfig {
17
+ createPreviewOverlay: (element: Element) => HTMLDivElement;
18
+ getSelectedElementId: () => string | null;
19
+ selectElement: (element: Element) => HTMLDivElement | undefined;
20
+ onDeselect: () => void;
21
+ }
22
+ export interface LayerController {
23
+ attachToOverlay: (overlay: HTMLDivElement | undefined, element: Element) => void;
24
+ cleanup: () => void;
25
+ }
26
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,cAAc,CAAC;IAC3D,oBAAoB,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,cAAc,GAAG,SAAS,CAAC;IAChE,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ /** Shared types for the layer-dropdown module */
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/types.ts"],"names":[],"mappings":"AAAA,iDAAiD"}
@@ -0,0 +1,25 @@
1
+ /** DOM utilities for the layer-dropdown module */
2
+ import type { LayerInfo } from "./types.js";
3
+ /** Apply a style map to an element */
4
+ export declare function applyStyles(element: HTMLElement, styles: Record<string, string>): void;
5
+ /** Display name for a layer — just the real tag name */
6
+ export declare function getLayerDisplayName(layer: LayerInfo): string;
7
+ /**
8
+ * Collect instrumented descendants up to `maxDepth` instrumented nesting levels.
9
+ * Non-instrumented wrappers are walked through without counting toward depth.
10
+ * Results are in DOM order.
11
+ * When `startDepth` is provided, assigns `depth` to each item during collection.
12
+ */
13
+ export declare function getInstrumentedDescendants(parent: Element, maxDepth: number, startDepth?: number): LayerInfo[];
14
+ /**
15
+ * Build the layer chain for the dropdown:
16
+ *
17
+ * Parents – up to MAX_PARENT_DEPTH instrumented ancestors, outer → inner.
18
+ * Siblings – instrumented children of the immediate parent, at the same depth.
19
+ * Current – the selected element (highlighted), with children expanded.
20
+ * Children – instrumented descendants within MAX_CHILD_DEPTH levels, DOM order.
21
+ *
22
+ * Each item carries a `depth` for visual indentation.
23
+ */
24
+ export declare function buildLayerChain(selectedElement: Element): LayerInfo[];
25
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/utils.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAKlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAOtF;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAE5D;AAYD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,SAAS,EAAE,CA0Bb;AAkFD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,EAAE,CAcrE"}
@@ -0,0 +1,143 @@
1
+ /** DOM utilities for the layer-dropdown module */
2
+ import { isInstrumentedElement, getElementSelectorId } from "../utils.js";
3
+ import { MAX_PARENT_DEPTH, MAX_CHILD_DEPTH } from "./consts.js";
4
+ /** Apply a style map to an element */
5
+ export function applyStyles(element, styles) {
6
+ for (const key of Object.keys(styles)) {
7
+ element.style.setProperty(key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`), styles[key]);
8
+ }
9
+ }
10
+ /** Display name for a layer — just the real tag name */
11
+ export function getLayerDisplayName(layer) {
12
+ return layer.tagName;
13
+ }
14
+ function toLayerInfo(element, depth) {
15
+ const info = {
16
+ element,
17
+ tagName: element.tagName.toLowerCase(),
18
+ selectorId: getElementSelectorId(element),
19
+ };
20
+ if (depth !== undefined)
21
+ info.depth = depth;
22
+ return info;
23
+ }
24
+ /**
25
+ * Collect instrumented descendants up to `maxDepth` instrumented nesting levels.
26
+ * Non-instrumented wrappers are walked through without counting toward depth.
27
+ * Results are in DOM order.
28
+ * When `startDepth` is provided, assigns `depth` to each item during collection.
29
+ */
30
+ export function getInstrumentedDescendants(parent, maxDepth, startDepth) {
31
+ const result = [];
32
+ function walk(el, instrDepth) {
33
+ if (instrDepth > maxDepth)
34
+ return;
35
+ for (let i = 0; i < el.children.length; i++) {
36
+ const child = el.children[i];
37
+ if (isInstrumentedElement(child)) {
38
+ const info = {
39
+ element: child,
40
+ tagName: child.tagName.toLowerCase(),
41
+ selectorId: getElementSelectorId(child),
42
+ };
43
+ if (startDepth !== undefined) {
44
+ info.depth = startDepth + instrDepth - 1;
45
+ }
46
+ result.push(info);
47
+ walk(child, instrDepth + 1);
48
+ }
49
+ else {
50
+ walk(child, instrDepth);
51
+ }
52
+ }
53
+ }
54
+ walk(parent, 1);
55
+ return result;
56
+ }
57
+ /** Collect instrumented ancestors from selected element up to MAX_PARENT_DEPTH (outermost first). */
58
+ function collectInstrumentedParents(selectedElement) {
59
+ const parents = [];
60
+ let current = selectedElement.parentElement;
61
+ while (current &&
62
+ current !== document.documentElement &&
63
+ current !== document.body &&
64
+ parents.length < MAX_PARENT_DEPTH) {
65
+ if (isInstrumentedElement(current)) {
66
+ parents.push(toLayerInfo(current));
67
+ }
68
+ current = current.parentElement;
69
+ }
70
+ parents.reverse();
71
+ return parents;
72
+ }
73
+ /** Add parents to chain with depth 0, 1, …; returns depth of selected (parents.length). */
74
+ function addParentsToChain(chain, parents) {
75
+ parents.forEach((p, i) => {
76
+ chain.push({ ...p, depth: i });
77
+ });
78
+ return parents.length;
79
+ }
80
+ /** Add selected element and its descendants at the given depth. */
81
+ function addSelfAndDescendantsToChain(chain, selectedElement, selfDepth) {
82
+ chain.push(toLayerInfo(selectedElement, selfDepth));
83
+ const descendants = getInstrumentedDescendants(selectedElement, MAX_CHILD_DEPTH, selfDepth + 1);
84
+ chain.push(...descendants);
85
+ }
86
+ /** Get the innermost instrumented parent's DOM element, or null if none. */
87
+ function getImmediateInstrParent(parents) {
88
+ return parents.at(-1)?.element ?? null;
89
+ }
90
+ /** Collect instrumented siblings of the selected element from its parent (DOM order). */
91
+ function collectSiblings(parent, selectedElement) {
92
+ const siblings = getInstrumentedDescendants(parent, 1);
93
+ if (!siblings.some((s) => s.element === selectedElement)) {
94
+ siblings.push(toLayerInfo(selectedElement));
95
+ }
96
+ return siblings;
97
+ }
98
+ /** Add siblings at selfDepth, expanding children only for the selected element. */
99
+ function appendSiblingsWithSelected(chain, siblings, selectedElement, selfDepth) {
100
+ const selectedSelectorId = getElementSelectorId(selectedElement);
101
+ const seen = new Set();
102
+ for (const sibling of siblings) {
103
+ if (sibling.element === selectedElement) {
104
+ addSelfAndDescendantsToChain(chain, selectedElement, selfDepth);
105
+ if (selectedSelectorId)
106
+ seen.add(selectedSelectorId);
107
+ }
108
+ else {
109
+ const id = sibling.selectorId;
110
+ if (id != null) {
111
+ if (id === selectedSelectorId || seen.has(id))
112
+ continue;
113
+ seen.add(id);
114
+ }
115
+ chain.push({ ...sibling, depth: selfDepth });
116
+ }
117
+ }
118
+ }
119
+ /**
120
+ * Build the layer chain for the dropdown:
121
+ *
122
+ * Parents – up to MAX_PARENT_DEPTH instrumented ancestors, outer → inner.
123
+ * Siblings – instrumented children of the immediate parent, at the same depth.
124
+ * Current – the selected element (highlighted), with children expanded.
125
+ * Children – instrumented descendants within MAX_CHILD_DEPTH levels, DOM order.
126
+ *
127
+ * Each item carries a `depth` for visual indentation.
128
+ */
129
+ export function buildLayerChain(selectedElement) {
130
+ const parents = collectInstrumentedParents(selectedElement);
131
+ const chain = [];
132
+ const selfDepth = addParentsToChain(chain, parents);
133
+ const instrParent = getImmediateInstrParent(parents);
134
+ if (instrParent) {
135
+ const siblings = collectSiblings(instrParent, selectedElement);
136
+ appendSiblingsWithSelected(chain, siblings, selectedElement, selfDepth);
137
+ }
138
+ else {
139
+ addSelfAndDescendantsToChain(chain, selectedElement, selfDepth);
140
+ }
141
+ return chain;
142
+ }
143
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/injections/layer-dropdown/utils.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAElD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,gBAAg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InstrumentedElement(element: Element): boolean;
3
+ /** Get the selector ID from an element's data attributes (prefers source-location) */
4
+ export declare function getElementSelectorId(element: Element): string | null;
5
+ export declare const ALLOWED_ATTRIBUTES: string[];
1
6
  /** Find elements by ID - first try data-source-location, fallback to data-visual-selector-id */
2
7
  export declare function findElementsById(id: string | null): Element[];
3
8
  /**
@@ -5,4 +10,8 @@ export declare function findElementsById(id: string | null): Element[];
5
10
  * Uses setAttribute instead of className to support both HTML and SVG elements.
6
11
  */
7
12
  export declare function updateElementClasses(elements: Element[], classes: string): void;
13
+ /** Set a single attribute on all provided elements. */
14
+ export declare function updateElementAttribute(elements: Element[], attribute: string, value: string): void;
15
+ /** Collect attribute values from an element for a given allowlist. */
16
+ export declare function collectAllowedAttributes(element: Element, allowedAttributes: string[]): Record<string, string>;
8
17
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/injections/utils.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/E"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/injections/utils.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAK/D;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAAY,CAAC;AAEpD,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/E;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAQlG;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAS9G"}