@aranova/tracking-next 0.27.0 → 1.0.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.
Files changed (71) hide show
  1. package/dist/blog-server.d.mts +2 -1
  2. package/dist/blog-server.d.ts +2 -1
  3. package/dist/blog-server.js +121 -98
  4. package/dist/blog-server.js.map +1 -1
  5. package/dist/blog-server.mjs +86 -63
  6. package/dist/blog-server.mjs.map +1 -1
  7. package/dist/blog.d.mts +651 -1755
  8. package/dist/blog.d.ts +651 -1755
  9. package/dist/blog.js +121 -98
  10. package/dist/blog.js.map +1 -1
  11. package/dist/blog.mjs +86 -63
  12. package/dist/blog.mjs.map +1 -1
  13. package/dist/calendar-server.d.mts +2 -2
  14. package/dist/calendar-server.d.ts +2 -2
  15. package/dist/calendar-server.js +0 -26
  16. package/dist/calendar-server.js.map +1 -1
  17. package/dist/calendar-server.mjs +0 -26
  18. package/dist/calendar-server.mjs.map +1 -1
  19. package/dist/calendar.d.mts +3 -3
  20. package/dist/calendar.d.ts +3 -3
  21. package/dist/calendar.js +227 -126
  22. package/dist/calendar.js.map +1 -1
  23. package/dist/calendar.mjs +216 -125
  24. package/dist/calendar.mjs.map +1 -1
  25. package/dist/client.d.mts +4 -3
  26. package/dist/client.d.ts +4 -3
  27. package/dist/client.js +185 -277
  28. package/dist/client.js.map +1 -1
  29. package/dist/client.mjs +157 -249
  30. package/dist/client.mjs.map +1 -1
  31. package/dist/index.d.mts +8 -7
  32. package/dist/index.d.ts +8 -7
  33. package/dist/index.js +482 -484
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +471 -484
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/ingest-typed-BdKmlouW.d.ts +791 -0
  38. package/dist/ingest-typed-Bo7WPmpU.d.mts +791 -0
  39. package/dist/middleware.js +0 -467
  40. package/dist/middleware.js.map +1 -1
  41. package/dist/middleware.mjs +0 -467
  42. package/dist/middleware.mjs.map +1 -1
  43. package/dist/{phone-utils-BVzSNBf1.d.mts → phone-utils-CubQif9Z.d.mts} +18 -78
  44. package/dist/{phone-utils-BVzSNBf1.d.ts → phone-utils-CubQif9Z.d.ts} +18 -78
  45. package/dist/phone.d.mts +2 -2
  46. package/dist/phone.d.ts +2 -2
  47. package/dist/phone.js +0 -464
  48. package/dist/phone.js.map +1 -1
  49. package/dist/phone.mjs +0 -464
  50. package/dist/phone.mjs.map +1 -1
  51. package/dist/{sales-DQGzXSgL.d.mts → sales-D7KstKA-.d.mts} +89 -328
  52. package/dist/{sales-IGC2tq4J.d.ts → sales-DG150g3o.d.ts} +89 -328
  53. package/dist/sales.d.mts +2 -2
  54. package/dist/sales.d.ts +2 -2
  55. package/dist/sales.js +265 -127
  56. package/dist/sales.js.map +1 -1
  57. package/dist/sales.mjs +254 -127
  58. package/dist/sales.mjs.map +1 -1
  59. package/dist/server.d.mts +2 -2
  60. package/dist/server.d.ts +2 -2
  61. package/dist/server.js +0 -467
  62. package/dist/server.js.map +1 -1
  63. package/dist/server.mjs +0 -467
  64. package/dist/server.mjs.map +1 -1
  65. package/dist/transport-CDmGOiCq.d.ts +253 -0
  66. package/dist/transport-I_cMSFQ6.d.mts +253 -0
  67. package/package.json +2 -2
  68. package/dist/ingest-typed-BxLFlZ7N.d.mts +0 -1371
  69. package/dist/ingest-typed-ByQVRMvP.d.ts +0 -1371
  70. package/dist/transport-C-_rFSR4.d.ts +0 -721
  71. package/dist/transport-yUF5Wize.d.mts +0 -721
package/dist/client.js CHANGED
@@ -626,10 +626,10 @@ function readStoredRecord() {
626
626
  return null;
627
627
  }
628
628
  }
629
- function writeRecord(record) {
630
- memoryRecord = record;
629
+ function writeRecord(record3) {
630
+ memoryRecord = record3;
631
631
  try {
632
- window.localStorage.setItem(LANDING_STORAGE_KEY, JSON.stringify(record));
632
+ window.localStorage.setItem(LANDING_STORAGE_KEY, JSON.stringify(record3));
633
633
  } catch {
634
634
  }
635
635
  }
@@ -651,9 +651,9 @@ function getOrCaptureLandingParams(sessionId, url) {
651
651
  if (memoryRecord && memoryRecord.session_id === sessionId) {
652
652
  return memoryRecord.params;
653
653
  }
654
- const record = { session_id: sessionId, params: captureFromUrl(url) };
655
- writeRecord(record);
656
- return record.params;
654
+ const record3 = { session_id: sessionId, params: captureFromUrl(url) };
655
+ writeRecord(record3);
656
+ return record3.params;
657
657
  }
658
658
  function buildLandingPayloadFields(sessionId, override) {
659
659
  const params = override ?? (typeof window === "undefined" ? null : getOrCaptureLandingParams(sessionId));
@@ -1485,25 +1485,32 @@ function getOrRotateSessionId(now = Date.now()) {
1485
1485
  return { id: fresh.id, isNew: true };
1486
1486
  }
1487
1487
 
1488
+ // ../tracking-core/src/page-view.ts
1489
+ var import_mini = require("zod/mini");
1490
+
1488
1491
  // ../tracking-core/src/events/page-view.ts
1489
- var import_zod = require("zod");
1490
- var pageViewMetadataSchema = import_zod.z.object({
1491
- page: import_zod.z.object({
1492
- title: import_zod.z.string().nullable(),
1493
- path: import_zod.z.string(),
1494
- search: import_zod.z.string(),
1495
- hash: import_zod.z.string()
1496
- }).strict(),
1497
- referrer: import_zod.z.string().nullable(),
1498
- // `.nullable().optional()` — absent (undefined) OR explicit null OR a
1492
+ var z = __toESM(require("zod/mini"));
1493
+ var pageViewMetadataSchema = z.strictObject({
1494
+ page: z.strictObject({
1495
+ title: z.nullable(z.string()),
1496
+ path: z.string(),
1497
+ search: z.string(),
1498
+ hash: z.string()
1499
+ }),
1500
+ referrer: z.nullable(z.string()),
1501
+ // Optional + nullable — absent (undefined) OR explicit null OR a
1499
1502
  // real viewport object. Mirrors Pydantic's `_Viewport | None = None`
1500
1503
  // on the backend side so the drift test stays clean.
1501
- viewport: import_zod.z.object({
1502
- w: import_zod.z.number(),
1503
- h: import_zod.z.number()
1504
- }).strict().nullable().optional()
1505
- }).strict();
1506
- var pageViewConfigSchema = import_zod.z.object({}).strict();
1504
+ viewport: z.optional(
1505
+ z.nullable(
1506
+ z.strictObject({
1507
+ w: z.number(),
1508
+ h: z.number()
1509
+ })
1510
+ )
1511
+ )
1512
+ });
1513
+ var pageViewConfigSchema = z.strictObject({});
1507
1514
 
1508
1515
  // ../tracking-core/src/page-view.ts
1509
1516
  var LAST_FIRED_URL_STORAGE_KEY = "aranova_tracking_last_fired_url";
@@ -1539,7 +1546,7 @@ function setLastFiredUrl(url) {
1539
1546
  }
1540
1547
  function buildPageViewMetadata(referrerOverride) {
1541
1548
  if (typeof window === "undefined" || typeof document === "undefined") return null;
1542
- return pageViewMetadataSchema.parse({
1549
+ return (0, import_mini.parse)(pageViewMetadataSchema, {
1543
1550
  page: {
1544
1551
  title: document.title || null,
1545
1552
  path: window.location.pathname,
@@ -1997,186 +2004,198 @@ function createTrackingClient(config) {
1997
2004
  };
1998
2005
  }
1999
2006
 
2007
+ // ../tracking-core/src/ingest-typed.ts
2008
+ var import_mini2 = require("zod/mini");
2009
+
2000
2010
  // ../tracking-core/src/events/cta-click.ts
2001
- var import_zod2 = require("zod");
2002
- var ctaClickMetadataSchema = import_zod2.z.object({
2003
- cta_name: import_zod2.z.string(),
2004
- page: import_zod2.z.object({
2005
- path: import_zod2.z.string()
2006
- }).strict(),
2007
- section: import_zod2.z.string().nullable().optional(),
2008
- destination_url: import_zod2.z.string().nullable().optional(),
2011
+ var z2 = __toESM(require("zod/mini"));
2012
+ var ctaClickMetadataSchema = z2.strictObject({
2013
+ cta_name: z2.string(),
2014
+ page: z2.strictObject({
2015
+ path: z2.string()
2016
+ }),
2017
+ section: z2.optional(z2.nullable(z2.string())),
2018
+ destination_url: z2.optional(z2.nullable(z2.string())),
2009
2019
  // Set by auto-capture (and available to manual callers): the link target
2010
2020
  // and a short element descriptor (tag#id) for tying clicks to specific UI.
2011
- href: import_zod2.z.string().nullable().optional(),
2012
- element: import_zod2.z.string().nullable().optional()
2013
- }).strict();
2014
- var ctaClickConfigSchema = import_zod2.z.object({
2015
- autoCapture: import_zod2.z.object({
2016
- selector: import_zod2.z.string().optional()
2017
- }).strict().optional()
2018
- }).strict();
2021
+ href: z2.optional(z2.nullable(z2.string())),
2022
+ element: z2.optional(z2.nullable(z2.string()))
2023
+ });
2024
+ var ctaClickConfigSchema = z2.strictObject({
2025
+ autoCapture: z2.optional(
2026
+ z2.strictObject({
2027
+ selector: z2.optional(z2.string())
2028
+ })
2029
+ )
2030
+ });
2019
2031
 
2020
2032
  // ../tracking-core/src/events/sdk-heartbeat.ts
2021
- var import_zod3 = require("zod");
2022
- var sdkHeartbeatTriggersSchema = import_zod3.z.object({
2023
- automatic: import_zod3.z.array(import_zod3.z.string()),
2024
- manual: import_zod3.z.array(import_zod3.z.string())
2025
- }).strict();
2026
- var sdkHeartbeatMetadataSchema = import_zod3.z.object({
2027
- sdk_version: import_zod3.z.string(),
2028
- package_name: import_zod3.z.string().nullable(),
2029
- surface: import_zod3.z.enum(["next", "react", "script"]),
2033
+ var z3 = __toESM(require("zod/mini"));
2034
+ var sdkHeartbeatTriggersSchema = z3.strictObject({
2035
+ automatic: z3.array(z3.string()),
2036
+ manual: z3.array(z3.string())
2037
+ });
2038
+ var sdkHeartbeatMetadataSchema = z3.strictObject({
2039
+ sdk_version: z3.string(),
2040
+ package_name: z3.nullable(z3.string()),
2041
+ surface: z3.enum(["next", "react", "script"]),
2030
2042
  triggers: sdkHeartbeatTriggersSchema,
2031
- trigger_config: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown())).nullable().optional(),
2032
- configured_gtag_ids: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.string()).nullable().optional(),
2043
+ trigger_config: z3.optional(z3.nullable(z3.record(z3.string(), z3.record(z3.string(), z3.unknown())))),
2044
+ configured_gtag_ids: z3.optional(z3.nullable(z3.record(z3.string(), z3.string()))),
2033
2045
  // Site whose config object the SDK resolves; null on a legacy business ref.
2034
- config_site_id: import_zod3.z.string().uuid().nullable().optional()
2035
- }).strict();
2036
- var sdkHeartbeatConfigSchema = import_zod3.z.object({}).strict();
2046
+ config_site_id: z3.optional(z3.nullable(z3.uuid()))
2047
+ });
2048
+ var sdkHeartbeatConfigSchema = z3.strictObject({});
2037
2049
 
2038
2050
  // ../tracking-core/src/events/form-start.ts
2039
- var import_zod4 = require("zod");
2040
- var formStartMetadataSchema = import_zod4.z.object({
2041
- form: import_zod4.z.object({
2042
- id: import_zod4.z.string(),
2043
- action: import_zod4.z.string().nullable()
2044
- }).strict(),
2045
- page: import_zod4.z.object({
2046
- path: import_zod4.z.string()
2047
- }).strict()
2048
- }).strict();
2049
- var formStartConfigSchema = import_zod4.z.object({
2050
- selector: import_zod4.z.string().optional()
2051
- }).strict();
2051
+ var z4 = __toESM(require("zod/mini"));
2052
+ var formStartMetadataSchema = z4.strictObject({
2053
+ form: z4.strictObject({
2054
+ id: z4.string(),
2055
+ action: z4.nullable(z4.string())
2056
+ }),
2057
+ page: z4.strictObject({
2058
+ path: z4.string()
2059
+ })
2060
+ });
2061
+ var formStartConfigSchema = z4.strictObject({
2062
+ selector: z4.optional(z4.string())
2063
+ });
2052
2064
 
2053
2065
  // ../tracking-core/src/events/form-submit.ts
2054
- var import_zod5 = require("zod");
2055
- var jsonValueSchema = import_zod5.z.lazy(
2056
- () => import_zod5.z.union([
2057
- import_zod5.z.string(),
2058
- import_zod5.z.number().finite(),
2059
- import_zod5.z.boolean(),
2060
- import_zod5.z.null(),
2061
- import_zod5.z.array(jsonValueSchema),
2062
- import_zod5.z.record(jsonValueSchema)
2066
+ var z5 = __toESM(require("zod/mini"));
2067
+ var jsonValueSchema = z5.lazy(
2068
+ () => z5.union([
2069
+ z5.string(),
2070
+ z5.number(),
2071
+ z5.boolean(),
2072
+ z5.null(),
2073
+ z5.array(jsonValueSchema),
2074
+ z5.record(z5.string(), jsonValueSchema)
2063
2075
  ])
2064
- );
2065
- var formSubmitMetadataSchema = import_zod5.z.object({
2066
- form: import_zod5.z.object({
2067
- id: import_zod5.z.string(),
2068
- action: import_zod5.z.string().nullable(),
2069
- fields: import_zod5.z.array(
2070
- import_zod5.z.object({
2071
- name: import_zod5.z.string(),
2072
- type: import_zod5.z.string(),
2073
- label: import_zod5.z.string().nullable(),
2074
- value: jsonValueSchema
2075
- }).strict()
2076
- ).optional()
2077
- }).strict(),
2078
- page: import_zod5.z.object({
2079
- path: import_zod5.z.string()
2080
- }).strict()
2081
- }).strict();
2082
- var formSubmitConfigSchema = import_zod5.z.object({}).strict();
2076
+ ).register(z5.globalRegistry, { id: "JsonSerializableValue" });
2077
+ var formSubmitMetadataSchema = z5.strictObject({
2078
+ form: z5.strictObject({
2079
+ id: z5.string(),
2080
+ action: z5.nullable(z5.string()),
2081
+ fields: z5.optional(
2082
+ z5.array(
2083
+ z5.strictObject({
2084
+ name: z5.string(),
2085
+ type: z5.string(),
2086
+ label: z5.nullable(z5.string()),
2087
+ value: jsonValueSchema
2088
+ })
2089
+ )
2090
+ )
2091
+ }),
2092
+ page: z5.strictObject({
2093
+ path: z5.string()
2094
+ })
2095
+ });
2096
+ var formSubmitConfigSchema = z5.strictObject({});
2083
2097
 
2084
2098
  // ../tracking-core/src/events/multi-page-session.ts
2085
- var import_zod6 = require("zod");
2086
- var multiPageSessionMetadataSchema = import_zod6.z.object({
2087
- page_count: import_zod6.z.number().int().min(2),
2088
- page: import_zod6.z.object({
2089
- path: import_zod6.z.string()
2090
- }).strict()
2091
- }).strict();
2092
- var multiPageSessionConfigSchema = import_zod6.z.object({
2093
- pageThreshold: import_zod6.z.number().int().min(2)
2094
- }).strict();
2099
+ var z6 = __toESM(require("zod/mini"));
2100
+ var multiPageSessionMetadataSchema = z6.strictObject({
2101
+ page_count: z6.int().check(z6.gte(2)),
2102
+ page: z6.strictObject({
2103
+ path: z6.string()
2104
+ })
2105
+ });
2106
+ var multiPageSessionConfigSchema = z6.strictObject({
2107
+ pageThreshold: z6.int().check(z6.gte(2))
2108
+ });
2095
2109
 
2096
2110
  // ../tracking-core/src/events/page-exit.ts
2097
- var import_zod7 = require("zod");
2098
- var pageExitMetadataSchema = import_zod7.z.object({
2099
- dwell_ms: import_zod7.z.number().int().min(0),
2111
+ var z7 = __toESM(require("zod/mini"));
2112
+ var pageExitMetadataSchema = z7.strictObject({
2113
+ dwell_ms: z7.int().check(z7.gte(0)),
2100
2114
  // null = left without any scroll signal; floor is 0 so a valid 0% is never
2101
2115
  // rejected (a single bad field 422s the whole keepalive beacon batch).
2102
- max_scroll_percent: import_zod7.z.number().int().min(0).max(100).nullable(),
2116
+ max_scroll_percent: z7.nullable(z7.int().check(z7.gte(0), z7.lte(100))),
2103
2117
  // The gating baseline: the fraction of the page visible at load with
2104
2118
  // zero scrolling — or, for pages that grew after the post-paint snapshot
2105
2119
  // (skeleton/streaming renders), the first-scroll position that
2106
2120
  // established it. null = page had no scrollable range, or the segment
2107
- // ended before the snapshot. `.optional()` is load-bearing: SDK builds
2121
+ // ended before the snapshot. Optionality is load-bearing: SDK builds
2108
2122
  // predating this field keep POSTing page_exit without the key —
2109
2123
  // requiring it would 422 whole keepalive beacon batches.
2110
- scroll_baseline_percent: import_zod7.z.number().int().min(0).max(100).nullable().optional(),
2111
- page: import_zod7.z.object({
2112
- path: import_zod7.z.string()
2113
- }).strict()
2114
- }).strict();
2115
- var pageExitConfigSchema = import_zod7.z.object({}).strict();
2124
+ scroll_baseline_percent: z7.optional(z7.nullable(z7.int().check(z7.gte(0), z7.lte(100)))),
2125
+ page: z7.strictObject({
2126
+ path: z7.string()
2127
+ })
2128
+ });
2129
+ var pageExitConfigSchema = z7.strictObject({});
2116
2130
 
2117
2131
  // ../tracking-core/src/events/phone-click.ts
2118
- var import_zod8 = require("zod");
2119
- var phoneClickMetadataSchema = import_zod8.z.object({
2120
- phone_number: import_zod8.z.string(),
2121
- page: import_zod8.z.object({
2122
- path: import_zod8.z.string()
2123
- }).strict(),
2124
- section: import_zod8.z.string().nullable().optional()
2125
- }).strict();
2126
- var phoneClickConfigSchema = import_zod8.z.object({
2127
- autoCapture: import_zod8.z.object({
2128
- selector: import_zod8.z.string().optional()
2129
- }).strict().optional()
2130
- }).strict();
2132
+ var z8 = __toESM(require("zod/mini"));
2133
+ var phoneClickMetadataSchema = z8.strictObject({
2134
+ phone_number: z8.string(),
2135
+ page: z8.strictObject({
2136
+ path: z8.string()
2137
+ }),
2138
+ section: z8.optional(z8.nullable(z8.string()))
2139
+ });
2140
+ var phoneClickConfigSchema = z8.strictObject({
2141
+ autoCapture: z8.optional(
2142
+ z8.strictObject({
2143
+ selector: z8.optional(z8.string())
2144
+ })
2145
+ )
2146
+ });
2131
2147
 
2132
2148
  // ../tracking-core/src/events/scroll-depth.ts
2133
- var import_zod9 = require("zod");
2134
- var scrollDepthMetadataSchema = import_zod9.z.object({
2135
- depth_percent: import_zod9.z.number().int().min(1).max(100),
2136
- page: import_zod9.z.object({
2137
- path: import_zod9.z.string()
2138
- }).strict()
2139
- }).strict();
2140
- var scrollDepthConfigSchema = import_zod9.z.object({
2141
- thresholds: import_zod9.z.array(import_zod9.z.number().int().min(1).max(100)).min(1)
2142
- }).strict();
2149
+ var z9 = __toESM(require("zod/mini"));
2150
+ var scrollDepthMetadataSchema = z9.strictObject({
2151
+ depth_percent: z9.int().check(z9.gte(1), z9.lte(100)),
2152
+ page: z9.strictObject({
2153
+ path: z9.string()
2154
+ })
2155
+ });
2156
+ var scrollDepthConfigSchema = z9.strictObject({
2157
+ thresholds: z9.array(z9.int().check(z9.gte(1), z9.lte(100))).check(z9.minLength(1))
2158
+ });
2143
2159
 
2144
2160
  // ../tracking-core/src/events/specific-page-visit.ts
2145
- var import_zod10 = require("zod");
2161
+ var z10 = __toESM(require("zod/mini"));
2146
2162
  var PAGE_IDENTITY_MAX_LENGTH = 64;
2147
2163
  var PAGE_IDENTITY_PATTERN = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
2148
- var pageIdentitySchema = import_zod10.z.string().max(PAGE_IDENTITY_MAX_LENGTH).regex(PAGE_IDENTITY_PATTERN, {
2149
- message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
2150
- });
2164
+ var pageIdentitySchema = z10.string().check(
2165
+ z10.maxLength(PAGE_IDENTITY_MAX_LENGTH),
2166
+ z10.regex(PAGE_IDENTITY_PATTERN, {
2167
+ message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
2168
+ })
2169
+ );
2151
2170
  var specificPageNameSchema = pageIdentitySchema;
2152
- var specificPageVisitMetadataSchema = import_zod10.z.object({
2171
+ var specificPageVisitMetadataSchema = z10.strictObject({
2153
2172
  page_name: specificPageNameSchema,
2154
- page: import_zod10.z.object({
2155
- path: import_zod10.z.string()
2156
- }).strict()
2157
- }).strict();
2158
- var specificPageVisitConfigSchema = import_zod10.z.object({
2159
- pages: import_zod10.z.array(
2160
- import_zod10.z.object({
2173
+ page: z10.strictObject({
2174
+ path: z10.string()
2175
+ })
2176
+ });
2177
+ var specificPageVisitConfigSchema = z10.strictObject({
2178
+ pages: z10.array(
2179
+ z10.strictObject({
2161
2180
  name: specificPageNameSchema,
2162
- pathPattern: import_zod10.z.custom((value) => value instanceof RegExp, {
2181
+ pathPattern: z10.custom((value) => value instanceof RegExp, {
2163
2182
  message: "pathPattern must be a RegExp"
2164
2183
  })
2165
- }).strict()
2166
- ).min(1)
2167
- }).strict();
2184
+ })
2185
+ ).check(z10.minLength(1))
2186
+ });
2168
2187
 
2169
2188
  // ../tracking-core/src/events/time-on-site.ts
2170
- var import_zod11 = require("zod");
2171
- var timeOnSiteMetadataSchema = import_zod11.z.object({
2172
- duration_ms: import_zod11.z.number().int().nonnegative(),
2173
- page: import_zod11.z.object({
2174
- path: import_zod11.z.string()
2175
- }).strict()
2176
- }).strict();
2177
- var timeOnSiteConfigSchema = import_zod11.z.object({
2178
- thresholdSeconds: import_zod11.z.number().int().positive()
2179
- }).strict();
2189
+ var z11 = __toESM(require("zod/mini"));
2190
+ var timeOnSiteMetadataSchema = z11.strictObject({
2191
+ duration_ms: z11.int().check(z11.nonnegative()),
2192
+ page: z11.strictObject({
2193
+ path: z11.string()
2194
+ })
2195
+ });
2196
+ var timeOnSiteConfigSchema = z11.strictObject({
2197
+ thresholdSeconds: z11.int().check(z11.positive())
2198
+ });
2180
2199
 
2181
2200
  // ../tracking-core/src/events/semantics.ts
2182
2201
  var EVENT_SEMANTICS = {
@@ -2335,7 +2354,7 @@ function createTypedClient(raw, registry, options = {}) {
2335
2354
  trackEvent(eventType, metadata, opts) {
2336
2355
  if (debug) {
2337
2356
  const def = getEventDefinition(eventType);
2338
- def.metadataSchema.parse(metadata);
2357
+ (0, import_mini2.parse)(def.metadataSchema, metadata);
2339
2358
  }
2340
2359
  raw.trackEvent({
2341
2360
  eventType,
@@ -2824,117 +2843,6 @@ function attachPhoneClickCapture(client, config) {
2824
2843
  };
2825
2844
  }
2826
2845
 
2827
- // ../tracking-core/src/resources/sales/schema.ts
2828
- var import_zod12 = require("zod");
2829
- var SUPPORTED_CURRENCIES = ["USD", "CAD"];
2830
- var TRACKING_ENVIRONMENTS = ["production", "development"];
2831
- var currencySchema = import_zod12.z.enum(SUPPORTED_CURRENCIES);
2832
- var centsSchema = import_zod12.z.number().int().nonnegative();
2833
- var quantitySchema = import_zod12.z.string().regex(/^\d+(\.\d{1,3})?$/);
2834
- var metadataSchema = import_zod12.z.record(import_zod12.z.unknown());
2835
- var saleItemSchema = import_zod12.z.object({
2836
- external_item_id: import_zod12.z.string().nullable().optional(),
2837
- name: import_zod12.z.string().nullable().optional(),
2838
- category: import_zod12.z.string().nullable().optional(),
2839
- quantity: quantitySchema,
2840
- unit_price_cents: centsSchema,
2841
- // Non-negativity validated on the wire — same contract as the other cents
2842
- // fields — and backstopped by the DB CHECK.
2843
- unit_cost_cents: centsSchema.nullable().optional()
2844
- }).strict();
2845
- var saleServiceSchema = import_zod12.z.object({
2846
- service: import_zod12.z.string(),
2847
- amount_cents: centsSchema
2848
- }).strict();
2849
- var customerNameSchema = import_zod12.z.string().max(200);
2850
- var customerPhoneSchema = import_zod12.z.string().max(64);
2851
- var customerEmailSchema = import_zod12.z.string().max(320).email();
2852
- function refineServiceXor(val, ctx, { requireAmount }) {
2853
- if (val.services != null) {
2854
- if (val.service != null) {
2855
- ctx.addIssue({
2856
- code: import_zod12.z.ZodIssueCode.custom,
2857
- message: "pass either `service` or `services`, not both",
2858
- path: ["services"]
2859
- });
2860
- }
2861
- if (val.services.length === 0) {
2862
- ctx.addIssue({
2863
- code: import_zod12.z.ZodIssueCode.custom,
2864
- message: "`services` must not be empty",
2865
- path: ["services"]
2866
- });
2867
- }
2868
- const keys = val.services.map((s) => s.service);
2869
- if (new Set(keys).size !== keys.length) {
2870
- ctx.addIssue({
2871
- code: import_zod12.z.ZodIssueCode.custom,
2872
- message: "`services` must not list the same service more than once",
2873
- path: ["services"]
2874
- });
2875
- }
2876
- if (val.amount_total_cents != null) {
2877
- const sum = val.services.reduce((acc, s) => acc + s.amount_cents, 0);
2878
- if (val.amount_total_cents !== sum) {
2879
- ctx.addIssue({
2880
- code: import_zod12.z.ZodIssueCode.custom,
2881
- message: "amount_total_cents must equal the sum of the services amounts (omit it to derive it automatically)",
2882
- path: ["amount_total_cents"]
2883
- });
2884
- }
2885
- }
2886
- } else if (requireAmount && val.amount_total_cents == null) {
2887
- ctx.addIssue({
2888
- code: import_zod12.z.ZodIssueCode.custom,
2889
- message: "amount_total_cents is required unless `services` is provided",
2890
- path: ["amount_total_cents"]
2891
- });
2892
- }
2893
- }
2894
- var saleCreateSchema = import_zod12.z.object({
2895
- external_id: import_zod12.z.string().nullable().optional(),
2896
- description: import_zod12.z.string().nullable().optional(),
2897
- service: import_zod12.z.string().nullable().optional(),
2898
- services: import_zod12.z.array(saleServiceSchema).nullable().optional(),
2899
- currency: currencySchema,
2900
- // Optional only because the plural `services` form derives it from the sum
2901
- // (see refineServiceXor); the singular/serviceless path still requires it.
2902
- amount_total_cents: centsSchema.nullable().optional(),
2903
- occurred_at: import_zod12.z.string().datetime(),
2904
- environment: import_zod12.z.enum(TRACKING_ENVIRONMENTS).default("production"),
2905
- items: import_zod12.z.array(saleItemSchema).default([]),
2906
- metadata: metadataSchema.nullable().optional(),
2907
- customer_name: customerNameSchema.nullable().optional(),
2908
- customer_phone: customerPhoneSchema.nullable().optional(),
2909
- customer_email: customerEmailSchema.nullable().optional(),
2910
- // CASL consent attestation: the customer agreed to receive SMS. Recorded
2911
- // with a timestamp server-side; every SMS send path gates on it.
2912
- //
2913
- // Tri-state: omit it (or send null) to let the server apply the business's
2914
- // configured default-opt-in policy, honouring a returning customer's
2915
- // remembered preference. Send an explicit boolean to assert consent state
2916
- // yourself — `false` records a deliberate opt-out.
2917
- sms_consent: import_zod12.z.boolean().nullable().optional()
2918
- }).strict().superRefine((val, ctx) => refineServiceXor(val, ctx, { requireAmount: true }));
2919
- var saleUpdateSchema = import_zod12.z.object({
2920
- description: import_zod12.z.string().nullable().optional(),
2921
- service: import_zod12.z.string().nullable().optional(),
2922
- services: import_zod12.z.array(saleServiceSchema).nullable().optional(),
2923
- currency: currencySchema.optional(),
2924
- amount_total_cents: centsSchema.optional(),
2925
- occurred_at: import_zod12.z.string().datetime().optional(),
2926
- items: import_zod12.z.array(saleItemSchema).optional(),
2927
- metadata: metadataSchema.nullable().optional(),
2928
- customer_name: customerNameSchema.nullable().optional(),
2929
- // Re-attest when changing a filler-looking name; the server clears the
2930
- // prior attestation whenever `customer_name` changes.
2931
- customer_name_placeholder_confirmed: import_zod12.z.boolean().optional(),
2932
- customer_phone: customerPhoneSchema.nullable().optional(),
2933
- customer_email: customerEmailSchema.nullable().optional(),
2934
- // NOT NULL server-side: omit to leave unchanged (explicit null is rejected).
2935
- sms_consent: import_zod12.z.boolean().optional()
2936
- }).strict().superRefine((val, ctx) => refineServiceXor(val, ctx, { requireAmount: false }));
2937
-
2938
2846
  // src/hooks.ts
2939
2847
  function useGclid() {
2940
2848
  const [gclid, setGclid] = (0, import_react.useState)(null);
@@ -3275,7 +3183,7 @@ function GoogleAdsTracking(props) {
3275
3183
  var import_navigation3 = require("next/navigation");
3276
3184
 
3277
3185
  // package.json
3278
- var version = "0.27.0";
3186
+ var version = "1.0.0";
3279
3187
 
3280
3188
  // src/factory.tsx
3281
3189
  var import_react5 = require("react");