<?php

return [
    'cache_ttl_seconds' => (int) env('SITEMAPS_CACHE_TTL', 900),

    'refresh' => [
        'build_on_request' => (bool) env('SITEMAPS_BUILD_ON_REQUEST', true),
    ],

    'delivery' => [
        'prefer_published_release' => (bool) env('SITEMAPS_PREFER_PUBLISHED_RELEASE', true),
        'fallback_to_live_build' => (bool) env('SITEMAPS_FALLBACK_TO_LIVE_BUILD', true),
    ],

    'pre_generated' => [
        'enabled' => (bool) env('SITEMAPS_PREGENERATED_ENABLED', true),
        'prefer' => (bool) env('SITEMAPS_PREGENERATED_PREFER', false),
        'disk' => env('SITEMAPS_PREGENERATED_DISK', 'local'),
        'path' => trim((string) env('SITEMAPS_PREGENERATED_PATH', 'generated-sitemaps'), '/'),
    ],

    'releases' => [
        'disk' => env('SITEMAPS_RELEASES_DISK', 'local'),
        'path' => trim((string) env('SITEMAPS_RELEASES_PATH', 'sitemaps'), '/'),
        'retain_successful' => (int) env('SITEMAPS_RELEASES_RETAIN_SUCCESSFUL', 3),
        'retain_failed' => (int) env('SITEMAPS_RELEASES_RETAIN_FAILED', 2),
        'lock_seconds' => (int) env('SITEMAPS_RELEASES_LOCK_SECONDS', 900),
    ],

    'shards' => [
        'enabled' => (bool) env('SITEMAPS_SHARDS_ENABLED', true),
        'zero_pad_length' => (int) env('SITEMAPS_SHARD_ZERO_PAD_LENGTH', 4),
        'force_family_indexes' => (bool) env('SITEMAPS_SHARD_FORCE_FAMILY_INDEXES', false),
        'artworks' => [
            'size' => (int) env('SITEMAPS_SHARD_ARTWORKS_SIZE', 10000),
        ],
        'users' => [
            'size' => (int) env('SITEMAPS_SHARD_USERS_SIZE', 10000),
        ],
        'cards' => [
            'size' => (int) env('SITEMAPS_SHARD_CARDS_SIZE', 10000),
        ],
        'stories' => [
            'size' => (int) env('SITEMAPS_SHARD_STORIES_SIZE', 10000),
        ],
        'news' => [
            'size' => (int) env('SITEMAPS_SHARD_NEWS_SIZE', 0),
        ],
        'forum-threads' => [
            'size' => (int) env('SITEMAPS_SHARD_FORUM_THREADS_SIZE', 10000),
        ],
        'collections' => [
            'size' => (int) env('SITEMAPS_SHARD_COLLECTIONS_SIZE', 10000),
        ],
    ],

    'validation' => [
        'forbidden_paths' => [
            '/admin',
            '/cp',
            '/dashboard',
            '/studio',
            '/account',
            '/login',
            '/register',
            '/creator/',
        ],
    ],

    'news' => [
        'google_variant_enabled' => (bool) env('SITEMAPS_NEWS_GOOGLE_VARIANT', true),
        'google_variant_name' => 'news-google',
        'google_publication_name' => env('SITEMAPS_NEWS_GOOGLE_PUBLICATION', env('APP_NAME', 'Skinbase Nova')),
        'google_language' => env('SITEMAPS_NEWS_GOOGLE_LANGUAGE', env('APP_LOCALE', 'en')),
        'google_lookback_hours' => (int) env('SITEMAPS_NEWS_GOOGLE_LOOKBACK_HOURS', 48),
        'google_max_items' => (int) env('SITEMAPS_NEWS_GOOGLE_MAX_ITEMS', 1000),
    ],

    'enabled' => [
        'artworks',
        'users',
        'tags',
        'categories',
        'collections',
        'cards',
        'stories',
        'news',
        'news-google',
        'forum-index',
        'forum-categories',
        'forum-threads',
        'static-pages',
    ],

    'content_type_slugs' => [
        'photography',
        'wallpapers',
        'skins',
        'other',
        'digital-art',
    ],

    'static_page_excluded_slugs' => [
        'about',
        'help',
        'contact',
        'legal-terms',
        'legal-privacy',
        'legal-cookies',
    ],
];