/** * Minified by jsDelivr using Terser v5.19.2. * Original file: /npm/ip-geolocation-api-jquery-sdk@1.1.0/ipgeolocation.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ var _ipgeolocation=function(){var e=!1,t=!0,n="",o="",i="",s="en",a="",c="ipgeo",r="timezone",u="_ipgeolocation_geolocation",g="_ipgeolocation_timezone";function p(p,l,d=""){if(e){if(p==c&&sessionStorage.getItem(u)&&l)return void l(JSON.parse(sessionStorage.getItem(u)));if(p==r&&sessionStorage.getItem(g)&&l)return void l(JSON.parse(sessionStorage.getItem(g)))}var m,S="";p?(d&&(S=f(S,"apiKey",d)),n&&(S=f(S,"ip",n)),i&&(S=f(S,"fields",i)),o&&(S=f(S,"excludes",o)),s&&(S=f(S,"lang",s)),a&&(S=f(S,"tz",a)),window.XMLHttpRequest?m=new XMLHttpRequest:window.ActiveXObject&&(m=new ActiveXObject("Microsoft.XMLHTTP")),m.onreadystatechange=function(){4==this.readyState&&(e&&200==this.status&&(key=u,p==r&&(key=g),sessionStorage.setItem(key,this.responseText)),l&&l(JSON.parse(this.responseText)))},m.open("GET","https://api.ipgeolocation.io/".concat(p,S,""),t),m.setRequestHeader("Accept","application/json"),m.send()):l(JSON.parse("{'status': 401, message: 'Given path to IP Geolocation API is not valid'}"))}function f(e,t,n){return e=e?e.concat("&",t,"=",n):"?".concat(t,"=",n)}return{enableSessionStorage:function(t=!1){e=t},makeAsyncCallsToAPI:function(e=!0){t=e},setIPAddress:function(e=""){n=e},setFields:function(e=""){i=e},setExcludes:function(e=""){o=e},setLanguage:function(e="en"){s=e},setTimeZone:function(e=""){a=e},setCoordinates:function(e="",t=""){latitudeParameter=e,longitudeParameter=t},getGeolocation:function(e,t=""){p(c,e,t)},getTimezone:function(e,t=""){p(r,e,t)}}}(); //# sourceMappingURL=/sm/0c9404ae6c994cac0c1a73e6477f9379dcf39e1e5da52471b359c68e5518b2aa.map