import type { App_RoutingForms_Form, User } from '../../../prisma-client';
import type { Ensure } from "@calcom/types/utils";
import { RaqbLogicResult } from "../lib/evaluateRaqbLogic";
import type { OrderedResponses } from "../types/types";
import type { FormResponse, SerializableForm } from "../types/types";
type SelectFieldWebhookResponse = string | number | string[] | {
    label: string;
    id: string | null;
};
export type FORM_SUBMITTED_WEBHOOK_RESPONSES = Record<string, {
    /**
     * Deprecates `value` prop as it now has both the id(that doesn't change) and the label(that can change but is human friendly)
     */
    response: number | string | string[] | SelectFieldWebhookResponse | SelectFieldWebhookResponse[];
    /**
     * @deprecated Use `response` instead
     */
    value: FormResponse[keyof FormResponse]["value"];
}>;
export declare const enum TroubleshooterCase {
    EMPTY_QUERY_VALUE = "empty-query-value",
    IS_A_ROUTER = "is-a-router",
    NO_LOGIC_FOUND = "no-logic-found",
    MATCH_RESULTS_READY = "match-results-ready",
    NO_ROUTE_FOUND = "no-route-found"
}
export declare function findTeamMembersMatchingAttributeLogicOfRoute({ form, response, routeId, teamId, isPreview, }: {
    form: Pick<SerializableForm<App_RoutingForms_Form>, "routes" | "fields">;
    response: FormResponse;
    routeId: string;
    teamId: number;
    isPreview?: boolean;
}, config?: {
    enablePerf?: boolean;
    concurrency?: number;
    enableTroubleshooter?: boolean;
}): Promise<{
    teamMembersMatchingAttributeLogic: null;
    timeTaken: null;
    troubleshooter: {
        type: TroubleshooterCase;
        data: {
            routeId: string;
            attributesQueryValue?: undefined;
            attributesQueryBuilderConfig?: undefined;
            teamMembersWithAttributeOptionValuePerAttribute?: undefined;
            attributesDataPerUser?: undefined;
            logic?: undefined;
            attributesForTeam?: undefined;
        };
    } | null;
} | {
    teamMembersMatchingAttributeLogic: null;
    timeTaken: {
        gAtr: number | null;
        gQryVal: number | null;
        gQryCnfg: null;
        gMbrWtAtr: null;
        lgcFrMbrs: null;
    };
    troubleshooter: {
        type: TroubleshooterCase;
        data: {
            attributesQueryValue: null;
            routeId?: undefined;
            attributesQueryBuilderConfig?: undefined;
            teamMembersWithAttributeOptionValuePerAttribute?: undefined;
            attributesDataPerUser?: undefined;
            logic?: undefined;
            attributesForTeam?: undefined;
        };
    } | null;
} | {
    teamMembersMatchingAttributeLogic: null;
    timeTaken: {
        gAtr: number | null;
        gQryCnfg: number | null;
        gMbrWtAtr: number | null;
        lgcFrMbrs: null;
        gQryVal: number | null;
    };
    troubleshooter: {
        type: TroubleshooterCase;
        data: {
            attributesQueryValue: {
                type: "group" | "switch_group";
                id?: string | undefined;
                children1?: any;
                properties?: any;
            } & import("zod").BRAND<"attributesQueryValue">;
            attributesQueryBuilderConfig: {
                fields: {
                    [k: string]: {
                        type: string;
                        fieldSettings: {
                            listValues: {
                                value: string;
                                title: string;
                            }[] | undefined;
                        };
                        label: string;
                        valueSources: ["value"];
                    };
                };
                operators: {
                    [x: string]: import("../components/react-awesome-query-builder/config/BasicConfig").Operator;
                };
                conjunctions: {
                    [x: string]: import("../components/react-awesome-query-builder/config/BasicConfig").Conjunction;
                };
                types: import("../components/react-awesome-query-builder/config/BasicConfig").Types;
                widgets: import("react-awesome-query-builder").Widgets & {
                    [x: string]: import("react-awesome-query-builder").Widget & {
                        type: string;
                    };
                };
                settings: import("react-awesome-query-builder").Settings;
            };
            teamMembersWithAttributeOptionValuePerAttribute: {
                userId: number;
                attributes: Record<string, {
                    type: import("../types/types").Attribute["type"];
                    value: string | string[];
                }>;
            }[];
            routeId?: undefined;
            attributesDataPerUser?: undefined;
            logic?: undefined;
            attributesForTeam?: undefined;
        };
    } | null;
} | {
    teamMembersMatchingAttributeLogic: {
        userId: number;
        result: RaqbLogicResult;
    }[];
    timeTaken: {
        gAtr: number | null;
        gQryCnfg: number | null;
        gMbrWtAtr: number | null;
        lgcFrMbrs: number | null;
        gQryVal: number | null;
    };
    troubleshooter: {
        type: TroubleshooterCase;
        data: {
            attributesDataPerUser: Map<number, Record<string, string | string[]>>;
            attributesQueryValue: {
                type: "group" | "switch_group";
                id?: string | undefined;
                children1?: any;
                properties?: any;
            } & import("zod").BRAND<"attributesQueryValue">;
            attributesQueryBuilderConfig: {
                fields: {
                    [k: string]: {
                        type: string;
                        fieldSettings: {
                            listValues: {
                                value: string;
                                title: string;
                            }[] | undefined;
                        };
                        label: string;
                        valueSources: ["value"];
                    };
                };
                operators: {
                    [x: string]: import("../components/react-awesome-query-builder/config/BasicConfig").Operator;
                };
                conjunctions: {
                    [x: string]: import("../components/react-awesome-query-builder/config/BasicConfig").Conjunction;
                };
                types: import("../components/react-awesome-query-builder/config/BasicConfig").Types;
                widgets: import("react-awesome-query-builder").Widgets & {
                    [x: string]: import("react-awesome-query-builder").Widget & {
                        type: string;
                    };
                };
                settings: import("react-awesome-query-builder").Settings;
            };
            logic: Object;
            attributesForTeam: {
                options: {
                    value: string;
                    id: string;
                    slug: string;
                }[];
                type: import('../../../prisma-client').$Enums.AttributeType;
                id: string;
                name: string;
                slug: string;
            }[];
            routeId?: undefined;
            teamMembersWithAttributeOptionValuePerAttribute?: undefined;
        };
    } | null;
}>;
export declare function onFormSubmission(form: Ensure<SerializableForm<App_RoutingForms_Form> & {
    user: Pick<User, "id" | "email">;
    userWithEmails?: string[];
}, "fields">, response: FormResponse, responseId: number, chosenAction?: {
    type: "customPageMessage" | "externalRedirectUrl" | "eventTypeRedirectUrl";
    value: string;
}): Promise<void>;
export declare const sendResponseEmail: (form: Pick<App_RoutingForms_Form, "id" | "name">, orderedResponses: OrderedResponses, toAddresses: string[]) => Promise<void>;
export {};
//# sourceMappingURL=utils.d.ts.map