Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.145/page_editor/app/utils/getFirstControlsId",["module","exports","require","../components/layout-data-items/Collection","../config/constants/itemTypes","../config/constants/layoutDataItemTypes"],(function(t,e,o){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function getFirstControlsId({item:t,layoutData:e}){const o=getCollectionItems(t.itemType===i.ITEM_TYPES.editable?t.parentId:t.id,e);if(!o.length)return t.id;return o.reduce(((e,o)=>o===t.id?e:(0,n.getToControlsId)(o,0,e)),(t=>t))(t.id)};var n=o("../components/layout-data-items/Collection"),i=o("../config/constants/itemTypes"),a=o("../config/constants/layoutDataItemTypes");function getCollectionItems(t,e,o=[]){const n=e.items[t];if(!n)return o;const i=n.type===a.LAYOUT_DATA_ITEM_TYPES.collection?[t,...o]:o;return getCollectionItems(n.parentId,e,i)}}}));
//# sourceMappingURL=getFirstControlsId.js.map