// src/lib/data-list-view.ts
var DATA_LIST_VIEW_TILES = [
  { value: "table", icon: "fa-table", label: "Table view" },
  { value: "list", icon: "fa-list", label: "List view" },
  { value: "board", icon: "fa-table-columns", label: "Board view" },
  { value: "dashboard", icon: "fa-chart-mixed", label: "Dashboard view" },
  { value: "calendar", icon: "fa-calendar-days", label: "Calendar view" },
  { value: "folder", icon: "fa-grid-2", label: "Folder view" },
  { value: "panel", icon: "fa-sidebar", label: "List & details" },
  { value: "tree-panel", icon: "fa-sitemap", label: "Tree & details" }
];
function dataListViewLabel(view) {
  return DATA_LIST_VIEW_TILES.find((t) => t.value === view)?.label ?? view;
}
function dataListViewIcon(view) {
  return DATA_LIST_VIEW_TILES.find((t) => t.value === view)?.icon ?? "fa-table";
}
function dataListViewAddShortcut(index) {
  if (index < 0 || index > 8) return void 0;
  return String(index + 1);
}

// src/lib/data-list-view-surface.ts
function getDataListViewRenderKind(view) {
  switch (view) {
    case "table":
      return "data-table";
    case "list":
      return "list-with-toolbar";
    case "board":
      return "board-with-toolbar";
    case "dashboard":
      return "dashboard-with-toolbar";
    case "calendar":
      return "calendar-with-toolbar";
    case "folder":
      return "folder-with-toolbar";
    case "panel":
      return "panel-with-toolbar";
    case "tree-panel":
      return "tree-panel-with-toolbar";
    default: {
      const _x = view;
      return _x;
    }
  }
}

// src/lib/data-list-view-registry.ts
var DEFINITIONS = DATA_LIST_VIEW_TILES.map((tile) => {
  const renderKind = getDataListViewRenderKind(tile.value);
  const hubMetricsStrip = renderKind !== "calendar-with-toolbar" && renderKind !== "dashboard-with-toolbar";
  return {
    value: tile.value,
    label: tile.label,
    icon: tile.icon,
    renderKind,
    hubMetricsStrip
  };
});
var BY_VALUE = new Map(
  DEFINITIONS.map((d) => [d.value, d])
);
var DATA_LIST_VIEW_REGISTRY = DEFINITIONS;
var PRIMARY_HUB_SUPPORTED_VIEWS = [
  "table",
  "list",
  "board",
  "dashboard"
];
var FULL_HUB_SUPPORTED_VIEWS = [
  "table",
  "list",
  "board",
  "dashboard",
  "folder",
  "panel",
  "tree-panel"
];
var ALL_DATA_LIST_VIEW_TYPES = DATA_LIST_VIEW_REGISTRY.map((d) => d.value);
function dataListViewDefinition(view) {
  const def = BY_VALUE.get(view);
  if (!def) {
    throw new Error(`Unknown DataListViewType: ${view}`);
  }
  return def;
}
function showsListPageHubMetricsStrip(view) {
  return dataListViewDefinition(view).hubMetricsStrip;
}
function dataListViewTilesForHub(supported) {
  const allowed = new Set(supported);
  return DATA_LIST_VIEW_REGISTRY.filter((d) => allowed.has(d.value)).map((d) => ({
    type: d.value,
    label: d.label,
    icon: d.icon
  }));
}
function dataListViewSelectionTilesForHub(supported) {
  return dataListViewTilesForHub(supported).map((t) => ({
    value: t.type,
    label: t.label,
    icon: t.icon
  }));
}
var DATA_LIST_SURFACE_VIEW_TYPES = new Set(
  DATA_LIST_VIEW_REGISTRY.map((d) => d.value)
);
function isDataListSurfaceViewType(viewType) {
  return DATA_LIST_SURFACE_VIEW_TYPES.has(viewType);
}
function isDataListViewTypeSupported(view, supported) {
  return supported.includes(view);
}
export {
  ALL_DATA_LIST_VIEW_TYPES,
  DATA_LIST_SURFACE_VIEW_TYPES,
  DATA_LIST_VIEW_REGISTRY,
  FULL_HUB_SUPPORTED_VIEWS,
  PRIMARY_HUB_SUPPORTED_VIEWS,
  dataListViewAddShortcut,
  dataListViewDefinition,
  dataListViewIcon,
  dataListViewLabel,
  dataListViewSelectionTilesForHub,
  dataListViewTilesForHub,
  getDataListViewRenderKind,
  isDataListSurfaceViewType,
  isDataListViewTypeSupported,
  showsListPageHubMetricsStrip
};
//# sourceMappingURL=data-list-view-registry.js.map