import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../../wayfinder'
/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

index.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::index
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:29
* @route '/admin/usuarios'
*/
indexForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

index.form = indexForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
export const referrerSuggestions = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: referrerSuggestions.url(options),
    method: 'get',
})

referrerSuggestions.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios/referidor-sugerencias',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.url = (options?: RouteQueryOptions) => {
    return referrerSuggestions.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestions.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: referrerSuggestions.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
const referrerSuggestionsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestionsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::referrerSuggestions
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:169
* @route '/admin/usuarios/referidor-sugerencias'
*/
referrerSuggestionsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: referrerSuggestions.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

referrerSuggestions.form = referrerSuggestionsForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
export const edit = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

edit.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios/{user}/editar',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
edit.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: edit.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
const editForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
editForm.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::edit
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:81
* @route '/admin/usuarios/{user}/editar'
*/
editForm.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

edit.form = editForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::attachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:225
* @route '/admin/usuarios/{user}/referidos-manuales'
*/
export const attachManualDirectReferral = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: attachManualDirectReferral.url(args, options),
    method: 'post',
})

attachManualDirectReferral.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/referidos-manuales',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::attachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:225
* @route '/admin/usuarios/{user}/referidos-manuales'
*/
attachManualDirectReferral.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::attachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:225
* @route '/admin/usuarios/{user}/referidos-manuales'
*/
attachManualDirectReferral.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: attachManualDirectReferral.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::attachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:225
* @route '/admin/usuarios/{user}/referidos-manuales'
*/
const attachManualDirectReferralForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: attachManualDirectReferral.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::attachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:225
* @route '/admin/usuarios/{user}/referidos-manuales'
*/
attachManualDirectReferralForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: attachManualDirectReferral.url(args, options),
    method: 'post',
})

attachManualDirectReferral.form = attachManualDirectReferralForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::detachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:269
* @route '/admin/usuarios/{user}/referidos-manuales/{referred}'
*/
export const detachManualDirectReferral = (args: { user: number | { id: number }, referred: number | { id: number } } | [user: number | { id: number }, referred: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: detachManualDirectReferral.url(args, options),
    method: 'delete',
})

detachManualDirectReferral.definition = {
    methods: ["delete"],
    url: '/admin/usuarios/{user}/referidos-manuales/{referred}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::detachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:269
* @route '/admin/usuarios/{user}/referidos-manuales/{referred}'
*/
detachManualDirectReferral.url = (args: { user: number | { id: number }, referred: number | { id: number } } | [user: number | { id: number }, referred: number | { id: number } ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            user: args[0],
            referred: args[1],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
        referred: typeof args.referred === 'object'
        ? args.referred.id
        : args.referred,
    }

    return detachManualDirectReferral.definition.url
            .replace('{user}', parsedArgs.user.toString())
            .replace('{referred}', parsedArgs.referred.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::detachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:269
* @route '/admin/usuarios/{user}/referidos-manuales/{referred}'
*/
detachManualDirectReferral.delete = (args: { user: number | { id: number }, referred: number | { id: number } } | [user: number | { id: number }, referred: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: detachManualDirectReferral.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::detachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:269
* @route '/admin/usuarios/{user}/referidos-manuales/{referred}'
*/
const detachManualDirectReferralForm = (args: { user: number | { id: number }, referred: number | { id: number } } | [user: number | { id: number }, referred: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: detachManualDirectReferral.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::detachManualDirectReferral
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:269
* @route '/admin/usuarios/{user}/referidos-manuales/{referred}'
*/
detachManualDirectReferralForm.delete = (args: { user: number | { id: number }, referred: number | { id: number } } | [user: number | { id: number }, referred: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: detachManualDirectReferral.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

detachManualDirectReferral.form = detachManualDirectReferralForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
export const update = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

update.definition = {
    methods: ["patch"],
    url: '/admin/usuarios/{user}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
update.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
update.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
const updateForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::update
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:287
* @route '/admin/usuarios/{user}'
*/
updateForm.patch = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

update.form = updateForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
export const addManualBalance = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addManualBalance.url(args, options),
    method: 'post',
})

addManualBalance.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/balance-manual',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
addManualBalance.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
addManualBalance.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addManualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
const addManualBalanceForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: addManualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:383
* @route '/admin/usuarios/{user}/balance-manual'
*/
addManualBalanceForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: addManualBalance.url(args, options),
    method: 'post',
})

addManualBalance.form = addManualBalanceForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
export const consolidateBalance = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: consolidateBalance.url(args, options),
    method: 'post',
})

consolidateBalance.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/consolidar-balance',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalance.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalance.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: consolidateBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
const consolidateBalanceForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: consolidateBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:525
* @route '/admin/usuarios/{user}/consolidar-balance'
*/
consolidateBalanceForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: consolidateBalance.url(args, options),
    method: 'post',
})

consolidateBalance.form = consolidateBalanceForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
export const consolidateBalancePreview = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: consolidateBalancePreview.url(args, options),
    method: 'get',
})

consolidateBalancePreview.definition = {
    methods: ["get","head"],
    url: '/admin/usuarios/{user}/consolidar-balance/preview',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
consolidateBalancePreview.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
consolidateBalancePreview.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: consolidateBalancePreview.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
consolidateBalancePreview.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: consolidateBalancePreview.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
const consolidateBalancePreviewForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: consolidateBalancePreview.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
consolidateBalancePreviewForm.get = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: consolidateBalancePreview.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::consolidateBalancePreview
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:504
* @route '/admin/usuarios/{user}/consolidar-balance/preview'
*/
consolidateBalancePreviewForm.head = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: consolidateBalancePreview.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

consolidateBalancePreview.form = consolidateBalancePreviewForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::recordWithdrawal
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:555
* @route '/admin/usuarios/{user}/retiro'
*/
export const recordWithdrawal = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: recordWithdrawal.url(args, options),
    method: 'post',
})

recordWithdrawal.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/retiro',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::recordWithdrawal
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:555
* @route '/admin/usuarios/{user}/retiro'
*/
recordWithdrawal.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::recordWithdrawal
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:555
* @route '/admin/usuarios/{user}/retiro'
*/
recordWithdrawal.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: recordWithdrawal.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::recordWithdrawal
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:555
* @route '/admin/usuarios/{user}/retiro'
*/
const recordWithdrawalForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: recordWithdrawal.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::recordWithdrawal
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:555
* @route '/admin/usuarios/{user}/retiro'
*/
recordWithdrawalForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: recordWithdrawal.url(args, options),
    method: 'post',
})

recordWithdrawal.form = recordWithdrawalForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
export const addManualReferralProgress = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addManualReferralProgress.url(args, options),
    method: 'post',
})

addManualReferralProgress.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/referidos-progreso-manual',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
addManualReferralProgress.url = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user: args.id }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
    }

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

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
addManualReferralProgress.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addManualReferralProgress.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
const addManualReferralProgressForm = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: addManualReferralProgress.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::addManualReferralProgress
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:425
* @route '/admin/usuarios/{user}/referidos-progreso-manual'
*/
addManualReferralProgressForm.post = (args: { user: number | { id: number } } | [user: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: addManualReferralProgress.url(args, options),
    method: 'post',
})

addManualReferralProgress.form = addManualReferralProgressForm

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::revertManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:467
* @route '/admin/usuarios/{user}/balance-manual/{transaction}/revertir'
*/
export const revertManualBalance = (args: { user: number | { id: number }, transaction: number | { id: number } } | [user: number | { id: number }, transaction: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: revertManualBalance.url(args, options),
    method: 'post',
})

revertManualBalance.definition = {
    methods: ["post"],
    url: '/admin/usuarios/{user}/balance-manual/{transaction}/revertir',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::revertManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:467
* @route '/admin/usuarios/{user}/balance-manual/{transaction}/revertir'
*/
revertManualBalance.url = (args: { user: number | { id: number }, transaction: number | { id: number } } | [user: number | { id: number }, transaction: number | { id: number } ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            user: args[0],
            transaction: args[1],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        user: typeof args.user === 'object'
        ? args.user.id
        : args.user,
        transaction: typeof args.transaction === 'object'
        ? args.transaction.id
        : args.transaction,
    }

    return revertManualBalance.definition.url
            .replace('{user}', parsedArgs.user.toString())
            .replace('{transaction}', parsedArgs.transaction.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::revertManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:467
* @route '/admin/usuarios/{user}/balance-manual/{transaction}/revertir'
*/
revertManualBalance.post = (args: { user: number | { id: number }, transaction: number | { id: number } } | [user: number | { id: number }, transaction: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: revertManualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::revertManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:467
* @route '/admin/usuarios/{user}/balance-manual/{transaction}/revertir'
*/
const revertManualBalanceForm = (args: { user: number | { id: number }, transaction: number | { id: number } } | [user: number | { id: number }, transaction: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: revertManualBalance.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\AdminUserDirectoryController::revertManualBalance
* @see app/Http/Controllers/Admin/AdminUserDirectoryController.php:467
* @route '/admin/usuarios/{user}/balance-manual/{transaction}/revertir'
*/
revertManualBalanceForm.post = (args: { user: number | { id: number }, transaction: number | { id: number } } | [user: number | { id: number }, transaction: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: revertManualBalance.url(args, options),
    method: 'post',
})

revertManualBalance.form = revertManualBalanceForm

const AdminUserDirectoryController = { index, referrerSuggestions, edit, attachManualDirectReferral, detachManualDirectReferral, update, addManualBalance, consolidateBalance, consolidateBalancePreview, recordWithdrawal, addManualReferralProgress, revertManualBalance }

export default AdminUserDirectoryController