(()=>{function t(t){var n=t.resourceUrlWhitelist();n.push(/^http(s?):\/\/www\.mapquestapi\.com\/geocoding\/v1\/address/),t.resourceUrlWhitelist(n)}function n(n){var a="c8y_Position",o=window.C8Y_APP.mapNominatimUrl||"//nominatim.openstreetmap.org/search";function s(){return this.points=[],this}return s.prototype.add=function(t){var n=this;return _.isArray(t)?_.forEach(t,function(t){n.points.push(t)}):t instanceof s?n.add(t.points):this.points.push(t),n},s.prototype.reset=function(){this.points.length=0},s.prototype.get=function(){var n={southWest:{},northEast:{}};return this.points.length||(n=null),this.points.forEach(function(t){t.lat<(n.southWest.lat||1/0)&&(n.southWest.lat=t.lat),t.lng<(n.southWest.lng||1/0)&&(n.southWest.lng=t.lng),t.lat>(n.northEast.lat||-1/0)&&(n.northEast.lat=t.lat),t.lng>(n.northEast.lng||-1/0)&&(n.northEast.lng=t.lng)}),n},{geoCode:function(t){return n.get(o,{params:{format:"json",q:t}})},Bounds:s,getLocationFragment:function(t){var n,o,s=t[a];if(s)return n=Number(s.lat),o=Number(s.lng),!_.isNaN(n)&&!_.isNaN(o)&&Math.abs(s.lng)<=180&&Math.abs(s.lat)<=90?{lat:n,lng:o}:(s=t.name||t.source&&t.source.name,void console.warn("Device ".concat(s," has an invalid location.")))},c8y_Position:a}}n.$inject=["$http"],t.$inject=["$sceDelegateProvider"],angular.module("c8y.core").config(t).factory("c8yGeo",n)})();