Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Friend-only readiness evidence for MASNavigationRail. It records that this
    ''' stage owns only the visual same-surface rail, item selection, keyboard/pointer
    ''' interaction, RTL layout, and official MAS surface routing. App route catalogs,
    ''' PageHost ownership, drawer replacement, content hosting, native menus, and
    ''' mouse-click outer focus rings remain outside this control.
    ''' </summary>
    Friend NotInheritable Class MASNavigationRailReadinessManifest
        Friend Sub New(status As MASNavigationRailReadinessStatus,
                       hasOfficialControlSurface As Boolean,
                       hasNoAppRouterPath As Boolean,
                       hasNoPageHostOwnershipPath As Boolean,
                       hasNoDrawerReplacementPath As Boolean,
                       hasNoContentHostingPath As Boolean,
                       hasNoNativeMenuPath As Boolean,
                       hasMouseFocusRingSuppressed As Boolean)
            Me.Status = status
            Me.HasOfficialControlSurface = hasOfficialControlSurface
            Me.HasNoAppRouterPath = hasNoAppRouterPath
            Me.HasNoPageHostOwnershipPath = hasNoPageHostOwnershipPath
            Me.HasNoDrawerReplacementPath = hasNoDrawerReplacementPath
            Me.HasNoContentHostingPath = hasNoContentHostingPath
            Me.HasNoNativeMenuPath = hasNoNativeMenuPath
            Me.HasMouseFocusRingSuppressed = hasMouseFocusRingSuppressed
        End Sub

        Friend ReadOnly Property Status As MASNavigationRailReadinessStatus
        Friend ReadOnly Property HasOfficialControlSurface As Boolean
        Friend ReadOnly Property HasNoAppRouterPath As Boolean
        Friend ReadOnly Property HasNoPageHostOwnershipPath As Boolean
        Friend ReadOnly Property HasNoDrawerReplacementPath As Boolean
        Friend ReadOnly Property HasNoContentHostingPath As Boolean
        Friend ReadOnly Property HasNoNativeMenuPath As Boolean
        Friend ReadOnly Property HasMouseFocusRingSuppressed As Boolean

        Friend Shared Function CreateDefault() As MASNavigationRailReadinessManifest
            Dim officialSurface As Boolean = True
            Dim noRouter As Boolean = MASNavigationRailPolicy.HasNoAppRouterPath()
            Dim noPageHost As Boolean = MASNavigationRailPolicy.HasNoPageHostOwnershipPath()
            Dim noDrawer As Boolean = MASNavigationRailPolicy.HasNoDrawerReplacementPath()
            Dim noContentHosting As Boolean = MASNavigationRailPolicy.HasNoContentHostingPath()
            Dim noNativeMenu As Boolean = MASNavigationRailPolicy.HasNoNativeMenuPath()
            Dim focusRingSuppressed As Boolean = MASNavigationRailPolicy.HasMouseFocusRingSuppressed()
            Dim status As MASNavigationRailReadinessStatus = MASNavigationRailReadinessStatus.Ready

            If Not officialSurface Then status = MASNavigationRailReadinessStatus.IncompleteEvidence
            If Not noRouter Then status = MASNavigationRailReadinessStatus.BlockedByAppRouterLeak
            If Not noPageHost Then status = MASNavigationRailReadinessStatus.BlockedByPageHostOwnershipLeak
            If Not noDrawer Then status = MASNavigationRailReadinessStatus.BlockedByDrawerReplacementLeak
            If Not noContentHosting Then status = MASNavigationRailReadinessStatus.BlockedByContentHostingLeak
            If Not noNativeMenu Then status = MASNavigationRailReadinessStatus.BlockedByNativeMenuLeak
            If Not focusRingSuppressed Then status = MASNavigationRailReadinessStatus.BlockedByMouseFocusRingLeak

            Return New MASNavigationRailReadinessManifest(
                status:=status,
                hasOfficialControlSurface:=officialSurface,
                hasNoAppRouterPath:=noRouter,
                hasNoPageHostOwnershipPath:=noPageHost,
                hasNoDrawerReplacementPath:=noDrawer,
                hasNoContentHostingPath:=noContentHosting,
                hasNoNativeMenuPath:=noNativeMenu,
                hasMouseFocusRingSuppressed:=focusRingSuppressed)
        End Function
    End Class

End Namespace
