window.Packlink||(window.Packlink={}),function(){function e(){this.get=function(e,t,n){this.call("GET",e,{},t,n)},this.post=function(e,t,n,s){this.call("POST",e,t,n,s)},this.call=function(t,n,s,o,i){const a=e(),r=Packlink.StateUUIDService.getStateUUID();i||(i=Packlink.responseService.errorHandler),n=n.replace("https:",""),n=n.replace("http:",""),a.open(t,n,!0),a.onreadystatechange=function(){if(this.readyState===4){if(r!==Packlink.StateUUIDService.getStateUUID())return;if(this.status>=200&&this.status<300)o&&o(JSON.parse(this.responseText||"{}"));else if(i){let e=this.responseText;try{e=JSON.parse(this.responseText||"{}")}catch{}i(e)}}},a.setRequestHeader("Accept","application/json"),t==="POST"?this.internalPerformPost(a,s):a.send()},this.internalPerformPost=function(e,t){e.setRequestHeader("Content-Type","application/json"),e.send(JSON.stringify(t))};function e(){let t=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],e;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;for(let n of t)try{e=new ActiveXObject(n);break}catch{}return e}}Packlink.ajaxService=new e}()