import 'rollup-plugin-inject-process-env'; import { FC } from "react"; import { Response } from "stentor-models"; import { FormWidgetConfig } from "../../config"; export declare const AUDIO_WAIT_NOTHING = 0, AUDIO_WAIT_CLOSE = 1, AUDIO_WAIT_MINIMIZE = 2; export interface FormWidgetProps { readonly config: FormWidgetConfig; /** * Optional initial response to display */ readonly response?: Response; readonly docked?: boolean; /** * Rendering inside a container the host page provided and sized (see `isEmbedded`). * * Drops the framing that makes the widget read as a floating card -- the desktop * max-width, border, radius and shadow -- so it fills the customer's div instead. */ readonly embedded?: boolean; /** * Zero-based step to open the form on, instead of the first. * * For previews that want to show a particular step -- get.xapp.ai's booking * preview opens on the date and time step, because the calendar is the part * worth showing. Applied once, when the form arrives; an index the form has * no step for is ignored. */ readonly initialStep?: number; /** * Open the date/time step on the soonest day that has times, rather than on * "Select a date to see the available times." * * For a preview that lands straight on that step: an empty column beside a * calendar reads as a form with nothing to offer. Off by default -- on a real * booking page a preselected date is one the customer never chose. */ readonly preselectFirstAvailableDate?: boolean; /** * True when the form was activated by a proactive auto-open trigger * (delay/scroll%/exit-intent/inactivity) rather than a genuine user * action. Used to keep the `engaged` signal limited to real engagement. */ readonly openedByTrigger?: boolean; /** * Label of a chip to auto-select after the form loads. * If the first response contains chips/suggestions, the form will * automatically click the chip matching this label. */ readonly preselectChipLabel?: string; /** * Callback when preselectChipLabel has been used (to clear it) */ readonly onPreselectChipUsed?: () => void; /** * Callback invoked when the user submits the final form step. * * Useful for firing external conversion tracking (e.g. a Meta Pixel * `Lead` event) from the embedding page. It receives ONLY a non-PII * `eventId` — the same id sent to the backend with the lead — so a * browser-side pixel event can be deduplicated against the server-side * Conversions API event. The submitted payload (which contains PII) is * deliberately never exposed to third-party trackers. */ readonly onSubmit?: (eventId?: string) => void; } export declare const FormWidget: FC;