# GlobalIntelligencePanel

- File ID: file:1niza9w:globalintelligencepanel-razor
- Path: NexusReader.UI.Shared/Components/Organisms/GlobalIntelligencePanel.razor
- Role: ui-component
- Layer: frontend

## Purpose

Blazor UI component that renders a 'Global Intelligence' semantic search panel, shows loading/results/empty states, and forwards search queries via an EventCallback.

## Key Details

Public parameters: Results: List<SemanticSearchResultDto>? (line 50), IsLoading: bool (line 51), OnPerformSearch: EventCallback<string> (line 52). Markup contains conditional rendering and a foreach loop to present results; HandleSearch (line 56) sets HasSearched and invokes OnPerformSearch.InvokeAsync(query).

## Symbols

- GlobalIntelligencePanel: Blazor UI component that renders a 'Global Intelligence' semantic search panel, shows loading/results/empty states, and forwards search queries via an EventCallback.
- Render (component markup): Renders the Global Intelligence panel and conditionally displays loading, search results (with a loop), or an empty state.
- HandleSearch(): Invoked when the child search box triggers a search; marks that a search occurred and forwards the query via OnPerformSearch EventCallback.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Application/DTOs/AI/SemanticSearchResultDto.cs (referenced via @using)
- dependency-target: NexusReader.UI.Shared/Components/Atoms/NexusSearchBox.razor (used as child component)
- call-target: unknown
- interaction-target: Awaits EventCallback.InvokeAsync(query) to notify parent component or consumer of the search.

## Coverage

- Symbols: 3
- Executable symbols: 2
- Executable symbols with control flow: 2
- Grounded edges: 3
- Unresolved references: 4
- Control-flow fragments: 2
- Unresolved jumps: 1
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 4

## Control Flow Fragments

- Render (component markup): 41 nodes, 50 edges, 0 jumps, 0 unsupported constructs
- HandleSearch: 7 nodes, 6 edges, 1 jumps, 0 unsupported constructs

## Diagrams

### GlobalIntelligencePanel Neighborhood

```mermaid
flowchart LR
    class_cps3pc_globalintelligencepanel("GlobalIntelligencePanel")
    file_1niza9w_globalintelligencepanel_razor("GlobalIntelligencePanel")
    method_cylg7j_render_component_markup[["Render (component markup)"]]
    method_h9z30t_handlesearch[["HandleSearch()"]]
```

### GlobalIntelligencePanel Execution Overview

```mermaid
flowchart TD
    class_cps3pc_globalintelligencepanel("GlobalIntelligencePanel")
    method_cylg7j_render_component_markup[["Render (component markup)"]]
    method_h9z30t_handlesearch[["HandleSearch()"]]
    unresolved_unresolved_ayzqd8_interaction_target{"Unresolved: Awaits EventCallback.InvokeAsync(query) to notify parent component or consumer of the search."}
    unresolved_unresolved_v7y5t4_call_target{"Unresolved: OnPerformSearch.InvokeAsync"}
    class_cps3pc_globalintelligencepanel -->|contains| method_cylg7j_render_component_markup
    class_cps3pc_globalintelligencepanel -->|contains| method_h9z30t_handlesearch
    class_cps3pc_globalintelligencepanel -->|unresolved interaction| unresolved_unresolved_ayzqd8_interaction_target
    method_h9z30t_handlesearch -->|unresolved call| unresolved_unresolved_v7y5t4_call_target
```

### Render (component markup)() Control Flow

_Warnings: diagram method_cylg7j_render_component_markup__fragment_diagram exceeds preferred complexity thresholds (41 nodes, 50 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_cylg7j_render_component_markup__action_14_branch_14__condition{"IsLoading ? show loading : (Results != null && Results.Any()) ? show results : HasSearched ? show empty"}
    method_cylg7j_render_component_markup__action_14_branch_14__false("results")
    method_cylg7j_render_component_markup__action_14_branch_14__merge("merge")
    method_cylg7j_render_component_markup__action_14_branch_14__true("loading")
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__condition{"IsLoading"}
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__false("false")
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__merge("merge")
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__true("true")
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__condition{"Results != null && Results.Any()"}
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__false("false")
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__merge("merge")
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__true("true")
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__condition{"Falls back to alternate path"}
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__false("otherwise")
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__merge("merge")
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__true("fallback")
    method_cylg7j_render_component_markup__action_23_loop_23__loop_body[["Iterates Results to render each search result (lines 23-37)."]]
    method_cylg7j_render_component_markup__action_23_loop_23__loop_entry("foreach over Results when non-empty")
    method_cylg7j_render_component_markup__action_23_loop_23__loop_exit("exit loop")
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_body[["@foreach (var result in Results)"]]
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_entry("var result in Results")
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_exit("Leaves the loop when the condition no longer holds.")
    method_cylg7j_render_component_markup__action_27_mapping_27__linear("Show relevance percentage")
    method_cylg7j_render_component_markup__action_28_guard_clause_28__condition{"!string.IsNullOrEmpty(result.SourceBookTitle)"}
    method_cylg7j_render_component_markup__action_28_guard_clause_28__false("skip source")
    method_cylg7j_render_component_markup__action_28_guard_clause_28__merge("merge")
    method_cylg7j_render_component_markup__action_28_guard_clause_28__true("render source")
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__condition{"!string.IsNullOrEmpty(result.SourceBookTitle)"}
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__false("false")
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__merge("merge")
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__true("true")
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__condition{"HasSearched"}
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__false("false")
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__merge("merge")
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__true("true")
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__condition{"Falls back to alternate path"}
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__false("otherwise")
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__merge("merge")
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__true("fallback")
    method_cylg7j_render_component_markup__entry(["Render (component markup) entry"])
    method_cylg7j_render_component_markup__implicit_return(["return"])
    method_cylg7j_render_component_markup__action_14_branch_14__condition -->|results| method_cylg7j_render_component_markup__action_14_branch_14__false
    method_cylg7j_render_component_markup__action_14_branch_14__condition -->|loading| method_cylg7j_render_component_markup__action_14_branch_14__true
    method_cylg7j_render_component_markup__action_14_branch_14__false -->|next| method_cylg7j_render_component_markup__action_14_branch_14__merge
    method_cylg7j_render_component_markup__action_14_branch_14__merge -->|next| method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__condition
    method_cylg7j_render_component_markup__action_14_branch_14__true -->|next| method_cylg7j_render_component_markup__action_14_branch_14__merge
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__condition -->|false| method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__false
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__condition -->|true| method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__true
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__false -->|next| method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__merge
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__merge -->|fallback| method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__condition
    method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__true -->|next| method_cylg7j_render_component_markup__action_14_render_component_markup_branch_14_0__merge
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__condition -->|false| method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__false
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__condition -->|true| method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__true
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__false -->|next| method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__merge
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__merge -->|next| method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_entry
    method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__true -->|next| method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__merge
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__condition -->|otherwise| method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__false
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__condition -->|fallback| method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__true
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__false -->|next| method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__merge
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__merge -->|next| method_cylg7j_render_component_markup__action_21_render_component_markup_branch_21_1__condition
    method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__true -->|next| method_cylg7j_render_component_markup__action_21_render_component_markup_fallback_21_2__merge
    method_cylg7j_render_component_markup__action_23_loop_23__loop_body -->|continue| method_cylg7j_render_component_markup__action_23_loop_23__loop_entry
    method_cylg7j_render_component_markup__action_23_loop_23__loop_entry -->|foreach over Results when non-empty| method_cylg7j_render_component_markup__action_23_loop_23__loop_body
    method_cylg7j_render_component_markup__action_23_loop_23__loop_entry -->|exit| method_cylg7j_render_component_markup__action_23_loop_23__loop_exit
    method_cylg7j_render_component_markup__action_23_loop_23__loop_exit -->|next| method_cylg7j_render_component_markup__action_27_mapping_27__linear
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_body -->|continue| method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_entry
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_entry -->|var result in Results| method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_body
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_entry -->|Leaves the loop when the condition no longer holds.| method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_exit
    method_cylg7j_render_component_markup__action_23_render_component_markup_loop_23_3__loop_exit -->|next| method_cylg7j_render_component_markup__action_23_loop_23__loop_entry
    method_cylg7j_render_component_markup__action_27_mapping_27__linear -->|next| method_cylg7j_render_component_markup__action_28_guard_clause_28__condition
    method_cylg7j_render_component_markup__action_28_guard_clause_28__condition -->|skip source| method_cylg7j_render_component_markup__action_28_guard_clause_28__false
    method_cylg7j_render_component_markup__action_28_guard_clause_28__condition -->|render source| method_cylg7j_render_component_markup__action_28_guard_clause_28__true
    method_cylg7j_render_component_markup__action_28_guard_clause_28__false -->|next| method_cylg7j_render_component_markup__action_28_guard_clause_28__merge
    method_cylg7j_render_component_markup__action_28_guard_clause_28__merge -->|next| method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__condition
    method_cylg7j_render_component_markup__action_28_guard_clause_28__true -->|next| method_cylg7j_render_component_markup__action_28_guard_clause_28__merge
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__condition -->|false| method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__false
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__condition -->|true| method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__true
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__false -->|next| method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__merge
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__merge -->|fallback| method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__condition
    method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__true -->|next| method_cylg7j_render_component_markup__action_28_render_component_markup_branch_28_4__merge
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__condition -->|false| method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__false
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__condition -->|true| method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__true
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__false -->|next| method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__merge
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__merge -->|return| method_cylg7j_render_component_markup__implicit_return
    method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__true -->|next| method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__merge
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__condition -->|otherwise| method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__false
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__condition -->|fallback| method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__true
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__false -->|next| method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__merge
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__merge -->|next| method_cylg7j_render_component_markup__action_39_render_component_markup_branch_39_5__condition
    method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__true -->|next| method_cylg7j_render_component_markup__action_39_render_component_markup_fallback_39_6__merge
    method_cylg7j_render_component_markup__entry -->|next| method_cylg7j_render_component_markup__action_14_branch_14__condition
```

### HandleSearch() Control Flow

```mermaid
flowchart TD
    method_h9z30t_handlesearch__call_59_OnPerformSearch_InvokeAsync[["OnPerformSearch.InvokeAsync"]]
    method_h9z30t_handlesearch__action_56_async_56__linear("Async forward")
    method_h9z30t_handlesearch__action_58_state_change_58__linear("Set HasSearched")
    method_h9z30t_handlesearch__action_59_handlesearch_await_59_0__await[["Waits for async work"]]
    method_h9z30t_handlesearch__entry(["HandleSearch entry"])
    method_h9z30t_handlesearch__action_59_external_call_59__linear("Forward search to parent/handler")
    method_h9z30t_handlesearch__implicit_return(["return"])
    method_h9z30t_handlesearch__action_56_async_56__linear -->|next| method_h9z30t_handlesearch__action_58_state_change_58__linear
    method_h9z30t_handlesearch__action_58_state_change_58__linear -->|next| method_h9z30t_handlesearch__action_59_handlesearch_await_59_0__await
    method_h9z30t_handlesearch__action_59_external_call_59__linear -->|query string passed from child search box| method_h9z30t_handlesearch__call_59_OnPerformSearch_InvokeAsync
    method_h9z30t_handlesearch__action_59_handlesearch_await_59_0__await -->|next| method_h9z30t_handlesearch__action_59_external_call_59__linear
    method_h9z30t_handlesearch__call_59_OnPerformSearch_InvokeAsync -->|return| method_h9z30t_handlesearch__implicit_return
    method_h9z30t_handlesearch__entry -->|next| method_h9z30t_handlesearch__action_56_async_56__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 1 unresolved jumps.
- Warning: control-flow: diagram method_cylg7j_render_component_markup__fragment_diagram exceeds preferred complexity thresholds (41 nodes, 50 edges).
