{% load admin_modify admin_urls i18n static unfold %}

<div class="js-inline-admin-formset inline-group" id="{{ inline_admin_formset.formset.prefix }}-group" data-inline-type="tabular" data-inline-formset="{{ inline_admin_formset.inline_formset_data }}" {% if inline_admin_formset.opts.tab %}x-show="activeTab == '{{ inline_admin_formset.formset.prefix|slugify }}'"{% else %}x-show="activeTab == 'general'"{% endif %}>
    <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
        {{ inline_admin_formset.formset.management_form }}

        <fieldset class="module relative {{ inline_admin_formset.classes }} min-w-0" aria-labelledby="{{ inline_admin_formset.formset.prefix }}-heading">
            {% if inline_admin_formset.is_collapsible %}<details><summary>{% endif %}

            <h2 id="{{ inline_admin_formset.formset.prefix }}-heading" class="bg-base-100 border border-transparent font-semibold mb-6 px-4 py-3 rounded-default text-font-important-light text-sm 2xl:-mx-4 dark:bg-white/[.02]  dark:text-font-important-dark {% if inline_admin_formset.opts.tab %}hidden{% endif %} {% if inline_admin_formset.is_collapsible %} cursor-pointer{% endif %}">
                {% if inline_admin_formset.formset.max_num == 1 %}
                    {{ inline_admin_formset.opts.verbose_name|capfirst }}
                {% else %}
                    {{ inline_admin_formset.opts.verbose_name_plural|capfirst }}
                {% endif %}
            </h2>

            {% if inline_admin_formset.is_collapsible %}</summary>{% endif %}

            {{ inline_admin_formset.formset.non_form_errors }}
            <div class="border border-base-200 mb-6 overflow-x-auto rounded-default shadow-xs dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
                <table class="tabular-table w-full [&>tbody:nth-child(odd)]:bg-base-50 dark:[&>tbody:nth-child(odd)]:bg-white/[.02]" {% if inline_admin_formset.opts.ordering_field %}data-ordering-field="{{ inline_admin_formset.opts.ordering_field }}" x-on:end="sortRecords" x-sort.ghost x-sort:config="{preventOnFilter: false}"{% endif %}>
                    {% include "unfold/helpers/edit_inline/tabular_heading.html" %}

                    {% for inline_admin_form in inline_admin_formset %}
                        <tbody class="{% if inline_admin_form.original or inline_admin_form.show_url %}has_original {% else %}template{% endif %}" x-sort:item>
                            {% include "unfold/helpers/edit_inline/tabular_error.html" %}

                            {% include "unfold/helpers/edit_inline/tabular_title.html" %}

                            {% include "unfold/helpers/edit_inline/tabular_row.html" %}
                        </tbody>
                    {% endfor %}
                </table>
            </div>

            {% if inline_admin_formset.is_collapsible %}</details>{% endif %}
        </fieldset>

        {% include "unfold/helpers/pagination_inline.html" %}
    </div>
</div>
