Liferay.Loader.define("frontend-taglib-clay@9.1.14/normalize_dropdown_items",["module","exports","require","./get_data_attributes"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e)return null;const t=f(e);if(0===t.length)return null;return l(t.map(p))};var o=(n=r("./get_data_attributes"))&&n.__esModule?n:{default:n};function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e){if(e.length<2)return e;const t=[e[0]];for(let r=1;r<e.length;r++){const n=e[r];"group"===n.type&&n.separator&&t.push({type:"divider"}),t.push(n)}return t.map((e=>"group"===e.type?a(a({},e),{},{items:l(e.items)}):e))}function f(e){return e.filter((e=>"group"!==e.type||Array.isArray(e.items)&&e.items.length)).map((e=>"group"===e.type?a(a({},e),{},{items:f(e.items)}):e))}function p(e){const{data:t}=e,r=i(e,["data"]),n=(0,o.default)(t),u=Array.isArray(e.items)?e.items.map(p):e.items;return a(a(a({},n),r),{},{items:u,symbolLeft:e.icon})}}}));
//# sourceMappingURL=normalize_dropdown_items.js.map