[{"name":"Navigation","comment":" Port-based SPA navigation for `Browser.element`.\n\nThis module provides helpers for navigating with ports instead of\nusing `Browser.application`. Your application defines two ports:\n\n    port navCmd : Nav.CommandPort msg\n\n    port onNavEvent : Nav.EventPort msg\n\nThen use [`pushUrl`](#pushUrl), [`replaceUrl`](#replaceUrl), and\n[`pushState`](#pushState) to send navigation commands, and\n[`onEvent`](#onEvent) to subscribe to navigation events.\n\nUse [`back`](#back) and [`forward`](#forward) to traverse history.\n\nNote: The History API only accepts same-origin URLs.\nAll navigation commands produce relative URL strings via `AppUrl`,\nwhich are always same-origin by construction.\n\n\n# Port Types\n\n@docs CommandPort, EventPort\n\n\n# Commands\n\n@docs pushUrl, replaceUrl, pushState\n\n\n# History Traversal\n\n@docs back, forward\n\n\n# Events\n\n@docs Event, decoder, onEvent\n\n","unions":[],"aliases":[{"name":"CommandPort","comment":" Type alias for an outgoing command port.\n\nDeclare this in your port module:\n\n    port navCmd : Nav.CommandPort msg\n\n","args":["msg"],"type":"Json.Encode.Value -> Platform.Cmd.Cmd msg"},{"name":"Event","comment":" Data sent by the JS companion after a navigation event.\n\n  - `appUrl` — the parsed `AppUrl` (path, query parameters, fragment)\n  - `state` — the history state object, or `null` if none was set\n\n","args":[],"type":"{ appUrl : AppUrl.AppUrl, state : Json.Decode.Value }"},{"name":"EventPort","comment":" Type alias for an incoming event port.\n\nDeclare this in your port module:\n\n    port onNavEvent : Nav.EventPort msg\n\n","args":["msg"],"type":"(Json.Decode.Value -> msg) -> Platform.Sub.Sub msg"}],"values":[{"name":"back","comment":" Go back by the given number of steps in session history.\n\nCalls `history.go(-n)`. The existing `popstate` listener handles\nthe resulting navigation event automatically.\n\n    Nav.back navCmd 1 -- equivalent to pressing the browser Back button\n\n    Nav.back navCmd 2 -- go back two pages\n\n","type":"Navigation.CommandPort msg -> Basics.Int -> Platform.Cmd.Cmd msg"},{"name":"decoder","comment":" Decode a navigation event from the JS companion.\n\nDecodes the `href` field into an `AppUrl` (failing if the URL is\nmalformed) and preserves the `state` field as a raw JSON value.\n\n","type":"Json.Decode.Decoder Navigation.Event"},{"name":"forward","comment":" Go forward by the given number of steps in session history.\n\nCalls `history.go(n)`. The existing `popstate` listener handles\nthe resulting navigation event automatically.\n\n    Nav.forward navCmd 1 -- equivalent to pressing the browser Forward button\n\n    Nav.forward navCmd 2 -- go forward two pages\n\n","type":"Navigation.CommandPort msg -> Basics.Int -> Platform.Cmd.Cmd msg"},{"name":"onEvent","comment":" Subscribe to navigation events.\n\n    subscriptions _ =\n        Nav.onEvent onNavEvent GotNavigationEvent\n\n","type":"Navigation.EventPort msg -> (Navigation.Event -> msg) -> Platform.Sub.Sub msg"},{"name":"pushState","comment":" Push a state object into the history without changing the URL.\n\nThe JS companion calls `history.pushState(state, \"\")` and notifies\nElm with both the URL and the state. Useful for wizard steps or\ntab-like flows that should support the back button but don't need\ndistinct URLs.\n\n    Nav.pushState navCmd\n        (Encode.object [ ( \"step\", Encode.int 2 ) ])\n\n","type":"Navigation.CommandPort msg -> Json.Encode.Value -> Platform.Cmd.Cmd msg"},{"name":"pushUrl","comment":" Navigate to a URL, creating a new history entry.\n\nThe JS companion calls `history.pushState(null, \"\", url)` and\nnotifies Elm of the new location.\n\n    update msg model =\n        case msg of\n            NavigateTo appUrl ->\n                ( model, Nav.pushUrl navCmd appUrl )\n\n","type":"Navigation.CommandPort msg -> AppUrl.AppUrl -> Platform.Cmd.Cmd msg"},{"name":"replaceUrl","comment":" Replace the current URL without creating a history entry.\n\nThe JS companion calls `history.replaceState(state, \"\", url)` and\ndoes **not** notify Elm. Use this for cosmetic URL updates where\nthe model is the source of truth.\n\n    ( { model | counter = n }\n    , Nav.replaceUrl navCmd\n        { path = [ \"about\" ]\n        , queryParameters = Dict.empty\n        , fragment = Just (String.fromInt n)\n        }\n    )\n\n","type":"Navigation.CommandPort msg -> AppUrl.AppUrl -> Platform.Cmd.Cmd msg"}],"binops":[]}]