// Code generated by Wire. DO NOT EDIT.

//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject

package main

import (
	"github.com/GoYoko/web"
	"github.com/chaitin/MonkeyCode/backend/config"
	"github.com/chaitin/MonkeyCode/backend/db"
	"github.com/chaitin/MonkeyCode/backend/domain"
	v1_5 "github.com/chaitin/MonkeyCode/backend/internal/billing/handler/http/v1"
	repo7 "github.com/chaitin/MonkeyCode/backend/internal/billing/repo"
	usecase6 "github.com/chaitin/MonkeyCode/backend/internal/billing/usecase"
	v1_6 "github.com/chaitin/MonkeyCode/backend/internal/codesnippet/handler/http/v1"
	repo9 "github.com/chaitin/MonkeyCode/backend/internal/codesnippet/repo"
	usecase8 "github.com/chaitin/MonkeyCode/backend/internal/codesnippet/usecase"
	v1_4 "github.com/chaitin/MonkeyCode/backend/internal/dashboard/handler/v1"
	repo6 "github.com/chaitin/MonkeyCode/backend/internal/dashboard/repo"
	usecase5 "github.com/chaitin/MonkeyCode/backend/internal/dashboard/usecase"
	repo4 "github.com/chaitin/MonkeyCode/backend/internal/extension/repo"
	usecase2 "github.com/chaitin/MonkeyCode/backend/internal/extension/usecase"
	"github.com/chaitin/MonkeyCode/backend/internal/middleware"
	v1_2 "github.com/chaitin/MonkeyCode/backend/internal/model/handler/http/v1"
	repo2 "github.com/chaitin/MonkeyCode/backend/internal/model/repo"
	usecase4 "github.com/chaitin/MonkeyCode/backend/internal/model/usecase"
	"github.com/chaitin/MonkeyCode/backend/internal/openai/handler/v1"
	repo3 "github.com/chaitin/MonkeyCode/backend/internal/openai/repo"
	"github.com/chaitin/MonkeyCode/backend/internal/openai/usecase"
	"github.com/chaitin/MonkeyCode/backend/internal/proxy"
	"github.com/chaitin/MonkeyCode/backend/internal/proxy/repo"
	"github.com/chaitin/MonkeyCode/backend/internal/proxy/usecase"
	repo10 "github.com/chaitin/MonkeyCode/backend/internal/report/repo"
	usecase9 "github.com/chaitin/MonkeyCode/backend/internal/report/usecase"
	"github.com/chaitin/MonkeyCode/backend/internal/socket/handler"
	v1_3 "github.com/chaitin/MonkeyCode/backend/internal/user/handler/v1"
	repo5 "github.com/chaitin/MonkeyCode/backend/internal/user/repo"
	usecase3 "github.com/chaitin/MonkeyCode/backend/internal/user/usecase"
	repo8 "github.com/chaitin/MonkeyCode/backend/internal/workspace/repo"
	usecase7 "github.com/chaitin/MonkeyCode/backend/internal/workspace/usecase"
	"github.com/chaitin/MonkeyCode/backend/pkg"
	"github.com/chaitin/MonkeyCode/backend/pkg/ipdb"
	"github.com/chaitin/MonkeyCode/backend/pkg/logger"
	"github.com/chaitin/MonkeyCode/backend/pkg/report"
	"github.com/chaitin/MonkeyCode/backend/pkg/session"
	"github.com/chaitin/MonkeyCode/backend/pkg/store"
	"github.com/chaitin/MonkeyCode/backend/pkg/version"
	"log/slog"
)

// Injectors from wire.go:

func newServer() (*Server, error) {
	configConfig, err := config.Init()
	if err != nil {
		return nil, err
	}
	web := pkg.NewWeb(configConfig)
	loggerConfig := configConfig.Logger
	slogLogger := logger.NewLogger(loggerConfig)
	client, err := store.NewEntDB(configConfig, slogLogger)
	if err != nil {
		return nil, err
	}
	redisClient := store.NewRedisCli(configConfig)
	proxyRepo := repo.NewProxyRepo(client, redisClient)
	modelRepo := repo2.NewModelRepo(client)
	proxyUsecase := usecase.NewProxyUsecase(proxyRepo, modelRepo, slogLogger)
	llmProxy := proxy.NewLLMProxy(slogLogger, configConfig, proxyUsecase)
	openAIRepo := repo3.NewOpenAIRepo(client)
	openAIUsecase := openai.NewOpenAIUsecase(configConfig, openAIRepo, modelRepo, slogLogger)
	extensionRepo := repo4.NewExtensionRepo(client)
	extensionUsecase := usecase2.NewExtensionUsecase(extensionRepo, configConfig, slogLogger)
	ipdbIPDB, err := ipdb.NewIPDB(slogLogger)
	if err != nil {
		return nil, err
	}
	userRepo := repo5.NewUserRepo(client, ipdbIPDB, redisClient, configConfig)
	sessionSession := session.NewSession(configConfig)
	userUsecase := usecase3.NewUserUsecase(configConfig, redisClient, userRepo, slogLogger, sessionSession)
	proxyMiddleware := middleware.NewProxyMiddleware(proxyUsecase)
	activeMiddleware := middleware.NewActiveMiddleware(redisClient, slogLogger)
	v1Handler := v1.NewV1Handler(slogLogger, web, llmProxy, proxyUsecase, openAIUsecase, extensionUsecase, userUsecase, proxyMiddleware, activeMiddleware, configConfig)
	modelUsecase := usecase4.NewModelUsecase(slogLogger, modelRepo, configConfig)
	authMiddleware := middleware.NewAuthMiddleware(sessionSession, slogLogger)
	readOnlyMiddleware := middleware.NewReadOnlyMiddleware(configConfig)
	modelHandler := v1_2.NewModelHandler(web, modelUsecase, authMiddleware, activeMiddleware, readOnlyMiddleware, slogLogger)
	dashboardRepo := repo6.NewDashboardRepo(client)
	dashboardUsecase := usecase5.NewDashboardUsecase(dashboardRepo)
	billingRepo := repo7.NewBillingRepo(client)
	billingUsecase := usecase6.NewBillingUsecase(billingRepo)
	userHandler := v1_3.NewUserHandler(web, userUsecase, extensionUsecase, dashboardUsecase, billingUsecase, authMiddleware, activeMiddleware, readOnlyMiddleware, sessionSession, slogLogger, configConfig)
	dashboardHandler := v1_4.NewDashboardHandler(web, dashboardUsecase, authMiddleware, activeMiddleware)
	billingHandler := v1_5.NewBillingHandler(web, billingUsecase, authMiddleware, activeMiddleware)
	workspaceFileRepo := repo8.NewWorkspaceFileRepo(client)
	workspaceRepo := repo8.NewWorkspaceRepo(client)
	workspaceUsecase := usecase7.NewWorkspaceUsecase(workspaceRepo, configConfig, slogLogger)
	codeSnippetRepo := repo9.NewCodeSnippetRepo(client, slogLogger)
	codeSnippetUsecase := usecase8.NewCodeSnippetUsecase(codeSnippetRepo, slogLogger)
	workspaceFileUsecase := usecase7.NewWorkspaceFileUsecase(workspaceFileRepo, workspaceUsecase, codeSnippetUsecase, configConfig, slogLogger)
	socketHandler, err := handler.NewSocketHandler(configConfig, slogLogger, workspaceFileUsecase, workspaceUsecase, userUsecase)
	if err != nil {
		return nil, err
	}
	versionInfo := version.NewVersionInfo()
	reporter := report.NewReport(slogLogger, configConfig, versionInfo)
	reportRepo := repo10.NewReportRepo(client)
	reportUsecase := usecase9.NewReportUsecase(reportRepo, slogLogger, reporter, redisClient)
	codeSnippetHandler := v1_6.NewCodeSnippetHandler(web, codeSnippetUsecase, authMiddleware, activeMiddleware, readOnlyMiddleware, proxyMiddleware, slogLogger)
	server := &Server{
		config:        configConfig,
		web:           web,
		ent:           client,
		logger:        slogLogger,
		openaiV1:      v1Handler,
		modelV1:       modelHandler,
		userV1:        userHandler,
		dashboardV1:   dashboardHandler,
		billingV1:     billingHandler,
		socketH:       socketHandler,
		version:       versionInfo,
		report:        reporter,
		reportuse:     reportUsecase,
		euse:          extensionUsecase,
		codeSnippetV1: codeSnippetHandler,
	}
	return server, nil
}

// wire.go:

type Server struct {
	config        *config.Config
	web           *web.Web
	ent           *db.Client
	logger        *slog.Logger
	openaiV1      *v1.V1Handler
	modelV1       *v1_2.ModelHandler
	userV1        *v1_3.UserHandler
	dashboardV1   *v1_4.DashboardHandler
	billingV1     *v1_5.BillingHandler
	socketH       *handler.SocketHandler
	version       *version.VersionInfo
	report        *report.Reporter
	reportuse     domain.ReportUsecase
	euse          domain.ExtensionUsecase
	codeSnippetV1 *v1_6.CodeSnippetHandler
}
