Liferay.Loader.define("product-navigation-control-menu-web@6.0.78/js/NavigationMenuItemsTree",["module","exports","require","@frontend-taglib-clay$clayui/core","@frontend-taglib-clay$clayui/icon","@liferay/layout-content-page-editor-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function NavigationMenuItemsTree({portletNamespace:e,selectedSiteNavigationMenuItemId:t,siteNavigationMenuItems:r}){const[n,o]=(0,l.useSessionState)("".concat(e,"_navigationMenusExpandedKeys"),[t]);return i.default.createElement(a.TreeView,{defaultItems:r,displayType:"dark",expandedKeys:new Set(n),nestedKey:"children",onExpandedChange:e=>{o(Array.from(e))},showExpanderOnHover:!1},(e=>i.default.createElement(TreeItem,{item:e,selectedItemId:t})))};var a=r("@frontend-taglib-clay$clayui/core"),n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/icon")),l=r("@liferay/layout-content-page-editor-web"),i=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e=13;function TreeItem({item:t,selectedItemId:r}){const l=t.url&&"#"!==t.url,o=(0,i.useRef)(null),u=(0,i.useRef)(null);return i.default.createElement(a.TreeView.Item,null,i.default.createElement(a.TreeView.ItemStack,{active:r===t.id?"true":null,onKeyDown:t=>{t.keyCode===e&&l&&o.current.click()}},i.default.createElement(n.default,{symbol:t.url?"page":"folder"}),i.default.createElement("div",{className:"align-items-center d-flex pl-2"},l?i.default.createElement("a",{className:"flex-grow-1 text-decoration-none text-truncate w-100","data-tooltip-floating":"true",href:t.url,ref:o,tabIndex:"-1",target:t.target,title:t.name},t.name):i.default.createElement("span",null,t.name))),i.default.createElement(a.TreeView.Group,{items:t.children},(t=>i.default.createElement(a.TreeView.Item,{active:r===t.id?"true":null,onKeyDown:t=>{t.keyCode===e&&l&&o.current.click()}},i.default.createElement(n.default,{symbol:t.url?"page":"folder"}),i.default.createElement("div",{className:"align-items-center d-flex pl-2"},l?i.default.createElement("a",{className:"flex-grow-1 text-decoration-none text-truncate w-100","data-tooltip-floating":"true",href:t.url,ref:u,tabIndex:"-1",target:t.target,title:t.name},t.name):i.default.createElement("span",null,t.name))))))}}}));
//# sourceMappingURL=NavigationMenuItemsTree.js.map