Liferay.Loader.define("knowledge-base-web@5.0.98/admin/js/components/MoveModal",["module","exports","require","@frontend-taglib-clay$clayui/core","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../utils/getSearchItems","../utils/normalizeItems","./SearchField"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function MoveModal({itemToMoveId:t,items:r}){const d=(0,o.useMemo)((()=>(0,c.default)(r)),[r]),m=(0,o.useMemo)((()=>(0,u.default)(r)),[r]),[p,y]=(0,o.useState)(!1);return o.default.createElement("div",{className:"container-fluid p-3"},o.default.createElement(f.default,{handleSearchChange:({isSearchActive:e})=>{y(e)},items:m}),!p&&o.default.createElement(a.TreeView,{defaultItems:d,defaultSelectedKeys:new Set([t]),dragAndDrop:!0,nestedKey:"children",onItemMove:(e,t,r)=>{(0,l.getOpener)().Liferay.fire(s,{destinationItem:t,index:r})},showExpanderOnHover:!1},(r=>o.default.createElement(a.TreeView.Item,{className:(0,i.default)({"knowledge-base-navigation-item-active":r.id===t}),onClick:e=>{((e,t)=>{t.stopPropagation();const r={next:e.children.length};(0,l.getOpener)().Liferay.fire(s,{destinationItem:e,index:r})})(r,e)}},o.default.createElement(a.TreeView.ItemStack,null,o.default.createElement(n.default,{symbol:e[r.type]}),r.name),o.default.createElement(a.TreeView.Group,{items:r.children},(t=>o.default.createElement(a.TreeView.Item,null,o.default.createElement(n.default,{symbol:e[t.type]}),t.name)))))))};var a=r("@frontend-taglib-clay$clayui/core"),n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(r("liferay!frontend-js-react-web$classnames")),l=r("frontend-js-web"),d=_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),o=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 i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),u=_interopRequireDefault(r("../utils/getSearchItems")),c=_interopRequireDefault(r("../utils/normalizeItems")),f=_interopRequireDefault(r("./SearchField"));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={article:"document-text",folder:"folder"},s="selectKBMoveFolder";const m={classNameId:d.default.string.isRequired,href:d.default.string.isRequired,id:d.default.string.isRequired,name:d.default.string.isRequired,type:d.default.oneOf(Object.keys(e)).isRequired};m.children=d.default.arrayOf(d.default.shape(m))}}));
//# sourceMappingURL=MoveModal.js.map