import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../../wayfinder'
/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
export const edit = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(options),
    method: 'get',
})

edit.definition = {
    methods: ["get","head"],
    url: '/settings/branding',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
edit.url = (options?: RouteQueryOptions) => {
    return edit.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
edit.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
edit.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: edit.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
const editForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
editForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::edit
* @see app/Http/Controllers/Settings/BrandingController.php:21
* @route '/settings/branding'
*/
editForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

edit.form = editForm

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
* @see app/Http/Controllers/Settings/BrandingController.php:36
* @route '/settings/branding'
*/
export const update = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: update.url(options),
    method: 'post',
})

update.definition = {
    methods: ["post"],
    url: '/settings/branding',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
* @see app/Http/Controllers/Settings/BrandingController.php:36
* @route '/settings/branding'
*/
update.url = (options?: RouteQueryOptions) => {
    return update.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
* @see app/Http/Controllers/Settings/BrandingController.php:36
* @route '/settings/branding'
*/
update.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: update.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
* @see app/Http/Controllers/Settings/BrandingController.php:36
* @route '/settings/branding'
*/
const updateForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::update
* @see app/Http/Controllers/Settings/BrandingController.php:36
* @route '/settings/branding'
*/
updateForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(options),
    method: 'post',
})

update.form = updateForm

/**
* @see \App\Http\Controllers\Settings\BrandingController::destroyLogo
* @see app/Http/Controllers/Settings/BrandingController.php:47
* @route '/settings/branding/logo/{type}'
*/
export const destroyLogo = (args: { type: string | number } | [type: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyLogo.url(args, options),
    method: 'delete',
})

destroyLogo.definition = {
    methods: ["delete"],
    url: '/settings/branding/logo/{type}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Settings\BrandingController::destroyLogo
* @see app/Http/Controllers/Settings/BrandingController.php:47
* @route '/settings/branding/logo/{type}'
*/
destroyLogo.url = (args: { type: string | number } | [type: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { type: args }
    }

    if (Array.isArray(args)) {
        args = {
            type: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        type: args.type,
    }

    return destroyLogo.definition.url
            .replace('{type}', parsedArgs.type.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Settings\BrandingController::destroyLogo
* @see app/Http/Controllers/Settings/BrandingController.php:47
* @route '/settings/branding/logo/{type}'
*/
destroyLogo.delete = (args: { type: string | number } | [type: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyLogo.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::destroyLogo
* @see app/Http/Controllers/Settings/BrandingController.php:47
* @route '/settings/branding/logo/{type}'
*/
const destroyLogoForm = (args: { type: string | number } | [type: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyLogo.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Settings\BrandingController::destroyLogo
* @see app/Http/Controllers/Settings/BrandingController.php:47
* @route '/settings/branding/logo/{type}'
*/
destroyLogoForm.delete = (args: { type: string | number } | [type: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyLogo.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroyLogo.form = destroyLogoForm

const BrandingController = { edit, update, destroyLogo }

export default BrandingController