// Sidebar nav collapse state — persisted in the `scadabridge_nav` cookie so it // survives full page reloads and reconnects. Invoked from NavMenu.razor via // JS interop (window.navState.get / .set), mirroring window.treeviewStorage. window.navState = { // Returns the raw cookie value (comma-separated expanded section ids), or // an empty string when the cookie is absent. get: function () { const match = document.cookie.match(/(?:^|;\s*)scadabridge_nav=([^;]*)/); return match ? decodeURIComponent(match[1]) : ""; }, // Writes the cookie with a one-year lifetime. SameSite=Lax; not HttpOnly // (JS must write it) and not sensitive. set: function (value) { const oneYearSeconds = 60 * 60 * 24 * 365; document.cookie = "scadabridge_nav=" + encodeURIComponent(value) + ";path=/;max-age=" + oneYearSeconds + ";samesite=lax"; } };