@toolbox-web/grid 1.23.2 → 1.23.3

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 (69) hide show
  1. package/README.md +2 -2
  2. package/all.js +2 -2
  3. package/all.js.map +1 -1
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/types.d.ts +1 -1
  7. package/lib/plugins/clipboard/index.js.map +1 -1
  8. package/lib/plugins/column-virtualization/index.js.map +1 -1
  9. package/lib/plugins/context-menu/index.js.map +1 -1
  10. package/lib/plugins/editing/EditingPlugin.d.ts +19 -122
  11. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  12. package/lib/plugins/editing/editors.d.ts +4 -2
  13. package/lib/plugins/editing/editors.d.ts.map +1 -1
  14. package/lib/plugins/editing/index.d.ts +1 -1
  15. package/lib/plugins/editing/index.d.ts.map +1 -1
  16. package/lib/plugins/editing/index.js +1 -1
  17. package/lib/plugins/editing/index.js.map +1 -1
  18. package/lib/plugins/editing/internal/cell-validation.d.ts +80 -0
  19. package/lib/plugins/editing/internal/cell-validation.d.ts.map +1 -0
  20. package/lib/plugins/editing/internal/dirty-tracking-manager.d.ts +77 -0
  21. package/lib/plugins/editing/internal/dirty-tracking-manager.d.ts.map +1 -0
  22. package/lib/plugins/editing/internal/editor-injection.d.ts +33 -0
  23. package/lib/plugins/editing/internal/editor-injection.d.ts.map +1 -0
  24. package/lib/plugins/editing/internal/helpers.d.ts +55 -0
  25. package/lib/plugins/editing/internal/helpers.d.ts.map +1 -0
  26. package/lib/plugins/export/index.js.map +1 -1
  27. package/lib/plugins/filtering/FilteringPlugin.d.ts +0 -20
  28. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  29. package/lib/plugins/filtering/filter-panel-date.d.ts +14 -0
  30. package/lib/plugins/filtering/filter-panel-date.d.ts.map +1 -0
  31. package/lib/plugins/filtering/filter-panel-default.d.ts +23 -0
  32. package/lib/plugins/filtering/filter-panel-default.d.ts.map +1 -0
  33. package/lib/plugins/filtering/filter-panel-number.d.ts +14 -0
  34. package/lib/plugins/filtering/filter-panel-number.d.ts.map +1 -0
  35. package/lib/plugins/filtering/index.js +1 -1
  36. package/lib/plugins/filtering/index.js.map +1 -1
  37. package/lib/plugins/grouping-columns/GroupingColumnsPlugin.d.ts.map +1 -1
  38. package/lib/plugins/grouping-columns/grouping-columns.d.ts +7 -0
  39. package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
  40. package/lib/plugins/grouping-columns/index.js +1 -1
  41. package/lib/plugins/grouping-columns/index.js.map +1 -1
  42. package/lib/plugins/grouping-rows/index.js.map +1 -1
  43. package/lib/plugins/master-detail/index.js.map +1 -1
  44. package/lib/plugins/multi-sort/index.js.map +1 -1
  45. package/lib/plugins/pinned-columns/index.js.map +1 -1
  46. package/lib/plugins/pinned-rows/index.js.map +1 -1
  47. package/lib/plugins/pivot/index.js.map +1 -1
  48. package/lib/plugins/print/index.js.map +1 -1
  49. package/lib/plugins/reorder/index.js.map +1 -1
  50. package/lib/plugins/responsive/index.js +1 -1
  51. package/lib/plugins/responsive/index.js.map +1 -1
  52. package/lib/plugins/row-reorder/index.js.map +1 -1
  53. package/lib/plugins/selection/index.js.map +1 -1
  54. package/lib/plugins/server-side/index.js.map +1 -1
  55. package/lib/plugins/tree/index.js.map +1 -1
  56. package/lib/plugins/undo-redo/index.js.map +1 -1
  57. package/lib/plugins/visibility/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/umd/grid.all.umd.js +1 -1
  60. package/umd/grid.all.umd.js.map +1 -1
  61. package/umd/grid.umd.js.map +1 -1
  62. package/umd/plugins/editing.umd.js +1 -1
  63. package/umd/plugins/editing.umd.js.map +1 -1
  64. package/umd/plugins/filtering.umd.js +1 -1
  65. package/umd/plugins/filtering.umd.js.map +1 -1
  66. package/umd/plugins/grouping-columns.umd.js +1 -1
  67. package/umd/plugins/grouping-columns.umd.js.map +1 -1
  68. package/umd/plugins/responsive.umd.js +1 -1
  69. package/umd/plugins/responsive.umd.js.map +1 -1
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Cell Validation Manager
3
+ *
4
+ * Manages invalid-cell state for the Editing Plugin.
5
+ * Extracted from EditingPlugin to reduce the main plugin file size.
6
+ *
7
+ * The manager owns the `Map<rowId, Map<field, message>>` state and exposes
8
+ * read/write methods. DOM synchronization is handled via an injected callback.
9
+ *
10
+ * @internal
11
+ */
12
+ /** Callback to sync the data-invalid attribute on a cell element in the DOM. */
13
+ export type SyncInvalidAttributeFn = (rowId: string, field: string, invalid: boolean) => void;
14
+ /**
15
+ * Manages validation state for grid cells.
16
+ *
17
+ * Tracks which cells are marked invalid and their validation messages.
18
+ * The DOM side-effect (adding/removing `data-invalid` attribute) is delegated
19
+ * to the `syncAttribute` callback provided at construction time.
20
+ */
21
+ export declare class CellValidationManager {
22
+ #private;
23
+ constructor(syncAttribute: SyncInvalidAttributeFn);
24
+ /**
25
+ * Mark a cell as invalid with an optional validation message.
26
+ *
27
+ * @param rowId - The row ID (from getRowId)
28
+ * @param field - The field name
29
+ * @param message - Optional validation message (for tooltips or display)
30
+ */
31
+ setInvalid(rowId: string, field: string, message?: string): void;
32
+ /**
33
+ * Clear the invalid state for a specific cell.
34
+ *
35
+ * @param rowId - The row ID (from getRowId)
36
+ * @param field - The field name
37
+ */
38
+ clearInvalid(rowId: string, field: string): void;
39
+ /**
40
+ * Clear all invalid cells for a specific row.
41
+ *
42
+ * @param rowId - The row ID (from getRowId)
43
+ */
44
+ clearRowInvalid(rowId: string): void;
45
+ /**
46
+ * Clear all invalid cell states across all rows.
47
+ */
48
+ clearAllInvalid(): void;
49
+ /**
50
+ * Check if a specific cell is marked as invalid.
51
+ *
52
+ * @param rowId - The row ID (from getRowId)
53
+ * @param field - The field name
54
+ * @returns True if the cell is marked as invalid
55
+ */
56
+ isCellInvalid(rowId: string, field: string): boolean;
57
+ /**
58
+ * Get the validation message for an invalid cell.
59
+ *
60
+ * @param rowId - The row ID (from getRowId)
61
+ * @param field - The field name
62
+ * @returns The validation message, or undefined if cell is valid
63
+ */
64
+ getInvalidMessage(rowId: string, field: string): string | undefined;
65
+ /**
66
+ * Check if a row has any invalid cells.
67
+ *
68
+ * @param rowId - The row ID (from getRowId)
69
+ * @returns True if the row has at least one invalid cell
70
+ */
71
+ hasInvalidCells(rowId: string): boolean;
72
+ /**
73
+ * Get all invalid fields for a row.
74
+ *
75
+ * @param rowId - The row ID (from getRowId)
76
+ * @returns Map of field names to validation messages
77
+ */
78
+ getInvalidFields(rowId: string): Map<string, string>;
79
+ }
80
+ //# sourceMappingURL=cell-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-validation.d.ts","sourceRoot":"","sources":["../../../../../../../libs/grid/src/lib/plugins/editing/internal/cell-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAE9F;;;;;;GAMG;AACH,qBAAa,qBAAqB;;gBAOpB,aAAa,EAAE,sBAAsB;IAMjD;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,IAAI;IAU5D;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAWhD;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IASpC;;OAEG;IACH,eAAe,IAAI,IAAI;IAYvB;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAIpD;;;;;;OAMG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAInE;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAKvC;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAKrD"}
@@ -0,0 +1,77 @@
1
+ import { DirtyRowEntry } from './dirty-tracking';
2
+ /**
3
+ * Callback that resolves a row object by its ID.
4
+ * Returns `undefined` when the row is not found.
5
+ */
6
+ export type RowResolver<T> = (rowId: string) => T | undefined;
7
+ export declare class DirtyTrackingManager<T> {
8
+ /** Baseline snapshots: rowId → deep-cloned original row data (first-write-wins) */
9
+ readonly baselines: Map<string, T>;
10
+ /** Whether new baselines were captured during the current processRows cycle */
11
+ private baselinesWereCaptured;
12
+ /** Row IDs inserted via `insertRow()` (no baseline available) */
13
+ readonly newRowIds: Set<string>;
14
+ /** Row IDs that have been modified (edit committed) */
15
+ readonly changedRowIds: Set<string>;
16
+ /** Row IDs whose edit session was committed (gates `tbw-row-dirty` CSS class) */
17
+ readonly committedDirtyRowIds: Set<string>;
18
+ /** Reset all dirty tracking state (called from detach / resetChangedRows). */
19
+ clear(): void;
20
+ /**
21
+ * Capture baselines for rows not already tracked (first-write-wins).
22
+ * Sets the `baselinesWereCaptured` flag when new rows are snapshotted.
23
+ */
24
+ capture(rows: readonly T[], getRowId: (r: T) => string | undefined): void;
25
+ /**
26
+ * Drain the baselines-captured flag (called from afterRender).
27
+ * Returns `null` when no new captures occurred, or the baseline count.
28
+ */
29
+ drainCapturedFlag(): number | null;
30
+ /** Check if a specific row differs from its baseline. */
31
+ isRowDirty(rowId: string, row: T): boolean;
32
+ /** Check if ANY row is dirty (requires row resolver for baseline iteration). */
33
+ hasAnyDirty(resolveRow: RowResolver<T>): boolean;
34
+ /** Check if a single cell differs from its baseline value. */
35
+ isCellDirty(rowId: string, row: T, field: string): boolean;
36
+ /**
37
+ * Get the dirty-state tuple needed by afterRowRender to toggle CSS classes.
38
+ *
39
+ * `isCommittedDirty` requires BOTH committed status AND actual data divergence
40
+ * from baseline (handles undo: after CTRL+Z, row is no longer visually dirty).
41
+ */
42
+ getRowDirtyState(rowId: string, row: T): {
43
+ isNew: boolean;
44
+ isCommittedDirty: boolean;
45
+ hasBaseline: boolean;
46
+ };
47
+ /** Re-snapshot baseline from current data and remove from all sets. */
48
+ markPristine(rowId: string, row: T): void;
49
+ /** Mark a row as newly inserted (no baseline). */
50
+ markNew(rowId: string): void;
51
+ /** Mark a row as dirty (external mutation). */
52
+ markDirty(rowId: string): void;
53
+ /** Re-snapshot all baselines and clear all tracking sets. */
54
+ markAllPristine(resolveRow: RowResolver<T>): void;
55
+ /** Get deep-cloned baseline (undefined for new/untracked rows). */
56
+ getOriginalRow(rowId: string): T | undefined;
57
+ /** Lightweight check whether a baseline exists (no cloning). */
58
+ hasBaseline(rowId: string): boolean;
59
+ /** Get all dirty rows with original + current data. Requires a row resolver. */
60
+ getDirtyRows(resolveRow: RowResolver<T>): DirtyRowEntry<T>[];
61
+ /** Get IDs of all dirty rows. Requires a row resolver. */
62
+ getDirtyRowIds(resolveRow: RowResolver<T>): string[];
63
+ /**
64
+ * Revert a row to its baseline values (mutates row in-place).
65
+ * Returns `true` when baseline existed and row was reverted.
66
+ */
67
+ revertRow(rowId: string, row: T): boolean;
68
+ /** Revert all rows to baseline values. Requires a row resolver. */
69
+ revertAll(resolveRow: RowResolver<T>): void;
70
+ /** Resolve changed row IDs to row objects. */
71
+ getChangedRows(resolveRow: RowResolver<T>): T[];
72
+ /** Get a copy of changed row IDs. */
73
+ getChangedRowIds(): string[];
74
+ /** Check if a row has been marked as changed. */
75
+ isRowChanged(rowId: string): boolean;
76
+ }
77
+ //# sourceMappingURL=dirty-tracking-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirty-tracking-manager.d.ts","sourceRoot":"","sources":["../../../../../../../libs/grid/src/lib/plugins/editing/internal/dirty-tracking-manager.ts"],"names":[],"mappings":"AAAA;;;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AAE,CAAC,GAAG,IAAI;IAOzC,kDAAkD;IAClD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK5B,+CAA+C;IAC/C,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9B,6DAA6D;IAC7D,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;IAYjD,mEAAmE;IACnE,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI5C,gEAAgE;IAChE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAMnC,gFAAgF;IAChF,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE;IAiB5D,0DAA0D;IAC1D,cAAc,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE;IAYpD;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO;IASzC,mEAAmE;IACnE,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;IAW3C,8CAA8C;IAC9C,cAAc,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;IAS/C,qCAAqC;IACrC,gBAAgB,IAAI,MAAM,EAAE;IAI5B,iDAAiD;IACjD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGrC"}
@@ -0,0 +1,33 @@
1
+ import { ColumnConfig, InternalGrid } from '../../../core/types';
2
+ import { EditingConfig } from '../types';
3
+ /**
4
+ * Dependencies injected by the EditingPlugin so the extraction
5
+ * can call back into plugin-owned state and methods.
6
+ */
7
+ export interface EditorInjectionDeps<T> {
8
+ /** Internal grid reference (also usable as HTMLElement via cast). */
9
+ grid: InternalGrid<T>;
10
+ /** Whether the grid is in always-editing "grid" mode. */
11
+ isGridMode: boolean;
12
+ /** Plugin configuration. */
13
+ config: EditingConfig;
14
+ /** Set of cells currently in edit mode ("rowIndex:colIndex"). */
15
+ editingCells: Set<string>;
16
+ /** Value-change callbacks keyed by "rowIndex:field". */
17
+ editorValueCallbacks: Map<string, (newValue: unknown) => void>;
18
+ /** Returns `true` when an edit session is active (#activeEditRow !== -1). */
19
+ isEditSessionActive: () => boolean;
20
+ /** Commit a single cell value change. */
21
+ commitCellValue: (rowIndex: number, column: ColumnConfig<T>, newValue: unknown, rowData: T) => void;
22
+ /** Exit editing for a row (commit or revert). */
23
+ exitRowEdit: (rowIndex: number, revert: boolean) => void;
24
+ }
25
+ /**
26
+ * Inject an editor into a cell element.
27
+ *
28
+ * Handles the full editor lifecycle: creates the editor host, resolves
29
+ * the editor spec (template / custom-element / factory / component),
30
+ * wires commit/cancel callbacks, and registers value-change listeners.
31
+ */
32
+ export declare function injectEditor<T>(deps: EditorInjectionDeps<T>, rowData: T, rowIndex: number, column: ColumnConfig<T>, colIndex: number, cell: HTMLElement, skipFocus: boolean): void;
33
+ //# sourceMappingURL=editor-injection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-injection.d.ts","sourceRoot":"","sources":["../../../../../../../libs/grid/src/lib/plugins/editing/internal/editor-injection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAkB,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE1G,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAC;AAa7D;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,qEAAqE;IACrE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACtB,yDAAyD;IACzD,UAAU,EAAE,OAAO,CAAC;IACpB,4BAA4B;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,iEAAiE;IACjE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,wDAAwD;IACxD,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC;IAC/D,6EAA6E;IAC7E,mBAAmB,EAAE,MAAM,OAAO,CAAC;IACnC,yCAAyC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IACpG,iDAAiD;IACjD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D;AAMD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC5B,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,OAAO,GACjB,IAAI,CAiPN"}
@@ -0,0 +1,55 @@
1
+ import { ColumnConfig, ColumnEditorSpec, ColumnInternal, InternalGrid, RowElementInternal } from '../../../core/types';
2
+ import { EditingConfig } from '../types';
3
+ /**
4
+ * CSS selector for focusable editor elements inside a cell.
5
+ * Duplicated from core/internal/rows to avoid cross-boundary imports
6
+ * that Vite externalises to `@toolbox-web/grid` during plugin bundling.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const FOCUSABLE_EDITOR_SELECTOR = "input,select,textarea,[contenteditable=\"true\"],[contenteditable=\"\"],[tabindex]:not([tabindex=\"-1\"])";
11
+ /**
12
+ * Resolves the editor for a column using the priority chain:
13
+ * 1. Column-level (`column.editor`)
14
+ * 2. Light DOM template (`__editorTemplate` → returns 'template')
15
+ * 3. Grid-level (`gridConfig.typeDefaults[column.type]`)
16
+ * 4. App-level (framework adapter's `getTypeDefault`)
17
+ * 5. Returns undefined (caller uses built-in defaultEditorFor)
18
+ */
19
+ export declare function resolveEditor<TRow>(grid: InternalGrid<TRow>, col: ColumnInternal<TRow>): ColumnEditorSpec<TRow, unknown> | 'template' | undefined;
20
+ /**
21
+ * Returns true if the given property key is safe to use on a plain object.
22
+ */
23
+ export declare function isSafePropertyKey(key: unknown): key is string;
24
+ /**
25
+ * Increment the editing cell count on a row element.
26
+ */
27
+ export declare function incrementEditingCount(rowEl: RowElementInternal): void;
28
+ /**
29
+ * Clear all editing state from a row element.
30
+ */
31
+ export declare function clearEditingState(rowEl: RowElementInternal): void;
32
+ /**
33
+ * No-op updateRow function for rows without IDs.
34
+ * Extracted to a named function to satisfy eslint no-empty-function.
35
+ */
36
+ export declare function noopUpdateRow(_changes: unknown): void;
37
+ /**
38
+ * Auto-wire commit/cancel lifecycle for input elements in string-returned editors.
39
+ */
40
+ export declare function wireEditorInputs(editorHost: HTMLElement, column: ColumnConfig<unknown>, commit: (value: unknown) => void, originalValue?: unknown): void;
41
+ /**
42
+ * Returns `true` when the configured `onBeforeEditClose` callback vetoes
43
+ * the close (i.e. returns `false`). Use as a one-liner guard:
44
+ *
45
+ * ```ts
46
+ * if (shouldPreventEditClose(config, e)) return;
47
+ * ```
48
+ */
49
+ export declare function shouldPreventEditClose(config: EditingConfig, event: MouseEvent | KeyboardEvent): boolean;
50
+ /**
51
+ * Shallow-compare a snapshot against the current row to detect changes.
52
+ * Returns `true` if any own-property value differs between the two objects.
53
+ */
54
+ export declare function hasRowChanged<T>(snapshot: T | undefined, current: T): boolean;
55
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../libs/grid/src/lib/plugins/editing/internal/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,kBAAkB,E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