<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_sales_channel_detail_base %}
<div class="sw-sales-channel-detail-base">

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_general %}
    <sw-card
        v-if="salesChannel"
        position-identifier="sw-sales-channel-detail-base-general"
        :is-loading="isLoading"
        :title="$tc('sw-sales-channel.detail.titleGeneralSettings')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_template %}
        <sw-select-field
            v-if="isProductComparison"
            v-model:value="templateName"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :label="$tc('sw-sales-channel.detail.productComparison.templates.label')"
            :placeholder="$tc('sw-sales-channel.detail.productComparison.templates.placeholderSelectTemplate')"
            :options="templateOptions"
            @update:value="(templateName) => $emit('template-selected', templateName)"
        >
            <option
                v-for="option in templateOptions"
                :key="option.name"
                :value="option.name"
            >
                {{ $tc(option.translationKey) }}
            </option>
        </sw-select-field>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_product_comparison_template_modal %}
        <sw-modal
            v-if="showTemplateModal"
            :title="$tc('sw-sales-channel.detail.productComparison.templates.modal-title')"
            @modal-close="$emit('template-modal-close')"
            @template-modal-confirm="$emit('template-modal-confirm')"
        >
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_product_comparison_template_modal_notification %}
            <p>{{ $tc('sw-sales-channel.detail.productComparison.templates.modal-message') }}</p>

            <template #modal-footer>
                <sw-button
                    size="small"
                    @click="$emit('template-modal-close')"
                >
                    {{ $tc('global.default.cancel') }}
                </sw-button>
                <sw-button
                    size="small"
                    variant="primary"
                    @click="$emit('template-modal-confirm')"
                >
                    {{ $tc('sw-sales-channel.detail.productComparison.templates.modal-confirm') }}
                </sw-button>
            </template>
            {% endblock %}
        </sw-modal>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_name %}
        <sw-text-field
            v-model:value="salesChannel.name"
            validation="required"
            required
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :placeholder="placeholder(salesChannel, 'name', $tc('sw-sales-channel.detail.placeholderName'))"
            :label="$tc('sw-sales-channel.detail.labelInputName')"
            :error="salesChannelNameError"
            class="sw-field--salesChannel-name"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_favorite %}
        <sw-switch-field
            :disabled="!acl.can('user_config:create') || !acl.can('user_config:update') || salesChannel._isNew"
            :label="$tc('sw-sales-channel.detail.favouriteLabel')"
            :value="isFavorite()"
            @update:value="(isFavorite) => { salesChannelFavoritesService.update(isFavorite, salesChannel.id) }"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_navigation_category_container %}
        <sw-container
            v-if="!isProductComparison"
            columns="1fr 200px"
            gap="0 30px"
        >

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_base_general_input_navigation_category %}
            <sw-category-tree-field
                v-if="!isProductComparison"
                id="navigationCategoryId"
                required
                :categories-collection="mainCategories"
                :placeholder="navigationCategoryPlaceholder"
                :single-select="true"
                :label="$tc('sw-sales-channel.detail.navigationCategoryId')"
                :disabled="!acl.can('sales_channel.editor') || undefined"
                :help-text="$tc('sw-sales-channel.detail.navigationCategoryHelpText')"
                :error="salesChannelNavigationCategoryIdError"
                class="sw-sales-channel-detail__select-navigation-category-id"
                @selection-add="onMainSelectionAdd"
                @selection-remove="onMainSelectionRemove"
            />
            {% endblock %}

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_base_general_input_navigation_category_depth %}
            <sw-number-field
                v-model:value="salesChannel.navigationCategoryDepth"
                number-type="int"
                :min="1"
                :disabled="!acl.can('sales_channel.editor') || undefined"
                :label="$tc('sw-sales-channel.detail.navigationCategoryDepth')"
            />
            {% endblock %}
        </sw-container>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_footer_category %}
        <sw-category-tree-field
            v-if="!isProductComparison"
            :categories-collection="footerCategories"
            :placeholder="footerCategoryPlaceholder"
            :single-select="true"
            :label="$tc('sw-sales-channel.detail.footerCategory')"
            :disabled="!acl.can('sales_channel.editor')"
            class="sw-sales-channel-detail__select-footer-category-id"
            @selection-add="onFooterSelectionAdd"
            @selection-remove="onFooterSelectionRemove"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_service_category %}
        <sw-category-tree-field
            v-if="!isProductComparison"
            :categories-collection="serviceCategories"
            :placeholder="serviceCategoryPlaceholder"
            :single-select="true"
            :label="$tc('sw-sales-channel.detail.serviceCategory')"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            class="sw-sales-channel-detail__select-service-category-id"
            @selection-add="onServiceSelectionAdd"
            @selection-remove="onServiceSelectionRemove"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_customer_group %}
        <sw-entity-single-select
            v-if="!isProductComparison"
            v-model:value="salesChannel.customerGroupId"
            class="sw-sales-channel-detail__select-customer-group"
            required
            show-clearable-button
            :label="$tc('sw-sales-channel.detail.customerGroup')"
            entity="customer_group"
            :error="salesChannelCustomerGroupIdError"
            :disabled="!acl.can('sales_channel.editor')"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_disabled_countries_warning %}
        <sw-alert
            v-if="disabledCountries.length > 0"
            :variant="disabledCountryVariant"
            :title="$tc('global.default.' + disabledCountryVariant)"
        >
            <span v-html="buildDisabledPaymentAlert('sw-sales-channel.detail.warningDisabledCountries', disabledCountries)"></span>
        </sw-alert>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_countries %}
        <sw-sales-channel-defaults-select
            v-if="!isProductComparison"
            :sales-channel="salesChannel"
            property-name="countries"
            :property-label="$tc('sw-sales-channel.detail.labelInputCountries')"
            :help-text="$tc('sw-sales-channel.detail.countryMultiSelectHelpText')"
            default-property-name="countryId"
            :criteria="countryCriteria"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :default-property-label="$tc('sw-sales-channel.detail.labelInputDefaultCountry')"
            :disabled-tooltip-message="$tc('sw-sales-channel.detail.tooltipDisabledCountry')"
            should-show-active-state
        />
        {% endblock %}

        <sw-alert
            v-if="unservedLanguages.length > 0"
            :variant="unservedLanguageVariant"
            :title="$tc('global.default.' + unservedLanguageVariant)"
        >
            <span v-html="buildUnservedLanguagesAlert('sw-sales-channel.detail.warningUnservedLanguage', unservedLanguages)"></span>
        </sw-alert>

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_languages %}
        <sw-sales-channel-defaults-select
            v-if="!isProductComparison"
            :sales-channel="salesChannel"
            property-name="languages"
            :property-label="$tc('sw-sales-channel.detail.labelInputLanguages')"
            default-property-name="languageId"
            :default-property-label="$tc('sw-sales-channel.detail.labelInputDefaultLanguage')"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            property-name-in-domain="languageId"
        />
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_shipping_payment %}
    <sw-card
        v-if="salesChannel"
        position-identifier="sw-sales-channel-detail-base-shipping-payment"
        :is-loading="isLoading"
        :title="$tc('sw-sales-channel.detail.titleShippingPayment')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_disabled_payments_methods_warning %}
        <sw-alert
            v-if="disabledPaymentMethods.length > 0"
            :variant="disabledPaymentMethodVariant"
            :title="$tc('global.default.' + disabledPaymentMethodVariant)"
        >
            <span v-html="buildDisabledPaymentAlert('sw-sales-channel.detail.warningDisabledPaymentMethod', disabledPaymentMethods, 'distinguishableName')"></span>
        </sw-alert>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_payments_methods %}
        <sw-sales-channel-defaults-select
            v-if="!isProductComparison"
            :sales-channel="salesChannel"
            property-name="paymentMethods"
            :criteria="paymentMethodCriteria"
            :property-label="$tc('sw-sales-channel.detail.labelInputPaymentMethods')"
            default-property-name="paymentMethodId"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :default-property-label="$tc('sw-sales-channel.detail.labelInputDefaultPaymentMethod')"
            :disabled-tooltip-message="$tc('sw-sales-channel.detail.tooltipDisabledPaymentMethod')"
            should-show-active-state
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_disabled_shipping_methods_warning %}
        <sw-alert
            v-if="disabledShippingMethods.length > 0"
            :variant="disabledShippingMethodVariant"
            :title="$tc('global.default.' + disabledShippingMethodVariant)"
        >
            <span v-html="buildDisabledShippingAlert('sw-sales-channel.detail.warningDisabledShippingMethod', disabledShippingMethods)"></span>
        </sw-alert>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_shipping_methods %}
        <sw-sales-channel-defaults-select
            v-if="!isProductComparison"
            :sales-channel="salesChannel"
            property-name="shippingMethods"
            :property-label="$tc('sw-sales-channel.detail.labelInputShippingMethods')"
            default-property-name="shippingMethodId"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :default-property-label="$tc('sw-sales-channel.detail.labelInputDefaultShippingMethod')"
            :disabled-tooltip-message="$tc('sw-sales-channel.detail.tooltipDisabledShippingMethod')"
            should-show-active-state
            :criteria="shippingMethodCriteria"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_currencies %}
        <sw-sales-channel-defaults-select
            v-if="!isProductComparison"
            :sales-channel="salesChannel"
            property-name="currencies"
            :property-label="$tc('sw-sales-channel.detail.labelInputCurrencies')"
            default-property-name="currencyId"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :default-property-label="$tc('sw-sales-channel.detail.labelInputDefaultCurrency')"
            property-name-in-domain="currencyId"
            :criteria="currencyCriteria"
        />
        {% endblock %}

        <sw-radio-field
            v-model:value="salesChannel.taxCalculationType"
            :label="$tc('sw-sales-channel.detail.labelTaxCalculation')"
            :help-text="helpTextTaxCalculation"
            block
            class="sw-sales-channel-detail__tax-calculation"
            identification="taxCalculation"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :description="$tc('sw-sales-channel.detail.descriptionTaxCalculation')"
            :options="taxCalculationTypeOptions"
        />
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_options_hreflang %}
    <sw-sales-channel-detail-hreflang
        v-if="salesChannel && isStorefront"
        :sales-channel="salesChannel"
        :disabled="!acl.can('sales_channel.editor') || undefined"
        :is-loading="isLoading"
    />
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_options_domains %}
    <sw-sales-channel-detail-domains
        v-if="salesChannel && isDomainAware"
        :sales-channel="salesChannel"
        :disable-edit="!acl.can('sales_channel.editor') || undefined"
        :is-loading="isLoading"
    />
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront %}
    <sw-card
        v-if="salesChannel && isProductComparison"
        position-identifier="sw-sales-channel-detail-base-general-input-product-comparison-storefront"
        :is-loading="isLoading"
        :title="$tc('sw-sales-channel.detail.productComparison.storefront')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront_select %}
        <sw-entity-single-select
            v-model:value="productExport.storefrontSalesChannelId"
            class="sw-sales-channel-detail__product-comparison-storefront"
            :label="$tc('sw-sales-channel.detail.productComparison.storefront')"
            :criteria="storefrontSalesChannelCriteria"
            label-property="name"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            value-property="id"
            entity="sales_channel"
            required
            show-clearable-button
            @update:value="onStorefrontSelectionChange"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront_domain %}
        <sw-entity-single-select
            v-model:value="productExport.salesChannelDomainId"
            class="sw-sales-channel-detail__product-comparison-domain"
            :label="$tc('sw-sales-channel.detail.productComparison.storefrontDomain')"
            :criteria="storefrontSalesChannelDomainCriteria"
            label-property="url"
            value-property="id"
            entity="sales_channel_domain"
            required
            show-clearable-button
            :disabled="(!productExport.salesChannelDomainId && !productExport.storefrontSalesChannelId) || !acl.can('sales_channel.editor') || undefined"
            :error="productExportSalesChannelDomainIdError"
            @update:value="onStorefrontDomainSelectionChange"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront_domain_currency %}
        <div
            v-if="productExport.salesChannelDomain"
            class="sw-sales-channel-detail-base__product-comparison-container"
        >
            <sw-entity-single-select
                v-model:value="productExport.currencyId"
                :label="$tc('sw-sales-channel.detail.productComparison.storefrontDomainCurrency.label')"
                :criteria="storefrontSalesChannelCurrencyCriteria"
                label-property="name"
                value-property="id"
                required
                entity="currency"
                :disabled="!acl.can('sales_channel.editor') || undefined"
                :error="productExportCurrencyIdError"
                show-clearable-button
            />
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront_domain_language %}
        <div
            v-if="productExport.salesChannelDomain"
            class="sw-sales-channel-detail-base__product-comparison-container"
        >
            <sw-entity-single-select
                v-model:value="productExport.salesChannelDomain.languageId"
                :label="$tc('sw-sales-channel.detail.productComparison.storefrontDomainLanguage.label')"
                label-property="name"
                value-property="id"
                entity="language"
                :disabled="true"
                show-clearable-button
            />
            <sw-help-text
                class="sw-sales-channel-detail-base__product-comparison-helptext"
                :text="$tc('sw-sales-channel.detail.productComparison.storefrontDomainLanguage.help')"
                :disabled="!acl.can('sales_channel.editor')"
                tooltip-position="top"
            />
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_storefront_sales_channel_customer_group %}
        <div class="sw-sales-channel-detail-base__product-comparison-container">
            <sw-entity-single-select
                v-model:value="salesChannel.customerGroupId"
                :label="$tc('sw-sales-channel.detail.productComparison.storefrontSalesChannelCustomerGroup.label')"
                label-property="name"
                value-property="id"
                entity="customer_group"
                :disabled="true"
                show-clearable-button
            />
            <sw-help-text
                class="sw-sales-channel-detail-base__product-comparison-helptext"
                :text="$tc('sw-sales-channel.detail.productComparison.storefrontSalesChannelCustomerGroup.help')"
                tooltip-position="top"
            />
        </div>
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_general_input_product_comparison_settings %}
    <sw-card
        v-if="salesChannel && isProductComparison"
        position-identifier="sw-sales-channel-detail-base-general-input-product-comparison-settings"
        :is-loading="isLoading"
        :title="$tc('sw-sales-channel.detail.productComparison.settings')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_filename %}
        <sw-text-field
            v-model:value="productExport.fileName"
            validation="required"
            required
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :label="$tc('sw-sales-channel.detail.productComparison.fileName')"
            :placeholder="$tc('sw-sales-channel.detail.productComparison.placeholderFileName')"
            :error="productExportFileNameError || invalidFileNameError"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_encoding %}
        <sw-select-field
            v-model:value="productExport.encoding"
            :label="$tc('sw-sales-channel.detail.productComparison.encoding')"
            :placeholder="$tc('sw-sales-channel.detail.productComparison.placeholderSelectEncoding')"
            :options="getEncodingOptions"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            required
            :error="productExportEncodingError"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_file_format %}
        <sw-select-field
            v-model:value="productExport.fileFormat"
            :label="$tc('sw-sales-channel.detail.productComparison.fileFormat')"
            :placeholder="$tc('sw-sales-channel.detail.productComparison.placeholderSelectFileFormat')"
            :options="getFileFormatOptions"
            required
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :error="productExportFileFormatError"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_include_variants %}
        <sw-switch-field
            v-model:value="productExport.includeVariants"
            bordered
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :label="$tc('sw-sales-channel.detail.productComparison.includeVariants')"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_interval %}
        <mt-select
            :model-value="productExport.interval"
            :label="$tc('sw-sales-channel.detail.productComparison.interval')"
            :options="getIntervalOptions"
            label-property="name"
            value-property="id"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            @update:model-value="changeInterval"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_generate_by_cronjob %}
        <sw-switch-field
            v-model:value="productExport.generateByCronjob"
            bordered
            :label="$tc('sw-sales-channel.detail.productComparison.generateByCronjob')"
            :disabled="disableGenerateByCronjob || !acl.can('sales_channel.editor') || undefined"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_last_generation %}
        <div v-if="productExport.salesChannelDomainId">
            <div
                v-if="productExport.generatedAt"
                class="sw-sales-channel-detail-base_general__last-generation-text"
            >
                {{ $tc('sw-sales-channel.detail.productComparison.lastGenerationLabel') }}{{ dateFilter(productExport.generatedAt, { hour: '2-digit', minute: '2-digit' }) }}
            </div>
            <div
                v-else
                class="sw-sales-channel-detail-base_general__last-generation-text"
            >
                {{ $tc('sw-sales-channel.detail.productComparison.lastGenerationLabel') }}{{ $tc('sw-sales-channel.detail.productComparison.notYetGenerated') }}
            </div>
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_general_input_product_comparison_product_stream %}
        <sw-entity-single-select
            v-model:value="productExport.productStreamId"
            class="sw-sales-channel-detail__product-comparison-product-stream"
            :label="$tc('sw-sales-channel.detail.productComparison.productStream')"
            label-property="name"
            value-property="id"
            required
            show-clearable-button
            :disabled="!acl.can('sales_channel.editor') || undefined"
            entity="product_stream"
            :error="productExportProductStreamIdError"
        />
        {% endblock %}

        <sw-text-field
            v-if="salesChannel.productExports && salesChannel.productExports.length > 0"
            v-model:value="cliCommand"
            copyable
            :label="$tc('sw-sales-channel.detail.productComparison.cliCommand')"
            readonly
            :disabled="true"
        />
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_options_api %}
    <sw-card
        v-if="salesChannel"
        position-identifier="sw-sales-channel-detail-base-options-api"
        :is-loading="isLoading"
        :title="$tc('sw-sales-channel.detail.titleOptionsApiKey')"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_api_description %}
        <div
            class="sw-sales-channel-detail-base__description-text"
            v-html="$tc('sw-sales-channel.detail.textApiAccessDescription')"
        ></div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_input_access_key %}
        <sw-text-field
            v-if="!isProductComparison"
            v-model:value="salesChannel.accessKey"
            :label="$tc('sw-sales-channel.detail.labelAccessKeyField')"
            :disabled="true"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_input_generate_key %}
        <div
            v-if="!isProductComparison"
            class="sw-sales-channel-detail__action-buttons"
        >
            <sw-button
                size="small"
                :disabled="!acl.can('sales_channel.editor') || undefined"
                class="sw-sales-channel-detail-base__button-generate-keys"
                @click="onGenerateKeys"
            >
                {{ $tc('sw-sales-channel.detail.buttonCreateNewApiKeys') }}
            </sw-button>

            <sw-button
                size="small"
                class="sw-sales-channel-detail-base__button-copy-key"
                @click="copyToClipboard"
            >
                {{ $tc('sw-sales-channel.detail.buttonCopyApiKeyButton') }}
            </sw-button>
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_product_comparison_access_key %}
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_product_comparison_input_access_key %}
        <sw-text-field
            v-if="isProductComparison"
            v-model:value="productExport.accessKey"
            :label="$tc('sw-sales-channel.detail.productComparison.accessKey')"
            :disabled="true"
            :copyable="true"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_product_comparison_input_access_url %}
        <sw-text-field
            v-if="isProductComparison && productExport.salesChannelDomainId"
            v-model:value="productComparisonAccessUrl"
            :label="$tc('sw-sales-channel.detail.productComparison.accessUrl')"
            :disabled="true"
            :copyable="true"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_product_comparison_input_generate_key %}
        <div class="sw-sales-channel-detail__action-button">
            <sw-button
                v-if="isProductComparison"
                variant="ghost"
                :disabled="!acl.can('sales_channel.editor')"
                size="small"
                class="sw-sales-channel-detail-base__button-generate-keys"
                @click="onGenerateProductExportKey"
            >
                {{ $tc('sw-sales-channel.detail.productComparison.buttonCreateNewAccessKey') }}
            </sw-button>
        </div>
        {% endblock %}
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_options_status %}
    <sw-card
        v-if="salesChannel"
        position-identifier="sw-sales-channel-detail-base-options-status"
        :title="$tc('sw-sales-channel.detail.titleStatus')"
        :is-loading="isLoading"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_status_description %}
        <div class="sw-sales-channel-detail-base__description-text">
            {{ $tc('sw-sales-channel.detail.textActiveDescription') }}
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_status_input_active %}
        <sw-switch-field
            v-model:value="salesChannel.active"
            :label="$tc('sw-sales-channel.detail.labelInputActive')"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            @update:value="onToggleActive"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_maintenance_header %}
        <h4 class="sw-sales-channel-detail-base__headline-text">
            {{ $tc('sw-sales-channel.detail.maintenanceModeTitle') }}
        </h4>

        <div class="sw-sales-channel-detail-base__description-text">
            {{ $tc('sw-sales-channel.detail.maintenanceModeDescription') }}
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_maintenance_input_active %}
        <sw-switch-field
            v-model:value="salesChannel.maintenance"
            name="sw-field--salesChannel-maintenance"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            :label="$tc('sw-sales-channel.detail.labelMaintenanceActive')"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_maintenance_ipwhitelist %}
        <sw-multi-tag-ip-select
            v-model:value="maintenanceIpAllowlist"
            :is-loading="isLoading"
            :disabled="!acl.can('sales_channel.editor') || undefined"
            class="sw-order-user-card__tag-select"
            :label="$tc('sw-sales-channel.detail.ipAddressAllowlist')"
            :help-text="$tc('sw-sales-channel.detail.ipAddressAllowlistHelpText')"
            :known-ips="knownIps"
            :validate="validateMaintenanceIpCidr"
            error-code="SHOPWARE_INVALID_IP_CIDR"
        />
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_settings_link %}
        <div class="sw-sales-channel-detail-base__settings-link">
            <router-link
                v-if="acl.can('sales_channel.editor')"
                :to="{ name: 'sw.settings.basic.information.index'}"
                class="sw-card__quick-link"
            >
                {{ $tc('sw-sales-channel.detail.basicinformationLink') }}
                <sw-icon
                    name="regular-long-arrow-right"
                    small
                />
            </router-link>
        </div>
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_base_options_delete %}
    <sw-card
        v-if="salesChannel && acl.can('sales_channel.deleter')"
        position-identifier="sw-sales-channel-detail-base-options-delete"
        :title="$tc('sw-sales-channel.detail.deleteModalTitle')"
        :is-loading="isLoading"
    >
        <sw-container
            columns="1fr 175px"
            gap="0px 30px"
            class="sw-sales-channel-detail-base__delete-sales-channel"
        >
            <div class="sw-sales-channel-detail-base__description-text">
                <strong>{{ $tc('global.default.warning') }}</strong>
                {{ $tc('sw-sales-channel.detail.textDeleteSalesChannelWarning') }}
            </div>

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_base_options_delete_button %}
            <div class="sw-sales-channel-detail-base__button-delete">
                <sw-button
                    variant="danger"
                    size="small"
                    @click="showDeleteModal = true"
                >
                    {{ $tc('sw-sales-channel.detail.buttonDelete') }}
                </sw-button>
            </div>
            {% endblock %}
        </sw-container>

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_detail_base_options_delete_modal %}
        <sw-modal
            v-if="showDeleteModal"
            ref="modal"
            class="sw-sales-channel-detail-base__delete-modal"
            variant="small"
            :title="$tc('sw-sales-channel.detail.deleteModalTitle')"
            @modal-close="onCloseDeleteModal"
        >

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_options_delete_modal_confirmtext %}
            <p class="sw-sales-channel-detail-base__delete-modal-confirm-text">
                {{ $tc('sw-sales-channel.detail.textConfirmDelete') }}
            </p>
            <p class="sw-sales-channel-detail-base__delete-modal-name">
                <strong>{{ placeholder(salesChannel, 'name') }}</strong>
            </p>
            <p>{{ $tc('sw-sales-channel.detail.textDeleteInfo') }}</p>
            {% endblock %}

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_detail_options_delete_modal_footer %}
            <template #modal-footer>
                <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
                {% block sw_sales_channel_detail_options_delete_modal_abort %}
                <sw-button
                    size="small"
                    @click="onCloseDeleteModal"
                >
                    {{ $tc('global.default.cancel') }}
                </sw-button>
                {% endblock %}

                <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
                {% block sw_sales_channel_detail_options_delete_modal_confirm %}
                <sw-button
                    size="small"
                    variant="danger"
                    @click="onConfirmDelete"
                >
                    {{ $tc('sw-sales-channel.detail.buttonConfirmDelete') }}
                </sw-button>
                {% endblock %}
            </template>
            {% endblock %}
        </sw-modal>
        {% endblock %}
    </sw-card>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_detail_custom_field_sets %}
    <sw-card
        v-if="salesChannel && customFieldSets.length > 0"
        position-identifier="sw-sales-channel-detail-base-custom-field-sets"
        :title="$tc('sw-settings-custom-field.general.mainMenuItemGeneral')"
        :is-loading="isLoading"
    >
        <sw-custom-field-set-renderer
            :entity="salesChannel"
            :sets="customFieldSets"
        />
    </sw-card>
    {% endblock %}
</div>
{% endblock %}
