<commit_before>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.leafletControlGeocoder = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
(function (global){
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
	Nominatim = _dereq_('./geocoders/nominatim')["class"];

module.exports = {
	"class": L.Control.extend({
		options: {
			showResultIcons: false,
			collapsed: true,
			expand: 'click',
			position: 'topright',
			placeholder: 'Search...',
			errorMessage: 'Nothing found.',
			suggestMinLength: 3,
			suggestTimeout: 250,
			defaultMarkGeocode: true,
			selectizePlaceholder: 'Write and select',
			countryLabel: 'Country',
			provinceLabel: 'Province',
			displayFlags: true,
			prependHtml: null,
			appendHtml: null
		},

		includes: L.Mixin.Events,

		initialize: function (options) {
			L.Util.setOptions(this, options);
			if (!this.options.geocoder) {
				this.options.geocoder = new Nominatim();
			}

			this._requestCount = 0;
		},

		onAdd: function (map) {
			var className = 'leaflet-control-geocoder',
			    container = L.DomUtil.create('div', className + ' leaflet-bar');
				if (this.options.prependHtml !== null) {
					$(container).append(this.options.prependHtml);
				}
			var selectorsTable = L.DomUtil.create('table', className + '-selectors-table', container),
			    countryTr = L.DomUtil.create('tr', className + '-country-row', selectorsTable),
			    provinceTr = L.DomUtil.create('tr', className + '-province-row', selectorsTable),
			    form = this._form = L.DomUtil.create('div', className + '-form', container),
			    icon = L.DomUtil.create('button', className + '-icon', form),
			    input,
			    countryLabelTd,
			    countryLabel,
			    countrySelectTd,
			    countrySelect,
				countrySelectize,
			    provinceLabelTd,
			    provinceLabel,
			    provinceSelectTd,
			    provinceSelect,
			    provinceSelectize;

			this._map = map;
			this._container = container;

			icon.innerHTML = '&nbsp;';
			icon.type = 'button';

			this._provincesData = {};

			countryLabelTd = L.DomUtil.create('td', '', countryTr);
			countryLabel = L.DomUtil.create('label', '', countryLabelTd);
			countryLabel.innerHTML = this.options.countryLabel  + ': ';
			countrySelectTd = L.DomUtil.create('td', '', countryTr);
			countrySelect = L.DomUtil.create('select', className + '-select ' + className + '-country-select', countrySelectTd);

			var countrySelectizeOptions = {
	            options: [],
				dropdownParent: 'body',
	            placeholder: this.options.selectizePlaceholder,
	            labelField: 'name',
				sortField: 'name',
	            searchField: ['name'],
	            valueField: 'iso_code',
				onChange: this._countryChange
	        };
			if (this.options.displayFlags) {
				countrySelectizeOptions.render = {
					option: function(data, escape) {
						return "<div data-value='" + data.iso_code + "' data-selectable='' class='flag-item option'>" +
						"<div class='flag-container'><span title='" +
                        data.name + "' class='flag-icon flag-icon-" + data.iso_code +
						"'></div><div class='selectize-label'>" + data.name + "</div></div>";
					},
					item: function(data, escape) {
						return "<div data-value='" + data.iso_code + "' data-selectable='' class='flag-item item'>" +
						"<div class='flag-container'><span title='" +
                        data.name + "' class='flag-icon flag-icon-" + data.iso_code +
						"'></div><div class='selectize-label'>" + data.name + "</div></div>";
					}
				};
			}
	        countrySelectize = this._countrySelectize = $(countrySelect).selectize(countrySelectizeOptions)[0].selectize;

			countrySelectize.on('change', function(value) {
				if (value === '') {
					provinceSelectize.clear();
					provinceSelectize.disable();
				}
			});

			countrySelectize.positionDropdown();

			countrySelectize._context = this;

	        emapic.getAllCountriesDataBbox().done(function() {
				var countries = [];
				$.each(emapic.allCountriesData, function(isoCode, data) {
					countries.push(data.properties);
				});
				countrySelectize.addOption(countries);
	        });
			provinceLabelTd = L.DomUtil.create('td', null, provinceTr);
			provinceLabel = L.DomUtil.create('label', null, provinceLabelTd);
			provinceLabel.innerHTML = this.options.provinceLabel  + ': ';
			provinceSelectTd = L.DomUtil.create('td', null, provinceTr);
			provinceSelect = this._provinceSelect = L.DomUtil.create('select', className + '-select ' + className + '-province-select', provinceSelectTd);

	        provinceSelectize = this._provinceSelectize = $(provinceSelect).selectize({
	            options: [],
				dropdownParent: 'body',
	            placeholder: this.options.selectizePlaceholder,
	            labelField: 'name',
				sortField: 'name',
	            searchField: ['name'],
	            valueField: 'adm_code',
				onChange: this._provinceChange
	        })[0].selectize;

			provinceSelectize.positionDropdown();

			provinceSelectize.disable();

			provinceSelectize._context = this;

			input = this._input = L.DomUtil.create('input', '', form);
			input.type = 'text';
			input.placeholder = this.options.placeholder;

			this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);
			this._errorElement.innerHTML = this.options.errorMessage;

			this._alts = L.DomUtil.create('ul',
				className + '-alternatives leaflet-control-geocoder-alternatives-minimized',
				container);
			L.DomEvent.disableClickPropagation(this._alts);

			L.DomEvent.addListener(input, 'keydown', this._keydown, this);
			L.DomEvent.addListener(input, 'blur', function() {
				this._clearResults();
				if (this.options.collapsed && !this._preventBlurCollapse) {
					this._collapse();
				}
				this._preventBlurCollapse = false;
			}, this);


			if (this.options.collapsed) {
				if (this.options.expand === 'click') {
					L.DomEvent.addListener(icon, 'click', function(e) {
						// TODO: touch
						if (e.button === 0 && e.detail !== 2) {
							this._toggle();
						}
					}, this);
				} else {
					L.DomEvent.addListener(icon, 'mouseover', this._expand, this);
					L.DomEvent.addListener(icon, 'mouseout', this._collapse, this);
					this._map.on('movestart', this._collapse, this);
				}
			} else {
				L.DomEvent.addListener(icon, 'click', function(e) {
					this._geocode(e);
				}, this);
				this._expand();
			}

			if (this.options.defaultMarkGeocode) {
				this.on('markgeocode', this.markGeocode, this);
			}

			this.on('startgeocode', function() {
				L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');
			}, this);
			this.on('finishgeocode', function() {
				L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');
			}, this);

			L.DomEvent.disableClickPropagation(container);

			if (this.options.appendHtml !== null) {
				$(container).append(this.options.appendHtml);
			}

			return container;
		},

		_geocodeResult: function (results, suggest) {
			if (!suggest && results.length === 1) {
				this._geocodeResultSelected(results[0]);
			} else if (results.length > 0) {<commit_msg>Fix a mistake in the Geocoder<commit_after>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.leafletControlGeocoder = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
(function (global){
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
	Nominatim = _dereq_('./geocoders/nominatim')["class"];

module.exports = {
	"class": L.Control.extend({
		options: {
			showResultIcons: false,
			collapsed: true,
			expand: 'click',
			position: 'topright',
			placeholder: 'Search...',
			errorMessage: 'Nothing found.',
			suggestMinLength: 3,
			suggestTimeout: 250,
			defaultMarkGeocode: true,
			selectizePlaceholder: 'Write and select',
			countryLabel: 'Country',
			provinceLabel: 'Province',
			displayFlags: true,
			prependHtml: null,
			appendHtml: null
		},

		includes: L.Mixin.Events,

		initialize: function (options) {
			L.Util.setOptions(this, options);
			if (!this.options.geocoder) {
				this.options.geocoder = new Nominatim();
			}

			this._requestCount = 0;
		},

		onAdd: function (map) {
			var className = 'leaflet-control-geocoder',
			    container = L.DomUtil.create('div', className + ' leaflet-bar');
				if (this.options.prependHtml !== null) {
					$(container).append(this.options.prependHtml);
				}
			var selectorsTable = L.DomUtil.create('table', className + '-selectors-table', container),
			    countryTr = L.DomUtil.create('tr', className + '-country-row', selectorsTable),
			    provinceTr = L.DomUtil.create('tr', className + '-province-row', selectorsTable),
			    form = this._form = L.DomUtil.create('div', className + '-form', container),
			    icon = L.DomUtil.create('button', className + '-icon', form),
			    input,
			    countryLabelTd,
			    countryLabel,
			    countrySelectTd,
			    countrySelect,
				countrySelectize,
			    provinceLabelTd,
			    provinceLabel,
			    provinceSelectTd,
			    provinceSelect,
			    provinceSelectize;

			this._map = map;
			this._container = container;

			icon.innerHTML = '&nbsp;';
			icon.type = 'button';

			this._provincesData = {};

			countryLabelTd = L.DomUtil.create('td', '', countryTr);
			countryLabel = L.DomUtil.create('label', '', countryLabelTd);
			countryLabel.innerHTML = this.options.countryLabel  + ': ';
			countrySelectTd = L.DomUtil.create('td', '', countryTr);
			countrySelect = L.DomUtil.create('select', className + '-select ' + className + '-country-select', countrySelectTd);

			var countrySelectizeOptions = {
	            options: [],
				dropdownParent: 'body',
	            placeholder: this.options.selectizePlaceholder,
	            labelField: 'name',
				sortField: 'name',
	            searchField: ['name'],
	            valueField: 'iso_code',
				onChange: this._countryChange
	        };
			if (this.options.displayFlags) {
				countrySelectizeOptions.render = {
					option: function(data, escape) {
						return "<div data-value='" + data.iso_code + "' data-selectable='' class='flag-item option'>" +
						"<div class='flag-container'><span title='" +
                        data.name + "' class='flag-icon flag-icon-" + data.iso_code +
						"'></div><div class='selectize-label'>" + data.name + "</div></div>";
					},
					item: function(data, escape) {
						return "<div data-value='" + data.iso_code + "' data-selectable='' class='flag-item item'>" +
						"<div class='flag-container'><span title='" +
                        data.name + "' class='flag-icon flag-icon-" + data.iso_code +
						"'></div><div class='selectize-label'>" + data.name + "</div></div>";
					}
				};
			}
	        countrySelectize = this._countrySelectize = $(countrySelect).selectize(countrySelectizeOptions)[0].selectize;

			countrySelectize.on('change', function(value) {
				if (value === '') {
					provinceSelectize.clear();
					provinceSelectize.disable();
				}
			});

			countrySelectize.positionDropdown();

			countrySelectize._context = this;

	        emapic.getAllCountriesDataBbox().done(function() {
				var countries = [];
				$.each(emapic.allCountriesData, function(isoCode, data) {
					countries.push(data.properties);
				});
				countrySelectize.addOption(countries);
	        });
			provinceLabelTd = L.DomUtil.create('td', null, provinceTr);
			provinceLabel = L.DomUtil.create('label', null, provinceLabelTd);
			provinceLabel.innerHTML = this.options.provinceLabel  + ': ';
			provinceSelectTd = L.DomUtil.create('td', null, provinceTr);
			provinceSelect = this._provinceSelect = L.DomUtil.create('select', className + '-select ' + className + '-province-select', provinceSelectTd);

	        provinceSelectize = this._provinceSelectize = $(provinceSelect).selectize({
	            options: [],
				dropdownParent: 'body',
	            placeholder: this.options.selectizePlaceholder,
	            labelField: 'name',
				sortField: 'name',
	            searchField: ['name'],
	            valueField: 'adm_code',
				onChange: this._provinceChange
	        })[0].selectize;

			provinceSelectize.positionDropdown();

			provinceSelectize.disable();

			provinceSelectize._context = this;

			input = this._input = L.DomUtil.create('input', '', form);
			input.type = 'text';
			input.placeholder = this.options.placeholder;

			this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);
			this._errorElement.innerHTML = this.options.errorMessage;

			this._alts = L.DomUtil.create('ul',
				className + '-alternatives leaflet-control-geocoder-alternatives-minimized',
				container);
			L.DomEvent.disableClickPropagation(this._alts);

			L.DomEvent.addListener(input, 'keydown', this._keydown, this);
			L.DomEvent.addListener(input, 'blur', function() {
				this._clearResults();
				if (this.options.collapsed && !this._preventBlurCollapse) {
					this._collapse();
				}
				this._preventBlurCollapse = false;
			}, this);


			if (this.options.collapsed) {
				if (this.options.expand === 'click') {
					L.DomEvent.addListener(icon, 'click', function(e) {
						// TODO: touch
						if (e.button === 0 && e.detail !== 2) {
							this._toggle();
						}
					}, this);
				} else {
					L.DomEvent.addListener(icon, 'mouseover', this._expand, this);
					L.DomEvent.addListener(icon, 'mouseout', this._collapse, this);
					this._map.on('movestart', this._collapse, this);
				}
			} else {
				L.DomEvent.addListener(icon, 'click', function(e) {
					this._geocode();
				}, this);
				this._expand();
			}

			if (this.options.defaultMarkGeocode) {
				this.on('markgeocode', this.markGeocode, this);
			}

			this.on('startgeocode', function() {
				L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');
			}, this);
			this.on('finishgeocode', function() {
				L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');
			}, this);

			L.DomEvent.disableClickPropagation(container);

			if (this.options.appendHtml !== null) {
				$(container).append(this.options.appendHtml);
			}

			return container;
		},

		_geocodeResult: function (results, suggest) {
			if (!suggest && results.length === 1) {
				this._geocodeResultSelected(results[0]);
			} else if (results.length > 0) {
{'fraction_non_alphanumeric': 0.16939510776815625, 'fraction_numerical': 0.0022754566715125464, 'mean_word_length': 3.620911214953271, 'pattern_counts': {'":': 2, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4219833', 'n_tokens_mistral': 5962, 'n_tokens_neox': 5015, 'n_words': 833}