try {
	let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
	n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b580c93a-3cc2-493d-8b45-a716f90a27e6", e._sentryDebugIdIdentifier = "sentry-dbid-b580c93a-3cc2-493d-8b45-a716f90a27e6");
} catch (e) {}
import { t as useAnalyticsContext } from "./useAnalyticsContext-DfTXpZbA.js";
import { useRef } from "preact/hooks";
//#region src/hooks/useTaskLandedEvent.ts
/**
* Hook that automatically sends a "Landed on page" analytic event on task mount & initializes event task type.
* Used on dropin level (i.e. Business Details, Individual, Business Financing etc.) to track visits.
* This centralizes the common analytics pattern used across form components.
*/
function useTaskLandedEvent(taskType, additionalData) {
	const userEvents = useAnalyticsContext();
	const oldTaskTypeRef = useRef(void 0);
	if (taskType && oldTaskTypeRef.current !== taskType) {
		userEvents.updateBaseTrackingPayload({ task: taskType });
		userEvents.addTaskEvent("Landed on page", {
			actionType: "start",
			...additionalData && { additionalData }
		});
		oldTaskTypeRef.current = taskType;
	}
}
//#endregion
export { useTaskLandedEvent as t };
