<?php
use App\Controllers\{ApiController, AuthController, CategoryController, CommentController, CommunityController, CookieController, DownloadController, EarningController, FriendController, HomeController, LanguageController, MessageController, ModController, MusicController, PackageController, PageController, PaymentController, ProfileController, SecurityBotController, StoryController, StudioController, SubscriptionController, WithdrawalController, ZPanelController};

$router->get('main', '/', [HomeController::class, 'index']);
$router->get('main', '/mod/{slug}', [ModController::class, 'show']);
$router->get('main', '/{lang}/mod/{slug}', [ModController::class, 'showLocalized']);
$router->get('main', '/kategori/{slug}', [CategoryController::class, 'show']);
$router->get('main', '/arama', [ModController::class, 'search']);
$router->get('main', '/kullanici/{nickname}', [ProfileController::class, 'show']);
$router->get('main', '/sayfa/{slug}', [PageController::class, 'show']);
$router->get('main', '/{lang}/sayfa/{slug}', [PageController::class, 'showLocalized']);
$router->get('main', '/{lang}/page/{slug}', [PageController::class, 'showLocalized']);
$router->get('main', '/giris-yap', [AuthController::class, 'login']);
$router->post('main', '/giris-yap', [AuthController::class, 'loginPost']);
$router->get('main', '/kayit', [AuthController::class, 'register']);
$router->post('main', '/kayit', [AuthController::class, 'registerPost']);
$router->get('main', '/sifremi-unuttum', [AuthController::class, 'forgot']);
$router->post('main', '/sifremi-unuttum', [AuthController::class, 'forgotPost']);
$router->get('main', '/sifre-sifirla', [AuthController::class, 'reset']);
$router->post('main', '/sifre-sifirla', [AuthController::class, 'resetPost']);
$router->get('main', '/cikis', [AuthController::class, 'logout']);
$router->get('main', '/odeme', [PaymentController::class, 'checkout']);
$router->get('main', '/checkout', [PaymentController::class, 'checkout']);
$router->get('main', '/checkout/{package_id}', [PaymentController::class, 'checkout']);
$router->get('main', '/payment/success/{order_no}', [PaymentController::class, 'success']);
$router->get('main', '/payment/failed/{order_no}', [PaymentController::class, 'failed']);
$router->get('main', '/payment/pending/{order_no}', [PaymentController::class, 'pending']);
$router->get('main', '/download/{id}', [DownloadController::class, 'download']);

$router->get('music', '/', [MusicController::class, 'index']);
$router->get('music', '/sarki/{slug}', [MusicController::class, 'show']);
$router->get('music', '/tarz/{slug}', [MusicController::class, 'genre']);
$router->get('music', '/arama', [MusicController::class, 'search']);
$router->get('music', '/sanatci/{slug}', [MusicController::class, 'artist']);

$router->get('studio', '/', [StudioController::class, 'dashboard']);
foreach (['modlarim', 'mod-yukle', 'mod-duzenle/{id}', 'muziklerim', 'muzik-yukle', 'muzik-duzenle/{id}', 'artist', 'artist/basvuru', 'profilim', 'arkadaslar', 'mesajlar', 'abonelikler', 'kazanclarim', 'para-cek', 'bilgilerim', 'ayarlar'] as $path) {
    $router->any('studio', '/' . $path, [StudioController::class, 'section']);
}

$router->get('zpanel', '/', [ZPanelController::class, 'dashboard']);
foreach (['kullanicilar', 'modlar', 'muzikler', 'community', 'artist-basvurulari', 'muzik-telif', 'kategoriler', 'mod-kategorileri', 'muzik-turleri', 'abonelikler', 'odemeler', 'sanal-pos', 'payment-providers', 'kazanclar', 'para-cekme-talepleri', 'site-banka-hesaplari', 'finans-ayarlari', 'sayfalar', 'sayfa-ekle', 'sayfa-duzenle/{id}', 'guvenlik-botu', 'link-denetimi', 'yasakli-kelimeler', 'domain-listeleri', 'bildirimler', 'ayarlar', 'settings', 'media', 'dosya-yoneticisi', 'yorumlar', 'mesaj-raporlari', 'sosyal-kayitlar', 'raporlar', 'loglar', 'test-araclari'] as $path) {
    $router->any('zpanel', '/' . $path, [ZPanelController::class, 'section']);
}

$router->get('api', '/api/search', [ApiController::class, 'search']);
$router->get('api', '/api/notifications/list', [ApiController::class, 'notificationsList']);
$router->post('api', '/api/notifications/read', [ApiController::class, 'notificationRead']);
$router->post('api', '/api/notifications/read-all', [ApiController::class, 'notificationsReadAll']);
$router->post('api', '/api/notifications/clear', [ApiController::class, 'notificationsClear']);
$router->get('api', '/api/music/search', [MusicController::class, 'searchApi']);
$router->get('api', '/api/music/queue', [MusicController::class, 'queueApi']);
$router->get('api', '/api/music/recommendations', [MusicController::class, 'recommendationsApi']);
$router->post('api', '/api/music/search', [MusicController::class, 'searchApi']);
$router->post('api', '/api/music/play', [MusicController::class, 'playApi']);
$router->post('api', '/api/music/like', [MusicController::class, 'likeApi']);
$router->post('api', '/api/music/share-track', [MusicController::class, 'shareTrackApi']);
$router->post('api', '/api/language/set', [LanguageController::class, 'set']);
$router->post('api', '/api/cookie-consent/save', [CookieController::class, 'save']);
$router->post('api', '/api/cookies/save', [CookieController::class, 'save']);
$router->post('api', '/api/payment/create-session', [PaymentController::class, 'createSession']);
$router->post('api', '/api/payment/callback/{provider}', [PaymentController::class, 'callback']);
$router->get('api', '/api/payment/status/{order_no}', [PaymentController::class, 'status']);
$router->get('api', '/api/zpanel/users/list', [ZPanelController::class, 'usersList']);
$router->post('api', '/api/zpanel/users/update-role', [ZPanelController::class, 'updateUserRole']);
$router->post('api', '/api/zpanel/users/update-status', [ZPanelController::class, 'updateUserStatus']);
$router->get('api', '/api/zpanel/mods/list', [ZPanelController::class, 'modsList']);
$router->post('api', '/api/zpanel/mod/approve', [ZPanelController::class, 'approveMod']);
$router->post('api', '/api/zpanel/mod/reject', [ZPanelController::class, 'rejectMod']);
$router->post('api', '/api/zpanel/mod/unpublish', [ZPanelController::class, 'unpublishMod']);
$router->post('api', '/api/zpanel/mod/delete', [ZPanelController::class, 'deleteMod']);
$router->post('api', '/api/zpanel/mod/feature', [ZPanelController::class, 'featureMod']);
$router->post('api', '/api/zpanel/mod/unfeature', [ZPanelController::class, 'unfeatureMod']);
$router->get('api', '/api/zpanel/music/list', [ZPanelController::class, 'musicList']);
$router->post('api', '/api/zpanel/music/approve', [ZPanelController::class, 'approveMusic']);
$router->post('api', '/api/zpanel/music/reject', [ZPanelController::class, 'rejectMusic']);
$router->post('api', '/api/zpanel/music/unpublish', [ZPanelController::class, 'unpublishMusic']);
$router->post('api', '/api/zpanel/music/delete', [ZPanelController::class, 'deleteMusic']);
$router->post('api', '/api/zpanel/music/feature', [ZPanelController::class, 'featureMusic']);
$router->post('api', '/api/zpanel/music/unfeature', [ZPanelController::class, 'unfeatureMusic']);
$router->post('api', '/api/zpanel/music/copyright-review', [ZPanelController::class, 'reviewMusic']);
$router->get('api', '/api/zpanel/media/list', [ZPanelController::class, 'mediaList']);
$router->post('api', '/api/zpanel/media/upload', [ZPanelController::class, 'uploadMedia']);
$router->post('api', '/api/zpanel/media/delete', [ZPanelController::class, 'deleteMedia']);
$router->post('api', '/api/zpanel/media/set-logo', [ZPanelController::class, 'setLogoMedia']);
$router->post('api', '/api/zpanel/media/set-favicon', [ZPanelController::class, 'setFaviconMedia']);
$router->post('api', '/api/zpanel/artists/approve', [ZPanelController::class, 'approveArtist']);
$router->post('api', '/api/zpanel/artists/reject', [ZPanelController::class, 'rejectArtist']);
$router->post('api', '/api/zpanel/copyright/approve', [ZPanelController::class, 'approveCopyright']);
$router->post('api', '/api/zpanel/copyright/reject', [ZPanelController::class, 'rejectCopyright']);
$router->post('api', '/api/zpanel/copyright/block', [ZPanelController::class, 'blockCopyright']);
$router->post('api', '/api/zpanel/categories/create', [ZPanelController::class, 'createCategory']);
$router->post('api', '/api/zpanel/categories/update', [ZPanelController::class, 'updateCategory']);
$router->post('api', '/api/zpanel/categories/delete', [ZPanelController::class, 'deleteCategory']);
$router->post('api', '/api/zpanel/pages/create', [ZPanelController::class, 'createPage']);
$router->post('api', '/api/zpanel/pages/update', [ZPanelController::class, 'updatePage']);
$router->post('api', '/api/zpanel/pages/trash', [ZPanelController::class, 'trashPage']);
$router->post('api', '/api/zpanel/pages/delete', [ZPanelController::class, 'deletePage']);
$router->post('api', '/api/zpanel/pages/publish', [ZPanelController::class, 'publishPage']);
$router->post('api', '/api/zpanel/pages/hide', [ZPanelController::class, 'hidePage']);
$router->post('api', '/api/zpanel/pages/restore', [ZPanelController::class, 'restorePage']);
$router->get('api', '/api/zpanel/comments/list', [ZPanelController::class, 'commentsList']);
$router->post('api', '/api/zpanel/comments/approve', [ZPanelController::class, 'approveComment']);
$router->post('api', '/api/zpanel/comments/block', [ZPanelController::class, 'blockComment']);
$router->post('api', '/api/zpanel/comments/delete', [ZPanelController::class, 'deleteComment']);
$router->post('api', '/api/zpanel/notifications/send', [ZPanelController::class, 'sendNotification']);
$router->post('api', '/api/zpanel/settings/update', [ZPanelController::class, 'updateSettings']);
$router->get('api', '/api/zpanel/admin-logs/list', [ZPanelController::class, 'adminLogsList']);
$router->post('api', '/api/zpanel/payment-providers/update', [ZPanelController::class, 'updatePaymentProviders']);
$router->post('api', '/api/zpanel/test-tools/run', [ZPanelController::class, 'runTestTool']);
$router->post('api', '/api/studio/mod/create', [StudioController::class, 'createMod']);
$router->post('api', '/api/studio/mod/update', [StudioController::class, 'updateMod']);
$router->post('api', '/api/studio/mod/delete', [StudioController::class, 'deleteModRequest']);
$router->post('api', '/api/studio/music/create', [StudioController::class, 'createMusic']);
$router->post('api', '/api/studio/music/update', [StudioController::class, 'updateMusic']);
$router->post('api', '/api/studio/music/delete', [StudioController::class, 'deleteMusicRequest']);
$router->post('api', '/api/studio/profile/update', [StudioController::class, 'updateProfile']);
$router->post('api', '/api/studio/profile/avatar', [StudioController::class, 'uploadProfileAvatar']);
$router->post('api', '/api/studio/profile/cover', [StudioController::class, 'uploadProfileCover']);
$router->post('api', '/api/studio/artist/apply', [StudioController::class, 'saveArtistApplication']);
$router->post('api', '/api/studio/account/password', [StudioController::class, 'changePassword']);
$router->post('api', '/api/studio/account/email', [StudioController::class, 'changeEmail']);
$router->post('api', '/api/studio/account/delete-request', [StudioController::class, 'requestAccountDeletion']);
$router->post('api', '/api/studio/upload/image', [ApiController::class, 'uploadImage']);
$router->post('api', '/api/studio/upload/audio', [ApiController::class, 'uploadAudio']);
$router->post('api', '/api/studio/ai/tags', [ApiController::class, 'suggestTags']);
$router->post('api', '/api/studio/ai/content-suggestions', [ApiController::class, 'contentSuggestions']);
$router->post('api', '/api/studio/mods/save', [StudioController::class, 'saveMod']);
$router->post('api', '/api/studio/mods/{id}/save', [StudioController::class, 'saveMod']);
$router->post('api', '/api/studio/mods/{id}/delete', [StudioController::class, 'deleteMod']);
$router->post('api', '/api/studio/music/save', [StudioController::class, 'saveMusic']);
$router->post('api', '/api/studio/music/{id}/save', [StudioController::class, 'saveMusic']);
$router->post('api', '/api/studio/music/{id}/delete', [StudioController::class, 'deleteMusic']);
$router->post('api', '/api/mods/{id}/view', [ModController::class, 'recordViewApi']);
$router->post('api', '/api/mods/{id}/reaction', [ModController::class, 'reaction']);
$router->post('api', '/api/mods/{id}/download', [DownloadController::class, 'apiDownload']);
$router->post('api', '/api/comments/create', [CommentController::class, 'create']);
$router->get('api', '/api/comments/list', [CommentController::class, 'listComments']);
$router->post('api', '/api/comments/update', [CommentController::class, 'update']);
$router->post('api', '/api/comments/delete', [CommentController::class, 'delete']);
$router->post('api', '/api/comments/reply', [CommentController::class, 'reply']);
$router->post('api', '/api/comments/like', [CommentController::class, 'like']);
$router->post('api', '/api/community/create', [CommunityController::class, 'create']);
$router->post('api', '/api/community/delete', [CommunityController::class, 'delete']);
$router->post('api', '/api/community/react', [CommunityController::class, 'react']);
$router->post('api', '/api/community/comment', [CommunityController::class, 'comment']);
$router->post('api', '/api/community/poll-vote', [CommunityController::class, 'pollVote']);
$router->post('api', '/api/stories/create', [StoryController::class, 'create']);
$router->post('api', '/api/stories/delete', [StoryController::class, 'delete']);
$router->get('api', '/api/stories/list', [StoryController::class, 'list']);
$router->post('api', '/api/stories/view', [StoryController::class, 'viewStory']);
$router->get('api', '/api/zpanel/community/list', [CommunityController::class, 'zpanelList']);
$router->post('api', '/api/zpanel/community/approve', [CommunityController::class, 'zpanelApprove']);
$router->post('api', '/api/zpanel/community/block', [CommunityController::class, 'zpanelBlock']);
$router->post('api', '/api/zpanel/community/delete', [CommunityController::class, 'zpanelDelete']);
$router->post('api', '/api/friends/request', [FriendController::class, 'request']);
$router->post('api', '/api/friends/accept', [FriendController::class, 'accept']);
$router->post('api', '/api/friends/reject', [FriendController::class, 'reject']);
$router->post('api', '/api/friends/remove', [FriendController::class, 'remove']);
$router->post('api', '/api/friends/block', [FriendController::class, 'block']);
$router->post('api', '/api/friends/unblock', [FriendController::class, 'unblock']);
$router->get('api', '/api/friends/search', [FriendController::class, 'search']);
$router->get('api', '/api/friends/list', [FriendController::class, 'list']);
$router->post('api', '/api/profile/follow', [ProfileController::class, 'follow']);
$router->post('api', '/api/profile/unfollow', [ProfileController::class, 'unfollow']);
$router->get('api', '/api/profile/{nickname}/stats', [ProfileController::class, 'stats']);
$router->get('api', '/api/messages/conversations', [MessageController::class, 'conversations']);
$router->get('api', '/api/messages/thread/{conversation_id}', [MessageController::class, 'thread']);
$router->post('api', '/api/messages/send', [MessageController::class, 'send']);
$router->post('api', '/api/messages/delete', [MessageController::class, 'delete']);
$router->post('api', '/api/messages/read', [MessageController::class, 'read']);
$router->post('api', '/api/messages/upload', [MessageController::class, 'upload']);
$router->get('api', '/api/messages/gifs', [MessageController::class, 'gifs']);
$router->post('api', '/api/security/scan-link', [SecurityBotController::class, 'scanLink']);
$router->post('api', '/api/moderation/scan-link', [SecurityBotController::class, 'scanLink']);
$router->get('api', '/api/zpanel/security/logs', [SecurityBotController::class, 'logs']);
$router->post('api', '/api/zpanel/security/settings', [SecurityBotController::class, 'settings']);
$router->post('api', '/api/zpanel/domain-whitelist/create', [SecurityBotController::class, 'createWhitelist']);
$router->post('api', '/api/zpanel/domain-whitelist/delete', [SecurityBotController::class, 'deleteWhitelist']);
$router->post('api', '/api/zpanel/domain-blacklist/create', [SecurityBotController::class, 'createBlacklist']);
$router->post('api', '/api/zpanel/domain-blacklist/delete', [SecurityBotController::class, 'deleteBlacklist']);
$router->post('api', '/api/zpanel/forbidden-words/create', [SecurityBotController::class, 'createForbiddenWord']);
$router->post('api', '/api/zpanel/forbidden-words/delete', [SecurityBotController::class, 'deleteForbiddenWord']);
$router->get('api', '/api/studio/earnings', [EarningController::class, 'summary']);
$router->post('api', '/api/studio/withdrawals/create', [WithdrawalController::class, 'create']);
$router->post('api', '/api/studio/withdrawals/cancel', [WithdrawalController::class, 'cancel']);
$router->post('api', '/api/studio/bank-accounts/create', [WithdrawalController::class, 'createBankAccount']);
$router->post('api', '/api/studio/bank-accounts/update', [WithdrawalController::class, 'updateBankAccount']);
$router->post('api', '/api/studio/bank-accounts/delete', [WithdrawalController::class, 'deleteBankAccount']);
$router->get('api', '/api/zpanel/withdrawals/list', [WithdrawalController::class, 'zpanelList']);
$router->post('api', '/api/zpanel/withdrawals/approve', [WithdrawalController::class, 'approve']);
$router->post('api', '/api/zpanel/withdrawals/processing', [WithdrawalController::class, 'processing']);
$router->post('api', '/api/zpanel/withdrawals/mark-sent', [WithdrawalController::class, 'markSent']);
$router->post('api', '/api/zpanel/withdrawals/reject', [WithdrawalController::class, 'reject']);
$router->post('api', '/api/zpanel/site-bank-accounts/create', [WithdrawalController::class, 'createSiteBankAccount']);
$router->post('api', '/api/zpanel/site-bank-accounts/update', [WithdrawalController::class, 'updateSiteBankAccount']);
$router->post('api', '/api/zpanel/site-bank-accounts/delete', [WithdrawalController::class, 'deleteSiteBankAccount']);
$router->post('api', '/api/zpanel/financial-settings/update', [WithdrawalController::class, 'updateFinancialSettings']);
$router->get('api', '/api/zpanel/earnings/summary', [EarningController::class, 'zpanelSummary']);
$router->get('api', '/api/zpanel/ledger/list', [EarningController::class, 'zpanelLedger']);
$router->post('api', '/api/studio/package/create', [PackageController::class, 'create']);
$router->post('api', '/api/studio/package/update', [PackageController::class, 'update']);
$router->post('api', '/api/studio/package/toggle', [PackageController::class, 'toggle']);
$router->post('api', '/api/studio/package/delete', [PackageController::class, 'delete']);
$router->get('api', '/api/studio/packages', [PackageController::class, 'studioPackages']);
$router->get('api', '/api/studio/subscribers', [SubscriptionController::class, 'subscribers']);
$router->get('api', '/api/studio/my-subscriptions', [SubscriptionController::class, 'mySubscriptions']);
$router->get('api', '/api/creator/{user_id}/packages', [PackageController::class, 'creatorPackages']);
$router->post('api', '/api/subscription/preview', [SubscriptionController::class, 'preview']);

$router->get('main', '/{lang}', [HomeController::class, 'localized']);
$router->fallback([HomeController::class, 'notFound']);
