(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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(require,module,exports){
"use strict";

Vue.component('wpcfto_image_select', {
    mixins: [window.validationMixin],
    props: ['fields', 'field_label', 'field_name', 'field_id', 'field_value', 'required'],
    data() {
      return {
        value: '',
        style: ''
      };
    },
    mounted() {
      this.value = this.field_value;
  
      const styles = [];
      if (this.fields.width) {
        styles.push(`width: ${this.fields.width}px`);
      }
      if (this.fields.height) {
        styles.push(`height: ${this.fields.height}px`);
      }
      this.style = styles.join('; ');
    },
    methods: {
      onKeyDown(event, key) {
        if (event.key === ' ' || event.key === 'Enter') {
          event.preventDefault();
          this.value = key;
        }
      }
    },
    template: `
      <div class="wpcfto_generic_field wpcfto_generic_field_image_select" :class="field_id">
        <wpcfto_fields_aside_before 
          :fields="fields" 
          :field_label="field_label"
          :required="fields.required === true"
        ></wpcfto_fields_aside_before>
  
        <div class="wpcfto-field-content">
          <div class="wpcfto_image_select" role="radiogroup" :aria-labelledby="field_id + '_label'">
            <label 
              v-for="(option, key) in fields.options" 
              :key="key"
              :class="{ active: value == key }"
              role="radio"
              :aria-checked="value == key ? 'true' : 'false'"
              tabindex="0"
              @keydown="onKeyDown($event, key)"
            >
              <span class="wpcfto-img-wrap">
                <img :src="option.img" :alt="option.alt" :style="style" />
              </span>
              <input 
                type="radio" 
                :name="field_name" 
                v-model="value" 
                :value="key" 
                :required="fields.required === true"
                style="display:none;"
              />
              <span class="wpcfto-img-alt" v-html="option.alt"></span>
            </label>
          </div>
        </div>
  
        <wpcfto_fields_aside_after :fields="fields"></wpcfto_fields_aside_after>
      </div>
    `,
    watch: {
      value(newVal) {
        this.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