import{a as e,f as t,l as n}from"./preact.module-CNakwbc9.js";import{d as r,s as i,t as a}from"./hooks.module-BrXTvcfS.js";import{h as o}from"./content_renderer-DOj8g78V.js";import{a as s}from"./i18n-BaLR3UdQ.js";import{t as c}from"./server-BXh06Wz_.js";import{t as l}from"./jsxRuntime.module-Cao1NCKs.js";import{J as u}from"./hooks-ClTXKdUl.js";import{t as d}from"./Modal-hBkTa-Ee.js";import{t as f}from"./Button-Du0dYm4Z.js";import{n as p}from"./RawHtml-BZRPHliO.js";n(),r();function m(){let n=a(null),[r,m]=i(),[h,g]=i(!1),_=a(null);return u(`showInfoDialog`,e=>{m(e),g(!0)}),l(d,{className:`info-dialog`,size:r?.size??`sm`,title:r?.title??s(`info.modalTitle`),onHidden:()=>{r?.callback?.(),g(!1)},onShown:()=>_.current?.focus?.(),modalRef:n,footer:l(e,{children:[r?.copyToClipboardButton&&l(f,{text:s(`info.copy_to_clipboard`),icon:`bx bx-copy`,onClick:async()=>{let e=n.current?.querySelector(`.modal-body`)?.innerHTML;if(!e)return;let{markdownContent:t}=await c.post(`other/to-markdown`,{htmlContent:e});o(t)}}),l(f,{buttonRef:_,text:s(`info.okButton`),onClick:()=>g(!1)})]}),show:h,stackable:!0,scrollable:!0,children:t(r?.message)?r?.message:l(p,{className:`info-dialog-content`,html:r?.message})})}export{m as default};