@php use App\Enums\FlowSessionStatus; use App\Enums\FlowStepType; @endphp {{-- Back link uses the snapshotted `$this->backHref` property captured at `Run::mount()` time. It is a real `` — no `wire:navigate`, no Livewire state lookup at click time. If JS is broken, the link still works via standard browser navigation. --}}
@if ($this->backHref !== null) {{ __('Back to all topics') }} @else {{ __('Back to all topics') }} @endif @if ($flow) {{ $flow->name }} @endif
@if ($flow === null)
{{ __('This help topic is no longer available. Please head back to the topic list.') }}
@elseif ($session !== null && $session->status === FlowSessionStatus::Completed) {{-- Terminal: self-resolved (resolution step). Light-mode emerald palette. Body HTML passes through HtmlSanitizer + placeholder rendering (clickable links, headings, lists). --}}

{{ $step ? $this->renderCopy($step->title) : __('All sorted') }}

@if ($step?->body)
{!! $this->renderBody($step->body) !!}
@endif
@elseif ($session !== null && $session->status === FlowSessionStatus::Escalated) {{-- Terminal: escalated to support. Confirmation copy: "Your support request #X has been received. We will respond as soon as possible." This wording is pinned by SelfHelpTest. --}}

{{ $step ? $this->renderCopy($step->title) : __('Passed to our support team') }}

@if ($session->ticket_id)

{{ __('Your support request #:id has been received. We will respond as soon as possible.', ['id' => $session->ticket_id]) }}

@elseif ($step?->body)
{!! $this->renderBody($step->body) !!}
@endif
@elseif ($step === null)
{{ __('This help topic looks misconfigured. Please contact us by email and reference this page.') }}
@else {{-- In-progress: render the current step. Title is plain text. Body passes through the sanitizer so operator-authored HTML (lists, headings, hyperlinks) renders safely. --}}

{{ $this->renderCopy($step->title) }}

@if ($step->body)
{!! $this->renderBody($step->body) !!}
@endif
@switch($step->type) @case(FlowStepType::Info) @break @case(FlowStepType::Choice)
@foreach (($step->config['options'] ?? []) as $i => $option) @endforeach
@break @case(FlowStepType::Form) @php // Form is the terminal "Contact // support" step — verified identity // already established; the only // customer-supplied signal is the // "Tell us more" message + optional // attachments. $allowAttachments = ($step->config['allow_attachments'] ?? false) === true; $createsTicket = ($step->config['create_ticket'] ?? true) !== false; @endphp
@error('supportFormMessage')

{{ $message }}

@enderror
@if ($allowAttachments)
@if (! empty($supportFormAttachments)) @php $attachmentCount = count($supportFormAttachments); $overLimit = $attachmentCount > \App\Livewire\SelfHelp\Run::SUPPORT_FORM_MAX_ATTACHMENTS; @endphp @if ($overLimit)

{{ __('You selected :count files but only :max are allowed. Remove :extra to continue.', [ 'count' => $attachmentCount, 'max' => \App\Livewire\SelfHelp\Run::SUPPORT_FORM_MAX_ATTACHMENTS, 'extra' => $attachmentCount - \App\Livewire\SelfHelp\Run::SUPPORT_FORM_MAX_ATTACHMENTS, ]) }}

@endif
    @foreach ($supportFormAttachments as $index => $file) @php $fileName = is_object($file) && method_exists($file, 'getClientOriginalName') ? $file->getClientOriginalName() : 'file'; @endphp
  • {{ $fileName }}
  • @endforeach
@endif @error('supportFormAttachments')

{{ $message }}

@enderror @error('supportFormAttachments.*')

{{ $message }}

@enderror
@endif
@break @case(FlowStepType::Action) @php $actionKey = is_array($step->config) ? ($step->config['action_key'] ?? null) : null; @endphp @if ($actionKey === 'edit_address') {{-- edit_address collects the new delivery address on this step (Form steps are terminal, so it can't be gathered upstream) and submits it as the input. --}}
@error('actionAddress.address_line_one')

{{ $message }}

@enderror
@error('actionAddress.city')

{{ $message }}

@enderror
@error('actionAddress.postcode')

{{ $message }}

@enderror
@else {{-- cancel / reship — a pure confirm; the body copy above is the operator-authored prompt. --}} @endif @break @default
{{ __('This step type is not yet supported on the public portal.') }}
@endswitch
@endif