"use strict";var c=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of g(e))!d.call(t,o)&&o!==r&&c(t,o,{get:()=>e[o],enumerable:!(s=x(e,o))||s.enumerable});return t};var P=t=>_(c({},"__esModule",{value:!0}),t);var I={};m(I,{default:()=>A,postRequest:()=>l});module.exports=P(I);var i=require("undici"),f=require("url");var y="2.22.0";function p(t){let e=process.env[t]||process.env[t.toUpperCase()];return e?new i.ProxyAgent(e):!1}var a=p("http_proxy_license_server")||p("http_proxy"),u=p("https_proxy_license_server")||p("https_proxy"),R={...a?{"http:":a}:{},...u?{"https:":u}:{}},S=((process.env.no_proxy||process.env.NO_PROXY)??"").split(",").map(t=>t.trim()).filter(t=>t.length>0),w=t=>{let{host:e,protocol:r}=t;return!(r==="http:"&&!a||r==="https:"&&!u||S.some(s=>e.endsWith(s)))};async function l(t,e,r={}){let s=new f.URL(t),o;w(s)&&(o=R[s.protocol]);try{let n=await(0,i.fetch)(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json","User-Agent":`License-SDK/${y} (Node.js ${process.version}; ${process.platform}) ${r.productIdentifier??""}`},signal:AbortSignal.timeout(r.timeoutInMs??3e4),...o?{dispatcher:o}:{}});return{status:n.status,data:await n.json()}}catch(n){let h=new Error("Connection Error: "+n.message);throw h.cause=n,h}}var A={postRequest:l};0&&(module.exports={postRequest});
//# sourceMappingURL=httpRequest.js.map