import{p as r,e as i,z as s,F as _,f as l,g as f,h as c,V as T,o as u}from"./vue-CSzJdJby.js";const k={key:0,class:"alert alert-danger alert-dismissible",role:"alert"},b={class:"modal-title",id:"ErrorLabel"},h={class:"pe-3"},y=["innerHTML"],g={__name:"Error",props:{showTitle:{default:!0}},setup(d,{expose:p}){const a=r(null),e=r(null);function n(){e.value=null,a.value=null}function v(t){if(t.status===0)a.value=null,e.value="Failed to contact temBoard server.";else{a.value=t.status;const o=t.getResponseHeader("content-type");o.includes("application/json")?(e.value=JSON.parse(t.responseText).error,e.value===""&&(e.value="Unknown error. Please contact temBoard administrator.")):o.includes("text/plain")?e.value=`<pre>${t.responseText}</pre>`:e.value="Unknown error. Please contact temBoard administrator."}}function m(t){a.value=null,e.value=t}return p({clear:n,fromXHR:v,setHTML:m}),(t,o)=>e.value?(u(),i("div",k,[s("h4",b,[d.showTitle?(u(),i(_,{key:0},[l("Error "+f(a.value),1)],64)):c("",!0)]),l(),s("button",{type:"button",class:"btn-close","aria-label":"Close",onClick:T(n,["prevent"])}),l(),s("div",h,[s("p",{innerHTML:e.value},null,8,y)])])):c("",!0)}};export{g as _};
