function RARGeo(){this.url="/api/geo";this.geoData={ipAddress:"",countryCode:"",countryName:"",regionCode:"",regionName:"",city:"",zipCode:"",timeZone:"",latitude:"",longitude:"",metroCode:"",isCampaignAvailable:function(n){return this.countryName.toLowerCase()=n.toLowerCase()},isCanada:function(){return this.countryName.toLowerCase()==="canada"},isUS:function(){return this.countryName.toLowerCase()==="us"},isMX:function(){return this.countryName.toLowerCase()==="mx"}};this.loadResponse=function(n){this.geoData.ipAddress=n.IP;this.geoData.countryCode=n.CountryCode;this.geoData.countryName=n.Country_Name;this.geoData.regionCode=n.Region_Code;this.geoData.regionName=n.Region_Name;this.geoData.city=n.City;this.geoData.zipCode=n.Zip_Code;this.geoData.timeZone=n.Time_Zone;this.geoData.latitude=n.Latitude;this.geoData.longitude=n.Longitude;this.geoData.metroCode=n.Metro_Code};this.getGeoData=function(){var n=this;return new Promise(function(t,i){var r=new XMLHttpRequest;r.open("GET",n.url);r.onload=function(){r.status==200?(n.loadResponse(JSON.parse(r.response)),t(n.geoData)):i(Error(r.statusText))};r.onerror=function(){i(Error("Network Error"))};r.send()})}}!function(n){function i(n,t){return function(){n.apply(t,arguments)}}function t(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null;this._value=null;this._deferreds=[];o(n,i(f,this),i(r,this))}function u(n){var t=this;return null===this._state?void this._deferreds.push(n):void s(function(){var i=t._state?n.onFulfilled:n.onRejected,r;if(null===i)return void(t._state?n.resolve:n.reject)(t._value);try{r=i(t._value)}catch(u){return void n.reject(u)}n.resolve(r)})}function f(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void o(i(t,n),i(f,this),i(r,this))}this._state=!0;this._value=n;e.call(this)}catch(u){r.call(this,u)}}function r(n){this._state=!1;this._value=n;e.call(this)}function e(){for(var n=0,t=this._deferreds.length;t>n;n++)u.call(this,this._deferreds[n]);this._deferreds=null}function h(n,t,i,r){this.onFulfilled="function"==typeof n?n:null;this.onRejected="function"==typeof t?t:null;this.resolve=i;this.reject=r}function o(n,t,i){var r=!1;try{n(function(n){r||(r=!0,t(n))},function(n){r||(r=!0,i(n))})}catch(u){if(r)return;r=!0;i(u)}}var c=setTimeout,s="function"==typeof setImmediate&&setImmediate||function(n){c(n,1)},l=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};t.prototype["catch"]=function(n){return this.then(null,n)};t.prototype.then=function(n,i){var r=this;return new t(function(t,f){u.call(r,new h(n,i,t,f))})};t.all=function(){var n=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new t(function(t,i){function u(r,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if("function"==typeof o)return void o.call(e,function(n){u(r,n)},i)}n[r]=e;0==--f&&t(n)}catch(s){i(s)}}if(0===n.length)return t([]);for(var f=n.length,r=0;r<n.length;r++)u(r,n[r])})};t.resolve=function(n){return n&&"object"==typeof n&&n.constructor===t?n:new t(function(t){t(n)})};t.reject=function(n){return new t(function(t,i){i(n)})};t.race=function(n){return new t(function(t,i){for(var r=0,u=n.length;u>r;r++)n[r].then(t,i)})};t._setImmediateFn=function(n){s=n};"undefined"!=typeof module&&module.exports?module.exports=t:n.Promise||(n.Promise=t)}(this)