import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../wayfinder'
/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
export const publicForm = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: publicForm.url(args, options),
    method: 'get',
})

publicForm.definition = {
    methods: ["get","head"],
    url: '/query-form/{companyId}/{token}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
publicForm.url = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            companyId: args[0],
            token: args[1],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        companyId: args.companyId,
        token: args.token,
    }

    return publicForm.definition.url
            .replace('{companyId}', parsedArgs.companyId.toString())
            .replace('{token}', parsedArgs.token.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
publicForm.get = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: publicForm.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
publicForm.head = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: publicForm.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
const publicFormForm = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: publicForm.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
publicFormForm.get = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: publicForm.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::publicForm
* @see app/Http/Controllers/QueriesController.php:111
* @route '/query-form/{companyId}/{token}'
*/
publicFormForm.head = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: publicForm.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

publicForm.form = publicFormForm

/**
* @see \App\Http\Controllers\QueriesController::publicStore
* @see app/Http/Controllers/QueriesController.php:136
* @route '/query-form/{companyId}/{token}'
*/
export const publicStore = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: publicStore.url(args, options),
    method: 'post',
})

publicStore.definition = {
    methods: ["post"],
    url: '/query-form/{companyId}/{token}',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::publicStore
* @see app/Http/Controllers/QueriesController.php:136
* @route '/query-form/{companyId}/{token}'
*/
publicStore.url = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            companyId: args[0],
            token: args[1],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        companyId: args.companyId,
        token: args.token,
    }

    return publicStore.definition.url
            .replace('{companyId}', parsedArgs.companyId.toString())
            .replace('{token}', parsedArgs.token.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\QueriesController::publicStore
* @see app/Http/Controllers/QueriesController.php:136
* @route '/query-form/{companyId}/{token}'
*/
publicStore.post = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: publicStore.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::publicStore
* @see app/Http/Controllers/QueriesController.php:136
* @route '/query-form/{companyId}/{token}'
*/
const publicStoreForm = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: publicStore.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::publicStore
* @see app/Http/Controllers/QueriesController.php:136
* @route '/query-form/{companyId}/{token}'
*/
publicStoreForm.post = (args: { companyId: string | number, token: string | number } | [companyId: string | number, token: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: publicStore.url(args, options),
    method: 'post',
})

publicStore.form = publicStoreForm

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
export const embedScript = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: embedScript.url(options),
    method: 'get',
})

embedScript.definition = {
    methods: ["get","head"],
    url: '/query-form/embed.js',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
embedScript.url = (options?: RouteQueryOptions) => {
    return embedScript.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
embedScript.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: embedScript.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
embedScript.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: embedScript.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
const embedScriptForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: embedScript.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
embedScriptForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: embedScript.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::embedScript
* @see app/Http/Controllers/QueriesController.php:209
* @route '/query-form/embed.js'
*/
embedScriptForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: embedScript.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

embedScript.form = embedScriptForm

/**
* @see \App\Http\Controllers\QueriesController::index
* @see app/Http/Controllers/QueriesController.php:255
* @route '/queries'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\QueriesController::index
* @see app/Http/Controllers/QueriesController.php:255
* @route '/queries'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\QueriesController::index
* @see app/Http/Controllers/QueriesController.php:255
* @route '/queries'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::index
* @see app/Http/Controllers/QueriesController.php:255
* @route '/queries'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

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

/**
* @see \App\Http\Controllers\QueriesController::index
* @see app/Http/Controllers/QueriesController.php:255
* @route '/queries'
*/
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\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
export const show = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

show.definition = {
    methods: ["get","head"],
    url: '/queries/{query}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
show.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
show.get = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
show.head = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
const showForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
showForm.get = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\QueriesController::show
* @see app/Http/Controllers/QueriesController.php:309
* @route '/queries/{query}'
*/
showForm.head = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

show.form = showForm

/**
* @see \App\Http\Controllers\QueriesController::update
* @see app/Http/Controllers/QueriesController.php:587
* @route '/queries/{query}'
*/
export const update = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

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

/**
* @see \App\Http\Controllers\QueriesController::update
* @see app/Http/Controllers/QueriesController.php:587
* @route '/queries/{query}'
*/
update.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::update
* @see app/Http/Controllers/QueriesController.php:587
* @route '/queries/{query}'
*/
update.patch = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: update.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\QueriesController::update
* @see app/Http/Controllers/QueriesController.php:587
* @route '/queries/{query}'
*/
const updateForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | 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\QueriesController::update
* @see app/Http/Controllers/QueriesController.php:587
* @route '/queries/{query}'
*/
updateForm.patch = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | 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\QueriesController::accept
* @see app/Http/Controllers/QueriesController.php:362
* @route '/queries/{query}/accept'
*/
export const accept = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: accept.url(args, options),
    method: 'post',
})

accept.definition = {
    methods: ["post"],
    url: '/queries/{query}/accept',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::accept
* @see app/Http/Controllers/QueriesController.php:362
* @route '/queries/{query}/accept'
*/
accept.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::accept
* @see app/Http/Controllers/QueriesController.php:362
* @route '/queries/{query}/accept'
*/
accept.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: accept.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::accept
* @see app/Http/Controllers/QueriesController.php:362
* @route '/queries/{query}/accept'
*/
const acceptForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: accept.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::accept
* @see app/Http/Controllers/QueriesController.php:362
* @route '/queries/{query}/accept'
*/
acceptForm.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: accept.url(args, options),
    method: 'post',
})

accept.form = acceptForm

/**
* @see \App\Http\Controllers\QueriesController::decline
* @see app/Http/Controllers/QueriesController.php:489
* @route '/queries/{query}/decline'
*/
export const decline = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: decline.url(args, options),
    method: 'post',
})

decline.definition = {
    methods: ["post"],
    url: '/queries/{query}/decline',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::decline
* @see app/Http/Controllers/QueriesController.php:489
* @route '/queries/{query}/decline'
*/
decline.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::decline
* @see app/Http/Controllers/QueriesController.php:489
* @route '/queries/{query}/decline'
*/
decline.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: decline.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::decline
* @see app/Http/Controllers/QueriesController.php:489
* @route '/queries/{query}/decline'
*/
const declineForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: decline.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::decline
* @see app/Http/Controllers/QueriesController.php:489
* @route '/queries/{query}/decline'
*/
declineForm.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: decline.url(args, options),
    method: 'post',
})

decline.form = declineForm

/**
* @see \App\Http\Controllers\QueriesController::acceptContractor
* @see app/Http/Controllers/QueriesController.php:511
* @route '/queries/{query}/accept-contractor'
*/
export const acceptContractor = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: acceptContractor.url(args, options),
    method: 'post',
})

acceptContractor.definition = {
    methods: ["post"],
    url: '/queries/{query}/accept-contractor',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::acceptContractor
* @see app/Http/Controllers/QueriesController.php:511
* @route '/queries/{query}/accept-contractor'
*/
acceptContractor.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::acceptContractor
* @see app/Http/Controllers/QueriesController.php:511
* @route '/queries/{query}/accept-contractor'
*/
acceptContractor.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: acceptContractor.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::acceptContractor
* @see app/Http/Controllers/QueriesController.php:511
* @route '/queries/{query}/accept-contractor'
*/
const acceptContractorForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: acceptContractor.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::acceptContractor
* @see app/Http/Controllers/QueriesController.php:511
* @route '/queries/{query}/accept-contractor'
*/
acceptContractorForm.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: acceptContractor.url(args, options),
    method: 'post',
})

acceptContractor.form = acceptContractorForm

/**
* @see \App\Http\Controllers\QueriesController::convertToJobcard
* @see app/Http/Controllers/QueriesController.php:387
* @route '/queries/{query}/convert-to-jobcard'
*/
export const convertToJobcard = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: convertToJobcard.url(args, options),
    method: 'post',
})

convertToJobcard.definition = {
    methods: ["post"],
    url: '/queries/{query}/convert-to-jobcard',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::convertToJobcard
* @see app/Http/Controllers/QueriesController.php:387
* @route '/queries/{query}/convert-to-jobcard'
*/
convertToJobcard.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::convertToJobcard
* @see app/Http/Controllers/QueriesController.php:387
* @route '/queries/{query}/convert-to-jobcard'
*/
convertToJobcard.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: convertToJobcard.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::convertToJobcard
* @see app/Http/Controllers/QueriesController.php:387
* @route '/queries/{query}/convert-to-jobcard'
*/
const convertToJobcardForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: convertToJobcard.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::convertToJobcard
* @see app/Http/Controllers/QueriesController.php:387
* @route '/queries/{query}/convert-to-jobcard'
*/
convertToJobcardForm.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: convertToJobcard.url(args, options),
    method: 'post',
})

convertToJobcard.form = convertToJobcardForm

/**
* @see \App\Http\Controllers\QueriesController::createQuote
* @see app/Http/Controllers/QueriesController.php:607
* @route '/queries/{query}/quote'
*/
export const createQuote = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: createQuote.url(args, options),
    method: 'post',
})

createQuote.definition = {
    methods: ["post"],
    url: '/queries/{query}/quote',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::createQuote
* @see app/Http/Controllers/QueriesController.php:607
* @route '/queries/{query}/quote'
*/
createQuote.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::createQuote
* @see app/Http/Controllers/QueriesController.php:607
* @route '/queries/{query}/quote'
*/
createQuote.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: createQuote.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::createQuote
* @see app/Http/Controllers/QueriesController.php:607
* @route '/queries/{query}/quote'
*/
const createQuoteForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: createQuote.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::createQuote
* @see app/Http/Controllers/QueriesController.php:607
* @route '/queries/{query}/quote'
*/
createQuoteForm.post = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: createQuote.url(args, options),
    method: 'post',
})

createQuote.form = createQuoteForm

/**
* @see \App\Http\Controllers\QueriesController::destroy
* @see app/Http/Controllers/QueriesController.php:665
* @route '/queries/{query}'
*/
export const destroy = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

destroy.definition = {
    methods: ["delete"],
    url: '/queries/{query}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\QueriesController::destroy
* @see app/Http/Controllers/QueriesController.php:665
* @route '/queries/{query}'
*/
destroy.url = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { query: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\QueriesController::destroy
* @see app/Http/Controllers/QueriesController.php:665
* @route '/queries/{query}'
*/
destroy.delete = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\QueriesController::destroy
* @see app/Http/Controllers/QueriesController.php:665
* @route '/queries/{query}'
*/
const destroyForm = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::destroy
* @see app/Http/Controllers/QueriesController.php:665
* @route '/queries/{query}'
*/
destroyForm.delete = (args: { query: string | number | { id: string | number } } | [query: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroy.form = destroyForm

/**
* @see \App\Http\Controllers\QueriesController::apiStore
* @see app/Http/Controllers/QueriesController.php:38
* @route '/api/queries'
*/
export const apiStore = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: apiStore.url(options),
    method: 'post',
})

apiStore.definition = {
    methods: ["post"],
    url: '/api/queries',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\QueriesController::apiStore
* @see app/Http/Controllers/QueriesController.php:38
* @route '/api/queries'
*/
apiStore.url = (options?: RouteQueryOptions) => {
    return apiStore.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\QueriesController::apiStore
* @see app/Http/Controllers/QueriesController.php:38
* @route '/api/queries'
*/
apiStore.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: apiStore.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::apiStore
* @see app/Http/Controllers/QueriesController.php:38
* @route '/api/queries'
*/
const apiStoreForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: apiStore.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\QueriesController::apiStore
* @see app/Http/Controllers/QueriesController.php:38
* @route '/api/queries'
*/
apiStoreForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: apiStore.url(options),
    method: 'post',
})

apiStore.form = apiStoreForm

const QueriesController = { publicForm, publicStore, embedScript, index, show, update, accept, decline, acceptContractor, convertToJobcard, createQuote, destroy, apiStore }

export default QueriesController