<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_seo %}
<div v-if="isLoading">
    <sw-skeleton variant="detail-bold" />
    <sw-skeleton />
</div>

<div v-else>
    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_product_detail_seo_general %}
    <sw-card
        position-identifier="sw-product-detail-seo"
        :title="$tc('sw-product.seo.cardTitleSeo')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_product_detail_seo_general_content %}
        <sw-product-seo-form
            ref="seoForm"
            :allow-edit="acl.can('product.editor')"
        />
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_product_detail_seo_urls %}
    <sw-seo-url
        v-if="product.seoUrls"
        :has-default-template="false"
        :disabled="!acl.can('product.editor')"
        :urls="product.seoUrls"
        @on-change-sales-channel="onChangeSalesChannel"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_product_detail_seo_urls_content %}
        <template #seo-additional="props">
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_product_detail_seo_urls_content_seo_additional %}
            <sw-inherit-wrapper
                v-if="product.mainCategories"
                v-model:value="productMainCategory"
                :has-parent="!!parentProduct.id && !!props.currentSalesChannelId && product.categories.length === 0"
                :label="$tc('sw-seo-url.labelMainCategory')"
                :inherited-value="parentMainCategory"
            >

                <template #content="{ currentValue, isInherited }">
                    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
                    {% block sw_product_detail_seo_urls_content_seo_additional_edit %}
                    <sw-seo-main-category
                        :current-sales-channel-id="props.currentSalesChannelId"
                        :categories="categories"
                        :main-categories="isInherited ? parentProduct.mainCategories : product.mainCategories"
                        :overwrite-label="true"
                        :allow-edit="acl.can('product.editor') && !isInherited"
                        @main-category-add="onAddMainCategory"
                    />
                    {% endblock %}
                </template>

            </sw-inherit-wrapper>
            {% endblock %}
        </template>
        {% endblock %}
    </sw-seo-url>
    {% endblock %}
</div>
{% endblock %}
