@aranova/tracking-next 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,20 +1,19 @@
1
- import { T as TrackingParams, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload, F as FormSubmitConfig, f as FormSubmitMetadata, C as ConsentState, g as ConsentChoiceState, h as ConsentSource, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, P as PhoneConfig, i as ParsedPhone, j as PhoneDisplayFormat } from './phone-utils-B6TYgiYT.js';
2
- export { k as ConsentChoice, D as DEFAULT_DECLINE_TTL_DAYS, l as DEFAULT_PHONE_COUNTRY, J as JsonValue, S as SetConsentOptions, m as TrackedField, n as TrackingInitConfig, o as formSubmitConfigSchema, p as formSubmitMetadataSchema, q as formatPhone, r as formatPhoneAsTyped, s as getConsentChoice, t as getConsentState, u as jsonValueSchema, v as onConsentChange, w as optIn, x as optOut, y as parsePhone, z as phoneField, A as resetConsent, B as setConsentState, E as toE164 } from './phone-utils-B6TYgiYT.js';
3
- import { T as TrackingConfigReference, C as ConversionConfig } from './sales-D_BTsRuM.js';
4
- export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, c as CompareTo, d as ConversionConfigStore, e as ConversionUserData, f as CurrencyRevenue, g as CustomerCurrencyDelta, h as CustomerCurrencyTotal, i as CustomerGetOptions, j as CustomerGetResult, k as CustomerKpis, l as CustomerKpisDeltas, m as CustomerKpisPrevious, n as CustomerListPage, o as CustomerListQuery, p as CustomerProfile, q as CustomerSegment, r as CustomerSegmentCount, s as CustomerSortField, t as CustomerSummary, u as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, v as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, w as Sale, x as SaleCursorPage, y as SaleFilters, z as SaleInput, A as SaleItem, E as SaleItemInput, F as SaleKeysetSortField, H as SaleListPage, I as SaleListQuery, J as SaleListQueryV2, K as SaleService, L as SaleServiceInput, M as SaleSortField, O as SaleSortOrder, Q as SaleSummary, R as SaleSummaryPrevious, U as SaleSummaryQuery, V as SaleSummaryQueryV2, W as SaleSummaryV2, X as SaleUpdateInput, Y as SalesBusinessClient, Z as SalesCategoryBreakdown, _ as SalesClient, $ as SalesClientConfig, a0 as SalesCustomersClient, a1 as SalesServiceBreakdown, a2 as SalesTransportConfig, a3 as SalesTrendPoint, a4 as SummaryCurrencyDelta, a5 as SummaryDeltas, a6 as SummaryWindow, a7 as SupportedCurrency, a8 as TRACKING_RANGES, a9 as TrackingOverviewRange, aa as clearStashedUserData, ab as createSalesClient, ac as fetchServices, ad as formatMoney, ae as fromMinor, af as getTrackingConfigRuntime, ag as resolveConversionConfig, ah as resolveTrackingConfigUrl, ai as saleCreateSchema, aj as saleItemSchema, ak as saleServiceSchema, al as saleUpdateSchema, am as salesRequest, an as stashUserData, ao as toMinor } from './sales-D_BTsRuM.js';
5
- import { z } from 'zod';
6
- import * as src from 'src';
1
+ import { T as TrackingParams, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload } from './phone-utils-BVzSNBf1.js';
2
+ export { C as ConsentChoice, f as ConsentChoiceState, g as ConsentSource, h as ConsentState, D as DEFAULT_DECLINE_TTL_DAYS, i as DEFAULT_PHONE_COUNTRY, F as FormSubmitConfig, j as FormSubmitMetadata, G as GtagEnvironmentMap, J as JsonValue, M as MetaPixelEnvironmentMap, P as ParsedPhone, k as PhoneConfig, l as PhoneDisplayFormat, S as SetConsentOptions, m as TrackedField, n as TrackingInitConfig, o as formSubmitConfigSchema, p as formSubmitMetadataSchema, q as formatPhone, r as formatPhoneAsTyped, s as getConsentChoice, t as getConsentState, u as jsonValueSchema, v as onConsentChange, w as optIn, x as optOut, y as parsePhone, z as phoneField, A as resetConsent, B as setConsentState, E as toE164 } from './phone-utils-BVzSNBf1.js';
3
+ export { B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, c as ConversionUserData, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SUPPORTED_CURRENCIES, u as Sale, v as SaleCursorPage, w as SaleFilters, x as SaleInput, y as SaleItem, z as SaleItemInput, A as SaleKeysetSortField, E as SaleListPage, F as SaleListQuery, H as SaleListQueryV2, I as SaleService, J as SaleServiceInput, K as SaleSortField, L as SaleSortOrder, M as SaleSummary, O as SaleSummaryPrevious, Q as SaleSummaryQuery, R as SaleSummaryQueryV2, T as SaleSummaryV2, U as SaleUpdateInput, V as SalesBusinessClient, W as SalesCategoryBreakdown, X as SalesClient, Y as SalesClientConfig, Z as SalesCustomersClient, _ as SalesServiceBreakdown, $ as SalesTransportConfig, a0 as SalesTrendPoint, a1 as SummaryCurrencyDelta, a2 as SummaryDeltas, a3 as SummaryWindow, a4 as SupportedCurrency, a5 as TRACKING_RANGES, a6 as TrackingOverviewRange, a7 as clearStashedUserData, a8 as createSalesClient, a9 as fetchServices, aa as formatMoney, ab as fromMinor, ac as saleCreateSchema, ad as saleItemSchema, ae as saleServiceSchema, af as saleUpdateSchema, ag as salesRequest, ah as stashUserData, ai as toMinor } from './sales-Bv1tihaB.js';
4
+ export { C as ConversionConfig, a as ConversionConfigStore, T as TrackingConfigReference, g as getTrackingConfigRuntime, r as resolveConversionConfig, b as resolveTrackingConfigUrl } from './tracking-config-runtime-BnUlS_Ae.js';
5
+ export { A as ALL_AUTOMATIC_EVENT_NAMES, a as ALL_LEAD_EVENT_NAMES, b as ALL_MANUAL_EVENT_NAMES, c as AutomaticEventName, C as CtaClickConfig, d as CtaClickMetadata, E as EVENT_REGISTRY, e as EVENT_SEMANTICS, f as EventCategory, g as EventClientVisibility, h as EventConfig, i as EventKind, j as EventMetadata, k as EventName, l as EventOutcomeRole, m as EventSemantics, F as FormStartConfig, n as FormStartMetadata, M as ManualEventName, o as MultiPageSessionConfig, p as MultiPageSessionMetadata, P as PAGE_IDENTITY_MAX_LENGTH, q as PAGE_IDENTITY_PATTERN, r as PageExitConfig, s as PageExitMetadata, t as PageIdentity, u as PageViewConfig, v as PageViewMetadata, w as PhoneClickConfig, x as PhoneClickMetadata, R as RegisteredAutomaticEvents, y as RegisteredManualEvents, S as SPECIFIC_PAGE_NAMES, z as ScrollDepthConfig, B as ScrollDepthMetadata, D as SdkHeartbeatConfig, G as SdkHeartbeatMetadata, H as SpecificPageName, I as SpecificPageVisitConfig, J as SpecificPageVisitMetadata, T as TimeOnSiteConfig, K as TimeOnSiteMetadata, L as TrackableEvent, N as TriggerRegistryConfig, O as TypedTrackEventOptions, Q as TypedTrackingClient, U as ctaClickConfigSchema, V as ctaClickMetadataSchema, W as formStartConfigSchema, X as formStartMetadataSchema, Y as getEventDefinition, Z as getEventSemantics, _ as multiPageSessionConfigSchema, $ as multiPageSessionMetadataSchema, a0 as pageExitConfigSchema, a1 as pageExitMetadataSchema, a2 as pageIdentitySchema, a3 as pageViewConfigSchema, a4 as pageViewMetadataSchema, a5 as phoneClickConfigSchema, a6 as phoneClickMetadataSchema, a7 as scrollDepthConfigSchema, a8 as scrollDepthMetadataSchema, a9 as sdkHeartbeatConfigSchema, aa as sdkHeartbeatMetadataSchema, ab as sdkHeartbeatTriggersSchema, ac as specificPageNameSchema, ad as specificPageVisitConfigSchema, ae as specificPageVisitMetadataSchema, af as timeOnSiteConfigSchema, ag as timeOnSiteMetadataSchema } from './ingest-typed-C-SPiigr.js';
7
6
  export { A as AranovaApiError, f as formatDateInTz } from './date-BHetnL7s.js';
8
- import * as react from 'react';
9
- import { ReactNode, CSSProperties, InputHTMLAttributes, ChangeEvent, FocusEvent } from 'react';
10
- import * as react_jsx_runtime from 'react/jsx-runtime';
7
+ export { AdPlatformTracking, AdPlatformTrackingProps, ConsentBanner, ConsentBannerProps, CreateTrackingOptions, CreateTrackingResult, GoogleAdsTracking, GoogleAdsTrackingProps, PhoneField, PhoneFieldApi, PhoneFieldProps, PhoneInputProps, TrackingProviderProps, UseConsentResult, UseCookiePreferencesOptions, UseCookiePreferencesResult, UsePhoneFieldOptions, createTracking, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams } from '@aranova/tracking-next/client';
11
8
  import { CalendarReadClient, ComputeSlotsOptions, OpeningHours, Slot } from './calendar.js';
12
9
  export { BusyQuery, CalendarReadClientConfig, ComputeSlotsResult, OpeningInterval, computeSlots, createCalendarReadClient, durationMinutes, endOfDayInTz, formatSlotRange, groupSlotsByDay, instantFromWallClock, isCalendarError, localDateKey, offsetMinutesAt, resolveBrowserTimeZone, startOfDayInTz } from './calendar.js';
13
10
  import { a as Booking, B as BookingCreateInput, d as BusyInterval } from './transport-C-_rFSR4.js';
14
11
  export { e as BOOKING_SOURCES, f as BOOKING_STATUSES, g as BookingAttendee, c as BookingCancelInput, h as BookingCustomer, i as BookingLocation, j as BookingMetadata, k as BookingReminders, b as BookingRescheduleInput, l as BookingStatus, m as BusyResponse, n as CALENDAR_ERROR_CODES, o as CALENDAR_METADATA_SCHEMA_VERSION, p as CALENDAR_SYNC_STATUSES, q as CalendarErrorCode, r as CalendarSummary, s as CalendarSyncStatus, C as CalendarTransportConfig, G as GOOGLE_SYNC_STATES, t as GoogleSyncState, J as JsonScalar, M as MAX_ATTENDEES, u as MAX_BOOKING_MINUTES, v as MAX_REMINDER_MINUTES, w as MAX_REMINDER_OVERRIDES, x as bookingAttendeeSchema, y as bookingCancelSchema, z as bookingCreateSchema, A as bookingCustomerSchema, D as bookingLocationNullableSchema, E as bookingLocationSchema, F as bookingMetadataSchema, H as bookingReminderSchema, I as bookingRemindersSchema, K as bookingRescheduleSchema } from './transport-C-_rFSR4.js';
15
- import { CountryCode } from 'libphonenumber-js';
12
+ import { ReactNode } from 'react';
16
13
  export { CountryCode } from 'libphonenumber-js';
14
+ import 'zod';
17
15
  import './request-Doq36Rt0.js';
16
+ import 'src';
18
17
 
19
18
  /**
20
19
  * Attribution query/cookie keys captured by the SDK.
@@ -69,1322 +68,6 @@ declare function createTrackingSessionUpsertPayload(trackingParams: TrackingPara
69
68
  */
70
69
  declare function createTrackingEventCreatePayload(trackingParams: TrackingParams, input: TrackingEventInput, context: TrackingClientContext): TrackingEventCreatePayload;
71
70
 
72
- /**
73
- * Metadata for a manually fired `cta_click` event.
74
- *
75
- * Use this for non-phone calls to action such as directions, appointment
76
- * buttons, downloads, or external booking links.
77
- */
78
- declare const ctaClickMetadataSchema: z.ZodObject<{
79
- cta_name: z.ZodString;
80
- page: z.ZodObject<{
81
- path: z.ZodString;
82
- }, "strict", z.ZodTypeAny, {
83
- path: string;
84
- }, {
85
- path: string;
86
- }>;
87
- section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
- destination_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
- href: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
- element: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
- }, "strict", z.ZodTypeAny, {
92
- page: {
93
- path: string;
94
- };
95
- cta_name: string;
96
- section?: string | null | undefined;
97
- href?: string | null | undefined;
98
- destination_url?: string | null | undefined;
99
- element?: string | null | undefined;
100
- }, {
101
- page: {
102
- path: string;
103
- };
104
- cta_name: string;
105
- section?: string | null | undefined;
106
- href?: string | null | undefined;
107
- destination_url?: string | null | undefined;
108
- element?: string | null | undefined;
109
- }>;
110
- type CtaClickMetadata = z.infer<typeof ctaClickMetadataSchema>;
111
- /**
112
- * Registration config for `cta_click`.
113
- *
114
- * The event stays manually fireable; `autoCapture` additionally attaches a
115
- * delegated click listener that fires it for any element matching `selector`
116
- * (default `[data-aranova-cta]`) — tag your CTAs, get analytics for free.
117
- */
118
- declare const ctaClickConfigSchema: z.ZodObject<{
119
- autoCapture: z.ZodOptional<z.ZodObject<{
120
- selector: z.ZodOptional<z.ZodString>;
121
- }, "strict", z.ZodTypeAny, {
122
- selector?: string | undefined;
123
- }, {
124
- selector?: string | undefined;
125
- }>>;
126
- }, "strict", z.ZodTypeAny, {
127
- autoCapture?: {
128
- selector?: string | undefined;
129
- } | undefined;
130
- }, {
131
- autoCapture?: {
132
- selector?: string | undefined;
133
- } | undefined;
134
- }>;
135
- type CtaClickConfig = z.infer<typeof ctaClickConfigSchema>;
136
-
137
- /**
138
- * Registered trigger names reported by the SDK heartbeat.
139
- */
140
- declare const sdkHeartbeatTriggersSchema: z.ZodObject<{
141
- automatic: z.ZodArray<z.ZodString, "many">;
142
- manual: z.ZodArray<z.ZodString, "many">;
143
- }, "strict", z.ZodTypeAny, {
144
- automatic: string[];
145
- manual: string[];
146
- }, {
147
- automatic: string[];
148
- manual: string[];
149
- }>;
150
- /**
151
- * Metadata for the SDK-internal `sdk_heartbeat` event.
152
- *
153
- * The SDK fires this once per new session so the dashboard can show which SDK
154
- * version, install surface, and trigger registry a client site is running.
155
- * Consumers do not manually register or fire this event.
156
- */
157
- declare const sdkHeartbeatMetadataSchema: z.ZodObject<{
158
- sdk_version: z.ZodString;
159
- package_name: z.ZodNullable<z.ZodString>;
160
- surface: z.ZodEnum<["next", "react", "script"]>;
161
- triggers: z.ZodObject<{
162
- automatic: z.ZodArray<z.ZodString, "many">;
163
- manual: z.ZodArray<z.ZodString, "many">;
164
- }, "strict", z.ZodTypeAny, {
165
- automatic: string[];
166
- manual: string[];
167
- }, {
168
- automatic: string[];
169
- manual: string[];
170
- }>;
171
- trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
172
- configured_gtag_ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
173
- }, "strict", z.ZodTypeAny, {
174
- sdk_version: string;
175
- package_name: string | null;
176
- surface: "next" | "react" | "script";
177
- triggers: {
178
- automatic: string[];
179
- manual: string[];
180
- };
181
- trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
182
- configured_gtag_ids?: Record<string, string> | null | undefined;
183
- }, {
184
- sdk_version: string;
185
- package_name: string | null;
186
- surface: "next" | "react" | "script";
187
- triggers: {
188
- automatic: string[];
189
- manual: string[];
190
- };
191
- trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
192
- configured_gtag_ids?: Record<string, string> | null | undefined;
193
- }>;
194
- type SdkHeartbeatMetadata = z.infer<typeof sdkHeartbeatMetadataSchema>;
195
- /**
196
- * Internal registration config for `sdk_heartbeat`.
197
- *
198
- * This event has no consumer-facing options.
199
- */
200
- declare const sdkHeartbeatConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
201
- type SdkHeartbeatConfig = z.infer<typeof sdkHeartbeatConfigSchema>;
202
-
203
- /**
204
- * Metadata for the automatic `form_start` event.
205
- *
206
- * The SDK emits this once per form when the visitor first focuses a field.
207
- */
208
- declare const formStartMetadataSchema: z.ZodObject<{
209
- form: z.ZodObject<{
210
- id: z.ZodString;
211
- action: z.ZodNullable<z.ZodString>;
212
- }, "strict", z.ZodTypeAny, {
213
- id: string;
214
- action: string | null;
215
- }, {
216
- id: string;
217
- action: string | null;
218
- }>;
219
- page: z.ZodObject<{
220
- path: z.ZodString;
221
- }, "strict", z.ZodTypeAny, {
222
- path: string;
223
- }, {
224
- path: string;
225
- }>;
226
- }, "strict", z.ZodTypeAny, {
227
- form: {
228
- id: string;
229
- action: string | null;
230
- };
231
- page: {
232
- path: string;
233
- };
234
- }, {
235
- form: {
236
- id: string;
237
- action: string | null;
238
- };
239
- page: {
240
- path: string;
241
- };
242
- }>;
243
- type FormStartMetadata = z.infer<typeof formStartMetadataSchema>;
244
- /**
245
- * Registration config for automatic `form_start`.
246
- *
247
- * Use `selector` to narrow which forms can trigger the event. When omitted,
248
- * the SDK observes all `<form>` elements.
249
- */
250
- declare const formStartConfigSchema: z.ZodObject<{
251
- selector: z.ZodOptional<z.ZodString>;
252
- }, "strict", z.ZodTypeAny, {
253
- selector?: string | undefined;
254
- }, {
255
- selector?: string | undefined;
256
- }>;
257
- type FormStartConfig = z.infer<typeof formStartConfigSchema>;
258
-
259
- /**
260
- * Metadata for the automatic `multi_page_session` event.
261
- *
262
- * Fired when the visitor reaches the configured distinct-page threshold in a
263
- * single tracking session.
264
- */
265
- declare const multiPageSessionMetadataSchema: z.ZodObject<{
266
- page_count: z.ZodNumber;
267
- page: z.ZodObject<{
268
- path: z.ZodString;
269
- }, "strict", z.ZodTypeAny, {
270
- path: string;
271
- }, {
272
- path: string;
273
- }>;
274
- }, "strict", z.ZodTypeAny, {
275
- page: {
276
- path: string;
277
- };
278
- page_count: number;
279
- }, {
280
- page: {
281
- path: string;
282
- };
283
- page_count: number;
284
- }>;
285
- type MultiPageSessionMetadata = z.infer<typeof multiPageSessionMetadataSchema>;
286
- /**
287
- * Registration config for automatic `multi_page_session`.
288
- */
289
- declare const multiPageSessionConfigSchema: z.ZodObject<{
290
- pageThreshold: z.ZodNumber;
291
- }, "strict", z.ZodTypeAny, {
292
- pageThreshold: number;
293
- }, {
294
- pageThreshold: number;
295
- }>;
296
- type MultiPageSessionConfig = z.infer<typeof multiPageSessionConfigSchema>;
297
-
298
- /**
299
- * Metadata for the automatic `page_exit` event.
300
- *
301
- * Fired when the user leaves a page (SPA navigation away, tab hidden, or
302
- * pagehide). `dwell_ms` is the ACTIVE (visible) time spent on the page segment
303
- * being closed — hidden time never counts, matching `time_on_site` semantics.
304
- * A page revisited after being hidden emits another `page_exit` for the next
305
- * visible segment, so summing `dwell_ms` per page/session yields total active
306
- * dwell without double counting.
307
- */
308
- declare const pageExitMetadataSchema: z.ZodObject<{
309
- dwell_ms: z.ZodNumber;
310
- max_scroll_percent: z.ZodNullable<z.ZodNumber>;
311
- scroll_baseline_percent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
312
- page: z.ZodObject<{
313
- path: z.ZodString;
314
- }, "strict", z.ZodTypeAny, {
315
- path: string;
316
- }, {
317
- path: string;
318
- }>;
319
- }, "strict", z.ZodTypeAny, {
320
- page: {
321
- path: string;
322
- };
323
- dwell_ms: number;
324
- max_scroll_percent: number | null;
325
- scroll_baseline_percent?: number | null | undefined;
326
- }, {
327
- page: {
328
- path: string;
329
- };
330
- dwell_ms: number;
331
- max_scroll_percent: number | null;
332
- scroll_baseline_percent?: number | null | undefined;
333
- }>;
334
- type PageExitMetadata = z.infer<typeof pageExitMetadataSchema>;
335
- /**
336
- * Registration config for automatic `page_exit`.
337
- *
338
- * SDK-internal: attached unconditionally (like `sdk_heartbeat`), so there are
339
- * no registration options.
340
- */
341
- declare const pageExitConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
342
- type PageExitConfig = z.infer<typeof pageExitConfigSchema>;
343
-
344
- /**
345
- * Metadata for the automatic `page_view` event.
346
- *
347
- * The SDK emits this on initial load, SPA route changes, and bfcache restores.
348
- * Consumers do not call `trackEvent('page_view', ...)`; registering
349
- * `automatic: { page_view: {} }` enables the SDK-owned trigger.
350
- */
351
- declare const pageViewMetadataSchema: z.ZodObject<{
352
- page: z.ZodObject<{
353
- title: z.ZodNullable<z.ZodString>;
354
- path: z.ZodString;
355
- search: z.ZodString;
356
- hash: z.ZodString;
357
- }, "strict", z.ZodTypeAny, {
358
- path: string;
359
- search: string;
360
- title: string | null;
361
- hash: string;
362
- }, {
363
- path: string;
364
- search: string;
365
- title: string | null;
366
- hash: string;
367
- }>;
368
- referrer: z.ZodNullable<z.ZodString>;
369
- viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
370
- w: z.ZodNumber;
371
- h: z.ZodNumber;
372
- }, "strict", z.ZodTypeAny, {
373
- w: number;
374
- h: number;
375
- }, {
376
- w: number;
377
- h: number;
378
- }>>>;
379
- }, "strict", z.ZodTypeAny, {
380
- page: {
381
- path: string;
382
- search: string;
383
- title: string | null;
384
- hash: string;
385
- };
386
- referrer: string | null;
387
- viewport?: {
388
- w: number;
389
- h: number;
390
- } | null | undefined;
391
- }, {
392
- page: {
393
- path: string;
394
- search: string;
395
- title: string | null;
396
- hash: string;
397
- };
398
- referrer: string | null;
399
- viewport?: {
400
- w: number;
401
- h: number;
402
- } | null | undefined;
403
- }>;
404
- type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
405
- /**
406
- * Registration config for automatic `page_view`.
407
- *
408
- * `page_view` is required in every trigger registry and currently has no
409
- * options. Use `{ page_view: {} }`.
410
- */
411
- declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
412
- type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
413
-
414
- /**
415
- * Metadata for a manually fired `phone_click` event.
416
- *
417
- * `phone_number` should be the business phone number from the clicked `tel:`
418
- * link, not a visitor-entered phone number. `section` can distinguish header,
419
- * footer, hero, or contact-page links.
420
- */
421
- declare const phoneClickMetadataSchema: z.ZodObject<{
422
- phone_number: z.ZodString;
423
- page: z.ZodObject<{
424
- path: z.ZodString;
425
- }, "strict", z.ZodTypeAny, {
426
- path: string;
427
- }, {
428
- path: string;
429
- }>;
430
- section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
431
- }, "strict", z.ZodTypeAny, {
432
- page: {
433
- path: string;
434
- };
435
- phone_number: string;
436
- section?: string | null | undefined;
437
- }, {
438
- page: {
439
- path: string;
440
- };
441
- phone_number: string;
442
- section?: string | null | undefined;
443
- }>;
444
- type PhoneClickMetadata = z.infer<typeof phoneClickMetadataSchema>;
445
- /**
446
- * Registration config for `phone_click`.
447
- *
448
- * The event stays manually fireable; `autoCapture` additionally attaches a
449
- * delegated click listener that fires it for any `tel:` link matching
450
- * `selector` (default `a[href^="tel:"]`) — link your phone number, get the
451
- * analytics event (and, for a linked phone-click goal, the conversion) for free.
452
- */
453
- declare const phoneClickConfigSchema: z.ZodObject<{
454
- autoCapture: z.ZodOptional<z.ZodObject<{
455
- selector: z.ZodOptional<z.ZodString>;
456
- }, "strict", z.ZodTypeAny, {
457
- selector?: string | undefined;
458
- }, {
459
- selector?: string | undefined;
460
- }>>;
461
- }, "strict", z.ZodTypeAny, {
462
- autoCapture?: {
463
- selector?: string | undefined;
464
- } | undefined;
465
- }, {
466
- autoCapture?: {
467
- selector?: string | undefined;
468
- } | undefined;
469
- }>;
470
- type PhoneClickConfig = z.infer<typeof phoneClickConfigSchema>;
471
-
472
- /**
473
- * Metadata for the automatic `scroll_depth` event.
474
- *
475
- * Fired once per configured threshold per page.
476
- */
477
- declare const scrollDepthMetadataSchema: z.ZodObject<{
478
- depth_percent: z.ZodNumber;
479
- page: z.ZodObject<{
480
- path: z.ZodString;
481
- }, "strict", z.ZodTypeAny, {
482
- path: string;
483
- }, {
484
- path: string;
485
- }>;
486
- }, "strict", z.ZodTypeAny, {
487
- page: {
488
- path: string;
489
- };
490
- depth_percent: number;
491
- }, {
492
- page: {
493
- path: string;
494
- };
495
- depth_percent: number;
496
- }>;
497
- type ScrollDepthMetadata = z.infer<typeof scrollDepthMetadataSchema>;
498
- /**
499
- * Registration config for automatic `scroll_depth`.
500
- *
501
- * `thresholds` are integer percentages from 1 to 100.
502
- */
503
- declare const scrollDepthConfigSchema: z.ZodObject<{
504
- thresholds: z.ZodArray<z.ZodNumber, "many">;
505
- }, "strict", z.ZodTypeAny, {
506
- thresholds: number[];
507
- }, {
508
- thresholds: number[];
509
- }>;
510
- type ScrollDepthConfig = z.infer<typeof scrollDepthConfigSchema>;
511
-
512
- declare const PAGE_IDENTITY_MAX_LENGTH = 64;
513
- declare const PAGE_IDENTITY_PATTERN: RegExp;
514
- /** Common page identities offered as presets by operator tooling. */
515
- declare const SPECIFIC_PAGE_NAMES: readonly ["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"];
516
- declare const pageIdentitySchema: z.ZodString;
517
- type PageIdentity = z.infer<typeof pageIdentitySchema>;
518
- /** @deprecated Use PageIdentity. Kept as a compatibility alias for existing consumers. */
519
- type SpecificPageName = PageIdentity;
520
- /** @deprecated Use pageIdentitySchema. Kept for source compatibility. */
521
- declare const specificPageNameSchema: z.ZodString;
522
- /**
523
- * Metadata for the automatic `specific_page_visit` event.
524
- *
525
- * The SDK emits this when the current pathname matches one of the configured
526
- * named page patterns.
527
- */
528
- declare const specificPageVisitMetadataSchema: z.ZodObject<{
529
- page_name: z.ZodString;
530
- page: z.ZodObject<{
531
- path: z.ZodString;
532
- }, "strict", z.ZodTypeAny, {
533
- path: string;
534
- }, {
535
- path: string;
536
- }>;
537
- }, "strict", z.ZodTypeAny, {
538
- page: {
539
- path: string;
540
- };
541
- page_name: string;
542
- }, {
543
- page: {
544
- path: string;
545
- };
546
- page_name: string;
547
- }>;
548
- type SpecificPageVisitMetadata = z.infer<typeof specificPageVisitMetadataSchema>;
549
- /**
550
- * Registration config for automatic `specific_page_visit`.
551
- *
552
- * Each page entry pairs a stable, validated identity with a `RegExp` that
553
- * matches the pathname. The identity can use a preset above or a client-specific
554
- * lowercase snake-case slug.
555
- */
556
- declare const specificPageVisitConfigSchema: z.ZodObject<{
557
- pages: z.ZodArray<z.ZodObject<{
558
- name: z.ZodString;
559
- pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
560
- }, "strict", z.ZodTypeAny, {
561
- name: string;
562
- pathPattern: RegExp;
563
- }, {
564
- name: string;
565
- pathPattern: RegExp;
566
- }>, "many">;
567
- }, "strict", z.ZodTypeAny, {
568
- pages: {
569
- name: string;
570
- pathPattern: RegExp;
571
- }[];
572
- }, {
573
- pages: {
574
- name: string;
575
- pathPattern: RegExp;
576
- }[];
577
- }>;
578
- type SpecificPageVisitConfig = z.infer<typeof specificPageVisitConfigSchema>;
579
-
580
- /**
581
- * Metadata for the automatic `time_on_site` event.
582
- *
583
- * The SDK starts a visibility-aware timer and fires once when visible
584
- * engagement crosses the configured threshold.
585
- */
586
- declare const timeOnSiteMetadataSchema: z.ZodObject<{
587
- duration_ms: z.ZodNumber;
588
- page: z.ZodObject<{
589
- path: z.ZodString;
590
- }, "strict", z.ZodTypeAny, {
591
- path: string;
592
- }, {
593
- path: string;
594
- }>;
595
- }, "strict", z.ZodTypeAny, {
596
- page: {
597
- path: string;
598
- };
599
- duration_ms: number;
600
- }, {
601
- page: {
602
- path: string;
603
- };
604
- duration_ms: number;
605
- }>;
606
- type TimeOnSiteMetadata = z.infer<typeof timeOnSiteMetadataSchema>;
607
- /**
608
- * Registration config for automatic `time_on_site`.
609
- */
610
- declare const timeOnSiteConfigSchema: z.ZodObject<{
611
- thresholdSeconds: z.ZodNumber;
612
- }, "strict", z.ZodTypeAny, {
613
- thresholdSeconds: number;
614
- }, {
615
- thresholdSeconds: number;
616
- }>;
617
- type TimeOnSiteConfig = z.infer<typeof timeOnSiteConfigSchema>;
618
-
619
- type EventOutcomeRole = "lead" | "engagement" | "navigation" | "diagnostic";
620
- type EventCategory = "page" | "engagement" | "lead" | "commerce" | "system";
621
- type EventClientVisibility = "simple" | "detailed" | "hidden";
622
- interface EventSemantics {
623
- label: string;
624
- category: EventCategory;
625
- outcomeRole: EventOutcomeRole;
626
- clientVisibility: EventClientVisibility;
627
- }
628
- /**
629
- * Lightweight runtime event metadata. This module intentionally imports no
630
- * Zod schemas so dashboards and framework adapters can consume it without
631
- * pulling the validation registry into their bundles.
632
- */
633
- declare const EVENT_SEMANTICS: {
634
- readonly page_view: {
635
- readonly label: "Page view";
636
- readonly category: "page";
637
- readonly outcomeRole: "navigation";
638
- readonly clientVisibility: "simple";
639
- };
640
- readonly time_on_site: {
641
- readonly label: "Time on site";
642
- readonly category: "engagement";
643
- readonly outcomeRole: "engagement";
644
- readonly clientVisibility: "detailed";
645
- };
646
- readonly specific_page_visit: {
647
- readonly label: "Key page visit";
648
- readonly category: "engagement";
649
- readonly outcomeRole: "engagement";
650
- readonly clientVisibility: "detailed";
651
- };
652
- readonly scroll_depth: {
653
- readonly label: "Scroll depth";
654
- readonly category: "engagement";
655
- readonly outcomeRole: "engagement";
656
- readonly clientVisibility: "detailed";
657
- };
658
- readonly multi_page_session: {
659
- readonly label: "Multi-page session";
660
- readonly category: "engagement";
661
- readonly outcomeRole: "engagement";
662
- readonly clientVisibility: "detailed";
663
- };
664
- readonly form_start: {
665
- readonly label: "Form started";
666
- readonly category: "engagement";
667
- readonly outcomeRole: "engagement";
668
- readonly clientVisibility: "simple";
669
- };
670
- readonly sdk_heartbeat: {
671
- readonly label: "SDK heartbeat";
672
- readonly category: "system";
673
- readonly outcomeRole: "diagnostic";
674
- readonly clientVisibility: "hidden";
675
- };
676
- readonly page_exit: {
677
- readonly label: "Page exit";
678
- readonly category: "engagement";
679
- readonly outcomeRole: "diagnostic";
680
- readonly clientVisibility: "detailed";
681
- };
682
- readonly form_submit: {
683
- readonly label: "Form submitted";
684
- readonly category: "lead";
685
- readonly outcomeRole: "lead";
686
- readonly clientVisibility: "simple";
687
- };
688
- readonly phone_click: {
689
- readonly label: "Phone click";
690
- readonly category: "lead";
691
- readonly outcomeRole: "lead";
692
- readonly clientVisibility: "simple";
693
- };
694
- readonly cta_click: {
695
- readonly label: "CTA click";
696
- readonly category: "engagement";
697
- readonly outcomeRole: "engagement";
698
- readonly clientVisibility: "simple";
699
- };
700
- };
701
- type EventName = keyof typeof EVENT_SEMANTICS;
702
- declare function getEventSemantics(eventName: string): EventSemantics | null;
703
-
704
- type EventKind = "automatic" | "manual";
705
- declare const EVENT_REGISTRY: {
706
- readonly page_view: {
707
- readonly kind: "automatic";
708
- readonly semantics: {
709
- readonly label: "Page view";
710
- readonly category: "page";
711
- readonly outcomeRole: "navigation";
712
- readonly clientVisibility: "simple";
713
- };
714
- readonly metadataSchema: z.ZodObject<{
715
- page: z.ZodObject<{
716
- title: z.ZodNullable<z.ZodString>;
717
- path: z.ZodString;
718
- search: z.ZodString;
719
- hash: z.ZodString;
720
- }, "strict", z.ZodTypeAny, {
721
- path: string;
722
- search: string;
723
- title: string | null;
724
- hash: string;
725
- }, {
726
- path: string;
727
- search: string;
728
- title: string | null;
729
- hash: string;
730
- }>;
731
- referrer: z.ZodNullable<z.ZodString>;
732
- viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
733
- w: z.ZodNumber;
734
- h: z.ZodNumber;
735
- }, "strict", z.ZodTypeAny, {
736
- w: number;
737
- h: number;
738
- }, {
739
- w: number;
740
- h: number;
741
- }>>>;
742
- }, "strict", z.ZodTypeAny, {
743
- page: {
744
- path: string;
745
- search: string;
746
- title: string | null;
747
- hash: string;
748
- };
749
- referrer: string | null;
750
- viewport?: {
751
- w: number;
752
- h: number;
753
- } | null | undefined;
754
- }, {
755
- page: {
756
- path: string;
757
- search: string;
758
- title: string | null;
759
- hash: string;
760
- };
761
- referrer: string | null;
762
- viewport?: {
763
- w: number;
764
- h: number;
765
- } | null | undefined;
766
- }>;
767
- readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
768
- };
769
- readonly time_on_site: {
770
- readonly kind: "automatic";
771
- readonly semantics: {
772
- readonly label: "Time on site";
773
- readonly category: "engagement";
774
- readonly outcomeRole: "engagement";
775
- readonly clientVisibility: "detailed";
776
- };
777
- readonly metadataSchema: z.ZodObject<{
778
- duration_ms: z.ZodNumber;
779
- page: z.ZodObject<{
780
- path: z.ZodString;
781
- }, "strict", z.ZodTypeAny, {
782
- path: string;
783
- }, {
784
- path: string;
785
- }>;
786
- }, "strict", z.ZodTypeAny, {
787
- page: {
788
- path: string;
789
- };
790
- duration_ms: number;
791
- }, {
792
- page: {
793
- path: string;
794
- };
795
- duration_ms: number;
796
- }>;
797
- readonly configSchema: z.ZodObject<{
798
- thresholdSeconds: z.ZodNumber;
799
- }, "strict", z.ZodTypeAny, {
800
- thresholdSeconds: number;
801
- }, {
802
- thresholdSeconds: number;
803
- }>;
804
- };
805
- readonly specific_page_visit: {
806
- readonly kind: "automatic";
807
- readonly semantics: {
808
- readonly label: "Key page visit";
809
- readonly category: "engagement";
810
- readonly outcomeRole: "engagement";
811
- readonly clientVisibility: "detailed";
812
- };
813
- readonly metadataSchema: z.ZodObject<{
814
- page_name: z.ZodString;
815
- page: z.ZodObject<{
816
- path: z.ZodString;
817
- }, "strict", z.ZodTypeAny, {
818
- path: string;
819
- }, {
820
- path: string;
821
- }>;
822
- }, "strict", z.ZodTypeAny, {
823
- page: {
824
- path: string;
825
- };
826
- page_name: string;
827
- }, {
828
- page: {
829
- path: string;
830
- };
831
- page_name: string;
832
- }>;
833
- readonly configSchema: z.ZodObject<{
834
- pages: z.ZodArray<z.ZodObject<{
835
- name: z.ZodString;
836
- pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
837
- }, "strict", z.ZodTypeAny, {
838
- name: string;
839
- pathPattern: RegExp;
840
- }, {
841
- name: string;
842
- pathPattern: RegExp;
843
- }>, "many">;
844
- }, "strict", z.ZodTypeAny, {
845
- pages: {
846
- name: string;
847
- pathPattern: RegExp;
848
- }[];
849
- }, {
850
- pages: {
851
- name: string;
852
- pathPattern: RegExp;
853
- }[];
854
- }>;
855
- };
856
- readonly scroll_depth: {
857
- readonly kind: "automatic";
858
- readonly semantics: {
859
- readonly label: "Scroll depth";
860
- readonly category: "engagement";
861
- readonly outcomeRole: "engagement";
862
- readonly clientVisibility: "detailed";
863
- };
864
- readonly metadataSchema: z.ZodObject<{
865
- depth_percent: z.ZodNumber;
866
- page: z.ZodObject<{
867
- path: z.ZodString;
868
- }, "strict", z.ZodTypeAny, {
869
- path: string;
870
- }, {
871
- path: string;
872
- }>;
873
- }, "strict", z.ZodTypeAny, {
874
- page: {
875
- path: string;
876
- };
877
- depth_percent: number;
878
- }, {
879
- page: {
880
- path: string;
881
- };
882
- depth_percent: number;
883
- }>;
884
- readonly configSchema: z.ZodObject<{
885
- thresholds: z.ZodArray<z.ZodNumber, "many">;
886
- }, "strict", z.ZodTypeAny, {
887
- thresholds: number[];
888
- }, {
889
- thresholds: number[];
890
- }>;
891
- };
892
- readonly multi_page_session: {
893
- readonly kind: "automatic";
894
- readonly semantics: {
895
- readonly label: "Multi-page session";
896
- readonly category: "engagement";
897
- readonly outcomeRole: "engagement";
898
- readonly clientVisibility: "detailed";
899
- };
900
- readonly metadataSchema: z.ZodObject<{
901
- page_count: z.ZodNumber;
902
- page: z.ZodObject<{
903
- path: z.ZodString;
904
- }, "strict", z.ZodTypeAny, {
905
- path: string;
906
- }, {
907
- path: string;
908
- }>;
909
- }, "strict", z.ZodTypeAny, {
910
- page: {
911
- path: string;
912
- };
913
- page_count: number;
914
- }, {
915
- page: {
916
- path: string;
917
- };
918
- page_count: number;
919
- }>;
920
- readonly configSchema: z.ZodObject<{
921
- pageThreshold: z.ZodNumber;
922
- }, "strict", z.ZodTypeAny, {
923
- pageThreshold: number;
924
- }, {
925
- pageThreshold: number;
926
- }>;
927
- };
928
- readonly form_start: {
929
- readonly kind: "automatic";
930
- readonly semantics: {
931
- readonly label: "Form started";
932
- readonly category: "engagement";
933
- readonly outcomeRole: "engagement";
934
- readonly clientVisibility: "simple";
935
- };
936
- readonly metadataSchema: z.ZodObject<{
937
- form: z.ZodObject<{
938
- id: z.ZodString;
939
- action: z.ZodNullable<z.ZodString>;
940
- }, "strict", z.ZodTypeAny, {
941
- id: string;
942
- action: string | null;
943
- }, {
944
- id: string;
945
- action: string | null;
946
- }>;
947
- page: z.ZodObject<{
948
- path: z.ZodString;
949
- }, "strict", z.ZodTypeAny, {
950
- path: string;
951
- }, {
952
- path: string;
953
- }>;
954
- }, "strict", z.ZodTypeAny, {
955
- form: {
956
- id: string;
957
- action: string | null;
958
- };
959
- page: {
960
- path: string;
961
- };
962
- }, {
963
- form: {
964
- id: string;
965
- action: string | null;
966
- };
967
- page: {
968
- path: string;
969
- };
970
- }>;
971
- readonly configSchema: z.ZodObject<{
972
- selector: z.ZodOptional<z.ZodString>;
973
- }, "strict", z.ZodTypeAny, {
974
- selector?: string | undefined;
975
- }, {
976
- selector?: string | undefined;
977
- }>;
978
- };
979
- readonly sdk_heartbeat: {
980
- readonly kind: "automatic";
981
- readonly semantics: {
982
- readonly label: "SDK heartbeat";
983
- readonly category: "system";
984
- readonly outcomeRole: "diagnostic";
985
- readonly clientVisibility: "hidden";
986
- };
987
- readonly metadataSchema: z.ZodObject<{
988
- sdk_version: z.ZodString;
989
- package_name: z.ZodNullable<z.ZodString>;
990
- surface: z.ZodEnum<["next", "react", "script"]>;
991
- triggers: z.ZodObject<{
992
- automatic: z.ZodArray<z.ZodString, "many">;
993
- manual: z.ZodArray<z.ZodString, "many">;
994
- }, "strict", z.ZodTypeAny, {
995
- automatic: string[];
996
- manual: string[];
997
- }, {
998
- automatic: string[];
999
- manual: string[];
1000
- }>;
1001
- trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
1002
- configured_gtag_ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
1003
- }, "strict", z.ZodTypeAny, {
1004
- sdk_version: string;
1005
- package_name: string | null;
1006
- surface: "next" | "react" | "script";
1007
- triggers: {
1008
- automatic: string[];
1009
- manual: string[];
1010
- };
1011
- trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
1012
- configured_gtag_ids?: Record<string, string> | null | undefined;
1013
- }, {
1014
- sdk_version: string;
1015
- package_name: string | null;
1016
- surface: "next" | "react" | "script";
1017
- triggers: {
1018
- automatic: string[];
1019
- manual: string[];
1020
- };
1021
- trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
1022
- configured_gtag_ids?: Record<string, string> | null | undefined;
1023
- }>;
1024
- readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
1025
- };
1026
- readonly page_exit: {
1027
- readonly kind: "automatic";
1028
- readonly semantics: {
1029
- readonly label: "Page exit";
1030
- readonly category: "engagement";
1031
- readonly outcomeRole: "diagnostic";
1032
- readonly clientVisibility: "detailed";
1033
- };
1034
- readonly metadataSchema: z.ZodObject<{
1035
- dwell_ms: z.ZodNumber;
1036
- max_scroll_percent: z.ZodNullable<z.ZodNumber>;
1037
- scroll_baseline_percent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1038
- page: z.ZodObject<{
1039
- path: z.ZodString;
1040
- }, "strict", z.ZodTypeAny, {
1041
- path: string;
1042
- }, {
1043
- path: string;
1044
- }>;
1045
- }, "strict", z.ZodTypeAny, {
1046
- page: {
1047
- path: string;
1048
- };
1049
- dwell_ms: number;
1050
- max_scroll_percent: number | null;
1051
- scroll_baseline_percent?: number | null | undefined;
1052
- }, {
1053
- page: {
1054
- path: string;
1055
- };
1056
- dwell_ms: number;
1057
- max_scroll_percent: number | null;
1058
- scroll_baseline_percent?: number | null | undefined;
1059
- }>;
1060
- readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
1061
- };
1062
- readonly form_submit: {
1063
- readonly kind: "manual";
1064
- readonly semantics: {
1065
- readonly label: "Form submitted";
1066
- readonly category: "lead";
1067
- readonly outcomeRole: "lead";
1068
- readonly clientVisibility: "simple";
1069
- };
1070
- readonly metadataSchema: z.ZodObject<{
1071
- form: z.ZodObject<{
1072
- id: z.ZodString;
1073
- action: z.ZodNullable<z.ZodString>;
1074
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
1075
- name: z.ZodString;
1076
- type: z.ZodString;
1077
- label: z.ZodNullable<z.ZodString>;
1078
- value: z.ZodType<src.JsonValue, z.ZodTypeDef, src.JsonValue>;
1079
- }, "strict", z.ZodTypeAny, {
1080
- value: src.JsonValue;
1081
- type: string;
1082
- name: string;
1083
- label: string | null;
1084
- }, {
1085
- value: src.JsonValue;
1086
- type: string;
1087
- name: string;
1088
- label: string | null;
1089
- }>, "many">>;
1090
- }, "strict", z.ZodTypeAny, {
1091
- id: string;
1092
- action: string | null;
1093
- fields?: {
1094
- value: src.JsonValue;
1095
- type: string;
1096
- name: string;
1097
- label: string | null;
1098
- }[] | undefined;
1099
- }, {
1100
- id: string;
1101
- action: string | null;
1102
- fields?: {
1103
- value: src.JsonValue;
1104
- type: string;
1105
- name: string;
1106
- label: string | null;
1107
- }[] | undefined;
1108
- }>;
1109
- page: z.ZodObject<{
1110
- path: z.ZodString;
1111
- }, "strict", z.ZodTypeAny, {
1112
- path: string;
1113
- }, {
1114
- path: string;
1115
- }>;
1116
- }, "strict", z.ZodTypeAny, {
1117
- form: {
1118
- id: string;
1119
- action: string | null;
1120
- fields?: {
1121
- value: src.JsonValue;
1122
- type: string;
1123
- name: string;
1124
- label: string | null;
1125
- }[] | undefined;
1126
- };
1127
- page: {
1128
- path: string;
1129
- };
1130
- }, {
1131
- form: {
1132
- id: string;
1133
- action: string | null;
1134
- fields?: {
1135
- value: src.JsonValue;
1136
- type: string;
1137
- name: string;
1138
- label: string | null;
1139
- }[] | undefined;
1140
- };
1141
- page: {
1142
- path: string;
1143
- };
1144
- }>;
1145
- readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
1146
- };
1147
- readonly phone_click: {
1148
- readonly kind: "manual";
1149
- readonly semantics: {
1150
- readonly label: "Phone click";
1151
- readonly category: "lead";
1152
- readonly outcomeRole: "lead";
1153
- readonly clientVisibility: "simple";
1154
- };
1155
- readonly metadataSchema: z.ZodObject<{
1156
- phone_number: z.ZodString;
1157
- page: z.ZodObject<{
1158
- path: z.ZodString;
1159
- }, "strict", z.ZodTypeAny, {
1160
- path: string;
1161
- }, {
1162
- path: string;
1163
- }>;
1164
- section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1165
- }, "strict", z.ZodTypeAny, {
1166
- page: {
1167
- path: string;
1168
- };
1169
- phone_number: string;
1170
- section?: string | null | undefined;
1171
- }, {
1172
- page: {
1173
- path: string;
1174
- };
1175
- phone_number: string;
1176
- section?: string | null | undefined;
1177
- }>;
1178
- readonly configSchema: z.ZodObject<{
1179
- autoCapture: z.ZodOptional<z.ZodObject<{
1180
- selector: z.ZodOptional<z.ZodString>;
1181
- }, "strict", z.ZodTypeAny, {
1182
- selector?: string | undefined;
1183
- }, {
1184
- selector?: string | undefined;
1185
- }>>;
1186
- }, "strict", z.ZodTypeAny, {
1187
- autoCapture?: {
1188
- selector?: string | undefined;
1189
- } | undefined;
1190
- }, {
1191
- autoCapture?: {
1192
- selector?: string | undefined;
1193
- } | undefined;
1194
- }>;
1195
- };
1196
- readonly cta_click: {
1197
- readonly kind: "manual";
1198
- readonly semantics: {
1199
- readonly label: "CTA click";
1200
- readonly category: "engagement";
1201
- readonly outcomeRole: "engagement";
1202
- readonly clientVisibility: "simple";
1203
- };
1204
- readonly metadataSchema: z.ZodObject<{
1205
- cta_name: z.ZodString;
1206
- page: z.ZodObject<{
1207
- path: z.ZodString;
1208
- }, "strict", z.ZodTypeAny, {
1209
- path: string;
1210
- }, {
1211
- path: string;
1212
- }>;
1213
- section: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1214
- destination_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1215
- href: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1216
- element: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1217
- }, "strict", z.ZodTypeAny, {
1218
- page: {
1219
- path: string;
1220
- };
1221
- cta_name: string;
1222
- section?: string | null | undefined;
1223
- href?: string | null | undefined;
1224
- destination_url?: string | null | undefined;
1225
- element?: string | null | undefined;
1226
- }, {
1227
- page: {
1228
- path: string;
1229
- };
1230
- cta_name: string;
1231
- section?: string | null | undefined;
1232
- href?: string | null | undefined;
1233
- destination_url?: string | null | undefined;
1234
- element?: string | null | undefined;
1235
- }>;
1236
- readonly configSchema: z.ZodObject<{
1237
- autoCapture: z.ZodOptional<z.ZodObject<{
1238
- selector: z.ZodOptional<z.ZodString>;
1239
- }, "strict", z.ZodTypeAny, {
1240
- selector?: string | undefined;
1241
- }, {
1242
- selector?: string | undefined;
1243
- }>>;
1244
- }, "strict", z.ZodTypeAny, {
1245
- autoCapture?: {
1246
- selector?: string | undefined;
1247
- } | undefined;
1248
- }, {
1249
- autoCapture?: {
1250
- selector?: string | undefined;
1251
- } | undefined;
1252
- }>;
1253
- };
1254
- };
1255
- /**
1256
- * Event names that are fired by the SDK when their configured signal occurs.
1257
- *
1258
- * Automatic events are not accepted by the typed `trackEvent()` API.
1259
- */
1260
- type AutomaticEventName = {
1261
- [K in EventName]: (typeof EVENT_REGISTRY)[K]["kind"] extends "automatic" ? K : never;
1262
- }[EventName];
1263
- /**
1264
- * Event names that consumer code can fire manually after registering them.
1265
- */
1266
- type ManualEventName = {
1267
- [K in EventName]: (typeof EVENT_REGISTRY)[K]["kind"] extends "manual" ? K : never;
1268
- }[EventName];
1269
- type MetadataByName = {
1270
- page_view: PageViewMetadata;
1271
- time_on_site: TimeOnSiteMetadata;
1272
- specific_page_visit: SpecificPageVisitMetadata;
1273
- scroll_depth: ScrollDepthMetadata;
1274
- multi_page_session: MultiPageSessionMetadata;
1275
- form_start: FormStartMetadata;
1276
- sdk_heartbeat: SdkHeartbeatMetadata;
1277
- page_exit: PageExitMetadata;
1278
- form_submit: FormSubmitMetadata;
1279
- phone_click: PhoneClickMetadata;
1280
- cta_click: CtaClickMetadata;
1281
- };
1282
- type ConfigByName = {
1283
- page_view: PageViewConfig;
1284
- time_on_site: TimeOnSiteConfig;
1285
- specific_page_visit: SpecificPageVisitConfig;
1286
- scroll_depth: ScrollDepthConfig;
1287
- multi_page_session: MultiPageSessionConfig;
1288
- form_start: FormStartConfig;
1289
- sdk_heartbeat: SdkHeartbeatConfig;
1290
- page_exit: PageExitConfig;
1291
- form_submit: FormSubmitConfig;
1292
- phone_click: PhoneClickConfig;
1293
- cta_click: CtaClickConfig;
1294
- };
1295
- /**
1296
- * Metadata payload type for a specific tracking event.
1297
- *
1298
- * @example
1299
- * ```ts
1300
- * type SubmitMetadata = EventMetadata<'form_submit'>;
1301
- * ```
1302
- */
1303
- type EventMetadata<K extends EventName> = MetadataByName[K];
1304
- /**
1305
- * Trigger registration config type for a specific tracking event.
1306
- */
1307
- type EventConfig<K extends EventName> = ConfigByName[K];
1308
- /**
1309
- * Runtime list of automatic event names.
1310
- */
1311
- declare const ALL_AUTOMATIC_EVENT_NAMES: readonly AutomaticEventName[];
1312
- /**
1313
- * Runtime list of manual event names.
1314
- */
1315
- declare const ALL_MANUAL_EVENT_NAMES: readonly ManualEventName[];
1316
- /**
1317
- * Events that represent a lead/outcome in first-party tracking projections.
1318
- */
1319
- declare const ALL_LEAD_EVENT_NAMES: readonly EventName[];
1320
- /**
1321
- * Trigger registry passed to `createTracking({ triggers })`.
1322
- *
1323
- * `automatic.page_view` is required because every install should capture page
1324
- * views. Other automatic events are opt-in. Manual events must be registered
1325
- * here before the typed client accepts `trackEvent()` calls for them.
1326
- *
1327
- * @example
1328
- * ```ts
1329
- * createTracking({
1330
- * apiKey,
1331
- * endpoint,
1332
- * triggers: {
1333
- * automatic: {
1334
- * page_view: {},
1335
- * time_on_site: { thresholdSeconds: 60 },
1336
- * },
1337
- * manual: {
1338
- * form_submit: {},
1339
- * phone_click: {},
1340
- * },
1341
- * },
1342
- * });
1343
- * ```
1344
- */
1345
- type TriggerRegistryConfig = {
1346
- automatic: {
1347
- page_view: EventConfig<"page_view">;
1348
- } & Partial<{
1349
- time_on_site: EventConfig<"time_on_site">;
1350
- specific_page_visit: EventConfig<"specific_page_visit">;
1351
- scroll_depth: EventConfig<"scroll_depth">;
1352
- multi_page_session: EventConfig<"multi_page_session">;
1353
- form_start: EventConfig<"form_start">;
1354
- }>;
1355
- manual?: Partial<{
1356
- form_submit: EventConfig<"form_submit">;
1357
- phone_click: EventConfig<"phone_click">;
1358
- cta_click: EventConfig<"cta_click">;
1359
- }>;
1360
- };
1361
- /**
1362
- * Manual event names registered in a concrete trigger registry.
1363
- *
1364
- * Used by `TypedTrackingClient` so `trackEvent()` only accepts events the
1365
- * consumer explicitly enabled.
1366
- */
1367
- type RegisteredManualEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof NonNullable<TRegistry["manual"]>, ManualEventName>;
1368
- /**
1369
- * Automatic event names registered in a concrete trigger registry.
1370
- */
1371
- type RegisteredAutomaticEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof TRegistry["automatic"], AutomaticEventName>;
1372
- /**
1373
- * Discriminated union of valid manual tracking calls for a registry.
1374
- */
1375
- type TrackableEvent<TRegistry extends TriggerRegistryConfig> = {
1376
- [K in RegisteredManualEvents<TRegistry>]: {
1377
- eventType: K;
1378
- metadata: EventMetadata<K>;
1379
- };
1380
- }[RegisteredManualEvents<TRegistry>];
1381
- declare function getEventDefinition(name: EventName): {
1382
- kind: EventKind;
1383
- semantics: EventSemantics;
1384
- metadataSchema: z.ZodTypeAny;
1385
- configSchema: z.ZodTypeAny;
1386
- };
1387
-
1388
71
  /**
1389
72
  * Input accepted by the low-level stringly-typed client.
1390
73
  *
@@ -1423,332 +106,6 @@ interface TrackingClient {
1423
106
  destroy: () => void;
1424
107
  }
1425
108
 
1426
- interface TypedTrackEventOptions {
1427
- /**
1428
- * Override the page URL associated with this event.
1429
- *
1430
- * Omit this for normal browser usage; the SDK captures `window.location.href`.
1431
- */
1432
- pageUrl?: string | null;
1433
- /**
1434
- * Override the event timestamp.
1435
- *
1436
- * Defaults to the time the event is queued. Accepts a `Date` or ISO string.
1437
- */
1438
- occurredAt?: Date | string | null;
1439
- }
1440
- /**
1441
- * Typed tracking client returned by `useTracking()`.
1442
- *
1443
- * The accepted event names and metadata shapes are narrowed from the concrete
1444
- * trigger registry supplied to `createTracking()`.
1445
- */
1446
- interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
1447
- /**
1448
- * Fire a manually-registered event. The event name must be present in
1449
- * the registry's `manual` map and the metadata must match that event's
1450
- * canonical Zod-derived shape.
1451
- */
1452
- trackEvent<K extends RegisteredManualEvents<TRegistry>>(eventType: K, metadata: EventMetadata<K>, options?: TypedTrackEventOptions): void;
1453
- /**
1454
- * Immediately flush queued events to the ingest endpoint.
1455
- *
1456
- * Normal consumers rarely need this because the SDK flushes on a debounce,
1457
- * when the queue reaches the batch threshold, and on `pagehide`.
1458
- */
1459
- flush(): Promise<void>;
1460
- /**
1461
- * Return the current rolling session id.
1462
- */
1463
- getSessionId(): string;
1464
- /**
1465
- * Return the persistent visitor id for this browser profile.
1466
- */
1467
- getVisitorId(): string;
1468
- }
1469
-
1470
- /**
1471
- * Legacy opt-in-era consent banner.
1472
- *
1473
- * @deprecated PERMANENTLY INERT since consent v2 (opt-out model): it renders
1474
- * only while consent is `pending`, and the effective state is never `pending`
1475
- * anymore, so this component always returns `null`. Tracking is on by default;
1476
- * replace the banner with a footer "cookie preferences" control built on
1477
- * {@link useCookiePreferences} (see the package README). Kept exported so
1478
- * existing integrations keep compiling; scheduled for removal.
1479
- */
1480
- interface ConsentBannerProps {
1481
- /** Body text. Defaults to the standard cookies-for-ad-performance message. */
1482
- message?: ReactNode;
1483
- /** Optional bold title above the body text. */
1484
- title?: ReactNode;
1485
- /** Label for the accept button. Default: `"Accept"`. */
1486
- acceptLabel?: string;
1487
- /** Label for the decline button. Default: `"Decline"`. */
1488
- declineLabel?: string;
1489
- /** Optional link inline with the message (e.g. to a privacy policy). */
1490
- policyHref?: string;
1491
- /** Visible text for {@link policyHref}. Default: `"Learn more"`. */
1492
- policyLabel?: string;
1493
- /**
1494
- * Fires after the consent state is persisted + propagated to gtag. Useful
1495
- * for emitting your own analytics event on the choice.
1496
- */
1497
- onAccept?: () => void;
1498
- onDecline?: () => void;
1499
- /** Where the banner docks. Default: `"bottom"`. */
1500
- position?: "top" | "bottom";
1501
- /**
1502
- * Visual theme. `"auto"` follows `prefers-color-scheme`. Default: `"light"`.
1503
- */
1504
- theme?: "light" | "dark" | "auto";
1505
- /** Class added to the outer wrapper for additional styling hooks. */
1506
- className?: string;
1507
- /** Inline style overrides applied to the outer wrapper after the defaults. */
1508
- style?: CSSProperties;
1509
- }
1510
- /**
1511
- * @deprecated Permanently inert since consent v2 — always renders `null`
1512
- * because the effective consent state is never `pending`. Use a footer
1513
- * control built on {@link useCookiePreferences} instead. See
1514
- * {@link ConsentBannerProps} for details.
1515
- */
1516
- declare function ConsentBanner({ message, title, acceptLabel, declineLabel, policyHref, policyLabel, onAccept, onDecline, position, theme, className, style, }?: ConsentBannerProps): ReactNode;
1517
-
1518
- /**
1519
- * Read the captured Google Ads click id from first-party cookies.
1520
- *
1521
- * Returns `null` during SSR and before the client has mounted.
1522
- */
1523
- declare function useGclid(): string | null;
1524
- /**
1525
- * Read all captured attribution parameters from first-party cookies.
1526
- *
1527
- * Values are loaded after mount, so the initial render returns all `null`s.
1528
- */
1529
- declare function useTrackingParams(): TrackingParams;
1530
- /** Options for {@link useCookiePreferences}. */
1531
- interface UseCookiePreferencesOptions {
1532
- /** Days an explicit decline is honored. Defaults to 90. */
1533
- declineTtlDays?: number;
1534
- }
1535
- /**
1536
- * The headless cookie-preferences surface returned by
1537
- * {@link useCookiePreferences}.
1538
- */
1539
- interface UseCookiePreferencesResult {
1540
- /** Effective consent — `granted` unless an unexpired explicit decline exists. */
1541
- state: ConsentChoiceState;
1542
- /** `default` = no valid explicit choice stored; `explicit` = visitor chose. */
1543
- source: ConsentSource;
1544
- /** True when the visitor has made no (valid, unexpired) explicit choice. */
1545
- isDefault: boolean;
1546
- isGranted: boolean;
1547
- isDenied: boolean;
1548
- /** ISO timestamp of the explicit choice; null for the default state. */
1549
- updatedAt: string | null;
1550
- /** ISO expiry of an unexpired decline; null otherwise. */
1551
- expiresAt: string | null;
1552
- /** Explicitly opt out of ad tracking (honored for 90 days by default). */
1553
- optOut: () => void;
1554
- /** Explicitly opt in (never expires). */
1555
- optIn: () => void;
1556
- /** Clear the explicit choice — back to default-granted. */
1557
- reset: () => void;
1558
- }
1559
- /**
1560
- * Headless cookie-preferences hook for the opt-out consent model (consent v2).
1561
- *
1562
- * Tracking is ON by default; this hook is how each client site wires its own
1563
- * footer "Cookie preferences" control (button, dialog, toggle — the packages
1564
- * ship no consent UI). State stays in sync with actions from other components
1565
- * in the same tab (via `onConsentChange`) and other tabs (via `storage`
1566
- * events).
1567
- *
1568
- * ```tsx
1569
- * function CookiePreferences() {
1570
- * const { isDenied, optOut, optIn } = useCookiePreferences();
1571
- * return isDenied ? (
1572
- * <button onClick={optIn}>Enable ad measurement</button>
1573
- * ) : (
1574
- * <button onClick={optOut}>Opt out of ad measurement</button>
1575
- * );
1576
- * }
1577
- * ```
1578
- */
1579
- declare function useCookiePreferences(options?: UseCookiePreferencesOptions): UseCookiePreferencesResult;
1580
- /**
1581
- * Read the current visitor consent state.
1582
- *
1583
- * @deprecated Since consent v2 (opt-out model) the state is never `pending`.
1584
- * Use {@link useCookiePreferences} — it exposes the effective state plus
1585
- * `source` so you can tell a default grant from an explicit one.
1586
- */
1587
- declare function useConsentState(): ConsentState;
1588
- /**
1589
- * Result shape of the deprecated {@link useConsent} hook.
1590
- *
1591
- * @deprecated Use {@link UseCookiePreferencesResult} via
1592
- * {@link useCookiePreferences}. `isPending` is always `false` since consent v2.
1593
- */
1594
- interface UseConsentResult {
1595
- state: ConsentState;
1596
- isPending: boolean;
1597
- isGranted: boolean;
1598
- isDenied: boolean;
1599
- accept: () => void;
1600
- decline: () => void;
1601
- reset: () => void;
1602
- }
1603
- /**
1604
- * Legacy opt-in-era consent hook.
1605
- *
1606
- * @deprecated Since consent v2 tracking defaults ON (opt-out model): the state
1607
- * is never `pending`, so banner UIs gated on `isPending` never render. Use
1608
- * {@link useCookiePreferences} for footer "cookie preferences" controls.
1609
- * `accept` / `decline` still work and map to `optIn` / `optOut`.
1610
- */
1611
- declare function useConsent(): UseConsentResult;
1612
-
1613
- /**
1614
- * Props for the combined Next.js ad-platform tag loader.
1615
- *
1616
- * Every field is optional and independent: pass the Google fields, the Meta
1617
- * fields, or both. For each platform a labelled `*Ids` map (ALL loaded) takes
1618
- * precedence over the single `*Id` shortcut.
1619
- */
1620
- interface AdPlatformTrackingProps {
1621
- /** Single Google Ads tag id, e.g. `AW-123456789`. */
1622
- gtagId?: string;
1623
- /** Labelled Google Ads tag map — ALL loaded; wins over `gtagId`. */
1624
- gtagIds?: GtagEnvironmentMap;
1625
- /** R2-authoritative Google tracking config. When set, static gtagId(s) are ignored. */
1626
- trackingConfig?: TrackingConfigReference;
1627
- /** Fire a Google page view from this standalone loader. Leave false when using TrackingProvider. */
1628
- standalonePageView?: boolean;
1629
- /** Single Meta Pixel id, e.g. `123456789012345`. */
1630
- metaPixelId?: string;
1631
- /** Labelled Meta Pixel map — ALL loaded; wins over `metaPixelId`. */
1632
- metaPixelIds?: MetaPixelEnvironmentMap;
1633
- }
1634
- /**
1635
- * Next.js client component that loads the configured ad-platform tags — the
1636
- * Google tag (`gtag`) and/or the Meta Pixel (`fbq`) — with Consent Mode, via
1637
- * `next/script`. Render once in the root layout; omit a platform's props to
1638
- * skip it. Renders no visible UI.
1639
- */
1640
- declare function AdPlatformTracking({ gtagId, gtagIds, trackingConfig, standalonePageView, metaPixelId, metaPixelIds, }: AdPlatformTrackingProps): react_jsx_runtime.JSX.Element;
1641
-
1642
- /**
1643
- * Props for the Next.js Google Ads tracking component.
1644
- *
1645
- * Accepts either a single `gtagId` (legacy) or a labelled `gtagIds` map
1646
- * where ALL entries are loaded simultaneously via `gtag('config', ...)`.
1647
- */
1648
- type GoogleAdsTrackingProps = {
1649
- gtagId: string;
1650
- gtagIds?: undefined;
1651
- } | {
1652
- gtagId?: undefined;
1653
- gtagIds: GtagEnvironmentMap;
1654
- };
1655
- /**
1656
- * Next.js client component that loads Google Ads gtag with Consent Mode.
1657
- *
1658
- * Render in the root layout `<head>` when the client site runs paid Google
1659
- * Ads. The component injects Next `<Script>` tags and renders no visible UI.
1660
- */
1661
- declare function GoogleAdsTracking(props: GoogleAdsTrackingProps): react_jsx_runtime.JSX.Element | null;
1662
-
1663
- interface CreateTrackingOptions<TRegistry extends TriggerRegistryConfig> {
1664
- /**
1665
- * Public tracking API key issued for this business.
1666
- *
1667
- * This key is safe to expose via `NEXT_PUBLIC_*` env vars.
1668
- */
1669
- apiKey: string;
1670
- /**
1671
- * Tracking endpoint base URL, usually ending in `/tracking`.
1672
- */
1673
- endpoint: string;
1674
- /**
1675
- * Trigger registry that controls automatic events and typed manual events.
1676
- */
1677
- triggers: TRegistry;
1678
- /**
1679
- * Deployment environment label reported in session context.
1680
- */
1681
- environment?: TrackingEnvironment;
1682
- /**
1683
- * Labelled map of Google Ads tag IDs. Included in session context and
1684
- * heartbeat metadata so the dashboard can show what's configured.
1685
- *
1686
- * This does NOT load the gtag scripts — use `<GoogleAdsTracking gtagIds={...} />`
1687
- * in the root layout for that. This option only controls what's reported
1688
- * in the tracking payload context.
1689
- */
1690
- gtagIds?: Record<string, string>;
1691
- /**
1692
- * Validate manual event metadata at runtime before queueing.
1693
- *
1694
- * Enable in development to catch shape bugs. Leave disabled in production so
1695
- * analytics can never throw into the host app.
1696
- */
1697
- debug?: boolean;
1698
- /**
1699
- * Phone-field display + default-country config, read by `usePhoneField` /
1700
- * `<PhoneField>`. Display is customizable; the transmitted value is always E.164.
1701
- */
1702
- phone?: PhoneConfig;
1703
- /**
1704
- * GAP28 / unified-goal: enable real-time on-site conversion firing. When set, the SDK
1705
- * fetches the per-business config from `cdnUrl` (optional offline `baked` fallback) and
1706
- * AUTOMATICALLY fires `gtag('event','conversion')` for any automatic event-goal whose
1707
- * trigger threshold a detector crosses. Omit to keep events analytics-only.
1708
- */
1709
- conversionConfig?: {
1710
- cdnUrl: string;
1711
- baked?: ConversionConfig | null;
1712
- };
1713
- /**
1714
- * R2-authoritative config reference — `ARANOVA_TRACKING_CONFIG` from
1715
- * `tracking-cli gen`. Wins over `conversionConfig`. The object URL is composed
1716
- * from `businessId` + `environment` against the production CDN; spread in a
1717
- * `cdnBaseUrl` to read it from somewhere else, e.g.
1718
- * `{ ...ARANOVA_TRACKING_CONFIG, cdnBaseUrl: process.env.NEXT_PUBLIC_ARANOVA_CDN_BASE_URL }`.
1719
- */
1720
- trackingConfig?: TrackingConfigReference;
1721
- }
1722
- interface TrackingProviderProps {
1723
- /**
1724
- * Application subtree that should have access to the tracking client.
1725
- */
1726
- children: ReactNode;
1727
- }
1728
- interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
1729
- /**
1730
- * Client component provider for the Next.js App Router integration.
1731
- */
1732
- TrackingProvider: (props: TrackingProviderProps) => ReactNode;
1733
- /**
1734
- * Hook that returns the registry-typed tracking client.
1735
- */
1736
- useTracking: () => TypedTrackingClient<TRegistry>;
1737
- }
1738
- /**
1739
- * Next.js App Router version of the `createTracking()` factory. Uses
1740
- * `usePathname` + `useSearchParams` from `next/navigation` for SPA route
1741
- * detection rather than patching `history.pushState`, because Next's
1742
- * router does not always go through the History API for transitions.
1743
- *
1744
- * Usage is identical to the React factory — call this once at app
1745
- * startup and export the returned `TrackingProvider` + `useTracking`
1746
- * from your own module, then import them everywhere else. `GoogleAdsTracking`
1747
- * is still imported separately and placed in the root layout's `<head>`
1748
- * when the client runs paid ads.
1749
- */
1750
- declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
1751
-
1752
109
  declare function CalendarClientProvider({ value, children, }: {
1753
110
  value: CalendarReadClient | null;
1754
111
  children: ReactNode;
@@ -1800,61 +157,4 @@ interface UseBookingFormResult {
1800
157
  */
1801
158
  declare function useBookingForm(options?: UseBookingFormOptions): UseBookingFormResult;
1802
159
 
1803
- /** Resolve the effective phone config (provider value or built-in defaults). */
1804
- declare function usePhoneConfig(): {
1805
- defaultCountry: CountryCode;
1806
- display: PhoneDisplayFormat;
1807
- };
1808
- interface UsePhoneFieldOptions {
1809
- defaultValue?: string;
1810
- /** Overrides the provider's `defaultCountry`. */
1811
- country?: CountryCode;
1812
- /** Overrides the provider's `display` (applied to the settled value on blur). */
1813
- display?: PhoneDisplayFormat;
1814
- /** Notified with the canonical E.164 (or `null`) on every change. */
1815
- onValueChange?: (e164: string | null) => void;
1816
- }
1817
- interface PhoneInputProps {
1818
- value: string;
1819
- onChange: (event: ChangeEvent<HTMLInputElement>) => void;
1820
- onBlur: (event: FocusEvent<HTMLInputElement>) => void;
1821
- type: "tel";
1822
- inputMode: "tel";
1823
- autoComplete: "tel";
1824
- }
1825
- interface PhoneFieldApi {
1826
- /** Display value for the `<input>` (live `AsYouType` while typing). */
1827
- value: string;
1828
- /** Canonical E.164 — what gets transmitted. `null` while invalid/incomplete. */
1829
- e164: string | null;
1830
- isValid: boolean;
1831
- /** Validation message, surfaced only after blur with non-empty invalid input. */
1832
- error: string | null;
1833
- parsed: ParsedPhone;
1834
- /** Spread onto an `<input>`: pre-wires value/onChange/onBlur/type/inputMode/autoComplete. */
1835
- inputProps: PhoneInputProps;
1836
- }
1837
- /** Headless phone field — the client owns the markup. */
1838
- declare function usePhoneField(opts?: UsePhoneFieldOptions): PhoneFieldApi;
1839
- interface PhoneFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
1840
- country?: CountryCode;
1841
- /** Controlled display value. */
1842
- value?: string;
1843
- /** Uncontrolled initial value. */
1844
- defaultValue?: string;
1845
- /** Receives the native change event (RHF `register().onChange` or your own); the
1846
- * event's `target.value` is already `AsYouType`-formatted. */
1847
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
1848
- /** Receives the canonical E.164 (or `null`) on every change. */
1849
- onE164Change?: (e164: string | null) => void;
1850
- }
1851
- /**
1852
- * Batteries-included phone input. Composes identically with react-hook-form
1853
- * `{...register('phone')}` and with controlled state — the `AsYouType` +
1854
- * mutate-`e.target.value`-before-`onChange` technique lives inside, so RHF and
1855
- * controlled parents both receive the formatted value, and the wire value stays
1856
- * E.164.
1857
- */
1858
- declare const PhoneField: react.ForwardRefExoticComponent<PhoneFieldProps & react.RefAttributes<HTMLInputElement>>;
1859
-
1860
- export { ALL_AUTOMATIC_EVENT_NAMES, ALL_LEAD_EVENT_NAMES, ALL_MANUAL_EVENT_NAMES, AdPlatformTracking, type AdPlatformTrackingProps, type AutomaticEventName, Booking, BookingCreateInput, BusyInterval, CalendarClientProvider, CalendarReadClient, ComputeSlotsOptions, ConsentBanner, type ConsentBannerProps, ConsentChoiceState, ConsentSource, ConsentState, ConversionConfig, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, EVENT_REGISTRY, EVENT_SEMANTICS, type EventCategory, type EventClientVisibility, type EventConfig, type EventKind, type EventMetadata, type EventName, type EventOutcomeRole, type EventSemantics, type FormStartConfig, type FormStartMetadata, FormSubmitConfig, FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, GtagEnvironmentMap, type ManualEventName, MetaPixelEnvironmentMap, type MultiPageSessionConfig, type MultiPageSessionMetadata, OpeningHours, PAGE_IDENTITY_MAX_LENGTH, PAGE_IDENTITY_PATTERN, type PageExitConfig, type PageExitMetadata, type PageIdentity, type PageViewConfig, type PageViewMetadata, ParsedPhone, type PhoneClickConfig, type PhoneClickMetadata, PhoneConfig, PhoneDisplayFormat, PhoneField, type PhoneFieldApi, type PhoneFieldProps, type PhoneInputProps, type RegisteredAutomaticEvents, type RegisteredManualEvents, SPECIFIC_PAGE_NAMES, type ScrollDepthConfig, type ScrollDepthMetadata, type SdkHeartbeatConfig, type SdkHeartbeatMetadata, Slot, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackableEvent, type TrackingClient, TrackingClientContext, TrackingConfigReference, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, type UseConsentResult, type UseCookiePreferencesOptions, type UseCookiePreferencesResult, type UsePhoneFieldOptions, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, ctaClickConfigSchema, ctaClickMetadataSchema, formStartConfigSchema, formStartMetadataSchema, getEventDefinition, getEventSemantics, multiPageSessionConfigSchema, multiPageSessionMetadataSchema, pageExitConfigSchema, pageExitMetadataSchema, pageIdentitySchema, pageViewConfigSchema, pageViewMetadataSchema, phoneClickConfigSchema, phoneClickMetadataSchema, scrollDepthConfigSchema, scrollDepthMetadataSchema, sdkHeartbeatConfigSchema, sdkHeartbeatMetadataSchema, sdkHeartbeatTriggersSchema, specificPageNameSchema, specificPageVisitConfigSchema, specificPageVisitMetadataSchema, timeOnSiteConfigSchema, timeOnSiteMetadataSchema, useBookingForm, useCalendarBusy, useCalendarClient, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useSlots, useTrackingParams };
160
+ export { Booking, BookingCreateInput, BusyInterval, CalendarClientProvider, CalendarReadClient, ComputeSlotsOptions, OpeningHours, Slot, TRACKING_PARAM_KEYS, type TrackingClient, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, TrackingSessionUpsertPayload, captureTrackingParamsFromLocation, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, useBookingForm, useCalendarBusy, useCalendarClient, useSlots };