@shware/analytics 15.0.1 → 16.1.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 (260) hide show
  1. package/README.md +164 -36
  2. package/dist/native/fbsdk.cjs +44 -1
  3. package/dist/native/fbsdk.cjs.map +1 -1
  4. package/dist/native/fbsdk.d.cts +23 -1
  5. package/dist/native/fbsdk.d.cts.map +1 -1
  6. package/dist/native/fbsdk.d.mts +23 -1
  7. package/dist/native/fbsdk.d.mts.map +1 -1
  8. package/dist/native/fbsdk.mjs +44 -3
  9. package/dist/native/fbsdk.mjs.map +1 -1
  10. package/dist/native/firebase.cjs +27 -0
  11. package/dist/native/firebase.cjs.map +1 -1
  12. package/dist/native/firebase.d.cts +11 -0
  13. package/dist/native/firebase.d.cts.map +1 -1
  14. package/dist/native/firebase.d.mts +11 -0
  15. package/dist/native/firebase.d.mts.map +1 -1
  16. package/dist/native/firebase.mjs +27 -2
  17. package/dist/native/firebase.mjs.map +1 -1
  18. package/dist/next/index.cjs +10 -123
  19. package/dist/next/index.cjs.map +1 -1
  20. package/dist/next/index.d.cts +2 -31
  21. package/dist/next/index.d.cts.map +1 -1
  22. package/dist/next/index.d.mts +2 -31
  23. package/dist/next/index.d.mts.map +1 -1
  24. package/dist/next/index.mjs +10 -123
  25. package/dist/next/index.mjs.map +1 -1
  26. package/dist/react/index.cjs +45 -0
  27. package/dist/react/index.cjs.map +1 -0
  28. package/dist/react/index.d.cts +15 -0
  29. package/dist/react/index.d.cts.map +1 -0
  30. package/dist/react/index.d.mts +15 -0
  31. package/dist/react/index.d.mts.map +1 -0
  32. package/dist/react/index.mjs +43 -0
  33. package/dist/react/index.mjs.map +1 -0
  34. package/dist/react/use-feature-flag.cjs +23 -0
  35. package/dist/react/use-feature-flag.cjs.map +1 -0
  36. package/dist/react/use-feature-flag.d.cts +10 -0
  37. package/dist/react/use-feature-flag.d.cts.map +1 -0
  38. package/dist/react/use-feature-flag.d.mts +10 -0
  39. package/dist/react/use-feature-flag.d.mts.map +1 -0
  40. package/dist/react/use-feature-flag.mjs +22 -0
  41. package/dist/react/use-feature-flag.mjs.map +1 -0
  42. package/dist/server/conversions-api-error.cjs +20 -0
  43. package/dist/server/conversions-api-error.cjs.map +1 -0
  44. package/dist/server/conversions-api-error.d.cts +17 -0
  45. package/dist/server/conversions-api-error.d.cts.map +1 -0
  46. package/dist/server/conversions-api-error.d.mts +17 -0
  47. package/dist/server/conversions-api-error.d.mts.map +1 -0
  48. package/dist/server/conversions-api-error.mjs +19 -0
  49. package/dist/server/conversions-api-error.mjs.map +1 -0
  50. package/dist/server/google-data-manager.cjs +24 -26
  51. package/dist/server/google-data-manager.cjs.map +1 -1
  52. package/dist/server/google-data-manager.d.cts +13 -5
  53. package/dist/server/google-data-manager.d.cts.map +1 -1
  54. package/dist/server/google-data-manager.d.mts +13 -5
  55. package/dist/server/google-data-manager.d.mts.map +1 -1
  56. package/dist/server/google-data-manager.mjs +24 -27
  57. package/dist/server/google-data-manager.mjs.map +1 -1
  58. package/dist/server/index.cjs +11 -0
  59. package/dist/server/index.d.cts +10 -7
  60. package/dist/server/index.d.mts +10 -7
  61. package/dist/server/index.mjs +9 -7
  62. package/dist/server/linkedin-conversions-api.cjs +29 -23
  63. package/dist/server/linkedin-conversions-api.cjs.map +1 -1
  64. package/dist/server/linkedin-conversions-api.d.cts +7 -2
  65. package/dist/server/linkedin-conversions-api.d.cts.map +1 -1
  66. package/dist/server/linkedin-conversions-api.d.mts +7 -2
  67. package/dist/server/linkedin-conversions-api.d.mts.map +1 -1
  68. package/dist/server/linkedin-conversions-api.mjs +29 -24
  69. package/dist/server/linkedin-conversions-api.mjs.map +1 -1
  70. package/dist/server/meta-capi.cjs +32 -31
  71. package/dist/server/meta-capi.cjs.map +1 -1
  72. package/dist/server/meta-capi.d.cts +12 -3
  73. package/dist/server/meta-capi.d.cts.map +1 -1
  74. package/dist/server/meta-capi.d.mts +12 -3
  75. package/dist/server/meta-capi.d.mts.map +1 -1
  76. package/dist/server/meta-capi.mjs +33 -33
  77. package/dist/server/meta-capi.mjs.map +1 -1
  78. package/dist/server/microsoft-conversions-api.cjs +33 -28
  79. package/dist/server/microsoft-conversions-api.cjs.map +1 -1
  80. package/dist/server/microsoft-conversions-api.d.cts +14 -2
  81. package/dist/server/microsoft-conversions-api.d.cts.map +1 -1
  82. package/dist/server/microsoft-conversions-api.d.mts +14 -2
  83. package/dist/server/microsoft-conversions-api.d.mts.map +1 -1
  84. package/dist/server/microsoft-conversions-api.mjs +33 -29
  85. package/dist/server/microsoft-conversions-api.mjs.map +1 -1
  86. package/dist/server/openai-conversions-api.cjs +20 -18
  87. package/dist/server/openai-conversions-api.cjs.map +1 -1
  88. package/dist/server/openai-conversions-api.d.cts +7 -0
  89. package/dist/server/openai-conversions-api.d.cts.map +1 -1
  90. package/dist/server/openai-conversions-api.d.mts +7 -0
  91. package/dist/server/openai-conversions-api.d.mts.map +1 -1
  92. package/dist/server/openai-conversions-api.mjs +21 -20
  93. package/dist/server/openai-conversions-api.mjs.map +1 -1
  94. package/dist/server/reddit-conversions-api.cjs +20 -18
  95. package/dist/server/reddit-conversions-api.cjs.map +1 -1
  96. package/dist/server/reddit-conversions-api.d.cts +8 -1
  97. package/dist/server/reddit-conversions-api.d.cts.map +1 -1
  98. package/dist/server/reddit-conversions-api.d.mts +8 -1
  99. package/dist/server/reddit-conversions-api.d.mts.map +1 -1
  100. package/dist/server/reddit-conversions-api.mjs +21 -20
  101. package/dist/server/reddit-conversions-api.mjs.map +1 -1
  102. package/dist/server/setup-conversions.cjs +62 -0
  103. package/dist/server/setup-conversions.cjs.map +1 -0
  104. package/dist/server/setup-conversions.d.cts +97 -0
  105. package/dist/server/setup-conversions.d.cts.map +1 -0
  106. package/dist/server/setup-conversions.d.mts +97 -0
  107. package/dist/server/setup-conversions.d.mts.map +1 -0
  108. package/dist/server/setup-conversions.mjs +60 -0
  109. package/dist/server/setup-conversions.mjs.map +1 -0
  110. package/dist/setup/index.cjs +4 -4
  111. package/dist/setup/index.cjs.map +1 -1
  112. package/dist/setup/index.d.cts +16 -6
  113. package/dist/setup/index.d.cts.map +1 -1
  114. package/dist/setup/index.d.mts +16 -6
  115. package/dist/setup/index.d.mts.map +1 -1
  116. package/dist/setup/index.mjs +4 -4
  117. package/dist/setup/index.mjs.map +1 -1
  118. package/dist/tanstack/index.cjs +0 -2
  119. package/dist/tanstack/index.d.cts +1 -2
  120. package/dist/tanstack/index.d.mts +1 -2
  121. package/dist/tanstack/index.mjs +1 -3
  122. package/dist/third-parties/analytics-props.cjs +28 -0
  123. package/dist/third-parties/analytics-props.cjs.map +1 -0
  124. package/dist/third-parties/analytics-props.d.cts +23 -0
  125. package/dist/third-parties/analytics-props.d.cts.map +1 -0
  126. package/dist/third-parties/analytics-props.d.mts +23 -0
  127. package/dist/third-parties/analytics-props.d.mts.map +1 -0
  128. package/dist/third-parties/analytics-props.mjs +26 -0
  129. package/dist/third-parties/analytics-props.mjs.map +1 -0
  130. package/dist/third-parties/google-analytics.cjs +32 -0
  131. package/dist/third-parties/google-analytics.cjs.map +1 -1
  132. package/dist/third-parties/google-analytics.d.cts +11 -1
  133. package/dist/third-parties/google-analytics.d.cts.map +1 -1
  134. package/dist/third-parties/google-analytics.d.mts +11 -1
  135. package/dist/third-parties/google-analytics.d.mts.map +1 -1
  136. package/dist/third-parties/google-analytics.mjs +32 -1
  137. package/dist/third-parties/google-analytics.mjs.map +1 -1
  138. package/dist/third-parties/index.cjs +16 -0
  139. package/dist/third-parties/index.d.cts +9 -7
  140. package/dist/third-parties/index.d.mts +9 -7
  141. package/dist/third-parties/index.mjs +9 -7
  142. package/dist/third-parties/integration.cjs +46 -0
  143. package/dist/third-parties/integration.cjs.map +1 -0
  144. package/dist/third-parties/integration.d.cts +61 -0
  145. package/dist/third-parties/integration.d.cts.map +1 -0
  146. package/dist/third-parties/integration.d.mts +61 -0
  147. package/dist/third-parties/integration.d.mts.map +1 -0
  148. package/dist/third-parties/integration.mjs +43 -0
  149. package/dist/third-parties/integration.mjs.map +1 -0
  150. package/dist/third-parties/linkedin-insight-tag.cjs +29 -0
  151. package/dist/third-parties/linkedin-insight-tag.cjs.map +1 -1
  152. package/dist/third-parties/linkedin-insight-tag.d.cts +14 -8
  153. package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -1
  154. package/dist/third-parties/linkedin-insight-tag.d.mts +14 -8
  155. package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -1
  156. package/dist/third-parties/linkedin-insight-tag.mjs +29 -1
  157. package/dist/third-parties/linkedin-insight-tag.mjs.map +1 -1
  158. package/dist/third-parties/meta-pixel.cjs +32 -0
  159. package/dist/third-parties/meta-pixel.cjs.map +1 -1
  160. package/dist/third-parties/meta-pixel.d.cts +7 -0
  161. package/dist/third-parties/meta-pixel.d.cts.map +1 -1
  162. package/dist/third-parties/meta-pixel.d.mts +7 -0
  163. package/dist/third-parties/meta-pixel.d.mts.map +1 -1
  164. package/dist/third-parties/meta-pixel.mjs +33 -2
  165. package/dist/third-parties/meta-pixel.mjs.map +1 -1
  166. package/dist/third-parties/microsoft-uet.cjs +54 -0
  167. package/dist/third-parties/microsoft-uet.cjs.map +1 -1
  168. package/dist/third-parties/microsoft-uet.d.cts +36 -0
  169. package/dist/third-parties/microsoft-uet.d.cts.map +1 -1
  170. package/dist/third-parties/microsoft-uet.d.mts +36 -0
  171. package/dist/third-parties/microsoft-uet.d.mts.map +1 -1
  172. package/dist/third-parties/microsoft-uet.mjs +52 -1
  173. package/dist/third-parties/microsoft-uet.mjs.map +1 -1
  174. package/dist/third-parties/openai-pixel.cjs +29 -0
  175. package/dist/third-parties/openai-pixel.cjs.map +1 -1
  176. package/dist/third-parties/openai-pixel.d.cts +7 -0
  177. package/dist/third-parties/openai-pixel.d.cts.map +1 -1
  178. package/dist/third-parties/openai-pixel.d.mts +7 -0
  179. package/dist/third-parties/openai-pixel.d.mts.map +1 -1
  180. package/dist/third-parties/openai-pixel.mjs +30 -2
  181. package/dist/third-parties/openai-pixel.mjs.map +1 -1
  182. package/dist/third-parties/posthog.cjs +97 -4
  183. package/dist/third-parties/posthog.cjs.map +1 -1
  184. package/dist/third-parties/posthog.d.cts +56 -1
  185. package/dist/third-parties/posthog.d.cts.map +1 -1
  186. package/dist/third-parties/posthog.d.mts +56 -1
  187. package/dist/third-parties/posthog.d.mts.map +1 -1
  188. package/dist/third-parties/posthog.mjs +91 -2
  189. package/dist/third-parties/posthog.mjs.map +1 -1
  190. package/dist/third-parties/reddit-pixel.cjs +30 -0
  191. package/dist/third-parties/reddit-pixel.cjs.map +1 -1
  192. package/dist/third-parties/reddit-pixel.d.cts +7 -0
  193. package/dist/third-parties/reddit-pixel.d.cts.map +1 -1
  194. package/dist/third-parties/reddit-pixel.d.mts +7 -0
  195. package/dist/third-parties/reddit-pixel.d.mts.map +1 -1
  196. package/dist/third-parties/reddit-pixel.mjs +31 -2
  197. package/dist/third-parties/reddit-pixel.mjs.map +1 -1
  198. package/dist/track/fbq.cjs +6 -1
  199. package/dist/track/fbq.cjs.map +1 -1
  200. package/dist/track/fbq.d.cts +2 -0
  201. package/dist/track/fbq.d.cts.map +1 -1
  202. package/dist/track/fbq.d.mts +2 -0
  203. package/dist/track/fbq.d.mts.map +1 -1
  204. package/dist/track/fbq.mjs +6 -2
  205. package/dist/track/fbq.mjs.map +1 -1
  206. package/dist/track/index.cjs +7 -7
  207. package/dist/track/index.cjs.map +1 -1
  208. package/dist/track/index.d.cts.map +1 -1
  209. package/dist/track/index.d.mts.map +1 -1
  210. package/dist/track/index.mjs +7 -7
  211. package/dist/track/index.mjs.map +1 -1
  212. package/dist/track/oaiq.cjs +5 -0
  213. package/dist/track/oaiq.cjs.map +1 -1
  214. package/dist/track/oaiq.d.cts +2 -0
  215. package/dist/track/oaiq.d.cts.map +1 -1
  216. package/dist/track/oaiq.d.mts +2 -0
  217. package/dist/track/oaiq.d.mts.map +1 -1
  218. package/dist/track/oaiq.mjs +5 -1
  219. package/dist/track/oaiq.mjs.map +1 -1
  220. package/dist/track/rdt.cjs +5 -0
  221. package/dist/track/rdt.cjs.map +1 -1
  222. package/dist/track/rdt.d.cts +2 -0
  223. package/dist/track/rdt.d.cts.map +1 -1
  224. package/dist/track/rdt.d.mts +2 -0
  225. package/dist/track/rdt.d.mts.map +1 -1
  226. package/dist/track/rdt.mjs +5 -1
  227. package/dist/track/rdt.mjs.map +1 -1
  228. package/dist/visitor/index.cjs +3 -3
  229. package/dist/visitor/index.cjs.map +1 -1
  230. package/dist/visitor/index.mjs +3 -3
  231. package/dist/visitor/index.mjs.map +1 -1
  232. package/package.json +11 -39
  233. package/dist/react-router/index.cjs +0 -160
  234. package/dist/react-router/index.cjs.map +0 -1
  235. package/dist/react-router/index.d.cts +0 -22
  236. package/dist/react-router/index.d.cts.map +0 -1
  237. package/dist/react-router/index.d.mts +0 -22
  238. package/dist/react-router/index.d.mts.map +0 -1
  239. package/dist/react-router/index.mjs +0 -159
  240. package/dist/react-router/index.mjs.map +0 -1
  241. package/dist/server/legacy.cjs +0 -3
  242. package/dist/server/legacy.d.cts +0 -2
  243. package/dist/server/legacy.d.mts +0 -2
  244. package/dist/server/legacy.mjs +0 -1
  245. package/dist/server/meta-conversions-api.cjs +0 -205
  246. package/dist/server/meta-conversions-api.cjs.map +0 -1
  247. package/dist/server/meta-conversions-api.d.cts +0 -8
  248. package/dist/server/meta-conversions-api.d.cts.map +0 -1
  249. package/dist/server/meta-conversions-api.d.mts +0 -8
  250. package/dist/server/meta-conversions-api.d.mts.map +0 -1
  251. package/dist/server/meta-conversions-api.mjs +0 -201
  252. package/dist/server/meta-conversions-api.mjs.map +0 -1
  253. package/dist/tanstack/analytics.cjs +0 -184
  254. package/dist/tanstack/analytics.cjs.map +0 -1
  255. package/dist/tanstack/analytics.d.cts +0 -33
  256. package/dist/tanstack/analytics.d.cts.map +0 -1
  257. package/dist/tanstack/analytics.d.mts +0 -33
  258. package/dist/tanstack/analytics.d.mts.map +0 -1
  259. package/dist/tanstack/analytics.mjs +0 -183
  260. package/dist/tanstack/analytics.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { keys } from '../constants/storage';\nimport { config } from '../setup/index';\nimport { endSession, track } from '../track/index';\nimport type { UserProvidedData } from '../track/types';\nimport { newVisitorId, visitorId } from './id';\nimport type { ThirdPartyUserSetter } from './types';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/**\n * The visitor and user this page last identified, as `<visitor>:<user>`: identify once per binding\n * per page, not per call. The visitor is part of it because the storage is shared: another tab's\n * `reset()` replaces the visitor under this page, and the same user here must then bind the new\n * one too.\n *\n * `undefined` until this page identifies anyone; `null` once it has signed out (`reset()`), so the\n * same user signing back in is identified again, and a later `reset()` here knows it has nothing\n * left to sign out — the device's identity, if any, is someone this page has not identified.\n */\nlet identified: string | null | undefined;\n\n/** Hands the user to every third-party user setter; one that throws does not stop the others. */\nfunction setUsers(user: Parameters<ThirdPartyUserSetter>[0]) {\n config.thirdPartyUserSetters.forEach((setter) => {\n try {\n setter(user);\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `userData` is handed to the setters\n * only, never stored with the event.\n *\n * The visitor's sessions so far — those before the sign-in included — become this user's. So a\n * different user than the one last identified on this device (an expired session, a sign-out the\n * host never reported) is `reset()` first: the previous user's visitor stays theirs, and this one\n * starts on a new visitor.\n *\n * Synchronous and never throws: sign-in must not fail on analytics.\n */\nexport function identify(userId: string, userData?: UserProvidedData) {\n let visitor = '';\n try {\n const previous = config.storage.getItem(keys.user_id);\n if (previous && previous !== userId) {\n // Another user is on the device: start over whatever this page last identified.\n startOver();\n setUsers({});\n }\n config.storage.setItem(keys.user_id, userId);\n visitor = visitorId();\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n\n const binding = `${visitor}:${userId}`;\n if (binding !== identified) {\n identified = binding;\n track(IDENTIFY_EVENT, { user_id: userId }, { enableThirdPartyTracking: false });\n }\n\n setUsers({ user_id: userId, user_data: userData });\n}\n\n/**\n * Signs the visitor out, as PostHog's `reset()` does: call it on sign-out, after\n * `track('logout')`, so that event still belongs to the user leaving.\n *\n * - The current session ends: what it accrued goes out as a `user_engagement`\n * (`trigger: 'reset'`), as when the page is closed, and the queue is sent under the visitor\n * and session its events happened in.\n * - A new visitor starts, and the next event opens a new session on it. Everything until the next\n * sign-in is anonymous, and becomes whoever's signs in next; the visitor that is left stays the\n * previous user's, with its history.\n * - The third-party setters drop the user (PostHog resets its identity, GA clears its user_id).\n *\n * The device id and the first visit or first open stay: they describe the device, not the person.\n *\n * Only the sign-out this page knows of: the session and visitor are replaced while the device's\n * identity (`keys.user_id` and the visitor, shared by every tab) is still the one this page last\n * identified, or the page has neither identified nor signed out anyone (a host that identifies at\n * sign-in only, on a page loaded since). Every tab of a site sees a sign-out and calls this,\n * some of them late — a tab frozen in the background handles it on resuming, after another tab\n * may have signed out and in again. A call that finds no user, or someone else's binding, is\n * stale: replacing that would cut the new anonymous visitor off from the next sign-in, or end the\n * next user's session and leave their pages on a visitor nobody identified. It only clears this\n * page: its setters are still told, since GA holds the user per page.\n *\n * Synchronous and never throws: sign-out must not fail on analytics.\n */\nexport function reset() {\n let current = false;\n try {\n const user = config.storage.getItem(keys.user_id);\n current = !!user && (identified === undefined || identified === `${visitorId()}:${user}`);\n if (current) startOver();\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n if (current || identified) setUsers({});\n identified = null;\n}\n\n/**\n * Ends the device's session and starts a new visitor with no user: `reset()` for the sign-out it\n * knows of, `identify` for a user signing in over another.\n */\nfunction startOver() {\n endSession();\n newVisitorId();\n config.storage.setItem(keys.user_id, '');\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAAiB;;;;;;;;;;;AAY9B,IAAI;;AAGJ,SAAS,SAAS,MAA2C;CAC3D,OAAO,sBAAsB,SAAS,WAAW;EAC/C,IAAI;GACF,OAAO,IAAI;EACb,SAAS,GAAY;GACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH;;;;;;;;;;;;;;;AAgBA,SAAgB,SAAS,QAAgB,UAA6B;CACpE,IAAI,UAAU;CACd,IAAI;EACF,MAAM,WAAW,OAAO,QAAQ,QAAQ,KAAK,OAAO;EACpD,IAAI,YAAY,aAAa,QAAQ;GAEnC,UAAU;GACV,SAAS,CAAC,CAAC;EACb;EACA,OAAO,QAAQ,QAAQ,KAAK,SAAS,MAAM;EAC3C,UAAU,UAAU;CACtB,SAAS,GAAY;EACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;CAC/C;CAEA,MAAM,UAAU,GAAG,QAAQ,GAAG;CAC9B,IAAI,YAAY,YAAY;EAC1B,aAAa;EACb,MAAM,gBAAgB,EAAE,SAAS,OAAO,GAAG,EAAE,0BAA0B,MAAM,CAAC;CAChF;CAEA,SAAS;EAAE,SAAS;EAAQ,WAAW;CAAS,CAAC;AACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,QAAQ;CACtB,IAAI,UAAU;CACd,IAAI;EACF,MAAM,OAAO,OAAO,QAAQ,QAAQ,KAAK,OAAO;EAChD,UAAU,CAAC,CAAC,SAAS,eAAe,KAAA,KAAa,eAAe,GAAG,UAAU,EAAE,GAAG;EAClF,IAAI,SAAS,UAAU;CACzB,SAAS,GAAY;EACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;CAC/C;CACA,IAAI,WAAW,YAAY,SAAS,CAAC,CAAC;CACtC,aAAa;AACf;;;;;AAMA,SAAS,YAAY;CACnB,WAAW;CACX,aAAa;CACb,OAAO,QAAQ,QAAQ,KAAK,SAAS,EAAE;AACzC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { keys } from '../constants/storage';\nimport { config } from '../setup/index';\nimport { endSession, track } from '../track/index';\nimport type { UserProvidedData } from '../track/types';\nimport { newVisitorId, visitorId } from './id';\nimport type { ThirdPartyUserSetter } from './types';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/**\n * The visitor and user this page last identified, as `<visitor>:<user>`: identify once per binding\n * per page, not per call. The visitor is part of it because the storage is shared: another tab's\n * `reset()` replaces the visitor under this page, and the same user here must then bind the new\n * one too.\n *\n * `undefined` until this page identifies anyone; `null` once it has signed out (`reset()`), so the\n * same user signing back in is identified again, and a later `reset()` here knows it has nothing\n * left to sign out — the device's identity, if any, is someone this page has not identified.\n */\nlet identified: string | null | undefined;\n\n/** Hands the user to every integration's user setter; one that throws does not stop the others. */\nfunction setUsers(user: Parameters<ThirdPartyUserSetter>[0]) {\n config.integrations.forEach(({ setUser }) => {\n try {\n setUser?.(user);\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `userData` is handed to the setters\n * only, never stored with the event.\n *\n * The visitor's sessions so far — those before the sign-in included — become this user's. So a\n * different user than the one last identified on this device (an expired session, a sign-out the\n * host never reported) is `reset()` first: the previous user's visitor stays theirs, and this one\n * starts on a new visitor.\n *\n * Synchronous and never throws: sign-in must not fail on analytics.\n */\nexport function identify(userId: string, userData?: UserProvidedData) {\n let visitor = '';\n try {\n const previous = config.storage.getItem(keys.user_id);\n if (previous && previous !== userId) {\n // Another user is on the device: start over whatever this page last identified.\n startOver();\n setUsers({});\n }\n config.storage.setItem(keys.user_id, userId);\n visitor = visitorId();\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n\n const binding = `${visitor}:${userId}`;\n if (binding !== identified) {\n identified = binding;\n track(IDENTIFY_EVENT, { user_id: userId }, { enableThirdPartyTracking: false });\n }\n\n setUsers({ user_id: userId, user_data: userData });\n}\n\n/**\n * Signs the visitor out, as PostHog's `reset()` does: call it on sign-out, after\n * `track('logout')`, so that event still belongs to the user leaving.\n *\n * - The current session ends: what it accrued goes out as a `user_engagement`\n * (`trigger: 'reset'`), as when the page is closed, and the queue is sent under the visitor\n * and session its events happened in.\n * - A new visitor starts, and the next event opens a new session on it. Everything until the next\n * sign-in is anonymous, and becomes whoever's signs in next; the visitor that is left stays the\n * previous user's, with its history.\n * - The third-party setters drop the user (PostHog resets its identity, GA clears its user_id).\n *\n * The device id and the first visit or first open stay: they describe the device, not the person.\n *\n * Only the sign-out this page knows of: the session and visitor are replaced while the device's\n * identity (`keys.user_id` and the visitor, shared by every tab) is still the one this page last\n * identified, or the page has neither identified nor signed out anyone (a host that identifies at\n * sign-in only, on a page loaded since). Every tab of a site sees a sign-out and calls this,\n * some of them late — a tab frozen in the background handles it on resuming, after another tab\n * may have signed out and in again. A call that finds no user, or someone else's binding, is\n * stale: replacing that would cut the new anonymous visitor off from the next sign-in, or end the\n * next user's session and leave their pages on a visitor nobody identified. It only clears this\n * page: its setters are still told, since GA holds the user per page.\n *\n * Synchronous and never throws: sign-out must not fail on analytics.\n */\nexport function reset() {\n let current = false;\n try {\n const user = config.storage.getItem(keys.user_id);\n current = !!user && (identified === undefined || identified === `${visitorId()}:${user}`);\n if (current) startOver();\n } catch (e: unknown) {\n if (e instanceof Error) console.log(e.message);\n }\n if (current || identified) setUsers({});\n identified = null;\n}\n\n/**\n * Ends the device's session and starts a new visitor with no user: `reset()` for the sign-out it\n * knows of, `identify` for a user signing in over another.\n */\nfunction startOver() {\n endSession();\n newVisitorId();\n config.storage.setItem(keys.user_id, '');\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAa,iBAAiB;;;;;;;;;;;AAY9B,IAAI;;AAGJ,SAAS,SAAS,MAA2C;CAC3D,OAAO,aAAa,SAAS,EAAE,cAAc;EAC3C,IAAI;GACF,UAAU,IAAI;EAChB,SAAS,GAAY;GACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH;;;;;;;;;;;;;;;AAgBA,SAAgB,SAAS,QAAgB,UAA6B;CACpE,IAAI,UAAU;CACd,IAAI;EACF,MAAM,WAAW,OAAO,QAAQ,QAAQ,KAAK,OAAO;EACpD,IAAI,YAAY,aAAa,QAAQ;GAEnC,UAAU;GACV,SAAS,CAAC,CAAC;EACb;EACA,OAAO,QAAQ,QAAQ,KAAK,SAAS,MAAM;EAC3C,UAAU,UAAU;CACtB,SAAS,GAAY;EACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;CAC/C;CAEA,MAAM,UAAU,GAAG,QAAQ,GAAG;CAC9B,IAAI,YAAY,YAAY;EAC1B,aAAa;EACb,MAAM,gBAAgB,EAAE,SAAS,OAAO,GAAG,EAAE,0BAA0B,MAAM,CAAC;CAChF;CAEA,SAAS;EAAE,SAAS;EAAQ,WAAW;CAAS,CAAC;AACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,QAAQ;CACtB,IAAI,UAAU;CACd,IAAI;EACF,MAAM,OAAO,OAAO,QAAQ,QAAQ,KAAK,OAAO;EAChD,UAAU,CAAC,CAAC,SAAS,eAAe,KAAA,KAAa,eAAe,GAAG,UAAU,EAAE,GAAG;EAClF,IAAI,SAAS,UAAU;CACzB,SAAS,GAAY;EACnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;CAC/C;CACA,IAAI,WAAW,YAAY,SAAS,CAAC,CAAC;CACtC,aAAa;AACf;;;;;AAMA,SAAS,YAAY;CACnB,WAAW;CACX,aAAa;CACb,OAAO,QAAQ,QAAQ,KAAK,SAAS,EAAE;AACzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/analytics",
3
- "version": "15.0.1",
3
+ "version": "16.1.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -91,14 +91,14 @@
91
91
  "default": "./dist/next/index.cjs"
92
92
  }
93
93
  },
94
- "./react-router": {
94
+ "./react": {
95
95
  "import": {
96
- "types": "./dist/react-router/index.d.mts",
97
- "default": "./dist/react-router/index.mjs"
96
+ "types": "./dist/react/index.d.mts",
97
+ "default": "./dist/react/index.mjs"
98
98
  },
99
99
  "require": {
100
- "types": "./dist/react-router/index.d.cts",
101
- "default": "./dist/react-router/index.cjs"
100
+ "types": "./dist/react/index.d.cts",
101
+ "default": "./dist/react/index.cjs"
102
102
  }
103
103
  },
104
104
  "./tanstack": {
@@ -121,16 +121,6 @@
121
121
  "default": "./dist/third-parties/index.cjs"
122
122
  }
123
123
  },
124
- "./third-parties/posthog": {
125
- "import": {
126
- "types": "./dist/third-parties/posthog.d.mts",
127
- "default": "./dist/third-parties/posthog.mjs"
128
- },
129
- "require": {
130
- "types": "./dist/third-parties/posthog.d.cts",
131
- "default": "./dist/third-parties/posthog.cjs"
132
- }
133
- },
134
124
  "./server": {
135
125
  "import": {
136
126
  "types": "./dist/server/index.d.mts",
@@ -140,16 +130,6 @@
140
130
  "types": "./dist/server/index.d.cts",
141
131
  "default": "./dist/server/index.cjs"
142
132
  }
143
- },
144
- "./server/legacy": {
145
- "import": {
146
- "types": "./dist/server/legacy.d.mts",
147
- "default": "./dist/server/legacy.mjs"
148
- },
149
- "require": {
150
- "types": "./dist/server/legacy.d.cts",
151
- "default": "./dist/server/legacy.cjs"
152
- }
153
133
  }
154
134
  },
155
135
  "publishConfig": {
@@ -167,9 +147,9 @@
167
147
  "@repo/typescript-config": "0.0.0",
168
148
  "@testing-library/react": "^16.3.3",
169
149
  "@types/babel__core": "7.20.5",
170
- "@types/facebook-nodejs-business-sdk": "^24.0.0",
171
150
  "@types/node": "^26.6.5",
172
151
  "@types/react": "^19.3.0",
152
+ "@types/react-dom": "^19.3.0",
173
153
  "@vitest/coverage-v8": "^5.0.5",
174
154
  "babel-plugin-react-compiler": "1.0.0",
175
155
  "bowser": "^2.14.1",
@@ -181,7 +161,6 @@
181
161
  },
182
162
  "peerDependencies": {
183
163
  "@react-native-firebase/analytics": "^26.4.1",
184
- "@tanstack/react-router": "^1.170.46",
185
164
  "@tanstack/react-start": "^1.169.4",
186
165
  "expo-application": "^57.0.3 || ^58.0.0",
187
166
  "expo-clipboard": "^57.0.2 || ^58.0.0",
@@ -190,22 +169,18 @@
190
169
  "expo-localization": "^57.0.2 || ^58.0.0",
191
170
  "expo-sqlite": "^57.0.3 || ^58.0.0",
192
171
  "expo-tracking-transparency": "^57.0.2 || ^58.0.0",
193
- "facebook-nodejs-business-sdk": "^24.0.1",
194
172
  "next": "^16.4.3",
195
173
  "posthog-js": "^1.438.21",
196
174
  "react": "^19.3.1",
175
+ "react-dom": "^19.3.1",
197
176
  "react-native": "^0.87.1 || ^0.88.0",
198
177
  "react-native-fbsdk-next": "^13.4.3",
199
- "react-router": "^8.5.0",
200
178
  "zod": "^4.6.5"
201
179
  },
202
180
  "peerDependenciesMeta": {
203
181
  "@react-native-firebase/analytics": {
204
182
  "optional": true
205
183
  },
206
- "@tanstack/react-router": {
207
- "optional": true
208
- },
209
184
  "@tanstack/react-start": {
210
185
  "optional": true
211
186
  },
@@ -230,9 +205,6 @@
230
205
  "expo-tracking-transparency": {
231
206
  "optional": true
232
207
  },
233
- "facebook-nodejs-business-sdk": {
234
- "optional": true
235
- },
236
208
  "next": {
237
209
  "optional": true
238
210
  },
@@ -242,13 +214,13 @@
242
214
  "react": {
243
215
  "optional": true
244
216
  },
245
- "react-native": {
217
+ "react-dom": {
246
218
  "optional": true
247
219
  },
248
- "react-native-fbsdk-next": {
220
+ "react-native": {
249
221
  "optional": true
250
222
  },
251
- "react-router": {
223
+ "react-native-fbsdk-next": {
252
224
  "optional": true
253
225
  }
254
226
  },
@@ -1,160 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_track_index = require("../track/index.cjs");
3
- const require_hooks_use_outbound_click_analytics = require("../hooks/use-outbound-click-analytics.cjs");
4
- const require_hooks_use_report_web_vitals = require("../hooks/use-report-web-vitals.cjs");
5
- const require_hooks_use_uet_id_sync = require("../hooks/use-uet-id-sync.cjs");
6
- const require_hooks_use_web_analytics = require("../hooks/use-web-analytics.cjs");
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- let react_router = require("react-router");
9
- // src/react-router/index.tsx
10
- function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId, linkedInPartnerId, uetTagId, uetCustomerId, hotjarId, facebookAppId, reportWebVitals = true }) {
11
- const { pathname, search } = (0, react_router.useLocation)();
12
- require_hooks_use_web_analytics.useWebAnalytics(pathname, search);
13
- require_hooks_use_outbound_click_analytics.useOutboundClickAnalytics();
14
- require_hooks_use_uet_id_sync.useUETIdSync(uetCustomerId);
15
- require_hooks_use_report_web_vitals.useReportWebVitals((metric) => {
16
- if (!reportWebVitals) return;
17
- const properties = {
18
- value: metric.delta,
19
- metric_id: metric.id,
20
- metric_value: metric.value,
21
- metric_delta: metric.delta,
22
- metric_rating: metric.rating,
23
- metric_navigation_type: metric.navigationType,
24
- non_interaction: true
25
- };
26
- require_track_index.track(metric.name, properties);
27
- });
28
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
29
- facebookAppId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
30
- property: "fb:app_id",
31
- content: facebookAppId
32
- }),
33
- gaId && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
34
- async: true,
35
- id: "gtag",
36
- nonce,
37
- src: gaSrc ?? `https://www.googletagmanager.com/gtag/js?id=${gaId}`
38
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
39
- async: true,
40
- nonce,
41
- id: "gtag-init",
42
- dangerouslySetInnerHTML: { __html: `
43
- window.dataLayer = window.dataLayer || [];
44
- function gtag(){dataLayer.push(arguments);}
45
- gtag('js', new Date());
46
- gtag('config', '${gaId}'${debugMode ? " ,{ 'debug_mode': true }" : ""});
47
- ` }
48
- })] }),
49
- metaPixelId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
50
- async: true,
51
- id: "meta-pixel",
52
- nonce,
53
- dangerouslySetInnerHTML: { __html: `
54
- !(function (f, b, e, v, n, t, s) {
55
- if (f.fbq) return;
56
- n = f.fbq = function () {
57
- n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
58
- };
59
- if (!f._fbq) f._fbq = n;
60
- n.push = n;
61
- n.loaded = !0;
62
- n.version = '2.0';
63
- n.queue = [];
64
- t = b.createElement(e);
65
- t.async = !0;
66
- t.src = v;
67
- s = b.getElementsByTagName(e)[0];
68
- s.parentNode.insertBefore(t, s);
69
- })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
70
- fbq('init', '${metaPixelId}');
71
- fbq('track', 'PageView');` }
72
- }),
73
- redditPixelId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
74
- async: true,
75
- id: "reddit-pixel",
76
- nonce,
77
- dangerouslySetInnerHTML: { __html: `
78
- !function(w,d) {
79
- if(!w.rdt) {
80
- var p = w.rdt = function() {
81
- p.sendEvent ? p.sendEvent.apply(p,arguments) : p.callQueue.push(arguments)
82
- };
83
- p.callQueue = [];
84
- var t = d.createElement("script");
85
- t.src = "https://www.redditstatic.com/ads/pixel.js";
86
- t.async = !0;
87
- var s = d.getElementsByTagName("script")[0];
88
- s.parentNode.insertBefore(t,s)
89
- }
90
- }(window, document);
91
- rdt('init', '${redditPixelId}');
92
- rdt('track', 'PageVisit');` }
93
- }),
94
- linkedInPartnerId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
95
- async: true,
96
- id: "linkedin-insight-tag",
97
- nonce,
98
- dangerouslySetInnerHTML: { __html: `
99
- _linkedin_partner_id = "${linkedInPartnerId}";
100
- window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
101
- window._linkedin_data_partner_ids.push(_linkedin_partner_id);
102
-
103
- (function(l) {
104
- if (!l){
105
- window.lintrk = function(a,b){
106
- window.lintrk.q.push([a,b])
107
- };
108
- window.lintrk.q=[]
109
- }
110
- var s = document.getElementsByTagName("script")[0];
111
- var b = document.createElement("script");
112
- b.type = "text/javascript";b.async = true;
113
- b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
114
- s.parentNode.insertBefore(b, s);
115
- })(window.lintrk);
116
- ` }
117
- }),
118
- uetTagId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
119
- async: true,
120
- id: "uet-tag",
121
- nonce,
122
- dangerouslySetInnerHTML: { __html: `
123
- (function (w, d, t, u, o) {
124
- w[u] = w[u] || [], o.ts = (new Date).getTime();
125
- var n = d.createElement(t);
126
- n.src = "https://bat.bing.net/bat.js?ti=" + o.ti + ("uetq" != u ? "&q=" + u : ""),
127
- n.async = 1, n.onload = n.onreadystatechange = function() {
128
- var s = this.readyState;
129
- s && "loaded" !== s && "complete" !== s ||
130
- (o.q = w[u], w[u] = new UET(o), w[u].push("pageLoad"),
131
- n.onload = n.onreadystatechange = null)
132
- };
133
- var i = d.getElementsByTagName(t)[0];
134
- i.parentNode.insertBefore(n, i);
135
- })(window, document, "script", "uetq", {
136
- ti: "${uetTagId}",
137
- enableAutoSpaTracking: true
138
- });
139
- ` }
140
- }),
141
- hotjarId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
142
- async: true,
143
- id: "hotjar",
144
- nonce,
145
- dangerouslySetInnerHTML: { __html: `
146
- (function(h,o,t,j,a,r){
147
- h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
148
- h._hjSettings={hjid:${hotjarId},hjsv:6};
149
- a=o.getElementsByTagName('head')[0];
150
- r=o.createElement('script');r.async=1;
151
- r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
152
- a.appendChild(r);
153
- })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
154
- ` }
155
- })
156
- ] });
157
- }
158
- exports.Analytics = Analytics;
159
-
160
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","names":["useLocation"],"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useLocation } from 'react-router';\nimport { useOutboundClickAnalytics } from '../hooks/use-outbound-click-analytics';\nimport { useReportWebVitals } from '../hooks/use-report-web-vitals';\nimport { useUETIdSync } from '../hooks/use-uet-id-sync';\nimport { useWebAnalytics } from '../hooks/use-web-analytics';\nimport type { PixelId as MetaPixelId } from '../track/fbq';\nimport type { GaId } from '../track/gtag';\nimport { track } from '../track/index';\nimport type { PixelId as RedditPixelId } from '../track/rdt';\n\ninterface Props {\n gaId?: GaId;\n gaSrc?: string;\n metaPixelId?: MetaPixelId;\n redditPixelId?: RedditPixelId;\n linkedInPartnerId?: `${number}`;\n /** Microsoft Advertising UET tag id. The tag reports page loads itself (`enableAutoSpaTracking`). */\n uetTagId?: `${number}`;\n /** Microsoft Advertising customer id (`cid` in the ads UI's URLs): enables the Conversions API's ID Sync pixel. */\n uetCustomerId?: `${number}`;\n hotjarId?: `${number}`;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: boolean;\n}\n\nexport function Analytics({\n gaId,\n gaSrc,\n nonce,\n debugMode,\n metaPixelId,\n redditPixelId,\n linkedInPartnerId,\n uetTagId,\n uetCustomerId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const { pathname, search } = useLocation();\n useWebAnalytics(pathname, search);\n useOutboundClickAnalytics();\n useUETIdSync(uetCustomerId);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\n const properties = {\n value: metric.delta,\n metric_id: metric.id,\n metric_value: metric.value,\n metric_delta: metric.delta,\n metric_rating: metric.rating,\n metric_navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={gaSrc ?? `https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {metaPixelId && (\n <script\n async\n id=\"meta-pixel\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '${metaPixelId}');\n fbq('track', 'PageView');`,\n }}\n />\n )}\n {redditPixelId && (\n <script\n async\n id=\"reddit-pixel\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n !function(w,d) {\n if(!w.rdt) {\n var p = w.rdt = function() {\n p.sendEvent ? p.sendEvent.apply(p,arguments) : p.callQueue.push(arguments)\n };\n p.callQueue = [];\n var t = d.createElement(\"script\");\n t.src = \"https://www.redditstatic.com/ads/pixel.js\";\n t.async = !0;\n var s = d.getElementsByTagName(\"script\")[0];\n s.parentNode.insertBefore(t,s)\n }\n }(window, document);\n rdt('init', '${redditPixelId}');\n rdt('track', 'PageVisit');`,\n }}\n />\n )}\n {linkedInPartnerId && (\n <script\n async\n id=\"linkedin-insight-tag\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n _linkedin_partner_id = \"${linkedInPartnerId}\";\n window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];\n window._linkedin_data_partner_ids.push(_linkedin_partner_id);\n\n (function(l) {\n if (!l){\n window.lintrk = function(a,b){\n window.lintrk.q.push([a,b])\n };\n window.lintrk.q=[]\n }\n var s = document.getElementsByTagName(\"script\")[0];\n var b = document.createElement(\"script\");\n b.type = \"text/javascript\";b.async = true;\n b.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\n s.parentNode.insertBefore(b, s);\n })(window.lintrk);\n `,\n }}\n />\n )}\n {uetTagId && (\n <script\n async\n id=\"uet-tag\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n (function (w, d, t, u, o) {\n w[u] = w[u] || [], o.ts = (new Date).getTime();\n var n = d.createElement(t);\n n.src = \"https://bat.bing.net/bat.js?ti=\" + o.ti + (\"uetq\" != u ? \"&q=\" + u : \"\"),\n n.async = 1, n.onload = n.onreadystatechange = function() {\n var s = this.readyState;\n s && \"loaded\" !== s && \"complete\" !== s ||\n (o.q = w[u], w[u] = new UET(o), w[u].push(\"pageLoad\"),\n n.onload = n.onreadystatechange = null)\n };\n var i = d.getElementsByTagName(t)[0];\n i.parentNode.insertBefore(n, i);\n })(window, document, \"script\", \"uetq\", {\n ti: \"${uetTagId}\",\n enableAutoSpaTracking: true\n });\n `,\n }}\n />\n )}\n {hotjarId && (\n <script\n async\n id=\"hotjar\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n `,\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgB,UAAU,EACxB,MACA,OACA,OACA,WACA,aACA,eACA,mBACA,UACA,eACA,UACA,eACA,kBAAkB,QACV;CACR,MAAM,EAAE,UAAU,YAAA,GAAWA,aAAAA,YAAAA,CAAY;CACzC,gCAAA,gBAAgB,UAAU,MAAM;CAChC,2CAAA,0BAA0B;CAC1B,8BAAA,aAAa,aAAa;CAE1B,oCAAA,oBAAoB,WAAW;EAC7B,IAAI,CAAC,iBAAiB;EACtB,MAAM,aAAa;GACjB,OAAO,OAAO;GACd,WAAW,OAAO;GAClB,cAAc,OAAO;GACrB,cAAc,OAAO;GACrB,eAAe,OAAO;GACtB,wBAAwB,OAAO;GAC/B,iBAAiB;EACnB;EACA,oBAAA,MAAM,OAAO,MAAM,UAAU;CAC/B,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;EACG,iBAAiB,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,UAAS;GAAY,SAAS;EAAgB,CAAA;EACrE,QACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,KAAK,SAAS,+CAA+C;EAC9D,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACO;GACP,IAAG;GACH,yBAAyB,EACvB,QAAQ;;;;gCAIU,KAAK,GAAG,YAAY,6BAA6B,GAAG;cAExE;EACD,CAAA,CACD,EAAA,CAAA;EAEH,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;;;;2BAiBO,YAAY;uCAE7B;EACD,CAAA;EAEF,iBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;2BAcO,cAAc;wCAE/B;EACD,CAAA;EAEF,qBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;sCACkB,kBAAkB;;;;;;;;;;;;;;;;;cAkB9C;EACD,CAAA;EAEF,YACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;uBAcG,SAAS;;;cAItB;EACD,CAAA;EAEF,YACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;oCAGgB,SAAS;;;;;;cAOnC;EACD,CAAA;CAEH,EAAA,CAAA;AAEN"}
@@ -1,22 +0,0 @@
1
- import { GaId } from "../track/gtag.cjs";
2
- import { PixelId } from "../track/fbq.cjs";
3
- import { PixelId as PixelId$1 } from "../track/rdt.cjs";
4
- interface Props {
5
- gaId?: GaId;
6
- gaSrc?: string;
7
- metaPixelId?: PixelId;
8
- redditPixelId?: PixelId$1;
9
- linkedInPartnerId?: `${number}`;
10
- /** Microsoft Advertising UET tag id. The tag reports page loads itself (`enableAutoSpaTracking`). */
11
- uetTagId?: `${number}`;
12
- /** Microsoft Advertising customer id (`cid` in the ads UI's URLs): enables the Conversions API's ID Sync pixel. */
13
- uetCustomerId?: `${number}`;
14
- hotjarId?: `${number}`;
15
- facebookAppId?: string;
16
- nonce?: string;
17
- debugMode?: boolean;
18
- reportWebVitals?: boolean;
19
- }
20
- export declare function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId, linkedInPartnerId, uetTagId, uetCustomerId, hotjarId, facebookAppId, reportWebVitals }: Props): import("react").JSX.Element;
21
- export {};
22
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":["MetaPixelId","RedditPixelId"],"sources":["../../src/react-router/index.tsx"],"mappings":";;;UAUU;EACR,OAAO;EACP;EACA,cAAcA;EACd,gBAAgBC;EAChB;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;;wBAGc,YACd,MACA,OACA,OACA,WACA,aACA,eACA,mBACA,UACA,eACA,UACA,eACA,mBACC,wBAAK,IAAA"}
@@ -1,22 +0,0 @@
1
- import { GaId } from "../track/gtag.mjs";
2
- import { PixelId } from "../track/fbq.mjs";
3
- import { PixelId as PixelId$1 } from "../track/rdt.mjs";
4
- interface Props {
5
- gaId?: GaId;
6
- gaSrc?: string;
7
- metaPixelId?: PixelId;
8
- redditPixelId?: PixelId$1;
9
- linkedInPartnerId?: `${number}`;
10
- /** Microsoft Advertising UET tag id. The tag reports page loads itself (`enableAutoSpaTracking`). */
11
- uetTagId?: `${number}`;
12
- /** Microsoft Advertising customer id (`cid` in the ads UI's URLs): enables the Conversions API's ID Sync pixel. */
13
- uetCustomerId?: `${number}`;
14
- hotjarId?: `${number}`;
15
- facebookAppId?: string;
16
- nonce?: string;
17
- debugMode?: boolean;
18
- reportWebVitals?: boolean;
19
- }
20
- export declare function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId, linkedInPartnerId, uetTagId, uetCustomerId, hotjarId, facebookAppId, reportWebVitals }: Props): import("react").JSX.Element;
21
- export {};
22
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":["MetaPixelId","RedditPixelId"],"sources":["../../src/react-router/index.tsx"],"mappings":";;;UAUU;EACR,OAAO;EACP;EACA,cAAcA;EACd,gBAAgBC;EAChB;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA;;wBAGc,YACd,MACA,OACA,OACA,WACA,aACA,eACA,mBACA,UACA,eACA,UACA,eACA,mBACC,wBAAK,IAAA"}
@@ -1,159 +0,0 @@
1
- import { track } from "../track/index.mjs";
2
- import { useOutboundClickAnalytics } from "../hooks/use-outbound-click-analytics.mjs";
3
- import { useReportWebVitals } from "../hooks/use-report-web-vitals.mjs";
4
- import { useUETIdSync } from "../hooks/use-uet-id-sync.mjs";
5
- import { useWebAnalytics } from "../hooks/use-web-analytics.mjs";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- import { useLocation } from "react-router";
8
- // src/react-router/index.tsx
9
- function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId, linkedInPartnerId, uetTagId, uetCustomerId, hotjarId, facebookAppId, reportWebVitals = true }) {
10
- const { pathname, search } = useLocation();
11
- useWebAnalytics(pathname, search);
12
- useOutboundClickAnalytics();
13
- useUETIdSync(uetCustomerId);
14
- useReportWebVitals((metric) => {
15
- if (!reportWebVitals) return;
16
- const properties = {
17
- value: metric.delta,
18
- metric_id: metric.id,
19
- metric_value: metric.value,
20
- metric_delta: metric.delta,
21
- metric_rating: metric.rating,
22
- metric_navigation_type: metric.navigationType,
23
- non_interaction: true
24
- };
25
- track(metric.name, properties);
26
- });
27
- return /* @__PURE__ */ jsxs(Fragment, { children: [
28
- facebookAppId && /* @__PURE__ */ jsx("meta", {
29
- property: "fb:app_id",
30
- content: facebookAppId
31
- }),
32
- gaId && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("script", {
33
- async: true,
34
- id: "gtag",
35
- nonce,
36
- src: gaSrc ?? `https://www.googletagmanager.com/gtag/js?id=${gaId}`
37
- }), /* @__PURE__ */ jsx("script", {
38
- async: true,
39
- nonce,
40
- id: "gtag-init",
41
- dangerouslySetInnerHTML: { __html: `
42
- window.dataLayer = window.dataLayer || [];
43
- function gtag(){dataLayer.push(arguments);}
44
- gtag('js', new Date());
45
- gtag('config', '${gaId}'${debugMode ? " ,{ 'debug_mode': true }" : ""});
46
- ` }
47
- })] }),
48
- metaPixelId && /* @__PURE__ */ jsx("script", {
49
- async: true,
50
- id: "meta-pixel",
51
- nonce,
52
- dangerouslySetInnerHTML: { __html: `
53
- !(function (f, b, e, v, n, t, s) {
54
- if (f.fbq) return;
55
- n = f.fbq = function () {
56
- n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
57
- };
58
- if (!f._fbq) f._fbq = n;
59
- n.push = n;
60
- n.loaded = !0;
61
- n.version = '2.0';
62
- n.queue = [];
63
- t = b.createElement(e);
64
- t.async = !0;
65
- t.src = v;
66
- s = b.getElementsByTagName(e)[0];
67
- s.parentNode.insertBefore(t, s);
68
- })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
69
- fbq('init', '${metaPixelId}');
70
- fbq('track', 'PageView');` }
71
- }),
72
- redditPixelId && /* @__PURE__ */ jsx("script", {
73
- async: true,
74
- id: "reddit-pixel",
75
- nonce,
76
- dangerouslySetInnerHTML: { __html: `
77
- !function(w,d) {
78
- if(!w.rdt) {
79
- var p = w.rdt = function() {
80
- p.sendEvent ? p.sendEvent.apply(p,arguments) : p.callQueue.push(arguments)
81
- };
82
- p.callQueue = [];
83
- var t = d.createElement("script");
84
- t.src = "https://www.redditstatic.com/ads/pixel.js";
85
- t.async = !0;
86
- var s = d.getElementsByTagName("script")[0];
87
- s.parentNode.insertBefore(t,s)
88
- }
89
- }(window, document);
90
- rdt('init', '${redditPixelId}');
91
- rdt('track', 'PageVisit');` }
92
- }),
93
- linkedInPartnerId && /* @__PURE__ */ jsx("script", {
94
- async: true,
95
- id: "linkedin-insight-tag",
96
- nonce,
97
- dangerouslySetInnerHTML: { __html: `
98
- _linkedin_partner_id = "${linkedInPartnerId}";
99
- window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
100
- window._linkedin_data_partner_ids.push(_linkedin_partner_id);
101
-
102
- (function(l) {
103
- if (!l){
104
- window.lintrk = function(a,b){
105
- window.lintrk.q.push([a,b])
106
- };
107
- window.lintrk.q=[]
108
- }
109
- var s = document.getElementsByTagName("script")[0];
110
- var b = document.createElement("script");
111
- b.type = "text/javascript";b.async = true;
112
- b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
113
- s.parentNode.insertBefore(b, s);
114
- })(window.lintrk);
115
- ` }
116
- }),
117
- uetTagId && /* @__PURE__ */ jsx("script", {
118
- async: true,
119
- id: "uet-tag",
120
- nonce,
121
- dangerouslySetInnerHTML: { __html: `
122
- (function (w, d, t, u, o) {
123
- w[u] = w[u] || [], o.ts = (new Date).getTime();
124
- var n = d.createElement(t);
125
- n.src = "https://bat.bing.net/bat.js?ti=" + o.ti + ("uetq" != u ? "&q=" + u : ""),
126
- n.async = 1, n.onload = n.onreadystatechange = function() {
127
- var s = this.readyState;
128
- s && "loaded" !== s && "complete" !== s ||
129
- (o.q = w[u], w[u] = new UET(o), w[u].push("pageLoad"),
130
- n.onload = n.onreadystatechange = null)
131
- };
132
- var i = d.getElementsByTagName(t)[0];
133
- i.parentNode.insertBefore(n, i);
134
- })(window, document, "script", "uetq", {
135
- ti: "${uetTagId}",
136
- enableAutoSpaTracking: true
137
- });
138
- ` }
139
- }),
140
- hotjarId && /* @__PURE__ */ jsx("script", {
141
- async: true,
142
- id: "hotjar",
143
- nonce,
144
- dangerouslySetInnerHTML: { __html: `
145
- (function(h,o,t,j,a,r){
146
- h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
147
- h._hjSettings={hjid:${hotjarId},hjsv:6};
148
- a=o.getElementsByTagName('head')[0];
149
- r=o.createElement('script');r.async=1;
150
- r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
151
- a.appendChild(r);
152
- })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
153
- ` }
154
- })
155
- ] });
156
- }
157
- export { Analytics };
158
-
159
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useLocation } from 'react-router';\nimport { useOutboundClickAnalytics } from '../hooks/use-outbound-click-analytics';\nimport { useReportWebVitals } from '../hooks/use-report-web-vitals';\nimport { useUETIdSync } from '../hooks/use-uet-id-sync';\nimport { useWebAnalytics } from '../hooks/use-web-analytics';\nimport type { PixelId as MetaPixelId } from '../track/fbq';\nimport type { GaId } from '../track/gtag';\nimport { track } from '../track/index';\nimport type { PixelId as RedditPixelId } from '../track/rdt';\n\ninterface Props {\n gaId?: GaId;\n gaSrc?: string;\n metaPixelId?: MetaPixelId;\n redditPixelId?: RedditPixelId;\n linkedInPartnerId?: `${number}`;\n /** Microsoft Advertising UET tag id. The tag reports page loads itself (`enableAutoSpaTracking`). */\n uetTagId?: `${number}`;\n /** Microsoft Advertising customer id (`cid` in the ads UI's URLs): enables the Conversions API's ID Sync pixel. */\n uetCustomerId?: `${number}`;\n hotjarId?: `${number}`;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: boolean;\n}\n\nexport function Analytics({\n gaId,\n gaSrc,\n nonce,\n debugMode,\n metaPixelId,\n redditPixelId,\n linkedInPartnerId,\n uetTagId,\n uetCustomerId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const { pathname, search } = useLocation();\n useWebAnalytics(pathname, search);\n useOutboundClickAnalytics();\n useUETIdSync(uetCustomerId);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\n const properties = {\n value: metric.delta,\n metric_id: metric.id,\n metric_value: metric.value,\n metric_delta: metric.delta,\n metric_rating: metric.rating,\n metric_navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={gaSrc ?? `https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {metaPixelId && (\n <script\n async\n id=\"meta-pixel\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '${metaPixelId}');\n fbq('track', 'PageView');`,\n }}\n />\n )}\n {redditPixelId && (\n <script\n async\n id=\"reddit-pixel\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n !function(w,d) {\n if(!w.rdt) {\n var p = w.rdt = function() {\n p.sendEvent ? p.sendEvent.apply(p,arguments) : p.callQueue.push(arguments)\n };\n p.callQueue = [];\n var t = d.createElement(\"script\");\n t.src = \"https://www.redditstatic.com/ads/pixel.js\";\n t.async = !0;\n var s = d.getElementsByTagName(\"script\")[0];\n s.parentNode.insertBefore(t,s)\n }\n }(window, document);\n rdt('init', '${redditPixelId}');\n rdt('track', 'PageVisit');`,\n }}\n />\n )}\n {linkedInPartnerId && (\n <script\n async\n id=\"linkedin-insight-tag\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n _linkedin_partner_id = \"${linkedInPartnerId}\";\n window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];\n window._linkedin_data_partner_ids.push(_linkedin_partner_id);\n\n (function(l) {\n if (!l){\n window.lintrk = function(a,b){\n window.lintrk.q.push([a,b])\n };\n window.lintrk.q=[]\n }\n var s = document.getElementsByTagName(\"script\")[0];\n var b = document.createElement(\"script\");\n b.type = \"text/javascript\";b.async = true;\n b.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\n s.parentNode.insertBefore(b, s);\n })(window.lintrk);\n `,\n }}\n />\n )}\n {uetTagId && (\n <script\n async\n id=\"uet-tag\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n (function (w, d, t, u, o) {\n w[u] = w[u] || [], o.ts = (new Date).getTime();\n var n = d.createElement(t);\n n.src = \"https://bat.bing.net/bat.js?ti=\" + o.ti + (\"uetq\" != u ? \"&q=\" + u : \"\"),\n n.async = 1, n.onload = n.onreadystatechange = function() {\n var s = this.readyState;\n s && \"loaded\" !== s && \"complete\" !== s ||\n (o.q = w[u], w[u] = new UET(o), w[u].push(\"pageLoad\"),\n n.onload = n.onreadystatechange = null)\n };\n var i = d.getElementsByTagName(t)[0];\n i.parentNode.insertBefore(n, i);\n })(window, document, \"script\", \"uetq\", {\n ti: \"${uetTagId}\",\n enableAutoSpaTracking: true\n });\n `,\n }}\n />\n )}\n {hotjarId && (\n <script\n async\n id=\"hotjar\"\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n `,\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,UAAU,EACxB,MACA,OACA,OACA,WACA,aACA,eACA,mBACA,UACA,eACA,UACA,eACA,kBAAkB,QACV;CACR,MAAM,EAAE,UAAU,WAAW,YAAY;CACzC,gBAAgB,UAAU,MAAM;CAChC,0BAA0B;CAC1B,aAAa,aAAa;CAE1B,oBAAoB,WAAW;EAC7B,IAAI,CAAC,iBAAiB;EACtB,MAAM,aAAa;GACjB,OAAO,OAAO;GACd,WAAW,OAAO;GAClB,cAAc,OAAO;GACrB,cAAc,OAAO;GACrB,eAAe,OAAO;GACtB,wBAAwB,OAAO;GAC/B,iBAAiB;EACnB;EACA,MAAM,OAAO,MAAM,UAAU;CAC/B,CAAC;CAED,OACE,qBAAA,UAAA,EAAA,UAAA;EACG,iBAAiB,oBAAC,QAAD;GAAM,UAAS;GAAY,SAAS;EAAgB,CAAA;EACrE,QACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,KAAK,SAAS,+CAA+C;EAC9D,CAAA,GACD,oBAAC,UAAD;GACE,OAAA;GACO;GACP,IAAG;GACH,yBAAyB,EACvB,QAAQ;;;;gCAIU,KAAK,GAAG,YAAY,6BAA6B,GAAG;cAExE;EACD,CAAA,CACD,EAAA,CAAA;EAEH,eACC,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;;;;2BAiBO,YAAY;uCAE7B;EACD,CAAA;EAEF,iBACC,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;2BAcO,cAAc;wCAE/B;EACD,CAAA;EAEF,qBACC,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;sCACkB,kBAAkB;;;;;;;;;;;;;;;;;cAkB9C;EACD,CAAA;EAEF,YACC,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;;;;;;;;;;;;uBAcG,SAAS;;;cAItB;EACD,CAAA;EAEF,YACC,oBAAC,UAAD;GACE,OAAA;GACA,IAAG;GACI;GACP,yBAAyB,EACvB,QAAQ;;;oCAGgB,SAAS;;;;;;cAOnC;EACD,CAAA;CAEH,EAAA,CAAA;AAEN"}
@@ -1,3 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_server_meta_conversions_api = require("./meta-conversions-api.cjs");
3
- exports.sendMetaEvents = require_server_meta_conversions_api.sendEvents;
@@ -1,2 +0,0 @@
1
- import { sendEvents } from "./meta-conversions-api.cjs";
2
- export { sendEvents as sendMetaEvents };
@@ -1,2 +0,0 @@
1
- import { sendEvents } from "./meta-conversions-api.mjs";
2
- export { sendEvents as sendMetaEvents };
@@ -1 +0,0 @@
1
- export { sendEvents as sendMetaEvents } from "./meta-conversions-api.mjs";