@if($plan)
    <?php $parsedPlan = json_decode($plan->data); ?>
    @if($parsedPlan && !empty(trim(strip_tags($parsedPlan->value))))
        <div class="inline-html-container <?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
            <?= @$parsedPlan->value ?>
        </div>
        <div class="screen-only d-flex align-items-baseline pt-1 border-top mt-1 mb-2">
            @if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id)
                <span class="text-sm">(updated on the patient's chart)</span>
            @else
                @if ($point->last_child_plan_point_scoped_note_id === $note->id)
                    <span class="text-sm">(updated on this note)</span>
                @else
                    <div class="d-inline position-relative on-click-menu">
                        <span class="text-sm text-primary c-pointer">
                            Updated <?= relative_friendly_date($plan->note->effective_dateest) ?>
                        </span>
                        <div menu right class="bg-white border">
                            <a native target="_blank"
                               href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $plan->note]) ?>"
                               class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
                        </div>
                    </div>
                @endif
            @endif
            <span class="mx-2 text-secondary text-sm">|</span>
            <a class="text-sm copy-to-new-subjective" href="#">Copy to new subjective</a>
        </div>
    @else
        <span class="text-secondary text-sm">-</span>
    @endif
@else
    <span class="text-secondary text-sm">-</span>
@endif
