import{E as e,aC as a,c1 as n,x as t,q as s,X as r,b7 as c,bq as g,bV as l,an as i,a7 as o,G as u,aA as d,F as m,bo as p,ao as h,a8 as $,cy as v,dN as b,b9 as f}from"./index-WdfADTOW.js";const x={string:a=>e(n,{get children(){return a.content}}),image:n=>e(a,{get src(){return n.content}})},I=()=>{const a=s();t.info(a("manage.messenger-tips"));const[I,w]=r(""),[y,C]=c(()=>g.post("/admin/message/get")),[k,q]=c(()=>g.post("/admin/message/send",{message:I()})),[j,z]=l([]),A=async()=>{const e=await C();v(e,e=>{z(b(a=>a.push(e)))})},E=async()=>{const e=await q();f(e)},F=setInterval(A,1e3);return i(()=>clearInterval(F)),e(o,{spacing:"$2",h:"$full",alignItems:"start",get children(){return[e(o,{w:"$full",spacing:"$2",alignItems:"start",p:"$2",rounded:"$lg",border:"1px solid var(--hope-colors-neutral6)",get children(){return[e(n,{size:"xl",get children(){return a("manage.received_msgs")}}),e(u,{each:j,children:a=>e(d,m({get component(){return x[a.type]}},a))})]}}),e(p,{w:"$full",get value(){return I()},onInput:e=>w(e.currentTarget.value)}),e(h,{spacing:"$2",get children(){return[e($,{colorScheme:"accent",get loading(){return y()},onClick:A,get children(){return a("manage.receive")}}),e($,{get loading(){return k()},onClick:E,get children(){return a("manage.send")}})]}})]}})};export{I as Messenger,x as Shower,I as default};
