# AiAssistantBubble

- File ID: file:83c16m:aiassistantbubble-razor
- Path: NexusReader.UI.Shared/Components/Molecules/AiAssistantBubble.razor
- Role: ui-component
- Layer: frontend

## Purpose

Blazor UI component that shows an AI assistant bubble: fetches a summary/quiz for a given content block, streams word-by-word reveal, exposes action buttons (show more / quiz), and manages streaming cancellation and lifecycle.

## Key Details

Core orchestration lives in FetchAndStreamAsync: cancels previous streams, requests summary via KnowledgeCoordinator, falls back to static Dialogue when missing, streams words with cancellation support, and surfaces quiz requests via injected IQuizStateService.

## Symbols

- OnParametersSetAsync(): Lifecycle hook: when parameters change, triggers fetching/streaming of AI content if component is interactive and the block id changed.
- OnAfterRenderAsync(): Lifecycle hook: on first render marks component interactive and triggers initial fetch/stream if a ContextBlockId is present.
- FetchAndStreamAsync(): Orchestrates requesting a summary/quiz from the KnowledgeCoordinator, handles fallbacks, streams the summary word-by-word to the UI, and manages cancellation, errors, and state flags.
- HandleActionClick(): Handles UI action button clicks: triggers quiz request when action indicates 'quiz' and forwards action via the OnActionTriggered callback if provided.
- Dispose(): Component disposal: cancels and disposes the streaming CancellationTokenSource to stop background streaming when the component is destroyed.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.UI.Shared/Services (IQuizStateService, KnowledgeCoordinator) - referenced via @inject
- dependency-target: NexusReader.Application.DTOs.AI (KnowledgePacket) - referenced via using
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: unknown
- interaction-target: await Coordinator.RequestSummaryAndQuizAsync(contentToAnalyze)

## Coverage

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

## Control Flow Fragments

- OnParametersSetAsync: 23 nodes, 26 edges, 1 jumps, 0 unsupported constructs
- OnAfterRenderAsync: 22 nodes, 25 edges, 1 jumps, 0 unsupported constructs
- FetchAndStreamAsync: 38 nodes, 42 edges, 1 jumps, 0 unsupported constructs
- HandleActionClick: 18 nodes, 20 edges, 1 jumps, 0 unsupported constructs
- Dispose: 4 nodes, 3 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### AiAssistantBubble Neighborhood

```mermaid
flowchart LR
    file_83c16m_aiassistantbubble_razor("AiAssistantBubble")
    method_16cvbhq_onparameterssetasync[["OnParametersSetAsync()"]]
    method_1bl306q_onafterrenderasync[["OnAfterRenderAsync()"]]
    method_1naqltb_handleactionclick[["HandleActionClick()"]]
    method_1p3ftme_dispose[["Dispose()"]]
    method_9ujebp_fetchandstreamasync[["FetchAndStreamAsync()"]]
```

### AiAssistantBubble Execution Overview

```mermaid
flowchart TD
    file_83c16m_aiassistantbubble_razor("AiAssistantBubble")
    method_16cvbhq_onparameterssetasync[["OnParametersSetAsync()"]]
    method_1bl306q_onafterrenderasync[["OnAfterRenderAsync()"]]
    method_1naqltb_handleactionclick[["HandleActionClick()"]]
    method_1p3ftme_dispose[["Dispose()"]]
    method_9ujebp_fetchandstreamasync[["FetchAndStreamAsync()"]]
    unresolved_unresolved_167r83h_call_target{"Unresolved: FetchAndStreamAsync"}
    unresolved_unresolved_1uzvj3j_call_target{"Unresolved: RequestQuiz"}
    unresolved_unresolved_4o4ap7_call_target{"Unresolved: RequestSummaryAndQuizAsync"}
    unresolved_unresolved_d0obx2_interaction_target{"Unresolved: await Coordinator.RequestSummaryAndQuizAsync(contentToAnalyze)"}
    unresolved_unresolved_d4ewrz_call_target{"Unresolved: FetchAndStreamAsync"}
    file_83c16m_aiassistantbubble_razor -->|contains| method_16cvbhq_onparameterssetasync
    file_83c16m_aiassistantbubble_razor -->|contains| method_1bl306q_onafterrenderasync
    file_83c16m_aiassistantbubble_razor -->|contains| method_1naqltb_handleactionclick
    file_83c16m_aiassistantbubble_razor -->|contains| method_1p3ftme_dispose
    file_83c16m_aiassistantbubble_razor -->|contains| method_9ujebp_fetchandstreamasync
    file_83c16m_aiassistantbubble_razor -->|unresolved interaction| unresolved_unresolved_d0obx2_interaction_target
    method_16cvbhq_onparameterssetasync -->|unresolved call| unresolved_unresolved_167r83h_call_target
    method_1bl306q_onafterrenderasync -->|unresolved call| unresolved_unresolved_d4ewrz_call_target
    method_1naqltb_handleactionclick -->|unresolved call| unresolved_unresolved_1uzvj3j_call_target
    method_9ujebp_fetchandstreamasync -->|unresolved call| unresolved_unresolved_4o4ap7_call_target
```

### OnParametersSetAsync() Control Flow

_Warnings: diagram method_16cvbhq_onparameterssetasync__fragment_diagram exceeds preferred complexity thresholds (23 nodes, 26 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_16cvbhq_onparameterssetasync__call_66_FetchAndStreamAsync[["FetchAndStreamAsync"]]
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__condition{"!_isInteractive"}
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__false("continue")
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__merge("merge")
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__true("return")
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__condition{"!_isInteractive"}
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__false("false")
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__merge("merge")
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__true("true")
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__condition{"string.IsNullOrEmpty(ContextBlockId) || ContextBlockId == _lastFetchedBlockId"}
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__false("fetch")
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__merge("merge")
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__true("return")
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__condition{"string.IsNullOrEmpty(ContextBlockId) || ContextBlockId == _lastFetchedBlockId"}
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__false("false")
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__merge("merge")
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__true("true")
    method_16cvbhq_onparameterssetasync__action_65_state_change_65__linear("Update last fetched block id")
    method_16cvbhq_onparameterssetasync__action_66_onparameterssetasync_await_66_4__await[["Waits for async work"]]
    method_16cvbhq_onparameterssetasync__entry(["OnParametersSetAsync entry"])
    method_16cvbhq_onparameterssetasync__action_59_onparameterssetasync_return_59_1__return(["Returns result"])
    method_16cvbhq_onparameterssetasync__action_63_onparameterssetasync_return_63_3__return(["Returns result"])
    method_16cvbhq_onparameterssetasync__implicit_return(["return"])
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__condition -->|continue| method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__false
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__condition -->|return| method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__true
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__false -->|next| method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__merge
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__merge -->|next| method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__condition
    method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__true -->|next| method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__merge
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__condition -->|false| method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__false
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__condition -->|true| method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__true
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__false -->|next| method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__merge
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__merge -->|return| method_16cvbhq_onparameterssetasync__action_59_onparameterssetasync_return_59_1__return
    method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__true -->|next| method_16cvbhq_onparameterssetasync__action_58_onparameterssetasync_branch_58_0__merge
    method_16cvbhq_onparameterssetasync__action_59_onparameterssetasync_return_59_1__return -->|next| method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__condition
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__condition -->|fetch| method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__false
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__condition -->|return| method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__true
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__false -->|next| method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__merge
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__merge -->|next| method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__condition
    method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__true -->|next| method_16cvbhq_onparameterssetasync__action_62_guard_clause_62__merge
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__condition -->|false| method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__false
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__condition -->|true| method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__true
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__false -->|next| method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__merge
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__merge -->|return| method_16cvbhq_onparameterssetasync__action_63_onparameterssetasync_return_63_3__return
    method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__true -->|next| method_16cvbhq_onparameterssetasync__action_62_onparameterssetasync_branch_62_2__merge
    method_16cvbhq_onparameterssetasync__action_63_onparameterssetasync_return_63_3__return -->|next| method_16cvbhq_onparameterssetasync__action_65_state_change_65__linear
    method_16cvbhq_onparameterssetasync__action_65_state_change_65__linear -->|next| method_16cvbhq_onparameterssetasync__action_66_onparameterssetasync_await_66_4__await
    method_16cvbhq_onparameterssetasync__action_66_onparameterssetasync_await_66_4__await -->|no args| method_16cvbhq_onparameterssetasync__call_66_FetchAndStreamAsync
    method_16cvbhq_onparameterssetasync__call_66_FetchAndStreamAsync -->|return| method_16cvbhq_onparameterssetasync__implicit_return
    method_16cvbhq_onparameterssetasync__entry -->|next| method_16cvbhq_onparameterssetasync__action_58_guard_clause_58__condition
```

### OnAfterRenderAsync() Control Flow

_Warnings: diagram method_1bl306q_onafterrenderasync__fragment_diagram exceeds preferred complexity thresholds (22 nodes, 25 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1bl306q_onafterrenderasync__call_77_FetchAndStreamAsync[["FetchAndStreamAsync"]]
    method_1bl306q_onafterrenderasync__action_71_branch_71__condition{"firstRender"}
    method_1bl306q_onafterrenderasync__action_71_branch_71__false("noop")
    method_1bl306q_onafterrenderasync__action_71_branch_71__merge("merge")
    method_1bl306q_onafterrenderasync__action_71_branch_71__true("initialize interactive + maybe fetch")
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__condition{"firstRender"}
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__false("false")
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__merge("merge")
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__true("true")
    method_1bl306q_onafterrenderasync__action_73_state_change_73__linear("Enable interactivity flag")
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__condition{"!string.IsNullOrEmpty(ContextBlockId)"}
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__false("skip")
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__merge("merge")
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__true("fetch")
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__condition{"!string.IsNullOrEmpty(ContextBlockId)"}
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__false("false")
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__merge("merge")
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__true("true")
    method_1bl306q_onafterrenderasync__action_76_state_change_76__linear("Record last fetched id")
    method_1bl306q_onafterrenderasync__action_77_onafterrenderasync_await_77_2__await[["Waits for async work"]]
    method_1bl306q_onafterrenderasync__entry(["OnAfterRenderAsync entry"])
    method_1bl306q_onafterrenderasync__implicit_return(["return"])
    method_1bl306q_onafterrenderasync__action_71_branch_71__condition -->|noop| method_1bl306q_onafterrenderasync__action_71_branch_71__false
    method_1bl306q_onafterrenderasync__action_71_branch_71__condition -->|initialize interactive + maybe fetch| method_1bl306q_onafterrenderasync__action_71_branch_71__true
    method_1bl306q_onafterrenderasync__action_71_branch_71__false -->|next| method_1bl306q_onafterrenderasync__action_71_branch_71__merge
    method_1bl306q_onafterrenderasync__action_71_branch_71__merge -->|next| method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__condition
    method_1bl306q_onafterrenderasync__action_71_branch_71__true -->|next| method_1bl306q_onafterrenderasync__action_71_branch_71__merge
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__condition -->|false| method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__false
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__condition -->|true| method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__true
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__false -->|next| method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__merge
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__merge -->|next| method_1bl306q_onafterrenderasync__action_73_state_change_73__linear
    method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__true -->|next| method_1bl306q_onafterrenderasync__action_71_onafterrenderasync_branch_71_0__merge
    method_1bl306q_onafterrenderasync__action_73_state_change_73__linear -->|next| method_1bl306q_onafterrenderasync__action_74_guard_clause_74__condition
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__condition -->|skip| method_1bl306q_onafterrenderasync__action_74_guard_clause_74__false
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__condition -->|fetch| method_1bl306q_onafterrenderasync__action_74_guard_clause_74__true
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__false -->|next| method_1bl306q_onafterrenderasync__action_74_guard_clause_74__merge
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__merge -->|next| method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__condition
    method_1bl306q_onafterrenderasync__action_74_guard_clause_74__true -->|next| method_1bl306q_onafterrenderasync__action_74_guard_clause_74__merge
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__condition -->|false| method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__false
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__condition -->|true| method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__true
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__false -->|next| method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__merge
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__merge -->|next| method_1bl306q_onafterrenderasync__action_76_state_change_76__linear
    method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__true -->|next| method_1bl306q_onafterrenderasync__action_74_onafterrenderasync_branch_74_1__merge
    method_1bl306q_onafterrenderasync__action_76_state_change_76__linear -->|next| method_1bl306q_onafterrenderasync__action_77_onafterrenderasync_await_77_2__await
    method_1bl306q_onafterrenderasync__action_77_onafterrenderasync_await_77_2__await -->|no args| method_1bl306q_onafterrenderasync__call_77_FetchAndStreamAsync
    method_1bl306q_onafterrenderasync__call_77_FetchAndStreamAsync -->|return| method_1bl306q_onafterrenderasync__implicit_return
    method_1bl306q_onafterrenderasync__entry -->|next| method_1bl306q_onafterrenderasync__action_71_branch_71__condition
```

### FetchAndStreamAsync() Control Flow

_Warnings: diagram method_9ujebp_fetchandstreamasync__fragment_diagram exceeds preferred complexity thresholds (38 nodes, 42 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_9ujebp_fetchandstreamasync__call_101_RequestSummaryAndQuizAsync[["RequestSummaryAndQuizAsync"]]
    method_9ujebp_fetchandstreamasync__action_101_fetchandstreamasync_await_101_1__await[["Waits for async work"]]
    method_9ujebp_fetchandstreamasync__action_102_mapping_102__linear("Apply coordinator result to local packet")
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__condition{"string.IsNullOrWhiteSpace(summary)"}
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__false("false")
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__merge("merge")
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__true("true")
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__condition{"string.IsNullOrWhiteSpace(summary)"}
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__false("continue streaming")
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__merge("merge")
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__true("use Dialogue or default message and return")
    method_9ujebp_fetchandstreamasync__action_117_state_change_117__linear("Begin streaming")
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_body[["appends words with Task.Delay(40, token) between words"]]
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_entry("foreach (var word in words)")
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_exit("exit loop")
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_body[["foreach (var word in words)"]]
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_entry("var word in words")
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_exit("Leaves the loop when the condition no longer holds.")
    method_9ujebp_fetchandstreamasync__action_124_cancellation_check_124__linear("Stop streaming if token canceled")
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__condition{"token.IsCancellationRequested"}
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__false("continue")
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__merge("merge")
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__true("exit")
    method_9ujebp_fetchandstreamasync__action_127_fetchandstreamasync_await_127_6__await[["Waits for async work"]]
    method_9ujebp_fetchandstreamasync__action_130_error_handling_130__linear("Suppress OperationCanceledException")
    method_9ujebp_fetchandstreamasync__action_130_fetchandstreamasync_catch_130_7__catch("catch OperationCanceledException")
    method_9ujebp_fetchandstreamasync__action_134_error_handling_134__linear("On unexpected error set fallback text and log")
    method_9ujebp_fetchandstreamasync__action_134_fetchandstreamasync_catch_134_8__catch("catch Exception ex")
    method_9ujebp_fetchandstreamasync__action_139_fetchandstreamasync_finally_139_9__finally("Runs cleanup or finalization")
    method_9ujebp_fetchandstreamasync__action_139_finally_139__finally("Clear streaming flag and refresh UI")
    method_9ujebp_fetchandstreamasync__action_85_side_effect_85__linear("Cancel in-progress stream")
    method_9ujebp_fetchandstreamasync__action_86_side_effect_86__linear("Create new CancellationTokenSource")
    method_9ujebp_fetchandstreamasync__action_89_state_change_89__linear("Set loading/stream flags and clear displayed text/packet")
    method_9ujebp_fetchandstreamasync__action_95_fetchandstreamasync_try_95_0__try("Begins protected execution")
    method_9ujebp_fetchandstreamasync__entry(["FetchAndStreamAsync entry"])
    method_9ujebp_fetchandstreamasync__action_101_external_call_101__linear("Request summary and quiz from coordinator")
    method_9ujebp_fetchandstreamasync__action_114_fetchandstreamasync_return_114_3__return(["Returns result"])
    method_9ujebp_fetchandstreamasync__implicit_return(["return"])
    method_9ujebp_fetchandstreamasync__action_101_external_call_101__linear -->|calls| method_9ujebp_fetchandstreamasync__call_101_RequestSummaryAndQuizAsync
    method_9ujebp_fetchandstreamasync__action_101_fetchandstreamasync_await_101_1__await -->|next| method_9ujebp_fetchandstreamasync__action_101_external_call_101__linear
    method_9ujebp_fetchandstreamasync__action_102_mapping_102__linear -->|next| method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__condition
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__condition -->|false| method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__false
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__condition -->|true| method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__true
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__false -->|next| method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__merge
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__merge -->|return| method_9ujebp_fetchandstreamasync__action_114_fetchandstreamasync_return_114_3__return
    method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__true -->|next| method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__merge
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__condition -->|continue streaming| method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__false
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__condition -->|use Dialogue or default message and return| method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__true
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__false -->|next| method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__merge
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__merge -->|next| method_9ujebp_fetchandstreamasync__action_106_fetchandstreamasync_branch_106_2__condition
    method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__true -->|next| method_9ujebp_fetchandstreamasync__action_106_guard_clause_106__merge
    method_9ujebp_fetchandstreamasync__action_114_fetchandstreamasync_return_114_3__return -->|next| method_9ujebp_fetchandstreamasync__action_117_state_change_117__linear
    method_9ujebp_fetchandstreamasync__action_117_state_change_117__linear -->|next| method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_entry
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_body -->|continue| method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_entry
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_entry -->|append word + delay| method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_body
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_entry -->|break on cancellation| method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_exit
    method_9ujebp_fetchandstreamasync__action_121_loop_121__loop_exit -->|next| method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_entry
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_body -->|continue| method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_entry
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_entry -->|var word in words| method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_body
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_entry -->|Leaves the loop when the condition no longer holds.| method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_exit
    method_9ujebp_fetchandstreamasync__action_122_fetchandstreamasync_loop_122_4__loop_exit -->|next| method_9ujebp_fetchandstreamasync__action_124_cancellation_check_124__linear
    method_9ujebp_fetchandstreamasync__action_124_cancellation_check_124__linear -->|next| method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__condition
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__condition -->|continue| method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__false
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__condition -->|exit| method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__true
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__false -->|next| method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__merge
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__merge -->|next| method_9ujebp_fetchandstreamasync__action_127_fetchandstreamasync_await_127_6__await
    method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__true -->|next| method_9ujebp_fetchandstreamasync__action_124_fetchandstreamasync_guard_clause_124_5__merge
    method_9ujebp_fetchandstreamasync__action_127_fetchandstreamasync_await_127_6__await -->|next| method_9ujebp_fetchandstreamasync__action_130_error_handling_130__linear
    method_9ujebp_fetchandstreamasync__action_130_error_handling_130__linear -->|exception| method_9ujebp_fetchandstreamasync__action_130_fetchandstreamasync_catch_130_7__catch
    method_9ujebp_fetchandstreamasync__action_130_fetchandstreamasync_catch_130_7__catch -->|next| method_9ujebp_fetchandstreamasync__action_134_error_handling_134__linear
    method_9ujebp_fetchandstreamasync__action_134_error_handling_134__linear -->|exception| method_9ujebp_fetchandstreamasync__action_134_fetchandstreamasync_catch_134_8__catch
    method_9ujebp_fetchandstreamasync__action_134_fetchandstreamasync_catch_134_8__catch -->|next| method_9ujebp_fetchandstreamasync__action_139_fetchandstreamasync_finally_139_9__finally
    method_9ujebp_fetchandstreamasync__action_139_fetchandstreamasync_finally_139_9__finally -->|next| method_9ujebp_fetchandstreamasync__action_139_finally_139__finally
    method_9ujebp_fetchandstreamasync__action_139_finally_139__finally -->|return| method_9ujebp_fetchandstreamasync__implicit_return
    method_9ujebp_fetchandstreamasync__action_85_side_effect_85__linear -->|next| method_9ujebp_fetchandstreamasync__action_86_side_effect_86__linear
    method_9ujebp_fetchandstreamasync__action_86_side_effect_86__linear -->|next| method_9ujebp_fetchandstreamasync__action_89_state_change_89__linear
    method_9ujebp_fetchandstreamasync__action_89_state_change_89__linear -->|next| method_9ujebp_fetchandstreamasync__action_95_fetchandstreamasync_try_95_0__try
    method_9ujebp_fetchandstreamasync__action_95_fetchandstreamasync_try_95_0__try -->|next| method_9ujebp_fetchandstreamasync__action_101_fetchandstreamasync_await_101_1__await
    method_9ujebp_fetchandstreamasync__call_101_RequestSummaryAndQuizAsync -->|next| method_9ujebp_fetchandstreamasync__action_102_mapping_102__linear
    method_9ujebp_fetchandstreamasync__entry -->|next| method_9ujebp_fetchandstreamasync__action_85_side_effect_85__linear
```

### HandleActionClick() Control Flow

```mermaid
flowchart TD
    method_1naqltb_handleactionclick__call_150_RequestQuiz[["RequestQuiz"]]
    method_1naqltb_handleactionclick__action_148_branch_148__condition{"action.Contains(\\"quiz\\", StringComparison.OrdinalIgnoreCase)"}
    method_1naqltb_handleactionclick__action_148_branch_148__false("skip")
    method_1naqltb_handleactionclick__action_148_branch_148__merge("merge")
    method_1naqltb_handleactionclick__action_148_branch_148__true("invoke quiz request")
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__condition{"action.Contains(\\"quiz\\", StringComparison.OrdinalIgnoreCase)"}
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__false("false")
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__merge("merge")
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__true("true")
    method_1naqltb_handleactionclick__action_150_handleactionclick_await_150_1__await[["Waits for async work"]]
    method_1naqltb_handleactionclick__action_153_event_153__linear("Invoke external callback when attached")
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__condition{"OnActionTriggered.HasDelegate"}
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__false("false")
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__merge("merge")
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__true("true")
    method_1naqltb_handleactionclick__action_155_handleactionclick_await_155_3__await[["Waits for async work"]]
    method_1naqltb_handleactionclick__entry(["HandleActionClick entry"])
    method_1naqltb_handleactionclick__implicit_return(["return"])
    method_1naqltb_handleactionclick__action_148_branch_148__condition -->|skip| method_1naqltb_handleactionclick__action_148_branch_148__false
    method_1naqltb_handleactionclick__action_148_branch_148__condition -->|invoke quiz request| method_1naqltb_handleactionclick__action_148_branch_148__true
    method_1naqltb_handleactionclick__action_148_branch_148__false -->|next| method_1naqltb_handleactionclick__action_148_branch_148__merge
    method_1naqltb_handleactionclick__action_148_branch_148__merge -->|next| method_1naqltb_handleactionclick__action_150_handleactionclick_await_150_1__await
    method_1naqltb_handleactionclick__action_148_branch_148__true -->|next| method_1naqltb_handleactionclick__action_148_branch_148__merge
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__condition -->|false| method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__false
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__condition -->|true| method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__true
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__false -->|next| method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__merge
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__merge -->|next| method_1naqltb_handleactionclick__action_148_branch_148__condition
    method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__true -->|next| method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__merge
    method_1naqltb_handleactionclick__action_150_handleactionclick_await_150_1__await -->|ContextBlockId string| method_1naqltb_handleactionclick__call_150_RequestQuiz
    method_1naqltb_handleactionclick__action_153_event_153__linear -->|next| method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__condition
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__condition -->|false| method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__false
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__condition -->|true| method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__true
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__false -->|next| method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__merge
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__merge -->|next| method_1naqltb_handleactionclick__action_155_handleactionclick_await_155_3__await
    method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__true -->|next| method_1naqltb_handleactionclick__action_153_handleactionclick_branch_153_2__merge
    method_1naqltb_handleactionclick__action_155_handleactionclick_await_155_3__await -->|return| method_1naqltb_handleactionclick__implicit_return
    method_1naqltb_handleactionclick__call_150_RequestQuiz -->|next| method_1naqltb_handleactionclick__action_153_event_153__linear
    method_1naqltb_handleactionclick__entry -->|next| method_1naqltb_handleactionclick__action_148_handleactionclick_branch_148_0__condition
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 4 unresolved jumps.
- Warning: control-flow: diagram method_16cvbhq_onparameterssetasync__fragment_diagram exceeds preferred complexity thresholds (23 nodes, 26 edges).
- Warning: control-flow: diagram method_1bl306q_onafterrenderasync__fragment_diagram exceeds preferred complexity thresholds (22 nodes, 25 edges).
- Warning: control-flow: diagram method_9ujebp_fetchandstreamasync__fragment_diagram exceeds preferred complexity thresholds (38 nodes, 42 edges).
