<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/side_panel_content/init.jsp" %>

	<c:if test="<%= Validator.isNull(screenNavigatorKey) %>">
		</div>
	</c:if>

	<c:if test="<%= Validator.isNotNull(screenNavigatorKey) %>">
		<liferay-frontend:screen-navigation
			containerWrapperCssClass="side-panel-iframe-wrapper"
			fullContainerCssClass="col-12"
			headerContainerCssClass="side-panel-iframe-menu-wrapper"
			key="<%= screenNavigatorKey %>"
			modelBean="<%= screenNavigatorModelBean %>"
			portletURL="<%= screenNavigatorPortletURL %>"
		/>
	</c:if>
</div>

<aui:script require="commerce-frontend-js/utilities/eventsDefinitions as events">
	document.querySelector('body').classList.remove('open');

	document
		.querySelectorAll('.side-panel-iframe-close, .btn-cancel')
		.forEach(function (trigger) {
			trigger.addEventListener('click', function (e) {
				e.preventDefault();
				window.parent.Liferay.fire(events.CLOSE_SIDE_PANEL);
			});
		});
</aui:script>