<commit_before>var requestUtils={
	'getParamValue':function(paramName){		
			let value= (location.search.split(paramName + '=')[1]||'').split('&')[0];
			if (value && value.length > 0){
				return value;
			}
			return null;
		},
	'isIOS':function(){
		return /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
	},
	'redirect':function(newUrl){
		document.location = newUrl;
	}
};

var goMap = {
	'config':{
		'containerid': 'gocontainer',		
		'defaults':{
			'lat':51.505,
			'lon':-0.09,
			'zoom':13
			}		
	},
	'utils':{
		'getPointFromUrl':function(){
			let point = {};
			point.lat = requestUtils.getParamValue('lat');
			point.lon = requestUtils.getParamValue('lon');
			point.zoom = requestUtils.getParamValue('z');
			return point;
		},
		'isPointComplete':function(point){		
			if (!point.lat || !point.lon){
				return false;
			}
			return true;
		},
		'extendPoint':function(initialPoint, newPoint){
			let point={};
			point.lat=newPoint.lat;
			if (!point.lat || point.lat == null){
				point.lat = initialPoint.lat;
			}
			point.lon=newPoint.lon;
			if (!point.lon || point.lon == null){
				point.lon = initialPoint.lon;
			}
			point.zoom=newPoint.zoom;
			if (!point.zoom || point.zoom == null){
				point.zoom = initialPoint.zoom;
			}
			return point;
		}
	},
	'init': function(config){
		if (config && typeof (config) == 'object') {
            $.extend(goMap.config, config);
        }
		goMap.$container = $('#' + goMap.config.containerid);
		goMap.$footer = goMap.$container.find('.gofooter');
		goMap.$latitude = goMap.$container.find('.latitude');
		goMap.$longitude = goMap.$container.find('.longitude');
		goMap.applestorelink = goMap.$container.find('.gobadges .apple a').attr('href');
		
		let inputPoint = goMap.utils.getPointFromUrl();					
		goMap.point = goMap.utils.extendPoint(goMap.config.defaults, inputPoint);
		goMap.refreshCoordinates();
		
		goMap.map =$.mapwidget();		
		goMap.map.showPoint(goMap.point);
		
		let inputComplete = goMap.utils.isPointComplete(inputPoint);
		if (inputComplete){
			goMap.map.addMarker(goMap.point);
		}
		goMap.point = goMap.utils.getPointFromUrl();	

		if (requestUtils.isIOS()){
			goMap.timer = $.timer({action:requestUtils.redirect, actionparams:goMap.applestorelink});
			goMap.timer.start();
		}
	},	
	'refreshCoordinates':function(){
		goMap.$latitude.text(goMap.point.lat);
		goMap.$longitude.text(goMap.point.lon);
	}
};

(function($) {
	$.mapwidget = function(config) {
		var mapobj={
			config: $.extend({
				'mapid':'map',
                'maxzoom':20,
				'maxnativezoom':19,
				'sourceurl':'http://tile.osmand.net/hd/{z}/{x}/{y}.png',
				'attribution':'&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'<commit_msg>Put back the replacement of the url with the one picked up by osmand<commit_after>var requestUtils={
	'getParamValue':function(paramName){		
			let value= (location.search.split(paramName + '=')[1]||'').split('&')[0];
			if (value && value.length > 0){
				return value;
			}
			return null;
		},
	'isIOS':function(){
		return /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
	},
	'redirect':function(newUrl){
		document.location = newUrl;
	}
};

var goMap = {
	'config':{
		'containerid': 'gocontainer',		
		'defaults':{
			'lat':51.505,
			'lon':-0.09,
			'zoom':13
			}
	},
	'utils':{
		'getPointFromUrl':function(){
			let point = {};
			point.lat = requestUtils.getParamValue('lat');
			point.lon = requestUtils.getParamValue('lon');
			point.zoom = requestUtils.getParamValue('z');
			return point;
		},
		'isPointComplete':function(point){		
			if (!point.lat || !point.lon){
				return false;
			}
			return true;
		},
		'extendPoint':function(initialPoint, newPoint){
			let point={};
			point.lat=newPoint.lat;
			if (!point.lat || point.lat == null){
				point.lat = initialPoint.lat;
			}
			point.lon=newPoint.lon;
			if (!point.lon || point.lon == null){
				point.lon = initialPoint.lon;
			}
			point.zoom=newPoint.zoom;
			if (!point.zoom || point.zoom == null){
				point.zoom = initialPoint.zoom;
			}
			return point;
		}
	},
	'init': function(config){
		if (config && typeof (config) == 'object') {
            $.extend(goMap.config, config);
        }
		goMap.$container = $('#' + goMap.config.containerid);
		goMap.$footer = goMap.$container.find('.gofooter');
		goMap.$latitude = goMap.$container.find('.latitude');
		goMap.$longitude = goMap.$container.find('.longitude');
		goMap.applestorelink = goMap.$container.find('.gobadges .apple a').attr('href');		
		goMap.inapplink = 'osmandmaps://' + document.location.search;
		
		
		let inputPoint = goMap.utils.getPointFromUrl();					
		goMap.point = goMap.utils.extendPoint(goMap.config.defaults, inputPoint);
		goMap.refreshCoordinates();
		
		goMap.map =$.mapwidget();		
		goMap.map.showPoint(goMap.point);
		
		let inputComplete = goMap.utils.isPointComplete(inputPoint);
		if (inputComplete){
			goMap.map.addMarker(goMap.point);
		}
		goMap.point = goMap.utils.getPointFromUrl();	

		if (requestUtils.isIOS()){
			try{
				requestUtils.redirect(goMap.inapplink);
			}catch(e){
				goMap.timer = $.timer({action:requestUtils.redirect, actionparams:goMap.applestorelink});
				goMap.timer.start();
			}
		}
	},	
	'refreshCoordinates':function(){
		goMap.$latitude.text(goMap.point.lat);
		goMap.$longitude.text(goMap.point.lon);
	}
};

(function($) {
	$.mapwidget = function(config) {
		var mapobj={
			config: $.extend({
				'mapid':'map',
                'maxzoom':20,
				'maxnativezoom':19,
				'sourceurl':'http://tile.osmand.net/hd/{z}/{x}/{y}.png',
				'attribution':'&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'
{'fraction_non_alphanumeric': 0.18762123082348792, 'fraction_numerical': 0.005995415270675366, 'mean_word_length': 3.6491803278688524, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2448037', 'n_tokens_mistral': 2335, 'n_tokens_neox': 2003, 'n_words': 300}