Liferay.Loader.define("frontend-js-web@5.0.45/liferay/portlet/portlet.es",["module","exports","require","../util/fetch.es","../util/form/object_to_form_data.es","../util/get_portlet_id","../util/portlet_url/create_portlet_url.es","./register.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.minimizePortlet=function(e,t,r){r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({doAsUserId:themeDisplay.getDoAsUserIdEncoded(),plid:themeDisplay.getPlid()},r);const l=document.querySelector(e);if(l){const e=l.querySelector(".portlet-content-container");if(e){const a=e.classList.contains("d-none");if(a?(e.classList.remove("d-none"),l.classList.remove("portlet-minimized")):(e.classList.add("d-none"),l.classList.add("portlet-minimized")),t){const e=a?Liferay.Language.get("minimize"):Liferay.Language.get("restore");t.setAttribute("alt",e),t.setAttribute("title",e);const r=t.querySelector(".taglib-text-icon");r&&(r.innerHTML=e);const i=t.querySelector("i");i&&(i.classList.remove("icon-minus","icon-resize-vertical"),a?(i.classList.add("icon-minus"),i.classList.remove("icon-resize-vertical")):(i.classList.add("icon-resize-vertical"),i.classList.remove("icon-minus")))}const c=(0,n.default)(l.id),d=(0,o.default)({cmd:"minimize",doAsUserId:r.doAsUserId,p_auth:Liferay.authToken,p_l_id:r.plid,p_p_id:c,p_p_restore:a,p_v_l_s_g_id:themeDisplay.getSiteGroupId()});(0,i.default)(themeDisplay.getPathMain()+"/portal/update_layout",{body:d,method:"POST"}).then((e=>{if(e.ok&&a){const e={doAsUserId:r.doAsUserId,p_l_id:r.plid,p_p_boundary:!1,p_p_id:c,p_p_isolated:!0};(0,i.default)((0,s.default)(themeDisplay.getPathMain()+"/portal/render_portlet",e)).then((e=>e.text())).then((e=>{const t=document.createRange();t.selectNode(l),l.innerHTML="";const r=t.createContextualFragment(e);l.appendChild(r)})).catch((e=>{}))}})).catch((e=>{}))}}},t.default=void 0;var i=l(r("../util/fetch.es")),o=l(r("../util/form/object_to_form_data.es")),n=l(r("../util/get_portlet_id")),s=l(r("../util/portlet_url/create_portlet_url.es"));function l(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}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}var d={register:l(r("./register.es")).default};t.default=d}}));
//# sourceMappingURL=portlet.es.js.map