Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
chore: first commit
Paulo Castellano7c80d717b111
diff --git a/CLAUDE.md b/CLAUDE.mdindex 1c9bf2a5e..f583ed4d0 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -15,6 +15,7 @@ This application is a Laravel application and its main Laravel ecosystems packag- laravel/framework (LARAVEL) - v12- laravel/horizon (HORIZON) - v5- laravel/prompts (PROMPTS) - v0+- laravel/reverb (REVERB) - v1- laravel/socialite (SOCIALITE) - v5- laravel/wayfinder (WAYFINDER) - v0- laravel/mcp (MCP) - v0diff --git a/GEMINI.md b/GEMINI.mdindex 1c9bf2a5e..f583ed4d0 100644--- a/GEMINI.md+++ b/GEMINI.md@@ -15,6 +15,7 @@ This application is a Laravel application and its main Laravel ecosystems packag- laravel/framework (LARAVEL) - v12- laravel/horizon (HORIZON) - v5- laravel/prompts (PROMPTS) - v0+- laravel/reverb (REVERB) - v1- laravel/socialite (SOCIALITE) - v5- laravel/wayfinder (WAYFINDER) - v0- laravel/mcp (MCP) - v0diff --git a/app/Enums/InviteStatus.php b/app/Enums/InviteStatus.phpindex a27d3af8a..aa9cacd59 100644--- a/app/Enums/InviteStatus.php+++ b/app/Enums/InviteStatus.php@@ -12,10 +12,10 @@ enum InviteStatus: stringpublic function label(): string{return match ($this) {- self::Pending => 'Pendente',- self::Accepted => 'Aceito',- self::Expired => 'Expirado',- self::Cancelled => 'Cancelado',+ self::Pending => 'Pending',+ self::Accepted => 'Accepted',+ self::Expired => 'Expired',+ self::Cancelled => 'Cancelled',};}diff --git a/app/Enums/PostStatus.php b/app/Enums/PostStatus.phpindex 238cb3694..96148ff40 100644--- a/app/Enums/PostStatus.php+++ b/app/Enums/PostStatus.php@@ -8,6 +8,7 @@ enum PostStatus: stringcase Scheduled = 'scheduled';case Publishing = 'publishing';case Published = 'published';+ case PartiallyPublished = 'partially_published';case Failed = 'failed';public function label(): string@@ -17,6 +18,7 @@ enum PostStatus: stringself::Scheduled => 'Agendado',self::Publishing => 'Publicando',self::Published => 'Publicado',+ self::PartiallyPublished => 'Parcialmente Publicado',self::Failed => 'Falhou',};}@@ -28,6 +30,7 @@ enum PostStatus: stringself::Scheduled => 'blue',self::Publishing => 'yellow',self::Published => 'green',+ self::PartiallyPublished => 'orange',self::Failed => 'red',};}diff --git a/app/Enums/SocialPlatform.php b/app/Enums/SocialPlatform.phpindex 4f2a47ab2..5d7be70d9 100644--- a/app/Enums/SocialPlatform.php+++ b/app/Enums/SocialPlatform.php@@ -8,6 +8,10 @@ enum SocialPlatform: stringcase LinkedInPage = 'linkedin-page';case X = 'x';case TikTok = 'tiktok';+ case YouTube = 'youtube';+ case Facebook = 'facebook';+ case Instagram = 'instagram';+ case Threads = 'threads';public function label(): string{@@ -16,6 +20,10 @@ enum SocialPlatform: stringself::LinkedInPage => 'LinkedIn Page',self::X => 'X',self::TikTok => 'TikTok',+ self::YouTube => 'YouTube Shorts',+ self::Facebook => 'Facebook Page',+ self::Instagram => 'Instagram',+ self::Threads => 'Threads',};}@@ -25,6 +33,10 @@ enum SocialPlatform: stringself::LinkedIn, self::LinkedInPage => '#0A66C2',self::X => '#000000',self::TikTok => '#000000',+ self::YouTube => '#FF0000',+ self::Facebook => '#1877F2',+ self::Instagram => '#E4405F',+ self::Threads => '#000000',};}@@ -34,6 +46,10 @@ enum SocialPlatform: stringself::LinkedIn, self::LinkedInPage => [MediaType::Image, MediaType::Video, MediaType::Document],self::X => [MediaType::Image, MediaType::Video],self::TikTok => [MediaType::Video],+ self::YouTube => [MediaType::Video],+ self::Facebook => [MediaType::Image, MediaType::Video],+ self::Instagram => [MediaType::Image, MediaType::Video],+ self::Threads => [MediaType::Image, MediaType::Video],};}@@ -43,6 +59,10 @@ enum SocialPlatform: stringself::LinkedIn, self::LinkedInPage => 1,self::X => 4,self::TikTok => 0,+ self::YouTube => 0,+ self::Facebook => 10,+ self::Instagram => 10,+ self::Threads => 10,};}@@ -52,6 +72,10 @@ enum SocialPlatform: stringself::LinkedIn, self::LinkedInPage => 3000,self::X => 280,self::TikTok => 2200,+ self::YouTube => 5000,+ self::Facebook => 63206,+ self::Instagram => 2200,+ self::Threads => 500,};}@@ -61,6 +85,10 @@ enum SocialPlatform: stringself::LinkedIn, self::LinkedInPage => true,self::X => true,self::TikTok => false,+ self::YouTube => false,+ self::Facebook => true,+ self::Instagram => false,+ self::Threads => true,};}}diff --git a/app/Enums/WorkspaceRole.php b/app/Enums/WorkspaceRole.phpindex 6f2b87fc9..dd71fe24e 100644--- a/app/Enums/WorkspaceRole.php+++ b/app/Enums/WorkspaceRole.php@@ -5,13 +5,31 @@ namespace App\Enums;enum WorkspaceRole: string{case Owner = 'owner';+ case Admin = 'admin';case Member = 'member';public function label(): string{return match ($this) {- self::Owner => 'Proprietário',- self::Member => 'Membro',+ self::Owner => 'Owner',+ self::Admin => 'Admin',+ self::Member => 'Member',+ };+ }++ public function canManageTeam(): bool+ {+ return match ($this) {+ self::Owner, self::Admin => true,+ self::Member => false,+ };+ }++ public function canManageAccounts(): bool+ {+ return match ($this) {+ self::Owner, self::Admin => true,+ self::Member => false,};}}diff --git a/app/Http/Controllers/Auth/FacebookController.php b/app/Http/Controllers/Auth/FacebookController.phpnew file mode 100644index 000000000..6c9c3c518--- /dev/null+++ b/app/Http/Controllers/Auth/FacebookController.php@@ -0,0 +1,246 @@+<?php++namespace App\Http\Controllers\Auth;++use App\Enums\SocialPlatform;+use App\Models\Workspace;+use Illuminate\Http\RedirectResponse;+use Illuminate\Http\Request;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;+use Inertia\Inertia;+use Laravel\Socialite\Facades\Socialite;+use Symfony\Component\HttpFoundation\Response;++class FacebookController extends SocialController+{+ protected string $driver = 'facebook';++ protected SocialPlatform $platform = SocialPlatform::Facebook;++ protected array $scopes = [+ 'pages_show_list',+ 'pages_read_engagement',+ 'pages_manage_posts',+ 'pages_read_user_content',+ ];++ public function connect(Request $request, Workspace $workspace): Response+ {+ $this->authorize('manageAccounts', $workspace);++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return back()->with('error', 'This platform is already connected.');+ }++ session(['social_connect_workspace' => $workspace->id]);++ return Inertia::location(+ Socialite::driver($this->driver)+ ->scopes($this->scopes)+ ->redirect()+ ->getTargetUrl()+ );+ }++ public function callback(Request $request): RedirectResponse+ {+ $workspaceId = session('social_connect_workspace');++ if (! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'This platform is already connected.');+ }++ try {+ $socialUser = Socialite::driver($this->driver)->user();++ // Fetch pages the user manages+ $pages = $this->fetchPages($socialUser->token);++ if (empty($pages)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'No Facebook Pages found. You need to be an admin of at least one page.');+ }++ // If only one page, connect directly+ if (count($pages) === 1) {+ $page = $pages[0];+ $avatarPath = uploadFromUrl($page['picture']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $page['id'],+ 'username' => $page['username'] ?? null,+ 'display_name' => $page['name'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $page['access_token'],+ 'refresh_token' => null, // Page tokens don't expire if user token is long-lived+ 'token_expires_at' => null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'page_id' => $page['id'],+ 'user_id' => $socialUser->getId(),+ 'user_token' => $socialUser->token,+ ],+ ]);++ session()->forget('social_connect_workspace');++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'Facebook Page connected successfully!');+ }++ // Multiple pages - store data and show selection+ session([+ 'facebook_oauth' => [+ 'user_token' => $socialUser->token,+ 'user_id' => $socialUser->getId(),+ 'pages' => $pages,+ ],+ ]);++ return redirect()->route('social.facebook.select-page');+ } catch (\Exception $e) {+ Log::error('Facebook OAuth Error', [+ 'error' => $e->getMessage(),+ 'trace' => $e->getTraceAsString(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting account. Please try again.');+ }+ }++ public function selectPage(Request $request)+ {+ $oauthData = session('facebook_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ return Inertia::render('accounts/FacebookPageSelect', [+ 'workspace' => $workspace,+ 'pages' => $oauthData['pages'],+ ]);+ }++ public function select(Request $request): RedirectResponse+ {+ $request->validate([+ 'page_id' => 'required|string',+ ]);++ $oauthData = session('facebook_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ try {+ $selectedPage = collect($oauthData['pages'])->firstWhere('id', $request->page_id);++ if (! $selectedPage) {+ return redirect()->route('social.facebook.select-page')+ ->with('error', 'Page not found.');+ }++ $avatarPath = uploadFromUrl($selectedPage['picture']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $selectedPage['id'],+ 'username' => $selectedPage['username'] ?? null,+ 'display_name' => $selectedPage['name'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $selectedPage['access_token'],+ 'refresh_token' => null,+ 'token_expires_at' => null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'page_id' => $selectedPage['id'],+ 'user_id' => $oauthData['user_id'],+ 'user_token' => $oauthData['user_token'],+ ],+ ]);++ session()->forget(['facebook_oauth', 'social_connect_workspace']);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'Facebook Page connected successfully!');+ } catch (\Exception $e) {+ Log::error('Facebook page selection error', [+ 'error' => $e->getMessage(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting page. Please try again.');+ }+ }++ private function fetchPages(string $userToken): array+ {+ try {+ $response = Http::get('https://graph.facebook.com/v21.0/me/accounts', [+ 'access_token' => $userToken,+ 'fields' => 'id,name,username,picture{url},access_token',+ ]);++ if ($response->failed()) {+ Log::error('Facebook pages fetch failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);++ return [];+ }++ $data = $response->json();++ return collect($data['data'] ?? [])->map(fn ($page) => [+ 'id' => $page['id'],+ 'name' => $page['name'],+ 'username' => $page['username'] ?? null,+ 'picture' => $page['picture']['data']['url'] ?? null,+ 'access_token' => $page['access_token'],+ ])->toArray();+ } catch (\Exception $e) {+ Log::error('Facebook pages fetch error', [+ 'error' => $e->getMessage(),+ ]);++ return [];+ }+ }+}diff --git a/app/Http/Controllers/Auth/InstagramController.php b/app/Http/Controllers/Auth/InstagramController.phpnew file mode 100644index 000000000..2c284df89--- /dev/null+++ b/app/Http/Controllers/Auth/InstagramController.php@@ -0,0 +1,260 @@+<?php++namespace App\Http\Controllers\Auth;++use App\Enums\SocialPlatform;+use App\Models\Workspace;+use Illuminate\Http\RedirectResponse;+use Illuminate\Http\Request;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;+use Inertia\Inertia;+use Laravel\Socialite\Facades\Socialite;+use Symfony\Component\HttpFoundation\Response;++class InstagramController extends SocialController+{+ protected string $driver = 'facebook';++ protected SocialPlatform $platform = SocialPlatform::Instagram;++ protected array $scopes = [+ 'instagram_basic',+ 'instagram_content_publish',+ 'pages_show_list',+ 'pages_read_engagement',+ ];++ public function connect(Request $request, Workspace $workspace): Response+ {+ $this->authorize('manageAccounts', $workspace);++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return back()->with('error', 'This platform is already connected.');+ }++ session(['social_connect_workspace' => $workspace->id]);++ return Inertia::location(+ Socialite::driver($this->driver)+ ->scopes($this->scopes)+ ->redirect()+ ->getTargetUrl()+ );+ }++ public function callback(Request $request): RedirectResponse+ {+ $workspaceId = session('social_connect_workspace');++ if (! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'This platform is already connected.');+ }++ try {+ $socialUser = Socialite::driver($this->driver)->user();++ // Fetch Instagram accounts linked to Facebook pages+ $accounts = $this->fetchInstagramAccounts($socialUser->token);++ if (empty($accounts)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'No Instagram Business accounts found. Make sure your Instagram is connected to a Facebook Page.');+ }++ // If only one account, connect directly+ if (count($accounts) === 1) {+ $account = $accounts[0];+ $avatarPath = uploadFromUrl($account['profile_picture_url']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $account['id'],+ 'username' => $account['username'],+ 'display_name' => $account['name'] ?? $account['username'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $account['page_access_token'],+ 'refresh_token' => null,+ 'token_expires_at' => null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'instagram_id' => $account['id'],+ 'page_id' => $account['page_id'],+ 'user_id' => $socialUser->getId(),+ 'user_token' => $socialUser->token,+ ],+ ]);++ session()->forget('social_connect_workspace');++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'Instagram account connected successfully!');+ }++ // Multiple accounts - store data and show selection+ session([+ 'instagram_oauth' => [+ 'user_token' => $socialUser->token,+ 'user_id' => $socialUser->getId(),+ 'accounts' => $accounts,+ ],+ ]);++ return redirect()->route('social.instagram.select-account');+ } catch (\Exception $e) {+ Log::error('Instagram OAuth Error', [+ 'error' => $e->getMessage(),+ 'trace' => $e->getTraceAsString(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting account. Please try again.');+ }+ }++ public function selectAccount(Request $request)+ {+ $oauthData = session('instagram_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ return Inertia::render('accounts/InstagramAccountSelect', [+ 'workspace' => $workspace,+ 'accounts' => $oauthData['accounts'],+ ]);+ }++ public function select(Request $request): RedirectResponse+ {+ $request->validate([+ 'account_id' => 'required|string',+ ]);++ $oauthData = session('instagram_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ try {+ $selectedAccount = collect($oauthData['accounts'])->firstWhere('id', $request->account_id);++ if (! $selectedAccount) {+ return redirect()->route('social.instagram.select-account')+ ->with('error', 'Account not found.');+ }++ $avatarPath = uploadFromUrl($selectedAccount['profile_picture_url']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $selectedAccount['id'],+ 'username' => $selectedAccount['username'],+ 'display_name' => $selectedAccount['name'] ?? $selectedAccount['username'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $selectedAccount['page_access_token'],+ 'refresh_token' => null,+ 'token_expires_at' => null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'instagram_id' => $selectedAccount['id'],+ 'page_id' => $selectedAccount['page_id'],+ 'user_id' => $oauthData['user_id'],+ 'user_token' => $oauthData['user_token'],+ ],+ ]);++ session()->forget(['instagram_oauth', 'social_connect_workspace']);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'Instagram account connected successfully!');+ } catch (\Exception $e) {+ Log::error('Instagram account selection error', [+ 'error' => $e->getMessage(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting account. Please try again.');+ }+ }++ private function fetchInstagramAccounts(string $userToken): array+ {+ try {+ // First, get all pages with their Instagram business accounts+ $response = Http::get('https://graph.facebook.com/v21.0/me/accounts', [+ 'access_token' => $userToken,+ 'fields' => 'id,name,access_token,instagram_business_account{id,username,name,profile_picture_url,followers_count}',+ ]);++ if ($response->failed()) {+ Log::error('Instagram accounts fetch failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);++ return [];+ }++ $data = $response->json();+ $accounts = [];++ foreach ($data['data'] ?? [] as $page) {+ if (isset($page['instagram_business_account'])) {+ $ig = $page['instagram_business_account'];+ $accounts[] = [+ 'id' => $ig['id'],+ 'username' => $ig['username'],+ 'name' => $ig['name'] ?? $ig['username'],+ 'profile_picture_url' => $ig['profile_picture_url'] ?? null,+ 'followers_count' => $ig['followers_count'] ?? 0,+ 'page_id' => $page['id'],+ 'page_name' => $page['name'],+ 'page_access_token' => $page['access_token'],+ ];+ }+ }++ return $accounts;+ } catch (\Exception $e) {+ Log::error('Instagram accounts fetch error', [+ 'error' => $e->getMessage(),+ ]);++ return [];+ }+ }+}diff --git a/app/Http/Controllers/Auth/LinkedInController.php b/app/Http/Controllers/Auth/LinkedInController.phpindex 0e8b1096a..f8ddc2e3a 100644--- a/app/Http/Controllers/Auth/LinkedInController.php+++ b/app/Http/Controllers/Auth/LinkedInController.php@@ -27,10 +27,10 @@ class LinkedInController extends SocialControllerpublic function connect(Request $request, Workspace $workspace): Response{- $this->authorize('update', $workspace);+ $this->authorize('manageAccounts', $workspace);if ($workspace->hasConnectedPlatform($this->platform->value)) {- return back()->with('error', 'Esta plataforma já está conectada.');+ return back()->with('error', 'This platform is already connected.');}return $this->redirectToProvider($workspace, $this->driver, $this->scopes);@@ -42,19 +42,19 @@ class LinkedInController extends SocialControllerif (! $workspaceId) {return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ ->with('error', 'Session expired. Please try again.');}$workspace = Workspace::find($workspaceId);- if (! $workspace || ! $request->user()->can('update', $workspace)) {+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ ->with('error', 'Workspace not found.');}if ($workspace->hasConnectedPlatform($this->platform->value)) {return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Esta plataforma já está conectada.');+ ->with('error', 'This platform is already connected.');}try {@@ -86,14 +86,14 @@ class LinkedInController extends SocialControllersession()->forget('social_connect_workspace');return redirect()->route('workspaces.accounts', $workspace)- ->with('success', 'Conta conectada com sucesso!');+ ->with('success', 'Account connected successfully!');} catch (\Exception $e) {Log::error('LinkedIn OAuth Error', ['error' => $e->getMessage(),]);return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Erro ao conectar conta. Tente novamente.');+ ->with('error', 'Error connecting account. Please try again.');}}diff --git a/app/Http/Controllers/Auth/LinkedInPageController.php b/app/Http/Controllers/Auth/LinkedInPageController.phpindex bcf09e4a9..69f054d15 100644--- a/app/Http/Controllers/Auth/LinkedInPageController.php+++ b/app/Http/Controllers/Auth/LinkedInPageController.php@@ -31,10 +31,10 @@ class LinkedInPageController extends SocialControllerpublic function connect(Request $request, Workspace $workspace): SymfonyResponse{- $this->authorize('update', $workspace);+ $this->authorize('manageAccounts', $workspace);if ($workspace->hasConnectedPlatform($this->platform->value)) {- return back()->with('error', 'Esta plataforma já está conectada.');+ return back()->with('error', 'This platform is already connected.');}session(['social_connect_workspace' => $workspace->id]);@@ -56,14 +56,14 @@ class LinkedInPageController extends SocialControllerif (! $workspaceId) {return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ ->with('error', 'Session expired. Please try again.');}$workspace = Workspace::find($workspaceId);- if (! $workspace || ! $request->user()->can('update', $workspace)) {+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ ->with('error', 'Workspace not found.');}try {@@ -81,7 +81,7 @@ class LinkedInPageController extends SocialControllersession()->forget('social_connect_workspace');return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Você não é administrador de nenhuma página do LinkedIn.');+ ->with('error', 'You are not an administrator of any LinkedIn page.');}// Store data in session and redirect to selection page@@ -105,7 +105,7 @@ class LinkedInPageController extends SocialController]);return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Erro ao conectar conta. Tente novamente.');+ ->with('error', 'Error connecting account. Please try again.');}}@@ -115,14 +115,14 @@ class LinkedInPageController extends SocialControllerif (! $pendingData) {return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ ->with('error', 'Session expired. Please try again.');}$workspace = Workspace::find($pendingData['workspace_id']);- if (! $workspace || ! $request->user()->can('update', $workspace)) {+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ ->with('error', 'Workspace not found.');}return Inertia::render('accounts/LinkedInPageSelect', [@@ -144,14 +144,14 @@ class LinkedInPageController extends SocialControllerif (! $pendingData) {return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ ->with('error', 'Session expired. Please try again.');}$workspace = Workspace::find($pendingData['workspace_id']);- if (! $workspace || ! $request->user()->can('update', $workspace)) {+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ ->with('error', 'Workspace not found.');}try {@@ -176,14 +176,14 @@ class LinkedInPageController extends SocialControllersession()->forget(['social_connect_workspace', 'linkedin_page_pending']);return redirect()->route('workspaces.accounts', $workspace)- ->with('success', 'LinkedIn Page conectada com sucesso!');+ ->with('success', 'LinkedIn Page connected successfully!');} catch (\Exception $e) {Log::error('LinkedIn Page selection error', ['error' => $e->getMessage(),]);return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Erro ao conectar página. Tente novamente.');+ ->with('error', 'Error connecting page. Please try again.');}}diff --git a/app/Http/Controllers/Auth/SocialController.php b/app/Http/Controllers/Auth/SocialController.phpindex 4ddf9708f..cfc002cdc 100644--- a/app/Http/Controllers/Auth/SocialController.php+++ b/app/Http/Controllers/Auth/SocialController.php@@ -8,10 +8,7 @@ use App\Models\SocialAccount;use App\Models\Workspace;use Illuminate\Http\RedirectResponse;use Illuminate\Http\Request;-use Illuminate\Support\Facades\Http;use Illuminate\Support\Facades\Log;-use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;use Inertia\Inertia;use Inertia\Response;use Laravel\Socialite\Facades\Socialite;@@ -45,7 +42,7 @@ class SocialController extends Controllerpublic function disconnect(Workspace $workspace, SocialAccount $account): RedirectResponse{- $this->authorize('update', $workspace);+ $this->authorize('manageAccounts', $workspace);if ($account->workspace_id !== $workspace->id) {abort(403);@@ -53,7 +50,10 @@ class SocialController extends Controller$account->delete();- return back()->with('success', 'Conta desconectada com sucesso!');+ session()->flash('flash.banner', 'Account disconnected successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return back();}protected function redirectToProvider(Workspace $workspace, string $driver, array $scopes): SymfonyResponse@@ -76,20 +76,26 @@ class SocialController extends Controller$workspaceId = session('social_connect_workspace');if (! $workspaceId) {- return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ session()->flash('flash.banner', 'Session expired. Please try again.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.index');}$workspace = Workspace::find($workspaceId);- if (! $workspace || ! $request->user()->can('update', $workspace)) {- return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ session()->flash('flash.banner', 'Workspace not found.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.index');}if ($workspace->hasConnectedPlatform($platform->value)) {- return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Esta plataforma já está conectada.');+ session()->flash('flash.banner', 'This platform is already connected.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.accounts', $workspace);}try {@@ -110,16 +116,20 @@ class SocialController extends Controllersession()->forget('social_connect_workspace');- return redirect()->route('workspaces.accounts', $workspace)- ->with('success', 'Conta conectada com sucesso!');+ session()->flash('flash.banner', 'Account connected successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route('workspaces.accounts', $workspace);} catch (\Exception $e) {Log::error('Social OAuth Error', ['platform' => $platform->value,'error' => $e->getMessage(),]);- return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Erro ao conectar conta. Tente novamente.');+ session()->flash('flash.banner', 'Error connecting account. Please try again.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.accounts', $workspace);}}}diff --git a/app/Http/Controllers/Auth/ThreadsController.php b/app/Http/Controllers/Auth/ThreadsController.phpnew file mode 100644index 000000000..dad7b57d0--- /dev/null+++ b/app/Http/Controllers/Auth/ThreadsController.php@@ -0,0 +1,156 @@+<?php++namespace App\Http\Controllers\Auth;++use App\Enums\SocialPlatform;+use App\Models\Workspace;+use Illuminate\Http\RedirectResponse;+use Illuminate\Http\Request;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;+use Inertia\Inertia;+use Symfony\Component\HttpFoundation\Response;++class ThreadsController extends SocialController+{+ protected SocialPlatform $platform = SocialPlatform::Threads;++ protected array $scopes = [+ 'threads_basic',+ 'threads_content_publish',+ 'threads_manage_replies',+ 'threads_read_replies',+ ];++ public function connect(Request $request, Workspace $workspace): Response+ {+ $this->authorize('manageAccounts', $workspace);++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return back()->with('error', 'This platform is already connected.');+ }++ session(['social_connect_workspace' => $workspace->id]);++ $state = bin2hex(random_bytes(16));+ session(['threads_oauth_state' => $state]);++ $params = http_build_query([+ 'client_id' => config('services.threads.client_id'),+ 'redirect_uri' => config('services.threads.redirect'),+ 'scope' => implode(',', $this->scopes),+ 'response_type' => 'code',+ 'state' => $state,+ ]);++ return Inertia::location("https://threads.net/oauth/authorize?{$params}");+ }++ public function callback(Request $request): RedirectResponse+ {+ $workspaceId = session('social_connect_workspace');+ $savedState = session('threads_oauth_state');++ if (! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ if ($request->state !== $savedState) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Invalid state. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'This platform is already connected.');+ }++ try {+ // Exchange code for short-lived token+ $tokenResponse = Http::asForm()->post('https://graph.threads.net/oauth/access_token', [+ 'client_id' => config('services.threads.client_id'),+ 'client_secret' => config('services.threads.client_secret'),+ 'grant_type' => 'authorization_code',+ 'redirect_uri' => config('services.threads.redirect'),+ 'code' => $request->code,+ ]);++ if ($tokenResponse->failed()) {+ Log::error('Threads token exchange failed', [+ 'status' => $tokenResponse->status(),+ 'body' => $tokenResponse->body(),+ ]);+ throw new \Exception('Failed to exchange token');+ }++ $tokenData = $tokenResponse->json();+ $shortLivedToken = $tokenData['access_token'];+ $userId = $tokenData['user_id'];++ // Exchange for long-lived token+ $longLivedResponse = Http::get('https://graph.threads.net/access_token', [+ 'grant_type' => 'th_exchange_token',+ 'client_secret' => config('services.threads.client_secret'),+ 'access_token' => $shortLivedToken,+ ]);++ $longLivedToken = $shortLivedToken;+ $expiresIn = null;++ if ($longLivedResponse->successful()) {+ $longLivedData = $longLivedResponse->json();+ $longLivedToken = $longLivedData['access_token'] ?? $shortLivedToken;+ $expiresIn = $longLivedData['expires_in'] ?? null;+ }++ // Fetch user profile+ $profileResponse = Http::get("https://graph.threads.net/v1.0/{$userId}", [+ 'access_token' => $longLivedToken,+ 'fields' => 'id,username,name,threads_profile_picture_url',+ ]);++ if ($profileResponse->failed()) {+ Log::error('Threads profile fetch failed', [+ 'body' => $profileResponse->body(),+ ]);+ throw new \Exception('Failed to fetch profile');+ }++ $profile = $profileResponse->json();+ $avatarPath = uploadFromUrl($profile['threads_profile_picture_url'] ?? null);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $profile['id'],+ 'username' => $profile['username'],+ 'display_name' => $profile['name'] ?? $profile['username'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $longLivedToken,+ 'refresh_token' => null,+ 'token_expires_at' => $expiresIn ? now()->addSeconds($expiresIn) : null,+ 'scopes' => $this->scopes,+ ]);++ session()->forget(['social_connect_workspace', 'threads_oauth_state']);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'Threads account connected successfully!');+ } catch (\Exception $e) {+ Log::error('Threads OAuth Error', [+ 'error' => $e->getMessage(),+ 'trace' => $e->getTraceAsString(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting account. Please try again.');+ }+ }+}diff --git a/app/Http/Controllers/Auth/TikTokController.php b/app/Http/Controllers/Auth/TikTokController.phpindex 32064c1a5..df3c8e567 100644--- a/app/Http/Controllers/Auth/TikTokController.php+++ b/app/Http/Controllers/Auth/TikTokController.php@@ -24,10 +24,10 @@ class TikTokController extends SocialControllerpublic function connect(Request $request, Workspace $workspace): Response{- $this->authorize('update', $workspace);+ $this->authorize('manageAccounts', $workspace);if ($workspace->hasConnectedPlatform($this->platform->value)) {- return back()->with('error', 'Esta plataforma já está conectada.');+ return back()->with('error', 'This platform is already connected.');}return $this->redirectToProvider($workspace, $this->driver, $this->scopes);@@ -39,19 +39,19 @@ class TikTokController extends SocialControllerif (! $workspaceId) {return redirect()->route('workspaces.index')- ->with('error', 'Sessão expirada. Tente novamente.');+ ->with('error', 'Session expired. Please try again.');}$workspace = Workspace::find($workspaceId);- if (! $workspace || ! $request->user()->can('update', $workspace)) {+ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {return redirect()->route('workspaces.index')- ->with('error', 'Workspace não encontrado.');+ ->with('error', 'Workspace not found.');}if ($workspace->hasConnectedPlatform($this->platform->value)) {return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Esta plataforma já está conectada.');+ ->with('error', 'This platform is already connected.');}try {@@ -84,14 +84,14 @@ class TikTokController extends SocialControllersession()->forget('social_connect_workspace');return redirect()->route('workspaces.accounts', $workspace)- ->with('success', 'Conta conectada com sucesso!');+ ->with('success', 'Account connected successfully!');} catch (\Exception $e) {Log::error('TikTok OAuth Error', ['error' => $e->getMessage(),]);return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Erro ao conectar conta. Tente novamente.');+ ->with('error', 'Error connecting account. Please try again.');}}}diff --git a/app/Http/Controllers/Auth/XController.php b/app/Http/Controllers/Auth/XController.phpindex c946a8fd5..260301d80 100644--- a/app/Http/Controllers/Auth/XController.php+++ b/app/Http/Controllers/Auth/XController.php@@ -10,7 +10,7 @@ use Symfony\Component\HttpFoundation\Response;class XController extends SocialController{- protected string $driver = 'twitter';+ protected string $driver = 'x';protected SocialPlatform $platform = SocialPlatform::X;@@ -18,15 +18,16 @@ class XController extends SocialController'tweet.read','tweet.write','users.read',+ 'media.write','offline.access',];public function connect(Request $request, Workspace $workspace): Response{- $this->authorize('update', $workspace);+ $this->authorize('manageAccounts', $workspace);if ($workspace->hasConnectedPlatform($this->platform->value)) {- return back()->with('error', 'Esta plataforma já está conectada.');+ return back()->with('error', 'This platform is already connected.');}return $this->redirectToProvider($workspace, $this->driver, $this->scopes);diff --git a/app/Http/Controllers/Auth/YouTubeController.php b/app/Http/Controllers/Auth/YouTubeController.phpnew file mode 100644index 000000000..2ff7e7bdb--- /dev/null+++ b/app/Http/Controllers/Auth/YouTubeController.php@@ -0,0 +1,264 @@+<?php++namespace App\Http\Controllers\Auth;++use App\Enums\SocialPlatform;+use App\Models\Workspace;+use Illuminate\Http\RedirectResponse;+use Illuminate\Http\Request;+use Illuminate\Support\Facades\Log;+use Laravel\Socialite\Facades\Socialite;+use Symfony\Component\HttpFoundation\Response;++class YouTubeController extends SocialController+{+ protected string $driver = 'google';++ protected SocialPlatform $platform = SocialPlatform::YouTube;++ protected array $scopes = [+ 'https://www.googleapis.com/auth/youtube.upload',+ 'https://www.googleapis.com/auth/youtube.readonly',+ 'https://www.googleapis.com/auth/youtube.force-ssl',+ ];++ public function connect(Request $request, Workspace $workspace): Response+ {+ $this->authorize('manageAccounts', $workspace);++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return back()->with('error', 'This platform is already connected.');+ }++ session(['social_connect_workspace' => $workspace->id]);++ return $this->redirectToGoogle($workspace);+ }++ public function callback(Request $request): RedirectResponse+ {+ $workspaceId = session('social_connect_workspace');++ if (! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ if ($workspace->hasConnectedPlatform($this->platform->value)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'This platform is already connected.');+ }++ try {+ $socialUser = Socialite::driver($this->driver)->user();++ // Fetch the channels the user authorized+ $channels = $this->fetchChannels($socialUser->token);++ if (empty($channels)) {+ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'No YouTube channels found. Please create a channel first.');+ }++ // If only one channel, connect directly (most common case)+ if (count($channels) === 1) {+ $channel = $channels[0];+ $avatarPath = uploadFromUrl($channel['thumbnail']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $channel['id'],+ 'username' => $channel['custom_url'] ?? $channel['id'],+ 'display_name' => $channel['title'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $socialUser->token,+ 'refresh_token' => $socialUser->refreshToken,+ 'token_expires_at' => $socialUser->expiresIn ? now()->addSeconds($socialUser->expiresIn) : null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'channel_id' => $channel['id'],+ 'google_user_id' => $socialUser->getId(),+ ],+ ]);++ session()->forget('social_connect_workspace');++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'YouTube channel connected successfully!');+ }++ // Multiple channels - store data and show selection screen+ session([+ 'youtube_oauth' => [+ 'access_token' => $socialUser->token,+ 'refresh_token' => $socialUser->refreshToken,+ 'expires_in' => $socialUser->expiresIn,+ 'user_id' => $socialUser->getId(),+ ],+ ]);++ return redirect()->route('social.youtube.select-channel');+ } catch (\Exception $e) {+ Log::error('YouTube OAuth Error', [+ 'error' => $e->getMessage(),+ 'trace' => $e->getTraceAsString(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting account. Please try again.');+ }+ }++ public function selectChannel(Request $request)+ {+ $oauthData = session('youtube_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ // Fetch YouTube channels+ $channels = $this->fetchChannels($oauthData['access_token']);++ if (empty($channels)) {+ session()->forget(['youtube_oauth', 'social_connect_workspace']);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'No YouTube channels found. Please create a channel first.');+ }++ return inertia('accounts/YouTubeChannelSelect', [+ 'workspace' => $workspace,+ 'channels' => $channels,+ ]);+ }++ public function select(Request $request): RedirectResponse+ {+ $request->validate([+ 'channel_id' => 'required|string',+ ]);++ $oauthData = session('youtube_oauth');+ $workspaceId = session('social_connect_workspace');++ if (! $oauthData || ! $workspaceId) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Session expired. Please try again.');+ }++ $workspace = Workspace::find($workspaceId);++ if (! $workspace || ! $request->user()->can('manageAccounts', $workspace)) {+ return redirect()->route('workspaces.index')+ ->with('error', 'Workspace not found.');+ }++ try {+ $channels = $this->fetchChannels($oauthData['access_token']);+ $selectedChannel = collect($channels)->firstWhere('id', $request->channel_id);++ if (! $selectedChannel) {+ return redirect()->route('social.youtube.select-channel')+ ->with('error', 'Channel not found.');+ }++ $avatarPath = uploadFromUrl($selectedChannel['thumbnail']);++ $workspace->socialAccounts()->create([+ 'platform' => $this->platform->value,+ 'platform_user_id' => $selectedChannel['id'],+ 'username' => $selectedChannel['custom_url'] ?? $selectedChannel['id'],+ 'display_name' => $selectedChannel['title'],+ 'avatar_url' => $avatarPath,+ 'access_token' => $oauthData['access_token'],+ 'refresh_token' => $oauthData['refresh_token'],+ 'token_expires_at' => $oauthData['expires_in'] ? now()->addSeconds($oauthData['expires_in']) : null,+ 'scopes' => $this->scopes,+ 'meta' => [+ 'channel_id' => $selectedChannel['id'],+ 'google_user_id' => $oauthData['user_id'],+ ],+ ]);++ session()->forget(['youtube_oauth', 'social_connect_workspace']);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('success', 'YouTube channel connected successfully!');+ } catch (\Exception $e) {+ Log::error('YouTube channel selection error', [+ 'error' => $e->getMessage(),+ ]);++ return redirect()->route('workspaces.accounts', $workspace)+ ->with('error', 'Error connecting channel. Please try again.');+ }+ }++ private function redirectToGoogle(Workspace $workspace): Response+ {+ return \Inertia\Inertia::location(+ Socialite::driver($this->driver)+ ->scopes($this->scopes)+ ->with([+ 'access_type' => 'offline',+ 'prompt' => 'consent',+ ])+ ->redirect()+ ->getTargetUrl()+ );+ }++ private function fetchChannels(string $accessToken): array+ {+ try {+ $response = \Illuminate\Support\Facades\Http::withToken($accessToken)+ ->get('https://www.googleapis.com/youtube/v3/channels', [+ 'part' => 'snippet,contentDetails,statistics',+ 'mine' => 'true',+ ]);++ if ($response->failed()) {+ Log::error('YouTube channels fetch failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);++ return [];+ }++ $data = $response->json();++ return collect($data['items'] ?? [])->map(fn ($channel) => [+ 'id' => $channel['id'],+ 'title' => $channel['snippet']['title'],+ 'description' => $channel['snippet']['description'] ?? '',+ 'thumbnail' => $channel['snippet']['thumbnails']['default']['url'] ?? null,+ 'custom_url' => $channel['snippet']['customUrl'] ?? null,+ 'subscriber_count' => $channel['statistics']['subscriberCount'] ?? 0,+ ])->toArray();+ } catch (\Exception $e) {+ Log::error('YouTube channels fetch error', [+ 'error' => $e->getMessage(),+ ]);++ return [];+ }+ }+}diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.phpindex b59a98ae5..70e186884 100644--- a/app/Http/Controllers/MediaController.php+++ b/app/Http/Controllers/MediaController.php@@ -6,8 +6,6 @@ use App\Enums\MediaType;use App\Http\Requests\StoreMediaRequest;use App\Models\PostMedia;use Illuminate\Http\JsonResponse;-use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;class MediaController extends Controller{@@ -18,12 +16,11 @@ class MediaController extends Controller$type = $this->getMediaType($mimeType);- $path = $file->store('media/' . now()->format('Y/m'), 'r2');+ $path = $file->store('media/'.now()->format('Y-m'));$media = PostMedia::create([- 'post_platform_id' => null,+ 'post_platform_id' => $request->input('post_platform_id'),'type' => $type,- 'disk' => 'r2','path' => $path,'original_filename' => $file->getClientOriginalName(),'mime_type' => $mimeType,diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.phpindex 9dbb7fe5e..62962c5cf 100644--- a/app/Http/Controllers/PostController.php+++ b/app/Http/Controllers/PostController.php@@ -5,6 +5,7 @@ namespace App\Http\Controllers;use App\Enums\PostStatus;use App\Http\Requests\StorePostRequest;use App\Http\Requests\UpdatePostRequest;+use App\Jobs\PublishPost;use App\Models\Post;use App\Models\Workspace;use Carbon\Carbon;@@ -34,46 +35,68 @@ class PostController extends Controller{$this->authorize('view', $workspace);- $month = $request->input('month', now()->month);- $year = $request->input('year', now()->year);+ $tz = $workspace->timezone;- $startOfMonth = Carbon::create($year, $month, 1)->startOfMonth();- $endOfMonth = Carbon::create($year, $month, 1)->endOfMonth();+ $weekStart = $request->input('week')+ ? Carbon::parse($request->input('week'), $tz)->startOfWeek()+ : Carbon::now($tz)->startOfWeek();++ $weekEnd = $weekStart->copy()->endOfWeek();++ // Convert to UTC for database query+ $weekStartUtc = $weekStart->copy()->utc();+ $weekEndUtc = $weekEnd->copy()->utc();$posts = $workspace->posts()->with(['postPlatforms.socialAccount'])- ->whereBetween('scheduled_at', [$startOfMonth, $endOfMonth])+ ->whereBetween('scheduled_at', [$weekStartUtc, $weekEndUtc])->orderBy('scheduled_at')->get()- ->groupBy(fn ($post) => $post->scheduled_at?->format('Y-m-d'));-- $socialAccounts = $workspace->socialAccounts;+ ->groupBy(fn ($post) => $post->scheduled_at?->setTimezone($tz)->format('Y-m-d'));return Inertia::render('posts/Calendar', ['workspace' => $workspace,'posts' => $posts,- 'socialAccounts' => $socialAccounts,- 'currentMonth' => $month,- 'currentYear' => $year,+ 'currentWeekStart' => $weekStart->format('Y-m-d'),]);}- public function create(Request $request, Workspace $workspace): Response|RedirectResponse+ public function create(Request $request, Workspace $workspace): RedirectResponse{$this->authorize('view', $workspace);$socialAccounts = $workspace->socialAccounts;if ($socialAccounts->isEmpty()) {- return redirect()->route('workspaces.accounts', $workspace)- ->with('error', 'Conecte pelo menos uma rede social antes de criar um post.');+ session()->flash('flash.banner', 'Connect at least one social network before creating a post.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.accounts', $workspace);}- return Inertia::render('posts/Create', [- 'workspace' => $workspace,- 'socialAccounts' => $socialAccounts,- 'scheduledDate' => $request->input('date'),+ // Create a draft post - default to today if no date provided+ $date = $request->input('date') ?: Carbon::now($workspace->timezone)->format('Y-m-d');+ $scheduledAt = Carbon::parse($date, $workspace->timezone)+ ->setTime(9, 0)+ ->utc();++ $post = $workspace->posts()->create([+ 'user_id' => $request->user()->id,+ 'status' => PostStatus::Draft,+ 'scheduled_at' => $scheduledAt,]);++ // Create post_platforms for each connected account+ foreach ($socialAccounts as $account) {+ $post->postPlatforms()->create([+ 'social_account_id' => $account->id,+ 'platform' => $account->platform->value,+ 'content' => '',+ 'status' => 'pending',+ ]);+ }++ return redirect()->route('workspaces.posts.edit', [$workspace, $post]);}public function store(StorePostRequest $request, Workspace $workspace): RedirectResponse@@ -105,8 +128,10 @@ class PostController extends Controller? 'workspaces.calendar': 'workspaces.posts.index';- return redirect()->route($route, $workspace)- ->with('success', 'Post criado com sucesso!');+ session()->flash('flash.banner', 'Post created successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route($route, $workspace);}public function show(Workspace $workspace, Post $post): Response@@ -134,17 +159,33 @@ class PostController extends Controller}if ($post->status === PostStatus::Published) {- return redirect()->route('workspaces.posts.show', [$workspace, $post])- ->with('error', 'Posts publicados não podem ser editados.');+ session()->flash('flash.banner', 'Published posts cannot be edited.');+ session()->flash('flash.bannerStyle', 'danger');++ return redirect()->route('workspaces.posts.show', [$workspace, $post]);}$post->load(['postPlatforms.socialAccount', 'postPlatforms.media']);$socialAccounts = $workspace->socialAccounts;+ $platformConfigs = $socialAccounts->mapWithKeys(function ($account) {+ $platform = $account->platform;++ return [+ $account->id => [+ 'maxContentLength' => $platform->maxContentLength(),+ 'maxImages' => $platform->maxImages(),+ 'allowedMediaTypes' => array_map(fn ($type) => $type->value, $platform->allowedMediaTypes()),+ 'supportsTextOnly' => $platform->supportsTextOnly(),+ ],+ ];+ });+return Inertia::render('posts/Edit', ['workspace' => $workspace,'post' => $post,'socialAccounts' => $socialAccounts,+ 'platformConfigs' => $platformConfigs,]);}@@ -157,24 +198,53 @@ class PostController extends Controller}if ($post->status === PostStatus::Published) {- return back()->with('error', 'Posts publicados não podem ser editados.');+ session()->flash('flash.banner', 'Published posts cannot be edited.');+ session()->flash('flash.bannerStyle', 'danger');++ return back();+ }++ $scheduledAt = $post->scheduled_at;+ if ($request->has('scheduled_at') && $request->input('scheduled_at')) {+ $scheduledAt = Carbon::parse($request->input('scheduled_at'), $workspace->timezone)->utc();}+ $status = $request->input('status', $post->status);+$post->update([- 'status' => $request->input('status', $post->status),- 'scheduled_at' => $request->input('scheduled_at', $post->scheduled_at),+ 'status' => $status === 'publishing' ? PostStatus::Publishing : $status,+ 'scheduled_at' => $scheduledAt,]);+ // Get selected platform IDs+ $selectedPlatformIds = collect($request->input('platforms', []))->pluck('id')->toArray();++ // Update all platforms - disable those not selected, update content for selected ones+ $post->postPlatforms()->update(['enabled' => false]);+foreach ($request->input('platforms', []) as $platformData) {$post->postPlatforms()->where('id', $platformData['id'])->update([+ 'enabled' => true,'content' => $platformData['content'],]);}- return redirect()->route('workspaces.posts.show', [$workspace, $post])- ->with('success', 'Post atualizado com sucesso!');+ // Dispatch publish job if publishing now+ if ($status === 'publishing') {+ PublishPost::dispatch($post);++ session()->flash('flash.banner', 'Post is being published!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route('workspaces.posts.show', [$workspace, $post]);+ }++ session()->flash('flash.banner', 'Post updated successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route('workspaces.posts.show', [$workspace, $post]);}public function destroy(Workspace $workspace, Post $post): RedirectResponse@@ -187,7 +257,9 @@ class PostController extends Controller$post->delete();- return redirect()->route('workspaces.calendar', $workspace)- ->with('success', 'Post excluído com sucesso!');+ session()->flash('flash.banner', 'Post deleted successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route('workspaces.calendar', $workspace);}}diff --git a/app/Http/Controllers/WorkspaceController.php b/app/Http/Controllers/WorkspaceController.phpindex c8dbd9db6..c39d6ed92 100644--- a/app/Http/Controllers/WorkspaceController.php+++ b/app/Http/Controllers/WorkspaceController.php@@ -32,7 +32,7 @@ class WorkspaceController extends Controller// First workspace is free, subsequent ones require subscriptionif ($user->ownedWorkspacesCount() > 0 && ! $user->hasActiveSubscription()) {return redirect()->route('billing.index')- ->with('message', 'Assine para criar mais workspaces.');+ ->with('message', 'Subscribe to create more workspaces.');}return Inertia::render('workspaces/Create');@@ -45,20 +45,18 @@ class WorkspaceController extends Controller// First workspace is free, subsequent ones require subscriptionif ($user->ownedWorkspacesCount() > 0 && ! $user->hasActiveSubscription()) {return redirect()->route('billing.index')- ->with('message', 'Assine para criar mais workspaces.');+ ->with('message', 'Subscribe to create more workspaces.');}$workspace = $user->workspaces()->create($request->validated());- $workspace->members()->attach($user->id, ['role' => 'owner']);-// Increment subscription quantity if user has subscriptionif ($user->hasActiveSubscription()) {$user->incrementWorkspaceQuantity();}return redirect()->route('workspaces.show', $workspace)- ->with('success', 'Workspace criado com sucesso!');+ ->with('success', 'Workspace created successfully!');}public function show(Request $request, Workspace $workspace): Response@@ -98,7 +96,33 @@ class WorkspaceController extends Controller$workspace->update($request->validated());return redirect()->route('workspaces.show', $workspace)- ->with('success', 'Workspace atualizado com sucesso!');+ ->with('success', 'Workspace updated successfully!');+ }++ public function settings(Workspace $workspace): Response+ {+ $this->authorize('update', $workspace);++ $timezones = collect(timezone_identifiers_list())+ ->mapWithKeys(fn ($tz) => [$tz => $tz])+ ->toArray();++ return Inertia::render('workspaces/Settings', [+ 'workspace' => $workspace,+ 'timezones' => $timezones,+ ]);+ }++ public function updateSettings(UpdateWorkspaceRequest $request, Workspace $workspace): RedirectResponse+ {+ $this->authorize('update', $workspace);++ $workspace->update($request->validated());++ session()->flash('flash.banner', 'Settings updated successfully!');+ session()->flash('flash.bannerStyle', 'success');++ return redirect()->route('workspaces.settings', $workspace);}public function destroy(Request $request, Workspace $workspace): RedirectResponse@@ -115,6 +139,6 @@ class WorkspaceController extends Controller}return redirect()->route('workspaces.index')- ->with('success', 'Workspace excluído com sucesso!');+ ->with('success', 'Workspace deleted successfully!');}}diff --git a/app/Http/Controllers/WorkspaceInviteController.php b/app/Http/Controllers/WorkspaceInviteController.phpindex 1a02910df..b1309e4fb 100644--- a/app/Http/Controllers/WorkspaceInviteController.php+++ b/app/Http/Controllers/WorkspaceInviteController.php@@ -2,7 +2,6 @@namespace App\Http\Controllers;-use App\Enums\InviteStatus;use App\Enums\WorkspaceRole;use App\Http\Requests\StoreWorkspaceInviteRequest;use App\Models\Workspace;@@ -17,7 +16,7 @@ class WorkspaceInviteController extends Controller{public function index(Workspace $workspace): Response{- $this->authorize('update', $workspace);+ $this->authorize('manageTeam', $workspace);return Inertia::render('workspaces/Invites', ['workspace' => $workspace,@@ -25,12 +24,15 @@ class WorkspaceInviteController extends Controller->with('inviter')->latest()->get(),- 'members' => $workspace->members()->get()->map(fn ($member) => [- 'id' => $member->id,- 'name' => $member->name,- 'email' => $member->email,- 'role' => $member->pivot->role,- ]),+ 'members' => $workspace->members()+ ->where('user_id', '!=', $workspace->user_id)+ ->get()+ ->map(fn ($member) => [+ 'id' => $member->id,+ 'name' => $member->name,+ 'email' => $member->email,+ 'role' => $member->pivot->role,+ ]),'owner' => ['id' => $workspace->owner->id,'name' => $workspace->owner->name,@@ -48,7 +50,7 @@ class WorkspaceInviteController extends Controllerpublic function store(StoreWorkspaceInviteRequest $request, Workspace $workspace): RedirectResponse{- $this->authorize('update', $workspace);+ $this->authorize('manageTeam', $workspace);$existingInvite = $workspace->invites()->where('email', $request->email)@@ -57,13 +59,13 @@ class WorkspaceInviteController extends Controllerif ($existingInvite) {return back()->withErrors([- 'email' => 'Já existe um convite pendente para este email.',+ 'email' => 'A pending invite already exists for this email.',]);}if ($workspace->members()->where('email', $request->email)->exists()) {return back()->withErrors([- 'email' => 'Este usuário já é membro do workspace.',+ 'email' => 'This user is already a member of the workspace.',]);}@@ -75,12 +77,12 @@ class WorkspaceInviteController extends Controller$invite->notify(new WorkspaceInviteNotification($invite));- return back()->with('success', 'Convite enviado com sucesso!');+ return back()->with('success', 'Invite sent successfully!');}public function destroy(Workspace $workspace, WorkspaceInvite $invite): RedirectResponse{- $this->authorize('update', $workspace);+ $this->authorize('manageTeam', $workspace);if ($invite->workspace_id !== $workspace->id) {abort(404);@@ -88,7 +90,7 @@ class WorkspaceInviteController extends Controller$invite->cancel();- return back()->with('success', 'Convite cancelado.');+ return back()->with('success', 'Invite cancelled.');}public function accept(Request $request, string $token): RedirectResponse@@ -98,11 +100,11 @@ class WorkspaceInviteController extends Controllerif (! $invite->isValid()) {if ($invite->isExpired()) {return redirect()->route('workspaces.index')- ->withErrors(['invite' => 'Este convite expirou.']);+ ->withErrors(['invite' => 'This invite has expired.']);}return redirect()->route('workspaces.index')- ->withErrors(['invite' => 'Este convite não é mais válido.']);+ ->withErrors(['invite' => 'This invite is no longer valid.']);}$user = $request->user();@@ -111,30 +113,30 @@ class WorkspaceInviteController extends Controllersession(['pending_invite_token' => $token]);return redirect()->route('login')- ->with('message', 'Faça login para aceitar o convite.');+ ->with('message', 'Please log in to accept the invite.');}if ($invite->workspace->hasMember($user)) {return redirect()->route('workspaces.show', $invite->workspace)- ->with('message', 'Você já é membro deste workspace.');+ ->with('message', 'You are already a member of this workspace.');}$invite->accept($user);return redirect()->route('workspaces.show', $invite->workspace)- ->with('success', 'Você agora é membro do workspace!');+ ->with('success', 'You are now a member of the workspace!');}public function removeMember(Workspace $workspace, string $userId): RedirectResponse{- $this->authorize('update', $workspace);+ $this->authorize('manageTeam', $workspace);if ($workspace->user_id === $userId) {- return back()->withErrors(['member' => 'Não é possível remover o dono do workspace.']);+ return back()->withErrors(['member' => 'Cannot remove the workspace owner.']);}$workspace->members()->detach($userId);- return back()->with('success', 'Membro removido com sucesso.');+ return back()->with('success', 'Member removed successfully.');}}diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.phpindex f4cc770ca..db703ad81 100644--- a/app/Http/Middleware/HandleInertiaRequests.php+++ b/app/Http/Middleware/HandleInertiaRequests.php@@ -42,6 +42,9 @@ class HandleInertiaRequests extends Middleware'user' => $request->user(),],'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',+ 'flash' => $request->session()->get('flash', []),+ 'env' => config('app.env'),+ 'locale' => app()->getLocale(),];}}diff --git a/app/Http/Requests/UpdatePostRequest.php b/app/Http/Requests/UpdatePostRequest.phpindex 2bbe4e902..65618e929 100644--- a/app/Http/Requests/UpdatePostRequest.php+++ b/app/Http/Requests/UpdatePostRequest.php@@ -2,9 +2,7 @@namespace App\Http\Requests;-use App\Enums\PostStatus;use Illuminate\Foundation\Http\FormRequest;-use Illuminate\Validation\Rule;class UpdatePostRequest extends FormRequest{@@ -16,8 +14,8 @@ class UpdatePostRequest extends FormRequestpublic function rules(): array{return [- 'status' => ['sometimes', Rule::enum(PostStatus::class)],- 'scheduled_at' => ['sometimes', 'nullable', 'date', 'after:now'],+ 'status' => ['sometimes', 'string'],+ 'scheduled_at' => ['sometimes', 'nullable', 'string'],'platforms' => ['sometimes', 'array'],'platforms.*.id' => ['required', 'uuid', 'exists:post_platforms,id'],'platforms.*.content' => ['nullable', 'string', 'max:5000'],@@ -27,7 +25,7 @@ class UpdatePostRequest extends FormRequestpublic function messages(): array{return [- 'scheduled_at.after' => 'A data de agendamento deve ser no futuro.',+ 'scheduled_at.after' => 'The scheduled date must be in the future.',];}}diff --git a/app/Http/Requests/UpdateWorkspaceRequest.php b/app/Http/Requests/UpdateWorkspaceRequest.phpindex 091716fc4..fd7b2ff83 100644--- a/app/Http/Requests/UpdateWorkspaceRequest.php+++ b/app/Http/Requests/UpdateWorkspaceRequest.php@@ -15,14 +15,17 @@ class UpdateWorkspaceRequest extends FormRequest{return ['name' => ['required', 'string', 'max:255'],+ 'timezone' => ['required', 'string', 'timezone:all'],];}public function messages(): array{return [- 'name.required' => 'O nome do workspace é obrigatório.',- 'name.max' => 'O nome do workspace deve ter no máximo 255 caracteres.',+ 'name.required' => 'The workspace name is required.',+ 'name.max' => 'The workspace name must be at most 255 characters.',+ 'timezone.required' => 'Please select a timezone.',+ 'timezone.timezone' => 'Please select a valid timezone.',];}}diff --git a/app/Jobs/PublishPost.php b/app/Jobs/PublishPost.phpindex f24dcf738..8bb4e6c4d 100644--- a/app/Jobs/PublishPost.php+++ b/app/Jobs/PublishPost.php@@ -16,7 +16,7 @@ class PublishPost implements ShouldQueue{$this->post->markAsPublishing();- foreach ($this->post->postPlatforms as $postPlatform) {+ foreach ($this->post->postPlatforms()->where('enabled', true)->get() as $postPlatform) {PublishToSocialPlatform::dispatch($postPlatform);}}diff --git a/app/Jobs/PublishToSocialPlatform.php b/app/Jobs/PublishToSocialPlatform.phpindex 4ab3fef52..b369d66fd 100644--- a/app/Jobs/PublishToSocialPlatform.php+++ b/app/Jobs/PublishToSocialPlatform.php@@ -2,13 +2,16 @@namespace App\Jobs;-use App\Enums\PostStatus;use App\Enums\SocialPlatform;use App\Models\PostPlatform;+use App\Services\Social\FacebookPublisher;+use App\Services\Social\InstagramPublisher;use App\Services\Social\LinkedInPagePublisher;use App\Services\Social\LinkedInPublisher;+use App\Services\Social\ThreadsPublisher;use App\Services\Social\TikTokPublisher;use App\Services\Social\XPublisher;+use App\Services\Social\YouTubePublisher;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Foundation\Queue\Queueable;use Illuminate\Support\Facades\Log;@@ -32,8 +35,6 @@ class PublishToSocialPlatform implements ShouldQueue$result = $publisher->publish($this->postPlatform);$this->postPlatform->markAsPublished($result['id'], $result['url'] ?? null);-- $this->checkPostComplete();} catch (\Exception $e) {Log::error('Failed to publish to social platform', ['post_platform_id' => $this->postPlatform->id,@@ -42,30 +43,47 @@ class PublishToSocialPlatform implements ShouldQueue]);$this->postPlatform->markAsFailed($e->getMessage());- $this->postPlatform->post->markAsFailed();-- throw $e;}++ // Always check and update post status after each platform finishes+ $this->updatePostStatus();}- private function getPublisher(): LinkedInPublisher|LinkedInPagePublisher|XPublisher|TikTokPublisher+ private function getPublisher(): LinkedInPublisher|LinkedInPagePublisher|XPublisher|TikTokPublisher|YouTubePublisher|FacebookPublisher|InstagramPublisher|ThreadsPublisher{return match ($this->postPlatform->platform) {SocialPlatform::LinkedIn => app(LinkedInPublisher::class),SocialPlatform::LinkedInPage => app(LinkedInPagePublisher::class),SocialPlatform::X => app(XPublisher::class),SocialPlatform::TikTok => app(TikTokPublisher::class),+ SocialPlatform::YouTube => app(YouTubePublisher::class),+ SocialPlatform::Facebook => app(FacebookPublisher::class),+ SocialPlatform::Instagram => app(InstagramPublisher::class),+ SocialPlatform::Threads => app(ThreadsPublisher::class),};}- private function checkPostComplete(): void+ private function updatePostStatus(): void{$post = $this->postPlatform->post->fresh();+ $enabledPlatforms = $post->postPlatforms->where('enabled', true);- $allPublished = $post->postPlatforms->every(fn ($pp) => $pp->status === 'published');+ $total = $enabledPlatforms->count();+ $publishedCount = $enabledPlatforms->where('status', 'published')->count();+ $failedCount = $enabledPlatforms->where('status', 'failed')->count();+ $finishedCount = $publishedCount + $failedCount;++ // Only update post status when all platforms have finished+ if ($finishedCount < $total) {+ return;+ }- if ($allPublished) {+ if ($publishedCount === $total) {$post->markAsPublished();+ } elseif ($publishedCount > 0) {+ $post->markAsPartiallyPublished();+ } else {+ $post->markAsFailed();}}}diff --git a/app/Models/Post.php b/app/Models/Post.phpindex cadecfde7..bbec52b01 100644--- a/app/Models/Post.php+++ b/app/Models/Post.php@@ -85,6 +85,14 @@ class Post extends Model]);}+ public function markAsPartiallyPublished(): void+ {+ $this->update([+ 'status' => PostStatus::PartiallyPublished,+ 'published_at' => now(),+ ]);+ }+public function markAsFailed(): void{$this->update(['status' => PostStatus::Failed]);diff --git a/app/Models/PostMedia.php b/app/Models/PostMedia.phpindex 2c94ca171..51ec54c93 100644--- a/app/Models/PostMedia.php+++ b/app/Models/PostMedia.php@@ -15,10 +15,11 @@ class PostMedia extends Model/** @use HasFactory<\Database\Factories\PostMediaFactory> */use HasFactory, HasUuids;+ protected $appends = ['url'];+protected $fillable = ['post_platform_id','type',- 'disk','path','original_filename','mime_type',@@ -45,13 +46,13 @@ class PostMedia extends Modelprotected function url(): Attribute{return Attribute::make(- get: fn () => Storage::disk($this->disk)->url($this->path),+ get: fn () => Storage::url($this->path),);}public function getTemporaryUrl(int $expirationMinutes = 60): string{- return Storage::disk($this->disk)->temporaryUrl(+ return Storage::temporaryUrl($this->path,now()->addMinutes($expirationMinutes));@@ -59,7 +60,7 @@ class PostMedia extends Modelpublic function delete(): bool{- Storage::disk($this->disk)->delete($this->path);+ Storage::delete($this->path);return parent::delete();}diff --git a/app/Models/PostPlatform.php b/app/Models/PostPlatform.phpindex 6499457bf..878fc3829 100644--- a/app/Models/PostPlatform.php+++ b/app/Models/PostPlatform.php@@ -17,6 +17,7 @@ class PostPlatform extends Modelprotected $fillable = ['post_id','social_account_id',+ 'enabled','platform','content','status',@@ -30,6 +31,7 @@ class PostPlatform extends Modelprotected function casts(): array{return [+ 'enabled' => 'boolean','platform' => SocialPlatform::class,'published_at' => 'datetime','meta' => 'array',diff --git a/app/Models/Workspace.php b/app/Models/Workspace.phpindex a3ec8c022..5310da9c9 100644--- a/app/Models/Workspace.php+++ b/app/Models/Workspace.php@@ -2,7 +2,6 @@namespace App\Models;-use App\Enums\WorkspaceRole;use Illuminate\Database\Eloquent\Concerns\HasUuids;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\Model;@@ -18,6 +17,7 @@ class Workspace extends Modelprotected $fillable = ['user_id','name',+ 'timezone',];public function owner(): BelongsTodiff --git a/app/Policies/WorkspacePolicy.php b/app/Policies/WorkspacePolicy.phpindex a5f3d180c..4d08f9341 100644--- a/app/Policies/WorkspacePolicy.php+++ b/app/Policies/WorkspacePolicy.php@@ -2,6 +2,7 @@namespace App\Policies;+use App\Enums\WorkspaceRole;use App\Models\User;use App\Models\Workspace;@@ -14,7 +15,7 @@ class WorkspacePolicypublic function view(User $user, Workspace $workspace): bool{- return $user->id === $workspace->user_id || $workspace->members->contains($user);+ return $this->isOwner($user, $workspace) || $workspace->members->contains($user);}public function create(User $user): bool@@ -24,21 +25,52 @@ class WorkspacePolicypublic function update(User $user, Workspace $workspace): bool{- return $user->id === $workspace->user_id;+ return $this->isOwner($user, $workspace) || $this->isAdmin($user, $workspace);}public function delete(User $user, Workspace $workspace): bool{- return $user->id === $workspace->user_id;+ return $this->isOwner($user, $workspace);}public function restore(User $user, Workspace $workspace): bool{- return $user->id === $workspace->user_id;+ return $this->isOwner($user, $workspace);}public function forceDelete(User $user, Workspace $workspace): bool+ {+ return $this->isOwner($user, $workspace);+ }++ public function manageTeam(User $user, Workspace $workspace): bool+ {+ return $this->isOwner($user, $workspace) || $this->isAdmin($user, $workspace);+ }++ public function manageAccounts(User $user, Workspace $workspace): bool+ {+ return $this->isOwner($user, $workspace) || $this->isAdmin($user, $workspace);+ }++ public function createPost(User $user, Workspace $workspace): bool+ {+ return $this->isOwner($user, $workspace) || $workspace->members->contains($user);+ }++ private function isOwner(User $user, Workspace $workspace): bool{return $user->id === $workspace->user_id;}++ private function isAdmin(User $user, Workspace $workspace): bool+ {+ $member = $workspace->members()->where('user_id', $user->id)->first();++ if (! $member) {+ return false;+ }++ return $member->pivot->role === WorkspaceRole::Admin->value;+ }}diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.phpindex 0d263c77d..c022048b3 100644--- a/app/Providers/AppServiceProvider.php+++ b/app/Providers/AppServiceProvider.php@@ -2,17 +2,16 @@namespace App\Providers;+use App\Socialite\LinkedInPageExtendSocialite;use Carbon\CarbonImmutable;use Illuminate\Support\Facades\Date;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Event;use Illuminate\Support\ServiceProvider;use Illuminate\Validation\Rules\Password;-use App\Socialite\LinkedInPageExtendSocialite;use SocialiteProviders\LinkedIn\LinkedInExtendSocialite;use SocialiteProviders\Manager\SocialiteWasCalled;use SocialiteProviders\TikTok\TikTokExtendSocialite;-use SocialiteProviders\Twitter\TwitterExtendSocialite;class AppServiceProvider extends ServiceProvider{@@ -38,7 +37,6 @@ class AppServiceProvider extends ServiceProviderEvent::listen(SocialiteWasCalled::class, LinkedInExtendSocialite::class);Event::listen(SocialiteWasCalled::class, LinkedInPageExtendSocialite::class);Event::listen(SocialiteWasCalled::class, TikTokExtendSocialite::class);- Event::listen(SocialiteWasCalled::class, TwitterExtendSocialite::class);}protected function configureDefaults(): voiddiff --git a/app/Services/Social/FacebookPublisher.php b/app/Services/Social/FacebookPublisher.phpnew file mode 100644index 000000000..951e1f59d--- /dev/null+++ b/app/Services/Social/FacebookPublisher.php@@ -0,0 +1,192 @@+<?php++namespace App\Services\Social;++use App\Models\PostPlatform;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;++class FacebookPublisher+{+ private string $baseUrl = 'https://graph.facebook.com/v21.0';++ public function publish(PostPlatform $postPlatform): array+ {+ $account = $postPlatform->socialAccount;+ $pageId = $account->platform_user_id;+ $accessToken = $account->access_token;++ $media = $postPlatform->media;++ // Text only post+ if ($media->isEmpty()) {+ return $this->publishTextPost($pageId, $accessToken, $postPlatform->content);+ }++ $firstMedia = $media->first();+ $isVideo = str_starts_with($firstMedia->mime_type, 'video/');+ $isImage = str_starts_with($firstMedia->mime_type, 'image/');++ if ($isVideo) {+ return $this->publishVideoPost($pageId, $accessToken, $postPlatform->content, $firstMedia);+ }++ if ($isImage) {+ // Single or multiple images+ if ($media->count() === 1) {+ return $this->publishSingleImagePost($pageId, $accessToken, $postPlatform->content, $firstMedia);+ }++ return $this->publishMultiImagePost($pageId, $accessToken, $postPlatform->content, $media);+ }++ throw new \Exception('Unsupported media type for Facebook');+ }++ private function publishTextPost(string $pageId, string $accessToken, string $content): array+ {+ Log::info('Facebook publishing text post', ['page_id' => $pageId]);++ $response = Http::post("{$this->baseUrl}/{$pageId}/feed", [+ 'message' => $content,+ 'access_token' => $accessToken,+ ]);++ if ($response->failed()) {+ Log::error('Facebook text post failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('Facebook API error: '.$response->body());+ }++ $data = $response->json();+ $postId = $data['id'];++ return [+ 'id' => $postId,+ 'url' => "https://www.facebook.com/{$postId}",+ ];+ }++ private function publishSingleImagePost(string $pageId, string $accessToken, string $content, $media): array+ {+ Log::info('Facebook publishing single image post', ['page_id' => $pageId]);++ $response = Http::post("{$this->baseUrl}/{$pageId}/photos", [+ 'message' => $content,+ 'url' => $media->url,+ 'access_token' => $accessToken,+ ]);++ if ($response->failed()) {+ Log::error('Facebook single image post failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('Facebook API error: '.$response->body());+ }++ $data = $response->json();+ $postId = $data['post_id'] ?? $data['id'];++ return [+ 'id' => $postId,+ 'url' => "https://www.facebook.com/{$postId}",+ ];+ }++ private function publishMultiImagePost(string $pageId, string $accessToken, string $content, $mediaCollection): array+ {+ Log::info('Facebook publishing multi-image post', [+ 'page_id' => $pageId,+ 'image_count' => $mediaCollection->count(),+ ]);++ // Upload each image as unpublished+ $attachedMedia = [];++ foreach ($mediaCollection as $media) {+ if (! str_starts_with($media->mime_type, 'image/')) {+ continue;+ }++ $uploadResponse = Http::post("{$this->baseUrl}/{$pageId}/photos", [+ 'url' => $media->url,+ 'published' => 'false',+ 'access_token' => $accessToken,+ ]);++ if ($uploadResponse->failed()) {+ Log::error('Facebook image upload failed', [+ 'body' => $uploadResponse->body(),+ ]);++ continue;+ }++ $uploadData = $uploadResponse->json();+ $attachedMedia[] = ['media_fbid' => $uploadData['id']];+ }++ if (empty($attachedMedia)) {+ throw new \Exception('Failed to upload any images to Facebook');+ }++ // Create the post with attached media+ $postData = [+ 'message' => $content,+ 'access_token' => $accessToken,+ ];++ foreach ($attachedMedia as $index => $media) {+ $postData["attached_media[{$index}]"] = json_encode($media);+ }++ $response = Http::post("{$this->baseUrl}/{$pageId}/feed", $postData);++ if ($response->failed()) {+ Log::error('Facebook multi-image post failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('Facebook API error: '.$response->body());+ }++ $data = $response->json();+ $postId = $data['id'];++ return [+ 'id' => $postId,+ 'url' => "https://www.facebook.com/{$postId}",+ ];+ }++ private function publishVideoPost(string $pageId, string $accessToken, string $content, $media): array+ {+ Log::info('Facebook publishing video post', ['page_id' => $pageId]);++ // Use resumable upload for videos+ $response = Http::post("{$this->baseUrl}/{$pageId}/videos", [+ 'description' => $content,+ 'file_url' => $media->url,+ 'access_token' => $accessToken,+ ]);++ if ($response->failed()) {+ Log::error('Facebook video post failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('Facebook API error: '.$response->body());+ }++ $data = $response->json();+ $videoId = $data['id'];++ return [+ 'id' => $videoId,+ 'url' => "https://www.facebook.com/{$pageId}/videos/{$videoId}",+ ];+ }+}diff --git a/app/Services/Social/InstagramPublisher.php b/app/Services/Social/InstagramPublisher.phpnew file mode 100644index 000000000..7121a0406--- /dev/null+++ b/app/Services/Social/InstagramPublisher.php@@ -0,0 +1,229 @@+<?php++namespace App\Services\Social;++use App\Models\PostPlatform;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;++class InstagramPublisher+{+ private string $baseUrl = 'https://graph.facebook.com/v21.0';++ public function publish(PostPlatform $postPlatform): array+ {+ $account = $postPlatform->socialAccount;+ $instagramId = $account->platform_user_id;+ $accessToken = $account->access_token;++ $media = $postPlatform->media;++ if ($media->isEmpty()) {+ throw new \Exception('Instagram requires at least one image or video.');+ }++ $firstMedia = $media->first();+ $isVideo = str_starts_with($firstMedia->mime_type, 'video/');++ // Single media+ if ($media->count() === 1) {+ if ($isVideo) {+ return $this->publishReel($instagramId, $accessToken, $postPlatform->content, $firstMedia);+ }++ return $this->publishSingleImage($instagramId, $accessToken, $postPlatform->content, $firstMedia);+ }++ // Multiple media - carousel+ return $this->publishCarousel($instagramId, $accessToken, $postPlatform->content, $media);+ }++ private function publishSingleImage(string $instagramId, string $accessToken, string $content, $media): array+ {+ Log::info('Instagram publishing single image', ['instagram_id' => $instagramId]);++ // Step 1: Create container+ $containerResponse = Http::post("{$this->baseUrl}/{$instagramId}/media", [+ 'image_url' => $media->url,+ 'caption' => $content,+ 'access_token' => $accessToken,+ ]);++ if ($containerResponse->failed()) {+ Log::error('Instagram container creation failed', [+ 'status' => $containerResponse->status(),+ 'body' => $containerResponse->body(),+ ]);+ throw new \Exception('Instagram API error: '.$containerResponse->body());+ }++ $containerId = $containerResponse->json()['id'];++ // Step 2: Publish container+ return $this->publishContainer($instagramId, $accessToken, $containerId);+ }++ private function publishReel(string $instagramId, string $accessToken, string $content, $media): array+ {+ Log::info('Instagram publishing reel', ['instagram_id' => $instagramId]);++ // Step 1: Create container for video/reel+ $containerResponse = Http::post("{$this->baseUrl}/{$instagramId}/media", [+ 'video_url' => $media->url,+ 'caption' => $content,+ 'media_type' => 'REELS',+ 'access_token' => $accessToken,+ ]);++ if ($containerResponse->failed()) {+ Log::error('Instagram reel container creation failed', [+ 'status' => $containerResponse->status(),+ 'body' => $containerResponse->body(),+ ]);+ throw new \Exception('Instagram API error: '.$containerResponse->body());+ }++ $containerId = $containerResponse->json()['id'];++ // Wait for video processing+ $this->waitForMediaProcessing($containerId, $accessToken);++ // Step 2: Publish container+ return $this->publishContainer($instagramId, $accessToken, $containerId);+ }++ private function publishCarousel(string $instagramId, string $accessToken, string $content, $mediaCollection): array+ {+ Log::info('Instagram publishing carousel', [+ 'instagram_id' => $instagramId,+ 'media_count' => $mediaCollection->count(),+ ]);++ // Step 1: Create containers for each media item+ $childContainers = [];++ foreach ($mediaCollection as $media) {+ $isVideo = str_starts_with($media->mime_type, 'video/');++ $params = [+ 'is_carousel_item' => 'true',+ 'access_token' => $accessToken,+ ];++ if ($isVideo) {+ $params['video_url'] = $media->url;+ $params['media_type'] = 'VIDEO';+ } else {+ $params['image_url'] = $media->url;+ }++ $containerResponse = Http::post("{$this->baseUrl}/{$instagramId}/media", $params);++ if ($containerResponse->failed()) {+ Log::error('Instagram carousel item creation failed', [+ 'body' => $containerResponse->body(),+ ]);++ continue;+ }++ $childId = $containerResponse->json()['id'];++ // Wait for video processing if needed+ if ($isVideo) {+ $this->waitForMediaProcessing($childId, $accessToken);+ }++ $childContainers[] = $childId;+ }++ if (empty($childContainers)) {+ throw new \Exception('Failed to create any carousel items');+ }++ // Step 2: Create carousel container+ $carouselResponse = Http::post("{$this->baseUrl}/{$instagramId}/media", [+ 'media_type' => 'CAROUSEL',+ 'caption' => $content,+ 'children' => implode(',', $childContainers),+ 'access_token' => $accessToken,+ ]);++ if ($carouselResponse->failed()) {+ Log::error('Instagram carousel container creation failed', [+ 'body' => $carouselResponse->body(),+ ]);+ throw new \Exception('Instagram API error: '.$carouselResponse->body());+ }++ $carouselId = $carouselResponse->json()['id'];++ // Step 3: Publish carousel+ return $this->publishContainer($instagramId, $accessToken, $carouselId);+ }++ private function publishContainer(string $instagramId, string $accessToken, string $containerId): array+ {+ $publishResponse = Http::post("{$this->baseUrl}/{$instagramId}/media_publish", [+ 'creation_id' => $containerId,+ 'access_token' => $accessToken,+ ]);++ if ($publishResponse->failed()) {+ Log::error('Instagram publish failed', [+ 'status' => $publishResponse->status(),+ 'body' => $publishResponse->body(),+ ]);+ throw new \Exception('Instagram publish error: '.$publishResponse->body());+ }++ $mediaId = $publishResponse->json()['id'];++ // Get permalink+ $permalinkResponse = Http::get("{$this->baseUrl}/{$mediaId}", [+ 'fields' => 'permalink',+ 'access_token' => $accessToken,+ ]);++ $permalink = $permalinkResponse->json()['permalink'] ?? null;++ Log::info('Instagram publish success', ['media_id' => $mediaId, 'permalink' => $permalink]);++ return [+ 'id' => $mediaId,+ 'url' => $permalink,+ ];+ }++ private function waitForMediaProcessing(string $containerId, string $accessToken, int $maxAttempts = 30): void+ {+ for ($i = 0; $i < $maxAttempts; $i++) {+ $statusResponse = Http::get("{$this->baseUrl}/{$containerId}", [+ 'fields' => 'status_code',+ 'access_token' => $accessToken,+ ]);++ if ($statusResponse->failed()) {+ sleep(5);++ continue;+ }++ $status = $statusResponse->json()['status_code'] ?? 'UNKNOWN';++ Log::info('Instagram media processing status', ['status' => $status, 'attempt' => $i]);++ if ($status === 'FINISHED') {+ return;+ }++ if ($status === 'ERROR') {+ throw new \Exception('Instagram media processing failed');+ }++ sleep(5);+ }++ Log::warning('Instagram media processing timeout, proceeding anyway');+ }+}diff --git a/app/Services/Social/LinkedInPagePublisher.php b/app/Services/Social/LinkedInPagePublisher.phpindex ef1e0d905..8b33e693f 100644--- a/app/Services/Social/LinkedInPagePublisher.php+++ b/app/Services/Social/LinkedInPagePublisher.php@@ -3,14 +3,29 @@namespace App\Services\Social;use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Http\Client\PendingRequest;use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;class LinkedInPagePublisher{+ private string $baseUrl = 'https://api.linkedin.com';++ private string $apiVersion = '202501';++ private string $accessToken;+public function publish(PostPlatform $postPlatform): array{$account = $postPlatform->socialAccount;- $accessToken = $account->access_token;++ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $this->accessToken = $account->access_token;$organizationId = $account->meta['organization_id'] ?? null;@@ -22,48 +37,296 @@ class LinkedInPagePublisher$payload = ['author' => $organizationUrn,- 'lifecycleState' => 'PUBLISHED',- 'specificContent' => [- 'com.linkedin.ugc.ShareContent' => [- 'shareCommentary' => [- 'text' => $postPlatform->content,- ],- 'shareMediaCategory' => 'NONE',- ],- ],- 'visibility' => [- 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC',+ 'commentary' => $postPlatform->content,+ 'visibility' => 'PUBLIC',+ 'distribution' => [+ 'feedDistribution' => 'MAIN_FEED',+ 'targetEntities' => [],+ 'thirdPartyDistributionChannels' => [],],+ 'lifecycleState' => 'PUBLISHED',];$media = $postPlatform->media;if ($media->isNotEmpty()) {$firstMedia = $media->first();+ $mediaUrn = $this->uploadMedia($firstMedia, $organizationUrn);- if ($firstMedia->type->value === 'image') {- $payload['specificContent']['com.linkedin.ugc.ShareContent']['shareMediaCategory'] = 'IMAGE';- $payload['specificContent']['com.linkedin.ugc.ShareContent']['media'] = [- [- 'status' => 'READY',- 'originalUrl' => $firstMedia->url,+ if ($mediaUrn) {+ $payload['content'] = [+ 'media' => [+ 'id' => $mediaUrn,],];}}- $response = Http::withToken($accessToken)- ->post('https://api.linkedin.com/v2/ugcPosts', $payload);+ Log::info('LinkedIn Page creating post', ['payload' => $payload]);++ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/posts", $payload);if ($response->failed()) {- throw new \Exception("LinkedIn Page API error: " . $response->body());+ Log::error('LinkedIn Page post creation failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('LinkedIn Page API error: '.$response->body());}- $data = $response->json();+ $postId = $response->header('x-restli-id');++ // Build company page URL+ $username = $account->username;+ $postUrl = $username+ ? "https://www.linkedin.com/company/{$username}/posts/"+ : "https://www.linkedin.com/feed/update/{$postId}";return [- 'id' => $data['id'] ?? 'unknown',- 'url' => null,+ 'id' => $postId ?? 'unknown',+ 'url' => $postId ? $postUrl : null,];}++ private function getHttpClient(): PendingRequest+ {+ return Http::withToken($this->accessToken)+ ->withHeaders([+ 'X-Restli-Protocol-Version' => '2.0.0',+ 'LinkedIn-Version' => $this->apiVersion,+ 'Content-Type' => 'application/json',+ ])+ ->timeout(300);+ }++ private function uploadMedia($mediaItem, string $ownerUrn): ?string+ {+ $mimeType = $mediaItem->mime_type;+ $isVideo = str_starts_with($mimeType, 'video/');+ $isImage = str_starts_with($mimeType, 'image/');++ if ($isVideo) {+ return $this->uploadVideo($mediaItem, $ownerUrn);+ }++ if ($isImage) {+ return $this->uploadImage($mediaItem, $ownerUrn);+ }++ return null;+ }++ private function uploadImage($mediaItem, string $ownerUrn): ?string+ {+ Log::info('LinkedIn Page initializing image upload', ['owner' => $ownerUrn]);++ // Step 1: Initialize upload+ $initResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/images?action=initializeUpload", [+ 'initializeUploadRequest' => [+ 'owner' => $ownerUrn,+ ],+ ]);++ if ($initResponse->failed()) {+ Log::error('LinkedIn Page image init failed', ['body' => $initResponse->body()]);+ throw new \Exception('Failed to initialize LinkedIn Page image upload: '.$initResponse->body());+ }++ $initData = $initResponse->json();+ $uploadUrl = $initData['value']['uploadUrl'] ?? null;+ $imageUrn = $initData['value']['image'] ?? null;++ if (! $uploadUrl || ! $imageUrn) {+ throw new \Exception('LinkedIn Page image upload init missing uploadUrl or image URN');+ }++ Log::info('LinkedIn Page image init success', ['imageUrn' => $imageUrn]);++ // Step 2: Upload binary data+ $imageContent = file_get_contents($mediaItem->url);++ $uploadResponse = Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/octet-stream',+ ])+ ->withBody($imageContent, 'application/octet-stream')+ ->put($uploadUrl);++ if ($uploadResponse->failed()) {+ Log::error('LinkedIn Page image upload failed', ['body' => $uploadResponse->body()]);+ throw new \Exception('Failed to upload LinkedIn Page image: '.$uploadResponse->body());+ }++ Log::info('LinkedIn Page image upload success', ['imageUrn' => $imageUrn]);++ return $imageUrn;+ }++ private function uploadVideo($mediaItem, string $ownerUrn): ?string+ {+ $videoContent = file_get_contents($mediaItem->url);+ $fileSize = strlen($videoContent);++ Log::info('LinkedIn Page initializing video upload', [+ 'owner' => $ownerUrn,+ 'fileSize' => $fileSize,+ ]);++ // Step 1: Initialize upload+ $initResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/videos?action=initializeUpload", [+ 'initializeUploadRequest' => [+ 'owner' => $ownerUrn,+ 'fileSizeBytes' => $fileSize,+ 'uploadCaptions' => false,+ 'uploadThumbnail' => false,+ ],+ ]);++ if ($initResponse->failed()) {+ Log::error('LinkedIn Page video init failed', ['body' => $initResponse->body()]);+ throw new \Exception('Failed to initialize LinkedIn Page video upload: '.$initResponse->body());+ }++ $initData = $initResponse->json();+ $videoUrn = $initData['value']['video'] ?? null;+ $uploadInstructions = $initData['value']['uploadInstructions'] ?? [];+ $uploadToken = $initData['value']['uploadToken'] ?? '';++ if (! $videoUrn || empty($uploadInstructions)) {+ throw new \Exception('LinkedIn Page video upload init missing video URN or upload instructions');+ }++ Log::info('LinkedIn Page video init success', [+ 'videoUrn' => $videoUrn,+ 'chunks' => count($uploadInstructions),+ ]);++ // Step 2: Upload chunks+ $uploadedPartIds = [];++ foreach ($uploadInstructions as $index => $instruction) {+ $uploadUrl = $instruction['uploadUrl'];+ $firstByte = $instruction['firstByte'];+ $lastByte = $instruction['lastByte'];++ $chunkData = substr($videoContent, $firstByte, $lastByte - $firstByte + 1);++ Log::info('LinkedIn Page uploading video chunk', [+ 'index' => $index,+ 'firstByte' => $firstByte,+ 'lastByte' => $lastByte,+ 'chunkSize' => strlen($chunkData),+ ]);++ $chunkResponse = Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/octet-stream',+ ])+ ->timeout(600)+ ->withBody($chunkData, 'application/octet-stream')+ ->put($uploadUrl);++ if ($chunkResponse->failed()) {+ Log::error('LinkedIn Page video chunk upload failed', [+ 'index' => $index,+ 'body' => $chunkResponse->body(),+ ]);+ throw new \Exception('Failed to upload LinkedIn Page video chunk: '.$chunkResponse->body());+ }++ $etag = $chunkResponse->header('etag');+ if ($etag) {+ $uploadedPartIds[] = $etag;+ }++ Log::info('LinkedIn Page video chunk uploaded', ['index' => $index, 'etag' => $etag]);+ }++ // Step 3: Finalize upload+ Log::info('LinkedIn Page finalizing video upload', ['videoUrn' => $videoUrn]);++ $finalizeResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/videos?action=finalizeUpload", [+ 'finalizeUploadRequest' => [+ 'video' => $videoUrn,+ 'uploadToken' => $uploadToken,+ 'uploadedPartIds' => $uploadedPartIds,+ ],+ ]);++ if ($finalizeResponse->failed()) {+ Log::error('LinkedIn Page video finalize failed', ['body' => $finalizeResponse->body()]);+ throw new \Exception('Failed to finalize LinkedIn Page video upload: '.$finalizeResponse->body());+ }++ Log::info('LinkedIn Page video upload finalized', ['videoUrn' => $videoUrn]);++ // Step 4: Wait for processing+ $this->waitForVideoProcessing($videoUrn);++ return $videoUrn;+ }++ private function waitForVideoProcessing(string $videoUrn, int $maxAttempts = 30): void+ {+ $encodedUrn = urlencode($videoUrn);++ for ($i = 0; $i < $maxAttempts; $i++) {+ $response = $this->getHttpClient()+ ->get("{$this->baseUrl}/rest/videos/{$encodedUrn}");++ if ($response->failed()) {+ Log::warning('LinkedIn Page video status check failed', ['attempt' => $i]);+ sleep(5);++ continue;+ }++ $data = $response->json();+ $status = $data['status'] ?? 'UNKNOWN';++ Log::info('LinkedIn Page video processing status', ['status' => $status, 'attempt' => $i]);++ if ($status === 'AVAILABLE') {+ return;+ }++ if ($status === 'PROCESSING_FAILED') {+ throw new \Exception('LinkedIn Page video processing failed');+ }++ sleep(5);+ }++ Log::warning('LinkedIn Page video processing timeout, proceeding anyway');+ }++ private function refreshToken(SocialAccount $account): void+ {+ if (! $account->refresh_token) {+ throw new \Exception('No refresh token available for LinkedIn Page account');+ }++ $response = Http::asForm()->post('https://www.linkedin.com/oauth/v2/accessToken', [+ 'grant_type' => 'refresh_token',+ 'refresh_token' => $account->refresh_token,+ 'client_id' => config('services.linkedin-openid.client_id'),+ 'client_secret' => config('services.linkedin-openid.client_secret'),+ ]);++ if ($response->failed()) {+ throw new \Exception('Failed to refresh LinkedIn Page token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'refresh_token' => $data['refresh_token'] ?? $account->refresh_token,+ 'token_expires_at' => isset($data['expires_in']) ? now()->addSeconds($data['expires_in']) : null,+ ]);+ }}diff --git a/app/Services/Social/LinkedInPublisher.php b/app/Services/Social/LinkedInPublisher.phpindex 18949e530..8f4cb21ea 100644--- a/app/Services/Social/LinkedInPublisher.php+++ b/app/Services/Social/LinkedInPublisher.php@@ -3,61 +3,318 @@namespace App\Services\Social;use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Http\Client\PendingRequest;use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;class LinkedInPublisher{+ private string $baseUrl = 'https://api.linkedin.com';++ private string $apiVersion = '202501';++ private string $accessToken;+public function publish(PostPlatform $postPlatform): array{$account = $postPlatform->socialAccount;- $accessToken = $account->access_token;++ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $this->accessToken = $account->access_token;$personUrn = "urn:li:person:{$account->platform_user_id}";$payload = ['author' => $personUrn,- 'lifecycleState' => 'PUBLISHED',- 'specificContent' => [- 'com.linkedin.ugc.ShareContent' => [- 'shareCommentary' => [- 'text' => $postPlatform->content,- ],- 'shareMediaCategory' => 'NONE',- ],- ],- 'visibility' => [- 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC',+ 'commentary' => $postPlatform->content,+ 'visibility' => 'PUBLIC',+ 'distribution' => [+ 'feedDistribution' => 'MAIN_FEED',+ 'targetEntities' => [],+ 'thirdPartyDistributionChannels' => [],],+ 'lifecycleState' => 'PUBLISHED',];$media = $postPlatform->media;if ($media->isNotEmpty()) {$firstMedia = $media->first();+ $mediaUrn = $this->uploadMedia($firstMedia, $personUrn);- if ($firstMedia->type->value === 'image') {- $payload['specificContent']['com.linkedin.ugc.ShareContent']['shareMediaCategory'] = 'IMAGE';- $payload['specificContent']['com.linkedin.ugc.ShareContent']['media'] = [- [- 'status' => 'READY',- 'originalUrl' => $firstMedia->url,+ if ($mediaUrn) {+ $payload['content'] = [+ 'media' => [+ 'id' => $mediaUrn,],];}}- $response = Http::withToken($accessToken)- ->post('https://api.linkedin.com/v2/ugcPosts', $payload);+ Log::info('LinkedIn creating post', ['payload' => $payload]);++ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/posts", $payload);if ($response->failed()) {- throw new \Exception("LinkedIn API error: " . $response->body());+ Log::error('LinkedIn post creation failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('LinkedIn API error: '.$response->body());}- $data = $response->json();+ $postId = $response->header('x-restli-id');return [- 'id' => $data['id'] ?? 'unknown',- 'url' => null,+ 'id' => $postId ?? 'unknown',+ 'url' => $postId ? "https://www.linkedin.com/feed/update/{$postId}" : null,];}++ private function getHttpClient(): PendingRequest+ {+ return Http::withToken($this->accessToken)+ ->withHeaders([+ 'X-Restli-Protocol-Version' => '2.0.0',+ 'LinkedIn-Version' => $this->apiVersion,+ 'Content-Type' => 'application/json',+ ])+ ->timeout(300);+ }++ private function uploadMedia($mediaItem, string $ownerUrn): ?string+ {+ $mimeType = $mediaItem->mime_type;+ $isVideo = str_starts_with($mimeType, 'video/');+ $isImage = str_starts_with($mimeType, 'image/');++ if ($isVideo) {+ return $this->uploadVideo($mediaItem, $ownerUrn);+ }++ if ($isImage) {+ return $this->uploadImage($mediaItem, $ownerUrn);+ }++ return null;+ }++ private function uploadImage($mediaItem, string $ownerUrn): ?string+ {+ Log::info('LinkedIn initializing image upload', ['owner' => $ownerUrn]);++ // Step 1: Initialize upload+ $initResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/images?action=initializeUpload", [+ 'initializeUploadRequest' => [+ 'owner' => $ownerUrn,+ ],+ ]);++ if ($initResponse->failed()) {+ Log::error('LinkedIn image init failed', ['body' => $initResponse->body()]);+ throw new \Exception('Failed to initialize LinkedIn image upload: '.$initResponse->body());+ }++ $initData = $initResponse->json();+ $uploadUrl = $initData['value']['uploadUrl'] ?? null;+ $imageUrn = $initData['value']['image'] ?? null;++ if (! $uploadUrl || ! $imageUrn) {+ throw new \Exception('LinkedIn image upload init missing uploadUrl or image URN');+ }++ Log::info('LinkedIn image init success', ['imageUrn' => $imageUrn]);++ // Step 2: Upload binary data+ $imageContent = file_get_contents($mediaItem->url);++ $uploadResponse = Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/octet-stream',+ ])+ ->withBody($imageContent, 'application/octet-stream')+ ->put($uploadUrl);++ if ($uploadResponse->failed()) {+ Log::error('LinkedIn image upload failed', ['body' => $uploadResponse->body()]);+ throw new \Exception('Failed to upload LinkedIn image: '.$uploadResponse->body());+ }++ Log::info('LinkedIn image upload success', ['imageUrn' => $imageUrn]);++ return $imageUrn;+ }++ private function uploadVideo($mediaItem, string $ownerUrn): ?string+ {+ $videoContent = file_get_contents($mediaItem->url);+ $fileSize = strlen($videoContent);++ Log::info('LinkedIn initializing video upload', [+ 'owner' => $ownerUrn,+ 'fileSize' => $fileSize,+ ]);++ // Step 1: Initialize upload+ $initResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/videos?action=initializeUpload", [+ 'initializeUploadRequest' => [+ 'owner' => $ownerUrn,+ 'fileSizeBytes' => $fileSize,+ 'uploadCaptions' => false,+ 'uploadThumbnail' => false,+ ],+ ]);++ if ($initResponse->failed()) {+ Log::error('LinkedIn video init failed', ['body' => $initResponse->body()]);+ throw new \Exception('Failed to initialize LinkedIn video upload: '.$initResponse->body());+ }++ $initData = $initResponse->json();+ $videoUrn = $initData['value']['video'] ?? null;+ $uploadInstructions = $initData['value']['uploadInstructions'] ?? [];+ $uploadToken = $initData['value']['uploadToken'] ?? '';++ if (! $videoUrn || empty($uploadInstructions)) {+ throw new \Exception('LinkedIn video upload init missing video URN or upload instructions');+ }++ Log::info('LinkedIn video init success', [+ 'videoUrn' => $videoUrn,+ 'chunks' => count($uploadInstructions),+ ]);++ // Step 2: Upload chunks+ $uploadedPartIds = [];++ foreach ($uploadInstructions as $index => $instruction) {+ $uploadUrl = $instruction['uploadUrl'];+ $firstByte = $instruction['firstByte'];+ $lastByte = $instruction['lastByte'];++ $chunkData = substr($videoContent, $firstByte, $lastByte - $firstByte + 1);++ Log::info('LinkedIn uploading video chunk', [+ 'index' => $index,+ 'firstByte' => $firstByte,+ 'lastByte' => $lastByte,+ 'chunkSize' => strlen($chunkData),+ ]);++ $chunkResponse = Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/octet-stream',+ ])+ ->timeout(600)+ ->withBody($chunkData, 'application/octet-stream')+ ->put($uploadUrl);++ if ($chunkResponse->failed()) {+ Log::error('LinkedIn video chunk upload failed', [+ 'index' => $index,+ 'body' => $chunkResponse->body(),+ ]);+ throw new \Exception('Failed to upload LinkedIn video chunk: '.$chunkResponse->body());+ }++ $etag = $chunkResponse->header('etag');+ if ($etag) {+ $uploadedPartIds[] = $etag;+ }++ Log::info('LinkedIn video chunk uploaded', ['index' => $index, 'etag' => $etag]);+ }++ // Step 3: Finalize upload+ Log::info('LinkedIn finalizing video upload', ['videoUrn' => $videoUrn]);++ $finalizeResponse = $this->getHttpClient()+ ->post("{$this->baseUrl}/rest/videos?action=finalizeUpload", [+ 'finalizeUploadRequest' => [+ 'video' => $videoUrn,+ 'uploadToken' => $uploadToken,+ 'uploadedPartIds' => $uploadedPartIds,+ ],+ ]);++ if ($finalizeResponse->failed()) {+ Log::error('LinkedIn video finalize failed', ['body' => $finalizeResponse->body()]);+ throw new \Exception('Failed to finalize LinkedIn video upload: '.$finalizeResponse->body());+ }++ Log::info('LinkedIn video upload finalized', ['videoUrn' => $videoUrn]);++ // Step 4: Wait for processing+ $this->waitForVideoProcessing($videoUrn);++ return $videoUrn;+ }++ private function waitForVideoProcessing(string $videoUrn, int $maxAttempts = 30): void+ {+ $encodedUrn = urlencode($videoUrn);++ for ($i = 0; $i < $maxAttempts; $i++) {+ $response = $this->getHttpClient()+ ->get("{$this->baseUrl}/rest/videos/{$encodedUrn}");++ if ($response->failed()) {+ Log::warning('LinkedIn video status check failed', ['attempt' => $i]);+ sleep(5);++ continue;+ }++ $data = $response->json();+ $status = $data['status'] ?? 'UNKNOWN';++ Log::info('LinkedIn video processing status', ['status' => $status, 'attempt' => $i]);++ if ($status === 'AVAILABLE') {+ return;+ }++ if ($status === 'PROCESSING_FAILED') {+ throw new \Exception('LinkedIn video processing failed');+ }++ sleep(5);+ }++ Log::warning('LinkedIn video processing timeout, proceeding anyway');+ }++ private function refreshToken(SocialAccount $account): void+ {+ if (! $account->refresh_token) {+ throw new \Exception('No refresh token available for LinkedIn account');+ }++ $response = Http::asForm()->post('https://www.linkedin.com/oauth/v2/accessToken', [+ 'grant_type' => 'refresh_token',+ 'refresh_token' => $account->refresh_token,+ 'client_id' => config('services.linkedin.client_id'),+ 'client_secret' => config('services.linkedin.client_secret'),+ ]);++ if ($response->failed()) {+ throw new \Exception('Failed to refresh LinkedIn token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'refresh_token' => $data['refresh_token'] ?? $account->refresh_token,+ 'token_expires_at' => isset($data['expires_in']) ? now()->addSeconds($data['expires_in']) : null,+ ]);+ }}diff --git a/app/Services/Social/ThreadsPublisher.php b/app/Services/Social/ThreadsPublisher.phpnew file mode 100644index 000000000..9edd7242d--- /dev/null+++ b/app/Services/Social/ThreadsPublisher.php@@ -0,0 +1,287 @@+<?php++namespace App\Services\Social;++use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;++class ThreadsPublisher+{+ private string $baseUrl = 'https://graph.threads.net/v1.0';++ public function publish(PostPlatform $postPlatform): array+ {+ $account = $postPlatform->socialAccount;++ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $userId = $account->platform_user_id;+ $accessToken = $account->access_token;++ $media = $postPlatform->media;++ // Text only post+ if ($media->isEmpty()) {+ return $this->publishTextPost($userId, $accessToken, $postPlatform->content);+ }++ $firstMedia = $media->first();+ $isVideo = str_starts_with($firstMedia->mime_type, 'video/');++ // Single media+ if ($media->count() === 1) {+ if ($isVideo) {+ return $this->publishVideoPost($userId, $accessToken, $postPlatform->content, $firstMedia);+ }++ return $this->publishImagePost($userId, $accessToken, $postPlatform->content, $firstMedia);+ }++ // Multiple media - carousel+ return $this->publishCarousel($userId, $accessToken, $postPlatform->content, $media);+ }++ private function publishTextPost(string $userId, string $accessToken, string $content): array+ {+ Log::info('Threads publishing text post', ['user_id' => $userId]);++ // Step 1: Create container+ $containerResponse = Http::post("{$this->baseUrl}/{$userId}/threads", [+ 'media_type' => 'TEXT',+ 'text' => $content,+ 'access_token' => $accessToken,+ ]);++ if ($containerResponse->failed()) {+ Log::error('Threads container creation failed', [+ 'status' => $containerResponse->status(),+ 'body' => $containerResponse->body(),+ ]);+ throw new \Exception('Threads API error: '.$containerResponse->body());+ }++ $containerId = $containerResponse->json()['id'];++ // Step 2: Publish+ return $this->publishContainer($userId, $accessToken, $containerId);+ }++ private function publishImagePost(string $userId, string $accessToken, string $content, $media): array+ {+ Log::info('Threads publishing image post', ['user_id' => $userId]);++ // Step 1: Create container+ $containerResponse = Http::post("{$this->baseUrl}/{$userId}/threads", [+ 'media_type' => 'IMAGE',+ 'image_url' => $media->url,+ 'text' => $content,+ 'access_token' => $accessToken,+ ]);++ if ($containerResponse->failed()) {+ Log::error('Threads image container creation failed', [+ 'status' => $containerResponse->status(),+ 'body' => $containerResponse->body(),+ ]);+ throw new \Exception('Threads API error: '.$containerResponse->body());+ }++ $containerId = $containerResponse->json()['id'];++ // Step 2: Publish+ return $this->publishContainer($userId, $accessToken, $containerId);+ }++ private function publishVideoPost(string $userId, string $accessToken, string $content, $media): array+ {+ Log::info('Threads publishing video post', ['user_id' => $userId]);++ // Step 1: Create container+ $containerResponse = Http::post("{$this->baseUrl}/{$userId}/threads", [+ 'media_type' => 'VIDEO',+ 'video_url' => $media->url,+ 'text' => $content,+ 'access_token' => $accessToken,+ ]);++ if ($containerResponse->failed()) {+ Log::error('Threads video container creation failed', [+ 'status' => $containerResponse->status(),+ 'body' => $containerResponse->body(),+ ]);+ throw new \Exception('Threads API error: '.$containerResponse->body());+ }++ $containerId = $containerResponse->json()['id'];++ // Wait for video processing+ $this->waitForMediaProcessing($containerId, $accessToken);++ // Step 2: Publish+ return $this->publishContainer($userId, $accessToken, $containerId);+ }++ private function publishCarousel(string $userId, string $accessToken, string $content, $mediaCollection): array+ {+ Log::info('Threads publishing carousel', [+ 'user_id' => $userId,+ 'media_count' => $mediaCollection->count(),+ ]);++ // Step 1: Create containers for each media item+ $childContainers = [];++ foreach ($mediaCollection as $media) {+ $isVideo = str_starts_with($media->mime_type, 'video/');++ $params = [+ 'is_carousel_item' => 'true',+ 'access_token' => $accessToken,+ ];++ if ($isVideo) {+ $params['media_type'] = 'VIDEO';+ $params['video_url'] = $media->url;+ } else {+ $params['media_type'] = 'IMAGE';+ $params['image_url'] = $media->url;+ }++ $containerResponse = Http::post("{$this->baseUrl}/{$userId}/threads", $params);++ if ($containerResponse->failed()) {+ Log::error('Threads carousel item creation failed', [+ 'body' => $containerResponse->body(),+ ]);++ continue;+ }++ $childId = $containerResponse->json()['id'];++ // Wait for video processing if needed+ if ($isVideo) {+ $this->waitForMediaProcessing($childId, $accessToken);+ }++ $childContainers[] = $childId;+ }++ if (empty($childContainers)) {+ throw new \Exception('Failed to create any carousel items');+ }++ // Step 2: Create carousel container+ $carouselResponse = Http::post("{$this->baseUrl}/{$userId}/threads", [+ 'media_type' => 'CAROUSEL',+ 'text' => $content,+ 'children' => implode(',', $childContainers),+ 'access_token' => $accessToken,+ ]);++ if ($carouselResponse->failed()) {+ Log::error('Threads carousel container creation failed', [+ 'body' => $carouselResponse->body(),+ ]);+ throw new \Exception('Threads API error: '.$carouselResponse->body());+ }++ $carouselId = $carouselResponse->json()['id'];++ // Step 3: Publish carousel+ return $this->publishContainer($userId, $accessToken, $carouselId);+ }++ private function publishContainer(string $userId, string $accessToken, string $containerId): array+ {+ $publishResponse = Http::post("{$this->baseUrl}/{$userId}/threads_publish", [+ 'creation_id' => $containerId,+ 'access_token' => $accessToken,+ ]);++ if ($publishResponse->failed()) {+ Log::error('Threads publish failed', [+ 'status' => $publishResponse->status(),+ 'body' => $publishResponse->body(),+ ]);+ throw new \Exception('Threads publish error: '.$publishResponse->body());+ }++ $mediaId = $publishResponse->json()['id'];++ // Get permalink+ $permalinkResponse = Http::get("{$this->baseUrl}/{$mediaId}", [+ 'fields' => 'permalink',+ 'access_token' => $accessToken,+ ]);++ $permalink = $permalinkResponse->json()['permalink'] ?? null;++ Log::info('Threads publish success', ['media_id' => $mediaId, 'permalink' => $permalink]);++ return [+ 'id' => $mediaId,+ 'url' => $permalink,+ ];+ }++ private function waitForMediaProcessing(string $containerId, string $accessToken, int $maxAttempts = 30): void+ {+ for ($i = 0; $i < $maxAttempts; $i++) {+ $statusResponse = Http::get("{$this->baseUrl}/{$containerId}", [+ 'fields' => 'status',+ 'access_token' => $accessToken,+ ]);++ if ($statusResponse->failed()) {+ sleep(3);++ continue;+ }++ $status = $statusResponse->json()['status'] ?? 'UNKNOWN';++ Log::info('Threads media processing status', ['status' => $status, 'attempt' => $i]);++ if ($status === 'FINISHED') {+ return;+ }++ if ($status === 'ERROR') {+ throw new \Exception('Threads media processing failed');+ }++ sleep(3);+ }++ Log::warning('Threads media processing timeout, proceeding anyway');+ }++ private function refreshToken(SocialAccount $account): void+ {+ // Threads uses long-lived tokens that can be refreshed+ $response = Http::get('https://graph.threads.net/refresh_access_token', [+ 'grant_type' => 'th_refresh_token',+ 'access_token' => $account->access_token,+ ]);++ if ($response->failed()) {+ Log::error('Threads token refresh failed', ['body' => $response->body()]);+ throw new \Exception('Failed to refresh Threads token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'token_expires_at' => isset($data['expires_in']) ? now()->addSeconds($data['expires_in']) : null,+ ]);++ Log::info('Threads token refreshed successfully');+ }+}diff --git a/app/Services/Social/TikTokPublisher.php b/app/Services/Social/TikTokPublisher.phpindex 7aba304c9..73ab5abaa 100644--- a/app/Services/Social/TikTokPublisher.php+++ b/app/Services/Social/TikTokPublisher.php@@ -3,43 +3,249 @@namespace App\Services\Social;use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Http\Client\PendingRequest;use Illuminate\Support\Facades\Http;-use Illuminate\Support\Facades\Storage;+use Illuminate\Support\Facades\Log;class TikTokPublisher{+ private string $baseUrl = 'https://open.tiktokapis.com/v2';++ private string $accessToken;+public function publish(PostPlatform $postPlatform): array{$account = $postPlatform->socialAccount;- $accessToken = $account->access_token;- $media = $postPlatform->media->first();+ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $this->accessToken = $account->access_token;++ $media = $postPlatform->media;- if (! $media || $media->type->value !== 'video') {- throw new \Exception('TikTok requires a video to publish.');+ if ($media->isEmpty()) {+ throw new \Exception('TikTok requires media (video or photos) to publish.');}- $response = Http::withToken($accessToken)- ->post('https://open.tiktokapis.com/v2/post/publish/inbox/video/init/', [+ $firstMedia = $media->first();+ $isVideo = str_starts_with($firstMedia->mime_type, 'video/');+ $isImage = str_starts_with($firstMedia->mime_type, 'image/');++ if ($isVideo) {+ return $this->publishVideo($postPlatform, $firstMedia);+ }++ if ($isImage) {+ return $this->publishPhotos($postPlatform, $media);+ }++ throw new \Exception('TikTok only supports video or image content.');+ }++ private function getHttpClient(): PendingRequest+ {+ return Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/json; charset=UTF-8',+ ])+ ->timeout(120);+ }++ private function publishVideo(PostPlatform $postPlatform, $media): array+ {+ Log::info('TikTok publishing video', [+ 'video_url' => $media->url,+ 'content' => $postPlatform->content,+ ]);++ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/post/publish/video/init/", [+ 'post_info' => [+ 'title' => $postPlatform->content,+ 'privacy_level' => 'PUBLIC_TO_EVERYONE',+ 'disable_duet' => false,+ 'disable_comment' => false,+ 'disable_stitch' => false,+ ],'source_info' => ['source' => 'PULL_FROM_URL','video_url' => $media->url,],+ ]);++ if ($response->failed()) {+ Log::error('TikTok video publish failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('TikTok API error: '.$response->body());+ }++ $data = $response->json();++ Log::info('TikTok video init response', ['data' => $data]);++ $publishId = $data['data']['publish_id'] ?? null;++ if (! $publishId) {+ throw new \Exception('TikTok did not return a publish_id');+ }++ // Wait for processing and get final status+ $finalStatus = $this->waitForPublishStatus($publishId);++ return [+ 'id' => $publishId,+ 'url' => $this->buildTikTokUrl($postPlatform->socialAccount),+ ];+ }++ private function publishPhotos(PostPlatform $postPlatform, $mediaCollection): array+ {+ $photoUrls = $mediaCollection+ ->filter(fn ($m) => str_starts_with($m->mime_type, 'image/'))+ ->map(fn ($m) => $m->url)+ ->values()+ ->toArray();++ if (empty($photoUrls)) {+ throw new \Exception('No valid images found for TikTok photo post');+ }++ Log::info('TikTok publishing photos', [+ 'photo_count' => count($photoUrls),+ 'content' => $postPlatform->content,+ ]);++ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/post/publish/content/init/", ['post_info' => ['title' => $postPlatform->content,'privacy_level' => 'PUBLIC_TO_EVERYONE',+ 'disable_comment' => false,],+ 'source_info' => [+ 'source' => 'PULL_FROM_URL',+ 'photo_cover_index' => 0,+ 'photo_images' => $photoUrls,+ ],+ 'post_mode' => 'DIRECT_POST',+ 'media_type' => 'PHOTO',]);if ($response->failed()) {- throw new \Exception("TikTok API error: " . $response->body());+ Log::error('TikTok photo publish failed', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('TikTok API error: '.$response->body());}$data = $response->json();+ Log::info('TikTok photo init response', ['data' => $data]);++ $publishId = $data['data']['publish_id'] ?? null;++ if (! $publishId) {+ throw new \Exception('TikTok did not return a publish_id');+ }++ // Wait for processing and get final status+ $finalStatus = $this->waitForPublishStatus($publishId);+return [- 'id' => $data['data']['publish_id'] ?? 'unknown',- 'url' => null,+ 'id' => $publishId,+ 'url' => $this->buildTikTokUrl($postPlatform->socialAccount),];}++ private function waitForPublishStatus(string $publishId, int $maxAttempts = 20): array+ {+ for ($i = 0; $i < $maxAttempts; $i++) {+ sleep(3);++ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/post/publish/status/fetch/", [+ 'publish_id' => $publishId,+ ]);++ if ($response->failed()) {+ Log::warning('TikTok status check failed', [+ 'attempt' => $i,+ 'body' => $response->body(),+ ]);++ continue;+ }++ $data = $response->json();+ $status = $data['data']['status'] ?? 'UNKNOWN';++ Log::info('TikTok publish status', [+ 'status' => $status,+ 'attempt' => $i,+ 'data' => $data,+ ]);++ if ($status === 'PUBLISH_COMPLETE') {+ return $data['data'] ?? [];+ }++ if (in_array($status, ['FAILED', 'PUBLISH_FAILED'])) {+ $errorCode = $data['data']['fail_reason'] ?? 'Unknown error';+ throw new \Exception("TikTok publish failed: {$errorCode}");+ }++ // PROCESSING_UPLOAD, PROCESSING_DOWNLOAD, SENDING_TO_USER_INBOX - continue waiting+ }++ Log::warning('TikTok publish status timeout, returning publish_id anyway');++ return ['publish_id' => $publishId];+ }++ private function buildTikTokUrl(SocialAccount $account): ?string+ {+ $username = $account->username;++ if ($username) {+ return "https://www.tiktok.com/@{$username}";+ }++ return null;+ }++ private function refreshToken(SocialAccount $account): void+ {+ if (! $account->refresh_token) {+ throw new \Exception('No refresh token available for TikTok account');+ }++ $response = Http::asForm()->post('https://open.tiktokapis.com/v2/oauth/token/', [+ 'client_key' => config('services.tiktok.client_id'),+ 'client_secret' => config('services.tiktok.client_secret'),+ 'grant_type' => 'refresh_token',+ 'refresh_token' => $account->refresh_token,+ ]);++ if ($response->failed()) {+ Log::error('TikTok token refresh failed', ['body' => $response->body()]);+ throw new \Exception('Failed to refresh TikTok token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'refresh_token' => $data['refresh_token'] ?? $account->refresh_token,+ 'token_expires_at' => isset($data['expires_in']) ? now()->addSeconds($data['expires_in']) : null,+ ]);++ Log::info('TikTok token refreshed successfully');+ }}diff --git a/app/Services/Social/XPublisher.php b/app/Services/Social/XPublisher.phpindex 395b06f9d..045e0f022 100644--- a/app/Services/Social/XPublisher.php+++ b/app/Services/Social/XPublisher.php@@ -3,47 +3,69 @@namespace App\Services\Social;use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Http\Client\PendingRequest;use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;class XPublisher{+ private string $baseUrl = 'https://api.x.com';++ private string $accessToken;+public function publish(PostPlatform $postPlatform): array{$account = $postPlatform->socialAccount;- $accessToken = $account->access_token;- $payload = [+ // Refresh token if expired or expiring soon+ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $this->accessToken = $account->access_token;++ $data = ['text' => $postPlatform->content,];+ $mediaIds = [];$media = $postPlatform->media;if ($media->isNotEmpty()) {- $mediaIds = [];-foreach ($media as $mediaItem) {- $uploadedMediaId = $this->uploadMedia($accessToken, $mediaItem);- if ($uploadedMediaId) {- $mediaIds[] = $uploadedMediaId;+ Log::info('Uploading media to X', [+ 'url' => $mediaItem->url,+ 'mime_type' => $mediaItem->mime_type,+ ]);++ $uploadedMedia = $this->uploadMedia($mediaItem);++ Log::info('X media upload response', ['response' => $uploadedMedia]);++ // v2 API returns data.id, v1 returns media_id+ $mediaId = $uploadedMedia['data']['id'] ?? $uploadedMedia['media_id'] ?? null;+ if ($mediaId) {+ $mediaIds[] = $mediaId;}}+ }- if (! empty($mediaIds)) {- $payload['media'] = [- 'media_ids' => $mediaIds,- ];- }+ if (! empty($mediaIds)) {+ $data['media'] = [+ 'media_ids' => $mediaIds,+ ];}- $response = Http::withToken($accessToken)- ->post('https://api.twitter.com/2/tweets', $payload);+ Log::info('Posting tweet', ['data' => $data]);- if ($response->failed()) {- throw new \Exception("X API error: " . $response->body());- }+ $response = $this->getHttpClient()+ ->post("{$this->baseUrl}/2/tweets", $data)+ ->throw()+ ->json();- $data = $response->json();- $tweetId = $data['data']['id'] ?? null;+ $tweetId = $response['data']['id'] ?? null;return ['id' => $tweetId ?? 'unknown',@@ -51,8 +73,259 @@ class XPublisher];}- private function uploadMedia(string $accessToken, $mediaItem): ?string+ private function getHttpClient(): PendingRequest+ {+ return Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => 'application/json',+ 'Accept' => 'application/json',+ ])+ ->timeout(360);+ }++ private function uploadMedia($mediaItem): ?array{+ $mediaContent = file_get_contents($mediaItem->url);+ $mimeType = $mediaItem->mime_type;+ $fileSize = strlen($mediaContent);++ // Create temp file+ $tempFile = tempnam(sys_get_temp_dir(), 'x_media_');+ file_put_contents($tempFile, $mediaContent);++ try {+ $mediaCategory = $this->getMediaCategory($mimeType, $fileSize);++ $isVideo = str_starts_with($mimeType, 'video/');+ $isGif = $mimeType === 'image/gif';++ // Use chunked upload for:+ // - Videos (always)+ // - GIFs (need async processing)+ // - Files > 5MB (API limit for simple upload)+ $useChunkedUpload = $isVideo || $isGif || $fileSize > 5 * 1024 * 1024;++ if ($useChunkedUpload) {+ return $this->chunkedUpload($mediaContent, $mimeType, $mediaCategory);+ }++ // Simple upload for small images+ $response = Http::withToken($this->accessToken)+ ->timeout(360)+ ->attach(+ 'media',+ file_get_contents($tempFile),+ basename($tempFile),+ ['Content-Type' => $mimeType]+ );++ $formParams = [];+ if ($mediaCategory) {+ $formParams['media_category'] = $mediaCategory;+ }++ $response = $response->post("{$this->baseUrl}/2/media/upload", $formParams);++ if ($response->failed()) {+ Log::error('X media upload error', [+ 'status' => $response->status(),+ 'body' => $response->body(),+ ]);+ throw new \Exception('Failed to upload media: '.$response->status().' - '.$response->body());+ }++ $responseData = $response->json();++ // v2 API returns data.id+ $mediaId = $responseData['data']['id'] ?? $responseData['media_id'] ?? null;++ if ($isGif && $mediaId) {+ $this->waitForProcessing($mediaId);+ }++ return $responseData;+ } finally {+ if (file_exists($tempFile)) {+ unlink($tempFile);+ }+ }+ }++ private function chunkedUpload(string $mediaContent, string $mimeType, string $mediaCategory): array+ {+ $totalBytes = strlen($mediaContent);++ Log::info('X chunked upload INIT', [+ 'total_bytes' => $totalBytes,+ 'media_type' => $mimeType,+ 'media_category' => $mediaCategory,+ ]);++ // INIT - Use dedicated initialize endpoint+ $initResponse = Http::withToken($this->accessToken)+ ->timeout(60)+ ->post("{$this->baseUrl}/2/media/upload/initialize", [+ 'media_type' => $mimeType,+ 'media_category' => $mediaCategory,+ 'total_bytes' => $totalBytes,+ ]);++ if ($initResponse->failed()) {+ Log::error('X chunked upload INIT error', [+ 'status' => $initResponse->status(),+ 'body' => $initResponse->body(),+ ]);+ throw new \Exception('Failed to initialize chunked upload: '.$initResponse->body());+ }++ $initData = $initResponse->json();+ $mediaId = $initData['data']['id'] ?? $initData['media_id'] ?? null;++ if (! $mediaId) {+ throw new \Exception('No media_id returned from INIT');+ }++ Log::info('X chunked upload INIT success', ['media_id' => $mediaId]);++ // APPEND - Upload in 1MB chunks (API limit)+ $chunkSize = 1 * 1024 * 1024;+ $chunks = str_split($mediaContent, $chunkSize);++ foreach ($chunks as $index => $chunk) {+ Log::info('X chunked upload APPEND', [+ 'media_id' => $mediaId,+ 'segment' => $index,+ 'chunk_size' => strlen($chunk),+ ]);++ // APPEND uses the new v2 endpoint with media_id in URL+ $appendResponse = Http::withToken($this->accessToken)+ ->timeout(300)+ ->attach('media', $chunk, 'chunk'.$index)+ ->post("{$this->baseUrl}/2/media/upload/{$mediaId}/append", [+ 'segment_index' => $index,+ ]);++ if ($appendResponse->failed()) {+ Log::error('X chunked upload APPEND error', [+ 'status' => $appendResponse->status(),+ 'body' => $appendResponse->body(),+ 'segment' => $index,+ ]);+ throw new \Exception('Failed to append chunk: '.$appendResponse->body());+ }+ }++ // FINALIZE - Use the new v2 endpoint+ Log::info('X chunked upload FINALIZE', ['media_id' => $mediaId]);++ $finalizeResponse = Http::withToken($this->accessToken)+ ->timeout(60)+ ->post("{$this->baseUrl}/2/media/upload/{$mediaId}/finalize");++ if ($finalizeResponse->failed()) {+ Log::error('X chunked upload FINALIZE error', [+ 'status' => $finalizeResponse->status(),+ 'body' => $finalizeResponse->body(),+ ]);+ throw new \Exception('Failed to finalize chunked upload: '.$finalizeResponse->body());+ }++ $finalizeData = $finalizeResponse->json();++ // Wait for processing (videos need transcoding)+ if (isset($finalizeData['processing_info']) || str_starts_with($mimeType, 'video/')) {+ $this->waitForProcessing($mediaId);+ }++ // Return in same format as simple upload+ return [+ 'data' => [+ 'id' => $mediaId,+ ],+ ];+ }++ private function getMediaCategory(string $mimeType, int $fileSize): ?string+ {+ if (str_starts_with($mimeType, 'video/')) {+ return $fileSize > 15 * 1024 * 1024 ? 'amplify_video' : 'tweet_video';+ }++ if ($mimeType === 'image/gif') {+ return 'tweet_gif';+ }++ if (str_starts_with($mimeType, 'image/')) {+ return 'tweet_image';+ }+return null;}++ private function waitForProcessing(string $mediaId, int $maxAttempts = 20): bool+ {+ for ($i = 0; $i < $maxAttempts; $i++) {+ $response = $this->getHttpClient()+ ->get("{$this->baseUrl}/2/media/{$mediaId}");++ if ($response->failed()) {+ Log::error('X media status check error: '.$response->body());+ sleep(3);++ continue;+ }++ $responseData = $response->json();++ // If processing_info doesn't exist, assume it's ready+ if (! isset($responseData['processing_info'])) {+ return true;+ }++ $state = $responseData['processing_info']['state'] ?? 'unknown';++ if ($state === 'succeeded') {+ return true;+ }++ if ($state === 'failed') {+ $error = $responseData['processing_info']['error'] ?? 'Unknown error';+ Log::error('X media processing failed: '.$error);++ return false;+ }++ // Wait before checking again+ $waitTime = $responseData['processing_info']['check_after_secs'] ?? 3;+ sleep($waitTime);+ }++ return false;+ }++ private function refreshToken(SocialAccount $account): void+ {+ if (! $account->refresh_token) {+ throw new \Exception('No refresh token available for X account');+ }++ $response = Http::asForm()->post("{$this->baseUrl}/2/oauth2/token", [+ 'grant_type' => 'refresh_token',+ 'refresh_token' => $account->refresh_token,+ 'client_id' => config('services.x.client_id'),+ ]);++ if ($response->failed()) {+ throw new \Exception('Failed to refresh X token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'refresh_token' => $data['refresh_token'] ?? $account->refresh_token,+ 'token_expires_at' => now()->addSeconds($data['expires_in'] ?? 7200),+ ]);+ }}diff --git a/app/Services/Social/YouTubePublisher.php b/app/Services/Social/YouTubePublisher.phpnew file mode 100644index 000000000..ab79c0504--- /dev/null+++ b/app/Services/Social/YouTubePublisher.php@@ -0,0 +1,182 @@+<?php++namespace App\Services\Social;++use App\Models\PostPlatform;+use App\Models\SocialAccount;+use Illuminate\Http\Client\PendingRequest;+use Illuminate\Support\Facades\Http;+use Illuminate\Support\Facades\Log;++class YouTubePublisher+{+ private string $baseUrl = 'https://www.googleapis.com';++ private string $accessToken;++ public function publish(PostPlatform $postPlatform): array+ {+ $account = $postPlatform->socialAccount;++ if ($account->is_token_expired || $account->is_token_expiring_soon) {+ $this->refreshToken($account);+ $account->refresh();+ }++ $this->accessToken = $account->access_token;++ $media = $postPlatform->media;++ if ($media->isEmpty()) {+ throw new \Exception('YouTube Shorts requires a video to publish.');+ }++ $firstMedia = $media->first();+ $isVideo = str_starts_with($firstMedia->mime_type, 'video/');++ if (! $isVideo) {+ throw new \Exception('YouTube Shorts only supports video content.');+ }++ return $this->publishShort($postPlatform, $firstMedia);+ }++ private function getHttpClient(): PendingRequest+ {+ return Http::withToken($this->accessToken)+ ->timeout(600);+ }++ private function publishShort(PostPlatform $postPlatform, $media): array+ {+ $title = $this->buildTitle($postPlatform->content);+ $description = $postPlatform->content;++ Log::info('YouTube Shorts publishing video', [+ 'video_url' => $media->url,+ 'title' => $title,+ ]);++ // Step 1: Get video content+ $videoContent = file_get_contents($media->url);+ $fileSize = strlen($videoContent);++ Log::info('YouTube video file size', ['size' => $fileSize]);++ // Step 2: Initialize resumable upload+ $initResponse = $this->getHttpClient()+ ->withHeaders([+ 'Content-Type' => 'application/json; charset=UTF-8',+ 'X-Upload-Content-Length' => $fileSize,+ 'X-Upload-Content-Type' => $media->mime_type,+ ])+ ->post("{$this->baseUrl}/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status", [+ 'snippet' => [+ 'title' => $title,+ 'description' => $description,+ 'categoryId' => '22', // People & Blogs+ ],+ 'status' => [+ 'privacyStatus' => 'public',+ 'selfDeclaredMadeForKids' => false,+ ],+ ]);++ if ($initResponse->failed()) {+ Log::error('YouTube upload init failed', [+ 'status' => $initResponse->status(),+ 'body' => $initResponse->body(),+ ]);+ throw new \Exception('YouTube API error: '.$initResponse->body());+ }++ $uploadUrl = $initResponse->header('Location');++ if (! $uploadUrl) {+ throw new \Exception('YouTube did not return an upload URL');+ }++ Log::info('YouTube upload initialized', ['uploadUrl' => $uploadUrl]);++ // Step 3: Upload the video content+ $uploadResponse = Http::withToken($this->accessToken)+ ->withHeaders([+ 'Content-Type' => $media->mime_type,+ 'Content-Length' => $fileSize,+ ])+ ->timeout(600)+ ->withBody($videoContent, $media->mime_type)+ ->put($uploadUrl);++ if ($uploadResponse->failed()) {+ Log::error('YouTube video upload failed', [+ 'status' => $uploadResponse->status(),+ 'body' => $uploadResponse->body(),+ ]);+ throw new \Exception('YouTube upload error: '.$uploadResponse->body());+ }++ $data = $uploadResponse->json();++ Log::info('YouTube upload response', ['data' => $data]);++ $videoId = $data['id'] ?? null;++ if (! $videoId) {+ throw new \Exception('YouTube did not return a video ID');+ }++ return [+ 'id' => $videoId,+ 'url' => "https://www.youtube.com/shorts/{$videoId}",+ ];+ }++ private function buildTitle(string $content): string+ {+ // YouTube title max is 100 characters+ // For Shorts, add #Shorts hashtag to help YouTube classify it+ $maxLength = 100;+ $shortsTag = ' #Shorts';+ $availableLength = $maxLength - strlen($shortsTag);++ // Get first line or first sentence as title+ $title = strtok($content, "\n");+ $title = strtok($title, '.');++ if (strlen($title) > $availableLength) {+ $title = substr($title, 0, $availableLength - 3).'...';+ }++ return $title.$shortsTag;+ }++ private function refreshToken(SocialAccount $account): void+ {+ if (! $account->refresh_token) {+ throw new \Exception('No refresh token available for YouTube account');+ }++ $response = Http::asForm()->post('https://oauth2.googleapis.com/token', [+ 'client_id' => config('services.google.client_id'),+ 'client_secret' => config('services.google.client_secret'),+ 'grant_type' => 'refresh_token',+ 'refresh_token' => $account->refresh_token,+ ]);++ if ($response->failed()) {+ Log::error('YouTube token refresh failed', ['body' => $response->body()]);+ throw new \Exception('Failed to refresh YouTube token: '.$response->body());+ }++ $data = $response->json();++ $account->update([+ 'access_token' => $data['access_token'],+ 'refresh_token' => $data['refresh_token'] ?? $account->refresh_token,+ 'token_expires_at' => isset($data['expires_in']) ? now()->addSeconds($data['expires_in']) : null,+ ]);++ Log::info('YouTube token refreshed successfully');+ }+}diff --git a/bootstrap/app.php b/bootstrap/app.phpindex c4f1cc5f5..bc947d8bb 100644--- a/bootstrap/app.php+++ b/bootstrap/app.php@@ -11,6 +11,7 @@ return Application::configure(basePath: dirname(__DIR__))->withRouting(web: __DIR__.'/../routes/web.php',commands: __DIR__.'/../routes/console.php',+ channels: __DIR__.'/../routes/channels.php',health: '/up',)->withMiddleware(function (Middleware $middleware): void {diff --git a/composer.json b/composer.jsonindex 806a2c3b2..ae6266d77 100644--- a/composer.json+++ b/composer.json@@ -15,6 +15,7 @@"laravel/fortify": "^1.30","laravel/framework": "^12.0","laravel/horizon": "^5.42",+ "laravel/reverb": "^1.0","laravel/socialite": "^5.24","laravel/tinker": "^2.10.1","laravel/wayfinder": "^0.1.9",diff --git a/composer.lock b/composer.lockindex 82bfc18c3..9db1311d3 100644--- a/composer.lock+++ b/composer.lock@@ -4,7 +4,7 @@"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],- "content-hash": "5870f9614cccbe4c1281d71773c1373c",+ "content-hash": "c6c2e7e35c2c6d5737296f159edc9a95","packages": [{"name": "aws/aws-crt-php",@@ -341,6 +341,136 @@],"time": "2024-02-09T16:56:22+00:00"},+ {+ "name": "clue/redis-protocol",+ "version": "v0.3.2",+ "source": {+ "type": "git",+ "url": "https://github.com/clue/redis-protocol.git",+ "reference": "6f565332f5531b7722d1e9c445314b91862f6d6c"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/clue/redis-protocol/zipball/6f565332f5531b7722d1e9c445314b91862f6d6c",+ "reference": "6f565332f5531b7722d1e9c445314b91862f6d6c",+ "shasum": ""+ },+ "require": {+ "php": ">=5.3"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "Clue\\Redis\\Protocol\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]"+ }+ ],+ "description": "A streaming Redis protocol (RESP) parser and serializer written in pure PHP.",+ "homepage": "https://github.com/clue/redis-protocol",+ "keywords": [+ "parser",+ "protocol",+ "redis",+ "resp",+ "serializer",+ "streaming"+ ],+ "support": {+ "issues": "https://github.com/clue/redis-protocol/issues",+ "source": "https://github.com/clue/redis-protocol/tree/v0.3.2"+ },+ "funding": [+ {+ "url": "https://clue.engineering/support",+ "type": "custom"+ },+ {+ "url": "https://github.com/clue",+ "type": "github"+ }+ ],+ "time": "2024-08-07T11:06:28+00:00"+ },+ {+ "name": "clue/redis-react",+ "version": "v2.8.0",+ "source": {+ "type": "git",+ "url": "https://github.com/clue/reactphp-redis.git",+ "reference": "84569198dfd5564977d2ae6a32de4beb5a24bdca"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/clue/reactphp-redis/zipball/84569198dfd5564977d2ae6a32de4beb5a24bdca",+ "reference": "84569198dfd5564977d2ae6a32de4beb5a24bdca",+ "shasum": ""+ },+ "require": {+ "clue/redis-protocol": "^0.3.2",+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",+ "php": ">=5.3",+ "react/event-loop": "^1.2",+ "react/promise": "^3.2 || ^2.0 || ^1.1",+ "react/promise-timer": "^1.11",+ "react/socket": "^1.16"+ },+ "require-dev": {+ "clue/block-react": "^1.5",+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "Clue\\React\\Redis\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]"+ }+ ],+ "description": "Async Redis client implementation, built on top of ReactPHP.",+ "homepage": "https://github.com/clue/reactphp-redis",+ "keywords": [+ "async",+ "client",+ "database",+ "reactphp",+ "redis"+ ],+ "support": {+ "issues": "https://github.com/clue/reactphp-redis/issues",+ "source": "https://github.com/clue/reactphp-redis/tree/v2.8.0"+ },+ "funding": [+ {+ "url": "https://clue.engineering/support",+ "type": "custom"+ },+ {+ "url": "https://github.com/clue",+ "type": "github"+ }+ ],+ "time": "2025-01-03T16:18:33+00:00"+ },{"name": "dasprid/enum","version": "1.0.7",@@ -764,6 +894,53 @@],"time": "2025-03-06T22:45:56+00:00"},+ {+ "name": "evenement/evenement",+ "version": "v3.0.2",+ "source": {+ "type": "git",+ "url": "https://github.com/igorw/evenement.git",+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc",+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc",+ "shasum": ""+ },+ "require": {+ "php": ">=7.0"+ },+ "require-dev": {+ "phpunit/phpunit": "^9 || ^6"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "Evenement\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Igor Wiedler",+ "email": "[email protected]"+ }+ ],+ "description": "Événement is a very simple event dispatching library for PHP",+ "keywords": [+ "event-dispatcher",+ "event-emitter"+ ],+ "support": {+ "issues": "https://github.com/igorw/evenement/issues",+ "source": "https://github.com/igorw/evenement/tree/v3.0.2"+ },+ "time": "2023-08-08T05:53:35+00:00"+ },{"name": "firebase/php-jwt","version": "v7.0.2",@@ -1952,6 +2129,88 @@},"time": "2026-01-07T21:00:29+00:00"},+ {+ "name": "laravel/reverb",+ "version": "v1.7.0",+ "source": {+ "type": "git",+ "url": "https://github.com/laravel/reverb.git",+ "reference": "4300fbbc3535f5cbbdf600b00edca1e4c515bfcf"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/laravel/reverb/zipball/4300fbbc3535f5cbbdf600b00edca1e4c515bfcf",+ "reference": "4300fbbc3535f5cbbdf600b00edca1e4c515bfcf",+ "shasum": ""+ },+ "require": {+ "clue/redis-react": "^2.6",+ "guzzlehttp/psr7": "^2.6",+ "illuminate/console": "^10.47|^11.0|^12.0",+ "illuminate/contracts": "^10.47|^11.0|^12.0",+ "illuminate/http": "^10.47|^11.0|^12.0",+ "illuminate/support": "^10.47|^11.0|^12.0",+ "laravel/prompts": "^0.1.15|^0.2.0|^0.3.0",+ "php": "^8.2",+ "pusher/pusher-php-server": "^7.2",+ "ratchet/rfc6455": "^0.4",+ "react/promise-timer": "^1.10",+ "react/socket": "^1.14",+ "symfony/console": "^6.0|^7.0",+ "symfony/http-foundation": "^6.3|^7.0"+ },+ "require-dev": {+ "orchestra/testbench": "^8.36|^9.15|^10.8",+ "pestphp/pest": "^2.0|^3.0|^4.0",+ "phpstan/phpstan": "^1.10",+ "ratchet/pawl": "^0.4.1",+ "react/async": "^4.2",+ "react/http": "^1.9"+ },+ "type": "library",+ "extra": {+ "laravel": {+ "aliases": {+ "Output": "Laravel\\Reverb\\Output"+ },+ "providers": [+ "Laravel\\Reverb\\ApplicationManagerServiceProvider",+ "Laravel\\Reverb\\ReverbServiceProvider"+ ]+ }+ },+ "autoload": {+ "psr-4": {+ "Laravel\\Reverb\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Taylor Otwell",+ "email": "[email protected]"+ },+ {+ "name": "Joe Dixon",+ "email": "[email protected]"+ }+ ],+ "description": "Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.",+ "keywords": [+ "WebSockets",+ "laravel",+ "real-time",+ "websocket"+ ],+ "support": {+ "issues": "https://github.com/laravel/reverb/issues",+ "source": "https://github.com/laravel/reverb/tree/v1.7.0"+ },+ "time": "2026-01-06T16:26:25+00:00"+ },{"name": "laravel/serializable-closure","version": "v2.0.8",@@ -3686,6 +3945,102 @@},"time": "2020-10-15T08:29:30+00:00"},+ {+ "name": "paragonie/sodium_compat",+ "version": "v2.5.0",+ "source": {+ "type": "git",+ "url": "https://github.com/paragonie/sodium_compat.git",+ "reference": "4714da6efdc782c06690bc72ce34fae7941c2d9f"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/4714da6efdc782c06690bc72ce34fae7941c2d9f",+ "reference": "4714da6efdc782c06690bc72ce34fae7941c2d9f",+ "shasum": ""+ },+ "require": {+ "php": "^8.1",+ "php-64bit": "*"+ },+ "require-dev": {+ "infection/infection": "^0",+ "nikic/php-fuzzer": "^0",+ "phpunit/phpunit": "^7|^8|^9|^10|^11",+ "vimeo/psalm": "^4|^5|^6"+ },+ "suggest": {+ "ext-sodium": "Better performance, password hashing (Argon2i), secure memory management (memzero), and better security."+ },+ "type": "library",+ "extra": {+ "branch-alias": {+ "dev-master": "2.0.x-dev"+ }+ },+ "autoload": {+ "files": [+ "autoload.php"+ ],+ "psr-4": {+ "ParagonIE\\Sodium\\": "namespaced/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "ISC"+ ],+ "authors": [+ {+ "name": "Paragon Initiative Enterprises",+ "email": "[email protected]"+ },+ {+ "name": "Frank Denis",+ "email": "[email protected]"+ }+ ],+ "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists",+ "keywords": [+ "Authentication",+ "BLAKE2b",+ "ChaCha20",+ "ChaCha20-Poly1305",+ "Chapoly",+ "Curve25519",+ "Ed25519",+ "EdDSA",+ "Edwards-curve Digital Signature Algorithm",+ "Elliptic Curve Diffie-Hellman",+ "Poly1305",+ "Pure-PHP cryptography",+ "RFC 7748",+ "RFC 8032",+ "Salpoly",+ "Salsa20",+ "X25519",+ "XChaCha20-Poly1305",+ "XSalsa20-Poly1305",+ "Xchacha20",+ "Xsalsa20",+ "aead",+ "cryptography",+ "ecdh",+ "elliptic curve",+ "elliptic curve cryptography",+ "encryption",+ "libsodium",+ "php",+ "public-key cryptography",+ "secret-key cryptography",+ "side-channel resistant"+ ],+ "support": {+ "issues": "https://github.com/paragonie/sodium_compat/issues",+ "source": "https://github.com/paragonie/sodium_compat/tree/v2.5.0"+ },+ "time": "2025-12-30T16:12:18+00:00"+ },{"name": "phpoption/phpoption","version": "1.9.5",@@ -4524,6 +4879,67 @@},"time": "2025-12-17T14:35:46+00:00"},+ {+ "name": "pusher/pusher-php-server",+ "version": "7.2.7",+ "source": {+ "type": "git",+ "url": "https://github.com/pusher/pusher-http-php.git",+ "reference": "148b0b5100d000ed57195acdf548a2b1b38ee3f7"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/148b0b5100d000ed57195acdf548a2b1b38ee3f7",+ "reference": "148b0b5100d000ed57195acdf548a2b1b38ee3f7",+ "shasum": ""+ },+ "require": {+ "ext-curl": "*",+ "ext-json": "*",+ "guzzlehttp/guzzle": "^7.2",+ "paragonie/sodium_compat": "^1.6|^2.0",+ "php": "^7.3|^8.0",+ "psr/log": "^1.0|^2.0|^3.0"+ },+ "require-dev": {+ "overtrue/phplint": "^2.3",+ "phpunit/phpunit": "^9.3"+ },+ "type": "library",+ "extra": {+ "branch-alias": {+ "dev-master": "5.0-dev"+ }+ },+ "autoload": {+ "psr-4": {+ "Pusher\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "description": "Library for interacting with the Pusher REST API",+ "keywords": [+ "events",+ "messaging",+ "php-pusher-server",+ "publish",+ "push",+ "pusher",+ "real time",+ "real-time",+ "realtime",+ "rest",+ "trigger"+ ],+ "support": {+ "issues": "https://github.com/pusher/pusher-http-php/issues",+ "source": "https://github.com/pusher/pusher-http-php/tree/7.2.7"+ },+ "time": "2025-01-06T10:56:20+00:00"+ },{"name": "ralouphie/getallheaders","version": "3.0.3",@@ -4722,6 +5138,595 @@},"time": "2025-12-14T04:43:48+00:00"},+ {+ "name": "ratchet/rfc6455",+ "version": "v0.4.0",+ "source": {+ "type": "git",+ "url": "https://github.com/ratchetphp/RFC6455.git",+ "reference": "859d95f85dda0912c6d5b936d036d044e3af47ef"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/859d95f85dda0912c6d5b936d036d044e3af47ef",+ "reference": "859d95f85dda0912c6d5b936d036d044e3af47ef",+ "shasum": ""+ },+ "require": {+ "php": ">=7.4",+ "psr/http-factory-implementation": "^1.0",+ "symfony/polyfill-php80": "^1.15"+ },+ "require-dev": {+ "guzzlehttp/psr7": "^2.7",+ "phpunit/phpunit": "^9.5",+ "react/socket": "^1.3"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "Ratchet\\RFC6455\\": "src"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "role": "Developer"+ },+ {+ "name": "Matt Bonneau",+ "role": "Developer"+ }+ ],+ "description": "RFC6455 WebSocket protocol handler",+ "homepage": "http://socketo.me",+ "keywords": [+ "WebSockets",+ "rfc6455",+ "websocket"+ ],+ "support": {+ "chat": "https://gitter.im/reactphp/reactphp",+ "issues": "https://github.com/ratchetphp/RFC6455/issues",+ "source": "https://github.com/ratchetphp/RFC6455/tree/v0.4.0"+ },+ "time": "2025-02-24T01:18:22+00:00"+ },+ {+ "name": "react/cache",+ "version": "v1.2.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/cache.git",+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b",+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b",+ "shasum": ""+ },+ "require": {+ "php": ">=5.3.0",+ "react/promise": "^3.0 || ^2.0 || ^1.1"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "React\\Cache\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "Async, Promise-based cache interface for ReactPHP",+ "keywords": [+ "cache",+ "caching",+ "promise",+ "reactphp"+ ],+ "support": {+ "issues": "https://github.com/reactphp/cache/issues",+ "source": "https://github.com/reactphp/cache/tree/v1.2.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2022-11-30T15:59:55+00:00"+ },+ {+ "name": "react/dns",+ "version": "v1.14.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/dns.git",+ "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3",+ "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3",+ "shasum": ""+ },+ "require": {+ "php": ">=5.3.0",+ "react/cache": "^1.0 || ^0.6 || ^0.5",+ "react/event-loop": "^1.2",+ "react/promise": "^3.2 || ^2.7 || ^1.2.1"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",+ "react/async": "^4.3 || ^3 || ^2",+ "react/promise-timer": "^1.11"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "React\\Dns\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "Async DNS resolver for ReactPHP",+ "keywords": [+ "async",+ "dns",+ "dns-resolver",+ "reactphp"+ ],+ "support": {+ "issues": "https://github.com/reactphp/dns/issues",+ "source": "https://github.com/reactphp/dns/tree/v1.14.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2025-11-18T19:34:28+00:00"+ },+ {+ "name": "react/event-loop",+ "version": "v1.6.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/event-loop.git",+ "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a",+ "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a",+ "shasum": ""+ },+ "require": {+ "php": ">=5.3.0"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"+ },+ "suggest": {+ "ext-pcntl": "For signal handling support when using the StreamSelectLoop"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "React\\EventLoop\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.",+ "keywords": [+ "asynchronous",+ "event-loop"+ ],+ "support": {+ "issues": "https://github.com/reactphp/event-loop/issues",+ "source": "https://github.com/reactphp/event-loop/tree/v1.6.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2025-11-17T20:46:25+00:00"+ },+ {+ "name": "react/promise",+ "version": "v3.3.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/promise.git",+ "reference": "23444f53a813a3296c1368bb104793ce8d88f04a"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a",+ "reference": "23444f53a813a3296c1368bb104793ce8d88f04a",+ "shasum": ""+ },+ "require": {+ "php": ">=7.1.0"+ },+ "require-dev": {+ "phpstan/phpstan": "1.12.28 || 1.4.10",+ "phpunit/phpunit": "^9.6 || ^7.5"+ },+ "type": "library",+ "autoload": {+ "files": [+ "src/functions_include.php"+ ],+ "psr-4": {+ "React\\Promise\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",+ "keywords": [+ "promise",+ "promises"+ ],+ "support": {+ "issues": "https://github.com/reactphp/promise/issues",+ "source": "https://github.com/reactphp/promise/tree/v3.3.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2025-08-19T18:57:03+00:00"+ },+ {+ "name": "react/promise-timer",+ "version": "v1.11.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/promise-timer.git",+ "reference": "4f70306ed66b8b44768941ca7f142092600fafc1"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/4f70306ed66b8b44768941ca7f142092600fafc1",+ "reference": "4f70306ed66b8b44768941ca7f142092600fafc1",+ "shasum": ""+ },+ "require": {+ "php": ">=5.3",+ "react/event-loop": "^1.2",+ "react/promise": "^3.2 || ^2.7.0 || ^1.2.1"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"+ },+ "type": "library",+ "autoload": {+ "files": [+ "src/functions_include.php"+ ],+ "psr-4": {+ "React\\Promise\\Timer\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.",+ "homepage": "https://github.com/reactphp/promise-timer",+ "keywords": [+ "async",+ "event-loop",+ "promise",+ "reactphp",+ "timeout",+ "timer"+ ],+ "support": {+ "issues": "https://github.com/reactphp/promise-timer/issues",+ "source": "https://github.com/reactphp/promise-timer/tree/v1.11.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2024-06-04T14:27:45+00:00"+ },+ {+ "name": "react/socket",+ "version": "v1.17.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/socket.git",+ "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08",+ "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08",+ "shasum": ""+ },+ "require": {+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",+ "php": ">=5.3.0",+ "react/dns": "^1.13",+ "react/event-loop": "^1.2",+ "react/promise": "^3.2 || ^2.6 || ^1.2.1",+ "react/stream": "^1.4"+ },+ "require-dev": {+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",+ "react/async": "^4.3 || ^3.3 || ^2",+ "react/promise-stream": "^1.4",+ "react/promise-timer": "^1.11"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "React\\Socket\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP",+ "keywords": [+ "Connection",+ "Socket",+ "async",+ "reactphp",+ "stream"+ ],+ "support": {+ "issues": "https://github.com/reactphp/socket/issues",+ "source": "https://github.com/reactphp/socket/tree/v1.17.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2025-11-19T20:47:34+00:00"+ },+ {+ "name": "react/stream",+ "version": "v1.4.0",+ "source": {+ "type": "git",+ "url": "https://github.com/reactphp/stream.git",+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d",+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d",+ "shasum": ""+ },+ "require": {+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",+ "php": ">=5.3.8",+ "react/event-loop": "^1.2"+ },+ "require-dev": {+ "clue/stream-filter": "~1.2",+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"+ },+ "type": "library",+ "autoload": {+ "psr-4": {+ "React\\Stream\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Christian Lück",+ "email": "[email protected]",+ "homepage": "https://clue.engineering/"+ },+ {+ "name": "Cees-Jan Kiewiet",+ "email": "[email protected]",+ "homepage": "https://wyrihaximus.net/"+ },+ {+ "name": "Jan Sorgalla",+ "email": "[email protected]",+ "homepage": "https://sorgalla.com/"+ },+ {+ "name": "Chris Boden",+ "email": "[email protected]",+ "homepage": "https://cboden.dev/"+ }+ ],+ "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP",+ "keywords": [+ "event-driven",+ "io",+ "non-blocking",+ "pipe",+ "reactphp",+ "readable",+ "stream",+ "writable"+ ],+ "support": {+ "issues": "https://github.com/reactphp/stream/issues",+ "source": "https://github.com/reactphp/stream/tree/v1.4.0"+ },+ "funding": [+ {+ "url": "https://opencollective.com/reactphp",+ "type": "open_collective"+ }+ ],+ "time": "2024-06-11T12:45:25+00:00"+ },{"name": "socialiteproviders/linkedin","version": "5.0.0",diff --git a/config/broadcasting.php b/config/broadcasting.phpnew file mode 100644index 000000000..ebc3fb9cf--- /dev/null+++ b/config/broadcasting.php@@ -0,0 +1,82 @@+<?php++return [++ /*+ |--------------------------------------------------------------------------+ | Default Broadcaster+ |--------------------------------------------------------------------------+ |+ | This option controls the default broadcaster that will be used by the+ | framework when an event needs to be broadcast. You may set this to+ | any of the connections defined in the "connections" array below.+ |+ | Supported: "reverb", "pusher", "ably", "redis", "log", "null"+ |+ */++ 'default' => env('BROADCAST_CONNECTION', 'null'),++ /*+ |--------------------------------------------------------------------------+ | Broadcast Connections+ |--------------------------------------------------------------------------+ |+ | Here you may define all of the broadcast connections that will be used+ | to broadcast events to other systems or over WebSockets. Samples of+ | each available type of connection are provided inside this array.+ |+ */++ 'connections' => [++ 'reverb' => [+ 'driver' => 'reverb',+ 'key' => env('REVERB_APP_KEY'),+ 'secret' => env('REVERB_APP_SECRET'),+ 'app_id' => env('REVERB_APP_ID'),+ 'options' => [+ 'host' => env('REVERB_HOST'),+ 'port' => env('REVERB_PORT', 443),+ 'scheme' => env('REVERB_SCHEME', 'https'),+ 'useTLS' => env('REVERB_SCHEME', 'https') === 'https',+ ],+ 'client_options' => [+ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html+ ],+ ],++ 'pusher' => [+ 'driver' => 'pusher',+ 'key' => env('PUSHER_APP_KEY'),+ 'secret' => env('PUSHER_APP_SECRET'),+ 'app_id' => env('PUSHER_APP_ID'),+ 'options' => [+ 'cluster' => env('PUSHER_APP_CLUSTER'),+ 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',+ 'port' => env('PUSHER_PORT', 443),+ 'scheme' => env('PUSHER_SCHEME', 'https'),+ 'encrypted' => true,+ 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',+ ],+ 'client_options' => [+ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html+ ],+ ],++ 'ably' => [+ 'driver' => 'ably',+ 'key' => env('ABLY_KEY'),+ ],++ 'log' => [+ 'driver' => 'log',+ ],++ 'null' => [+ 'driver' => 'null',+ ],++ ],++];diff --git a/config/reverb.php b/config/reverb.phpnew file mode 100644index 000000000..d7fc88e08--- /dev/null+++ b/config/reverb.php@@ -0,0 +1,95 @@+<?php++return [++ /*+ |--------------------------------------------------------------------------+ | Default Reverb Server+ |--------------------------------------------------------------------------+ |+ | This option controls the default server used by Reverb to handle+ | incoming messages as well as broadcasting message to all your+ | connected clients. At this time only "reverb" is supported.+ |+ */++ 'default' => env('REVERB_SERVER', 'reverb'),++ /*+ |--------------------------------------------------------------------------+ | Reverb Servers+ |--------------------------------------------------------------------------+ |+ | Here you may define details for each of the supported Reverb servers.+ | Each server has its own configuration options that are defined in+ | the array below. You should ensure all the options are present.+ |+ */++ 'servers' => [++ 'reverb' => [+ 'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),+ 'port' => env('REVERB_SERVER_PORT', 8080),+ 'path' => env('REVERB_SERVER_PATH', ''),+ 'hostname' => env('REVERB_HOST'),+ 'options' => [+ 'tls' => [],+ ],+ 'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000),+ 'scaling' => [+ 'enabled' => env('REVERB_SCALING_ENABLED', false),+ 'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),+ 'server' => [+ 'url' => env('REDIS_URL'),+ 'host' => env('REDIS_HOST', '127.0.0.1'),+ 'port' => env('REDIS_PORT', '6379'),+ 'username' => env('REDIS_USERNAME'),+ 'password' => env('REDIS_PASSWORD'),+ 'database' => env('REDIS_DB', '0'),+ 'timeout' => env('REDIS_TIMEOUT', 60),+ ],+ ],+ 'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),+ 'telescope_ingest_interval' => env('REVERB_TELESCOPE_INGEST_INTERVAL', 15),+ ],++ ],++ /*+ |--------------------------------------------------------------------------+ | Reverb Applications+ |--------------------------------------------------------------------------+ |+ | Here you may define how Reverb applications are managed. If you choose+ | to use the "config" provider, you may define an array of apps which+ | your server will support, including their connection credentials.+ |+ */++ 'apps' => [++ 'provider' => 'config',++ 'apps' => [+ [+ 'key' => env('REVERB_APP_KEY'),+ 'secret' => env('REVERB_APP_SECRET'),+ 'app_id' => env('REVERB_APP_ID'),+ 'options' => [+ 'host' => env('REVERB_HOST'),+ 'port' => env('REVERB_PORT', 443),+ 'scheme' => env('REVERB_SCHEME', 'https'),+ 'useTLS' => env('REVERB_SCHEME', 'https') === 'https',+ ],+ 'allowed_origins' => ['*'],+ 'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),+ 'activity_timeout' => env('REVERB_APP_ACTIVITY_TIMEOUT', 30),+ 'max_connections' => env('REVERB_APP_MAX_CONNECTIONS'),+ 'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000),+ ],+ ],++ ],++];diff --git a/config/services.php b/config/services.phpindex bb59e3a2a..3bae0c89b 100644--- a/config/services.php+++ b/config/services.php@@ -48,7 +48,7 @@ return ['redirect_page' => env('LINKEDIN_PAGE_CLIENT_REDIRECT'),],- 'twitter' => [+ 'x' => ['client_id' => env('X_CLIENT_ID'),'client_secret' => env('X_CLIENT_SECRET'),'redirect' => env('X_CLIENT_REDIRECT'),@@ -60,6 +60,27 @@ return ['redirect' => env('TIKTOK_CLIENT_REDIRECT'),],+ // Google OAuth (used for YouTube)+ 'google' => [+ 'client_id' => env('GOOGLE_CLIENT_ID'),+ 'client_secret' => env('GOOGLE_CLIENT_SECRET'),+ 'redirect' => env('GOOGLE_CLIENT_REDIRECT'),+ ],++ // Facebook (used for Facebook Pages and Instagram)+ 'facebook' => [+ 'client_id' => env('FACEBOOK_CLIENT_ID'),+ 'client_secret' => env('FACEBOOK_CLIENT_SECRET'),+ 'redirect' => env('FACEBOOK_CLIENT_REDIRECT'),+ ],++ // Threads+ 'threads' => [+ 'client_id' => env('THREADS_CLIENT_ID'),+ 'client_secret' => env('THREADS_CLIENT_SECRET'),+ 'redirect' => env('THREADS_CLIENT_REDIRECT'),+ ],+'stripe' => ['price_id' => env('STRIPE_PRICE_ID'),'workspace_price' => env('STRIPE_WORKSPACE_PRICE', 2000), // $20.00 in centsdiff --git a/database/migrations/2026_01_14_232320_create_post_media_table.php b/database/migrations/2026_01_14_232320_create_post_media_table.phpindex 67ca6e6c3..16b4b5a02 100644--- a/database/migrations/2026_01_14_232320_create_post_media_table.php+++ b/database/migrations/2026_01_14_232320_create_post_media_table.php@@ -15,7 +15,6 @@ return new class extends Migration$table->uuid('id')->primary();$table->uuid('post_platform_id');$table->string('type');- $table->string('disk')->default('r2');$table->string('path');$table->string('original_filename');$table->string('mime_type');diff --git a/database/migrations/2026_01_15_013103_make_post_platform_id_nullable_on_post_media.php b/database/migrations/2026_01_15_013103_make_post_platform_id_nullable_on_post_media.phpnew file mode 100644index 000000000..c9c6997de--- /dev/null+++ b/database/migrations/2026_01_15_013103_make_post_platform_id_nullable_on_post_media.php@@ -0,0 +1,28 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('post_media', function (Blueprint $table) {+ $table->uuid('post_platform_id')->nullable()->change();+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('post_media', function (Blueprint $table) {+ $table->uuid('post_platform_id')->nullable(false)->change();+ });+ }+};diff --git a/database/migrations/2026_01_15_020942_add_timezone_to_workspaces_table.php b/database/migrations/2026_01_15_020942_add_timezone_to_workspaces_table.phpnew file mode 100644index 000000000..4cb795a42--- /dev/null+++ b/database/migrations/2026_01_15_020942_add_timezone_to_workspaces_table.php@@ -0,0 +1,28 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('workspaces', function (Blueprint $table) {+ $table->string('timezone')->default('America/New_York')->after('name');+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('workspaces', function (Blueprint $table) {+ $table->dropColumn('timezone');+ });+ }+};diff --git a/database/migrations/2026_01_15_022545_add_enabled_to_post_platforms_table.php b/database/migrations/2026_01_15_022545_add_enabled_to_post_platforms_table.phpnew file mode 100644index 000000000..6f5a851c1--- /dev/null+++ b/database/migrations/2026_01_15_022545_add_enabled_to_post_platforms_table.php@@ -0,0 +1,28 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('post_platforms', function (Blueprint $table) {+ $table->boolean('enabled')->default(true)->after('social_account_id');+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('post_platforms', function (Blueprint $table) {+ $table->dropColumn('enabled');+ });+ }+};diff --git a/package-lock.json b/package-lock.jsonindex 4d2bc091c..e57b41013 100644--- a/package-lock.json+++ b/package-lock.json@@ -6,11 +6,14 @@"": {"dependencies": {"@inertiajs/vue3": "^2.3.7",+ "@tabler/icons-vue": "^3.36.1","@vueuse/core": "^12.8.2","class-variance-authority": "^0.7.1","clsx": "^2.1.1",+ "dayjs": "^1.11.19","laravel-vite-plugin": "^2.0.0","lucide-vue-next": "^0.468.0",+ "maska": "^3.2.0","reka-ui": "^2.7.0","tailwind-merge": "^3.2.0","tailwindcss": "^4.1.1",@@ -20,6 +23,7 @@},"devDependencies": {"@eslint/js": "^9.19.0",+ "@laravel/echo-vue": "^2.3.0","@laravel/vite-plugin-wayfinder": "^0.1.3","@tailwindcss/vite": "^4.1.11","@types/node": "^22.13.5",@@ -31,9 +35,11 @@"eslint-import-resolver-typescript": "^4.4.4","eslint-plugin-import": "^2.32.0","eslint-plugin-vue": "^9.32.0",+ "laravel-echo": "^2.3.0","prettier": "^3.4.2","prettier-plugin-organize-imports": "^4.1.0","prettier-plugin-tailwindcss": "^0.6.11",+ "pusher-js": "^8.4.0","typescript": "^5.2.2","typescript-eslint": "^8.23.0","vite": "^7.0.4",@@ -932,6 +938,21 @@"@jridgewell/sourcemap-codec": "^1.4.14"}},+ "node_modules/@laravel/echo-vue": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/@laravel/echo-vue/-/echo-vue-2.3.0.tgz",+ "integrity": "sha512-IWHFrRw1A7OE7rwB2q2ZqsuBjeI4HGUzaRSxBzPzkx8cKq0ten8/1jN6v3jg+Xe2dLGKYQXQoMNj9xbJxV4gbA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=20"+ },+ "peerDependencies": {+ "pusher-js": "*",+ "socket.io-client": "*",+ "vue": "^3.0.0"+ }+ },"node_modules/@laravel/vite-plugin-wayfinder": {"version": "0.1.7","resolved": "https://registry.npmjs.org/@laravel/vite-plugin-wayfinder/-/vite-plugin-wayfinder-0.1.7.tgz",@@ -1329,6 +1350,14 @@"dev": true,"license": "MIT"},+ "node_modules/@socket.io/component-emitter": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",+ "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==",+ "dev": true,+ "license": "MIT",+ "peer": true+ },"node_modules/@swc/helpers": {"version": "0.5.18","resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.18.tgz",@@ -1338,6 +1367,32 @@"tslib": "^2.8.0"}},+ "node_modules/@tabler/icons": {+ "version": "3.36.1",+ "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.36.1.tgz",+ "integrity": "sha512-f4Jg3Fof/Vru5ioix/UO4GX+sdDsF9wQo47FbtvG+utIYYVQ/QVAC0QYgcBbAjQGfbdOh2CCf0BgiFOF9Ixtjw==",+ "license": "MIT",+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/codecalm"+ }+ },+ "node_modules/@tabler/icons-vue": {+ "version": "3.36.1",+ "resolved": "https://registry.npmjs.org/@tabler/icons-vue/-/icons-vue-3.36.1.tgz",+ "integrity": "sha512-ssIu0KSmGFKvvoC5PJhSYAj/J2kTEbIVIix0528zdRKfN6yohUlQt014tGnDDdJ/MyyG/xRXsKD1U6dyQY8rrg==",+ "license": "MIT",+ "dependencies": {+ "@tabler/icons": ""+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/codecalm"+ },+ "peerDependencies": {+ "vue": ">=3.0.1"+ }+ },"node_modules/@tailwindcss/node": {"version": "4.1.18","resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz",@@ -3022,6 +3077,12 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/dayjs": {+ "version": "1.11.19",+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",+ "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==",+ "license": "MIT"+ },"node_modules/de-indent": {"version": "1.0.2","resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",@@ -3149,6 +3210,32 @@"dev": true,"license": "MIT"},+ "node_modules/engine.io-client": {+ "version": "6.6.4",+ "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.4.tgz",+ "integrity": "sha512-+kjUJnZGwzewFDw951CDWcwj35vMNf2fcj7xQWOctq1F2i1jkDdVvdFG9kM/BEChymCH36KgjnW0NsL58JYRxw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1",+ "engine.io-parser": "~5.2.1",+ "ws": "~8.18.3",+ "xmlhttprequest-ssl": "~2.1.1"+ }+ },+ "node_modules/engine.io-parser": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz",+ "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=10.0.0"+ }+ },"node_modules/enhanced-resolve": {"version": "5.18.4","resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz",@@ -4924,6 +5011,20 @@"json-buffer": "3.0.1"}},+ "node_modules/laravel-echo": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/laravel-echo/-/laravel-echo-2.3.0.tgz",+ "integrity": "sha512-wgHPnnBvfHmu2I58xJ4asZH37Nu6P0472ku6zuoGRLc3zEWwIbpovDLYTiOshDH1SM7rA6AjZTKuu+jYoM1tpQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=20"+ },+ "peerDependencies": {+ "pusher-js": "*",+ "socket.io-client": "*"+ }+ },"node_modules/laravel-precognition": {"version": "1.0.0","resolved": "https://registry.npmjs.org/laravel-precognition/-/laravel-precognition-1.0.0.tgz",@@ -5271,6 +5372,12 @@"@jridgewell/sourcemap-codec": "^1.5.5"}},+ "node_modules/maska": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/maska/-/maska-3.2.0.tgz",+ "integrity": "sha512-zSmSgs5/q9vMSmrdZT3rKOv9uLznNWR/niuuAdBZDTvB3SMKOX9vhMtDijFyExz+B4UClu2rvksylUh/ea1bLA==",+ "license": "MIT"+ },"node_modules/math-intrinsics": {"version": "1.1.0","resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",@@ -5852,6 +5959,16 @@"node": ">=6"}},+ "node_modules/pusher-js": {+ "version": "8.4.0",+ "resolved": "https://registry.npmjs.org/pusher-js/-/pusher-js-8.4.0.tgz",+ "integrity": "sha512-wp3HqIIUc1GRyu1XrP6m2dgyE9MoCsXVsWNlohj0rjSkLf+a0jLvEyVubdg58oMk7bhjBWnFClgp8jfAa6Ak4Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tweetnacl": "^1.0.3"+ }+ },"node_modules/qs": {"version": "6.14.1","resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",@@ -6344,6 +6461,38 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/socket.io-client": {+ "version": "4.8.3",+ "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.3.tgz",+ "integrity": "sha512-uP0bpjWrjQmUt5DTHq9RuoCBdFJF10cdX9X+a368j/Ft0wmaVgxlrjvK3kjvgCODOMMOz9lcaRzxmso0bTWZ/g==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1",+ "engine.io-client": "~6.6.1",+ "socket.io-parser": "~4.2.4"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },+ "node_modules/socket.io-parser": {+ "version": "4.2.5",+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz",+ "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@socket.io/component-emitter": "~3.1.0",+ "debug": "~4.4.1"+ },+ "engines": {+ "node": ">=10.0.0"+ }+ },"node_modules/source-map-js": {"version": "1.2.1","resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",@@ -6655,6 +6804,13 @@"url": "https://github.com/sponsors/Wombosvideo"}},+ "node_modules/tweetnacl": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",+ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",+ "dev": true,+ "license": "Unlicense"+ },"node_modules/type-check": {"version": "0.4.0","resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",@@ -7216,6 +7372,29 @@"url": "https://github.com/chalk/wrap-ansi?sponsor=1"}},+ "node_modules/ws": {+ "version": "8.18.3",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",+ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },"node_modules/xml-name-validator": {"version": "4.0.0","resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz",@@ -7226,6 +7405,16 @@"node": ">=12"}},+ "node_modules/xmlhttprequest-ssl": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz",+ "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==",+ "dev": true,+ "peer": true,+ "engines": {+ "node": ">=0.4.0"+ }+ },"node_modules/y18n": {"version": "5.0.8","resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",diff --git a/package.json b/package.jsonindex e288728dd..7e888cc56 100644--- a/package.json+++ b/package.json@@ -12,6 +12,7 @@},"devDependencies": {"@eslint/js": "^9.19.0",+ "@laravel/echo-vue": "^2.3.0","@laravel/vite-plugin-wayfinder": "^0.1.3","@tailwindcss/vite": "^4.1.11","@types/node": "^22.13.5",@@ -23,9 +24,11 @@"eslint-import-resolver-typescript": "^4.4.4","eslint-plugin-import": "^2.32.0","eslint-plugin-vue": "^9.32.0",+ "laravel-echo": "^2.3.0","prettier": "^3.4.2","prettier-plugin-organize-imports": "^4.1.0","prettier-plugin-tailwindcss": "^0.6.11",+ "pusher-js": "^8.4.0","typescript": "^5.2.2","typescript-eslint": "^8.23.0","vite": "^7.0.4",@@ -33,11 +36,14 @@},"dependencies": {"@inertiajs/vue3": "^2.3.7",+ "@tabler/icons-vue": "^3.36.1","@vueuse/core": "^12.8.2","class-variance-authority": "^0.7.1","clsx": "^2.1.1",+ "dayjs": "^1.11.19","laravel-vite-plugin": "^2.0.0","lucide-vue-next": "^0.468.0",+ "maska": "^3.2.0","reka-ui": "^2.7.0","tailwind-merge": "^3.2.0","tailwindcss": "^4.1.1",diff --git a/public/favicon.png b/public/favicon.pngnew file mode 100644index 000000000..dd0665ffdBinary files /dev/null and b/public/favicon.png differdiff --git a/public/images/trypost/icon.png b/public/images/trypost/icon.pngnew file mode 100644index 000000000..876e54b74Binary files /dev/null and b/public/images/trypost/icon.png differdiff --git a/public/images/trypost/logo-dark.png b/public/images/trypost/logo-dark.pngnew file mode 100644index 000000000..72d19b2a2Binary files /dev/null and b/public/images/trypost/logo-dark.png differdiff --git a/public/images/trypost/logo-light.png b/public/images/trypost/logo-light.pngnew file mode 100644index 000000000..db7f9e423Binary files /dev/null and b/public/images/trypost/logo-light.png differdiff --git a/resources/js/app.ts b/resources/js/app.tsindex 2a27450cb..20097f5bb 100644--- a/resources/js/app.ts+++ b/resources/js/app.ts@@ -1,4 +1,5 @@import '../css/app.css';+import './echo';import { createInertiaApp } from '@inertiajs/vue3';import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';@@ -6,8 +7,13 @@ import type { DefineComponent } from 'vue';import { createApp, h } from 'vue';import { initializeTheme } from './composables/useAppearance';+import { configureEcho } from '@laravel/echo-vue';-const appName = import.meta.env.VITE_APP_NAME || 'Laravel';+configureEcho({+ broadcaster: 'reverb',+});++const appName = import.meta.env.VITE_APP_NAME || 'TryPost.it';createInertiaApp({title: (title) => (title ? `${title} - ${appName}` : appName),diff --git a/resources/js/components/AppHeader.vue b/resources/js/components/AppHeader.vueindex 5155ac81f..720a2df2b 100644--- a/resources/js/components/AppHeader.vue+++ b/resources/js/components/AppHeader.vue@@ -1,11 +1,9 @@<script setup lang="ts">import type { InertiaLinkProps } from '@inertiajs/vue3';import { Link, usePage } from '@inertiajs/vue3';-import { BookOpen, Folder, LayoutGrid, Menu, Search } from 'lucide-vue-next';+import { Briefcase, Menu } from 'lucide-vue-next';import { computed } from 'vue';-import AppLogo from '@/components/AppLogo.vue';-import AppLogoIcon from '@/components/AppLogoIcon.vue';import Breadcrumbs from '@/components/Breadcrumbs.vue';import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';import { Button } from '@/components/ui/button';@@ -27,17 +25,9 @@ import {SheetTitle,SheetTrigger,} from '@/components/ui/sheet';-import {- Tooltip,- TooltipContent,- TooltipProvider,- TooltipTrigger,-} from '@/components/ui/tooltip';import UserMenuContent from '@/components/UserMenuContent.vue';import { useActiveUrl } from '@/composables/useActiveUrl';import { getInitials } from '@/composables/useInitials';-import { toUrl } from '@/lib/utils';-import { dashboard } from '@/routes';import type { BreadcrumbItem, NavItem } from '@/types';interface Props {@@ -60,22 +50,9 @@ function activeItemStyles(url: NonNullable<InertiaLinkProps['href']>) {const mainNavItems: NavItem[] = [{- title: 'Dashboard',- href: dashboard(),- icon: LayoutGrid,- },-];--const rightNavItems: NavItem[] = [- {- title: 'Repository',- href: 'https://github.com/laravel/vue-starter-kit',- icon: Folder,- },- {- title: 'Documentation',- href: 'https://laravel.com/docs/starter-kits#vue',- icon: BookOpen,+ title: 'Workspaces',+ href: '/workspaces',+ icon: Briefcase,},];</script>@@ -88,171 +65,69 @@ const rightNavItems: NavItem[] = [<div class="lg:hidden"><Sheet><SheetTrigger :as-child="true">- <Button- variant="ghost"- size="icon"- class="mr-2 h-9 w-9"- >+ <Button variant="ghost" size="icon" class="mr-2 h-9 w-9"><Menu class="h-5 w-5" /></Button></SheetTrigger><SheetContent side="left" class="w-[300px] p-6">- <SheetTitle class="sr-only"- >Navigation Menu</SheetTitle- >+ <SheetTitle class="sr-only">Navigation Menu</SheetTitle><SheetHeader class="flex justify-start text-left">- <AppLogoIcon- class="size-6 fill-current text-black dark:text-white"- />+ <img src="/images/trypost/logo-light.png" alt="TryPost"+ class="dark:hidden h-8 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost"+ class="hidden dark:block h-8 w-auto" /></SheetHeader>- <div- class="flex h-full flex-1 flex-col justify-between space-y-4 py-6"- >+ <div class="flex h-full flex-1 flex-col justify-between space-y-4 py-6"><nav class="-mx-3 space-y-1">- <Link- v-for="item in mainNavItems"- :key="item.title"- :href="item.href"+ <Link v-for="item in mainNavItems" :key="item.title" :href="item.href"class="flex items-center gap-x-3 rounded-lg px-3 py-2 text-sm font-medium hover:bg-accent"- :class="activeItemStyles(item.href)"- >- <component- v-if="item.icon"- :is="item.icon"- class="h-5 w-5"- />+ :class="activeItemStyles(item.href)">+ <component v-if="item.icon" :is="item.icon" class="h-5 w-5" />{{ item.title }}</Link></nav>- <div class="flex flex-col space-y-4">- <a- v-for="item in rightNavItems"- :key="item.title"- :href="toUrl(item.href)"- target="_blank"- rel="noopener noreferrer"- class="flex items-center space-x-2 text-sm font-medium"- >- <component- v-if="item.icon"- :is="item.icon"- class="h-5 w-5"- />- <span>{{ item.title }}</span>- </a>- </div></div></SheetContent></Sheet></div>- <Link :href="dashboard()" class="flex items-center gap-x-2">- <AppLogo />+ <Link href="/workspaces" class="flex items-center gap-x-2">+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-8 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-8 w-auto" /></Link><!-- Desktop Menu --><div class="hidden h-full lg:flex lg:flex-1"><NavigationMenu class="ml-10 flex h-full items-stretch">- <NavigationMenuList- class="flex h-full items-stretch space-x-2"- >- <NavigationMenuItem- v-for="(item, index) in mainNavItems"- :key="index"- class="relative flex h-full items-center"- >- <Link- :class="[- navigationMenuTriggerStyle(),- activeItemStyles(item.href),- 'h-9 cursor-pointer px-3',- ]"- :href="item.href"- >- <component- v-if="item.icon"- :is="item.icon"- class="mr-2 h-4 w-4"- />+ <NavigationMenuList class="flex h-full items-stretch space-x-2">+ <NavigationMenuItem v-for="(item, index) in mainNavItems" :key="index"+ class="relative flex h-full items-center">+ <Link :class="[+ navigationMenuTriggerStyle(),+ activeItemStyles(item.href),+ 'h-9 cursor-pointer px-3',+ ]" :href="item.href">+ <component v-if="item.icon" :is="item.icon" class="mr-2 h-4 w-4" />{{ item.title }}</Link>- <div- v-if="urlIsActive(item.href)"- class="absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white"- ></div>+ <div v-if="urlIsActive(item.href)"+ class="absolute bottom-0 left-0 h-0.5 w-full translate-y-px bg-black dark:bg-white">+ </div></NavigationMenuItem></NavigationMenuList></NavigationMenu></div><div class="ml-auto flex items-center space-x-2">- <div class="relative flex items-center space-x-1">- <Button- variant="ghost"- size="icon"- class="group h-9 w-9 cursor-pointer"- >- <Search- class="size-5 opacity-80 group-hover:opacity-100"- />- </Button>-- <div class="hidden space-x-1 lg:flex">- <template- v-for="item in rightNavItems"- :key="item.title"- >- <TooltipProvider :delay-duration="0">- <Tooltip>- <TooltipTrigger>- <Button- variant="ghost"- size="icon"- as-child- class="group h-9 w-9 cursor-pointer"- >- <a- :href="toUrl(item.href)"- target="_blank"- rel="noopener noreferrer"- >- <span class="sr-only">{{- item.title- }}</span>- <component- :is="item.icon"- class="size-5 opacity-80 group-hover:opacity-100"- />- </a>- </Button>- </TooltipTrigger>- <TooltipContent>- <p>{{ item.title }}</p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- </template>- </div>- </div>-<DropdownMenu><DropdownMenuTrigger :as-child="true">- <Button- variant="ghost"- size="icon"- class="relative size-10 w-auto rounded-full p-1 focus-within:ring-2 focus-within:ring-primary"- >- <Avatar- class="size-8 overflow-hidden rounded-full"- >- <AvatarImage- v-if="auth.user.avatar"- :src="auth.user.avatar"- :alt="auth.user.name"- />+ <Button variant="ghost" size="icon"+ class="relative size-10 w-auto rounded-full p-1 focus-within:ring-2 focus-within:ring-primary">+ <Avatar class="size-8 overflow-hidden rounded-full">+ <AvatarImage v-if="auth.user.avatar" :src="auth.user.avatar"+ :alt="auth.user.name" /><AvatarFallback- class="rounded-lg bg-neutral-200 font-semibold text-black dark:bg-neutral-700 dark:text-white"- >+ class="rounded-lg bg-neutral-200 font-semibold text-black dark:bg-neutral-700 dark:text-white">{{ getInitials(auth.user?.name) }}</AvatarFallback></Avatar>@@ -266,15 +141,10 @@ const rightNavItems: NavItem[] = [</div></div>- <div- v-if="props.breadcrumbs.length > 1"- class="flex w-full border-b border-sidebar-border/70"- >- <div- class="mx-auto flex h-12 w-full items-center justify-start px-4 text-neutral-500 md:max-w-7xl"- >+ <div v-if="props.breadcrumbs.length > 1" class="flex w-full border-b border-sidebar-border/70">+ <div class="mx-auto flex h-12 w-full items-center justify-start px-4 text-neutral-500 md:max-w-7xl"><Breadcrumbs :breadcrumbs="breadcrumbs" /></div></div></div>-</template>+</template>\ No newline at end of filediff --git a/resources/js/components/AppLogo.vue b/resources/js/components/AppLogo.vuedeleted file mode 100644index bc795273d..000000000--- a/resources/js/components/AppLogo.vue+++ /dev/null@@ -1,16 +0,0 @@-<script setup lang="ts">-import AppLogoIcon from '@/components/AppLogoIcon.vue';-</script>--<template>- <div- class="flex aspect-square size-8 items-center justify-center rounded-md bg-sidebar-primary text-sidebar-primary-foreground"- >- <AppLogoIcon class="size-5 fill-current text-white dark:text-black" />- </div>- <div class="ml-1 grid flex-1 text-left text-sm">- <span class="mb-0.5 truncate leading-tight font-semibold"- >Laravel Starter Kit</span- >- </div>-</template>diff --git a/resources/js/components/AppLogoIcon.vue b/resources/js/components/AppLogoIcon.vuedeleted file mode 100644index 4300b81b3..000000000--- a/resources/js/components/AppLogoIcon.vue+++ /dev/null@@ -1,29 +0,0 @@-<script setup lang="ts">-import type { HTMLAttributes } from 'vue';--defineOptions({- inheritAttrs: false,-});--interface Props {- className?: HTMLAttributes['class'];-}--defineProps<Props>();-</script>--<template>- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 40 42"- :class="className"- v-bind="$attrs"- >- <path- fill="currentColor"- fill-rule="evenodd"- clip-rule="evenodd"- d="M17.2 5.633 8.6.855 0 5.633v26.51l16.2 9 16.2-9v-8.442l7.6-4.223V9.856l-8.6-4.777-8.6 4.777V18.3l-5.6 3.111V5.633ZM38 18.301l-5.6 3.11v-6.157l5.6-3.11V18.3Zm-1.06-7.856-5.54 3.078-5.54-3.079 5.54-3.078 5.54 3.079ZM24.8 18.3v-6.157l5.6 3.111v6.158L24.8 18.3Zm-1 1.732 5.54 3.078-13.14 7.302-5.54-3.078 13.14-7.3v-.002Zm-16.2 7.89 7.6 4.222V38.3L2 30.966V7.92l5.6 3.111v16.892ZM8.6 9.3 3.06 6.222 8.6 3.143l5.54 3.08L8.6 9.3Zm21.8 15.51-13.2 7.334V38.3l13.2-7.334v-6.156ZM9.6 11.034l5.6-3.11v14.6l-5.6 3.11v-14.6Z"- />- </svg>-</template>diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vuedeleted file mode 100644index dbb2a76b8..000000000--- a/resources/js/components/AppSidebar.vue+++ /dev/null@@ -1,68 +0,0 @@-<script setup lang="ts">-import { Link } from '@inertiajs/vue3';-import { BookOpen, Folder, LayoutGrid } from 'lucide-vue-next';--import NavFooter from '@/components/NavFooter.vue';-import NavMain from '@/components/NavMain.vue';-import NavUser from '@/components/NavUser.vue';-import {- Sidebar,- SidebarContent,- SidebarFooter,- SidebarHeader,- SidebarMenu,- SidebarMenuButton,- SidebarMenuItem,-} from '@/components/ui/sidebar';-import { dashboard } from '@/routes';-import { type NavItem } from '@/types';--import AppLogo from './AppLogo.vue';--const mainNavItems: NavItem[] = [- {- title: 'Dashboard',- href: dashboard(),- icon: LayoutGrid,- },-];--const footerNavItems: NavItem[] = [- {- title: 'Github Repo',- href: 'https://github.com/laravel/vue-starter-kit',- icon: Folder,- },- {- title: 'Documentation',- href: 'https://laravel.com/docs/starter-kits#vue',- icon: BookOpen,- },-];-</script>--<template>- <Sidebar collapsible="icon" variant="inset">- <SidebarHeader>- <SidebarMenu>- <SidebarMenuItem>- <SidebarMenuButton size="lg" as-child>- <Link :href="dashboard()">- <AppLogo />- </Link>- </SidebarMenuButton>- </SidebarMenuItem>- </SidebarMenu>- </SidebarHeader>-- <SidebarContent>- <NavMain :items="mainNavItems" />- </SidebarContent>-- <SidebarFooter>- <NavFooter :items="footerNavItems" />- <NavUser />- </SidebarFooter>- </Sidebar>- <slot />-</template>diff --git a/resources/js/components/ConfirmDeleteModal.vue b/resources/js/components/ConfirmDeleteModal.vuenew file mode 100644index 000000000..dae61d0a2--- /dev/null+++ b/resources/js/components/ConfirmDeleteModal.vue@@ -0,0 +1,128 @@+<script setup lang="ts">+import {+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,+} from '@/components/ui/alert-dialog';+import { router } from '@inertiajs/vue3';+import { ref } from 'vue';++const props = defineProps({+ title: {+ type: String,+ default: 'Are you sure?',+ },++ description: {+ type: String,+ default:+ 'Are you sure you want to perform this action? This action cannot be undone.',+ },++ action: {+ type: String,+ default: 'Delete',+ },++ cancel: {+ type: String,+ default: 'Cancel',+ },++ method: {+ type: String,+ default: 'delete',+ },++ preserveState: {+ type: Boolean,+ default: false,+ },++ preserveScroll: {+ type: Boolean,+ default: false,+ },+});++const emit = defineEmits(['deleted', 'closed']);++const isOpen = ref<boolean>(false);+const loading = ref<boolean>(false);+const url = ref<string | null>(null);++function remove() {+ if (!url.value) return;++ loading.value = true;++ router[props.method as 'delete' | 'get' | 'post' | 'put' | 'patch'](+ url.value,+ {},+ {+ preserveState: props.preserveState,+ preserveScroll: props.preserveScroll,+ onSuccess: () => {+ close();+ emit('deleted');+ },+ onError: (errors) => {+ console.error(errors);+ },+ onFinish: () => {+ loading.value = false;+ },+ },+ );+}++function open(data: { url: string }) {+ url.value = data.url;+ loading.value = false;+ isOpen.value = true;+}++function close() {+ isOpen.value = false;+ loading.value = false;+ emit('closed');+}++function onOpenChange(value: boolean) {+ isOpen.value = value;+ if (!value) {+ close();+ }+}++defineExpose({+ open,+ close,+});+</script>++<template>+ <AlertDialog :open="isOpen" @update:open="onOpenChange">+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>{{ title }}</AlertDialogTitle>+ <AlertDialogDescription>+ {{ description }}+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogCancel :disabled="loading">+ {{ cancel }}+ </AlertDialogCancel>+ <AlertDialogAction :disabled="loading" variant="default" @click="remove">+ {{ action }}+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+</template>\ No newline at end of filediff --git a/resources/js/components/DatePicker.vue b/resources/js/components/DatePicker.vuenew file mode 100644index 000000000..2af106939--- /dev/null+++ b/resources/js/components/DatePicker.vue@@ -0,0 +1,157 @@+<script setup lang="ts">+import { Button } from '@/components/ui/button';+import { Calendar } from '@/components/ui/calendar';+import { InputMask } from '@/components/ui/input';+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from '@/components/ui/popover';+import { useDateMaska } from '@/composables/useDateMaska';+import dayjs from '@/dayjs';+import { parseDate } from '@internationalized/date';+import { IconCalendar } from '@tabler/icons-vue';+import { ref, watch } from 'vue';++const props = defineProps({+ name: {+ type: String,+ required: true,+ },+ modelValue: {+ type: String,+ default: '',+ },+ align: {+ type: String as () => 'start' | 'center' | 'end',+ default: 'end',+ validator: (value: string) => ['start', 'end'].includes(value),+ },+ disabled: {+ type: Boolean,+ default: false,+ },+});++const emit = defineEmits(['update:modelValue']);++const { dateOptions } = useDateMaska();++// Parse input value into date+function parseInput(value: string) {+ if (!value) return undefined;++ // Parse date string (YYYY-MM-DD format)+ try {+ return parseDate(value);+ } catch {+ return undefined;+ }+}++const internalDate = ref(parseInput(props.modelValue));+const displayValue = ref(+ props.modelValue && dayjs(props.modelValue).isValid()+ ? dayjs(props.modelValue).format('MM/DD/YYYY')+ : '',+);+const popoverOpen = ref(false);++// Parse American date format (MM/DD/YYYY) to YYYY-MM-DD+function parseAmericanDate(value: string): string | null {+ if (!value) return null;++ // Remove any non-digit characters+ const digits = value.replace(/\D/g, '');++ // Try to parse MM/DD/YYYY format+ if (digits.length === 8) {+ const month = digits.substring(0, 2);+ const day = digits.substring(2, 4);+ const year = digits.substring(4, 8);++ const dateStr = `${year}-${month}-${day}`;+ const parsed = dayjs(dateStr, 'YYYY-MM-DD');++ if (parsed.isValid()) {+ return dateStr;+ }+ }++ return null;+}++// Handle manual input change+function onInputChange(event: Event) {+ const value = (event.target as HTMLInputElement).value;+ displayValue.value = value;++ const parsedDate = parseAmericanDate(value);+ if (parsedDate) {+ internalDate.value = parseInput(parsedDate);+ emit('update:modelValue', parsedDate);+ }+}++// Parse input value into date component+const isInternalUpdate = ref(false);++watch(+ () => props.modelValue,+ (newVal) => {+ if (isInternalUpdate.value) {+ isInternalUpdate.value = false;+ return;+ }++ internalDate.value = parseInput(newVal);++ // Update display value+ if (newVal) {+ const parsed = dayjs(newVal);+ if (parsed.isValid()) {+ displayValue.value = parsed.format('MM/DD/YYYY');+ }+ } else {+ displayValue.value = '';+ }+ },+ { immediate: true },+);++// Watch internal date changes from calendar+watch(internalDate, (newDate) => {+ if (!newDate || isInternalUpdate.value) return;++ isInternalUpdate.value = true;+ const formatted = newDate.toString();+ emit('update:modelValue', formatted);+ popoverOpen.value = false;++ // Update display value when date is selected from calendar+ if (formatted) {+ const parsed = dayjs(formatted);+ if (parsed.isValid()) {+ displayValue.value = parsed.format('MM/DD/YYYY');+ }+ }+});+</script>++<template>+ <div class="relative">+ <InputMask :id="name" v-model="displayValue" :mask-options="dateOptions" placeholder="MM/DD/YYYY"+ @input="onInputChange" class="pr-10" :disabled="disabled" />+ <Popover v-model:open="popoverOpen">+ <PopoverTrigger :disabled="disabled">+ <Button type="button" variant="ghost" size="sm" class="absolute top-0 right-0 z-10 h-full" :disabled="disabled">+ <IconCalendar class="h-4 w-4" />+ </Button>+ </PopoverTrigger>+ <PopoverContent class="w-auto p-0" :align="align">+ <Calendar v-model="internalDate" :placeholder="internalDate" layout="month-and-year" locale="en-US"+ calendar-label="Date picker" initial-focus />+ </PopoverContent>+ </Popover>+ </div>+</template>\ No newline at end of filediff --git a/resources/js/components/TimezoneCombobox.vue b/resources/js/components/TimezoneCombobox.vuenew file mode 100644index 000000000..2353c27d5--- /dev/null+++ b/resources/js/components/TimezoneCombobox.vue@@ -0,0 +1,129 @@+<script setup lang="ts">+import { Button } from '@/components/ui/button';+import {+ Combobox,+ ComboboxAnchor,+ ComboboxEmpty,+ ComboboxGroup,+ ComboboxInput,+ ComboboxItem,+ ComboboxItemIndicator,+ ComboboxList,+ ComboboxTrigger,+} from '@/components/ui/combobox';+import { IconCheck, IconChevronDown, IconSearch } from '@tabler/icons-vue';+import { FocusScope } from 'reka-ui';+import { ref, watchEffect } from 'vue';++interface Timezone {+ value: string;+ label: string;+}++interface Props {+ modelValue?: string | null;+ timezones: Record<string, string>;+}++const props = defineProps<Props>();+const emit = defineEmits<{+ 'update:modelValue': [value: string | null];+}>();++// Common timezones to show first+const commonTimezoneIds = [+ 'America/New_York',+ 'America/Chicago',+ 'America/Denver',+ 'America/Los_Angeles',+ 'America/Sao_Paulo',+ 'America/Mexico_City',+ 'Europe/London',+ 'Europe/Paris',+ 'Europe/Berlin',+ 'Asia/Tokyo',+ 'Asia/Shanghai',+ 'Asia/Dubai',+ 'Australia/Sydney',+ 'Pacific/Auckland',+];++// Build timezone list from props+const timezones = Object.keys(props.timezones)+ .sort((a, b) => {+ const aIsCommon = commonTimezoneIds.includes(a);+ const bIsCommon = commonTimezoneIds.includes(b);+ if (aIsCommon && !bIsCommon) return -1;+ if (!aIsCommon && bIsCommon) return 1;+ return a.localeCompare(b);+ })+ .map((tz) => ({+ value: tz,+ label: tz.replace(/_/g, ' '),+ }));++const selectedTimezone = ref<Timezone | undefined>();++watchEffect(() => {+ selectedTimezone.value = timezones.find(+ (tz) => tz.value === props.modelValue,+ );+});+</script>++<template>+ <FocusScope as-child>+ <Combobox+ :model-value="selectedTimezone"+ @update:model-value="+ (v: Timezone) => {+ selectedTimezone = v;+ emit('update:modelValue', v?.value || null);+ }+ "+ >+ <ComboboxAnchor as-child>+ <ComboboxTrigger as-child>+ <Button+ variant="outline"+ class="w-full justify-between"+ >+ {{+ selectedTimezone+ ? selectedTimezone.label+ : 'Select timezone'+ }}+ <IconChevronDown+ class="ml-2 h-4 w-4 shrink-0 opacity-50"+ />+ </Button>+ </ComboboxTrigger>+ </ComboboxAnchor>+ <ComboboxList class="w-full">+ <div class="relative">+ <ComboboxInput placeholder="Search timezone..." />+ <span+ class="absolute inset-y-0 start-0 flex items-center justify-center px-3"+ >+ <IconSearch class="size-4 text-muted-foreground" />+ </span>+ </div>+ <ComboboxEmpty>No timezone found</ComboboxEmpty>+ <ComboboxGroup>+ <ComboboxItem+ v-for="tz in timezones"+ :key="tz.value"+ :value="tz"+ >+ <span class="min-w-0 flex-1 truncate">{{+ tz.label+ }}</span>+ <ComboboxItemIndicator>+ <IconCheck class="ml-auto h-4 w-4" />+ </ComboboxItemIndicator>+ </ComboboxItem>+ </ComboboxGroup>+ </ComboboxList>+ </Combobox>+ </FocusScope>+</template>diff --git a/resources/js/components/Toast.vue b/resources/js/components/Toast.vuenew file mode 100644index 000000000..f7f28e1a0--- /dev/null+++ b/resources/js/components/Toast.vue@@ -0,0 +1,127 @@+<script setup lang="ts">+import { usePage } from '@inertiajs/vue3';+import { computed, ref, watch } from 'vue';++import {+ IconAlertTriangle,+ IconCircleCheck,+ IconCircleX,+ IconInfoCircle,+ IconX,+} from '@tabler/icons-vue';++const show = ref(false);+const animate = ref(false);+const style = computed(() => usePage().props.flash?.bannerStyle || 'success');+const message = computed(() => usePage().props.flash?.banner || '');++let timeoutId: ReturnType<typeof setTimeout> | null = null;++watch(+ message,+ (newMessage) => {+ if (newMessage) {+ show.value = true;+ // Reseta a animação+ animate.value = false;++ // Inicia a animação logo após mostrar+ setTimeout(() => {+ animate.value = true;+ }, 10);++ // Limpa timeout anterior se existir+ if (timeoutId) {+ clearTimeout(timeoutId);+ }++ // Define novo timeout+ timeoutId = setTimeout(() => {+ show.value = false;+ animate.value = false;+ timeoutId = null;+ }, 3000);+ }+ },+ { immediate: true },+);+</script>++<template>+ <div+ v-if="show && message"+ class="pointer-events-none fixed inset-0 z-50 flex px-4 py-6 sm:items-start sm:p-6"+ >+ <div+ class="absolute right-5 bottom-5 flex w-full flex-col items-end space-y-4"+ >+ <transition+ enter-active-class="transform ease-out duration-300 transition"+ enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"+ enter-to-class="translate-y-0 opacity-100 sm:translate-x-0"+ leave-active-class="transition ease-in duration-100"+ leave-from-class="opacity-100"+ leave-to-class="opacity-0"+ >+ <div+ v-if="show"+ class="ring-opacity-5 pointer-events-auto relative w-full max-w-sm overflow-hidden rounded-lg bg-zinc-800 shadow-2xl ring-1 ring-transparent dark:ring-zinc-700"+ >+ <!-- Barra de progresso animada -->+ <div+ class="absolute top-0 left-0 h-full transition-all duration-[3000ms] ease-linear"+ :class="{+ 'w-0': !animate,+ 'w-full': animate,+ 'bg-green-500/10': style === 'success',+ 'bg-red-500/10': style === 'danger',+ 'bg-blue-500/10': style === 'info',+ 'bg-yellow-500/10': style === 'warning',+ }"+ />+ <div class="relative p-4">+ <div class="flex items-start">+ <div class="mt-0.5 flex-shrink-0">+ <IconCircleCheck+ v-if="style == 'success'"+ class="h-6 w-6 stroke-2 text-green-400"+ aria-hidden="true"+ />+ <IconCircleX+ v-if="style == 'danger'"+ class="h-6 w-6 stroke-2 text-red-400"+ aria-hidden="true"+ />+ <IconInfoCircle+ v-if="style == 'info'"+ class="h-6 w-6 stroke-2 text-blue-400"+ aria-hidden="true"+ />+ <IconAlertTriangle+ v-if="style == 'warning'"+ class="h-6 w-6 stroke-2 text-yellow-400"+ aria-hidden="true"+ />+ </div>+ <div class="ml-3 w-0 flex-1 pt-0.5">+ <p class="text-sm font-medium text-white">+ {{ message }}+ </p>+ </div>+ <div class="ml-4 flex flex-shrink-0">+ <button+ type="button"+ @click="show = false"+ class="inline-flex rounded-md bg-transparent text-zinc-400 hover:text-zinc-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none"+ >+ <span class="sr-only">Close</span>+ <IconX class="h-5 w-5" aria-hidden="true" />+ </button>+ </div>+ </div>+ </div>+ </div>+ </transition>+ </div>+ </div>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialog.vue b/resources/js/components/ui/alert-dialog/AlertDialog.vuenew file mode 100644index 000000000..b6e6b4bf8--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialog.vue@@ -0,0 +1,15 @@+<script setup lang="ts">+import type { AlertDialogEmits, AlertDialogProps } from "reka-ui"+import { AlertDialogRoot, useForwardPropsEmits } from "reka-ui"++const props = defineProps<AlertDialogProps>()+const emits = defineEmits<AlertDialogEmits>()++const forwarded = useForwardPropsEmits(props, emits)+</script>++<template>+ <AlertDialogRoot v-slot="slotProps" data-slot="alert-dialog" v-bind="forwarded">+ <slot v-bind="slotProps" />+ </AlertDialogRoot>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogAction.vue b/resources/js/components/ui/alert-dialog/AlertDialogAction.vuenew file mode 100644index 000000000..09cf6fcbc--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogAction.vue@@ -0,0 +1,18 @@+<script setup lang="ts">+import type { AlertDialogActionProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { AlertDialogAction } from "reka-ui"+import { cn } from "@/lib/utils"+import { buttonVariants } from '@/components/ui/button'++const props = defineProps<AlertDialogActionProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <AlertDialogAction v-bind="delegatedProps" :class="cn(buttonVariants(), props.class)">+ <slot />+ </AlertDialogAction>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogCancel.vue b/resources/js/components/ui/alert-dialog/AlertDialogCancel.vuenew file mode 100644index 000000000..e261894e5--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogCancel.vue@@ -0,0 +1,25 @@+<script setup lang="ts">+import type { AlertDialogCancelProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { AlertDialogCancel } from "reka-ui"+import { cn } from "@/lib/utils"+import { buttonVariants } from '@/components/ui/button'++const props = defineProps<AlertDialogCancelProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <AlertDialogCancel+ v-bind="delegatedProps"+ :class="cn(+ buttonVariants({ variant: 'outline' }),+ 'mt-2 sm:mt-0',+ props.class,+ )"+ >+ <slot />+ </AlertDialogCancel>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogContent.vue b/resources/js/components/ui/alert-dialog/AlertDialogContent.vuenew file mode 100644index 000000000..4597f0dc6--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogContent.vue@@ -0,0 +1,44 @@+<script setup lang="ts">+import type { AlertDialogContentEmits, AlertDialogContentProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ AlertDialogContent,+ AlertDialogOverlay,+ AlertDialogPortal,+ useForwardPropsEmits,+} from "reka-ui"+import { cn } from "@/lib/utils"++defineOptions({+ inheritAttrs: false,+})++const props = defineProps<AlertDialogContentProps & { class?: HTMLAttributes["class"] }>()+const emits = defineEmits<AlertDialogContentEmits>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <AlertDialogPortal>+ <AlertDialogOverlay+ data-slot="alert-dialog-overlay"+ class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80"+ />+ <AlertDialogContent+ data-slot="alert-dialog-content"+ v-bind="{ ...$attrs, ...forwarded }"+ :class="+ cn(+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',+ props.class,+ )+ "+ >+ <slot />+ </AlertDialogContent>+ </AlertDialogPortal>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogDescription.vue b/resources/js/components/ui/alert-dialog/AlertDialogDescription.vuenew file mode 100644index 000000000..69642c9a5--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogDescription.vue@@ -0,0 +1,23 @@+<script setup lang="ts">+import type { AlertDialogDescriptionProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ AlertDialogDescription,+} from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<AlertDialogDescriptionProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <AlertDialogDescription+ data-slot="alert-dialog-description"+ v-bind="delegatedProps"+ :class="cn('text-muted-foreground text-sm', props.class)"+ >+ <slot />+ </AlertDialogDescription>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogFooter.vue b/resources/js/components/ui/alert-dialog/AlertDialogFooter.vuenew file mode 100644index 000000000..50d4098ea--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogFooter.vue@@ -0,0 +1,22 @@+<script setup lang="ts">+import type { HTMLAttributes } from "vue"+import { cn } from "@/lib/utils"++const props = defineProps<{+ class?: HTMLAttributes["class"]+}>()+</script>++<template>+ <div+ data-slot="alert-dialog-footer"+ :class="+ cn(+ 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',+ props.class,+ )+ "+ >+ <slot />+ </div>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogHeader.vue b/resources/js/components/ui/alert-dialog/AlertDialogHeader.vuenew file mode 100644index 000000000..dbe72a764--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogHeader.vue@@ -0,0 +1,17 @@+<script setup lang="ts">+import type { HTMLAttributes } from "vue"+import { cn } from "@/lib/utils"++const props = defineProps<{+ class?: HTMLAttributes["class"]+}>()+</script>++<template>+ <div+ data-slot="alert-dialog-header"+ :class="cn('flex flex-col gap-2 text-center sm:text-left', props.class)"+ >+ <slot />+ </div>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogTitle.vue b/resources/js/components/ui/alert-dialog/AlertDialogTitle.vuenew file mode 100644index 000000000..bb97e4d4a--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogTitle.vue@@ -0,0 +1,21 @@+<script setup lang="ts">+import type { AlertDialogTitleProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { AlertDialogTitle } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<AlertDialogTitleProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <AlertDialogTitle+ data-slot="alert-dialog-title"+ v-bind="delegatedProps"+ :class="cn('text-lg font-semibold', props.class)"+ >+ <slot />+ </AlertDialogTitle>+</template>diff --git a/resources/js/components/ui/alert-dialog/AlertDialogTrigger.vue b/resources/js/components/ui/alert-dialog/AlertDialogTrigger.vuenew file mode 100644index 000000000..98d40ee08--- /dev/null+++ b/resources/js/components/ui/alert-dialog/AlertDialogTrigger.vue@@ -0,0 +1,12 @@+<script setup lang="ts">+import type { AlertDialogTriggerProps } from "reka-ui"+import { AlertDialogTrigger } from "reka-ui"++const props = defineProps<AlertDialogTriggerProps>()+</script>++<template>+ <AlertDialogTrigger data-slot="alert-dialog-trigger" v-bind="props">+ <slot />+ </AlertDialogTrigger>+</template>diff --git a/resources/js/components/ui/alert-dialog/index.ts b/resources/js/components/ui/alert-dialog/index.tsnew file mode 100644index 000000000..cf1b45dff--- /dev/null+++ b/resources/js/components/ui/alert-dialog/index.ts@@ -0,0 +1,9 @@+export { default as AlertDialog } from "./AlertDialog.vue"+export { default as AlertDialogAction } from "./AlertDialogAction.vue"+export { default as AlertDialogCancel } from "./AlertDialogCancel.vue"+export { default as AlertDialogContent } from "./AlertDialogContent.vue"+export { default as AlertDialogDescription } from "./AlertDialogDescription.vue"+export { default as AlertDialogFooter } from "./AlertDialogFooter.vue"+export { default as AlertDialogHeader } from "./AlertDialogHeader.vue"+export { default as AlertDialogTitle } from "./AlertDialogTitle.vue"+export { default as AlertDialogTrigger } from "./AlertDialogTrigger.vue"diff --git a/resources/js/components/ui/calendar/Calendar.vue b/resources/js/components/ui/calendar/Calendar.vuenew file mode 100644index 000000000..3054f730c--- /dev/null+++ b/resources/js/components/ui/calendar/Calendar.vue@@ -0,0 +1,160 @@+<script lang="ts" setup>+import type { CalendarRootEmits, CalendarRootProps, DateValue } from "reka-ui"+import type { HTMLAttributes, Ref } from "vue"+import type { LayoutTypes } from "."+import { getLocalTimeZone, today } from "@internationalized/date"+import { createReusableTemplate, reactiveOmit, useVModel } from "@vueuse/core"+import { CalendarRoot, useDateFormatter, useForwardPropsEmits } from "reka-ui"+import { createYear, createYearRange, toDate } from "reka-ui/date"+import { computed, toRaw } from "vue"+import { cn } from "@/lib/utils"+import { NativeSelect, NativeSelectOption } from '@/components/ui/native-select'+import { CalendarCell, CalendarCellTrigger, CalendarGrid, CalendarGridBody, CalendarGridHead, CalendarGridRow, CalendarHeadCell, CalendarHeader, CalendarHeading, CalendarNextButton, CalendarPrevButton } from "."++const props = withDefaults(defineProps<CalendarRootProps & { class?: HTMLAttributes["class"], layout?: LayoutTypes, yearRange?: DateValue[] }>(), {+ modelValue: undefined,+ layout: undefined,+})+const emits = defineEmits<CalendarRootEmits>()++const delegatedProps = reactiveOmit(props, "class", "layout", "placeholder")++const placeholder = useVModel(props, "placeholder", emits, {+ passive: true,+ defaultValue: props.defaultPlaceholder ?? today(getLocalTimeZone()),+}) as Ref<DateValue>++const formatter = useDateFormatter(props.locale ?? "en")++const yearRange = computed(() => {+ return props.yearRange ?? createYearRange({+ start: props?.minValue ?? (toRaw(props.placeholder) ?? props.defaultPlaceholder ?? today(getLocalTimeZone()))+ .cycle("year", -100),++ end: props?.maxValue ?? (toRaw(props.placeholder) ?? props.defaultPlaceholder ?? today(getLocalTimeZone()))+ .cycle("year", 10),+ })+})++const [DefineMonthTemplate, ReuseMonthTemplate] = createReusableTemplate<{ date: DateValue }>()+const [DefineYearTemplate, ReuseYearTemplate] = createReusableTemplate<{ date: DateValue }>()++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <DefineMonthTemplate v-slot="{ date }">+ <div class="**:data-[slot=native-select-icon]:right-1">+ <div class="relative">+ <div class="absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none">+ {{ formatter.custom(toDate(date), { month: 'short' }) }}+ </div>+ <NativeSelect+ class="text-xs h-8 pr-6 pl-2 text-transparent relative"+ @change="(e: Event) => {+ placeholder = placeholder.set({+ month: Number((e?.target as any)?.value),+ })+ }"+ >+ <NativeSelectOption v-for="(month) in createYear({ dateObj: date })" :key="month.toString()" :value="month.month" :selected="date.month === month.month">+ {{ formatter.custom(toDate(month), { month: 'short' }) }}+ </NativeSelectOption>+ </NativeSelect>+ </div>+ </div>+ </DefineMonthTemplate>++ <DefineYearTemplate v-slot="{ date }">+ <div class="**:data-[slot=native-select-icon]:right-1">+ <div class="relative">+ <div class="absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none">+ {{ formatter.custom(toDate(date), { year: 'numeric' }) }}+ </div>+ <NativeSelect+ class="text-xs h-8 pr-6 pl-2 text-transparent relative"+ @change="(e: Event) => {+ placeholder = placeholder.set({+ year: Number((e?.target as any)?.value),+ })+ }"+ >+ <NativeSelectOption v-for="(year) in yearRange" :key="year.toString()" :value="year.year" :selected="date.year === year.year">+ {{ formatter.custom(toDate(year), { year: 'numeric' }) }}+ </NativeSelectOption>+ </NativeSelect>+ </div>+ </div>+ </DefineYearTemplate>++ <CalendarRoot+ v-slot="{ grid, weekDays, date }"+ v-bind="forwarded"+ v-model:placeholder="placeholder"+ data-slot="calendar"+ :class="cn('p-3', props.class)"+ >+ <CalendarHeader class="pt-0">+ <nav class="flex items-center gap-1 absolute top-0 inset-x-0 justify-between">+ <CalendarPrevButton>+ <slot name="calendar-prev-icon" />+ </CalendarPrevButton>+ <CalendarNextButton>+ <slot name="calendar-next-icon" />+ </CalendarNextButton>+ </nav>++ <slot name="calendar-heading" :date="date" :month="ReuseMonthTemplate" :year="ReuseYearTemplate">+ <template v-if="layout === 'month-and-year'">+ <div class="flex items-center justify-center gap-1">+ <ReuseMonthTemplate :date="date" />+ <ReuseYearTemplate :date="date" />+ </div>+ </template>+ <template v-else-if="layout === 'month-only'">+ <div class="flex items-center justify-center gap-1">+ <ReuseMonthTemplate :date="date" />+ {{ formatter.custom(toDate(date), { year: 'numeric' }) }}+ </div>+ </template>+ <template v-else-if="layout === 'year-only'">+ <div class="flex items-center justify-center gap-1">+ {{ formatter.custom(toDate(date), { month: 'short' }) }}+ <ReuseYearTemplate :date="date" />+ </div>+ </template>+ <template v-else>+ <CalendarHeading />+ </template>+ </slot>+ </CalendarHeader>++ <div class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">+ <CalendarGrid v-for="month in grid" :key="month.value.toString()">+ <CalendarGridHead>+ <CalendarGridRow>+ <CalendarHeadCell+ v-for="day in weekDays" :key="day"+ >+ {{ day }}+ </CalendarHeadCell>+ </CalendarGridRow>+ </CalendarGridHead>+ <CalendarGridBody>+ <CalendarGridRow v-for="(weekDates, index) in month.rows" :key="`weekDate-${index}`" class="mt-2 w-full">+ <CalendarCell+ v-for="weekDate in weekDates"+ :key="weekDate.toString()"+ :date="weekDate"+ >+ <CalendarCellTrigger+ :day="weekDate"+ :month="month.value"+ />+ </CalendarCell>+ </CalendarGridRow>+ </CalendarGridBody>+ </CalendarGrid>+ </div>+ </CalendarRoot>+</template>diff --git a/resources/js/components/ui/calendar/CalendarCell.vue b/resources/js/components/ui/calendar/CalendarCell.vuenew file mode 100644index 000000000..15b802883--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarCell.vue@@ -0,0 +1,23 @@+<script lang="ts" setup>+import type { CalendarCellProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarCell, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarCellProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarCell+ data-slot="calendar-cell"+ :class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent', props.class)"+ v-bind="forwardedProps"+ >+ <slot />+ </CalendarCell>+</template>diff --git a/resources/js/components/ui/calendar/CalendarCellTrigger.vue b/resources/js/components/ui/calendar/CalendarCellTrigger.vuenew file mode 100644index 000000000..1107fc6ed--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarCellTrigger.vue@@ -0,0 +1,39 @@+<script lang="ts" setup>+import type { CalendarCellTriggerProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarCellTrigger, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"+import { buttonVariants } from '@/components/ui/button'++const props = withDefaults(defineProps<CalendarCellTriggerProps & { class?: HTMLAttributes["class"] }>(), {+ as: "button",+})++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarCellTrigger+ data-slot="calendar-cell-trigger"+ :class="cn(+ buttonVariants({ variant: 'ghost' }),+ 'size-8 p-0 font-normal aria-selected:opacity-100 cursor-default',+ '[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground',+ // Selected+ 'data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground',+ // Disabled+ 'data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',+ // Unavailable+ 'data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through',+ // Outside months+ 'data-[outside-view]:text-muted-foreground',+ props.class,+ )"+ v-bind="forwardedProps"+ >+ <slot />+ </CalendarCellTrigger>+</template>diff --git a/resources/js/components/ui/calendar/CalendarGrid.vue b/resources/js/components/ui/calendar/CalendarGrid.vuenew file mode 100644index 000000000..e6dd7d6b9--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarGrid.vue@@ -0,0 +1,23 @@+<script lang="ts" setup>+import type { CalendarGridProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarGrid, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarGridProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarGrid+ data-slot="calendar-grid"+ :class="cn('w-full border-collapse space-x-1', props.class)"+ v-bind="forwardedProps"+ >+ <slot />+ </CalendarGrid>+</template>diff --git a/resources/js/components/ui/calendar/CalendarGridBody.vue b/resources/js/components/ui/calendar/CalendarGridBody.vuenew file mode 100644index 000000000..3b9e716a6--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarGridBody.vue@@ -0,0 +1,15 @@+<script lang="ts" setup>+import type { CalendarGridBodyProps } from "reka-ui"+import { CalendarGridBody } from "reka-ui"++const props = defineProps<CalendarGridBodyProps>()+</script>++<template>+ <CalendarGridBody+ data-slot="calendar-grid-body"+ v-bind="props"+ >+ <slot />+ </CalendarGridBody>+</template>diff --git a/resources/js/components/ui/calendar/CalendarGridHead.vue b/resources/js/components/ui/calendar/CalendarGridHead.vuenew file mode 100644index 000000000..de1589b60--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarGridHead.vue@@ -0,0 +1,16 @@+<script lang="ts" setup>+import type { CalendarGridHeadProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { CalendarGridHead } from "reka-ui"++const props = defineProps<CalendarGridHeadProps & { class?: HTMLAttributes["class"] }>()+</script>++<template>+ <CalendarGridHead+ data-slot="calendar-grid-head"+ v-bind="props"+ >+ <slot />+ </CalendarGridHead>+</template>diff --git a/resources/js/components/ui/calendar/CalendarGridRow.vue b/resources/js/components/ui/calendar/CalendarGridRow.vuenew file mode 100644index 000000000..767557d87--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarGridRow.vue@@ -0,0 +1,22 @@+<script lang="ts" setup>+import type { CalendarGridRowProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarGridRow, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarGridRowProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarGridRow+ data-slot="calendar-grid-row"+ :class="cn('flex', props.class)" v-bind="forwardedProps"+ >+ <slot />+ </CalendarGridRow>+</template>diff --git a/resources/js/components/ui/calendar/CalendarHeadCell.vue b/resources/js/components/ui/calendar/CalendarHeadCell.vuenew file mode 100644index 000000000..47fefbc7a--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarHeadCell.vue@@ -0,0 +1,23 @@+<script lang="ts" setup>+import type { CalendarHeadCellProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarHeadCell, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarHeadCellProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarHeadCell+ data-slot="calendar-head-cell"+ :class="cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem]', props.class)"+ v-bind="forwardedProps"+ >+ <slot />+ </CalendarHeadCell>+</template>diff --git a/resources/js/components/ui/calendar/CalendarHeader.vue b/resources/js/components/ui/calendar/CalendarHeader.vuenew file mode 100644index 000000000..175118dbf--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarHeader.vue@@ -0,0 +1,23 @@+<script lang="ts" setup>+import type { CalendarHeaderProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarHeader, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarHeaderProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarHeader+ data-slot="calendar-header"+ :class="cn('flex justify-center pt-1 relative items-center w-full px-8', props.class)"+ v-bind="forwardedProps"+ >+ <slot />+ </CalendarHeader>+</template>diff --git a/resources/js/components/ui/calendar/CalendarHeading.vue b/resources/js/components/ui/calendar/CalendarHeading.vuenew file mode 100644index 000000000..5a11c12f5--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarHeading.vue@@ -0,0 +1,30 @@+<script lang="ts" setup>+import type { CalendarHeadingProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { CalendarHeading, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<CalendarHeadingProps & { class?: HTMLAttributes["class"] }>()++defineSlots<{+ default: (props: { headingValue: string }) => any+}>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarHeading+ v-slot="{ headingValue }"+ data-slot="calendar-heading"+ :class="cn('text-sm font-medium', props.class)"+ v-bind="forwardedProps"+ >+ <slot :heading-value>+ {{ headingValue }}+ </slot>+ </CalendarHeading>+</template>diff --git a/resources/js/components/ui/calendar/CalendarNextButton.vue b/resources/js/components/ui/calendar/CalendarNextButton.vuenew file mode 100644index 000000000..bd1efcebb--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarNextButton.vue@@ -0,0 +1,31 @@+<script lang="ts" setup>+import type { CalendarNextProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { ChevronRight } from "lucide-vue-next"+import { CalendarNext, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"+import { buttonVariants } from '@/components/ui/button'++const props = defineProps<CalendarNextProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarNext+ data-slot="calendar-next-button"+ :class="cn(+ buttonVariants({ variant: 'outline' }),+ 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',+ props.class,+ )"+ v-bind="forwardedProps"+ >+ <slot>+ <ChevronRight class="size-4" />+ </slot>+ </CalendarNext>+</template>diff --git a/resources/js/components/ui/calendar/CalendarPrevButton.vue b/resources/js/components/ui/calendar/CalendarPrevButton.vuenew file mode 100644index 000000000..80bdcec6a--- /dev/null+++ b/resources/js/components/ui/calendar/CalendarPrevButton.vue@@ -0,0 +1,31 @@+<script lang="ts" setup>+import type { CalendarPrevProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { ChevronLeft } from "lucide-vue-next"+import { CalendarPrev, useForwardProps } from "reka-ui"+import { cn } from "@/lib/utils"+import { buttonVariants } from '@/components/ui/button'++const props = defineProps<CalendarPrevProps & { class?: HTMLAttributes["class"] }>()++const delegatedProps = reactiveOmit(props, "class")++const forwardedProps = useForwardProps(delegatedProps)+</script>++<template>+ <CalendarPrev+ data-slot="calendar-prev-button"+ :class="cn(+ buttonVariants({ variant: 'outline' }),+ 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',+ props.class,+ )"+ v-bind="forwardedProps"+ >+ <slot>+ <ChevronLeft class="size-4" />+ </slot>+ </CalendarPrev>+</template>diff --git a/resources/js/components/ui/calendar/index.ts b/resources/js/components/ui/calendar/index.tsnew file mode 100644index 000000000..552c634b7--- /dev/null+++ b/resources/js/components/ui/calendar/index.ts@@ -0,0 +1,14 @@+export { default as Calendar } from "./Calendar.vue"+export { default as CalendarCell } from "./CalendarCell.vue"+export { default as CalendarCellTrigger } from "./CalendarCellTrigger.vue"+export { default as CalendarGrid } from "./CalendarGrid.vue"+export { default as CalendarGridBody } from "./CalendarGridBody.vue"+export { default as CalendarGridHead } from "./CalendarGridHead.vue"+export { default as CalendarGridRow } from "./CalendarGridRow.vue"+export { default as CalendarHeadCell } from "./CalendarHeadCell.vue"+export { default as CalendarHeader } from "./CalendarHeader.vue"+export { default as CalendarHeading } from "./CalendarHeading.vue"+export { default as CalendarNextButton } from "./CalendarNextButton.vue"+export { default as CalendarPrevButton } from "./CalendarPrevButton.vue"++export type LayoutTypes = "month-and-year" | "month-only" | "year-only" | undefineddiff --git a/resources/js/components/ui/combobox/Combobox.vue b/resources/js/components/ui/combobox/Combobox.vuenew file mode 100644index 000000000..1e930a6be--- /dev/null+++ b/resources/js/components/ui/combobox/Combobox.vue@@ -0,0 +1,19 @@+<script setup lang="ts">+import type { ComboboxRootEmits, ComboboxRootProps } from "reka-ui"+import {+ ComboboxRoot,++ useForwardPropsEmits,+} from "reka-ui"++const props = defineProps<ComboboxRootProps>()+const emits = defineEmits<ComboboxRootEmits>()++const forwarded = useForwardPropsEmits(props, emits)+</script>++<template>+ <ComboboxRoot data-slot="combobox" v-bind="forwarded">+ <slot />+ </ComboboxRoot>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxAnchor.vue b/resources/js/components/ui/combobox/ComboboxAnchor.vuenew file mode 100644index 000000000..a7da66d28--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxAnchor.vue@@ -0,0 +1,30 @@+<script setup lang="ts">+import type { ComboboxAnchorProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxAnchor,++ useForwardProps,+} from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxAnchorProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardProps(delegatedProps)+</script>++<template>+ <ComboboxAnchor+ data-slot="combobox-anchor"+ v-bind="forwarded"+ :class="cn('w-[200px]', props.class)"+ >+ <slot />+ </ComboboxAnchor>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxEmpty.vue b/resources/js/components/ui/combobox/ComboboxEmpty.vuenew file mode 100644index 000000000..bd001207a--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxEmpty.vue@@ -0,0 +1,24 @@+<script setup lang="ts">+import type { ComboboxEmptyProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { ComboboxEmpty } from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxEmptyProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <ComboboxEmpty+ data-slot="combobox-empty"+ v-bind="delegatedProps"+ :class="cn('py-6 text-center text-sm', props.class)"+ >+ <slot />+ </ComboboxEmpty>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxGroup.vue b/resources/js/components/ui/combobox/ComboboxGroup.vuenew file mode 100644index 000000000..b3fc9da1f--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxGroup.vue@@ -0,0 +1,35 @@+<script setup lang="ts">+import type { ComboboxGroupProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { ComboboxGroup, ComboboxLabel } from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxGroupProps & {+ class?: HTMLAttributes["class"]+ heading?: string+ }+>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <ComboboxGroup+ data-slot="combobox-group"+ v-bind="delegatedProps"+ :class="+ cn('overflow-y-auto max-h-[240px] p-1 text-foreground', props.class)+ "+ >+ <ComboboxLabel+ v-if="heading"+ class="px-2 py-1.5 text-xs font-medium text-muted-foreground"+ >+ {{ heading }}+ </ComboboxLabel>+ <slot />+ </ComboboxGroup>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxInput.vue b/resources/js/components/ui/combobox/ComboboxInput.vuenew file mode 100644index 000000000..f1aedd243--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxInput.vue@@ -0,0 +1,50 @@+<script setup lang="ts">+import type { ComboboxInputEmits, ComboboxInputProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { IconSearch } from '@tabler/icons-vue'+import {+ ComboboxInput,++ useForwardPropsEmits,+} from "reka-ui"++import { cn } from "@/lib/utils"++defineOptions({+ inheritAttrs: false,+})++const props = defineProps<+ ComboboxInputProps & {+ class?: HTMLAttributes["class"]+ }+>()++const emits = defineEmits<ComboboxInputEmits>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <div+ data-slot="command-input-wrapper"+ class="flex h-9 items-center gap-2 border-b px-3"+ >+ <IconSearch class="size-4 shrink-0 opacity-50" />+ <ComboboxInput+ data-slot="command-input"+ :class="+ cn(+ 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',+ props.class,+ )+ "+ v-bind="{ ...forwarded, ...$attrs }"+ >+ <slot />+ </ComboboxInput>+ </div>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxItem.vue b/resources/js/components/ui/combobox/ComboboxItem.vuenew file mode 100644index 000000000..3efdf6d9c--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxItem.vue@@ -0,0 +1,35 @@+<script setup lang="ts">+import type { ComboboxItemEmits, ComboboxItemProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxItem,++ useForwardPropsEmits,+} from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxItemProps & { class?: HTMLAttributes["class"] }+>()+const emits = defineEmits<ComboboxItemEmits>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <ComboboxItem+ data-slot="combobox-item"+ v-bind="forwarded"+ :class="+ cn(+ `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground hover:bg-accent hover:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full min-w-0 cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,+ props.class,+ )+ "+ >+ <slot />+ </ComboboxItem>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxItemIndicator.vue b/resources/js/components/ui/combobox/ComboboxItemIndicator.vuenew file mode 100644index 000000000..64a4b214b--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxItemIndicator.vue@@ -0,0 +1,30 @@+<script setup lang="ts">+import type { ComboboxItemIndicatorProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxItemIndicator,++ useForwardProps,+} from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxItemIndicatorProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardProps(delegatedProps)+</script>++<template>+ <ComboboxItemIndicator+ data-slot="combobox-item-indicator"+ v-bind="forwarded"+ :class="cn('ml-auto', props.class)"+ >+ <slot />+ </ComboboxItemIndicator>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxList.vue b/resources/js/components/ui/combobox/ComboboxList.vuenew file mode 100644index 000000000..e16876546--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxList.vue@@ -0,0 +1,43 @@+<script setup lang="ts">+import type { ComboboxContentEmits, ComboboxContentProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxContent,++ ComboboxPortal,+ useForwardPropsEmits,+} from "reka-ui"++import { cn } from "@/lib/utils"++const props = withDefaults(+ defineProps<ComboboxContentProps & { class?: HTMLAttributes["class"] }>(),+ {+ position: "popper",+ align: "center",+ sideOffset: 4,+ },+)+const emits = defineEmits<ComboboxContentEmits>()++const delegatedProps = reactiveOmit(props, "class")+const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <ComboboxPortal>+ <ComboboxContent+ data-slot="combobox-list"+ v-bind="forwarded"+ :class="+ cn(+ 'z-50 rounded-md border bg-popover text-popover-foreground origin-(--reka-combobox-content-transform-origin) overflow-hidden shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-[var(--reka-combobox-trigger-width)] w-auto truncate max-w-[var(--reka-combobox-trigger-width)]',+ props.class,+ )+ "+ >+ <slot />+ </ComboboxContent>+ </ComboboxPortal>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxSeparator.vue b/resources/js/components/ui/combobox/ComboboxSeparator.vuenew file mode 100644index 000000000..a481aa8fd--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxSeparator.vue@@ -0,0 +1,24 @@+<script setup lang="ts">+import type { ComboboxSeparatorProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import { ComboboxSeparator } from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxSeparatorProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <ComboboxSeparator+ data-slot="combobox-separator"+ v-bind="delegatedProps"+ :class="cn('bg-border -mx-1 h-px', props.class)"+ >+ <slot />+ </ComboboxSeparator>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxTrigger.vue b/resources/js/components/ui/combobox/ComboboxTrigger.vuenew file mode 100644index 000000000..7901cb2b0--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxTrigger.vue@@ -0,0 +1,31 @@+<script setup lang="ts">+import type { ComboboxTriggerProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxTrigger,++ useForwardProps,+} from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxTriggerProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardProps(delegatedProps)+</script>++<template>+ <ComboboxTrigger+ data-slot="combobox-trigger"+ v-bind="forwarded"+ :class="cn('', props.class)"+ tabindex="0"+ >+ <slot />+ </ComboboxTrigger>+</template>diff --git a/resources/js/components/ui/combobox/ComboboxViewport.vue b/resources/js/components/ui/combobox/ComboboxViewport.vuenew file mode 100644index 000000000..e512468fe--- /dev/null+++ b/resources/js/components/ui/combobox/ComboboxViewport.vue@@ -0,0 +1,35 @@+<script setup lang="ts">+import type { ComboboxViewportProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ ComboboxViewport,++ useForwardProps,+} from "reka-ui"++import { cn } from "@/lib/utils"++const props = defineProps<+ ComboboxViewportProps & { class?: HTMLAttributes["class"] }+>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardProps(delegatedProps)+</script>++<template>+ <ComboboxViewport+ data-slot="combobox-viewport"+ v-bind="forwarded"+ :class="+ cn(+ 'max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto',+ props.class,+ )+ "+ >+ <slot />+ </ComboboxViewport>+</template>diff --git a/resources/js/components/ui/combobox/index.ts b/resources/js/components/ui/combobox/index.tsnew file mode 100644index 000000000..7c7bfc785--- /dev/null+++ b/resources/js/components/ui/combobox/index.ts@@ -0,0 +1,12 @@+export { default as Combobox } from "./Combobox.vue"+export { default as ComboboxAnchor } from "./ComboboxAnchor.vue"+export { default as ComboboxEmpty } from "./ComboboxEmpty.vue"+export { default as ComboboxGroup } from "./ComboboxGroup.vue"+export { default as ComboboxInput } from "./ComboboxInput.vue"+export { default as ComboboxItem } from "./ComboboxItem.vue"+export { default as ComboboxItemIndicator } from "./ComboboxItemIndicator.vue"+export { default as ComboboxList } from "./ComboboxList.vue"+export { default as ComboboxSeparator } from "./ComboboxSeparator.vue"+export { default as ComboboxViewport } from "./ComboboxViewport.vue"++export { ComboboxCancel, ComboboxTrigger } from "reka-ui"diff --git a/resources/js/components/ui/input/InputMask.vue b/resources/js/components/ui/input/InputMask.vuenew file mode 100644index 000000000..0cc70bb59--- /dev/null+++ b/resources/js/components/ui/input/InputMask.vue@@ -0,0 +1,40 @@+<script setup lang="ts">+import type { HTMLAttributes } from 'vue';+import { vMaska } from 'maska/vue';+import { cn } from '@/lib/utils';++const props = defineProps<{+ defaultValue?: string | number;+ modelValue?: string | number;+ class?: HTMLAttributes['class'];+ maskOptions?: Record<string, any>;+ emitMasked?: boolean;+}>();++const emits = defineEmits<{+ 'update:modelValue': [value: string | number];+}>();++function onMaska(event: { detail: { masked: string; unmasked: string; completed: boolean } }) {+ const value = props.emitMasked ? event.detail.masked : event.detail.unmasked;+ emits('update:modelValue', value || '');+}+</script>++<template>+ <input+ v-maska+ v-bind="maskOptions"+ :value="modelValue"+ data-slot="input"+ :class="+ cn(+ 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',+ props.class,+ )+ "+ @maska="onMaska"+ />+</template>diff --git a/resources/js/components/ui/input/index.ts b/resources/js/components/ui/input/index.tsindex 9976b86f5..c31a94e28 100644--- a/resources/js/components/ui/input/index.ts+++ b/resources/js/components/ui/input/index.ts@@ -1 +1,2 @@export { default as Input } from "./Input.vue"+export { default as InputMask } from './InputMask.vue';\ No newline at end of filediff --git a/resources/js/components/ui/native-select/NativeSelect.vue b/resources/js/components/ui/native-select/NativeSelect.vuenew file mode 100644index 000000000..31716767a--- /dev/null+++ b/resources/js/components/ui/native-select/NativeSelect.vue@@ -0,0 +1,50 @@+<script setup lang="ts">+import type { AcceptableValue } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit, useVModel } from "@vueuse/core"+import { ChevronDownIcon } from "lucide-vue-next"+import { cn } from "@/lib/utils"++defineOptions({+ inheritAttrs: false,+})++const props = defineProps<{ modelValue?: AcceptableValue | AcceptableValue[], class?: HTMLAttributes["class"] }>()++const emit = defineEmits<{+ "update:modelValue": AcceptableValue+}>()++const modelValue = useVModel(props, "modelValue", emit, {+ passive: true,+ defaultValue: "",+})++const delegatedProps = reactiveOmit(props, "class")+</script>++<template>+ <div+ class="group/native-select relative w-fit has-[select:disabled]:opacity-50"+ data-slot="native-select-wrapper"+ >+ <select+ v-bind="{ ...$attrs, ...delegatedProps }"+ v-model="modelValue"+ data-slot="native-select"+ :class="cn(+ 'border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed',+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',+ props.class,+ )"+ >+ <slot />+ </select>+ <ChevronDownIcon+ class="text-muted-foreground pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 opacity-50 select-none"+ aria-hidden="true"+ data-slot="native-select-icon"+ />+ </div>+</template>diff --git a/resources/js/components/ui/native-select/NativeSelectOptGroup.vue b/resources/js/components/ui/native-select/NativeSelectOptGroup.vuenew file mode 100644index 000000000..169558cb8--- /dev/null+++ b/resources/js/components/ui/native-select/NativeSelectOptGroup.vue@@ -0,0 +1,15 @@+<!-- @fallthroughAttributes true -->+<!-- @strictTemplates true -->++<script setup lang="ts">+import type { HTMLAttributes } from "vue"+import { cn } from "@/lib/utils"++const props = defineProps<{ class?: HTMLAttributes["class"] }>()+</script>++<template>+ <optgroup data-slot="native-select-optgroup" :class="cn('bg-popover text-popover-foreground', props.class)">+ <slot />+ </optgroup>+</template>diff --git a/resources/js/components/ui/native-select/NativeSelectOption.vue b/resources/js/components/ui/native-select/NativeSelectOption.vuenew file mode 100644index 000000000..2f678fb61--- /dev/null+++ b/resources/js/components/ui/native-select/NativeSelectOption.vue@@ -0,0 +1,15 @@+<!-- @fallthroughAttributes true -->+<!-- @strictTemplates true -->++<script setup lang="ts">+import type { HTMLAttributes } from "vue"+import { cn } from "@/lib/utils"++const props = defineProps<{ class?: HTMLAttributes["class"] }>()+</script>++<template>+ <option data-slot="native-select-option" :class="cn('bg-popover text-popover-foreground', props.class)">+ <slot />+ </option>+</template>diff --git a/resources/js/components/ui/native-select/index.ts b/resources/js/components/ui/native-select/index.tsnew file mode 100644index 000000000..04e92c7ee--- /dev/null+++ b/resources/js/components/ui/native-select/index.ts@@ -0,0 +1,3 @@+export { default as NativeSelect } from "./NativeSelect.vue"+export { default as NativeSelectOptGroup } from "./NativeSelectOptGroup.vue"+export { default as NativeSelectOption } from "./NativeSelectOption.vue"diff --git a/resources/js/components/ui/popover/Popover.vue b/resources/js/components/ui/popover/Popover.vuenew file mode 100644index 000000000..4efdb98a0--- /dev/null+++ b/resources/js/components/ui/popover/Popover.vue@@ -0,0 +1,19 @@+<script setup lang="ts">+import type { PopoverRootEmits, PopoverRootProps } from "reka-ui"+import { PopoverRoot, useForwardPropsEmits } from "reka-ui"++const props = defineProps<PopoverRootProps>()+const emits = defineEmits<PopoverRootEmits>()++const forwarded = useForwardPropsEmits(props, emits)+</script>++<template>+ <PopoverRoot+ v-slot="slotProps"+ data-slot="popover"+ v-bind="forwarded"+ >+ <slot v-bind="slotProps" />+ </PopoverRoot>+</template>diff --git a/resources/js/components/ui/popover/PopoverAnchor.vue b/resources/js/components/ui/popover/PopoverAnchor.vuenew file mode 100644index 000000000..49e01dbc5--- /dev/null+++ b/resources/js/components/ui/popover/PopoverAnchor.vue@@ -0,0 +1,15 @@+<script setup lang="ts">+import type { PopoverAnchorProps } from "reka-ui"+import { PopoverAnchor } from "reka-ui"++const props = defineProps<PopoverAnchorProps>()+</script>++<template>+ <PopoverAnchor+ data-slot="popover-anchor"+ v-bind="props"+ >+ <slot />+ </PopoverAnchor>+</template>diff --git a/resources/js/components/ui/popover/PopoverContent.vue b/resources/js/components/ui/popover/PopoverContent.vuenew file mode 100644index 000000000..cf1e55c50--- /dev/null+++ b/resources/js/components/ui/popover/PopoverContent.vue@@ -0,0 +1,45 @@+<script setup lang="ts">+import type { PopoverContentEmits, PopoverContentProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ PopoverContent,+ PopoverPortal,+ useForwardPropsEmits,+} from "reka-ui"+import { cn } from "@/lib/utils"++defineOptions({+ inheritAttrs: false,+})++const props = withDefaults(+ defineProps<PopoverContentProps & { class?: HTMLAttributes["class"] }>(),+ {+ align: "center",+ sideOffset: 4,+ },+)+const emits = defineEmits<PopoverContentEmits>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <PopoverPortal>+ <PopoverContent+ data-slot="popover-content"+ v-bind="{ ...$attrs, ...forwarded }"+ :class="+ cn(+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden',+ props.class,+ )+ "+ >+ <slot />+ </PopoverContent>+ </PopoverPortal>+</template>diff --git a/resources/js/components/ui/popover/PopoverTrigger.vue b/resources/js/components/ui/popover/PopoverTrigger.vuenew file mode 100644index 000000000..fd3b4974d--- /dev/null+++ b/resources/js/components/ui/popover/PopoverTrigger.vue@@ -0,0 +1,15 @@+<script setup lang="ts">+import type { PopoverTriggerProps } from "reka-ui"+import { PopoverTrigger } from "reka-ui"++const props = defineProps<PopoverTriggerProps>()+</script>++<template>+ <PopoverTrigger+ data-slot="popover-trigger"+ v-bind="props"+ >+ <slot />+ </PopoverTrigger>+</template>diff --git a/resources/js/components/ui/popover/index.ts b/resources/js/components/ui/popover/index.tsnew file mode 100644index 000000000..66edf89f6--- /dev/null+++ b/resources/js/components/ui/popover/index.ts@@ -0,0 +1,4 @@+export { default as Popover } from "./Popover.vue"+export { default as PopoverAnchor } from "./PopoverAnchor.vue"+export { default as PopoverContent } from "./PopoverContent.vue"+export { default as PopoverTrigger } from "./PopoverTrigger.vue"diff --git a/resources/js/components/ui/switch/Switch.vue b/resources/js/components/ui/switch/Switch.vuenew file mode 100644index 000000000..2e725edb5--- /dev/null+++ b/resources/js/components/ui/switch/Switch.vue@@ -0,0 +1,38 @@+<script setup lang="ts">+import type { SwitchRootEmits, SwitchRootProps } from "reka-ui"+import type { HTMLAttributes } from "vue"+import { reactiveOmit } from "@vueuse/core"+import {+ SwitchRoot,+ SwitchThumb,+ useForwardPropsEmits,+} from "reka-ui"+import { cn } from "@/lib/utils"++const props = defineProps<SwitchRootProps & { class?: HTMLAttributes["class"] }>()++const emits = defineEmits<SwitchRootEmits>()++const delegatedProps = reactiveOmit(props, "class")++const forwarded = useForwardPropsEmits(delegatedProps, emits)+</script>++<template>+ <SwitchRoot+ v-slot="slotProps"+ data-slot="switch"+ v-bind="forwarded"+ :class="cn(+ 'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',+ props.class,+ )"+ >+ <SwitchThumb+ data-slot="switch-thumb"+ :class="cn('bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0')"+ >+ <slot name="thumb" v-bind="slotProps" />+ </SwitchThumb>+ </SwitchRoot>+</template>diff --git a/resources/js/components/ui/switch/index.ts b/resources/js/components/ui/switch/index.tsnew file mode 100644index 000000000..cc081f3f1--- /dev/null+++ b/resources/js/components/ui/switch/index.ts@@ -0,0 +1 @@+export { default as Switch } from "./Switch.vue"diff --git a/resources/js/composables/useDateMaska.ts b/resources/js/composables/useDateMaska.tsnew file mode 100644index 000000000..178a9d2d6--- /dev/null+++ b/resources/js/composables/useDateMaska.ts@@ -0,0 +1,10 @@+export function useDateMaska() {+ const dateOptions = {+ 'data-maska': '##/##/####',+ 'data-maska-tokens': '#:[0-9]',+ };++ return {+ dateOptions,+ };+}diff --git a/resources/js/date.ts b/resources/js/date.tsnew file mode 100644index 000000000..d21abf491--- /dev/null+++ b/resources/js/date.ts@@ -0,0 +1,186 @@+import dayjs from '@/dayjs';++/**+ * Obtém o timezone do usuário+ * Tenta pegar do Inertia page props primeiro, senão usa o timezone do browser+ */+function getUserTimezone(): string {+ return Intl.DateTimeFormat().resolvedOptions().timeZone;+}++export default {+ formatDate(date: string | null | undefined) {+ if (!date) return '-';+ return dayjs(date).format('DD/MM/YYYY');+ },++ formatDateTime(date: string) {+ return dayjs+ .utc(date)+ .tz(getUserTimezone())+ .format('D [de] MMM [de] YYYY [às] HH:mm');+ },++ formatTime(date: string | null | undefined) {+ if (!date) return '-';+ return dayjs.utc(date).tz(getUserTimezone()).format('HH:mm');+ },++ formatDateTimeForApi(date: string) {+ // Convert from user timezone to UTC for API+ return dayjs+ .tz(date, getUserTimezone())+ .utc()+ .format('YYYY-MM-DD HH:mm:ss');+ },++ formatDateTimeForDatePicker(date: string) {+ // Convert from UTC to user timezone for display+ if (!date) return dayjs().tz(getUserTimezone());+ return dayjs.utc(date).tz(getUserTimezone());+ },++ diffForHumans(date: string) {+ const localDate = dayjs+ .utc(date)+ .tz(getUserTimezone())+ .format('YYYY-MM-DD HH:mm:ss');+ return dayjs().to(dayjs(localDate));+ },++ formatTimelineDate(dateStr: string) {+ const d = dayjs(dateStr);+ return {+ day: d.date(),+ month: d.format('MMM'),+ year: d.year(),+ };+ },++ formatDuration(duration: string) {+ // Duration comes in format "HH:mm:ss"+ const [hours, minutes, seconds] = duration.split(':');+ const h = parseInt(hours, 10);+ const m = parseInt(minutes, 10);++ if (h > 0) {+ return `${h}h ${m}min`;+ }+ return `${m}min`;+ },++ formatMedicalRecordDuration(startAt: string, duration: string | null) {+ const startTime = this.formatTime(startAt);++ if (!duration) {+ return startTime;+ }++ const formattedDuration = this.formatDuration(duration);+ return `${startTime} (${formattedDuration})`;+ },++ /**+ * Converte horário de appointment de UTC para timezone do usuário+ * Específico para agenda onde date e time vêm separados do banco+ * @param date - Data no formato YYYY-MM-DD+ * @param time - Horário no formato HH:mm:ss+ * @returns Horário formatado no timezone do usuário (HH:mm)+ */+ convertAppointmentTimeToUserTimezone(date: string, time: string): string {+ return dayjs+ .utc(`${date} ${time}`)+ .tz(getUserTimezone())+ .format('HH:mm');+ },++ /**+ * Converte horário de appointment de UTC para timezone do usuário e retorna objeto dayjs+ * Útil para cálculos de posicionamento na agenda+ * @param date - Data no formato YYYY-MM-DD+ * @param time - Horário no formato HH:mm:ss+ * @returns Objeto dayjs no timezone do usuário+ */+ getAppointmentDateTimeInUserTimezone(date: string, time: string) {+ return dayjs.utc(`${date} ${time}`).tz(getUserTimezone());+ },++ /**+ * Formata o nome do mês e ano+ * @param month - Número do mês (1-12)+ * @param year - Ano (ex: 2025)+ * @returns String formatada (ex: "Fev/2025")+ */+ formatMonthYear(month: number, year: number): string {+ return dayjs(new Date(year, month - 1, 1)).format('MMM/YYYY');+ },++ formatAge(birthDate: string): string {+ return dayjs().from(dayjs(birthDate), true);+ },++ /**+ * Formata tempo decorrido em segundos para formato de stopwatch HH:MM:SS+ * @param seconds - Tempo decorrido em segundos+ * @returns String formatada (ex: "02:30:45", "00:05:12")+ */+ formatStopwatch(seconds: number): string {+ return dayjs.duration(seconds, 'seconds').format('HH:mm:ss');+ },++ /**+ * Calcula tempo decorrido entre uma data UTC e o momento atual no timezone do usuário+ * @param startDateTime - Data/hora de início em UTC (ISO string)+ * @returns Tempo decorrido em segundos+ */+ getElapsedSeconds(startDateTime: string): number {+ const startTime = dayjs.utc(startDateTime).tz(getUserTimezone());+ const now = dayjs().tz(getUserTimezone());+ return now.diff(startTime, 'seconds');+ },++ /**+ * Formata a data de build da aplicação no timezone do usuário+ * @param date - Data/hora em ISO string (UTC)+ * @returns String formatada (ex: "31/12/2025 14:25")+ */+ formatBuildDate(date: string): string {+ return dayjs.utc(date).tz(getUserTimezone()).format('DD/MM/YYYY HH:mm');+ },++ /**+ * Obtém o timezone do usuário+ * Tenta pegar do Inertia page props primeiro, senão usa o timezone do browser+ * @returns Timezone do usuário+ */+ getUserTimezone,++ /**+ * Formata uma data para o formato YYYY-MM-DD (usado em DatePicker)+ * Evita problemas de timezone ao não criar objeto Date+ * @param date - Data no formato YYYY-MM-DD ou ISO string+ * @returns Data no formato YYYY-MM-DD+ */+ formatDateForInput(date: string): string {+ return dayjs(date).format('YYYY-MM-DD');+ },++ /**+ * Formata minutos para formato legível+ * @param minutes - Número de minutos+ * @returns String formatada (ex: "1h", "1h 41min", "30min")+ */+ formatMinutes(minutes: number): string {+ const duration = dayjs.duration(minutes, 'minutes');+ const h = duration.hours();+ const m = duration.minutes();++ if (h > 0 && m > 0) {+ return `${h}h ${m}min`;+ }+ if (h > 0) {+ return `${h}h`;+ }+ return `${m}min`;+ },+};diff --git a/resources/js/dayjs.ts b/resources/js/dayjs.tsnew file mode 100644index 000000000..6f3ef6527--- /dev/null+++ b/resources/js/dayjs.ts@@ -0,0 +1,35 @@+import dayjs from 'dayjs';+import advancedFormat from 'dayjs/plugin/advancedFormat';+import calendar from 'dayjs/plugin/calendar';+import customParseFormat from 'dayjs/plugin/customParseFormat';+import duration from 'dayjs/plugin/duration';+import isBetween from 'dayjs/plugin/isBetween';+import relativeTime from 'dayjs/plugin/relativeTime';+import timezone from 'dayjs/plugin/timezone';+import updateLocale from 'dayjs/plugin/updateLocale';+import utc from 'dayjs/plugin/utc';+import weekday from 'dayjs/plugin/weekday';++// Import locales+import 'dayjs/locale/en';++// Extend dayjs with plugins+dayjs.extend(utc);+dayjs.extend(timezone);+dayjs.extend(calendar);+dayjs.extend(customParseFormat);+dayjs.extend(relativeTime);+dayjs.extend(duration);+dayjs.extend(updateLocale);+dayjs.extend(advancedFormat);+dayjs.extend(weekday);+dayjs.extend(isBetween);++dayjs.locale('en');++// Set Monday as first day of week (to match Carbon/Laravel)+dayjs.updateLocale('en', {+ weekStart: 1,+});++export default dayjs;diff --git a/resources/js/debounce.ts b/resources/js/debounce.tsnew file mode 100644index 000000000..7fff555be--- /dev/null+++ b/resources/js/debounce.ts@@ -0,0 +1,24 @@+export default function debounce(+ callback: (...args: any[]) => void,+ wait = 1000,+) {+ let timeoutId: NodeJS.Timeout | null = null;++ const debouncedFn = (...args: any[]) => {+ if (timeoutId) {+ clearTimeout(timeoutId);+ }+ timeoutId = setTimeout(() => {+ callback(...args);+ }, wait);+ };++ debouncedFn.cancel = () => {+ if (timeoutId) {+ clearTimeout(timeoutId);+ timeoutId = null;+ }+ };++ return debouncedFn;+}diff --git a/resources/js/echo.ts b/resources/js/echo.tsnew file mode 100644index 000000000..425da4193--- /dev/null+++ b/resources/js/echo.ts@@ -0,0 +1,14 @@+import Echo from 'laravel-echo';+import Pusher from 'pusher-js';++window.Pusher = Pusher;++window.Echo = new Echo({+ broadcaster: 'reverb',+ key: import.meta.env.VITE_REVERB_APP_KEY,+ wsHost: import.meta.env.VITE_REVERB_HOST,+ wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,+ wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,+ forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',+ enabledTransports: ['ws', 'wss'],+});diff --git a/resources/js/layouts/AppLayout.vue b/resources/js/layouts/AppLayout.vueindex 77c93964b..f13a51f93 100644--- a/resources/js/layouts/AppLayout.vue+++ b/resources/js/layouts/AppLayout.vue@@ -1,5 +1,5 @@<script setup lang="ts">-import AppLayout from '@/layouts/app/AppSidebarLayout.vue';+import AppLayout from '@/layouts/app/AppHeaderLayout.vue';import type { BreadcrumbItemType } from '@/types';interface Props {diff --git a/resources/js/layouts/GuestLayout.vue b/resources/js/layouts/GuestLayout.vuenew file mode 100644index 000000000..f9514212f--- /dev/null+++ b/resources/js/layouts/GuestLayout.vue@@ -0,0 +1,61 @@+<script setup lang="ts">+import { Link } from '@inertiajs/vue3';+import { home } from '@/routes';++defineProps<{+ title?: string;+}>();+</script>++<template>+ <div class="min-h-svh bg-background">+ <!-- Header -->+ <header class="border-b">+ <div class="mx-auto max-w-5xl px-6 py-4 flex items-center justify-between">+ <Link :href="home()" class="flex items-center gap-2">+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-7 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-7 w-auto" />+ </Link>+ <nav class="flex items-center gap-4">+ <Link+ :href="home()"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors"+ >+ Home+ </Link>+ </nav>+ </div>+ </header>++ <!-- Main Content -->+ <main class="mx-auto max-w-5xl px-6 py-12">+ <h1 v-if="title" class="text-3xl font-bold mb-8">{{ title }}</h1>+ <slot />+ </main>++ <!-- Footer -->+ <footer class="border-t mt-auto">+ <div class="mx-auto max-w-5xl px-6 py-8">+ <div class="flex flex-col md:flex-row items-center justify-between gap-4">+ <p class="text-sm text-muted-foreground">+ © {{ new Date().getFullYear() }} TryPost. All rights reserved.+ </p>+ <nav class="flex items-center gap-6">+ <Link+ href="/privacy"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors"+ >+ Privacy Policy+ </Link>+ <Link+ href="/terms"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors"+ >+ Terms of Service+ </Link>+ </nav>+ </div>+ </div>+ </footer>+ </div>+</template>diff --git a/resources/js/layouts/auth/AuthCardLayout.vue b/resources/js/layouts/auth/AuthCardLayout.vueindex 498146f36..14a3f3d09 100644--- a/resources/js/layouts/auth/AuthCardLayout.vue+++ b/resources/js/layouts/auth/AuthCardLayout.vue@@ -1,7 +1,6 @@<script setup lang="ts">import { Link } from '@inertiajs/vue3';-import AppLogoIcon from '@/components/AppLogoIcon.vue';import {Card,CardContent,@@ -18,18 +17,12 @@ defineProps<{</script><template>- <div- class="flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10"- >+ <div class="flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10"><div class="flex w-full max-w-md flex-col gap-6">- <Link- :href="home()"- class="flex items-center gap-2 self-center font-medium"- >+ <Link :href="home()" class="flex items-center gap-2 self-center font-medium"><div class="flex h-9 w-9 items-center justify-center">- <AppLogoIcon- class="size-9 fill-current text-black dark:text-white"- />+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-8 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-8 w-auto" /></div></Link>@@ -48,4 +41,4 @@ defineProps<{</div></div></div>-</template>+</template>\ No newline at end of filediff --git a/resources/js/layouts/auth/AuthSimpleLayout.vue b/resources/js/layouts/auth/AuthSimpleLayout.vueindex 3addc6062..c9490c3d1 100644--- a/resources/js/layouts/auth/AuthSimpleLayout.vue+++ b/resources/js/layouts/auth/AuthSimpleLayout.vue@@ -1,7 +1,5 @@<script setup lang="ts">import { Link } from '@inertiajs/vue3';--import AppLogoIcon from '@/components/AppLogoIcon.vue';import { home } from '@/routes';defineProps<{@@ -11,23 +9,13 @@ defineProps<{</script><template>- <div- class="flex min-h-svh flex-col items-center justify-center gap-6 bg-background p-6 md:p-10"- >+ <div class="flex min-h-svh flex-col items-center justify-center gap-6 bg-background p-6 md:p-10"><div class="w-full max-w-sm"><div class="flex flex-col gap-8"><div class="flex flex-col items-center gap-4">- <Link- :href="home()"- class="flex flex-col items-center gap-2 font-medium"- >- <div- class="mb-1 flex h-9 w-9 items-center justify-center rounded-md"- >- <AppLogoIcon- class="size-9 fill-current text-[var(--foreground)] dark:text-white"- />- </div>+ <Link :href="home()" class="flex flex-col items-center gap-2 font-medium">+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-8 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-8 w-auto" /><span class="sr-only">{{ title }}</span></Link><div class="space-y-2 text-center">@@ -41,4 +29,4 @@ defineProps<{</div></div></div>-</template>+</template>\ No newline at end of filediff --git a/resources/js/layouts/auth/AuthSplitLayout.vue b/resources/js/layouts/auth/AuthSplitLayout.vuedeleted file mode 100644index e61786256..000000000--- a/resources/js/layouts/auth/AuthSplitLayout.vue+++ /dev/null@@ -1,48 +0,0 @@-<script setup lang="ts">-import { Link, usePage } from '@inertiajs/vue3';--import AppLogoIcon from '@/components/AppLogoIcon.vue';-import { home } from '@/routes';--const page = usePage();-const name = page.props.name;--defineProps<{- title?: string;- description?: string;-}>();-</script>--<template>- <div- class="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0"- >- <div- class="relative hidden h-full flex-col bg-muted p-10 text-white lg:flex dark:border-r"- >- <div class="absolute inset-0 bg-zinc-900" />- <Link- :href="home()"- class="relative z-20 flex items-center text-lg font-medium"- >- <AppLogoIcon class="mr-2 size-8 fill-current text-white" />- {{ name }}- </Link>- </div>- <div class="lg:p-8">- <div- class="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]"- >- <div class="flex flex-col space-y-2 text-center">- <h1 class="text-xl font-medium tracking-tight" v-if="title">- {{ title }}- </h1>- <p class="text-sm text-muted-foreground" v-if="description">- {{ description }}- </p>- </div>- <slot />- </div>- </div>- </div>-</template>diff --git a/resources/js/pages/Welcome.vue b/resources/js/pages/Welcome.vueindex c2736a81c..3e4be86d8 100644--- a/resources/js/pages/Welcome.vue+++ b/resources/js/pages/Welcome.vue@@ -1,7 +1,9 @@<script setup lang="ts">import { Head, Link } from '@inertiajs/vue3';+import { CalendarDays, Clock, Share2, Sparkles, CheckCircle } from 'lucide-vue-next';-import { dashboard, login, register } from '@/routes';+import { login, register } from '@/routes';+import { Button } from '@/components/ui/button';withDefaults(defineProps<{@@ -11,833 +13,217 @@ withDefaults(canRegister: true,},);++const features = [+ {+ icon: CalendarDays,+ title: 'Visual Calendar',+ description: 'Plan and visualize your content with an intuitive calendar interface.',+ },+ {+ icon: Clock,+ title: 'Smart Scheduling',+ description: 'Schedule posts for the perfect time across all your social platforms.',+ },+ {+ icon: Share2,+ title: 'Multi-Platform',+ description: 'Publish to LinkedIn, X, TikTok, YouTube, Facebook, Instagram, and Threads.',+ },+ {+ icon: Sparkles,+ title: 'Workspace Collaboration',+ description: 'Invite team members and collaborate on your social media strategy.',+ },+];++const platforms = [+ { name: 'LinkedIn', logo: '/images/accounts/linkedin.png' },+ { name: 'X', logo: '/images/accounts/x.png' },+ { name: 'TikTok', logo: '/images/accounts/tiktok.png' },+ { name: 'YouTube', logo: '/images/accounts/youtube.png' },+ { name: 'Facebook', logo: '/images/accounts/facebook.png' },+ { name: 'Instagram', logo: '/images/accounts/instagram.png' },+ { name: 'Threads', logo: '/images/accounts/threads.png' },+];</script><template>- <Head title="Welcome">- <link rel="preconnect" href="https://rsms.me/" />- <link rel="stylesheet" href="https://rsms.me/inter/inter.css" />+ <Head title="Social Media Scheduling Made Simple">+ <meta name="description" content="Schedule and publish your social media content to multiple platforms with TryPost. Support for LinkedIn, X, TikTok, YouTube, Facebook, Instagram, and Threads." /></Head>- <div- class="flex min-h-screen flex-col items-center bg-[#FDFDFC] p-6 text-[#1b1b18] lg:justify-center lg:p-8 dark:bg-[#0a0a0a]"- >- <header- class="mb-6 w-full max-w-[335px] text-sm not-has-[nav]:hidden lg:max-w-4xl"- >- <nav class="flex items-center justify-end gap-4">- <Link- v-if="$page.props.auth.user"- :href="dashboard()"- class="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"- >- Dashboard- </Link>- <template v-else>- <Link- :href="login()"- class="inline-block rounded-sm border border-transparent px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#19140035] dark:text-[#EDEDEC] dark:hover:border-[#3E3E3A]"- >- Log in- </Link>++ <div class="min-h-svh bg-background">+ <!-- Header -->+ <header class="border-b">+ <div class="mx-auto max-w-6xl px-6 py-4 flex items-center justify-between">+ <div class="flex items-center gap-2">+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-7 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-7 w-auto" />+ </div>+ <nav class="flex items-center gap-3"><Link- v-if="canRegister"- :href="register()"- class="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"+ v-if="$page.props.auth.user"+ href="/workspaces"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors">- Register+ Dashboard</Link>- </template>- </nav>+ <template v-else>+ <Link :href="login()">+ <Button variant="ghost" size="sm">Log in</Button>+ </Link>+ <Link v-if="canRegister" :href="register()">+ <Button size="sm">Get Started</Button>+ </Link>+ </template>+ </nav>+ </div></header>- <div- class="flex w-full items-center justify-center opacity-100 transition-opacity duration-750 lg:grow starting:opacity-0"- >- <main- class="flex w-full max-w-[335px] flex-col-reverse overflow-hidden rounded-lg lg:max-w-4xl lg:flex-row"- >- <div- class="flex-1 rounded-br-lg rounded-bl-lg bg-white p-6 pb-12 text-[13px] leading-[20px] shadow-[inset_0px_0px_0px_1px_rgba(26,26,0,0.16)] lg:rounded-tl-lg lg:rounded-br-none lg:p-20 dark:bg-[#161615] dark:text-[#EDEDEC] dark:shadow-[inset_0px_0px_0px_1px_#fffaed2d]"- >- <h1 class="mb-1 font-medium">Let's get started</h1>- <p class="mb-2 text-[#706f6c] dark:text-[#A1A09A]">- Laravel has an incredibly rich ecosystem. <br />We- suggest starting with the following.- </p>- <ul class="mb-4 flex flex-col lg:mb-6">- <li- class="relative flex items-center gap-4 py-2 before:absolute before:top-1/2 before:bottom-0 before:left-[0.4rem] before:border-l before:border-[#e3e3e0] dark:before:border-[#3E3E3A]"- >- <span- class="relative bg-white py-1 dark:bg-[#161615]"- >- <span- class="flex h-3.5 w-3.5 items-center justify-center rounded-full border border-[#e3e3e0] bg-[#FDFDFC] shadow-[0px_0px_1px_0px_rgba(0,0,0,0.03),0px_1px_2px_0px_rgba(0,0,0,0.06)] dark:border-[#3E3E3A] dark:bg-[#161615]"- >- <span- class="h-1.5 w-1.5 rounded-full bg-[#dbdbd7] dark:bg-[#3E3E3A]"- />- </span>- </span>- <span>- Read the- <a- href="https://laravel.com/docs"- target="_blank"- class="ml-1 inline-flex items-center space-x-1 font-medium text-[#f53003] underline underline-offset-4 dark:text-[#FF4433]"- >- <span>Documentation</span>- <svg- width="10"- height="11"- viewBox="0 0 10 11"- fill="none"- xmlns="http://www.w3.org/2000/svg"- class="h-2.5 w-2.5"- >- <path- d="M7.70833 6.95834V2.79167H3.54167M2.5 8L7.5 3.00001"- stroke="currentColor"- stroke-linecap="square"- />- </svg>- </a>- </span>- </li>- <li- class="relative flex items-center gap-4 py-2 before:absolute before:top-0 before:bottom-1/2 before:left-[0.4rem] before:border-l before:border-[#e3e3e0] dark:before:border-[#3E3E3A]"- >- <span- class="relative bg-white py-1 dark:bg-[#161615]"- >- <span- class="flex h-3.5 w-3.5 items-center justify-center rounded-full border border-[#e3e3e0] bg-[#FDFDFC] shadow-[0px_0px_1px_0px_rgba(0,0,0,0.03),0px_1px_2px_0px_rgba(0,0,0,0.06)] dark:border-[#3E3E3A] dark:bg-[#161615]"- >- <span- class="h-1.5 w-1.5 rounded-full bg-[#dbdbd7] dark:bg-[#3E3E3A]"- />- </span>- </span>- <span>- Watch video tutorials at- <a- href="https://laracasts.com"- target="_blank"- class="ml-1 inline-flex items-center space-x-1 font-medium text-[#f53003] underline underline-offset-4 dark:text-[#FF4433]"- >- <span>Laracasts</span>- <svg- width="10"- height="11"- viewBox="0 0 10 11"- fill="none"- xmlns="http://www.w3.org/2000/svg"- class="h-2.5 w-2.5"- >- <path- d="M7.70833 6.95834V2.79167H3.54167M2.5 8L7.5 3.00001"- stroke="currentColor"- stroke-linecap="square"- />- </svg>- </a>- </span>- </li>- </ul>- <ul class="flex gap-3 text-sm leading-normal">- <li>- <a- href="https://cloud.laravel.com"- target="_blank"- class="inline-block rounded-sm border border-black bg-[#1b1b18] px-5 py-1.5 text-sm leading-normal text-white hover:border-black hover:bg-black dark:border-[#eeeeec] dark:bg-[#eeeeec] dark:text-[#1C1C1A] dark:hover:border-white dark:hover:bg-white"- >- Deploy now- </a>- </li>- </ul>++ <!-- Hero Section -->+ <section class="py-20 md:py-32">+ <div class="mx-auto max-w-6xl px-6 text-center">+ <h1 class="text-4xl md:text-6xl font-bold tracking-tight mb-6">+ Social Media Scheduling<br />+ <span class="text-primary">Made Simple</span>+ </h1>+ <p class="text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto mb-8">+ Plan, schedule, and publish your content across all major social platforms from one place.+ Save time and grow your audience.+ </p>+ <div class="flex items-center justify-center gap-4">+ <Link v-if="canRegister" :href="register()">+ <Button size="lg">Start Free Trial</Button>+ </Link>+ <Link :href="login()">+ <Button variant="outline" size="lg">Log in</Button>+ </Link></div>- <div- class="relative -mb-px aspect-335/376 w-full shrink-0 overflow-hidden rounded-t-lg bg-[#fff2f2] lg:mb-0 lg:-ml-px lg:aspect-auto lg:w-[438px] lg:rounded-t-none lg:rounded-r-lg dark:bg-[#1D0002]"- >- <svg- class="w-full max-w-none translate-y-0 text-[#F53003] opacity-100 transition-all duration-750 dark:text-[#F61500] starting:translate-y-6 starting:opacity-0"- viewBox="0 0 438 104"- fill="none"- xmlns="http://www.w3.org/2000/svg"- >- <path- d="M17.2036 -3H0V102.197H49.5189V86.7187H17.2036V-3Z"- fill="currentColor"- />- <path- d="M110.256 41.6337C108.061 38.1275 104.945 35.3731 100.905 33.3681C96.8667 31.3647 92.8016 30.3618 88.7131 30.3618C83.4247 30.3618 78.5885 31.3389 74.201 33.2923C69.8111 35.2456 66.0474 37.928 62.9059 41.3333C59.7643 44.7401 57.3198 48.6726 55.5754 53.1293C53.8287 57.589 52.9572 62.274 52.9572 67.1813C52.9572 72.1925 53.8287 76.8995 55.5754 81.3069C57.3191 85.7173 59.7636 89.6241 62.9059 93.0293C66.0474 96.4361 69.8119 99.1155 74.201 101.069C78.5885 103.022 83.4247 103.999 88.7131 103.999C92.8016 103.999 96.8667 102.997 100.905 100.994C104.945 98.9911 108.061 96.2359 110.256 92.7282V102.195H126.563V32.1642H110.256V41.6337ZM108.76 75.7472C107.762 78.4531 106.366 80.8078 104.572 82.8112C102.776 84.8161 100.606 86.4183 98.0637 87.6206C95.5202 88.823 92.7004 89.4238 89.6103 89.4238C86.5178 89.4238 83.7252 88.823 81.2324 87.6206C78.7388 86.4183 76.5949 84.8161 74.7998 82.8112C73.004 80.8078 71.6319 78.4531 70.6856 75.7472C69.7356 73.0421 69.2644 70.1868 69.2644 67.1821C69.2644 64.1758 69.7356 61.3205 70.6856 58.6154C71.6319 55.9102 73.004 53.5571 74.7998 51.5522C76.5949 49.5495 78.738 47.9451 81.2324 46.7427C83.7252 45.5404 86.5178 44.9396 89.6103 44.9396C92.7012 44.9396 95.5202 45.5404 98.0637 46.7427C100.606 47.9451 102.776 49.5487 104.572 51.5522C106.367 53.5571 107.762 55.9102 108.76 58.6154C109.756 61.3205 110.256 64.1758 110.256 67.1821C110.256 70.1868 109.756 73.0421 108.76 75.7472Z"- fill="currentColor"- />- <path- d="M242.805 41.6337C240.611 38.1275 237.494 35.3731 233.455 33.3681C229.416 31.3647 225.351 30.3618 221.262 30.3618C215.974 30.3618 211.138 31.3389 206.75 33.2923C202.36 35.2456 198.597 37.928 195.455 41.3333C192.314 44.7401 189.869 48.6726 188.125 53.1293C186.378 57.589 185.507 62.274 185.507 67.1813C185.507 72.1925 186.378 76.8995 188.125 81.3069C189.868 85.7173 192.313 89.6241 195.455 93.0293C198.597 96.4361 202.361 99.1155 206.75 101.069C211.138 103.022 215.974 103.999 221.262 103.999C225.351 103.999 229.416 102.997 233.455 100.994C237.494 98.9911 240.611 96.2359 242.805 92.7282V102.195H259.112V32.1642H242.805V41.6337ZM241.31 75.7472C240.312 78.4531 238.916 80.8078 237.122 82.8112C235.326 84.8161 233.156 86.4183 230.614 87.6206C228.07 88.823 225.251 89.4238 222.16 89.4238C219.068 89.4238 216.275 88.823 213.782 87.6206C211.289 86.4183 209.145 84.8161 207.35 82.8112C205.554 80.8078 204.182 78.4531 203.236 75.7472C202.286 73.0421 201.814 70.1868 201.814 67.1821C201.814 64.1758 202.286 61.3205 203.236 58.6154C204.182 55.9102 205.554 53.5571 207.35 51.5522C209.145 49.5495 211.288 47.9451 213.782 46.7427C216.275 45.5404 219.068 44.9396 222.16 44.9396C225.251 44.9396 228.07 45.5404 230.614 46.7427C233.156 47.9451 235.326 49.5487 237.122 51.5522C238.917 53.5571 240.312 55.9102 241.31 58.6154C242.306 61.3205 242.806 64.1758 242.806 67.1821C242.805 70.1868 242.305 73.0421 241.31 75.7472Z"- fill="currentColor"- />- <path- d="M438 -3H421.694V102.197H438V-3Z"- fill="currentColor"- />- <path- d="M139.43 102.197H155.735V48.2834H183.712V32.1665H139.43V102.197Z"- fill="currentColor"- />- <path- d="M324.49 32.1665L303.995 85.794L283.498 32.1665H266.983L293.748 102.197H314.242L341.006 32.1665H324.49Z"- fill="currentColor"- />- <path- d="M376.571 30.3656C356.603 30.3656 340.797 46.8497 340.797 67.1828C340.797 89.6597 356.094 104 378.661 104C391.29 104 399.354 99.1488 409.206 88.5848L398.189 80.0226C398.183 80.031 389.874 90.9895 377.468 90.9895C363.048 90.9895 356.977 79.3111 356.977 73.269H411.075C413.917 50.1328 398.775 30.3656 376.571 30.3656ZM357.02 61.0967C357.145 59.7487 359.023 43.3761 376.442 43.3761C393.861 43.3761 395.978 59.7464 396.099 61.0967H357.02Z"- fill="currentColor"- />- </svg>- <svg- class="relative -mt-[4.9rem] -ml-8 w-[448px] max-w-none lg:-mt-[6.6rem] lg:ml-0 dark:hidden"- viewBox="0 0 440 376"- fill="none"- xmlns="http://www.w3.org/2000/svg"+ </div>+ </section>++ <!-- Platforms Section -->+ <section class="py-16 bg-muted/30">+ <div class="mx-auto max-w-6xl px-6">+ <p class="text-center text-sm text-muted-foreground mb-8">+ Publish to all your favorite platforms+ </p>+ <div class="flex items-center justify-center gap-8 flex-wrap">+ <div+ v-for="platform in platforms"+ :key="platform.name"+ class="flex items-center gap-2 text-muted-foreground">- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M188.263 355.73L188.595 355.73C195.441 348.845 205.766 339.761 219.569 328.477C232.93 317.193 242.978 308.205 249.714 301.511C256.34 294.626 260.867 287.358 263.296 279.708C265.725 272.058 264.565 264.121 259.816 255.896C254.516 246.716 247.062 239.352 237.454 233.805C227.957 228.067 217.908 225.198 207.307 225.198C196.927 225.197 190.136 227.97 186.934 233.516C183.621 238.872 184.726 246.331 190.247 255.894L125.647 255.891C116.371 239.825 112.395 225.481 113.72 212.858C115.265 200.235 121.559 190.481 132.602 183.596C143.754 176.52 158.607 172.982 177.159 172.983C196.594 172.984 215.863 176.523 234.968 183.6C253.961 190.486 271.299 200.241 286.98 212.864C302.661 225.488 315.14 239.833 324.416 255.899C333.03 270.817 336.841 283.918 335.847 295.203C335.075 306.487 331.376 316.336 324.75 324.751C318.346 333.167 308.408 343.494 294.936 355.734L377.094 355.737L405.917 405.656L217.087 405.649L188.263 355.73Z"- fill="black"- />- <path- d="M9.11884 226.339L-13.7396 226.338L-42.7286 176.132L43.0733 176.135L175.595 405.649L112.651 405.647L9.11884 226.339Z"- fill="black"- />- <path- d="M188.263 355.73L188.595 355.73C195.441 348.845 205.766 339.761 219.569 328.477C232.93 317.193 242.978 308.205 249.714 301.511C256.34 294.626 260.867 287.358 263.296 279.708C265.725 272.058 264.565 264.121 259.816 255.896C254.516 246.716 247.062 239.352 237.454 233.805C227.957 228.067 217.908 225.198 207.307 225.198C196.927 225.197 190.136 227.97 186.934 233.516C183.621 238.872 184.726 246.331 190.247 255.894L125.647 255.891C116.371 239.825 112.395 225.481 113.72 212.858C115.265 200.235 121.559 190.481 132.602 183.596C143.754 176.52 158.607 172.982 177.159 172.983C196.594 172.984 215.863 176.523 234.968 183.6C253.961 190.486 271.299 200.241 286.98 212.864C302.661 225.488 315.14 239.833 324.416 255.899C333.03 270.817 336.841 283.918 335.847 295.203C335.075 306.487 331.376 316.336 324.75 324.751C318.346 333.167 308.408 343.494 294.936 355.734L377.094 355.737L405.917 405.656L217.087 405.649L188.263 355.73Z"- stroke="#1B1B18"- stroke-width="1"- />- <path- d="M9.11884 226.339L-13.7396 226.338L-42.7286 176.132L43.0733 176.135L175.595 405.649L112.651 405.647L9.11884 226.339Z"- stroke="#1B1B18"- stroke-width="1"- />- <path- d="M204.592 327.449L204.923 327.449C211.769 320.564 222.094 311.479 235.897 300.196C249.258 288.912 259.306 279.923 266.042 273.23C272.668 266.345 277.195 259.077 279.624 251.427C282.053 243.777 280.893 235.839 276.145 227.615C270.844 218.435 263.39 211.071 253.782 205.524C244.285 199.786 234.236 196.917 223.635 196.916C213.255 196.916 206.464 199.689 203.262 205.235C199.949 210.59 201.054 218.049 206.575 227.612L141.975 227.61C132.699 211.544 128.723 197.2 130.048 184.577C131.593 171.954 137.887 162.2 148.93 155.315C160.083 148.239 174.935 144.701 193.487 144.702C212.922 144.703 232.192 148.242 251.296 155.319C270.289 162.205 287.627 171.96 303.308 184.583C318.989 197.207 331.468 211.552 340.745 227.618C349.358 242.536 353.169 255.637 352.175 266.921C351.403 278.205 347.704 288.055 341.078 296.47C334.674 304.885 324.736 315.213 311.264 327.453L393.422 327.456L422.246 377.375L233.415 377.368L204.592 327.449Z"- fill="#F8B803"- />- <path- d="M25.447 198.058L2.58852 198.057L-26.4005 147.851L59.4015 147.854L191.923 377.368L128.979 377.365L25.447 198.058Z"- fill="#F8B803"- />- <path- d="M204.592 327.449L204.923 327.449C211.769 320.564 222.094 311.479 235.897 300.196C249.258 288.912 259.306 279.923 266.042 273.23C272.668 266.345 277.195 259.077 279.624 251.427C282.053 243.777 280.893 235.839 276.145 227.615C270.844 218.435 263.39 211.071 253.782 205.524C244.285 199.786 234.236 196.917 223.635 196.916C213.255 196.916 206.464 199.689 203.262 205.235C199.949 210.59 201.054 218.049 206.575 227.612L141.975 227.61C132.699 211.544 128.723 197.2 130.048 184.577C131.593 171.954 137.887 162.2 148.93 155.315C160.083 148.239 174.935 144.701 193.487 144.702C212.922 144.703 232.192 148.242 251.296 155.319C270.289 162.205 287.627 171.96 303.308 184.583C318.989 197.207 331.468 211.552 340.745 227.618C349.358 242.536 353.169 255.637 352.175 266.921C351.403 278.205 347.704 288.055 341.078 296.47C334.674 304.885 324.736 315.213 311.264 327.453L393.422 327.456L422.246 377.375L233.415 377.368L204.592 327.449Z"- stroke="#1B1B18"- stroke-width="1"- />- <path- d="M25.447 198.058L2.58852 198.057L-26.4005 147.851L59.4015 147.854L191.923 377.368L128.979 377.365L25.447 198.058Z"- stroke="#1B1B18"- stroke-width="1"- />- </g>- <g- :style="{ mixBlendMode: 'hard-light' }"- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M217.342 305.363L217.673 305.363C224.519 298.478 234.844 289.393 248.647 278.11C262.008 266.826 272.056 257.837 278.792 251.144C285.418 244.259 289.945 236.991 292.374 229.341C294.803 221.691 293.643 213.753 288.895 205.529C283.594 196.349 276.14 188.985 266.532 183.438C257.035 177.7 246.986 174.831 236.385 174.83C226.005 174.83 219.214 177.603 216.012 183.149C212.699 188.504 213.804 195.963 219.325 205.527L154.725 205.524C145.449 189.458 141.473 175.114 142.798 162.491C144.343 149.868 150.637 140.114 161.68 133.229C172.833 126.153 187.685 122.615 206.237 122.616C225.672 122.617 244.942 126.156 264.046 133.233C283.039 140.119 300.377 149.874 316.058 162.497C331.739 175.121 344.218 189.466 353.495 205.532C362.108 220.45 365.919 233.551 364.925 244.835C364.153 256.12 360.454 265.969 353.828 274.384C347.424 282.799 337.486 293.127 324.014 305.367L406.172 305.37L434.996 355.289L246.165 355.282L217.342 305.363Z"- fill="#F0ACB8"- />- <path- d="M38.197 175.972L15.3385 175.971L-13.6505 125.765L72.1515 125.768L204.673 355.282L141.729 355.279L38.197 175.972Z"- fill="#F0ACB8"- />- <path- d="M217.342 305.363L217.673 305.363C224.519 298.478 234.844 289.393 248.647 278.11C262.008 266.826 272.056 257.837 278.792 251.144C285.418 244.259 289.945 236.991 292.374 229.341C294.803 221.691 293.643 213.753 288.895 205.529C283.594 196.349 276.14 188.985 266.532 183.438C257.035 177.7 246.986 174.831 236.385 174.83C226.005 174.83 219.214 177.603 216.012 183.149C212.699 188.504 213.804 195.963 219.325 205.527L154.725 205.524C145.449 189.458 141.473 175.114 142.798 162.491C144.343 149.868 150.637 140.114 161.68 133.229C172.833 126.153 187.685 122.615 206.237 122.616C225.672 122.617 244.942 126.156 264.046 133.233C283.039 140.119 300.377 149.874 316.058 162.497C331.739 175.121 344.218 189.466 353.495 205.532C362.108 220.45 365.919 233.551 364.925 244.835C364.153 256.12 360.454 265.969 353.828 274.384C347.424 282.799 337.486 293.127 324.014 305.367L406.172 305.37L434.996 355.289L246.165 355.282L217.342 305.363Z"- stroke="#1B1B18"- stroke-width="1"- />- <path- d="M38.197 175.972L15.3385 175.971L-13.6505 125.765L72.1515 125.768L204.673 355.282L141.729 355.279L38.197 175.972Z"- stroke="#1B1B18"- stroke-width="1"- />- </g>- <g- :style="`mixBlendMode: 'plus-darker'`"- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M230.951 281.792L231.282 281.793C238.128 274.907 248.453 265.823 262.256 254.539C275.617 243.256 285.666 234.267 292.402 227.573C299.027 220.688 303.554 213.421 305.983 205.771C308.412 198.12 307.253 190.183 302.504 181.959C297.203 172.778 289.749 165.415 280.142 159.868C270.645 154.13 260.596 151.26 249.995 151.26C239.615 151.26 232.823 154.033 229.621 159.579C226.309 164.934 227.413 172.393 232.935 181.956L168.335 181.954C159.058 165.888 155.082 151.543 156.407 138.92C157.953 126.298 164.247 116.544 175.289 109.659C186.442 102.583 201.294 99.045 219.846 99.0457C239.281 99.0464 258.551 102.585 277.655 109.663C296.649 116.549 313.986 126.303 329.667 138.927C345.349 151.551 357.827 165.895 367.104 181.961C375.718 196.88 379.528 209.981 378.535 221.265C377.762 232.549 374.063 242.399 367.438 250.814C361.033 259.229 351.095 269.557 337.624 281.796L419.782 281.8L448.605 331.719L259.774 331.712L230.951 281.792Z"- fill="#F3BEC7"- />- <path- d="M51.8063 152.402L28.9479 152.401L-0.0411453 102.195L85.7608 102.198L218.282 331.711L155.339 331.709L51.8063 152.402Z"- fill="#F3BEC7"- />- <path- d="M230.951 281.792L231.282 281.793C238.128 274.907 248.453 265.823 262.256 254.539C275.617 243.256 285.666 234.267 292.402 227.573C299.027 220.688 303.554 213.421 305.983 205.771C308.412 198.12 307.253 190.183 302.504 181.959C297.203 172.778 289.749 165.415 280.142 159.868C270.645 154.13 260.596 151.26 249.995 151.26C239.615 151.26 232.823 154.033 229.621 159.579C226.309 164.934 227.413 172.393 232.935 181.956L168.335 181.954C159.058 165.888 155.082 151.543 156.407 138.92C157.953 126.298 164.247 116.544 175.289 109.659C186.442 102.583 201.294 99.045 219.846 99.0457C239.281 99.0464 258.551 102.585 277.655 109.663C296.649 116.549 313.986 126.303 329.667 138.927C345.349 151.551 357.827 165.895 367.104 181.961C375.718 196.88 379.528 209.981 378.535 221.265C377.762 232.549 374.063 242.399 367.438 250.814C361.033 259.229 351.095 269.557 337.624 281.796L419.782 281.8L448.605 331.719L259.774 331.712L230.951 281.792Z"- stroke="#1B1B18"- stroke-width="1"- />- <path- d="M51.8063 152.402L28.9479 152.401L-0.0411453 102.195L85.7608 102.198L218.282 331.711L155.339 331.709L51.8063 152.402Z"- stroke="#1B1B18"- stroke-width="1"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M188.467 355.363L188.798 355.363C195.644 348.478 205.969 339.393 219.772 328.11C233.133 316.826 243.181 307.837 249.917 301.144C253.696 297.217 256.792 293.166 259.205 288.991C261.024 285.845 262.455 282.628 263.499 279.341C265.928 271.691 264.768 263.753 260.02 255.529C254.719 246.349 247.265 238.985 237.657 233.438C228.16 227.7 218.111 224.831 207.51 224.83C197.13 224.83 190.339 227.603 187.137 233.149C183.824 238.504 184.929 245.963 190.45 255.527L125.851 255.524C116.574 239.458 112.598 225.114 113.923 212.491C114.615 206.836 116.261 201.756 118.859 197.253C122.061 191.704 126.709 187.03 132.805 183.229C143.958 176.153 158.81 172.615 177.362 172.616C196.797 172.617 216.067 176.156 235.171 183.233C254.164 190.119 271.502 199.874 287.183 212.497C302.864 225.121 315.343 239.466 324.62 255.532C333.233 270.45 337.044 283.551 336.05 294.835C335.46 303.459 333.16 311.245 329.151 318.194C327.915 320.337 326.515 322.4 324.953 324.384C318.549 332.799 308.611 343.127 295.139 355.367L377.297 355.37L406.121 405.289L217.29 405.282L188.467 355.363Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M9.32197 225.972L-13.5365 225.971L-42.5255 175.765L43.2765 175.768L175.798 405.282L112.854 405.279L9.32197 225.972Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M345.247 111.915C329.566 99.2919 312.229 89.5371 293.235 82.6512L235.167 183.228C254.161 190.114 271.498 199.869 287.179 212.492L345.247 111.915Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M382.686 154.964C373.41 138.898 360.931 124.553 345.25 111.93L287.182 212.506C302.863 225.13 315.342 239.475 324.618 255.541L382.686 154.964Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M293.243 82.6472C274.139 75.57 254.869 72.031 235.434 72.0303L177.366 172.607C196.801 172.608 216.071 176.147 235.175 183.224L293.243 82.6472Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M394.118 194.257C395.112 182.973 391.301 169.872 382.688 154.953L324.619 255.53C333.233 270.448 337.044 283.55 336.05 294.834L394.118 194.257Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M235.432 72.0311C216.88 72.0304 202.027 75.5681 190.875 82.6442L132.806 183.221C143.959 176.145 158.812 172.607 177.363 172.608L235.432 72.0311Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M265.59 124.25C276.191 124.251 286.24 127.12 295.737 132.858L237.669 233.435C228.172 227.697 218.123 224.828 207.522 224.827L265.59 124.25Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M295.719 132.859C305.326 138.406 312.78 145.77 318.081 154.95L260.013 255.527C254.712 246.347 247.258 238.983 237.651 233.436L295.719 132.859Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M387.218 217.608C391.227 210.66 393.527 202.874 394.117 194.25L336.049 294.827C335.459 303.451 333.159 311.237 329.15 318.185L387.218 217.608Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M245.211 132.577C248.413 127.03 255.204 124.257 265.584 124.258L207.516 224.835C197.136 224.834 190.345 227.607 187.143 233.154L245.211 132.577Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M318.094 154.945C322.842 163.17 324.002 171.107 321.573 178.757L263.505 279.334C265.934 271.684 264.774 263.746 260.026 255.522L318.094 154.945Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M176.925 96.6737C180.127 91.1249 184.776 86.4503 190.871 82.6499L132.803 183.227C126.708 187.027 122.059 191.702 118.857 197.25L176.925 96.6737Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M387.226 217.606C385.989 219.749 384.59 221.813 383.028 223.797L324.96 324.373C326.522 322.39 327.921 320.326 329.157 318.183L387.226 217.606Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M317.269 188.408C319.087 185.262 320.519 182.045 321.562 178.758L263.494 279.335C262.451 282.622 261.019 285.839 259.201 288.985L317.269 188.408Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M245.208 132.573C241.895 137.928 243 145.387 248.522 154.95L190.454 255.527C184.932 245.964 183.827 238.505 187.14 233.15L245.208 132.573Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M176.93 96.6719C174.331 101.175 172.686 106.255 171.993 111.91L113.925 212.487C114.618 206.831 116.263 201.752 118.862 197.249L176.93 96.6719Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M317.266 188.413C314.853 192.589 311.757 196.64 307.978 200.566L249.91 301.143C253.689 297.216 256.785 293.166 259.198 288.99L317.266 188.413Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M464.198 304.708L435.375 254.789L377.307 355.366L406.13 405.285L464.198 304.708Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M353.209 254.787C366.68 242.548 376.618 232.22 383.023 223.805L324.955 324.382C318.55 332.797 308.612 343.124 295.141 355.364L353.209 254.787Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M435.37 254.787L353.212 254.784L295.144 355.361L377.302 355.364L435.37 254.787Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M183.921 154.947L248.521 154.95L190.453 255.527L125.853 255.524L183.921 154.947Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M171.992 111.914C170.668 124.537 174.643 138.881 183.92 154.947L125.852 255.524C116.575 239.458 112.599 225.114 113.924 212.491L171.992 111.914Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M307.987 200.562C301.251 207.256 291.203 216.244 277.842 227.528L219.774 328.105C233.135 316.821 243.183 307.832 249.919 301.139L307.987 200.562Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M15.5469 75.1797L44.5359 125.386L-13.5321 225.963L-42.5212 175.756L15.5469 75.1797Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M277.836 227.536C264.033 238.82 253.708 247.904 246.862 254.789L188.794 355.366C195.64 348.481 205.965 339.397 219.768 328.113L277.836 227.536Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M275.358 304.706L464.189 304.713L406.12 405.29L217.29 405.283L275.358 304.706Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M44.5279 125.39L67.3864 125.39L9.31834 225.967L-13.5401 225.966L44.5279 125.39Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M101.341 75.1911L233.863 304.705L175.795 405.282L43.2733 175.768L101.341 75.1911ZM15.5431 75.19L-42.525 175.767L43.277 175.77L101.345 75.1932L15.5431 75.19Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M246.866 254.784L246.534 254.784L188.466 355.361L188.798 355.361L246.866 254.784Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M246.539 254.781L275.362 304.701L217.294 405.277L188.471 355.358L246.539 254.781Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M67.3906 125.391L170.923 304.698L112.855 405.275L9.32257 225.967L67.3906 125.391Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M170.921 304.699L233.865 304.701L175.797 405.278L112.853 405.276L170.921 304.699Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="bevel"- />- </g>- <g- :style="{ mixBlendMode: 'hard-light' }"- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M246.544 254.79L246.875 254.79C253.722 247.905 264.046 238.82 277.849 227.537C291.21 216.253 301.259 207.264 307.995 200.57C314.62 193.685 319.147 186.418 321.577 178.768C324.006 171.117 322.846 163.18 318.097 154.956C312.796 145.775 305.342 138.412 295.735 132.865C286.238 127.127 276.189 124.258 265.588 124.257C255.208 124.257 248.416 127.03 245.214 132.576C241.902 137.931 243.006 145.39 248.528 154.953L183.928 154.951C174.652 138.885 170.676 124.541 172 111.918C173.546 99.2946 179.84 89.5408 190.882 82.6559C202.035 75.5798 216.887 72.0421 235.439 72.0428C254.874 72.0435 274.144 75.5825 293.248 82.6598C312.242 89.5457 329.579 99.3005 345.261 111.924C360.942 124.548 373.421 138.892 382.697 154.958C391.311 169.877 395.121 182.978 394.128 194.262C393.355 205.546 389.656 215.396 383.031 223.811C376.627 232.226 366.688 242.554 353.217 254.794L435.375 254.797L464.198 304.716L275.367 304.709L246.544 254.79Z"- fill="#F0ACB8"- />- <path- d="M246.544 254.79L246.875 254.79C253.722 247.905 264.046 238.82 277.849 227.537C291.21 216.253 301.259 207.264 307.995 200.57C314.62 193.685 319.147 186.418 321.577 178.768C324.006 171.117 322.846 163.18 318.097 154.956C312.796 145.775 305.342 138.412 295.735 132.865C286.238 127.127 276.189 124.258 265.588 124.257C255.208 124.257 248.416 127.03 245.214 132.576C241.902 137.931 243.006 145.39 248.528 154.953L183.928 154.951C174.652 138.885 170.676 124.541 172 111.918C173.546 99.2946 179.84 89.5408 190.882 82.6559C202.035 75.5798 216.887 72.0421 235.439 72.0428C254.874 72.0435 274.144 75.5825 293.248 82.6598C312.242 89.5457 329.579 99.3005 345.261 111.924C360.942 124.548 373.421 138.892 382.697 154.958C391.311 169.877 395.121 182.978 394.128 194.262C393.355 205.546 389.656 215.396 383.031 223.811C376.627 232.226 366.688 242.554 353.217 254.794L435.375 254.797L464.198 304.716L275.367 304.709L246.544 254.79Z"- stroke="#1B1B18"- stroke-width="1"- stroke-linejoin="round"- />- </g>- <g- :style="{ mixBlendMode: 'hard-light' }"- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M67.41 125.402L44.5515 125.401L15.5625 75.1953L101.364 75.1985L233.886 304.712L170.942 304.71L67.41 125.402Z"- fill="#F0ACB8"- />- <path- d="M67.41 125.402L44.5515 125.401L15.5625 75.1953L101.364 75.1985L233.886 304.712L170.942 304.71L67.41 125.402Z"- stroke="#1B1B18"- stroke-width="1"- />- </g>- </svg>- <svg- class="relative -mt-[4.9rem] -ml-8 hidden w-[448px] max-w-none lg:-mt-[6.6rem] lg:ml-0 dark:block"- viewBox="0 0 440 376"- fill="none"- xmlns="http://www.w3.org/2000/svg"+ <img :src="platform.logo" :alt="platform.name" class="h-8 w-8" />+ <span class="text-sm font-medium">{{ platform.name }}</span>+ </div>+ </div>+ </div>+ </section>++ <!-- Features Section -->+ <section class="py-20">+ <div class="mx-auto max-w-6xl px-6">+ <h2 class="text-3xl font-bold text-center mb-12">+ Everything you need to manage your social presence+ </h2>+ <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-8">+ <div+ v-for="feature in features"+ :key="feature.title"+ class="p-6 rounded-lg border bg-card">- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M188.263 355.73L188.595 355.73C195.441 348.845 205.766 339.761 219.569 328.477C232.93 317.193 242.978 308.205 249.714 301.511C256.34 294.626 260.867 287.358 263.296 279.708C265.725 272.058 264.565 264.121 259.816 255.896C254.516 246.716 247.062 239.352 237.454 233.805C227.957 228.067 217.908 225.198 207.307 225.198C196.927 225.197 190.136 227.97 186.934 233.516C183.621 238.872 184.726 246.331 190.247 255.894L125.647 255.891C116.371 239.825 112.395 225.481 113.72 212.858C115.265 200.235 121.559 190.481 132.602 183.596C143.754 176.52 158.607 172.982 177.159 172.983C196.594 172.984 215.863 176.523 234.968 183.6C253.961 190.486 271.299 200.241 286.98 212.864C302.661 225.488 315.14 239.833 324.416 255.899C333.03 270.817 336.841 283.918 335.847 295.203C335.075 306.487 331.376 316.336 324.75 324.751C318.346 333.167 308.408 343.494 294.936 355.734L377.094 355.737L405.917 405.656L217.087 405.649L188.263 355.73Z"- fill="black"- />- <path- d="M9.11884 226.339L-13.7396 226.338L-42.7286 176.132L43.0733 176.135L175.595 405.649L112.651 405.647L9.11884 226.339Z"- fill="black"- />- <path- d="M188.263 355.73L188.595 355.73C195.441 348.845 205.766 339.761 219.569 328.477C232.93 317.193 242.978 308.205 249.714 301.511C256.34 294.626 260.867 287.358 263.296 279.708C265.725 272.058 264.565 264.121 259.816 255.896C254.516 246.716 247.062 239.352 237.454 233.805C227.957 228.067 217.908 225.198 207.307 225.198C196.927 225.197 190.136 227.97 186.934 233.516C183.621 238.872 184.726 246.331 190.247 255.894L125.647 255.891C116.371 239.825 112.395 225.481 113.72 212.858C115.265 200.235 121.559 190.481 132.602 183.596C143.754 176.52 158.607 172.982 177.159 172.983C196.594 172.984 215.863 176.523 234.968 183.6C253.961 190.486 271.299 200.241 286.98 212.864C302.661 225.488 315.14 239.833 324.416 255.899C333.03 270.817 336.841 283.918 335.847 295.203C335.075 306.487 331.376 316.336 324.75 324.751C318.346 333.167 308.408 343.494 294.936 355.734L377.094 355.737L405.917 405.656L217.087 405.649L188.263 355.73Z"- stroke="#FF750F"- stroke-width="1"- />- <path- d="M9.11884 226.339L-13.7396 226.338L-42.7286 176.132L43.0733 176.135L175.595 405.649L112.651 405.647L9.11884 226.339Z"- stroke="#FF750F"- stroke-width="1"- />- <path- d="M204.592 327.449L204.923 327.449C211.769 320.564 222.094 311.479 235.897 300.196C249.258 288.912 259.306 279.923 266.042 273.23C272.668 266.345 277.195 259.077 279.624 251.427C282.053 243.777 280.893 235.839 276.145 227.615C270.844 218.435 263.39 211.071 253.782 205.524C244.285 199.786 234.236 196.917 223.635 196.916C213.255 196.916 206.464 199.689 203.262 205.235C199.949 210.59 201.054 218.049 206.575 227.612L141.975 227.61C132.699 211.544 128.723 197.2 130.048 184.577C131.593 171.954 137.887 162.2 148.93 155.315C160.083 148.239 174.935 144.701 193.487 144.702C212.922 144.703 232.192 148.242 251.296 155.319C270.289 162.205 287.627 171.96 303.308 184.583C318.989 197.207 331.468 211.552 340.745 227.618C349.358 242.536 353.169 255.637 352.175 266.921C351.403 278.205 347.704 288.055 341.078 296.47C334.674 304.885 324.736 315.213 311.264 327.453L393.422 327.456L422.246 377.375L233.415 377.368L204.592 327.449Z"- fill="#391800"- />- <path- d="M25.447 198.058L2.58852 198.057L-26.4005 147.851L59.4015 147.854L191.923 377.368L128.979 377.365L25.447 198.058Z"- fill="#391800"- />- <path- d="M204.592 327.449L204.923 327.449C211.769 320.564 222.094 311.479 235.897 300.196C249.258 288.912 259.306 279.923 266.042 273.23C272.668 266.345 277.195 259.077 279.624 251.427C282.053 243.777 280.893 235.839 276.145 227.615C270.844 218.435 263.39 211.071 253.782 205.524C244.285 199.786 234.236 196.917 223.635 196.916C213.255 196.916 206.464 199.689 203.262 205.235C199.949 210.59 201.054 218.049 206.575 227.612L141.975 227.61C132.699 211.544 128.723 197.2 130.048 184.577C131.593 171.954 137.887 162.2 148.93 155.315C160.083 148.239 174.935 144.701 193.487 144.702C212.922 144.703 232.192 148.242 251.296 155.319C270.289 162.205 287.627 171.96 303.308 184.583C318.989 197.207 331.468 211.552 340.745 227.618C349.358 242.536 353.169 255.637 352.175 266.921C351.403 278.205 347.704 288.055 341.078 296.47C334.674 304.885 324.736 315.213 311.264 327.453L393.422 327.456L422.246 377.375L233.415 377.368L204.592 327.449Z"- stroke="#FF750F"- stroke-width="1"- />- <path- d="M25.447 198.058L2.58852 198.057L-26.4005 147.851L59.4015 147.854L191.923 377.368L128.979 377.365L25.447 198.058Z"- stroke="#FF750F"- stroke-width="1"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- :style="{ mixBlendMode: 'hard-light' }"- >- <path- d="M217.342 305.363L217.673 305.363C224.519 298.478 234.844 289.393 248.647 278.11C262.008 266.826 272.056 257.837 278.792 251.144C285.418 244.259 289.945 236.991 292.374 229.341C294.803 221.691 293.643 213.753 288.895 205.529C283.594 196.349 276.14 188.985 266.532 183.438C257.035 177.7 246.986 174.831 236.385 174.83C226.005 174.83 219.214 177.603 216.012 183.149C212.699 188.504 213.804 195.963 219.325 205.527L154.725 205.524C145.449 189.458 141.473 175.114 142.798 162.491C144.343 149.868 150.637 140.114 161.68 133.229C172.833 126.153 187.685 122.615 206.237 122.616C225.672 122.617 244.942 126.156 264.046 133.233C283.039 140.119 300.377 149.874 316.058 162.497C331.739 175.121 344.218 189.466 353.495 205.532C362.108 220.45 365.919 233.551 364.925 244.835C364.153 256.12 360.454 265.969 353.828 274.384C347.424 282.799 337.486 293.127 324.014 305.367L406.172 305.37L434.996 355.289L246.165 355.282L217.342 305.363Z"- fill="#733000"- />- <path- d="M38.197 175.972L15.3385 175.971L-13.6505 125.765L72.1515 125.768L204.673 355.282L141.729 355.279L38.197 175.972Z"- fill="#733000"- />- <path- d="M217.342 305.363L217.673 305.363C224.519 298.478 234.844 289.393 248.647 278.11C262.008 266.826 272.056 257.837 278.792 251.144C285.418 244.259 289.945 236.991 292.374 229.341C294.803 221.691 293.643 213.753 288.895 205.529C283.594 196.349 276.14 188.985 266.532 183.438C257.035 177.7 246.986 174.831 236.385 174.83C226.005 174.83 219.214 177.603 216.012 183.149C212.699 188.504 213.804 195.963 219.325 205.527L154.725 205.524C145.449 189.458 141.473 175.114 142.798 162.491C144.343 149.868 150.637 140.114 161.68 133.229C172.833 126.153 187.685 122.615 206.237 122.616C225.672 122.617 244.942 126.156 264.046 133.233C283.039 140.119 300.377 149.874 316.058 162.497C331.739 175.121 344.218 189.466 353.495 205.532C362.108 220.45 365.919 233.551 364.925 244.835C364.153 256.12 360.454 265.969 353.828 274.384C347.424 282.799 337.486 293.127 324.014 305.367L406.172 305.37L434.996 355.289L246.165 355.282L217.342 305.363Z"- stroke="#FF750F"- stroke-width="1"- />- <path- d="M38.197 175.972L15.3385 175.971L-13.6505 125.765L72.1515 125.768L204.673 355.282L141.729 355.279L38.197 175.972Z"- stroke="#FF750F"- stroke-width="1"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M217.342 305.363L217.673 305.363C224.519 298.478 234.844 289.393 248.647 278.11C262.008 266.826 272.056 257.837 278.792 251.144C285.418 244.259 289.945 236.991 292.374 229.341C294.803 221.691 293.643 213.753 288.895 205.529C283.594 196.349 276.14 188.985 266.532 183.438C257.035 177.7 246.986 174.831 236.385 174.83C226.005 174.83 219.214 177.603 216.012 183.149C212.699 188.504 213.804 195.963 219.325 205.527L154.726 205.524C145.449 189.458 141.473 175.114 142.798 162.491C144.343 149.868 150.637 140.114 161.68 133.229C172.833 126.153 187.685 122.615 206.237 122.616C225.672 122.617 244.942 126.156 264.046 133.233C283.039 140.119 300.377 149.874 316.058 162.497C331.739 175.121 344.218 189.466 353.495 205.532C362.108 220.45 365.919 233.551 364.925 244.835C364.153 256.12 360.454 265.969 353.828 274.384C347.424 282.799 337.486 293.127 324.014 305.367L406.172 305.37L434.996 355.289L246.165 355.282L217.342 305.363Z"- stroke="#FF750F"- stroke-width="1"- />- <path- d="M38.197 175.972L15.3385 175.971L-13.6505 125.765L72.1515 125.768L204.673 355.282L141.729 355.279L38.197 175.972Z"- stroke="#FF750F"- stroke-width="1"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- >- <path- d="M188.467 355.363L188.798 355.363C195.644 348.478 205.969 339.393 219.772 328.11C233.133 316.826 243.181 307.837 249.917 301.144C253.696 297.217 256.792 293.166 259.205 288.991C261.024 285.845 262.455 282.628 263.499 279.341C265.928 271.691 264.768 263.753 260.02 255.529C254.719 246.349 247.265 238.985 237.657 233.438C228.16 227.7 218.111 224.831 207.51 224.83C197.13 224.83 190.339 227.603 187.137 233.149C183.824 238.504 184.929 245.963 190.45 255.527L125.851 255.524C116.574 239.458 112.598 225.114 113.923 212.491C114.615 206.836 116.261 201.756 118.859 197.253C122.061 191.704 126.709 187.03 132.805 183.229C143.958 176.153 158.81 172.615 177.362 172.616C196.797 172.617 216.067 176.156 235.171 183.233C254.164 190.119 271.502 199.874 287.183 212.497C302.864 225.121 315.343 239.466 324.62 255.532C333.233 270.45 337.044 283.551 336.05 294.835C335.46 303.459 333.16 311.245 329.151 318.194C327.915 320.337 326.515 322.4 324.953 324.384C318.549 332.799 308.611 343.127 295.139 355.367L377.297 355.37L406.121 405.289L217.29 405.282L188.467 355.363Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M9.32197 225.972L-13.5365 225.971L-42.5255 175.765L43.2765 175.768L175.798 405.282L112.854 405.279L9.32197 225.972Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M345.247 111.915C329.566 99.2919 312.229 89.5371 293.235 82.6512L235.167 183.228C254.161 190.114 271.498 199.869 287.179 212.492L345.247 111.915Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M382.686 154.964C373.41 138.898 360.931 124.553 345.25 111.93L287.182 212.506C302.863 225.13 315.342 239.475 324.618 255.541L382.686 154.964Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M293.243 82.6472C274.139 75.57 254.869 72.031 235.434 72.0303L177.366 172.607C196.801 172.608 216.071 176.147 235.175 183.224L293.243 82.6472Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M394.118 194.257C395.112 182.973 391.301 169.872 382.688 154.953L324.619 255.53C333.233 270.448 337.044 283.55 336.05 294.834L394.118 194.257Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M235.432 72.0311C216.88 72.0304 202.027 75.5681 190.875 82.6442L132.806 183.221C143.959 176.145 158.812 172.607 177.363 172.608L235.432 72.0311Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M265.59 124.25C276.191 124.251 286.24 127.12 295.737 132.858L237.669 233.435C228.172 227.697 218.123 224.828 207.522 224.827L265.59 124.25Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M295.719 132.859C305.326 138.406 312.78 145.77 318.081 154.95L260.013 255.527C254.712 246.347 247.258 238.983 237.651 233.436L295.719 132.859Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M387.218 217.608C391.227 210.66 393.527 202.874 394.117 194.25L336.049 294.827C335.459 303.451 333.159 311.237 329.15 318.185L387.218 217.608Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M245.211 132.577C248.413 127.03 255.204 124.257 265.584 124.258L207.516 224.835C197.136 224.834 190.345 227.607 187.143 233.154L245.211 132.577Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M318.094 154.945C322.842 163.17 324.002 171.107 321.573 178.757L263.505 279.334C265.934 271.684 264.774 263.746 260.026 255.522L318.094 154.945Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M176.925 96.6737C180.127 91.1249 184.776 86.4503 190.871 82.6499L132.803 183.227C126.708 187.027 122.059 191.702 118.857 197.25L176.925 96.6737Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M387.226 217.606C385.989 219.749 384.59 221.813 383.028 223.797L324.96 324.373C326.522 322.39 327.921 320.326 329.157 318.183L387.226 217.606Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M317.269 188.408C319.087 185.262 320.519 182.045 321.562 178.758L263.494 279.335C262.451 282.622 261.019 285.839 259.201 288.985L317.269 188.408Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M245.208 132.573C241.895 137.928 243 145.387 248.522 154.95L190.454 255.527C184.932 245.964 183.827 238.505 187.14 233.15L245.208 132.573Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M176.93 96.6719C174.331 101.175 172.686 106.255 171.993 111.91L113.925 212.487C114.618 206.831 116.263 201.752 118.862 197.249L176.93 96.6719Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M317.266 188.413C314.853 192.589 311.757 196.64 307.978 200.566L249.91 301.143C253.689 297.216 256.785 293.166 259.198 288.99L317.266 188.413Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M464.198 304.708L435.375 254.789L377.307 355.366L406.13 405.285L464.198 304.708Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M353.209 254.787C366.68 242.548 376.618 232.22 383.023 223.805L324.955 324.382C318.55 332.797 308.612 343.124 295.141 355.364L353.209 254.787Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M435.37 254.787L353.212 254.784L295.144 355.361L377.302 355.364L435.37 254.787Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M183.921 154.947L248.521 154.95L190.453 255.527L125.853 255.524L183.921 154.947Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M171.992 111.914C170.668 124.537 174.643 138.881 183.92 154.947L125.852 255.524C116.575 239.458 112.599 225.114 113.924 212.491L171.992 111.914Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M307.987 200.562C301.251 207.256 291.203 216.244 277.842 227.528L219.774 328.105C233.135 316.821 243.183 307.832 249.919 301.139L307.987 200.562Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M15.5469 75.1797L44.5359 125.386L-13.5321 225.963L-42.5212 175.756L15.5469 75.1797Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M277.836 227.536C264.033 238.82 253.708 247.904 246.862 254.789L188.794 355.366C195.64 348.481 205.965 339.397 219.768 328.113L277.836 227.536Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M275.358 304.706L464.189 304.713L406.12 405.29L217.29 405.283L275.358 304.706Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M44.5279 125.39L67.3864 125.39L9.31834 225.967L-13.5401 225.966L44.5279 125.39Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M101.341 75.1911L233.863 304.705L175.795 405.282L43.2733 175.768L101.341 75.1911ZM15.5431 75.19L-42.525 175.767L43.277 175.77L101.345 75.1932L15.5431 75.19Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M246.866 254.784L246.534 254.784L188.466 355.361L188.798 355.361L246.866 254.784Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M246.539 254.781L275.362 304.701L217.294 405.277L188.471 355.358L246.539 254.781Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M67.3906 125.391L170.923 304.698L112.855 405.275L9.32257 225.967L67.3906 125.391Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- <path- d="M170.921 304.699L233.865 304.701L175.797 405.278L112.853 405.276L170.921 304.699Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="bevel"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- :style="{ mixBlendMode: 'hard-light' }"+ <component :is="feature.icon" class="h-10 w-10 text-primary mb-4" />+ <h3 class="font-semibold mb-2">{{ feature.title }}</h3>+ <p class="text-sm text-muted-foreground">{{ feature.description }}</p>+ </div>+ </div>+ </div>+ </section>++ <!-- Benefits Section -->+ <section class="py-20 bg-muted/30">+ <div class="mx-auto max-w-6xl px-6">+ <div class="grid md:grid-cols-2 gap-12 items-center">+ <div>+ <h2 class="text-3xl font-bold mb-6">+ Focus on creating, not scheduling+ </h2>+ <ul class="space-y-4">+ <li class="flex items-start gap-3">+ <CheckCircle class="h-5 w-5 text-green-500 mt-0.5 shrink-0" />+ <span>Schedule weeks of content in minutes</span>+ </li>+ <li class="flex items-start gap-3">+ <CheckCircle class="h-5 w-5 text-green-500 mt-0.5 shrink-0" />+ <span>Customize content for each platform</span>+ </li>+ <li class="flex items-start gap-3">+ <CheckCircle class="h-5 w-5 text-green-500 mt-0.5 shrink-0" />+ <span>Upload images and videos with ease</span>+ </li>+ <li class="flex items-start gap-3">+ <CheckCircle class="h-5 w-5 text-green-500 mt-0.5 shrink-0" />+ <span>Collaborate with your team</span>+ </li>+ <li class="flex items-start gap-3">+ <CheckCircle class="h-5 w-5 text-green-500 mt-0.5 shrink-0" />+ <span>Track your publishing history</span>+ </li>+ </ul>+ </div>+ <div class="bg-card border rounded-lg p-8 text-center">+ <p class="text-4xl font-bold text-primary mb-2">$20</p>+ <p class="text-muted-foreground mb-6">per workspace / month</p>+ <Link v-if="canRegister" :href="register()">+ <Button class="w-full" size="lg">Start Free Trial</Button>+ </Link>+ </div>+ </div>+ </div>+ </section>++ <!-- CTA Section -->+ <section class="py-20">+ <div class="mx-auto max-w-6xl px-6 text-center">+ <h2 class="text-3xl font-bold mb-4">Ready to streamline your social media?</h2>+ <p class="text-muted-foreground mb-8">+ Join thousands of creators and businesses who trust TryPost.+ </p>+ <Link v-if="canRegister" :href="register()">+ <Button size="lg">Get Started Now</Button>+ </Link>+ </div>+ </section>++ <!-- Footer -->+ <footer class="border-t py-12">+ <div class="mx-auto max-w-6xl px-6">+ <div class="flex flex-col md:flex-row items-center justify-between gap-6">+ <div class="flex items-center gap-2">+ <img src="/images/trypost/logo-light.png" alt="TryPost" class="dark:hidden h-6 w-auto" />+ <img src="/images/trypost/logo-dark.png" alt="TryPost" class="hidden dark:block h-6 w-auto" />+ </div>+ <nav class="flex items-center gap-6">+ <Link+ href="/privacy"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors">- <path- d="M246.544 254.79L246.875 254.79C253.722 247.905 264.046 238.82 277.849 227.537C291.21 216.253 301.259 207.264 307.995 200.57C314.62 193.685 319.147 186.418 321.577 178.768C324.006 171.117 322.846 163.18 318.097 154.956C312.796 145.775 305.342 138.412 295.735 132.865C286.238 127.127 276.189 124.258 265.588 124.257C255.208 124.257 248.416 127.03 245.214 132.576C241.902 137.931 243.006 145.39 248.528 154.953L183.928 154.951C174.652 138.885 170.676 124.541 172 111.918C173.546 99.2946 179.84 89.5408 190.882 82.6559C202.035 75.5798 216.887 72.0421 235.439 72.0428C254.874 72.0435 274.144 75.5825 293.248 82.6598C312.242 89.5457 329.579 99.3005 345.261 111.924C360.942 124.548 373.421 138.892 382.697 154.958C391.311 169.877 395.121 182.978 394.128 194.262C393.355 205.546 389.656 215.396 383.031 223.811C376.627 232.226 366.688 242.554 353.217 254.794L435.375 254.797L464.198 304.716L275.367 304.709L246.544 254.79Z"- fill="#4B0600"- />- <path- d="M246.544 254.79L246.875 254.79C253.722 247.905 264.046 238.82 277.849 227.537C291.21 216.253 301.259 207.264 307.995 200.57C314.62 193.685 319.147 186.418 321.577 178.768C324.006 171.117 322.846 163.18 318.097 154.956C312.796 145.775 305.342 138.412 295.735 132.865C286.238 127.127 276.189 124.258 265.588 124.257C255.208 124.257 248.416 127.03 245.214 132.576C241.902 137.931 243.006 145.39 248.528 154.953L183.928 154.951C174.652 138.885 170.676 124.541 172 111.918C173.546 99.2946 179.84 89.5408 190.882 82.6559C202.035 75.5798 216.887 72.0421 235.439 72.0428C254.874 72.0435 274.144 75.5825 293.248 82.6598C312.242 89.5457 329.579 99.3005 345.261 111.924C360.942 124.548 373.421 138.892 382.697 154.958C391.311 169.877 395.121 182.978 394.128 194.262C393.355 205.546 389.656 215.396 383.031 223.811C376.627 232.226 366.688 242.554 353.217 254.794L435.375 254.797L464.198 304.716L275.367 304.709L246.544 254.79Z"- stroke="#FF750F"- stroke-width="1"- stroke-linejoin="round"- />- </g>- <g- class="translate-y-0 opacity-100 transition-all delay-300 duration-750 starting:translate-y-4 starting:opacity-0"- :style="{ mixBlendMode: 'hard-light' }"+ Privacy Policy+ </Link>+ <Link+ href="/terms"+ class="text-sm text-muted-foreground hover:text-foreground transition-colors">- <path- d="M67.41 125.402L44.5515 125.401L15.5625 75.1953L101.364 75.1985L233.886 304.712L170.942 304.71L67.41 125.402Z"- fill="#4B0600"- />- <path- d="M67.41 125.402L44.5515 125.401L15.5625 75.1953L101.364 75.1985L233.886 304.712L170.942 304.71L67.41 125.402Z"- stroke="#FF750F"- stroke-width="1"- />- </g>- </svg>- <div- class="absolute inset-0 rounded-t-lg shadow-[inset_0px_0px_0px_1px_rgba(26,26,0,0.16)] lg:overflow-hidden lg:rounded-t-none lg:rounded-r-lg dark:shadow-[inset_0px_0px_0px_1px_#fffaed2d]"- />+ Terms of Service+ </Link>+ </nav>+ <p class="text-sm text-muted-foreground">+ © {{ new Date().getFullYear() }} TryPost. All rights reserved.+ </p></div>- </main>- </div>- <div class="hidden h-14.5 lg:block"></div>+ </div>+ </footer></div></template>diff --git a/resources/js/pages/accounts/Index.vue b/resources/js/pages/accounts/Index.vueindex a38161bd1..03925d69e 100644--- a/resources/js/pages/accounts/Index.vue+++ b/resources/js/pages/accounts/Index.vue@@ -1,11 +1,12 @@<script setup lang="ts">-import { Head, Link, router } from '@inertiajs/vue3';+import { Head, Link } from '@inertiajs/vue3';+import { ref } from 'vue';import { Check, ExternalLink, Trash2 } from 'lucide-vue-next';import AppLayout from '@/layouts/AppLayout.vue';import { Button } from '@/components/ui/button';import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';-import { Badge } from '@/components/ui/badge';+import ConfirmDeleteModal from '@/components/ConfirmDeleteModal.vue';import { type BreadcrumbItemType } from '@/types';interface SocialAccount {@@ -36,6 +37,8 @@ interface Props {const props = defineProps<Props>();+const deleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);+const breadcrumbs: BreadcrumbItemType[] = [{title: 'Workspaces',@@ -46,15 +49,15 @@ const breadcrumbs: BreadcrumbItemType[] = [href: `/workspaces/${props.workspace.id}`,},{- title: 'Contas',+ title: 'Accounts',href: `/workspaces/${props.workspace.id}/accounts`,},];const disconnect = (accountId: string) => {- if (confirm('Tem certeza que deseja desconectar esta conta?')) {- router.delete(`/workspaces/${props.workspace.id}/accounts/${accountId}`);- }+ deleteModal.value?.open({+ url: `/workspaces/${props.workspace.id}/accounts/${accountId}`,+ });};const getPlatformLogo = (platform: string): string => {@@ -94,14 +97,14 @@ const getProfileUrl = (platform: string, username: string | null): string | null</script><template>- <Head title="Contas Conectadas" />+ <Head title="Connected Accounts" /><AppLayout :breadcrumbs="breadcrumbs"><div class="flex flex-col gap-8 p-6"><div>- <h1 class="text-2xl font-bold tracking-tight">Contas Conectadas</h1>+ <h1 class="text-2xl font-bold tracking-tight">Connected Accounts</h1><p class="text-muted-foreground">- Conecte suas redes sociais para agendar e publicar posts+ Connect your social networks to schedule and publish posts</p></div>@@ -135,7 +138,7 @@ const getProfileUrl = (platform: string, username: string | null): string | null@{{ platform.account.username || platform.account.display_name }}</p><p v-else class="text-sm text-muted-foreground">- Não conectado+ Not connected</p></div></div>@@ -160,14 +163,14 @@ const getProfileUrl = (platform: string, username: string | null): string | null:href="getProfileUrl(platform.value, platform.account.username)!"target="_blank"class="p-2 text-muted-foreground hover:text-foreground transition-colors"- title="Ver perfil"+ title="View profile"><ExternalLink class="h-4 w-4" /></a><button@click="disconnect(platform.account.id)"class="p-2 text-muted-foreground hover:text-red-600 transition-colors"- title="Desconectar"+ title="Disconnect"><Trash2 class="h-4 w-4" /></button>@@ -179,7 +182,7 @@ const getProfileUrl = (platform: string, username: string | null): string | null<div v-else class="border-t px-4 py-3"><Link :href="`/workspaces/${workspace.id}/connect/${platform.value}`"><Button variant="outline" class="w-full" size="sm">- Conectar+ Connect</Button></Link></div>@@ -187,4 +190,12 @@ const getProfileUrl = (platform: string, username: string | null): string | null</div></div></AppLayout>++ <ConfirmDeleteModal+ ref="deleteModal"+ title="Disconnect Account"+ description="Are you sure you want to disconnect this account? You can reconnect it at any time."+ action="Disconnect"+ cancel="Cancel"+ /></template>diff --git a/resources/js/pages/accounts/YouTubeChannelSelect.vue b/resources/js/pages/accounts/YouTubeChannelSelect.vuenew file mode 100644index 000000000..5b9e3e471--- /dev/null+++ b/resources/js/pages/accounts/YouTubeChannelSelect.vue@@ -0,0 +1,149 @@+<script setup lang="ts">+import { Head, router } from '@inertiajs/vue3';+import { Youtube, ArrowLeft, Check, Users } from 'lucide-vue-next';++import AppLayout from '@/layouts/AppLayout.vue';+import { Button } from '@/components/ui/button';+import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';+import { Alert, AlertDescription } from '@/components/ui/alert';+import { type BreadcrumbItemType } from '@/types';++interface Channel {+ id: string;+ title: string;+ description: string;+ thumbnail: string | null;+ custom_url: string | null;+ subscriber_count: number | string;+}++interface Workspace {+ id: string;+ name: string;+}++interface Props {+ workspace: Workspace;+ channels: Channel[];+ error?: string;+}++const props = defineProps<Props>();++const breadcrumbs: BreadcrumbItemType[] = [+ {+ title: 'Workspaces',+ href: '/workspaces',+ },+ {+ title: props.workspace.name,+ href: `/workspaces/${props.workspace.id}`,+ },+ {+ title: 'Accounts',+ href: `/workspaces/${props.workspace.id}/accounts`,+ },+ {+ title: 'Select Channel',+ href: '#',+ },+];++const selectChannel = (channel: Channel) => {+ router.post('/accounts/youtube/select', {+ channel_id: channel.id,+ });+};++const goBack = () => {+ router.visit(`/workspaces/${props.workspace.id}/accounts`);+};++const formatSubscribers = (count: number | string) => {+ const num = typeof count === 'string' ? parseInt(count) : count;+ if (num >= 1000000) {+ return `${(num / 1000000).toFixed(1)}M subscribers`;+ }+ if (num >= 1000) {+ return `${(num / 1000).toFixed(1)}K subscribers`;+ }+ return `${num} subscribers`;+};+</script>++<template>+ <Head title="Select YouTube Channel" />++ <AppLayout :breadcrumbs="breadcrumbs">+ <div class="flex flex-col gap-8 p-6">+ <div class="flex items-center gap-4">+ <Button variant="ghost" size="icon" @click="goBack" class="shrink-0">+ <ArrowLeft class="h-4 w-4" />+ </Button>+ <div class="flex items-center gap-3">+ <div class="flex h-10 w-10 items-center justify-center rounded-lg bg-red-600">+ <Youtube class="h-6 w-6 text-white" />+ </div>+ <div>+ <h1 class="text-2xl font-bold tracking-tight">Select YouTube Channel</h1>+ <p class="text-muted-foreground">+ Choose which channel you want to connect for Shorts+ </p>+ </div>+ </div>+ </div>++ <Alert v-if="error" variant="destructive">+ <AlertDescription>{{ error }}</AlertDescription>+ </Alert>++ <div v-if="channels.length === 0 && !error" class="text-center py-16">+ <div class="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-muted">+ <Youtube class="h-8 w-8 text-muted-foreground" />+ </div>+ <h3 class="mt-4 text-lg font-semibold">No channels found</h3>+ <p class="mt-1 text-muted-foreground">+ You don't have any YouTube channels associated with your account.+ </p>+ <Button class="mt-6" @click="goBack">+ Go Back+ </Button>+ </div>++ <div v-else class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">+ <button+ v-for="channel in channels"+ :key="channel.id"+ @click="selectChannel(channel)"+ class="group relative overflow-hidden rounded-xl border bg-card p-4 text-left transition-all hover:border-primary hover:shadow-md focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"+ >+ <div class="flex items-center gap-4">+ <Avatar class="h-14 w-14 rounded-full">+ <AvatarImage v-if="channel.thumbnail" :src="channel.thumbnail" class="object-cover" />+ <AvatarFallback class="bg-red-100 dark:bg-red-900">+ <Youtube class="h-7 w-7 text-red-600 dark:text-red-400" />+ </AvatarFallback>+ </Avatar>+ <div class="flex-1 min-w-0">+ <h3 class="font-semibold truncate group-hover:text-primary transition-colors">+ {{ channel.title }}+ </h3>+ <p v-if="channel.custom_url" class="text-sm text-muted-foreground truncate">+ youtube.com/{{ channel.custom_url }}+ </p>+ <div class="flex items-center gap-1 text-sm text-muted-foreground mt-1">+ <Users class="h-3 w-3" />+ {{ formatSubscribers(channel.subscriber_count) }}+ </div>+ </div>+ <div class="shrink-0 opacity-0 group-hover:opacity-100 transition-opacity">+ <div class="flex h-8 w-8 items-center justify-center rounded-full bg-primary text-primary-foreground">+ <Check class="h-4 w-4" />+ </div>+ </div>+ </div>+ </button>+ </div>+ </div>+ </AppLayout>+</template>diff --git a/resources/js/pages/legal/Privacy.vue b/resources/js/pages/legal/Privacy.vuenew file mode 100644index 000000000..fa4c6498d--- /dev/null+++ b/resources/js/pages/legal/Privacy.vue@@ -0,0 +1,144 @@+<script setup lang="ts">+import { Head } from '@inertiajs/vue3';+import GuestLayout from '@/layouts/GuestLayout.vue';+</script>++<template>+ <Head title="Privacy Policy" />++ <GuestLayout title="Privacy Policy">+ <div class="prose prose-gray dark:prose-invert max-w-none">+ <p class="text-muted-foreground">Last updated: January 15, 2025</p>++ <h2>1. Introduction</h2>+ <p>+ Welcome to TryPost ("we," "our," or "us"). We are committed to protecting your personal information+ and your right to privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard+ your information when you use our social media scheduling service.+ </p>++ <h2>2. Information We Collect</h2>+ <h3>2.1 Personal Information</h3>+ <p>We collect personal information that you voluntarily provide to us when you:</p>+ <ul>+ <li>Register for an account</li>+ <li>Connect your social media accounts</li>+ <li>Create and schedule posts</li>+ <li>Contact us for support</li>+ </ul>+ <p>This information may include:</p>+ <ul>+ <li>Name and email address</li>+ <li>Social media account credentials and tokens</li>+ <li>Content you create for posting (text, images, videos)</li>+ <li>Billing information (processed securely by Stripe)</li>+ </ul>++ <h3>2.2 Social Media Data</h3>+ <p>+ When you connect your social media accounts (Facebook, Instagram, LinkedIn, X/Twitter, TikTok, YouTube, Threads),+ we access certain information as permitted by each platform's API, including:+ </p>+ <ul>+ <li>Account profile information (name, username, profile picture)</li>+ <li>Page/channel information for business accounts</li>+ <li>Access tokens required to post on your behalf</li>+ </ul>++ <h3>2.3 Automatically Collected Information</h3>+ <p>We automatically collect certain information when you visit our platform, including:</p>+ <ul>+ <li>IP address and browser type</li>+ <li>Device information</li>+ <li>Usage data and analytics</li>+ </ul>++ <h2>3. How We Use Your Information</h2>+ <p>We use the information we collect to:</p>+ <ul>+ <li>Provide and maintain our service</li>+ <li>Schedule and publish your content to connected social media platforms</li>+ <li>Process your transactions and manage your subscription</li>+ <li>Send you service-related communications</li>+ <li>Respond to your inquiries and provide customer support</li>+ <li>Improve our service and develop new features</li>+ <li>Protect against fraud and unauthorized access</li>+ </ul>++ <h2>4. How We Share Your Information</h2>+ <p>We may share your information in the following situations:</p>+ <ul>+ <li><strong>With Social Media Platforms:</strong> We share your content with the platforms you've connected to publish your scheduled posts.</li>+ <li><strong>With Service Providers:</strong> We work with third-party service providers (hosting, payment processing, analytics) who need access to your information to perform services for us.</li>+ <li><strong>For Legal Compliance:</strong> We may disclose your information if required by law or in response to valid legal requests.</li>+ <li><strong>Business Transfers:</strong> In connection with any merger, sale, or acquisition of our business.</li>+ </ul>+ <p>We do not sell your personal information to third parties.</p>++ <h2>5. Data Security</h2>+ <p>+ We implement appropriate technical and organizational security measures to protect your personal information.+ This includes encryption of sensitive data, secure HTTPS connections, and regular security audits.+ However, no method of transmission over the Internet is 100% secure, and we cannot guarantee absolute security.+ </p>++ <h2>6. Data Retention</h2>+ <p>+ We retain your personal information for as long as your account is active or as needed to provide you services.+ You may request deletion of your account and associated data at any time by contacting us.+ </p>++ <h2>7. Your Privacy Rights</h2>+ <p>Depending on your location, you may have the right to:</p>+ <ul>+ <li>Access the personal information we hold about you</li>+ <li>Request correction of inaccurate information</li>+ <li>Request deletion of your personal information</li>+ <li>Object to or restrict processing of your information</li>+ <li>Data portability</li>+ <li>Withdraw consent where processing is based on consent</li>+ </ul>+ <p>To exercise these rights, please contact us at the email address provided below.</p>++ <h2>8. Third-Party Services</h2>+ <p>+ Our service integrates with third-party social media platforms. Each platform has its own privacy policy,+ and we encourage you to review them:+ </p>+ <ul>+ <li><a href="https://www.facebook.com/privacy/policy" target="_blank" rel="noopener">Meta (Facebook, Instagram, Threads) Privacy Policy</a></li>+ <li><a href="https://www.linkedin.com/legal/privacy-policy" target="_blank" rel="noopener">LinkedIn Privacy Policy</a></li>+ <li><a href="https://twitter.com/privacy" target="_blank" rel="noopener">X (Twitter) Privacy Policy</a></li>+ <li><a href="https://www.tiktok.com/legal/privacy-policy" target="_blank" rel="noopener">TikTok Privacy Policy</a></li>+ <li><a href="https://policies.google.com/privacy" target="_blank" rel="noopener">Google (YouTube) Privacy Policy</a></li>+ </ul>++ <h2>9. Children's Privacy</h2>+ <p>+ Our service is not intended for individuals under the age of 18. We do not knowingly collect personal+ information from children. If you believe we have collected information from a child, please contact us immediately.+ </p>++ <h2>10. International Data Transfers</h2>+ <p>+ Your information may be transferred to and processed in countries other than your country of residence.+ These countries may have different data protection laws. We ensure appropriate safeguards are in place+ for such transfers.+ </p>++ <h2>11. Changes to This Privacy Policy</h2>+ <p>+ We may update this Privacy Policy from time to time. We will notify you of any changes by posting the+ new Privacy Policy on this page and updating the "Last updated" date. We encourage you to review this+ Privacy Policy periodically.+ </p>++ <h2>12. Contact Us</h2>+ <p>If you have questions or concerns about this Privacy Policy, please contact us at:</p>+ <p>+ <strong>Email:</strong> [email protected]<br />+ <strong>Website:</strong> https://trypost.com+ </p>+ </div>+ </GuestLayout>+</template>diff --git a/resources/js/pages/legal/Terms.vue b/resources/js/pages/legal/Terms.vuenew file mode 100644index 000000000..cc8a7009b--- /dev/null+++ b/resources/js/pages/legal/Terms.vue@@ -0,0 +1,180 @@+<script setup lang="ts">+import { Head } from '@inertiajs/vue3';+import GuestLayout from '@/layouts/GuestLayout.vue';+</script>++<template>+ <Head title="Terms of Service" />++ <GuestLayout title="Terms of Service">+ <div class="prose prose-gray dark:prose-invert max-w-none">+ <p class="text-muted-foreground">Last updated: January 15, 2025</p>++ <h2>1. Agreement to Terms</h2>+ <p>+ By accessing or using TryPost ("Service"), you agree to be bound by these Terms of Service ("Terms").+ If you disagree with any part of these terms, you may not access the Service.+ </p>++ <h2>2. Description of Service</h2>+ <p>+ TryPost is a social media scheduling platform that allows you to create, schedule, and publish content+ to multiple social media platforms including Facebook, Instagram, LinkedIn, X (Twitter), TikTok, YouTube, and Threads.+ </p>++ <h2>3. Account Registration</h2>+ <p>To use our Service, you must:</p>+ <ul>+ <li>Be at least 18 years old</li>+ <li>Provide accurate and complete registration information</li>+ <li>Maintain the security of your account credentials</li>+ <li>Notify us immediately of any unauthorized account use</li>+ </ul>+ <p>+ You are responsible for all activities that occur under your account. We reserve the right to suspend+ or terminate accounts that violate these Terms.+ </p>++ <h2>4. Subscription and Payments</h2>+ <h3>4.1 Pricing</h3>+ <p>+ TryPost operates on a subscription model. Pricing is based on the number of workspaces you maintain.+ Current pricing and features are available on our website.+ </p>++ <h3>4.2 Billing</h3>+ <p>+ Subscriptions are billed in advance on a recurring basis (monthly or annually, depending on your plan).+ Payment is processed securely through Stripe. By providing payment information, you authorize us to+ charge your payment method for the applicable fees.+ </p>++ <h3>4.3 Refunds</h3>+ <p>+ Subscription fees are generally non-refundable except where required by law. You may cancel your+ subscription at any time, and you will continue to have access until the end of your billing period.+ </p>++ <h2>5. User Content</h2>+ <h3>5.1 Ownership</h3>+ <p>+ You retain all rights to the content you create and schedule through our Service. By using TryPost,+ you grant us a limited license to store, process, and transmit your content solely for the purpose+ of providing the Service.+ </p>++ <h3>5.2 Content Responsibility</h3>+ <p>You are solely responsible for the content you publish through our Service. You agree not to post content that:</p>+ <ul>+ <li>Violates any applicable laws or regulations</li>+ <li>Infringes on intellectual property rights of others</li>+ <li>Contains malware, spam, or malicious code</li>+ <li>Is defamatory, harassing, or discriminatory</li>+ <li>Violates the terms of service of connected social media platforms</li>+ </ul>++ <h3>5.3 Content Removal</h3>+ <p>+ We reserve the right to remove any content that violates these Terms or applicable laws.+ We may also remove content in response to valid legal requests or DMCA takedown notices.+ </p>++ <h2>6. Social Media Platform Compliance</h2>+ <p>+ When using TryPost to connect to third-party social media platforms, you agree to comply with each+ platform's terms of service and community guidelines. We are not responsible for any actions taken+ by social media platforms against your accounts.+ </p>++ <h2>7. Prohibited Uses</h2>+ <p>You agree not to use the Service to:</p>+ <ul>+ <li>Violate any laws or regulations</li>+ <li>Impersonate others or misrepresent your affiliation</li>+ <li>Engage in automated data collection without authorization</li>+ <li>Attempt to gain unauthorized access to our systems</li>+ <li>Interfere with the proper operation of the Service</li>+ <li>Circumvent any security measures</li>+ <li>Use the Service for spam or bulk unsolicited messaging</li>+ </ul>++ <h2>8. Intellectual Property</h2>+ <p>+ The Service, including its original content, features, and functionality, is owned by TryPost and+ is protected by international copyright, trademark, and other intellectual property laws. Our+ trademarks may not be used without prior written consent.+ </p>++ <h2>9. Disclaimer of Warranties</h2>+ <p>+ THE SERVICE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS+ OR IMPLIED. WE DO NOT WARRANT THAT THE SERVICE WILL BE UNINTERRUPTED, SECURE, OR ERROR-FREE.+ </p>+ <p>+ We do not guarantee that posts will be published successfully, as this depends on third-party+ platform availability and their API functionality.+ </p>++ <h2>10. Limitation of Liability</h2>+ <p>+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, TRYPOST SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL,+ SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, DATA,+ OR BUSINESS OPPORTUNITIES, ARISING FROM YOUR USE OF THE SERVICE.+ </p>+ <p>+ Our total liability for any claims arising from these Terms or your use of the Service shall not+ exceed the amount you paid us in the twelve (12) months preceding the claim.+ </p>++ <h2>11. Indemnification</h2>+ <p>+ You agree to indemnify and hold harmless TryPost, its officers, directors, employees, and agents+ from any claims, damages, losses, or expenses (including reasonable attorney fees) arising from+ your use of the Service or violation of these Terms.+ </p>++ <h2>12. Termination</h2>+ <p>+ We may terminate or suspend your account immediately, without prior notice, for any breach of+ these Terms. Upon termination, your right to use the Service will cease immediately.+ </p>+ <p>+ You may terminate your account at any time by contacting us or through your account settings.+ Upon termination, we will delete your data in accordance with our Privacy Policy.+ </p>++ <h2>13. Changes to Terms</h2>+ <p>+ We reserve the right to modify these Terms at any time. We will notify you of significant changes+ by posting the new Terms on this page and updating the "Last updated" date. Your continued use+ of the Service after changes constitute acceptance of the new Terms.+ </p>++ <h2>14. Governing Law</h2>+ <p>+ These Terms shall be governed by and construed in accordance with applicable laws, without regard+ to conflict of law principles.+ </p>++ <h2>15. Dispute Resolution</h2>+ <p>+ Any disputes arising from these Terms or your use of the Service shall first be attempted to be+ resolved through good faith negotiation. If negotiation fails, disputes shall be resolved through+ binding arbitration or in the courts of competent jurisdiction.+ </p>++ <h2>16. Severability</h2>+ <p>+ If any provision of these Terms is found to be unenforceable, the remaining provisions will+ continue in full force and effect.+ </p>++ <h2>17. Contact Information</h2>+ <p>For questions about these Terms, please contact us at:</p>+ <p>+ <strong>Email:</strong> [email protected]<br />+ <strong>Website:</strong> https://trypost.com+ </p>+ </div>+ </GuestLayout>+</template>diff --git a/resources/js/pages/posts/Calendar.vue b/resources/js/pages/posts/Calendar.vueindex 21441f06f..2cd4cd3a0 100644--- a/resources/js/pages/posts/Calendar.vue+++ b/resources/js/pages/posts/Calendar.vue@@ -1,11 +1,11 @@<script setup lang="ts">import { Head, Link, router } from '@inertiajs/vue3';-import { computed, ref } from 'vue';+import { computed } from 'vue';import { ChevronLeft, ChevronRight, Plus } from 'lucide-vue-next';+import dayjs from '@/dayjs';import AppLayout from '@/layouts/AppLayout.vue';import { Button } from '@/components/ui/button';-import { Card, CardContent } from '@/components/ui/card';import { type BreadcrumbItemType } from '@/types';interface PostPlatform {@@ -27,224 +27,213 @@ interface Post {post_platforms: PostPlatform[];}-interface SocialAccount {- id: string;- platform: string;- display_name: string;-}-interface Workspace {id: string;name: string;+ timezone: string;}interface Props {workspace: Workspace;posts: Record<string, Post[]>;- socialAccounts: SocialAccount[];- currentMonth: number;- currentYear: number;+ currentWeekStart: string;}const props = defineProps<Props>();const breadcrumbs: BreadcrumbItemType[] = [- {- title: 'Workspaces',- href: '/workspaces',- },- {- title: props.workspace.name,- href: `/workspaces/${props.workspace.id}`,- },- {- title: 'Calendário',- href: `/workspaces/${props.workspace.id}/calendar`,- },-];--const monthNames = [- 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',- 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'+ { title: 'Workspaces', href: '/workspaces' },+ { title: props.workspace.name, href: `/workspaces/${props.workspace.id}` },+ { title: 'Calendar', href: `/workspaces/${props.workspace.id}/calendar` },];-const dayNames = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'];+const weekStart = computed(() => dayjs(props.currentWeekStart));-const currentDate = computed(() => new Date(props.currentYear, props.currentMonth - 1, 1));--const daysInMonth = computed(() => {- return new Date(props.currentYear, props.currentMonth, 0).getDate();-});--const firstDayOfMonth = computed(() => {- return new Date(props.currentYear, props.currentMonth - 1, 1).getDay();+const weekDays = computed(() => {+ const days = [];+ for (let i = 0; i < 7; i++) {+ days.push(weekStart.value.add(i, 'day'));+ }+ return days;});-const calendarDays = computed(() => {- const days: (number | null)[] = [];+const headerTitle = computed(() => {+ const start = weekStart.value;+ const end = weekStart.value.add(6, 'day');- for (let i = 0; i < firstDayOfMonth.value; i++) {- days.push(null);+ if (start.month() === end.month()) {+ return `${start.format('MMMM D')} - ${end.format('D, YYYY')}`;}-- for (let i = 1; i <= daysInMonth.value; i++) {- days.push(i);- }-- return days;+ return `${start.format('MMM D')} - ${end.format('MMM D, YYYY')}`;});-const getPostsForDay = (day: number): Post[] => {- const dateKey = `${props.currentYear}-${String(props.currentMonth).padStart(2, '0')}-${String(day).padStart(2, '0')}`;+const getPostsForDay = (day: dayjs.Dayjs): Post[] => {+ const dateKey = day.format('YYYY-MM-DD');return props.posts[dateKey] || [];};-const navigateMonth = (direction: number) => {- let newMonth = props.currentMonth + direction;- let newYear = props.currentYear;-- if (newMonth > 12) {- newMonth = 1;- newYear++;- } else if (newMonth < 1) {- newMonth = 12;- newYear--;- }-+const navigateWeek = (direction: number) => {+ const newStart = weekStart.value.add(direction * 7, 'day');router.get(`/workspaces/${props.workspace.id}/calendar`, {- month: newMonth,- year: newYear,+ week: newStart.format('YYYY-MM-DD'),}, {preserveState: true,});};+const goToToday = () => {+ router.get(`/workspaces/${props.workspace.id}/calendar`, {}, {+ preserveState: true,+ });+};++const isToday = (day: dayjs.Dayjs): boolean => {+ return day.isSame(dayjs(), 'day');+};+const getStatusColor = (status: string): string => {const colors: Record<string, string> = {- draft: 'bg-gray-400',- scheduled: 'bg-blue-500',- publishing: 'bg-yellow-500',- published: 'bg-green-500',- failed: 'bg-red-500',+ draft: 'bg-gray-100 border-gray-300 text-gray-700',+ scheduled: 'bg-blue-50 border-blue-300 text-blue-700',+ publishing: 'bg-yellow-50 border-yellow-300 text-yellow-700',+ published: 'bg-green-50 border-green-300 text-green-700',+ partially_published: 'bg-orange-50 border-orange-300 text-orange-700',+ failed: 'bg-red-50 border-red-300 text-red-700',};- return colors[status] || 'bg-gray-400';+ return colors[status] || 'bg-gray-100 border-gray-300 text-gray-700';};-const getPlatformEmoji = (platform: string): string => {- const emojis: Record<string, string> = {- linkedin: '💼',- twitter: '𝕏',- tiktok: '🎵',+const getPlatformLogo = (platform: string): string => {+ const logos: Record<string, string> = {+ 'linkedin': '/images/accounts/linkedin.png',+ 'linkedin-page': '/images/accounts/linkedin.png',+ 'x': '/images/accounts/x.png',+ 'tiktok': '/images/accounts/tiktok.png',+ 'youtube': '/images/accounts/youtube.png',+ 'facebook': '/images/accounts/facebook.png',+ 'instagram': '/images/accounts/instagram.png',+ 'threads': '/images/accounts/threads.png',};- return emojis[platform] || '🌐';+ return logos[platform] || '/images/accounts/default.png';+};++const getPostUrl = (post: Post): string => {+ const base = `/workspaces/${props.workspace.id}/posts/${post.id}`;+ return post.status === 'draft' || post.status === 'scheduled' ? `${base}/edit` : base;};-const isToday = (day: number): boolean => {- const today = new Date();- return (- day === today.getDate() &&- props.currentMonth === today.getMonth() + 1 &&- props.currentYear === today.getFullYear()- );+const formatTime = (scheduledAt: string): string => {+ return dayjs.utc(scheduledAt).tz(props.workspace.timezone).format('h:mm A');};</script><template>- <Head title="Calendário" />+ <Head title="Calendar" /><AppLayout :breadcrumbs="breadcrumbs">- <div class="flex flex-col gap-4 p-6">- <div class="flex items-center justify-between">- <div>- <h1 class="text-2xl font-bold tracking-tight">Calendário</h1>- <p class="text-muted-foreground">- Visualize e agende seus posts- </p>+ <div class="flex flex-col h-full">+ <!-- Header -->+ <div class="flex items-center justify-between p-4 border-b">+ <div class="flex items-center gap-4">+ <div class="flex items-center gap-1">+ <Button variant="outline" size="icon" @click="navigateWeek(-1)">+ <ChevronLeft class="h-4 w-4" />+ </Button>+ <Button variant="outline" size="icon" @click="navigateWeek(1)">+ <ChevronRight class="h-4 w-4" />+ </Button>+ </div>+ <Button variant="outline" size="sm" @click="goToToday">+ Today+ </Button>+ <h1 class="text-lg font-semibold">+ {{ headerTitle }}+ </h1></div><Link :href="`/workspaces/${workspace.id}/posts/create`"><Button><Plus class="mr-2 h-4 w-4" />- Novo Post+ New Post</Button></Link></div>- <Card>- <CardContent class="p-4">- <div class="flex items-center justify-between mb-4">- <Button variant="outline" size="icon" @click="navigateMonth(-1)">- <ChevronLeft class="h-4 w-4" />- </Button>- <h2 class="text-lg font-semibold">- {{ monthNames[currentMonth - 1] }} {{ currentYear }}- </h2>- <Button variant="outline" size="icon" @click="navigateMonth(1)">- <ChevronRight class="h-4 w-4" />- </Button>+ <!-- Week Grid -->+ <div class="flex-1 grid grid-cols-7 divide-x overflow-hidden">+ <div+ v-for="day in weekDays"+ :key="day.format('YYYY-MM-DD')"+ class="flex flex-col min-h-0"+ :class="{ 'bg-primary/5': isToday(day) }"+ >+ <!-- Day Header -->+ <div class="flex flex-col items-center py-3 border-b bg-muted/30">+ <span class="text-xs font-medium text-muted-foreground uppercase">+ {{ day.format('ddd') }}+ </span>+ <span+ class="mt-1 flex items-center justify-center w-8 h-8 text-sm font-semibold rounded-full"+ :class="{+ 'bg-primary text-primary-foreground': isToday(day),+ 'text-foreground': !isToday(day),+ }"+ >+ {{ day.format('D') }}+ </span></div>- <div class="grid grid-cols-7 gap-px bg-muted rounded-lg overflow-hidden">- <div- v-for="dayName in dayNames"- :key="dayName"- class="bg-background p-2 text-center text-sm font-medium text-muted-foreground"+ <!-- Day Content -->+ <div class="flex-1 overflow-y-auto p-2 space-y-2">+ <!-- Add Post Button -->+ <Link+ :href="`/workspaces/${workspace.id}/posts/create?date=${day.format('YYYY-MM-DD')}`"+ class="flex items-center justify-center p-2 rounded border border-dashed border-muted-foreground/30 text-muted-foreground hover:border-primary hover:text-primary hover:bg-primary/5 transition-colors">- {{ dayName }}- </div>-- <div- v-for="(day, index) in calendarDays"- :key="index"- class="bg-background min-h-[100px] p-1"- :class="{ 'opacity-50': !day }"+ <Plus class="h-4 w-4" />+ </Link>++ <!-- Posts -->+ <Link+ v-for="post in getPostsForDay(day)"+ :key="post.id"+ :href="getPostUrl(post)"+ class="block">- <div v-if="day" class="h-full">- <div class="flex items-center justify-between mb-1">+ <div+ class="p-2 rounded border text-sm transition-all hover:ring-2 hover:ring-primary hover:ring-offset-1"+ :class="getStatusColor(post.status)"+ >+ <!-- Time -->+ <div class="text-xs font-medium mb-1">+ {{ formatTime(post.scheduled_at) }}+ </div>++ <!-- Platforms -->+ <div class="flex -space-x-1 mb-1.5">+ <img+ v-for="pp in post.post_platforms.slice(0, 4)"+ :key="pp.id"+ :src="getPlatformLogo(pp.platform)"+ :alt="pp.platform"+ class="h-5 w-5 rounded-full ring-2 ring-white"+ /><span- class="text-sm font-medium"- :class="{- 'bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center': isToday(day)- }"+ v-if="post.post_platforms.length > 4"+ class="flex items-center justify-center h-5 w-5 rounded-full bg-muted text-[10px] font-medium ring-2 ring-white">- {{ day }}+ +{{ post.post_platforms.length - 4 }}</span>- <Link- :href="`/workspaces/${workspace.id}/posts/create?date=${currentYear}-${String(currentMonth).padStart(2, '0')}-${String(day).padStart(2, '0')}`"- class="opacity-0 hover:opacity-100 transition-opacity"- >- <Button variant="ghost" size="icon" class="h-6 w-6">- <Plus class="h-3 w-3" />- </Button>- </Link></div>- <div class="space-y-1">- <Link- v-for="post in getPostsForDay(day)"- :key="post.id"- :href="`/workspaces/${workspace.id}/posts/${post.id}`"- class="block"- >- <div- class="text-xs p-1 rounded truncate hover:bg-accent transition-colors"- :class="getStatusColor(post.status)"- >- <span class="text-white flex items-center gap-1">- <span v-for="pp in post.post_platforms" :key="pp.id">- {{ getPlatformEmoji(pp.platform) }}- </span>- <span class="truncate">- {{ post.post_platforms[0]?.content?.substring(0, 20) || 'Sem conteúdo' }}- </span>- </span>- </div>- </Link>- </div>+ <!-- Content Preview -->+ <p class="text-xs line-clamp-2 opacity-80">+ {{ post.post_platforms[0]?.content || 'No content' }}+ </p></div>- </div>+ </Link></div>- </CardContent>- </Card>+ </div>+ </div></div></AppLayout></template>diff --git a/resources/js/pages/posts/Create.vue b/resources/js/pages/posts/Create.vuedeleted file mode 100644index 7c8827765..000000000--- a/resources/js/pages/posts/Create.vue+++ /dev/null@@ -1,416 +0,0 @@-<script setup lang="ts">-import { Head, useForm } from '@inertiajs/vue3';-import { computed, ref, watch } from 'vue';-import { Calendar, Clock, Image, Video, FileText, X } from 'lucide-vue-next';--import AppLayout from '@/layouts/AppLayout.vue';-import { Button } from '@/components/ui/button';-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';-import { Checkbox } from '@/components/ui/checkbox';-import { Label } from '@/components/ui/label';-import { Input } from '@/components/ui/input';-import { type BreadcrumbItemType } from '@/types';--interface SocialAccount {- id: string;- platform: string;- display_name: string;- username: string;-}--interface Workspace {- id: string;- name: string;-}--interface Props {- workspace: Workspace;- socialAccounts: SocialAccount[];- scheduledDate?: string;-}--const props = defineProps<Props>();--const breadcrumbs: BreadcrumbItemType[] = [- {- title: 'Workspaces',- href: '/workspaces',- },- {- title: props.workspace.name,- href: `/workspaces/${props.workspace.id}`,- },- {- title: 'Calendário',- href: `/workspaces/${props.workspace.id}/calendar`,- },- {- title: 'Novo Post',- href: `/workspaces/${props.workspace.id}/posts/create`,- },-];--interface PlatformContent {- social_account_id: string;- platform: string;- content: string;- media_ids: string[];-}--const selectedPlatforms = ref<string[]>([]);-const platformContents = ref<Record<string, PlatformContent>>({});-const globalContent = ref('');-const useGlobalContent = ref(true);-const uploadedMedia = ref<Array<{ id: string; url: string; type: string; original_filename: string }>>([]);-const isUploading = ref(false);--const form = useForm({- status: 'scheduled',- scheduled_at: props.scheduledDate ? `${props.scheduledDate}T09:00` : '',- platforms: [] as PlatformContent[],-});--watch(selectedPlatforms, (newVal) => {- newVal.forEach(accountId => {- const account = props.socialAccounts.find(a => a.id === accountId);- if (account && !platformContents.value[accountId]) {- platformContents.value[accountId] = {- social_account_id: accountId,- platform: account.platform,- content: '',- media_ids: [],- };- }- });-- Object.keys(platformContents.value).forEach(accountId => {- if (!newVal.includes(accountId)) {- delete platformContents.value[accountId];- }- });-});--watch(globalContent, (newVal) => {- if (useGlobalContent.value) {- Object.keys(platformContents.value).forEach(accountId => {- platformContents.value[accountId].content = newVal;- });- }-});--const getPlatformEmoji = (platform: string): string => {- const emojis: Record<string, string> = {- linkedin: '💼',- twitter: '𝕏',- tiktok: '🎵',- };- return emojis[platform] || '🌐';-};--const getPlatformLabel = (platform: string): string => {- const labels: Record<string, string> = {- linkedin: 'LinkedIn',- twitter: 'X (Twitter)',- tiktok: 'TikTok',- };- return labels[platform] || platform;-};--const getCharLimit = (platform: string): number => {- const limits: Record<string, number> = {- linkedin: 3000,- twitter: 280,- tiktok: 2200,- };- return limits[platform] || 5000;-};--const handleFileUpload = async (event: Event) => {- const input = event.target as HTMLInputElement;- const files = input.files;-- if (!files || files.length === 0) return;-- isUploading.value = true;-- for (const file of Array.from(files)) {- const formData = new FormData();- formData.append('file', file);-- try {- const response = await fetch('/media', {- method: 'POST',- body: formData,- headers: {- 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',- },- });-- const data = await response.json();- uploadedMedia.value.push(data);- } catch (error) {- console.error('Upload failed:', error);- }- }-- isUploading.value = false;- input.value = '';-};--const removeMedia = (mediaId: string) => {- uploadedMedia.value = uploadedMedia.value.filter(m => m.id !== mediaId);-- fetch(`/media/${mediaId}`, {- method: 'DELETE',- headers: {- 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',- },- });-};--const submit = () => {- const platforms = Object.values(platformContents.value).map(pc => ({- ...pc,- media_ids: uploadedMedia.value.map(m => m.id),- }));-- form.platforms = platforms;- form.post(`/workspaces/${props.workspace.id}/posts`);-};--const canSubmit = computed(() => {- return selectedPlatforms.value.length > 0 &&- form.scheduled_at &&- Object.values(platformContents.value).some(pc => pc.content.trim() !== '');-});-</script>--<template>- <Head title="Novo Post" />-- <AppLayout :breadcrumbs="breadcrumbs">- <div class="flex flex-col gap-6 p-6">- <div>- <h1 class="text-2xl font-bold tracking-tight">Criar Post</h1>- <p class="text-muted-foreground">- Agende um novo post para suas redes sociais- </p>- </div>-- <div class="grid gap-6 lg:grid-cols-3">- <div class="lg:col-span-2 space-y-6">- <Card>- <CardHeader>- <CardTitle>Selecione as Redes Sociais</CardTitle>- <CardDescription>- Escolha onde você quer publicar- </CardDescription>- </CardHeader>- <CardContent>- <div class="flex flex-wrap gap-4">- <div- v-for="account in socialAccounts"- :key="account.id"- class="flex items-center gap-2"- >- <Checkbox- :id="account.id"- :checked="selectedPlatforms.includes(account.id)"- @update:checked="(checked) => {- if (checked) {- selectedPlatforms.push(account.id);- } else {- selectedPlatforms = selectedPlatforms.filter(id => id !== account.id);- }- }"- />- <Label :for="account.id" class="flex items-center gap-2 cursor-pointer">- <span>{{ getPlatformEmoji(account.platform) }}</span>- <span>{{ account.display_name || account.username }}</span>- </Label>- </div>- </div>- </CardContent>- </Card>-- <Card v-if="selectedPlatforms.length > 0">- <CardHeader>- <CardTitle>Conteúdo</CardTitle>- <CardDescription>- Escreva o conteúdo do seu post- </CardDescription>- </CardHeader>- <CardContent class="space-y-4">- <div v-if="selectedPlatforms.length > 1" class="flex items-center gap-2">- <Checkbox- id="use-global"- v-model:checked="useGlobalContent"- />- <Label for="use-global">- Usar o mesmo conteúdo para todas as redes- </Label>- </div>-- <div v-if="useGlobalContent && selectedPlatforms.length > 0" class="space-y-2">- <Label>Conteúdo</Label>- <textarea- v-model="globalContent"- class="w-full min-h-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"- placeholder="O que você quer compartilhar?"- />- </div>-- <div v-else class="space-y-4">- <div- v-for="accountId in selectedPlatforms"- :key="accountId"- class="space-y-2"- >- <div class="flex items-center justify-between">- <Label class="flex items-center gap-2">- <span>{{ getPlatformEmoji(platformContents[accountId]?.platform) }}</span>- {{ getPlatformLabel(platformContents[accountId]?.platform) }}- </Label>- <span class="text-xs text-muted-foreground">- {{ platformContents[accountId]?.content.length || 0 }} /- {{ getCharLimit(platformContents[accountId]?.platform) }}- </span>- </div>- <textarea- v-model="platformContents[accountId].content"- class="w-full min-h-[100px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"- :placeholder="`Conteúdo para ${getPlatformLabel(platformContents[accountId]?.platform)}`"- />- </div>- </div>- </CardContent>- </Card>-- <Card v-if="selectedPlatforms.length > 0">- <CardHeader>- <CardTitle>Mídia</CardTitle>- <CardDescription>- Adicione imagens ou vídeos ao seu post- </CardDescription>- </CardHeader>- <CardContent>- <div class="space-y-4">- <div class="flex flex-wrap gap-4">- <div- v-for="media in uploadedMedia"- :key="media.id"- class="relative group"- >- <div class="w-24 h-24 rounded-lg overflow-hidden border">- <img- v-if="media.type === 'image'"- :src="media.url"- :alt="media.original_filename"- class="w-full h-full object-cover"- />- <div- v-else- class="w-full h-full flex items-center justify-center bg-muted"- >- <Video class="h-8 w-8 text-muted-foreground" />- </div>- </div>- <button- type="button"- @click="removeMedia(media.id)"- class="absolute -top-2 -right-2 bg-destructive text-destructive-foreground rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity"- >- <X class="h-3 w-3" />- </button>- </div>-- <label class="w-24 h-24 rounded-lg border-2 border-dashed flex items-center justify-center cursor-pointer hover:bg-accent transition-colors">- <input- type="file"- accept="image/*,video/*"- multiple- class="hidden"- @change="handleFileUpload"- :disabled="isUploading"- />- <div class="text-center">- <Image class="h-6 w-6 mx-auto text-muted-foreground" />- <span class="text-xs text-muted-foreground">- {{ isUploading ? 'Enviando...' : 'Adicionar' }}- </span>- </div>- </label>- </div>- </div>- </CardContent>- </Card>- </div>-- <div class="space-y-6">- <Card>- <CardHeader>- <CardTitle>Agendamento</CardTitle>- <CardDescription>- Quando você quer publicar?- </CardDescription>- </CardHeader>- <CardContent class="space-y-4">- <div class="space-y-2">- <Label for="scheduled_at">Data e Hora</Label>- <Input- id="scheduled_at"- type="datetime-local"- v-model="form.scheduled_at"- />- <p v-if="form.errors.scheduled_at" class="text-sm text-destructive">- {{ form.errors.scheduled_at }}- </p>- </div>-- <div class="pt-4 space-y-2">- <Button- type="button"- class="w-full"- :disabled="!canSubmit || form.processing"- @click="submit"- >- <Clock class="mr-2 h-4 w-4" />- {{ form.processing ? 'Agendando...' : 'Agendar Post' }}- </Button>-- <Button- type="button"- variant="outline"- class="w-full"- :disabled="selectedPlatforms.length === 0 || form.processing"- @click="() => { form.status = 'draft'; submit(); }"- >- <FileText class="mr-2 h-4 w-4" />- Salvar como Rascunho- </Button>- </div>- </CardContent>- </Card>-- <Card v-if="selectedPlatforms.length > 0">- <CardHeader>- <CardTitle>Resumo</CardTitle>- </CardHeader>- <CardContent>- <div class="space-y-2 text-sm">- <div class="flex justify-between">- <span class="text-muted-foreground">Redes selecionadas</span>- <span>{{ selectedPlatforms.length }}</span>- </div>- <div class="flex justify-between">- <span class="text-muted-foreground">Mídias anexadas</span>- <span>{{ uploadedMedia.length }}</span>- </div>- </div>- </CardContent>- </Card>- </div>- </div>- </div>- </AppLayout>-</template>diff --git a/resources/js/pages/posts/Edit.vue b/resources/js/pages/posts/Edit.vuenew file mode 100644index 000000000..c9e20525b--- /dev/null+++ b/resources/js/pages/posts/Edit.vue@@ -0,0 +1,620 @@+<script setup lang="ts">+import { Head, router } from '@inertiajs/vue3';+import { computed, ref } from 'vue';+import { Clock, Image, Video, X, FileText, AlertCircle, Check, Trash2, Send } from 'lucide-vue-next';+import dayjs from '@/dayjs';++import AppLayout from '@/layouts/AppLayout.vue';+import { Button } from '@/components/ui/button';+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';+import { Label } from '@/components/ui/label';+import { Input } from '@/components/ui/input';+import { Switch } from '@/components/ui/switch';+import { Alert, AlertDescription } from '@/components/ui/alert';+import DatePicker from '@/components/DatePicker.vue';+import ConfirmDeleteModal from '@/components/ConfirmDeleteModal.vue';+import { type BreadcrumbItemType } from '@/types';++interface SocialAccount {+ id: string;+ platform: string;+ display_name: string;+ username: string;+ avatar_url: string | null;+}++interface MediaItem {+ id: string;+ url: string;+ type: string;+ original_filename: string;+}++interface PostPlatform {+ id: string;+ social_account_id: string;+ enabled: boolean;+ platform: string;+ content: string;+ status: string;+ social_account: SocialAccount;+ media: MediaItem[];+}++interface Post {+ id: string;+ status: string;+ scheduled_at: string | null;+ post_platforms: PostPlatform[];+}++interface PlatformConfig {+ maxContentLength: number;+ maxImages: number;+ allowedMediaTypes: string[];+ supportsTextOnly: boolean;+}++interface Workspace {+ id: string;+ name: string;+ timezone: string;+}++interface Props {+ workspace: Workspace;+ post: Post;+ socialAccounts: SocialAccount[];+ platformConfigs: Record<string, PlatformConfig>;+}++const props = defineProps<Props>();++const breadcrumbs: BreadcrumbItemType[] = [+ { title: 'Workspaces', href: '/workspaces' },+ { title: props.workspace.name, href: `/workspaces/${props.workspace.id}` },+ { title: 'Calendar', href: `/workspaces/${props.workspace.id}/calendar` },+ { title: 'Edit Post', href: '#' },+];++// State+const selectedPlatformIds = ref<string[]>(+ props.post.post_platforms.filter(pp => pp.enabled).map(pp => pp.id)+);+const useGlobalContent = ref(true);+const enabledPlatforms = props.post.post_platforms.filter(pp => pp.enabled);+const globalContent = ref(+ enabledPlatforms[0]?.content || props.post.post_platforms[0]?.content || ''+);+const platformContents = ref<Record<string, string>>(+ Object.fromEntries(props.post.post_platforms.map(pp => [pp.id, pp.content]))+);+const platformMedia = ref<Record<string, MediaItem[]>>(+ Object.fromEntries(props.post.post_platforms.map(pp => [pp.id, pp.media || []]))+);+const isUploading = ref<Record<string, boolean>>({});+const isSubmitting = ref(false);+const deleteModal = ref<InstanceType<typeof ConfirmDeleteModal> | null>(null);++// Convert UTC to workspace timezone for display+const getLocalSchedule = () => {+ if (!props.post.scheduled_at) {+ return { date: '', time: '09:00' };+ }+ const local = dayjs.utc(props.post.scheduled_at).tz(props.workspace.timezone);+ return {+ date: local.format('YYYY-MM-DD'),+ time: local.format('HH:mm'),+ };+};++const { date: initialDate, time: initialTime } = getLocalSchedule();+const scheduledDate = ref(initialDate);+const scheduledTime = ref(initialTime);++// Helpers+const getPlatformLogo = (platform: string): string => {+ const logos: Record<string, string> = {+ 'linkedin': '/images/accounts/linkedin.png',+ 'linkedin-page': '/images/accounts/linkedin.png',+ 'x': '/images/accounts/x.png',+ 'tiktok': '/images/accounts/tiktok.png',+ 'youtube': '/images/accounts/youtube.png',+ 'facebook': '/images/accounts/facebook.png',+ 'instagram': '/images/accounts/instagram.png',+ 'threads': '/images/accounts/threads.png',+ };+ return logos[platform] || '/images/accounts/default.png';+};++const getPlatformLabel = (platform: string): string => {+ const labels: Record<string, string> = {+ 'linkedin': 'LinkedIn',+ 'linkedin-page': 'LinkedIn Page',+ 'x': 'X',+ 'tiktok': 'TikTok',+ 'youtube': 'YouTube Shorts',+ 'facebook': 'Facebook Page',+ 'instagram': 'Instagram',+ 'threads': 'Threads',+ };+ return labels[platform] || platform;+};++const getConfig = (postPlatform: PostPlatform): PlatformConfig => {+ return props.platformConfigs[postPlatform.social_account_id] || {+ maxContentLength: 5000,+ maxImages: 10,+ allowedMediaTypes: ['image', 'video'],+ supportsTextOnly: true,+ };+};++// Computed+const contentValidation = computed(() => {+ const results: Record<string, { valid: boolean; message: string }> = {};++ for (const pp of props.post.post_platforms) {+ if (!selectedPlatformIds.value.includes(pp.id)) continue;++ const config = getConfig(pp);+ const content = useGlobalContent.value+ ? globalContent.value+ : (platformContents.value[pp.id] || '');++ const charCount = content.length;+ const hasContent = charCount > 0;+ const withinLimit = charCount <= config.maxContentLength;+ const media = platformMedia.value[pp.id] || [];+ const hasMedia = media.length > 0;++ if (!config.supportsTextOnly && !hasMedia) {+ results[pp.id] = { valid: false, message: 'Requires media' };+ } else if (!hasContent && !hasMedia) {+ results[pp.id] = { valid: false, message: 'No content' };+ } else if (!withinLimit) {+ results[pp.id] = { valid: false, message: `${charCount - config.maxContentLength} exceeded` };+ } else {+ results[pp.id] = { valid: true, message: `${charCount}/${config.maxContentLength}` };+ }+ }++ return results;+});++const mediaValidation = computed(() => {+ const errors: string[] = [];++ for (const pp of props.post.post_platforms) {+ if (!selectedPlatformIds.value.includes(pp.id)) continue;++ const config = getConfig(pp);+ const media = platformMedia.value[pp.id] || [];+ const imageCount = media.filter(m => m.type === 'image').length;+ const videoCount = media.filter(m => m.type === 'video').length;++ if (config.maxImages === 0 && imageCount > 0) {+ errors.push(`${getPlatformLabel(pp.platform)} does not support images`);+ }++ if (imageCount > config.maxImages && config.maxImages > 0) {+ errors.push(`${getPlatformLabel(pp.platform)} supports up to ${config.maxImages} images`);+ }++ if (!config.allowedMediaTypes.includes('video') && videoCount > 0) {+ errors.push(`${getPlatformLabel(pp.platform)} does not support videos`);+ }+ }++ return [...new Set(errors)];+});++const canSubmit = computed(() => {+ if (selectedPlatformIds.value.length === 0) return false;+ if (!scheduledDate.value) return false;++ const selectedValidations = Object.entries(contentValidation.value)+ .filter(([id]) => selectedPlatformIds.value.includes(id));++ return selectedValidations.every(([, v]) => v.valid) && mediaValidation.value.length === 0;+});++// Methods+const togglePlatform = (platformId: string) => {+ const index = selectedPlatformIds.value.indexOf(platformId);+ if (index === -1) {+ selectedPlatformIds.value.push(platformId);+ } else {+ selectedPlatformIds.value.splice(index, 1);+ }+};++const handleFileUpload = async (event: Event, postPlatformId: string) => {+ const input = event.target as HTMLInputElement;+ const files = input.files;++ if (!files || files.length === 0) return;++ isUploading.value[postPlatformId] = true;++ for (const file of Array.from(files)) {+ const formData = new FormData();+ formData.append('file', file);+ formData.append('post_platform_id', postPlatformId);++ try {+ const response = await fetch('/media', {+ method: 'POST',+ body: formData,+ headers: {+ 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',+ },+ });++ if (response.ok) {+ const data = await response.json();+ if (!platformMedia.value[postPlatformId]) {+ platformMedia.value[postPlatformId] = [];+ }+ platformMedia.value[postPlatformId].push(data);+ }+ } catch (error) {+ console.error('Upload failed:', error);+ }+ }++ isUploading.value[postPlatformId] = false;+ input.value = '';+};++const removeMedia = async (postPlatformId: string, mediaId: string) => {+ platformMedia.value[postPlatformId] = platformMedia.value[postPlatformId].filter(m => m.id !== mediaId);++ await fetch(`/media/${mediaId}`, {+ method: 'DELETE',+ headers: {+ 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',+ },+ });+};++const submit = (status: string = 'scheduled') => {+ if (isSubmitting.value) return;++ const platforms = props.post.post_platforms+ .filter(pp => selectedPlatformIds.value.includes(pp.id))+ .map(pp => ({+ id: pp.id,+ content: useGlobalContent.value ? globalContent.value : platformContents.value[pp.id],+ }));++ // Combine date and time into ISO format+ const scheduled_at = scheduledDate.value+ ? `${scheduledDate.value}T${scheduledTime.value}:00`+ : null;++ isSubmitting.value = true;++ router.put(`/workspaces/${props.workspace.id}/posts/${props.post.id}`, {+ status,+ scheduled_at,+ platforms,+ }, {+ onFinish: () => {+ isSubmitting.value = false;+ },+ });+};++const deletePost = () => {+ deleteModal.value?.open({+ url: `/workspaces/${props.workspace.id}/posts/${props.post.id}`,+ });+};+</script>++<template>+ <Head title="Edit Post" />++ <AppLayout :breadcrumbs="breadcrumbs">+ <div class="flex flex-col gap-6 p-6">+ <div class="flex items-center justify-between">+ <div>+ <h1 class="text-2xl font-bold tracking-tight">Edit Post</h1>+ <p class="text-muted-foreground">+ Configure and schedule your post+ </p>+ </div>+ <Button variant="ghost" size="sm" @click="deletePost" class="text-destructive hover:text-destructive">+ <Trash2 class="h-4 w-4 mr-2" />+ Delete+ </Button>+ </div>++ <div class="grid gap-6 lg:grid-cols-3">+ <!-- Main Content -->+ <div class="lg:col-span-2 space-y-6">+ <!-- Platform Selection -->+ <Card>+ <CardHeader>+ <CardTitle>Social Networks</CardTitle>+ <CardDescription>+ Select where you want to publish+ </CardDescription>+ </CardHeader>+ <CardContent>+ <div class="grid gap-3 sm:grid-cols-2">+ <button+ v-for="pp in post.post_platforms"+ :key="pp.id"+ type="button"+ @click="togglePlatform(pp.id)"+ class="flex items-center gap-3 p-3 rounded-lg border text-left transition-all hover:border-primary"+ :class="selectedPlatformIds.includes(pp.id) ? 'border-primary bg-primary/5 ring-1 ring-primary' : ''"+ >+ <div class="relative shrink-0">+ <img+ v-if="pp.social_account.avatar_url"+ :src="pp.social_account.avatar_url"+ :alt="pp.social_account.display_name"+ class="h-10 w-10 rounded-full object-cover"+ />+ <div v-else class="h-10 w-10 rounded-full bg-muted flex items-center justify-center">+ <span class="text-sm font-medium">{{ pp.social_account.display_name?.charAt(0) }}</span>+ </div>+ <img+ :src="getPlatformLogo(pp.platform)"+ :alt="pp.platform"+ class="absolute -bottom-1 -right-1 h-5 w-5 rounded-full ring-2 ring-background"+ />+ </div>+ <div class="flex-1 min-w-0">+ <p class="font-medium text-sm truncate">{{ pp.social_account.display_name }}</p>+ <p class="text-xs text-muted-foreground">{{ getPlatformLabel(pp.platform) }}</p>+ </div>+ <div+ class="shrink-0 h-5 w-5 rounded-full border-2 flex items-center justify-center transition-colors"+ :class="selectedPlatformIds.includes(pp.id) ? 'border-primary bg-primary text-primary-foreground' : 'border-muted-foreground/30'"+ >+ <Check v-if="selectedPlatformIds.includes(pp.id)" class="h-3 w-3" />+ </div>+ </button>+ </div>+ </CardContent>+ </Card>++ <!-- Content Editor -->+ <Card v-if="selectedPlatformIds.length > 0">+ <CardHeader>+ <div class="flex items-center justify-between">+ <div>+ <CardTitle>Content</CardTitle>+ <CardDescription>+ Write your post content+ </CardDescription>+ </div>+ <div v-if="selectedPlatformIds.length > 1" class="flex items-center gap-2">+ <Switch+ id="global-content"+ :checked="useGlobalContent"+ @update:checked="useGlobalContent = $event"+ />+ <Label for="global-content" class="text-sm cursor-pointer">+ Same content+ </Label>+ </div>+ </div>+ </CardHeader>+ <CardContent class="space-y-4">+ <!-- Global Content Mode -->+ <div v-if="useGlobalContent" class="space-y-3">+ <textarea+ v-model="globalContent"+ class="w-full min-h-[180px] rounded-lg border border-input bg-background px-4 py-3 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none"+ placeholder="What do you want to share?"+ />+ <div class="flex flex-wrap gap-2">+ <div+ v-for="pp in post.post_platforms.filter(p => selectedPlatformIds.includes(p.id))"+ :key="pp.id"+ class="flex items-center gap-1.5 px-2 py-1 rounded-md text-xs"+ :class="contentValidation[pp.id]?.valid ? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400' : 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400'"+ >+ <img :src="getPlatformLogo(pp.platform)" class="h-4 w-4" />+ <span>{{ contentValidation[pp.id]?.message }}</span>+ </div>+ </div>+ </div>++ <!-- Per-Platform Content Mode -->+ <div v-else class="space-y-4">+ <div+ v-for="pp in post.post_platforms.filter(p => selectedPlatformIds.includes(p.id))"+ :key="pp.id"+ class="space-y-2 p-4 rounded-lg border"+ >+ <div class="flex items-center justify-between">+ <div class="flex items-center gap-2">+ <img :src="getPlatformLogo(pp.platform)" class="h-5 w-5" />+ <span class="font-medium text-sm">{{ pp.social_account.display_name }}</span>+ </div>+ <span+ class="text-xs px-2 py-0.5 rounded"+ :class="contentValidation[pp.id]?.valid ? 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400' : 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400'"+ >+ {{ contentValidation[pp.id]?.message }}+ </span>+ </div>+ <textarea+ v-model="platformContents[pp.id]"+ class="w-full min-h-[120px] rounded-lg border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring resize-none"+ :placeholder="`Content for ${getPlatformLabel(pp.platform)}`"+ />+ </div>+ </div>+ </CardContent>+ </Card>++ <!-- Media Upload per Platform -->+ <Card v-for="pp in post.post_platforms.filter(p => selectedPlatformIds.includes(p.id))" :key="'media-' + pp.id">+ <CardHeader class="pb-3">+ <div class="flex items-center gap-2">+ <img :src="getPlatformLogo(pp.platform)" class="h-5 w-5" />+ <CardTitle class="text-base">Media - {{ pp.social_account.display_name }}</CardTitle>+ </div>+ </CardHeader>+ <CardContent>+ <div class="flex flex-wrap gap-3">+ <div+ v-for="media in platformMedia[pp.id]"+ :key="media.id"+ class="relative group"+ >+ <div class="w-20 h-20 rounded-lg overflow-hidden border bg-muted">+ <img+ v-if="media.type === 'image'"+ :src="media.url"+ :alt="media.original_filename"+ class="w-full h-full object-cover"+ />+ <div v-else class="w-full h-full flex items-center justify-center">+ <Video class="h-6 w-6 text-muted-foreground" />+ </div>+ </div>+ <button+ type="button"+ @click="removeMedia(pp.id, media.id)"+ class="absolute -top-2 -right-2 bg-destructive text-destructive-foreground rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity shadow-sm"+ >+ <X class="h-3 w-3" />+ </button>+ </div>++ <label class="w-20 h-20 rounded-lg border-2 border-dashed flex flex-col items-center justify-center cursor-pointer hover:bg-accent transition-colors">+ <input+ type="file"+ accept="image/*,video/*"+ multiple+ class="hidden"+ @change="(e) => handleFileUpload(e, pp.id)"+ :disabled="isUploading[pp.id]"+ />+ <Image class="h-5 w-5 text-muted-foreground" />+ <span class="text-xs text-muted-foreground mt-1">+ {{ isUploading[pp.id] ? '...' : 'Add' }}+ </span>+ </label>+ </div>+ </CardContent>+ </Card>++ <!-- Media Validation -->+ <Alert v-if="mediaValidation.length > 0" variant="destructive">+ <AlertCircle class="h-4 w-4" />+ <AlertDescription>+ <ul class="list-disc list-inside">+ <li v-for="error in mediaValidation" :key="error">{{ error }}</li>+ </ul>+ </AlertDescription>+ </Alert>+ </div>++ <!-- Sidebar -->+ <div class="space-y-6">+ <Card>+ <CardHeader>+ <CardTitle>Scheduling</CardTitle>+ </CardHeader>+ <CardContent class="space-y-4">+ <div class="space-y-2">+ <Label for="scheduled_date">Date</Label>+ <DatePicker+ name="scheduled_date"+ v-model="scheduledDate"+ />+ </div>++ <div class="space-y-2">+ <Label for="scheduled_time">Time</Label>+ <Input+ id="scheduled_time"+ type="time"+ v-model="scheduledTime"+ />+ </div>++ <div class="pt-4 space-y-2">+ <Button+ type="button"+ class="w-full"+ :disabled="!canSubmit || isSubmitting"+ @click="submit('scheduled')"+ >+ <Clock class="mr-2 h-4 w-4" />+ {{ isSubmitting ? 'Saving...' : 'Schedule Post' }}+ </Button>++ <Button+ type="button"+ variant="secondary"+ class="w-full"+ :disabled="!canSubmit || isSubmitting"+ @click="submit('publishing')"+ >+ <Send class="mr-2 h-4 w-4" />+ {{ isSubmitting ? 'Publishing...' : 'Publish Now' }}+ </Button>++ <Button+ type="button"+ variant="outline"+ class="w-full"+ :disabled="selectedPlatformIds.length === 0 || isSubmitting"+ @click="submit('draft')"+ >+ <FileText class="mr-2 h-4 w-4" />+ {{ isSubmitting ? 'Saving...' : 'Save Draft' }}+ </Button>+ </div>+ </CardContent>+ </Card>++ <Card v-if="selectedPlatformIds.length > 0">+ <CardHeader>+ <CardTitle>Summary</CardTitle>+ </CardHeader>+ <CardContent>+ <div class="space-y-3">+ <div class="flex justify-between text-sm">+ <span class="text-muted-foreground">Selected networks</span>+ <span class="font-medium">{{ selectedPlatformIds.length }}</span>+ </div>+ <div class="pt-2 border-t">+ <p class="text-xs text-muted-foreground mb-2">Publish to:</p>+ <div class="flex flex-wrap gap-1">+ <div+ v-for="pp in post.post_platforms.filter(p => selectedPlatformIds.includes(p.id))"+ :key="pp.id"+ class="flex items-center gap-1 px-2 py-1 bg-muted rounded text-xs"+ >+ <img :src="getPlatformLogo(pp.platform)" class="h-3 w-3" />+ {{ pp.social_account.display_name }}+ </div>+ </div>+ </div>+ </div>+ </CardContent>+ </Card>+ </div>+ </div>+ </div>+ </AppLayout>++ <ConfirmDeleteModal+ ref="deleteModal"+ title="Delete Post"+ description="Are you sure you want to delete this post? This action cannot be undone."+ action="Delete"+ cancel="Cancel"+ />+</template>diff --git a/resources/js/pages/posts/Show.vue b/resources/js/pages/posts/Show.vuenew file mode 100644index 000000000..12deef41a--- /dev/null+++ b/resources/js/pages/posts/Show.vue@@ -0,0 +1,287 @@+<script setup lang="ts">+import { Head, Link } from '@inertiajs/vue3';+import { Clock, CheckCircle, AlertCircle, Loader2, FileText, ExternalLink, Pencil } from 'lucide-vue-next';+import dayjs from '@/dayjs';++import AppLayout from '@/layouts/AppLayout.vue';+import { Button } from '@/components/ui/button';+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';+import { Badge } from '@/components/ui/badge';+import { type BreadcrumbItemType } from '@/types';++interface SocialAccount {+ id: string;+ platform: string;+ display_name: string;+ username: string;+ avatar_url: string | null;+}++interface MediaItem {+ id: string;+ url: string;+ type: string;+ original_filename: string;+}++interface PostPlatform {+ id: string;+ social_account_id: string;+ enabled: boolean;+ platform: string;+ content: string;+ status: string;+ platform_url: string | null;+ error_message: string | null;+ published_at: string | null;+ social_account: SocialAccount;+ media: MediaItem[];+}++interface User {+ id: string;+ name: string;+}++interface Post {+ id: string;+ status: string;+ scheduled_at: string | null;+ published_at: string | null;+ post_platforms: PostPlatform[];+ user: User;+}++interface Workspace {+ id: string;+ name: string;+ timezone: string;+}++interface Props {+ workspace: Workspace;+ post: Post;+}++const props = defineProps<Props>();++const breadcrumbs: BreadcrumbItemType[] = [+ { title: 'Workspaces', href: '/workspaces' },+ { title: props.workspace.name, href: `/workspaces/${props.workspace.id}` },+ { title: 'Calendar', href: `/workspaces/${props.workspace.id}/calendar` },+ { title: 'Post', href: '#' },+];++const getPlatformLogo = (platform: string): string => {+ const logos: Record<string, string> = {+ 'linkedin': '/images/accounts/linkedin.png',+ 'linkedin-page': '/images/accounts/linkedin.png',+ 'x': '/images/accounts/x.png',+ 'tiktok': '/images/accounts/tiktok.png',+ 'youtube': '/images/accounts/youtube.png',+ 'facebook': '/images/accounts/facebook.png',+ 'instagram': '/images/accounts/instagram.png',+ 'threads': '/images/accounts/threads.png',+ };+ return logos[platform] || '/images/accounts/default.png';+};++const getPlatformLabel = (platform: string): string => {+ const labels: Record<string, string> = {+ 'linkedin': 'LinkedIn',+ 'linkedin-page': 'LinkedIn Page',+ 'x': 'X',+ 'tiktok': 'TikTok',+ 'youtube': 'YouTube Shorts',+ 'facebook': 'Facebook Page',+ 'instagram': 'Instagram',+ 'threads': 'Threads',+ };+ return labels[platform] || platform;+};++const getStatusConfig = (status: string) => {+ const configs: Record<string, { label: string; color: string; icon: any }> = {+ 'draft': { label: 'Draft', color: 'bg-gray-100 text-gray-800', icon: FileText },+ 'scheduled': { label: 'Scheduled', color: 'bg-blue-100 text-blue-800', icon: Clock },+ 'publishing': { label: 'Publishing', color: 'bg-yellow-100 text-yellow-800', icon: Loader2 },+ 'published': { label: 'Published', color: 'bg-green-100 text-green-800', icon: CheckCircle },+ 'partially_published': { label: 'Partially Published', color: 'bg-orange-100 text-orange-800', icon: AlertCircle },+ 'failed': { label: 'Failed', color: 'bg-red-100 text-red-800', icon: AlertCircle },+ };+ return configs[status] || configs['draft'];+};++const formatDateTime = (date: string | null): string => {+ if (!date) return '-';+ return dayjs.utc(date).tz(props.workspace.timezone).format('MMM D, YYYY [at] h:mm A');+};++const canEdit = ['draft', 'scheduled'].includes(props.post.status);+const enabledPlatforms = props.post.post_platforms.filter(pp => pp.enabled);+</script>++<template>+ <Head title="Post Details" />++ <AppLayout :breadcrumbs="breadcrumbs">+ <div class="flex flex-col gap-6 p-6">+ <div class="flex items-center justify-between">+ <div>+ <h1 class="text-2xl font-bold tracking-tight">Post Details</h1>+ <p class="text-muted-foreground">+ Created by {{ post.user.name }}+ </p>+ </div>+ <Link v-if="canEdit" :href="`/workspaces/${workspace.id}/posts/${post.id}/edit`">+ <Button>+ <Pencil class="mr-2 h-4 w-4" />+ Edit Post+ </Button>+ </Link>+ </div>++ <div class="grid gap-6 lg:grid-cols-3">+ <!-- Main Content -->+ <div class="lg:col-span-2 space-y-6">+ <!-- Platform Posts -->+ <Card v-for="pp in enabledPlatforms" :key="pp.id">+ <CardHeader>+ <div class="flex items-center justify-between">+ <div class="flex items-center gap-3">+ <div class="relative shrink-0">+ <img+ v-if="pp.social_account.avatar_url"+ :src="pp.social_account.avatar_url"+ :alt="pp.social_account.display_name"+ class="h-10 w-10 rounded-full object-cover"+ />+ <div v-else class="h-10 w-10 rounded-full bg-muted flex items-center justify-center">+ <span class="text-sm font-medium">{{ pp.social_account.display_name?.charAt(0) }}</span>+ </div>+ <img+ :src="getPlatformLogo(pp.platform)"+ :alt="pp.platform"+ class="absolute -bottom-1 -right-1 h-5 w-5 rounded-full ring-2 ring-background"+ />+ </div>+ <div>+ <CardTitle class="text-base">{{ pp.social_account.display_name }}</CardTitle>+ <CardDescription>{{ getPlatformLabel(pp.platform) }}</CardDescription>+ </div>+ </div>+ <div class="flex items-center gap-2">+ <Badge :class="getStatusConfig(pp.status).color">+ <component :is="getStatusConfig(pp.status).icon" class="mr-1 h-3 w-3" />+ {{ getStatusConfig(pp.status).label }}+ </Badge>+ <a+ v-if="pp.platform_url"+ :href="pp.platform_url"+ target="_blank"+ class="text-muted-foreground hover:text-foreground"+ >+ <ExternalLink class="h-4 w-4" />+ </a>+ </div>+ </div>+ </CardHeader>+ <CardContent class="space-y-4">+ <!-- Content -->+ <div class="whitespace-pre-wrap text-sm">+ {{ pp.content || 'No content' }}+ </div>++ <!-- Media -->+ <div v-if="pp.media.length > 0" class="flex flex-wrap gap-2">+ <div+ v-for="media in pp.media"+ :key="media.id"+ class="w-24 h-24 rounded-lg overflow-hidden border bg-muted"+ >+ <img+ v-if="media.type === 'image'"+ :src="media.url"+ :alt="media.original_filename"+ class="w-full h-full object-cover"+ />+ <div v-else class="w-full h-full flex items-center justify-center text-xs text-muted-foreground">+ {{ media.type }}+ </div>+ </div>+ </div>++ <!-- Error Message -->+ <div v-if="pp.error_message" class="p-3 rounded-lg bg-red-50 border border-red-200 text-sm text-red-700">+ <p class="font-medium">Error:</p>+ <p class="mt-1">{{ pp.error_message }}</p>+ </div>++ <!-- Published Info -->+ <div v-if="pp.published_at" class="text-xs text-muted-foreground">+ Published {{ formatDateTime(pp.published_at) }}+ </div>+ </CardContent>+ </Card>++ <Card v-if="enabledPlatforms.length === 0">+ <CardContent class="py-8 text-center text-muted-foreground">+ No platforms selected for this post.+ </CardContent>+ </Card>+ </div>++ <!-- Sidebar -->+ <div class="space-y-6">+ <Card>+ <CardHeader>+ <CardTitle>Status</CardTitle>+ </CardHeader>+ <CardContent class="space-y-4">+ <div class="flex items-center gap-2">+ <Badge :class="getStatusConfig(post.status).color" class="text-sm">+ <component :is="getStatusConfig(post.status).icon" class="mr-1 h-4 w-4" />+ {{ getStatusConfig(post.status).label }}+ </Badge>+ </div>++ <div class="space-y-2 text-sm">+ <div class="flex justify-between">+ <span class="text-muted-foreground">Scheduled</span>+ <span>{{ formatDateTime(post.scheduled_at) }}</span>+ </div>+ <div v-if="post.published_at" class="flex justify-between">+ <span class="text-muted-foreground">Published</span>+ <span>{{ formatDateTime(post.published_at) }}</span>+ </div>+ </div>+ </CardContent>+ </Card>++ <Card>+ <CardHeader>+ <CardTitle>Platforms</CardTitle>+ </CardHeader>+ <CardContent>+ <div class="space-y-2">+ <div+ v-for="pp in enabledPlatforms"+ :key="pp.id"+ class="flex items-center justify-between text-sm"+ >+ <div class="flex items-center gap-2">+ <img :src="getPlatformLogo(pp.platform)" class="h-4 w-4" />+ <span>{{ pp.social_account.display_name }}</span>+ </div>+ <Badge variant="outline" :class="getStatusConfig(pp.status).color" class="text-xs">+ {{ getStatusConfig(pp.status).label }}+ </Badge>+ </div>+ </div>+ </CardContent>+ </Card>+ </div>+ </div>+ </div>+ </AppLayout>+</template>diff --git a/resources/js/pages/workspaces/Invites.vue b/resources/js/pages/workspaces/Invites.vueindex 291eb2c56..7f866830c 100644--- a/resources/js/pages/workspaces/Invites.vue+++ b/resources/js/pages/workspaces/Invites.vue@@ -1,6 +1,6 @@<script setup lang="ts">import { Head, useForm, router } from '@inertiajs/vue3';-import { UserPlus, Users, Mail, Clock, Trash2, Crown, User } from 'lucide-vue-next';+import { UserPlus, Users, Mail, Clock, Trash2, Crown, User, Shield } from 'lucide-vue-next';import AppLayout from '@/layouts/AppLayout.vue';import { Button } from '@/components/ui/button';@@ -58,7 +58,7 @@ const breadcrumbs: BreadcrumbItemType[] = [href: `/workspaces/${props.workspace.id}`,},{- title: 'Equipe',+ title: 'Team',href: `/workspaces/${props.workspace.id}/members`,},];@@ -78,7 +78,7 @@ function submitInvite() {}function cancelInvite(inviteId: string) {- if (confirm('Tem certeza que deseja cancelar este convite?')) {+ if (confirm('Are you sure you want to cancel this invite?')) {router.delete(`/workspaces/${props.workspace.id}/invites/${inviteId}`, {preserveScroll: true,});@@ -86,7 +86,7 @@ function cancelInvite(inviteId: string) {}function removeMember(memberId: string) {- if (confirm('Tem certeza que deseja remover este membro?')) {+ if (confirm('Are you sure you want to remove this member?')) {router.delete(`/workspaces/${props.workspace.id}/members/${memberId}`, {preserveScroll: true,});@@ -94,9 +94,9 @@ function removeMember(memberId: string) {}function formatDate(dateString: string): string {- return new Date(dateString).toLocaleDateString('pt-BR', {- day: '2-digit',- month: '2-digit',+ return new Date(dateString).toLocaleDateString('en-US', {+ month: 'short',+ day: 'numeric',year: 'numeric',});}@@ -110,18 +110,23 @@ function getStatusColor(color: string): string {};return colors[color] || 'bg-gray-100 text-gray-800';}++function getRoleIcon(role: string) {+ if (role === 'admin') return Shield;+ return User;+}</script><template>- <Head :title="`Equipe - ${workspace.name}`" />+ <Head :title="`Team - ${workspace.name}`" /><AppLayout :breadcrumbs="breadcrumbs"><div class="flex flex-col gap-6 p-6"><div class="flex items-center justify-between"><div>- <h1 class="text-2xl font-bold tracking-tight">Equipe</h1>+ <h1 class="text-2xl font-bold tracking-tight">Team</h1><p class="text-muted-foreground">- Gerencie os membros e convites do workspace+ Manage members and invites for this workspace</p></div></div>@@ -131,10 +136,10 @@ function getStatusColor(color: string): string {<CardHeader><CardTitle class="flex items-center gap-2"><UserPlus class="h-5 w-5" />- Convidar Membro+ Invite Member</CardTitle><CardDescription>- Envie um convite por email para adicionar colaboradores+ Send an email invite to add collaborators</CardDescription></CardHeader><CardContent>@@ -145,7 +150,7 @@ function getStatusColor(color: string): string {id="email"v-model="form.email"type="email"- placeholder="[email protected]"+ placeholder="[email protected]":class="{ 'border-red-500': form.errors.email }"/><p v-if="form.errors.email" class="text-sm text-red-500">@@ -154,10 +159,10 @@ function getStatusColor(color: string): string {</div><div class="space-y-2">- <Label for="role">Papel</Label>+ <Label for="role">Role</Label><Select v-model="form.role"><SelectTrigger>- <SelectValue placeholder="Selecione um papel" />+ <SelectValue placeholder="Select a role" /></SelectTrigger><SelectContent><SelectItem@@ -173,7 +178,7 @@ function getStatusColor(color: string): string {<Button type="submit" :disabled="form.processing" class="w-full"><Mail class="mr-2 h-4 w-4" />- Enviar Convite+ Send Invite</Button></form></CardContent>@@ -183,15 +188,15 @@ function getStatusColor(color: string): string {<CardHeader><CardTitle class="flex items-center gap-2"><Clock class="h-5 w-5" />- Convites Pendentes+ Pending Invites</CardTitle><CardDescription>- Convites aguardando aceitação+ Invites awaiting acceptance</CardDescription></CardHeader><CardContent><div v-if="invites.length === 0" class="text-center py-6 text-muted-foreground">- Nenhum convite pendente+ No pending invites</div><div v-else class="space-y-3"><div@@ -210,7 +215,7 @@ function getStatusColor(color: string): string {</Badge></div><p class="text-xs text-muted-foreground mt-1">- Expira em {{ formatDate(invite.expires_at) }}+ Expires {{ formatDate(invite.expires_at) }}</p></div><Button@@ -231,10 +236,10 @@ function getStatusColor(color: string): string {<CardHeader><CardTitle class="flex items-center gap-2"><Users class="h-5 w-5" />- Membros+ Members</CardTitle><CardDescription>- Pessoas com acesso a este workspace+ People with access to this workspace</CardDescription></CardHeader><CardContent>@@ -249,7 +254,7 @@ function getStatusColor(color: string): string {<p class="text-sm text-muted-foreground">{{ owner.email }}</p></div></div>- <Badge>Proprietário</Badge>+ <Badge>Owner</Badge></div><div@@ -259,7 +264,7 @@ function getStatusColor(color: string): string {><div class="flex items-center gap-3"><div class="flex h-10 w-10 items-center justify-center rounded-full bg-secondary text-secondary-foreground">- <User class="h-5 w-5" />+ <component :is="getRoleIcon(member.role)" class="h-5 w-5" /></div><div><p class="font-medium">{{ member.name }}</p>@@ -267,7 +272,7 @@ function getStatusColor(color: string): string {</div></div><div class="flex items-center gap-2">- <Badge variant="outline">{{ member.role }}</Badge>+ <Badge variant="outline" class="capitalize">{{ member.role }}</Badge><Buttonvariant="ghost"size="icon"@@ -279,7 +284,7 @@ function getStatusColor(color: string): string {</div><div v-if="members.length === 0" class="text-center py-6 text-muted-foreground">- Nenhum membro além do proprietário+ No members besides the owner</div></div></CardContent>diff --git a/resources/js/pages/workspaces/Settings.vue b/resources/js/pages/workspaces/Settings.vuenew file mode 100644index 000000000..af6a027cf--- /dev/null+++ b/resources/js/pages/workspaces/Settings.vue@@ -0,0 +1,109 @@+<script setup lang="ts">+import { Head, useForm } from '@inertiajs/vue3';+import { Settings } from 'lucide-vue-next';++import AppLayout from '@/layouts/AppLayout.vue';+import { Button } from '@/components/ui/button';+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';+import { Input } from '@/components/ui/input';+import { Label } from '@/components/ui/label';+import TimezoneCombobox from '@/components/TimezoneCombobox.vue';+import { type BreadcrumbItemType } from '@/types';++interface Workspace {+ id: string;+ name: string;+ timezone: string;+}++interface Props {+ workspace: Workspace;+ timezones: Record<string, string>;+}++const props = defineProps<Props>();++const breadcrumbs: BreadcrumbItemType[] = [+ {+ title: 'Workspaces',+ href: '/workspaces',+ },+ {+ title: props.workspace.name,+ href: `/workspaces/${props.workspace.id}`,+ },+ {+ title: 'Settings',+ href: `/workspaces/${props.workspace.id}/settings`,+ },+];++const form = useForm({+ name: props.workspace.name,+ timezone: props.workspace.timezone,+});++const submit = () => {+ form.put(`/workspaces/${props.workspace.id}/settings`);+};+</script>++<template>+ <Head title="Settings" />++ <AppLayout :breadcrumbs="breadcrumbs">+ <div class="flex flex-col gap-6 p-6">+ <div>+ <h1 class="text-2xl font-bold tracking-tight">Settings</h1>+ <p class="text-muted-foreground">+ Manage your workspace settings+ </p>+ </div>++ <Card class="max-w-lg">+ <CardHeader>+ <CardTitle class="flex items-center gap-2">+ <Settings class="h-5 w-5" />+ Workspace Settings+ </CardTitle>+ <CardDescription>+ Update your workspace name and timezone+ </CardDescription>+ </CardHeader>+ <CardContent>+ <form @submit.prevent="submit" class="space-y-4">+ <div class="space-y-2">+ <Label for="name">Name</Label>+ <Input+ id="name"+ v-model="form.name"+ placeholder="My Workspace"+ :class="{ 'border-destructive': form.errors.name }"+ />+ <p v-if="form.errors.name" class="text-sm text-destructive">+ {{ form.errors.name }}+ </p>+ </div>++ <div class="space-y-2">+ <Label for="timezone">Timezone</Label>+ <TimezoneCombobox+ v-model="form.timezone"+ :timezones="timezones"+ />+ <p v-if="form.errors.timezone" class="text-sm text-destructive">+ {{ form.errors.timezone }}+ </p>+ </div>++ <div class="flex gap-2 pt-2">+ <Button type="submit" :disabled="form.processing">+ {{ form.processing ? 'Saving...' : 'Save Changes' }}+ </Button>+ </div>+ </form>+ </CardContent>+ </Card>+ </div>+ </AppLayout>+</template>diff --git a/resources/js/pages/workspaces/Show.vue b/resources/js/pages/workspaces/Show.vueindex cc3e365b7..accc54e84 100644--- a/resources/js/pages/workspaces/Show.vue+++ b/resources/js/pages/workspaces/Show.vue@@ -56,26 +56,31 @@ const breadcrumbs: BreadcrumbItemType[] = [<div><h1 class="text-2xl font-bold tracking-tight">{{ workspace.name }}</h1><p class="text-muted-foreground">- Dashboard do workspace+ Workspace dashboard</p></div><div class="flex gap-2">+ <Link :href="`/workspaces/${workspace.id}/settings`">+ <Button variant="ghost" size="icon">+ <Settings class="h-4 w-4" />+ </Button>+ </Link><Link :href="`/workspaces/${workspace.id}/members`"><Button variant="outline"><UserPlus class="mr-2 h-4 w-4" />- Equipe+ Team</Button></Link><Link :href="`/workspaces/${workspace.id}/accounts`"><Button variant="outline"><Users class="mr-2 h-4 w-4" />- Contas+ Accounts</Button></Link><Link :href="`/workspaces/${workspace.id}/calendar`"><Button><Calendar class="mr-2 h-4 w-4" />- Calendário+ Calendar</Button></Link></div>diff --git a/resources/views/app.blade.php b/resources/views/app.blade.phpindex 3ef8e7afb..ee941560e 100644--- a/resources/views/app.blade.php+++ b/resources/views/app.blade.php@@ -3,6 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">+ <meta name="csrf-token" content="{{ csrf_token() }}">{{-- Inline script to detect system dark mode preference and apply it immediately --}}<script>diff --git a/routes/channels.php b/routes/channels.phpnew file mode 100644index 000000000..df2ad287e--- /dev/null+++ b/routes/channels.php@@ -0,0 +1,7 @@+<?php++use Illuminate\Support\Facades\Broadcast;++Broadcast::channel('App.Models.User.{id}', function ($user, $id) {+ return (int) $user->id === (int) $id;+});diff --git a/routes/web.php b/routes/web.phpindex bd47133e7..7e3874c6c 100644--- a/routes/web.php+++ b/routes/web.php@@ -1,10 +1,14 @@<?php+use App\Http\Controllers\Auth\FacebookController;+use App\Http\Controllers\Auth\InstagramController;use App\Http\Controllers\Auth\LinkedInController;use App\Http\Controllers\Auth\LinkedInPageController;use App\Http\Controllers\Auth\SocialController;+use App\Http\Controllers\Auth\ThreadsController;use App\Http\Controllers\Auth\TikTokController;use App\Http\Controllers\Auth\XController;+use App\Http\Controllers\Auth\YouTubeController;use App\Http\Controllers\BillingController;use App\Http\Controllers\MediaController;use App\Http\Controllers\PostController;@@ -20,6 +24,14 @@ Route::get('/', function () {]);})->name('home');+Route::get('/privacy', function () {+ return Inertia::render('legal/Privacy');+})->name('privacy');++Route::get('/terms', function () {+ return Inertia::render('legal/Terms');+})->name('terms');+Route::get('dashboard', function () {return redirect()->route('workspaces.index');})->middleware(['auth', 'verified'])->name('dashboard');@@ -27,6 +39,10 @@ Route::get('dashboard', function () {Route::middleware(['auth', 'verified'])->group(function () {// WorkspacesRoute::resource('workspaces', WorkspaceController::class);+ Route::get('workspaces/{workspace}/settings', [WorkspaceController::class, 'settings'])+ ->name('workspaces.settings');+ Route::put('workspaces/{workspace}/settings', [WorkspaceController::class, 'updateSettings'])+ ->name('workspaces.settings.update');// Social AccountsRoute::get('workspaces/{workspace}/accounts', [SocialController::class, 'index'])@@ -62,6 +78,42 @@ Route::middleware(['auth', 'verified'])->group(function () {Route::get('accounts/tiktok/callback', [TikTokController::class, 'callback'])->name('social.tiktok.callback');+ // YouTube+ Route::get('workspaces/{workspace}/connect/youtube', [YouTubeController::class, 'connect'])+ ->name('social.youtube.connect');+ Route::get('accounts/youtube/callback', [YouTubeController::class, 'callback'])+ ->name('social.youtube.callback');+ Route::get('accounts/youtube/select', [YouTubeController::class, 'selectChannel'])+ ->name('social.youtube.select-channel');+ Route::post('accounts/youtube/select', [YouTubeController::class, 'select'])+ ->name('social.youtube.select');++ Route::get('workspaces/{workspace}/connect/facebook', [FacebookController::class, 'connect'])+ ->name('social.facebook.connect');+ Route::get('accounts/facebook/callback', [FacebookController::class, 'callback'])+ ->name('social.facebook.callback');+ Route::get('accounts/facebook/select', [FacebookController::class, 'selectPage'])+ ->name('social.facebook.select-page');+ Route::post('accounts/facebook/select', [FacebookController::class, 'select'])+ ->name('social.facebook.select');++ Route::get('workspaces/{workspace}/connect/instagram', [InstagramController::class, 'connect'])+ ->name('social.instagram.connect');+ Route::get('accounts/instagram/callback', [InstagramController::class, 'callback'])+ ->name('social.instagram.callback');+ Route::get('accounts/instagram/select', [InstagramController::class, 'selectAccount'])+ ->name('social.instagram.select-account');+ Route::post('accounts/instagram/select', [InstagramController::class, 'select'])+ ->name('social.instagram.select');++ // Threads+ Route::get('workspaces/{workspace}/connect/threads', [ThreadsController::class, 'connect'])+ ->name('social.threads.connect');+ Route::get('accounts/threads/callback', [ThreadsController::class, 'callback'])+ ->name('social.threads.callback');+// CalendarRoute::get('workspaces/{workspace}/calendar', [PostController::class, 'calendar'])->name('workspaces.calendar');