"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isRichMediaInsideOfBlockNode = void 0;
var _utils = require("@atlaskit/editor-prosemirror/utils");
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
var isRichMediaInsideOfBlockNode = exports.isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
    return false;
  }
  var $pos = view.state.doc.resolve(pos);
  var _view$state$schema$no = view.state.schema.nodes,
    expand = _view$state$schema$no.expand,
    nestedExpand = _view$state$schema$no.nestedExpand,
    layoutColumn = _view$state$schema$no.layoutColumn,
    bodiedSyncBlock = _view$state$schema$no.bodiedSyncBlock;
  if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
    return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn, bodiedSyncBlock]);
  }
  return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
};