Liferay.Loader.define("layout-content-page-editor-web@2.0.166/page_editor/app/utils/dragAndDrop/itemIsAncestor", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = itemIsAncestor;

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */

    /**
     * Checks if the given parent is indeed parent of given child.
     * @param {object} child
     * @param {object} parent
     * @param {{current: object}} layoutDataRef
     * @return {boolean}
     */
    function itemIsAncestor(child, parent, layoutDataRef) {
      if (child && parent) {
        return child.itemId !== parent.itemId ? itemIsAncestor(child, layoutDataRef.current.items[parent.parentId], layoutDataRef) : true;
      }

      return false;
    }
    //# sourceMappingURL=itemIsAncestor.js.map
  }
});
//# sourceMappingURL=itemIsAncestor.js.map