@if (!empty($synastryGrid)) @php $rows = $synastryGrid['rows']; $cols = $synastryGrid['cols']; $grid = $synastryGrid['grid']; $uid = 'syn_' . uniqid(); $hideHeader = !empty($hideHeader); $wrapCard = isset($wrapCard) ? (bool) $wrapCard : true; $bodyClass = $wrapCard ? 'aspect-body p-2' : 'synastry-embed-body p-0'; // 1. AÇI İKONLARI VE VERİSİ $getAspectData = function ($type, $orb = 0) { $type = (string) $type; $html = match ($type) { '0' => '', '30' => '', '45' => '', '60' => '', '90' => '', '120' => '', '135' => '', '150' => '', '180' => '', 'PAR' => '||', 'CPAR' => '', default => '', }; $name = match ($type) { '0' => t('synod'), '30' => '30°', '45' => '45°', '60' => t('sextilee'), '90' => t('square'), '120' => t('triangle'), '135' => '135°', '150' => '150°', '180' => t('anti'), 'PAR' => t('parallel'), 'CPAR' => t('contra-parallel'), default => $type, }; return ['html' => $html, 'name' => $name, 'orb' => $orb]; }; // 2. GEZEGEN SEMBOLLERİ (Geriye Dönük Uyumluluk için Helper) // Not: Asıl veriler Service'den 'glyph_html' olarak geliyor. // Ancak 'rows' ve 'cols' içinde bu veri yoksa (eski cache vb.) diye // basit bir fallback fonksiyonu bırakıyoruz. $getSymFallback = function ($key) { return substr($key, 0, 2); }; // 3. LİSTE VERİSİNİ HAZIRLA // Synastry verilerini (Rows/Cols) senin istediğin Pairs formatına çeviriyoruz. $pairs = []; foreach ($rows as $rIndex => $row) { foreach ($cols as $cIndex => $col) { $cellData = $grid[$rIndex][$cIndex] ?? null; if ($cellData) { $orb = isset($cellData['orb_val']) ? $cellData['orb_val'] : 0; $type = $cellData['type'] ?? ''; // A Kişisi (Sol) $pA = $row; // B Kişisi (Sağ) - B'nin ismi row içinde olmayabilir, key kullanalım $pB = $col; if (!isset($pB['name'])) { $pB['name'] = $pB['key']; } $pairs[] = [ 'a' => $pA, 'b' => $pB, 'asp' => $getAspectData($type, $orb), ]; } } } @endphp @php // Başlık ve yön etiketleri için kişi isimlerini hazırla $pA_Name = $personA['title'] ?? ($personA['name'] ?? 'Harita'); $pB_Name = $personB['title'] ?? ($personB['name'] ?? 'Transit'); $pA_Color = $personA['color'] ?? '#479483'; $pB_Color = $personB['color'] ?? '#f1c40f'; // Başlık metni: "Solar Arc Doğum Haritası" veya "Solar Arc Transit" gibi if (!empty($pA_Name) && !empty($pB_Name)) { $pairTitle = trim($pA_Name . ' ' . $pB_Name); } else { $pairTitle = $pA_Name ?: $pB_Name; } // ✅ AI Chat için JSON veri paketi oluştur $synastryJsonData = [ 'person_a' => $pA_Name, 'person_b' => $pB_Name, 'pairs' => array_map(function ($p) { return [ 'person_a_planet' => $p['a']['name'] ?? $p['a']['key'], 'person_a_sign' => $p['a']['sign'] ?? '', 'person_a_deg' => $p['a']['deg_formatted'] ?? '', 'person_b_planet' => $p['b']['name'] ?? $p['b']['key'], 'person_b_sign' => $p['b']['sign'] ?? '', 'person_b_deg' => $p['b']['deg_formatted'] ?? '', 'aspect_type' => $p['asp']['name'] ?? '', 'orb' => $p['asp']['orb'] ?? 0, ]; }, $pairs), ]; @endphp
@if (!$hideHeader)
{{ $pairTitle }}
@endif
{{-- PANE 1: MATRİS (Kare Tablo) --}}
@foreach ($cols as $col) @endforeach @foreach ($rows as $rIndex => $row) @foreach ($cols as $cIndex => $col) @php $cellData = $grid[$rIndex][$cIndex] ?? null; $isSelf = $row['key'] === $col['key']; @endphp @endforeach @endforeach
{{-- Sol Üst Köşe (İsimler) --}}
{{ Str::limit($pA_Name, 8) }} ↓
{{ Str::limit($pB_Name, 8) }} →
{!! $col['sign_symbol'] ?? '' !!} {{ $col['deg_only'] }}
{{ $col['min_only'] }}
@if (!empty($col['is_plain_text'])) {!! $col['glyph_html'] ?? $getSymFallback($col['key']) !!} @else {!! $col['glyph_html'] ?? $getSymFallback($col['key']) !!} @endif
{{ $row['name'] ?? $row['key'] }}
{!! $row['sign_symbol'] ?? '' !!} {{ $row['deg_formatted'] }}
@if (!empty($row['is_plain_text'])) {!! $row['glyph_html'] ?? $getSymFallback($row['key']) !!} @else {!! $row['glyph_html'] ?? $getSymFallback($row['key']) !!} @endif
@if ($cellData) @php $type = $cellData['type'] ?? ''; $orb = isset($cellData['orb_val']) ? round($cellData['orb_val']) : ''; $aspData = $getAspectData($type); @endphp
{!! $aspData['html'] !!} @if ($orb !== '' && $orb < 10) {{ $orb }}° @endif
@elseif($isSelf)
·
@endif
{{-- PANE 2: LİSTE (aspect-pairs-table ile aynı düzen: 1.Gezegen | Açı | 2.Gezegen) --}}
@endif