@c15t/scripts 2.0.1 → 2.2.0-canary-20260727202135

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 (182) hide show
  1. package/AGENTS.md +62 -0
  2. package/README.md +41 -29
  3. package/dist/e2e-test-utils.cjs +51 -10
  4. package/dist/e2e-test-utils.js +37 -3
  5. package/dist/engine/compile.cjs +9 -5
  6. package/dist/engine/runtime.cjs +111 -17
  7. package/dist/engine/runtime.js +102 -12
  8. package/dist/registry.cjs +423 -0
  9. package/dist/registry.js +372 -0
  10. package/dist/resolve.cjs +9 -5
  11. package/dist/types.cjs +32 -10
  12. package/dist/types.js +10 -1
  13. package/dist/vendors/_shared/attributes.cjs +55 -0
  14. package/dist/vendors/_shared/attributes.js +14 -0
  15. package/dist/vendors/_shared/google-consent.cjs +69 -0
  16. package/dist/vendors/_shared/google-consent.js +27 -0
  17. package/dist/vendors/_shared/install-builders.cjs +59 -0
  18. package/dist/vendors/_shared/install-builders.js +21 -0
  19. package/dist/vendors/_shared/script-url.cjs +78 -0
  20. package/dist/vendors/_shared/script-url.js +28 -0
  21. package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +11 -7
  22. package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
  23. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +206 -0
  24. package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
  25. package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +42 -21
  26. package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
  27. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +151 -0
  28. package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
  29. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +131 -0
  30. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
  31. package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +11 -7
  32. package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
  33. package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +15 -8
  34. package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
  35. package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
  36. package/dist/vendors/analytics/adobe-analytics.js +49 -0
  37. package/dist/vendors/analytics/ahrefs-analytics.cjs +68 -0
  38. package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
  39. package/dist/vendors/analytics/amplitude.cjs +193 -0
  40. package/dist/vendors/analytics/amplitude.js +134 -0
  41. package/dist/vendors/analytics/clearbit.cjs +69 -0
  42. package/dist/vendors/analytics/clearbit.js +28 -0
  43. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +73 -0
  44. package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
  45. package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +14 -10
  46. package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
  47. package/dist/vendors/analytics/fathom-analytics.cjs +76 -0
  48. package/dist/vendors/analytics/fathom-analytics.js +35 -0
  49. package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +18 -35
  50. package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
  51. package/dist/vendors/analytics/heap.cjs +181 -0
  52. package/dist/vendors/analytics/heap.js +134 -0
  53. package/dist/vendors/analytics/hightouch.cjs +153 -0
  54. package/dist/vendors/analytics/hightouch.js +109 -0
  55. package/dist/vendors/analytics/hotjar.cjs +85 -0
  56. package/dist/vendors/analytics/hotjar.js +44 -0
  57. package/dist/vendors/analytics/logrocket.cjs +99 -0
  58. package/dist/vendors/analytics/logrocket.js +58 -0
  59. package/dist/vendors/analytics/matomo-analytics.cjs +232 -0
  60. package/dist/vendors/analytics/matomo-analytics.js +191 -0
  61. package/dist/vendors/analytics/microsoft-clarity.cjs +138 -0
  62. package/dist/vendors/analytics/microsoft-clarity.js +97 -0
  63. package/dist/vendors/analytics/mixpanel-analytics.cjs +134 -0
  64. package/dist/vendors/analytics/mixpanel-analytics.js +93 -0
  65. package/dist/vendors/analytics/pirsch.cjs +108 -0
  66. package/dist/vendors/analytics/pirsch.js +67 -0
  67. package/dist/vendors/analytics/plausible-analytics.cjs +122 -0
  68. package/dist/vendors/analytics/plausible-analytics.js +81 -0
  69. package/dist/vendors/analytics/posthog.cjs +204 -0
  70. package/dist/vendors/analytics/posthog.js +163 -0
  71. package/dist/vendors/analytics/promptwatch.cjs +70 -0
  72. package/dist/vendors/analytics/promptwatch.js +29 -0
  73. package/dist/vendors/analytics/rudderstack.cjs +227 -0
  74. package/dist/vendors/analytics/rudderstack.js +183 -0
  75. package/dist/vendors/analytics/rybbit-analytics.cjs +104 -0
  76. package/dist/vendors/analytics/rybbit-analytics.js +63 -0
  77. package/dist/vendors/analytics/segment.cjs +97 -0
  78. package/dist/vendors/analytics/segment.js +56 -0
  79. package/dist/vendors/analytics/umami-analytics.cjs +80 -0
  80. package/dist/vendors/analytics/umami-analytics.js +39 -0
  81. package/dist/vendors/analytics/vercel-analytics.cjs +94 -0
  82. package/dist/vendors/analytics/vercel-analytics.js +53 -0
  83. package/dist/vendors/functional/crisp.cjs +143 -0
  84. package/dist/vendors/functional/crisp.js +102 -0
  85. package/dist/vendors/functional/intercom.cjs +89 -0
  86. package/dist/vendors/functional/intercom.js +45 -0
  87. package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +17 -34
  88. package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
  89. package/dist-types/__tests__/helpers.d.ts +141 -0
  90. package/dist-types/engine/runtime.d.ts +1 -1
  91. package/dist-types/registry.d.ts +440 -0
  92. package/dist-types/types.d.ts +53 -2
  93. package/dist-types/vendors/_shared/attributes.d.ts +35 -0
  94. package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
  95. package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
  96. package/dist-types/vendors/_shared/script-url.d.ts +75 -0
  97. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +92 -0
  98. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
  99. package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +45 -34
  100. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
  101. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
  102. package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +48 -33
  103. package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +34 -17
  104. package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
  105. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
  106. package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
  107. package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
  108. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
  109. package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +25 -25
  110. package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
  111. package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +21 -24
  112. package/dist-types/vendors/analytics/heap.d.ts +316 -0
  113. package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
  114. package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
  115. package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
  116. package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
  117. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +98 -0
  118. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +113 -0
  119. package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
  120. package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
  121. package/dist-types/vendors/analytics/posthog.d.ts +154 -0
  122. package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
  123. package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
  124. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
  125. package/dist-types/vendors/analytics/segment.d.ts +158 -0
  126. package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
  127. package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
  128. package/dist-types/vendors/functional/crisp.d.ts +78 -0
  129. package/dist-types/vendors/functional/intercom.d.ts +135 -0
  130. package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +22 -25
  131. package/docs/README.md +62 -0
  132. package/docs/frameworks/javascript/script-loader.md +354 -0
  133. package/docs/frameworks/next/script-loader.md +499 -0
  134. package/docs/frameworks/react/script-loader.md +553 -0
  135. package/docs/integrations/adobe-analytics.md +160 -0
  136. package/docs/integrations/ahrefs-analytics.md +157 -0
  137. package/docs/integrations/amplitude.md +230 -0
  138. package/docs/integrations/building-integrations.md +239 -0
  139. package/docs/integrations/clearbit.md +130 -0
  140. package/docs/integrations/cloudflare-web-analytics.md +126 -0
  141. package/docs/integrations/crisp.md +140 -0
  142. package/docs/integrations/databuddy.md +205 -0
  143. package/docs/integrations/fathom-analytics.md +150 -0
  144. package/docs/integrations/google-maps.md +263 -0
  145. package/docs/integrations/google-tag-manager.md +154 -0
  146. package/docs/integrations/google-tag.md +134 -0
  147. package/docs/integrations/heap.md +219 -0
  148. package/docs/integrations/hightouch.md +199 -0
  149. package/docs/integrations/hotjar.md +143 -0
  150. package/docs/integrations/intercom.md +144 -0
  151. package/docs/integrations/linkedin-insights.md +161 -0
  152. package/docs/integrations/logrocket.md +175 -0
  153. package/docs/integrations/matomo-analytics.md +171 -0
  154. package/docs/integrations/meta-pixel.md +412 -0
  155. package/docs/integrations/microsoft-clarity.md +173 -0
  156. package/docs/integrations/microsoft-uet.md +156 -0
  157. package/docs/integrations/mixpanel-analytics.md +130 -0
  158. package/docs/integrations/overview.md +149 -0
  159. package/docs/integrations/pirsch.md +142 -0
  160. package/docs/integrations/plausible-analytics.md +154 -0
  161. package/docs/integrations/posthog.md +258 -0
  162. package/docs/integrations/promptwatch.md +121 -0
  163. package/docs/integrations/reddit-pixel.md +241 -0
  164. package/docs/integrations/rudderstack.md +271 -0
  165. package/docs/integrations/rybbit-analytics.md +143 -0
  166. package/docs/integrations/segment.md +146 -0
  167. package/docs/integrations/snapchat-pixel.md +163 -0
  168. package/docs/integrations/tiktok-pixel.md +123 -0
  169. package/docs/integrations/umami-analytics.md +148 -0
  170. package/docs/integrations/vercel-analytics.md +141 -0
  171. package/docs/integrations/x-pixel.md +157 -0
  172. package/docs/integrations/youtube.md +193 -0
  173. package/docs/shared/react/guides/script-loader.md +309 -0
  174. package/package.json +223 -8
  175. package/readme.json +8 -4
  176. package/dist/meta-pixel.cjs +0 -129
  177. package/dist/meta-pixel.js +0 -89
  178. package/dist/posthog.cjs +0 -137
  179. package/dist/posthog.js +0 -100
  180. package/dist-types/linkedin-insights.d.ts +0 -79
  181. package/dist-types/meta-pixel.d.ts +0 -185
  182. package/dist-types/posthog.d.ts +0 -112
@@ -1,9 +1,10 @@
1
- import { resolveManifest } from "./resolve.js";
2
- import { vendorManifestContract } from "./types.js";
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
3
  const microsoftUetManifest = {
4
4
  ...vendorManifestContract,
5
5
  vendor: 'microsoft-uet',
6
6
  category: 'marketing',
7
+ alwaysLoad: true,
7
8
  persistAfterConsentRevoked: true,
8
9
  bootstrap: [
9
10
  {
@@ -13,6 +14,34 @@ const microsoftUetManifest = {
13
14
  ifUndefined: true
14
15
  }
15
16
  ],
17
+ onBeforeLoadGranted: [
18
+ {
19
+ type: 'callGlobal',
20
+ global: 'uetq',
21
+ method: 'push',
22
+ args: [
23
+ 'consent',
24
+ 'default',
25
+ {
26
+ ad_storage: 'granted'
27
+ }
28
+ ]
29
+ }
30
+ ],
31
+ onBeforeLoadDenied: [
32
+ {
33
+ type: 'callGlobal',
34
+ global: 'uetq',
35
+ method: 'push',
36
+ args: [
37
+ 'consent',
38
+ 'default',
39
+ {
40
+ ad_storage: 'denied'
41
+ }
42
+ ]
43
+ }
44
+ ],
16
45
  install: [
17
46
  {
18
47
  type: 'loadScript',
@@ -40,18 +69,6 @@ const microsoftUetManifest = {
40
69
  args: [
41
70
  'pageLoad'
42
71
  ]
43
- },
44
- {
45
- type: 'callGlobal',
46
- global: 'uetq',
47
- method: 'push',
48
- args: [
49
- 'consent',
50
- 'default',
51
- {
52
- ad_storage: 'granted'
53
- }
54
- ]
55
72
  }
56
73
  ],
57
74
  onConsentGranted: [
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ redditPixel: ()=>redditPixel,
32
+ redditPixelEvent: ()=>redditPixelEvent,
33
+ redditPixelManifest: ()=>redditPixelManifest
34
+ });
35
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
36
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
37
+ const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
38
+ const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
39
+ const redditPixelManifest = {
40
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
41
+ vendor: 'reddit-pixel',
42
+ category: 'marketing',
43
+ persistAfterConsentRevoked: true,
44
+ bootstrap: [
45
+ {
46
+ type: 'defineStubFunction',
47
+ name: 'rdt',
48
+ queue: {
49
+ property: 'callQueue'
50
+ },
51
+ dispatchProperty: 'sendEvent',
52
+ queueFormat: 'array',
53
+ ifUndefined: true
54
+ }
55
+ ],
56
+ install: [
57
+ {
58
+ type: 'callGlobal',
59
+ global: 'rdt',
60
+ args: [
61
+ 'init',
62
+ '{{pixelId}}'
63
+ ]
64
+ },
65
+ {
66
+ type: 'callGlobal',
67
+ global: 'rdt',
68
+ args: [
69
+ 'track',
70
+ 'PageVisit'
71
+ ]
72
+ },
73
+ {
74
+ type: 'loadScript',
75
+ src: "{{scriptUrl}}",
76
+ async: true
77
+ }
78
+ ],
79
+ onConsentGranted: [
80
+ {
81
+ type: 'callGlobal',
82
+ global: 'rdt',
83
+ args: [
84
+ 'enableFirstPartyCookies'
85
+ ]
86
+ }
87
+ ],
88
+ onConsentDenied: [
89
+ {
90
+ type: 'callGlobal',
91
+ global: 'rdt',
92
+ args: [
93
+ 'disableFirstPartyCookies'
94
+ ]
95
+ }
96
+ ]
97
+ };
98
+ function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirstPartyCookies, scriptUrl }) {
99
+ let trackStep;
100
+ if (trackPageVisit) trackStep = {
101
+ args: [
102
+ 'track',
103
+ 'PageVisit'
104
+ ]
105
+ };
106
+ const resolvedInitOptions = getRedditPixelInitOptions({
107
+ initOptions,
108
+ disableFirstPartyCookies
109
+ });
110
+ const initArgs = [
111
+ 'init',
112
+ '{{pixelId}}'
113
+ ];
114
+ if (void 0 !== resolvedInitOptions) initArgs.push('{{initOptions}}');
115
+ const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
116
+ global: 'rdt',
117
+ initArgs,
118
+ trackStep
119
+ });
120
+ const manifest = {
121
+ ...redditPixelManifest,
122
+ install
123
+ };
124
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
125
+ pixelId,
126
+ initOptions: resolvedInitOptions,
127
+ scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptUrl, 'https://www.redditstatic.com/ads/pixel.js')
128
+ });
129
+ }
130
+ function getRedditPixelInitOptions({ initOptions, disableFirstPartyCookies }) {
131
+ if (void 0 === disableFirstPartyCookies) return initOptions;
132
+ return {
133
+ ...initOptions,
134
+ disableFirstPartyCookies
135
+ };
136
+ }
137
+ const redditPixelEvent = (eventName, metadata)=>{
138
+ if ("u" < typeof window || 'function' != typeof window.rdt) return;
139
+ window.rdt('track', eventName, metadata);
140
+ };
141
+ exports.redditPixel = __webpack_exports__.redditPixel;
142
+ exports.redditPixelEvent = __webpack_exports__.redditPixelEvent;
143
+ exports.redditPixelManifest = __webpack_exports__.redditPixelManifest;
144
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
145
+ "redditPixel",
146
+ "redditPixelEvent",
147
+ "redditPixelManifest"
148
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
149
+ Object.defineProperty(exports, '__esModule', {
150
+ value: true
151
+ });
@@ -0,0 +1,107 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ import { buildQueuePixelInstall } from "../_shared/install-builders.js";
4
+ import { resolveScriptUrl } from "../_shared/script-url.js";
5
+ const redditPixelManifest = {
6
+ ...vendorManifestContract,
7
+ vendor: 'reddit-pixel',
8
+ category: 'marketing',
9
+ persistAfterConsentRevoked: true,
10
+ bootstrap: [
11
+ {
12
+ type: 'defineStubFunction',
13
+ name: 'rdt',
14
+ queue: {
15
+ property: 'callQueue'
16
+ },
17
+ dispatchProperty: 'sendEvent',
18
+ queueFormat: 'array',
19
+ ifUndefined: true
20
+ }
21
+ ],
22
+ install: [
23
+ {
24
+ type: 'callGlobal',
25
+ global: 'rdt',
26
+ args: [
27
+ 'init',
28
+ '{{pixelId}}'
29
+ ]
30
+ },
31
+ {
32
+ type: 'callGlobal',
33
+ global: 'rdt',
34
+ args: [
35
+ 'track',
36
+ 'PageVisit'
37
+ ]
38
+ },
39
+ {
40
+ type: 'loadScript',
41
+ src: "{{scriptUrl}}",
42
+ async: true
43
+ }
44
+ ],
45
+ onConsentGranted: [
46
+ {
47
+ type: 'callGlobal',
48
+ global: 'rdt',
49
+ args: [
50
+ 'enableFirstPartyCookies'
51
+ ]
52
+ }
53
+ ],
54
+ onConsentDenied: [
55
+ {
56
+ type: 'callGlobal',
57
+ global: 'rdt',
58
+ args: [
59
+ 'disableFirstPartyCookies'
60
+ ]
61
+ }
62
+ ]
63
+ };
64
+ function redditPixel({ pixelId, trackPageVisit = true, initOptions, disableFirstPartyCookies, scriptUrl }) {
65
+ let trackStep;
66
+ if (trackPageVisit) trackStep = {
67
+ args: [
68
+ 'track',
69
+ 'PageVisit'
70
+ ]
71
+ };
72
+ const resolvedInitOptions = getRedditPixelInitOptions({
73
+ initOptions,
74
+ disableFirstPartyCookies
75
+ });
76
+ const initArgs = [
77
+ 'init',
78
+ '{{pixelId}}'
79
+ ];
80
+ if (void 0 !== resolvedInitOptions) initArgs.push('{{initOptions}}');
81
+ const install = buildQueuePixelInstall({
82
+ global: 'rdt',
83
+ initArgs,
84
+ trackStep
85
+ });
86
+ const manifest = {
87
+ ...redditPixelManifest,
88
+ install
89
+ };
90
+ return resolveManifest(manifest, {
91
+ pixelId,
92
+ initOptions: resolvedInitOptions,
93
+ scriptUrl: resolveScriptUrl(scriptUrl, 'https://www.redditstatic.com/ads/pixel.js')
94
+ });
95
+ }
96
+ function getRedditPixelInitOptions({ initOptions, disableFirstPartyCookies }) {
97
+ if (void 0 === disableFirstPartyCookies) return initOptions;
98
+ return {
99
+ ...initOptions,
100
+ disableFirstPartyCookies
101
+ };
102
+ }
103
+ const redditPixelEvent = (eventName, metadata)=>{
104
+ if ("u" < typeof window || 'function' != typeof window.rdt) return;
105
+ window.rdt('track', eventName, metadata);
106
+ };
107
+ export { redditPixel, redditPixelEvent, redditPixelManifest };
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ snapchatPixel: ()=>snapchatPixel,
32
+ snapchatPixelEvent: ()=>snapchatPixelEvent,
33
+ snapchatPixelManifest: ()=>snapchatPixelManifest
34
+ });
35
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
36
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
37
+ const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
38
+ const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
39
+ const snapchatPixelManifest = {
40
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
41
+ vendor: 'snapchat-pixel',
42
+ category: 'marketing',
43
+ bootstrap: [
44
+ {
45
+ type: 'defineStubFunction',
46
+ name: 'snaptr',
47
+ queue: {
48
+ property: 'queue'
49
+ },
50
+ dispatchProperty: 'handleRequest',
51
+ queueFormat: 'array',
52
+ aliases: [
53
+ '_snaptr'
54
+ ],
55
+ selfReferences: [
56
+ 'push'
57
+ ],
58
+ properties: {
59
+ loaded: true,
60
+ version: '1.0'
61
+ },
62
+ ifUndefined: true
63
+ }
64
+ ],
65
+ install: [
66
+ {
67
+ type: 'callGlobal',
68
+ global: 'snaptr',
69
+ args: [
70
+ 'init',
71
+ '{{pixelId}}'
72
+ ]
73
+ },
74
+ {
75
+ type: 'callGlobal',
76
+ global: 'snaptr',
77
+ args: [
78
+ 'track',
79
+ 'PAGE_VIEW'
80
+ ]
81
+ },
82
+ {
83
+ type: 'loadScript',
84
+ src: "{{scriptUrl}}",
85
+ async: true
86
+ }
87
+ ]
88
+ };
89
+ function snapchatPixel({ pixelId, initOptions, trackPageView = true, scriptUrl }) {
90
+ const initArgs = [
91
+ 'init',
92
+ '{{pixelId}}'
93
+ ];
94
+ if (void 0 !== initOptions) initArgs.push('{{initOptions}}');
95
+ let trackStep;
96
+ if (trackPageView) trackStep = {
97
+ args: [
98
+ 'track',
99
+ 'PAGE_VIEW'
100
+ ]
101
+ };
102
+ const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
103
+ global: 'snaptr',
104
+ initArgs,
105
+ trackStep
106
+ });
107
+ const manifest = {
108
+ ...snapchatPixelManifest,
109
+ install
110
+ };
111
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
112
+ pixelId,
113
+ initOptions,
114
+ scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptUrl, 'https://sc-static.net/scevent.min.js')
115
+ });
116
+ }
117
+ const snapchatPixelEvent = (eventName, properties)=>{
118
+ if ("u" < typeof window || 'function' != typeof window.snaptr) return;
119
+ window.snaptr('track', eventName, properties);
120
+ };
121
+ exports.snapchatPixel = __webpack_exports__.snapchatPixel;
122
+ exports.snapchatPixelEvent = __webpack_exports__.snapchatPixelEvent;
123
+ exports.snapchatPixelManifest = __webpack_exports__.snapchatPixelManifest;
124
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
125
+ "snapchatPixel",
126
+ "snapchatPixelEvent",
127
+ "snapchatPixelManifest"
128
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
129
+ Object.defineProperty(exports, '__esModule', {
130
+ value: true
131
+ });
@@ -0,0 +1,87 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ import { buildQueuePixelInstall } from "../_shared/install-builders.js";
4
+ import { resolveScriptUrl } from "../_shared/script-url.js";
5
+ const snapchatPixelManifest = {
6
+ ...vendorManifestContract,
7
+ vendor: 'snapchat-pixel',
8
+ category: 'marketing',
9
+ bootstrap: [
10
+ {
11
+ type: 'defineStubFunction',
12
+ name: 'snaptr',
13
+ queue: {
14
+ property: 'queue'
15
+ },
16
+ dispatchProperty: 'handleRequest',
17
+ queueFormat: 'array',
18
+ aliases: [
19
+ '_snaptr'
20
+ ],
21
+ selfReferences: [
22
+ 'push'
23
+ ],
24
+ properties: {
25
+ loaded: true,
26
+ version: '1.0'
27
+ },
28
+ ifUndefined: true
29
+ }
30
+ ],
31
+ install: [
32
+ {
33
+ type: 'callGlobal',
34
+ global: 'snaptr',
35
+ args: [
36
+ 'init',
37
+ '{{pixelId}}'
38
+ ]
39
+ },
40
+ {
41
+ type: 'callGlobal',
42
+ global: 'snaptr',
43
+ args: [
44
+ 'track',
45
+ 'PAGE_VIEW'
46
+ ]
47
+ },
48
+ {
49
+ type: 'loadScript',
50
+ src: "{{scriptUrl}}",
51
+ async: true
52
+ }
53
+ ]
54
+ };
55
+ function snapchatPixel({ pixelId, initOptions, trackPageView = true, scriptUrl }) {
56
+ const initArgs = [
57
+ 'init',
58
+ '{{pixelId}}'
59
+ ];
60
+ if (void 0 !== initOptions) initArgs.push('{{initOptions}}');
61
+ let trackStep;
62
+ if (trackPageView) trackStep = {
63
+ args: [
64
+ 'track',
65
+ 'PAGE_VIEW'
66
+ ]
67
+ };
68
+ const install = buildQueuePixelInstall({
69
+ global: 'snaptr',
70
+ initArgs,
71
+ trackStep
72
+ });
73
+ const manifest = {
74
+ ...snapchatPixelManifest,
75
+ install
76
+ };
77
+ return resolveManifest(manifest, {
78
+ pixelId,
79
+ initOptions,
80
+ scriptUrl: resolveScriptUrl(scriptUrl, 'https://sc-static.net/scevent.min.js')
81
+ });
82
+ }
83
+ const snapchatPixelEvent = (eventName, properties)=>{
84
+ if ("u" < typeof window || 'function' != typeof window.snaptr) return;
85
+ window.snaptr('track', eventName, properties);
86
+ };
87
+ export { snapchatPixel, snapchatPixelEvent, snapchatPixelManifest };
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
3
  (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
9
13
  };
10
14
  })();
11
15
  (()=>{
@@ -27,8 +31,8 @@ __webpack_require__.d(__webpack_exports__, {
27
31
  tiktokPixel: ()=>tiktokPixel,
28
32
  tiktokPixelManifest: ()=>tiktokPixelManifest
29
33
  });
30
- const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
31
- const external_types_cjs_namespaceObject = require("./types.cjs");
34
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
32
36
  const tiktokPixelManifest = {
33
37
  ...external_types_cjs_namespaceObject.vendorManifestContract,
34
38
  vendor: 'tiktok-pixel',
@@ -1,5 +1,5 @@
1
- import { resolveManifest } from "./resolve.js";
2
- import { vendorManifestContract } from "./types.js";
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
3
  const tiktokPixelManifest = {
4
4
  ...vendorManifestContract,
5
5
  vendor: 'tiktok-pixel',
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
3
  (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
9
13
  };
10
14
  })();
11
15
  (()=>{
@@ -28,8 +32,8 @@ __webpack_require__.d(__webpack_exports__, {
28
32
  xPixelEvent: ()=>xPixelEvent,
29
33
  xPixelManifest: ()=>xPixelManifest
30
34
  });
31
- const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
32
- const external_types_cjs_namespaceObject = require("./types.cjs");
35
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
36
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
33
37
  const xPixelManifest = {
34
38
  ...external_types_cjs_namespaceObject.vendorManifestContract,
35
39
  vendor: 'x-pixel',
@@ -71,7 +75,10 @@ function xPixel({ pixelId, scriptSrc }) {
71
75
  });
72
76
  return resolved;
73
77
  }
74
- const xPixelEvent = (eventId, metadata)=>window.twq?.('event', eventId, metadata);
78
+ const xPixelEvent = (eventId, metadata)=>{
79
+ if ("u" < typeof window || 'function' != typeof window.twq) throw new Error('X Pixel (twq) is not loaded. Ensure marketing consent is granted before calling xPixelEvent.');
80
+ window.twq('event', eventId, metadata);
81
+ };
75
82
  exports.xPixel = __webpack_exports__.xPixel;
76
83
  exports.xPixelEvent = __webpack_exports__.xPixelEvent;
77
84
  exports.xPixelManifest = __webpack_exports__.xPixelManifest;
@@ -1,5 +1,5 @@
1
- import { resolveManifest } from "./resolve.js";
2
- import { vendorManifestContract } from "./types.js";
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
3
  const xPixelManifest = {
4
4
  ...vendorManifestContract,
5
5
  vendor: 'x-pixel',
@@ -41,5 +41,8 @@ function xPixel({ pixelId, scriptSrc }) {
41
41
  });
42
42
  return resolved;
43
43
  }
44
- const xPixelEvent = (eventId, metadata)=>window.twq?.('event', eventId, metadata);
44
+ const xPixelEvent = (eventId, metadata)=>{
45
+ if ("u" < typeof window || 'function' != typeof window.twq) throw new Error('X Pixel (twq) is not loaded. Ensure marketing consent is granted before calling xPixelEvent.');
46
+ window.twq('event', eventId, metadata);
47
+ };
45
48
  export { xPixel, xPixelEvent, xPixelManifest };