class i{constructor(t){this.endpoint=t}query(t){return new Promise((r,n)=>{let e=new XMLHttpRequest;e.onreadystatechange=l=>{if(e.readyState===XMLHttpRequest.DONE)if(e.status===200)var s=e.responseText;else var s=!1;else var s=null;if(s===!1)n(e.status);else if(s!==null){try{var a=JSON.parse(s)}catch{n("Can't parse response !")}r(a)}},e.open("POST",this.endpoint),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.send("query="+encodeURIComponent(t)+"&format="+encodeURIComponent("application/sparql-results+json"))})}}export{i as default};
