function updateList(filter) {
	var template = '<a href="https://servaid.atlascopco.com/AssertWeb/undefined/AtlasCopco/Catalogue/{{id}}/Identity" target="_blank">{{value}}</a>'

	var html = ""
	$.each(productNumbers, function (_, p) {
		if (p.includes(filter)) {
			if (html.length) {
				html += "<br>"
			}
			var value = p.replace(/^(\d{4})(\d{4})(\d{2})$/, "$1 $2 $3")
			html += template.replace(/{{id}}/g, p).replace(/{{value}}/g, value)
		}
	})
	$(".product-numbers-list").html(html)
}

$(function () {
	updateList("")
	$('#product-numbers-filter').keyup(function () {
		updateList(this.value.replace(/\s/g, ""))
	})	
})