# ReconnectModal.razor

- File ID: file:1wkle85:reconnectmodal-razor-js
- Path: NexusReader.UI.Shared/Layout/ReconnectModal.razor.js
- Role: ui-component
- Layer: frontend

## Purpose

Client-side script for the Reconnect modal component: attaches UI event handlers and orchestrates reconnect/resume flows (using Blazor interop), handling retries, visibility-driven retries, and fallback reloads.

## Key Details

Orchestrates reconnect/resume flows with three outcome semantics from Blazor.reconnect (true = success, false = server reached but circuit rejected, throw = server unreachable). Uses visibility events to defer retries when offline/unreachable.

## Symbols

- <module_init>(): Top-level initialization: obtains DOM elements and registers event listeners for reconnect state and button clicks.
- handleReconnectStateChanged(): Handles incoming reconnect-state change events and performs UI actions (show/hide modal), schedules visibility-driven retries, or forces page reload on rejection.
- retry(): Attempts to reconnect via Blazor.reconnect; if server reachable but circuit rejected attempts resume, otherwise reloads; on network error schedules visibility-driven retry.
- resume(): Attempts to resume an existing circuit via Blazor.resumeCircuit; reloads on failure or toggles UI class on exception.
- retryWhenDocumentBecomesVisible(): Visibility-change handler that triggers retry() when the document becomes visible.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: unknown (Blazor interop and browser DOM APIs referenced)
- call-target: self
- call-target: self
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: self
- call-target: unknown
- call-target: unknown
- call-target: unknown
- call-target: self

## Coverage

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

## Control Flow Fragments

- <module_init>: 9 nodes, 8 edges, 3 jumps, 0 unsupported constructs
- handleReconnectStateChanged: 39 nodes, 46 edges, 4 jumps, 0 unsupported constructs
- retry: 37 nodes, 42 edges, 6 jumps, 0 unsupported constructs
- resume: 17 nodes, 18 edges, 3 jumps, 0 unsupported constructs
- retryWhenDocumentBecomesVisible: 18 nodes, 21 edges, 1 jumps, 0 unsupported constructs

## Diagrams

### ReconnectModal.razor Neighborhood

```mermaid
flowchart LR
    file_1wkle85_reconnectmodal_razor_js("ReconnectModal.razor")
    method_12nt8as_resume[["resume()"]]
    method_15ixuxd_module_init[["<module_init>()"]]
    method_1js2qbs_retrywhendocumentbecomesvisible[["retryWhenDocumentBecomesVisible()"]]
    method_1n08b99_handlereconnectstatechanged[["handleReconnectStateChanged()"]]
    method_mdoq3y_retry[["retry()"]]
```

### ReconnectModal.razor Execution Overview

_Warnings: diagram file_1wkle85_reconnectmodal_razor_js_execution_view exceeds preferred complexity thresholds (23 nodes, 22 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    file_1wkle85_reconnectmodal_razor_js("ReconnectModal.razor")
    method_12nt8as_resume[["resume()"]]
    method_15ixuxd_module_init[["<module_init>()"]]
    method_1js2qbs_retrywhendocumentbecomesvisible[["retryWhenDocumentBecomesVisible()"]]
    method_1n08b99_handlereconnectstatechanged[["handleReconnectStateChanged()"]]
    method_mdoq3y_retry[["retry()"]]
    unresolved_unresolved_10kruh6_call_target{"Unresolved: resume"}
    unresolved_unresolved_11ky44a_call_target{"Unresolved: location.reload"}
    unresolved_unresolved_1drhmzn_call_target{"Unresolved: location.reload"}
    unresolved_unresolved_1pbt6sg_call_target{"Unresolved: retryWhenDocumentBecomesVisible"}
    unresolved_unresolved_1q5jveu_call_target{"Unresolved: reconnectModal.classList.replace"}
    unresolved_unresolved_1sxr8qr_call_target{"Unresolved: Blazor.resumeCircuit"}
    unresolved_unresolved_1w3gmn3_call_target{"Unresolved: retry"}
    unresolved_unresolved_1yjs71m_call_target{"Unresolved: retryWhenDocumentBecomesVisible"}
    unresolved_unresolved_3slkrk_call_target{"Unresolved: document.removeEventListener"}
    unresolved_unresolved_5x2oyh_call_target{"Unresolved: retry"}
    unresolved_unresolved_66tchk_call_target{"Unresolved: Blazor.resumeCircuit"}
    unresolved_unresolved_8mchpn_call_target{"Unresolved: handleReconnectStateChanged"}
    unresolved_unresolved_f7i5v_call_target{"Unresolved: reconnectModal.close"}
    unresolved_unresolved_m2lwlj_call_target{"Unresolved: reconnectModal.showModal"}
    unresolved_unresolved_psft95_call_target{"Unresolved: reconnectModal.close"}
    unresolved_unresolved_ulfrfc_call_target{"Unresolved: Blazor.reconnect"}
    unresolved_unresolved_wqabat_call_target{"Unresolved: location.reload"}
    file_1wkle85_reconnectmodal_razor_js -->|contains| method_12nt8as_resume
    file_1wkle85_reconnectmodal_razor_js -->|contains| method_15ixuxd_module_init
    file_1wkle85_reconnectmodal_razor_js -->|contains| method_1js2qbs_retrywhendocumentbecomesvisible
    file_1wkle85_reconnectmodal_razor_js -->|contains| method_1n08b99_handlereconnectstatechanged
    file_1wkle85_reconnectmodal_razor_js -->|contains| method_mdoq3y_retry
    method_12nt8as_resume -->|unresolved call| unresolved_unresolved_11ky44a_call_target
    method_12nt8as_resume -->|unresolved call| unresolved_unresolved_1q5jveu_call_target
    method_12nt8as_resume -->|unresolved call| unresolved_unresolved_66tchk_call_target
    method_15ixuxd_module_init -->|unresolved call| unresolved_unresolved_10kruh6_call_target
    method_15ixuxd_module_init -->|unresolved call| unresolved_unresolved_5x2oyh_call_target
    method_15ixuxd_module_init -->|unresolved call| unresolved_unresolved_8mchpn_call_target
    method_1js2qbs_retrywhendocumentbecomesvisible -->|unresolved call| unresolved_unresolved_1w3gmn3_call_target
    method_1n08b99_handlereconnectstatechanged -->|unresolved call| unresolved_unresolved_1yjs71m_call_target
    method_1n08b99_handlereconnectstatechanged -->|unresolved call| unresolved_unresolved_m2lwlj_call_target
    method_1n08b99_handlereconnectstatechanged -->|unresolved call| unresolved_unresolved_psft95_call_target
    method_1n08b99_handlereconnectstatechanged -->|unresolved call| unresolved_unresolved_wqabat_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_1drhmzn_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_1pbt6sg_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_1sxr8qr_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_3slkrk_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_f7i5v_call_target
    method_mdoq3y_retry -->|unresolved call| unresolved_unresolved_ulfrfc_call_target
```

### handleReconnectStateChanged() Control Flow

_Warnings: diagram method_1n08b99_handlereconnectstatechanged__fragment_diagram exceeds preferred complexity thresholds (39 nodes, 46 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_1n08b99_handlereconnectstatechanged__call_13_reconnectModal_showModal[["reconnectModal.showModal"]]
    method_1n08b99_handlereconnectstatechanged__call_15_reconnectModal_close[["reconnectModal.close"]]
    method_1n08b99_handlereconnectstatechanged__call_17_retryWhenDocumentBecomesVisible[["retryWhenDocumentBecomesVisible"]]
    method_1n08b99_handlereconnectstatechanged__call_19_location_reload[["location.reload"]]
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__condition{"event.detail.state === 'show' | 'hide' | 'failed' | 'rejected'"}
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__false("hide -> close modal")
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__true("show -> show modal")
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__condition{"event.detail.state === \\"show\\""}
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__false("false")
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__true("true")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__condition{"event.detail.state === \\"hide\\""}
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__false("false")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__true("true")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__condition{"Falls back to alternate path"}
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__false("otherwise")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__true("fallback")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__condition{"event.detail.state === \\"failed\\""}
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__false("false")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__true("true")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__condition{"Falls back to alternate path"}
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__false("otherwise")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__true("fallback")
    method_1n08b99_handlereconnectstatechanged__action_17_event_registration_17__linear("Schedules retry on visibilitychange when failed")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__condition{"event.detail.state === \\"rejected\\""}
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__false("false")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__true("true")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__condition{"Falls back to alternate path"}
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__false("otherwise")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__merge("merge")
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__true("fallback")
    method_1n08b99_handlereconnectstatechanged__entry(["handleReconnectStateChanged entry"])
    method_1n08b99_handlereconnectstatechanged__implicit_return(["return"])
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__condition -->|hide -> close modal| method_1n08b99_handlereconnectstatechanged__action_12_branch_12__false
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__condition -->|show -> show modal| method_1n08b99_handlereconnectstatechanged__action_12_branch_12__true
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__false -->|next| method_1n08b99_handlereconnectstatechanged__action_12_branch_12__merge
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__merge -->|next| method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__condition
    method_1n08b99_handlereconnectstatechanged__action_12_branch_12__true -->|next| method_1n08b99_handlereconnectstatechanged__action_12_branch_12__merge
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__condition -->|false| method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__false
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__condition -->|true| method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__true
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__false -->|next| method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__merge
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__merge -->|none| method_1n08b99_handlereconnectstatechanged__call_13_reconnectModal_showModal
    method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__true -->|next| method_1n08b99_handlereconnectstatechanged__action_12_handlereconnectstatechanged_branch_12_0__merge
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__condition -->|false| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__false
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__condition -->|true| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__true
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__false -->|next| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__merge
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__merge -->|none| method_1n08b99_handlereconnectstatechanged__call_15_reconnectModal_close
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__true -->|next| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__merge
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__condition -->|otherwise| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__false
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__condition -->|fallback| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__true
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__false -->|next| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__merge
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__merge -->|next| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_branch_14_1__condition
    method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__true -->|next| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__merge
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__condition -->|false| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__false
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__condition -->|true| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__true
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__false -->|next| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__merge
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__merge -->|next| method_1n08b99_handlereconnectstatechanged__action_17_event_registration_17__linear
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__true -->|next| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__merge
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__condition -->|otherwise| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__false
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__condition -->|fallback| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__true
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__false -->|next| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__merge
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__merge -->|next| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_branch_16_3__condition
    method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__true -->|next| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__merge
    method_1n08b99_handlereconnectstatechanged__action_17_event_registration_17__linear -->|registered as visibilitychange handler| method_1n08b99_handlereconnectstatechanged__call_17_retryWhenDocumentBecomesVisible
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__condition -->|false| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__false
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__condition -->|true| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__true
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__false -->|next| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__merge
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__merge -->|none| method_1n08b99_handlereconnectstatechanged__call_19_location_reload
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__true -->|next| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__merge
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__condition -->|otherwise| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__false
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__condition -->|fallback| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__true
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__false -->|next| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__merge
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__merge -->|next| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_branch_18_5__condition
    method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__true -->|next| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__merge
    method_1n08b99_handlereconnectstatechanged__call_13_reconnectModal_showModal -->|fallback| method_1n08b99_handlereconnectstatechanged__action_14_handlereconnectstatechanged_fallback_14_2__condition
    method_1n08b99_handlereconnectstatechanged__call_15_reconnectModal_close -->|fallback| method_1n08b99_handlereconnectstatechanged__action_16_handlereconnectstatechanged_fallback_16_4__condition
    method_1n08b99_handlereconnectstatechanged__call_17_retryWhenDocumentBecomesVisible -->|fallback| method_1n08b99_handlereconnectstatechanged__action_18_handlereconnectstatechanged_fallback_18_6__condition
    method_1n08b99_handlereconnectstatechanged__call_19_location_reload -->|return| method_1n08b99_handlereconnectstatechanged__implicit_return
    method_1n08b99_handlereconnectstatechanged__entry -->|next| method_1n08b99_handlereconnectstatechanged__action_12_branch_12__condition
```

### retry() Control Flow

_Warnings: diagram method_mdoq3y_retry__fragment_diagram exceeds preferred complexity thresholds (37 nodes, 42 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_mdoq3y_retry__call_24_document_removeEventListener[["document.removeEventListener"]]
    method_mdoq3y_retry__call_31_Blazor_reconnect[["Blazor.reconnect"]]
    method_mdoq3y_retry__call_35_Blazor_resumeCircuit[["Blazor.resumeCircuit"]]
    method_mdoq3y_retry__call_37_location_reload[["location.reload"]]
    method_mdoq3y_retry__call_39_reconnectModal_close[["reconnectModal.close"]]
    method_mdoq3y_retry__call_44_retryWhenDocumentBecomesVisible[["retryWhenDocumentBecomesVisible"]]
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_body[["async function retry() {"]]
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_entry("Retries work after a recoverable failure")
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_exit("Stops retrying when the attempt budget is exhausted or the call succeeds.")
    method_mdoq3y_retry__action_24_guard_clause_24__condition{"always executed at start"}
    method_mdoq3y_retry__action_24_guard_clause_24__false("otherwise")
    method_mdoq3y_retry__action_24_guard_clause_24__merge("merge")
    method_mdoq3y_retry__action_24_guard_clause_24__true("listener removed")
    method_mdoq3y_retry__action_26_retry_try_26_1__try("Begins protected execution")
    method_mdoq3y_retry__action_26_try_catch_26__linear("Network call with fallback")
    method_mdoq3y_retry__action_31_branch_31__condition{"successful === true | false | throws"}
    method_mdoq3y_retry__action_31_branch_31__false("true -> implicit success (no UI change here)")
    method_mdoq3y_retry__action_31_branch_31__merge("merge")
    method_mdoq3y_retry__action_31_branch_31__true("false -> attempt resumeCircuit")
    method_mdoq3y_retry__action_31_retry_await_31_2__await[["Waits for async work"]]
    method_mdoq3y_retry__action_32_retry_branch_32_3__condition{"!successful"}
    method_mdoq3y_retry__action_32_retry_branch_32_3__false("false")
    method_mdoq3y_retry__action_32_retry_branch_32_3__merge("merge")
    method_mdoq3y_retry__action_32_retry_branch_32_3__true("true")
    method_mdoq3y_retry__action_35_retry_await_35_4__await[["Waits for async work"]]
    method_mdoq3y_retry__action_36_retry_branch_36_5__condition{"!resumeSuccessful"}
    method_mdoq3y_retry__action_36_retry_branch_36_5__false("false")
    method_mdoq3y_retry__action_36_retry_branch_36_5__merge("merge")
    method_mdoq3y_retry__action_36_retry_branch_36_5__true("true")
    method_mdoq3y_retry__action_38_retry_fallback_38_6__condition{"Falls back to alternate path"}
    method_mdoq3y_retry__action_38_retry_fallback_38_6__false("otherwise")
    method_mdoq3y_retry__action_38_retry_fallback_38_6__merge("merge")
    method_mdoq3y_retry__action_38_retry_fallback_38_6__true("fallback")
    method_mdoq3y_retry__action_42_retry_catch_42_7__catch("catch err")
    method_mdoq3y_retry__action_44_event_registration_44__linear("Schedules visibility retry on exception")
    method_mdoq3y_retry__entry(["retry entry"])
    method_mdoq3y_retry__implicit_return(["return"])
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_body -->|retry| method_mdoq3y_retry__action_23_retry_retry_23_0__loop_entry
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_entry -->|retry| method_mdoq3y_retry__action_23_retry_retry_23_0__loop_body
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_entry -->|Stops retrying when the attempt budget is exhausted or the call succeeds.| method_mdoq3y_retry__action_23_retry_retry_23_0__loop_exit
    method_mdoq3y_retry__action_23_retry_retry_23_0__loop_exit -->|next| method_mdoq3y_retry__action_24_guard_clause_24__condition
    method_mdoq3y_retry__action_24_guard_clause_24__condition -->|otherwise| method_mdoq3y_retry__action_24_guard_clause_24__false
    method_mdoq3y_retry__action_24_guard_clause_24__condition -->|listener removed| method_mdoq3y_retry__action_24_guard_clause_24__true
    method_mdoq3y_retry__action_24_guard_clause_24__false -->|next| method_mdoq3y_retry__action_24_guard_clause_24__merge
    method_mdoq3y_retry__action_24_guard_clause_24__merge -->|removes visibilitychange handler retryWhenDocumentBecomesVisible| method_mdoq3y_retry__call_24_document_removeEventListener
    method_mdoq3y_retry__action_24_guard_clause_24__true -->|next| method_mdoq3y_retry__action_24_guard_clause_24__merge
    method_mdoq3y_retry__action_26_retry_try_26_1__try -->|next| method_mdoq3y_retry__action_31_retry_await_31_2__await
    method_mdoq3y_retry__action_26_try_catch_26__linear -->|next| method_mdoq3y_retry__action_26_retry_try_26_1__try
    method_mdoq3y_retry__action_31_branch_31__condition -->|true -> implicit success no UI change here| method_mdoq3y_retry__action_31_branch_31__false
    method_mdoq3y_retry__action_31_branch_31__condition -->|false -> attempt resumeCircuit| method_mdoq3y_retry__action_31_branch_31__true
    method_mdoq3y_retry__action_31_branch_31__false -->|next| method_mdoq3y_retry__action_31_branch_31__merge
    method_mdoq3y_retry__action_31_branch_31__merge -->|awaits reconnect returns true false throws| method_mdoq3y_retry__call_31_Blazor_reconnect
    method_mdoq3y_retry__action_31_branch_31__true -->|next| method_mdoq3y_retry__action_31_branch_31__merge
    method_mdoq3y_retry__action_31_retry_await_31_2__await -->|next| method_mdoq3y_retry__action_31_branch_31__condition
    method_mdoq3y_retry__action_32_retry_branch_32_3__condition -->|false| method_mdoq3y_retry__action_32_retry_branch_32_3__false
    method_mdoq3y_retry__action_32_retry_branch_32_3__condition -->|true| method_mdoq3y_retry__action_32_retry_branch_32_3__true
    method_mdoq3y_retry__action_32_retry_branch_32_3__false -->|next| method_mdoq3y_retry__action_32_retry_branch_32_3__merge
    method_mdoq3y_retry__action_32_retry_branch_32_3__merge -->|next| method_mdoq3y_retry__action_35_retry_await_35_4__await
    method_mdoq3y_retry__action_32_retry_branch_32_3__true -->|next| method_mdoq3y_retry__action_32_retry_branch_32_3__merge
    method_mdoq3y_retry__action_35_retry_await_35_4__await -->|attempts to resume server circuit when reconnect reached server but was rejected| method_mdoq3y_retry__call_35_Blazor_resumeCircuit
    method_mdoq3y_retry__action_36_retry_branch_36_5__condition -->|false| method_mdoq3y_retry__action_36_retry_branch_36_5__false
    method_mdoq3y_retry__action_36_retry_branch_36_5__condition -->|true| method_mdoq3y_retry__action_36_retry_branch_36_5__true
    method_mdoq3y_retry__action_36_retry_branch_36_5__false -->|next| method_mdoq3y_retry__action_36_retry_branch_36_5__merge
    method_mdoq3y_retry__action_36_retry_branch_36_5__merge -->|reloads page when resume failed| method_mdoq3y_retry__call_37_location_reload
    method_mdoq3y_retry__action_36_retry_branch_36_5__true -->|next| method_mdoq3y_retry__action_36_retry_branch_36_5__merge
    method_mdoq3y_retry__action_38_retry_fallback_38_6__condition -->|otherwise| method_mdoq3y_retry__action_38_retry_fallback_38_6__false
    method_mdoq3y_retry__action_38_retry_fallback_38_6__condition -->|fallback| method_mdoq3y_retry__action_38_retry_fallback_38_6__true
    method_mdoq3y_retry__action_38_retry_fallback_38_6__false -->|next| method_mdoq3y_retry__action_38_retry_fallback_38_6__merge
    method_mdoq3y_retry__action_38_retry_fallback_38_6__merge -->|closes modal when resume succeeded| method_mdoq3y_retry__call_39_reconnectModal_close
    method_mdoq3y_retry__action_38_retry_fallback_38_6__true -->|next| method_mdoq3y_retry__action_38_retry_fallback_38_6__merge
    method_mdoq3y_retry__action_42_retry_catch_42_7__catch -->|next| method_mdoq3y_retry__action_44_event_registration_44__linear
    method_mdoq3y_retry__action_44_event_registration_44__linear -->|registered on visibilitychange in catch path| method_mdoq3y_retry__call_44_retryWhenDocumentBecomesVisible
    method_mdoq3y_retry__call_24_document_removeEventListener -->|next| method_mdoq3y_retry__action_26_try_catch_26__linear
    method_mdoq3y_retry__call_31_Blazor_reconnect -->|next| method_mdoq3y_retry__action_32_retry_branch_32_3__condition
    method_mdoq3y_retry__call_35_Blazor_resumeCircuit -->|next| method_mdoq3y_retry__action_36_retry_branch_36_5__condition
    method_mdoq3y_retry__call_37_location_reload -->|fallback| method_mdoq3y_retry__action_38_retry_fallback_38_6__condition
    method_mdoq3y_retry__call_39_reconnectModal_close -->|exception| method_mdoq3y_retry__action_42_retry_catch_42_7__catch
    method_mdoq3y_retry__call_44_retryWhenDocumentBecomesVisible -->|return| method_mdoq3y_retry__implicit_return
    method_mdoq3y_retry__entry -->|next| method_mdoq3y_retry__action_23_retry_retry_23_0__loop_entry
```

### resume() Control Flow

```mermaid
flowchart TD
    method_12nt8as_resume__call_50_Blazor_resumeCircuit[["Blazor.resumeCircuit"]]
    method_12nt8as_resume__call_52_location_reload[["location.reload"]]
    method_12nt8as_resume__call_55_reconnectModal_classList_replace[["reconnectModal.classList.replace"]]
    method_12nt8as_resume__action_49_resume_try_49_0__try("Begins protected execution")
    method_12nt8as_resume__action_49_try_catch_49__linear("Attempt resume with fallback UI update")
    method_12nt8as_resume__action_50_resume_await_50_1__await[["Waits for async work"]]
    method_12nt8as_resume__action_51_branch_51__condition{"successful === false triggers reload"}
    method_12nt8as_resume__action_51_branch_51__false("close/noop")
    method_12nt8as_resume__action_51_branch_51__merge("merge")
    method_12nt8as_resume__action_51_branch_51__true("reload")
    method_12nt8as_resume__action_51_resume_branch_51_2__condition{"!successful"}
    method_12nt8as_resume__action_51_resume_branch_51_2__false("false")
    method_12nt8as_resume__action_51_resume_branch_51_2__merge("merge")
    method_12nt8as_resume__action_51_resume_branch_51_2__true("true")
    method_12nt8as_resume__action_54_resume_catch_54_3__catch("Handles exception path")
    method_12nt8as_resume__entry(["resume entry"])
    method_12nt8as_resume__implicit_return(["return"])
    method_12nt8as_resume__action_49_resume_try_49_0__try -->|next| method_12nt8as_resume__action_49_try_catch_49__linear
    method_12nt8as_resume__action_49_try_catch_49__linear -->|next| method_12nt8as_resume__action_50_resume_await_50_1__await
    method_12nt8as_resume__action_50_resume_await_50_1__await -->|awaits resume result boolean| method_12nt8as_resume__call_50_Blazor_resumeCircuit
    method_12nt8as_resume__action_51_branch_51__condition -->|close / noop| method_12nt8as_resume__action_51_branch_51__false
    method_12nt8as_resume__action_51_branch_51__condition -->|reload| method_12nt8as_resume__action_51_branch_51__true
    method_12nt8as_resume__action_51_branch_51__false -->|next| method_12nt8as_resume__action_51_branch_51__merge
    method_12nt8as_resume__action_51_branch_51__merge -->|next| method_12nt8as_resume__action_51_resume_branch_51_2__condition
    method_12nt8as_resume__action_51_branch_51__true -->|next| method_12nt8as_resume__action_51_branch_51__merge
    method_12nt8as_resume__action_51_resume_branch_51_2__condition -->|false| method_12nt8as_resume__action_51_resume_branch_51_2__false
    method_12nt8as_resume__action_51_resume_branch_51_2__condition -->|true| method_12nt8as_resume__action_51_resume_branch_51_2__true
    method_12nt8as_resume__action_51_resume_branch_51_2__false -->|next| method_12nt8as_resume__action_51_resume_branch_51_2__merge
    method_12nt8as_resume__action_51_resume_branch_51_2__merge -->|reloads when resume returned false| method_12nt8as_resume__call_52_location_reload
    method_12nt8as_resume__action_51_resume_branch_51_2__true -->|next| method_12nt8as_resume__action_51_resume_branch_51_2__merge
    method_12nt8as_resume__action_54_resume_catch_54_3__catch -->|replaces paused CSS class with resume-failed on exception| method_12nt8as_resume__call_55_reconnectModal_classList_replace
    method_12nt8as_resume__call_50_Blazor_resumeCircuit -->|next| method_12nt8as_resume__action_51_branch_51__condition
    method_12nt8as_resume__call_52_location_reload -->|exception| method_12nt8as_resume__action_54_resume_catch_54_3__catch
    method_12nt8as_resume__call_55_reconnectModal_classList_replace -->|return| method_12nt8as_resume__implicit_return
    method_12nt8as_resume__entry -->|next| method_12nt8as_resume__action_49_resume_try_49_0__try
```

### retryWhenDocumentBecomesVisible() Control Flow

```mermaid
flowchart TD
    method_1js2qbs_retrywhendocumentbecomesvisible__call_61_retry[["retry"]]
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_body[["async function retryWhenDocumentBecomesVisible() {"]]
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_entry("Retries work after a recoverable failure")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_exit("Stops retrying when the attempt budget is exhausted or the call succeeds.")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__condition{"document.visibilityState === 'visible'"}
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__false("not visible -> no-op")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__merge("merge")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__true("visible -> call retry")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__condition{"document.visibilityState === \\"visible\\""}
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__false("false")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__merge("merge")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__true("true")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_await_61_3__await[["Waits for async work"]]
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_body[["await retry();"]]
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_entry("Retries work after a recoverable failure")
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_exit("Stops retrying when the attempt budget is exhausted or the call succeeds.")
    method_1js2qbs_retrywhendocumentbecomesvisible__entry(["retryWhenDocumentBecomesVisible entry"])
    method_1js2qbs_retrywhendocumentbecomesvisible__implicit_return(["return"])
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_body -->|retry| method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_entry
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_entry -->|retry| method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_body
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_entry -->|Stops retrying when the attempt budget is exhausted or the call succeeds.| method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_exit
    method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_exit -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__condition
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__condition -->|not visible -> no-op| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__false
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__condition -->|visible -> call retry| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__true
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__false -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__merge
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__merge -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__condition
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__true -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_guard_clause_60__merge
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__condition -->|false| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__false
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__condition -->|true| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__true
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__false -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__merge
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__merge -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_await_61_3__await
    method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__true -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_60_retrywhendocumentbecomesvisible_branch_60_1__merge
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_await_61_3__await -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_entry
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_body -->|retry| method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_entry
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_entry -->|retry| method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_body
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_entry -->|Stops retrying when the attempt budget is exhausted or the call succeeds.| method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_exit
    method_1js2qbs_retrywhendocumentbecomesvisible__action_61_retrywhendocumentbecomesvisible_retry_61_2__loop_exit -->|calls| method_1js2qbs_retrywhendocumentbecomesvisible__call_61_retry
    method_1js2qbs_retrywhendocumentbecomesvisible__call_61_retry -->|return| method_1js2qbs_retrywhendocumentbecomesvisible__implicit_return
    method_1js2qbs_retrywhendocumentbecomesvisible__entry -->|next| method_1js2qbs_retrywhendocumentbecomesvisible__action_59_retrywhendocumentbecomesvisible_retry_59_0__loop_entry
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 11 unresolved jumps.
- Warning: execution-overview: diagram file_1wkle85_reconnectmodal_razor_js_execution_view exceeds preferred complexity thresholds (23 nodes, 22 edges).
- Warning: control-flow: diagram method_1n08b99_handlereconnectstatechanged__fragment_diagram exceeds preferred complexity thresholds (39 nodes, 46 edges).
- Warning: control-flow: diagram method_mdoq3y_retry__fragment_diagram exceeds preferred complexity thresholds (37 nodes, 42 edges).
