{% extends '/components/merlin/steps/base.twig' %}

{% block slide_body_video_section_blurb %}
	{% import '/common/macros.twig' as icwp_macros %}
	<p>{{ strings.ip_detect_able }}</p>
	<p>{{ strings.ip_detect_text }}</p>
	<p><{{ strings.ip_detect_auto }}/p>
	<p>T{{ strings.ip_detect_resolve }}</p>

	{% if flags.has_none %}
		<div class="alert alert-warning">{{ strings.ip_detect_auto }}</div>

	{% elseif flags.has_only_1 %}
		<div class="alert alert-info">{{ strings.ip_detect_not_required }}: <code>{{ vars.the_ip }}</code></div>

	{% elseif flags.has_multiple %}
		<form class="form-horizontal merlin-form ajax-form mt-4">

			<div class="row my-3">
				<label class="col-4 col-form-label">
					Step 1: What Is <em>Your</em> IP?
				</label>
				<div class="col-8">
					<a href="{{ hrefs.visitor_ip }}" target="_blank">Click here to discover your current IP Address</a>
				</div>
			</div>

			<div class="form-group row mt-3">
				<label class="col-4 col-form-label" for="_ip_source">
					Step 2: Select Your IP
				</label>
				<div class="col-8">
					<select name="ip_source" id="_ip_source">
						{% for ip_source,ip in vars.all_ips %}
							<option value="{{ ip_source }}">{{ ip }}</option>
						{% endfor %}
					</select>
					<small class="form-text text-muted d-block">
						Is your IP address on this list?
					</small>
				</div>
			</div>

			<div class="mt-3"></div>
			{{ icwp_macros.formInput_Hidden( 'step_slug', vars.step_slug ) }}
			{{ icwp_macros.formInput_Submit2( 'Confirm My IP Address', null, null, false ) }}
		</form>
	{% endif %}

{% endblock %}