Liferay.Loader.define("asset-taglib@6.2.15/asset_categories_navigation/js/AssetCategoriesNavigationTreeView",["module","exports","require","@frontend-taglib-clay$clayui/core","@frontend-taglib-clay$clayui/icon","frontend-js-components-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a("@frontend-taglib-clay$clayui/core"),l=o(a("@frontend-taglib-clay$clayui/icon")),r=a("frontend-js-components-web"),i=o(a("liferay!frontend-js-react-web$react"));function o(e){return e&&e.__esModule?e:{default:e}}function c(e,t=[]){for(const a of t){if(a.id===e)return a;const t=c(e,a.children);if(t)return t}return null}const e=({selectedCategoryId:e,vocabularies:t})=>{const a=(t,a)=>{t.preventDefault(),e!==a.id&&Liferay.Util.navigate(a.url)};return i.default.createElement(n.TreeView,{defaultItems:t,defaultSelectedKeys:new Set(e?[e]:[])},(e=>i.default.createElement(n.TreeView.Item,null,i.default.createElement(n.TreeView.ItemStack,{onClick:t=>a(t,e)},i.default.createElement(l.default,{symbol:e.icon}),e.name),i.default.createElement(n.TreeView.Group,{items:e.children},(e=>i.default.createElement(n.TreeView.Item,{onClick:t=>a(t,e)},i.default.createElement(l.default,{symbol:e.icon}),e.name))))))},u=({selectedCategoryId:e,vocabularies:t})=>i.default.createElement(r.Treeview,{NodeComponent:r.Treeview.Card,initialSelectedNodeIds:e?[e]:[],multiSelection:!1,nodes:t,onSelectedNodesChange:([a])=>{if(a&&e!==a){const e=c(a,t);e&&Liferay.Util.navigate(e.url)}}});var d=Liferay.__FF__.enableClayTreeView?e:u;t.default=d}}));
//# sourceMappingURL=AssetCategoriesNavigationTreeView.js.map