import { Node_Type } from "./../ricos-schema/legacy/wix/rich_content/v1/index.js";
const ensureCardsUnwrapped = (content) => {
  if (!content?.nodes?.length) {
    return content;
  }
  const hasCards = content.nodes.some((node) => node.type === Node_Type.CARD);
  if (!hasCards) {
    return content;
  }
  const unwrappedNodes = [];
  for (const node of content.nodes) {
    if (node.type === Node_Type.CARD) {
      unwrappedNodes.push(...node.nodes ?? []);
    } else {
      unwrappedNodes.push(node);
    }
  }
  return {
    ...content,
    nodes: unwrappedNodes
  };
};
export {
  ensureCardsUnwrapped
};
//# sourceMappingURL=ensure-cards-unwrap.js.map
