"use strict";

exports.__esModule = true;
exports.multiReferenceCellType = void 0;
var _types = require("../../types");
var _ReferenceEditWrapper = require("../reference/ReferenceEditWrapper");
var _View = require("./View");
exports.MultiReferenceView = _View.MultiReferenceView;
var _Edit = require("./Edit");
exports.MultiReferenceEdit = _Edit.MultiReferenceEdit;
const multiReferenceCellType = exports.multiReferenceCellType = (0, _types.defineCellType)({
  type: 'multiReference',
  ViewComponent: _View.MultiReferenceView,
  EditComponent: _Edit.MultiReferenceEdit,
  EditWrapper: _ReferenceEditWrapper.ReferenceEditWrapper,
  // Compact, single-line JSON for clipboard TSV (no pretty-printing).
  serialize: value => value && value.length ? JSON.stringify(value) : '',
  deserialize: raw => {
    if (!raw) {
      return null;
    }
    try {
      const parsed = JSON.parse(raw);
      if (Array.isArray(parsed)) {
        return parsed;
      }
    } catch {}
    return null;
  },
  editable: true,
  clearable: true,
  // Single click opens the chip editor (parity with the UX handoff).
  editOnClick: () => true,
  // Enter edit on a printable key without clearing the existing chips — the
  // MultiSelect input takes over typing once edit opens.
  onTypeToEdit: () => ({})
});
//# sourceMappingURL=index.js.map