"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var node_data_refined_types_exports = {};
__export(node_data_refined_types_exports, {
  isParagraphData: () => isParagraphData,
  isTextData: () => isTextData
});
module.exports = __toCommonJS(node_data_refined_types_exports);
var import_v1 = require("./../../ricos-schema/legacy/wix/rich_content/v1/index.js");
const isTextData = (data) => typeof data?.text === "string" && Array.isArray(data?.decorations) && data.decorations.every(isDecoration);
const DECORATION_TYPES = [
  import_v1.Decoration_Type.ANCHOR,
  import_v1.Decoration_Type.BOLD,
  import_v1.Decoration_Type.COLOR,
  import_v1.Decoration_Type.EXTERNAL,
  import_v1.Decoration_Type.FONT_SIZE,
  import_v1.Decoration_Type.ITALIC,
  import_v1.Decoration_Type.LINK,
  import_v1.Decoration_Type.MENTION,
  import_v1.Decoration_Type.SPOILER,
  import_v1.Decoration_Type.UNDERLINE
];
const isDecoration = (data) => DECORATION_TYPES.includes(data.type);
const isParagraphData = (data) => !!data && (!data.indentation || typeof data.indentation === "number") && (!data.textStyle || [
  import_v1.TextStyle_TextAlignment.AUTO,
  import_v1.TextStyle_TextAlignment.CENTER,
  import_v1.TextStyle_TextAlignment.JUSTIFY,
  import_v1.TextStyle_TextAlignment.LEFT,
  import_v1.TextStyle_TextAlignment.RIGHT
].includes(data.textStyle.textAlignment));
//# sourceMappingURL=node-data-refined-types.js.map
