Liferay.Loader.define("@liferay/document-library-web@6.0.163/document_library/js/data-engine/panels/InfoPanel.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/loading-indicator","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","../../../css/data_engine_info_panel.scss"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function InfoPanel({title:e,url:t}){const[n,d]=(0,o.useState)(!0),[c,s]=(0,o.useState)(""),u=(0,l.useIsMounted)();return(0,o.useEffect)((()=>{(0,i.fetch)(t).then((e=>e.text())).then((e=>{u()&&(s(e),d(!1))})).catch((e=>{}))}),[u,t]),o.default.createElement("div",{className:"dm-sidebar sidebar-sm"},o.default.createElement("div",{className:"sidebar-header"},o.default.createElement("div",{className:"autofit-row mb-3 sidebar-section"},o.default.createElement("div",{className:"component-title"},o.default.createElement("h2",{className:"text-truncate-inline"},e)),o.default.createElement(a.ClayButtonWithIcon,{"aria-label":(()=>"Details"===e?Liferay.Language.get("close-details-panel"):"Permissions"===e?Liferay.Language.get("close-permissions-panel"):"Additional Metadata Fields"===e?Liferay.Language.get("close-additional-metadata-fields-panel"):void 0)(),displayType:"unstyled",onClick:()=>{const t=document.querySelector(".ddm-form-builder--sidebar-open"),n=document.querySelector(".multi-panel-sidebar-content-open");t.classList.remove("ddm-form-builder--sidebar-open"),n.classList.remove("multi-panel-sidebar-content-open");const a=document.querySelector('[data-panel-id="'.concat(e,'"]'));null==a||a.focus(),a.ariaSelected=!1},size:"sm",symbol:"times",tabIndex:"0",title:Liferay.Language.get("close")}))),o.default.createElement("div",{className:"sidebar-body"},n?o.default.createElement(r.default,null):o.default.createElement(InfoPanelBody,{content:c})))};var a=n("@frontend-taglib-clay$clayui/button"),r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("@frontend-taglib-clay$clayui/loading-indicator")),l=n("@liferay/frontend-js-react-web"),i=n("frontend-js-web"),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 n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=a?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(n,r,l):n[r]=e[r]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}n("../../../css/data_engine_info_panel.scss");class InfoPanelBody extends o.default.Component{constructor(e){super(e),this._ref=o.default.createRef()}componentDidMount(){this._ref.current&&((0,i.runScriptsInElement)(this._ref.current),this._ref.current.addEventListener("change",this._handleOnChange))}shouldComponentUpdate(){return!1}render(){return o.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.content},ref:this._ref})}}}}));
//# sourceMappingURL=InfoPanel.es.js.map