{% if field.prepend or field.append or field.copy_to_clipboard %}
    {% set field = field|merge({'wrapper_classes': 'form-input-addon-wrapper'}) %}
{% endif %}

{% extends "forms/field.html.twig" %}

{% block prepend %}
{% if field.prepend %}
    <div class="form-input-addon form-input-prepend">
        {%- if field.markdown -%}{{- field.prepend|t|markdown|raw -}}{%- else -%}{{- field.prepend|t|e -}}{%- endif -%}
    </div>
{% endif %}
{% endblock %}

{% block input_attributes %}
    type="text"
    {% if field.size %}size="{{ field.size }}"{% endif %}
    {% if field.minlength is defined or field.validate.min is defined %}minlength="{{ field.minlength | default(field.validate.min) }}"{% endif %}
    {% if field.maxlength is defined or field.validate.max is defined %}maxlength="{{ field.maxlength | default(field.validate.max) }}"{% endif %}
    {{ parent() }}
{% endblock %}

{% block append %}
    {% if field.copy_to_clipboard %}
        <div class="form-input-addon form-input-append copy-to-clipboard">
            {% if field.copy_to_clipboard in ['0', '1'] %}
                <i class="fa fa-clipboard"></i>
            {% else %}
                {%- if field.markdown -%}{{- field.copy_to_clipboard|t|markdown|raw -}}{%- else -%}{{- field.copy_to_clipboard|t|e -}}{%- endif -%}
            {% endif %}
        </div>
    {% elseif field.append %}
        <div class="form-input-addon form-input-append">
            {%- if field.markdown -%}{{- field.append|t|markdown|raw -}}{%- else -%}{{- field.append|t|e -}}{%- endif -%}
        </div>
    {% endif %}
{% endblock %}


