// One-liner helper used by DebouncedSearchInput.razor to push a value into an <input>
// element WITHOUT going through a full Blazor re-render. The C# component owns the
// debounce; the DOM owns the input value while the user is typing.
//
// Why not just bind value="@..."? Because every keystroke would re-render the input
// from the server, which clobbers the cursor position and fights the user's typing
// during fast input or backspace bursts.
window.tmDebounced = window.tmDebounced || {
    setValue: function (el, val) {
        if (!el) return;
        // Only update if the value actually changed — avoids unnecessary cursor jumps.
        if (el.value !== val) {
            el.value = val == null ? '' : val;
        }
    }
};
