{{-- New Order — IMPULSA skin (redesigned: compact 3-panel hero + 2-col form). Same Livewire component (Create) and the same real OrderCreator flow. All content fits on a desktop screen without vertical scroll. --}} @php use Illuminate\Support\Str; $total = $hero['total'] ?? 0; $pct = fn ($v) => $total > 0 ? number_format($v / $total * 100, 2).'%' : '0.00%'; // ---- Description → spec-sheet bullets (scraped text) ---- $bullets = []; if ($service && trim((string) $service->description) !== '') { $emoji = '\x{1F000}-\x{1FAFF}\x{2600}-\x{27BF}\x{2B00}-\x{2BFF}\x{2190}-\x{21FF}\x{2300}-\x{23FF}\x{25A0}-\x{25FF}\x{2100}-\x{214F}\x{FE0F}'; $norm = preg_replace('/\s*(?=['.$emoji.'])/u', "\n", trim($service->description)); $norm = preg_replace('/\r\n|\r|•|\s\|\s?|\s-\s/u', "\n", $norm); foreach (preg_split('/\n+/u', $norm, -1, PREG_SPLIT_NO_EMPTY) as $frag) { $t = trim($frag); if ($t === '' || ! preg_match('/[\p{L}\p{N}]/u', $t)) { continue; } if (preg_match('/^['.$emoji.']+\s*(.*)$/u', $t, $m) && trim($m[1]) !== '') { $t = trim($m[1]); } $label = null; $value = $t; if (preg_match('/^([\p{L}\p{N}\/&.\s]{1,26}?)\s*:\s*(.+)$/u', $t, $m2)) { $label = trim($m2[1]); $value = trim($m2[2]); } $low = Str::lower($t); $color = 'var(--color-primary-600)'; if (Str::contains($low, ['velocidad','speed','día','day','boost','k/'])) { $color = '#12c2b8'; } if (Str::contains($t, ['♻']) || preg_match('/\b(refill|lifetime)\b/u', $low) || Str::contains($low, ['recarga','garantía'])) { $color = '#22c55e'; } if (Str::contains($t, ['⚠']) || Str::contains($low, ['drop','no refill','no realice','importante','notice','please read','read the'])) { $color = '#f59e0b'; } $bullets[] = ['label' => $label, 'value' => $value, 'color' => $color]; } $bullets = array_slice($bullets, 0, 24); } // ---- Donut multi-color segments for hero panel 2 ---- $dCompleted = $total > 0 ? round(($hero['completed'] ?? 0) / $total * 100) : 0; $dPending = $total > 0 ? round(($hero['pending'] ?? 0) / $total * 100) : 0; $dCanceled = $total > 0 ? round(($hero['canceled'] ?? 0) / $total * 100) : 0; $dPendEnd = $dCompleted + $dPending; $dCanEnd = $dPendEnd + $dCanceled; $donutGrad = $total === 0 ? 'var(--color-surface-3) 0 100%' : "#22c55e 0 {$dCompleted}%, #f59e0b {$dCompleted}% {$dPendEnd}%, #ef4444 {$dPendEnd}% {$dCanEnd}%, var(--color-surface-3) {$dCanEnd}% 100%"; // ---- Sparkline chart for hero panel 1 (vh matches hero height 155px) ---- $chartSeries = $hero['series'] ?? []; $chart = count($chartSeries) >= 2 ? impulsa_chart($chartSeries, ['vh' => 155, 'padX' => 22, 'padTop' => 48, 'padBottom' => 8, 'tension' => 0.42]) : null; // ---- Hero networks (quick + more, up to 20 chips) ---- $heroNets = array_slice(array_merge($networks['quick'], $networks['more']), 0, 20); @endphp {{-- Scoped styles for this page only --}} {{-- Root: content-driven, no forced viewport height --}}
{{-- ══ HERO: 3 compact panels at fixed 155px ══ --}}
{{-- Panel 1 — sparkline chart + CTA pill --}}
{{-- Chart fills the card background --}} @if ($chart) @php $nhcMaxVal = max(1, max(array_column($chartSeries ?: [['value' => 0]], 'value'))); @endphp {{-- Subtle horizontal reference lines --}} @foreach (array_slice($chart['gridYs'], 1, 2) as $gy) @endforeach {{-- Area gradient fill --}} {{-- Soft glow layer (wider, low-opacity duplicate) --}} {{-- Crisp main line --}} {{-- Data point dots (non-zero values only) --}} @foreach ($chart['coords'] as $nhcIdx => $nhcCoord) @php $nhcVal = (int)($chartSeries[$nhcIdx]['value'] ?? 0); @endphp @if ($nhcVal > 0) @php $nhcIsPeak = ($nhcVal === $nhcMaxVal); @endphp @endif @endforeach @else
@endif {{-- "Place an Order" pill — centered over the chart --}}
{{ __('Place an Order') }}
{{-- Orders label bottom-left --}}
{{ __('Orders · 14d') }}
{{-- Panel 2 — donut + 7 status counters --}}
@foreach ([ [__('All'), $total, '#6366f1'], [__('Pending'), $hero['pending'] ?? 0, '#94a3b8'], [__('Processing'), $hero['processing'] ?? 0, '#f59e0b'], [__('In progress'), $hero['inProgress'] ?? 0, '#3b82f6'], [__('Completed'), $hero['completed'] ?? 0, '#22c55e'], [__('Partial'), $hero['partial'] ?? 0, '#a855f7'], [__('Canceled'), $hero['canceled'] ?? 0, '#ef4444'], ] as [$lbl, $val, $clr])
{{ $lbl }}
{{ number_format($val) }}
@endforeach
{{-- Panel 3 — network chips (solid brand colors) --}}
{{ __('Social Networks') }}
@foreach ($heroNets as $n) @include('partials.impulsa-netchip', ['n' => $n]) @endforeach
{{-- ══ FORM CARD: tabs + form body ══ --}}
{{-- Tabs --}}
{{-- ── Important tab ── --}} @if ($mode === 'important')

{{ __('Before you order') }}

  • {{ __('Make sure your profile is public — private accounts cannot be processed.') }}
  • {{ __('Do not place a second order on the same link until the first completes.') }}
  • {{ __('Check the service min/max and average time before confirming.') }}
  • {{ __('Orders cannot be canceled once sent to the provider.') }}
{{-- ── Mass order tab ── --}} @elseif ($mode === 'mass')
@error('massInput')

{{ $message }}

@enderror @error('massConfirmed')

{{ $message }}

@enderror
{{-- ── Single order tab: 2-column compact form ── --}} @else
{{-- ═══ LEFT: form fields ═══ --}}
{{ __('Add new') }}
{{-- Category — unified dropdown. When a network is active: options are pre-filtered to that network's categories and the auto-selected default stays highlighted. Clicking the field opens the dropdown (keeps the selection visible); only the × clears it. When no network is active: all categories shown. --}}
{{-- Trigger row: left = name (clickable, opens dropdown); right = × or chevron --}}
@if ($selectedCategoryName) @include('partials.impulsa-neticon', ['n' => $selectedCategoryNetworkMeta ?? $selectedNetworkMeta]) {{ $selectedCategoryName }} @else {{ __('Choose a category') }} @endif @if ($selectedCategoryName) {{-- × clears the category but keeps the network active --}} @else @endif
{{-- Dropdown with sticky search + filtered options --}}
{{-- Sticky search input --}}
@forelse ($categoryOptions as $opt) @empty
{{ $categorySearch === '' ? __('No categories available.') : __('No categories match.') }}
@endforelse
{{-- Order Service --}}
@if (! $categoryId)
{{ __('Choose a category first') }}
@else
@foreach ($services as $svc) @endforeach
@endif
@if ($isSubscription) {{-- SUBSCRIPTION FIELDS --}}
{{ __('Subscription settings') }}
{{-- Username --}}
@error('subUsername')

{{ $message }}

@enderror
{{-- Min / Max per post --}}
@error('subMin')

{{ $message }}

@enderror
@error('subMax')

{{ $message }}

@enderror
@if ($service)

{{ __('Service limit') }}: {{ number_format($service->min) }} – {{ number_format($service->max) }} {{ __('per post') }}

@endif {{-- Posts / Old posts --}}
@error('subPosts')

{{ $message }}

@enderror
{{-- Delay / Expiry --}}
{{-- Subscription charge chip --}} @if ($subMax && $subPosts)
{{ number_format((int)$subMax) }} × {{ number_format((int)$subPosts) }} = {{ number_format((int)$subMax * (int)$subPosts) }} {{ __('units') }} {{ client_money($charge) }}
@endif @else {{-- Link --}}
@error('link')

{{ $message }}

@enderror
{{-- Drip-feed toggle --}} @if ($service && $service->dripfeed)
@if ($dripFeed)
@endif
@endif {{-- Quantity + Total Charge --}}
{{ __('Total') }}: {{ client_money($charge) }}
@if ($dripFeed && $runs && $interval && $quantity) @php $dfTotalQty = (int)$runs * (int)$quantity; $dfTotalMin = max(0, ((int)$runs - 1) * (int)$interval); $dfH = intdiv($dfTotalMin, 60); $dfM = $dfTotalMin % 60; if ($dfH > 0 && $dfM > 0) { $dfDuration = __(':hours hours and :minutes minutes', ['hours' => $dfH, 'minutes' => $dfM]); } elseif ($dfH > 0) { $dfDuration = __(':hours hours', ['hours' => $dfH]); } else { $dfDuration = __(':minutes minutes', ['minutes' => $dfM]); } @endphp
{{ __(':runs deliveries of :qty every :interval min', ['runs' => number_format((int)$runs), 'qty' => number_format((int)$quantity), 'interval' => (int)$interval]) }}
{{ __('Total quantity: :total', ['total' => number_format($dfTotalQty)]) }}
{{ __('Approximate duration: :duration', ['duration' => $dfDuration]) }}
{{ __('Total price: :price', ['price' => client_money($charge)]) }}
@endif @if ($belowMin)

{{ __('Quantity is below the minimum of :min.', ['min' => number_format($service->min)]) }}

@endif @if ($aboveMax)

{{ __('Quantity is above the maximum of :max.', ['max' => number_format($service->max)]) }}

@endif
@endif {{-- Insufficient funds alert --}} @if ($insufficient)
{{ __('Order amount exceeds available funds.') }} {{ __('Add funds') }}
@endif {{-- Confirm checkbox --}} @error('confirmed')

{{ $message }}

@enderror {{-- Place Order (always visible at bottom of column) --}}
{{-- ═══ RIGHT: order summary ═══ --}}
{{ __('Order Summary') }}
{{-- Service name --}}
{{ $service?->name ?? __('Choose a service to see its details.') }}
{{-- Meta tiles: 4 cols, compact --}}
{{ __('Avg. time') }}
{{ $service && $service->average_time ? $service->average_time : '—' }}
{{ __('Min') }}
{{ $service ? number_format($service->min) : '—' }}
{{ __('Max') }}
{{ $service ? number_format($service->max) : '—' }}
{{ __('Per 1000') }}
{{ $unitPrice ? client_rate_money($unitPrice) : '—' }}
{{-- Description: grows with content, no internal scroll --}}
@if (count($bullets)) @foreach ($bullets as $b)
@if ($b['label']){{ $b['label'] }}:@endif{{ $b['value'] }}
@endforeach @else {{ $service ? __('This service has no description.') : __('Select a service to read its description.') }} @endif
@endif
{{-- /form card --}}
{{-- /root --}} {{-- Modal is rendered by the parent create.blade.php (shared across all skins) --}}