using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using MudBlazor; using MudBlazor.Services; using RobotNet10.CustomConfigurationEditor.Services.API; using RobotNet10.CustomConfigurationEditor.Services.State; using RobotNet10.MapEditor.Services.API; using RobotNet10.MapEditor.Services.State; using RobotNet10.RobotApp.Client; using RobotNet10.RobotApp.Client.Clients; using RobotNet10.RobotApp.Client.Services; using RobotNet10.ScriptEditor; using RobotNet10.NavigationTuneUI.Clients; using RobotNet10.NavigationTuneUI.Services; using System.Globalization; CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.Logging.AddFilter("System.Net.Http.HttpClient", LogLevel.Warning); builder.Services.AddAuthorizationCore(); builder.Services.AddCascadingAuthenticationState(); builder.Services.AddAuthenticationStateDeserialization(); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress), }); builder.Services.AddMudServices(config => { config.SnackbarConfiguration.VisibleStateDuration = 2000; config.SnackbarConfiguration.HideTransitionDuration = 500; config.SnackbarConfiguration.ShowTransitionDuration = 500; config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomLeft; }); builder.Services.AddNavigationMenu(); builder.Services.AddScriptEditor(); // MapEditor Services builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); // Device Hub Clients builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); // Navigation Tuning Services builder.Services.AddScoped(); builder.Services.AddScoped(); // Config Manager Services builder.Services.AddScoped(); builder.Services.AddScoped(sp => { var configApi = sp.GetRequiredService(); var authStateProvider = sp.GetService(); return new ConfigManagerState(configApi, authStateProvider, "Distributor"); }); // DockStation Config Services builder.Services.AddScoped(); builder.Services.AddScoped(); await builder.Build().RunAsync();