Liferay.Loader.define("data-engine-js-components-web@1.0.112/js/custom/form-report/components/sidebar/Sidebar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/loading-indicator","liferay!frontend-js-react-web$react","../../hooks/useRequest","../list/List","../summary/Summary","./SidebarContext","./Sidebar.scss"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Sidebar(){const{field:e,isOpen:t,portletNamespace:a}=(0,c.useContext)(s.SidebarContext);return c.default.createElement(c.default.Fragment,null,t&&c.default.createElement("div",{className:"lfr-de__form-report-sidebar-backdrop"}),c.default.createElement("div",{className:"sidebar-container lfr-de__form-report-sidebar"+(t?" open":""),id:"".concat(a,"sidebar-reports")},c.default.createElement("div",{className:"sidebar sidebar-light"},e&&c.default.createElement(SidebarContent,null))))};var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/loading-indicator")),c=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 a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=r?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(a,l,n):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),o=_interopRequireDefault(a("../../hooks/useRequest")),d=_interopRequireDefault(a("../list/List")),u=_interopRequireDefault(a("../summary/Summary")),s=a("./SidebarContext");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}}a("./Sidebar.scss");const SidebarContent=()=>{const{field:e,formReportRecordsFieldValuesURL:t,portletNamespace:a,summary:f={},toggleSidebar:m,totalEntries:b,type:p}=(0,c.useContext)(s.SidebarContext),{origin:y}=new URL(t),g=t.replace(y,""),E="".concat(g,"&").concat(a,"fieldName=").concat(e.name),{isLoading:_,response:N=[]}=(0,o.default)(E),{icon:R,label:v}=e;return c.default.createElement(c.default.Fragment,null,c.default.createElement("nav",{className:"component-tbar tbar"},c.default.createElement(n.default.ContainerFluid,null,c.default.createElement("ul",{className:"tbar-nav"},c.default.createElement("li",{className:"tbar-item"},c.default.createElement("div",{className:"icon"},c.default.createElement(l.default,{symbol:R}))),c.default.createElement("li",{className:"tbar-item tbar-item-expand"},c.default.createElement("div",{className:"tbar-section"},c.default.createElement("div",{className:"field-info"},c.default.createElement("p",{className:"title"},v),c.default.createElement("p",{className:"description"},b+" ",Liferay.Language.get("entries").toLowerCase())))),c.default.createElement("li",{className:"tbar-item"},c.default.createElement(r.default,{"aria-label":Liferay.Language.get("close"),className:"close-sidebar",displayType:"secondary",id:"".concat(a,"close-sidebar"),monospaced:!0,onClick:()=>m()},c.default.createElement(l.default,{className:"close-button",symbol:"times-small"})))))),c.default.createElement("div",{className:"sidebar-body"},_&&c.default.createElement("div",{className:"align-items-center d-flex loading-wrapper"},c.default.createElement(i.default,null)),!!Object.entries(f).length&&c.default.createElement(u.default,{summary:f}),c.default.createElement(d.default,{data:N,type:p})))}}}));
//# sourceMappingURL=Sidebar.js.map