Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/sxp_blueprint_admin/js/shared/PreviewModal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/link","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$react","../utils/constants","../utils/toasts","./CodeMirrorEditor"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewModalWithCopyDownload=function PreviewModalWithCopyDownload({children:e,fileName:t,foldInitializationDelay:a,folded:i=!1,lineWrapping:f,readOnly:s=!0,size:y,text:p,title:m,type:b="application/json"}){return o.default.createElement(PreviewModal,{body:o.default.createElement(o.default.Fragment,null,o.default.createElement(l.default.Group,{spaced:!0},o.default.createElement(l.default,{className:d.COPY_BUTTON_CSS_CLASS,"data-clipboard-text":p,displayType:"secondary",small:!0},o.default.createElement("span",{className:"inline-item inline-item-before"},o.default.createElement(r.default,{symbol:"copy"})),Liferay.Language.get("copy-to-clipboard")),o.default.createElement(n.default,{displayType:"secondary",download:t,href:URL.createObjectURL(new Blob([p],{type:b})),onClick:()=>{(0,u.openSuccessToast)({message:Liferay.Language.get("downloaded")})},outline:!0},o.default.createElement("span",{className:"inline-item inline-item-before"},o.default.createElement(r.default,{symbol:"download"})),Liferay.Language.get("download"))),o.default.createElement(c.default,{foldInitializationDelay:a,folded:i,lineWrapping:f,readOnly:s,value:p})),size:y,title:m},e)},t.default=void 0;var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/link")),i=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/modal")),o=_interopRequireWildcard(a("liferay!frontend-js-react-web$react")),d=a("../utils/constants"),u=a("../utils/toasts"),c=_interopRequireDefault(a("./CodeMirrorEditor"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const PreviewModal=({body:e,children:t,size:a="md",title:l})=>{const[r,n]=(0,o.useState)(!1),{observer:d}=(0,i.useModal)({onClose:()=>n(!1)});return o.default.createElement(o.default.Fragment,null,r&&o.default.createElement(i.default,{className:"preview-modal",observer:d,size:a},o.default.createElement(i.default.Header,null,l),o.default.createElement(i.default.Body,null,e)),o.default.createElement("div",{onClick:()=>n(!r)},t))};var f=PreviewModal;t.default=f}}));
//# sourceMappingURL=PreviewModal.js.map