<?php
/**
 * @package   Essentials YOOtheme Pro 2.2.16 build 0813.1608
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Auth;

use ZOOlanders\YOOessentials\UpdateTransform;
use ZOOlanders\YOOessentials\Config\ConfigUpdater;

return [

    'routes' => [
        ['post', AuthController::GENERATE_ID_ENDPOINT, AuthController::class . '@generateId'],
        ['post', AuthController::POLL_ENDPOINT, AuthController::class . '@poll'],
    ],

    'events' => [
        'customizer.init' => [
            Listener\LoadCustomizerData::class => ['@handle', -10],
            Listener\LoadAuths::class => ['@handle', -10],
        ],

        'yooessentials.config.save' => [
            Listener\SaveAuths::class => ['@handle'],
        ],
    ],

    'services' => [
        AuthManager::class => '',
    ],

    'loaders' => [
        'yooessentials-auth-drivers' => new AuthDriverLoader(),
    ],

    'extend' => [
        ConfigUpdater::class => function (ConfigUpdater $updater) {
            $updater->addGlobals(require __DIR__ . '/updates.php');
        },

        UpdateTransform::class => function (UpdateTransform $update) {
            $update->addGlobals(require __DIR__ . '/updates.php');
        },
    ],

    'yooessentials-bootstrap' => [
        __DIR__ . '/drivers/ApiKey/bootstrap.php',
        __DIR__ . '/drivers/Facebook/bootstrap.php',
        __DIR__ . '/drivers/Google/bootstrap.php',
        __DIR__ . '/drivers/Instagram/bootstrap.php',
        __DIR__ . '/drivers/TikTok/bootstrap.php',
        __DIR__ . '/drivers/Twitter/bootstrap.php',
        __DIR__ . '/drivers/Cloudflare/bootstrap.php',
        __DIR__ . '/drivers/Aws/bootstrap.php',
        __DIR__ . '/drivers/Vimeo/bootstrap.php',
        __DIR__ . '/drivers/Database/bootstrap.php',
        __DIR__ . '/drivers/Mailchimp/bootstrap.php',
        __DIR__ . '/drivers/Airtable/bootstrap.php',
    ],
];
