"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useFeedbackSubmitMutation = useFeedbackSubmitMutation;
exports.mutationKeyFeedbackSubmit = mutationKeyFeedbackSubmit;
exports.buildFeedbackSubmitMutation = buildFeedbackSubmitMutation;
const react_query_1 = require("@tanstack/react-query");
const feedbackSubmit_js_1 = require("../funcs/feedbackSubmit.js");
const primitives_js_1 = require("../lib/primitives.js");
const fp_js_1 = require("../types/fp.js");
const _context_js_1 = require("./_context.js");
/**
 * Log Feedback
 *
 * @remarks
 * Logs new feedback or updates an existing one.
 *
 * **API Key Types:**  `WEB`, `API`
 */
function useFeedbackSubmitMutation(options) {
    const client = (0, _context_js_1.useInkeepAnalyticsContext)();
    return (0, react_query_1.useMutation)({
        ...buildFeedbackSubmitMutation(client, options),
        ...options,
    });
}
function mutationKeyFeedbackSubmit() {
    return ["@inkeep/inkeep-analytics", "feedback", "submit"];
}
function buildFeedbackSubmitMutation(client$, hookOptions) {
    return {
        mutationKey: mutationKeyFeedbackSubmit(),
        mutationFn: function feedbackSubmitMutationFn({ request, options, }) {
            const mergedOptions = {
                ...hookOptions,
                ...options,
                fetchOptions: {
                    ...hookOptions?.fetchOptions,
                    ...options?.fetchOptions,
                    signal: (0, primitives_js_1.combineSignals)(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
                },
            };
            return (0, fp_js_1.unwrapAsync)((0, feedbackSubmit_js_1.feedbackSubmit)(client$, request, mergedOptions));
        },
    };
}
//# sourceMappingURL=feedbackSubmit.js.map