<% if ( 1 == happyForms.form.get( 'enable_active_campaign' ) ) { %>
<p>
	<label for="<%= instance.id %>_active_campaign_field"><?php _e( 'Map field to ActiveCampaign field', 'happyforms' ); ?></label>
	<select class="widefat" data-bind="active_campaign_field">
		<option value="" selected><?php _e( '— Select —', 'happyforms' ); ?></option>
		<%
		var supported = _happyFormsActiveCampaignSettings.mappings[instance.type];
		var list_id = happyForms.form.get( 'active_campaign_list' );
		var fields = _happyFormsActiveCampaignSettings.fields[list_id];

		if ( fields ) {
			fields.forEach( function( field ) { %>
				<% if ( supported.indexOf( field.type ) >= 0 ) { %>
				<option value="<%= field.id %>" <% if ( instance.active_campaign_field == field.id ) { %>selected<% } %>><%= field.name %></option>
				<% }; %>
			<% } ); %>
		<% } %>
	</select>
</p>
<% } %>
