Liferay.Loader.define("@liferay/document-library-web@6.0.110/document_library/js/DocumentLibrary",["module","exports","require","frontend-js-web"],(function(e,t,n){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({editEntryUrl:e,namespace:t,searchContainerId:n,selectFolderURL:c}){let a;const l=document["".concat(t,"fm2")];function i(){const e=a.select&&a.select.get("bulkSelection");l.elements["".concat(t,"selectAll")].value=e}function r(n){l.action=e,l.method="POST",l.enctype="multipart/form-data",l.elements["".concat(t,"cmd")].value="move",l.elements["".concat(t,"newFolderId")].value=n,submitForm(l,e,!1)}function d(e){const t=e.targetItem,n=e.selectedItems,o=t.attr("data-folder-id");o&&(a.select&&!n.indexOf(t.one("input[type=checkbox]"))||r(o))}function m(){const n="move_to_trash";l.elements["".concat(t,"javax-portlet-action")]?l.elements["".concat(t,"javax-portlet-action")].value=n:l.elements["".concat(t,"cmd")].value=n,submitForm(l,e,!1)}Liferay.componentReady("".concat(t).concat(n)).then((e=>{a=e,a.registerAction("move-to-folder",d),a.registerAction("move-to-trash",m),a.on("rowToggled",i)})),window["".concat(t,"move")]=function(n,a,i){const d=1===n?Liferay.Language.get("select-destination-folder-for-x-item"):Liferay.Language.get("select-destination-folder-for-x-items");(0,o.openSelectionModal)({height:"480px",id:t,onSelect:n=>{a&&i?function(n,c,a){const i=l.elements["".concat(t,"redirect")].value,r=document.createElement("div");r.appendChild((0,o.buildFragment)('<form action="'.concat(e,'" class="hide" method="POST"><input name="').concat(t,'cmd" value="move"/>\n\t\t\t\t\t<input name="').concat(t,'newFolderId" value="').concat(n,'"/>\n\t\t\t\t\t<input name="').concat(t).concat(c,'" value="').concat(a,'"/>\n\t\t\t\t\t<input name="').concat(t,'redirect" value="').concat(encodeURIComponent(i),'"/>\n\t\t\t\t</form>')));const d=r.firstElementChild;l.append(d),submitForm(d,e,!1)}(n.folderid,a,i):r(n.folderid)},selectEventName:"".concat(t,"selectFolder"),size:"lg",title:(0,o.sub)(d,[n]),url:c})}};var o=n("frontend-js-web")}));
//# sourceMappingURL=DocumentLibrary.js.map