@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
@@ -0,0 +1,59 @@
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
+ function buildQueuePixelInstall({ global, initArgs, trackStep, scriptPlaceholder = "{{scriptUrl}}" }) {
31
+ const install = [
32
+ {
33
+ type: 'callGlobal',
34
+ global,
35
+ args: initArgs
36
+ }
37
+ ];
38
+ if (void 0 !== trackStep) install.push({
39
+ type: 'callGlobal',
40
+ global,
41
+ args: trackStep.args
42
+ });
43
+ install.push({
44
+ type: 'loadScript',
45
+ src: scriptPlaceholder,
46
+ async: true
47
+ });
48
+ return install;
49
+ }
50
+ __webpack_require__.d(__webpack_exports__, {
51
+ buildQueuePixelInstall: ()=>buildQueuePixelInstall
52
+ });
53
+ exports.buildQueuePixelInstall = __webpack_exports__.buildQueuePixelInstall;
54
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
55
+ "buildQueuePixelInstall"
56
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
57
+ Object.defineProperty(exports, '__esModule', {
58
+ value: true
59
+ });
@@ -0,0 +1,21 @@
1
+ function buildQueuePixelInstall({ global, initArgs, trackStep, scriptPlaceholder = "{{scriptUrl}}" }) {
2
+ const install = [
3
+ {
4
+ type: 'callGlobal',
5
+ global,
6
+ args: initArgs
7
+ }
8
+ ];
9
+ if (void 0 !== trackStep) install.push({
10
+ type: 'callGlobal',
11
+ global,
12
+ args: trackStep.args
13
+ });
14
+ install.push({
15
+ type: 'loadScript',
16
+ src: scriptPlaceholder,
17
+ async: true
18
+ });
19
+ return install;
20
+ }
21
+ export { buildQueuePixelInstall };
@@ -0,0 +1,78 @@
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
+ function trimToUndefined(value) {
31
+ if (void 0 === value) return;
32
+ const trimmed = value.trim();
33
+ if (0 === trimmed.length) return;
34
+ return trimmed;
35
+ }
36
+ function resolveScriptUrl(override, fallback) {
37
+ if (void 0 !== override) return override;
38
+ return fallback;
39
+ }
40
+ function stripLeadingSlashes(value) {
41
+ let index = 0;
42
+ while(index < value.length && 47 === value.charCodeAt(index))index += 1;
43
+ return 0 === index ? value : value.slice(index);
44
+ }
45
+ function stripTrailingSlashes(value) {
46
+ let end = value.length;
47
+ while(end > 0 && 47 === value.charCodeAt(end - 1))end -= 1;
48
+ return end === value.length ? value : value.slice(0, end);
49
+ }
50
+ function joinUrlPath(base, path) {
51
+ const trimmedBase = base.trim();
52
+ const trimmedPath = path.trim();
53
+ if (0 === trimmedBase.length) throw new TypeError(`joinUrlPath requires a non-empty base URL. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
54
+ if (0 === trimmedPath.length) throw new TypeError(`joinUrlPath requires a non-empty path. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
55
+ return `${stripTrailingSlashes(trimmedBase)}/${stripLeadingSlashes(trimmedPath)}`;
56
+ }
57
+ __webpack_require__.d(__webpack_exports__, {
58
+ joinUrlPath: ()=>joinUrlPath,
59
+ resolveScriptUrl: ()=>resolveScriptUrl,
60
+ stripLeadingSlashes: ()=>stripLeadingSlashes,
61
+ stripTrailingSlashes: ()=>stripTrailingSlashes,
62
+ trimToUndefined: ()=>trimToUndefined
63
+ });
64
+ exports.joinUrlPath = __webpack_exports__.joinUrlPath;
65
+ exports.resolveScriptUrl = __webpack_exports__.resolveScriptUrl;
66
+ exports.stripLeadingSlashes = __webpack_exports__.stripLeadingSlashes;
67
+ exports.stripTrailingSlashes = __webpack_exports__.stripTrailingSlashes;
68
+ exports.trimToUndefined = __webpack_exports__.trimToUndefined;
69
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
70
+ "joinUrlPath",
71
+ "resolveScriptUrl",
72
+ "stripLeadingSlashes",
73
+ "stripTrailingSlashes",
74
+ "trimToUndefined"
75
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
76
+ Object.defineProperty(exports, '__esModule', {
77
+ value: true
78
+ });
@@ -0,0 +1,28 @@
1
+ function trimToUndefined(value) {
2
+ if (void 0 === value) return;
3
+ const trimmed = value.trim();
4
+ if (0 === trimmed.length) return;
5
+ return trimmed;
6
+ }
7
+ function resolveScriptUrl(override, fallback) {
8
+ if (void 0 !== override) return override;
9
+ return fallback;
10
+ }
11
+ function stripLeadingSlashes(value) {
12
+ let index = 0;
13
+ while(index < value.length && 47 === value.charCodeAt(index))index += 1;
14
+ return 0 === index ? value : value.slice(index);
15
+ }
16
+ function stripTrailingSlashes(value) {
17
+ let end = value.length;
18
+ while(end > 0 && 47 === value.charCodeAt(end - 1))end -= 1;
19
+ return end === value.length ? value : value.slice(0, end);
20
+ }
21
+ function joinUrlPath(base, path) {
22
+ const trimmedBase = base.trim();
23
+ const trimmedPath = path.trim();
24
+ if (0 === trimmedBase.length) throw new TypeError(`joinUrlPath requires a non-empty base URL. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
25
+ if (0 === trimmedPath.length) throw new TypeError(`joinUrlPath requires a non-empty path. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
26
+ return `${stripTrailingSlashes(trimmedBase)}/${stripLeadingSlashes(trimmedPath)}`;
27
+ }
28
+ export { joinUrlPath, resolveScriptUrl, stripLeadingSlashes, stripTrailingSlashes, trimToUndefined };
@@ -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
  linkedinInsights: ()=>linkedinInsights,
28
32
  linkedinInsightsManifest: ()=>linkedinInsightsManifest
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 linkedinInsightsManifest = {
33
37
  ...external_types_cjs_namespaceObject.vendorManifestContract,
34
38
  vendor: 'linkedin-insights',
@@ -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 linkedinInsightsManifest = {
4
4
  ...vendorManifestContract,
5
5
  vendor: 'linkedin-insights',
@@ -0,0 +1,206 @@
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
+ metaPixel: ()=>metaPixel,
32
+ metaPixelCustomEvent: ()=>metaPixelCustomEvent,
33
+ metaPixelEvent: ()=>metaPixelEvent,
34
+ metaPixelManifest: ()=>metaPixelManifest,
35
+ metaPixelSingleCustomEvent: ()=>metaPixelSingleCustomEvent,
36
+ metaPixelSingleEvent: ()=>metaPixelSingleEvent
37
+ });
38
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
39
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
40
+ const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
41
+ const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
42
+ const metaPixelManifest = {
43
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
44
+ vendor: 'meta-pixel',
45
+ category: 'marketing',
46
+ persistAfterConsentRevoked: true,
47
+ bootstrap: [
48
+ {
49
+ type: 'defineStubFunction',
50
+ name: 'fbq',
51
+ queue: {
52
+ property: 'queue'
53
+ },
54
+ dispatchProperty: 'callMethod',
55
+ selfReferences: [
56
+ 'push'
57
+ ],
58
+ aliases: [
59
+ '_fbq'
60
+ ],
61
+ properties: {
62
+ loaded: true,
63
+ version: '2.0'
64
+ },
65
+ ifUndefined: true
66
+ }
67
+ ],
68
+ install: [
69
+ {
70
+ type: 'callGlobal',
71
+ global: 'fbq',
72
+ args: [
73
+ 'consent',
74
+ 'grant'
75
+ ]
76
+ },
77
+ {
78
+ type: 'callGlobal',
79
+ global: 'fbq',
80
+ args: [
81
+ 'init',
82
+ '{{pixelId}}'
83
+ ]
84
+ },
85
+ {
86
+ type: 'callGlobal',
87
+ global: 'fbq',
88
+ args: [
89
+ 'track',
90
+ 'PageView'
91
+ ]
92
+ },
93
+ {
94
+ type: 'loadScript',
95
+ src: "{{scriptSrc}}",
96
+ async: true
97
+ }
98
+ ],
99
+ onConsentGranted: [
100
+ {
101
+ type: 'callGlobal',
102
+ global: 'fbq',
103
+ args: [
104
+ 'consent',
105
+ 'grant'
106
+ ]
107
+ }
108
+ ],
109
+ onConsentDenied: [
110
+ {
111
+ type: 'callGlobal',
112
+ global: 'fbq',
113
+ args: [
114
+ 'consent',
115
+ 'revoke'
116
+ ]
117
+ }
118
+ ]
119
+ };
120
+ function metaPixel({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
121
+ const install = buildMetaPixelInstall({
122
+ hasInitOptions: void 0 !== initOptions,
123
+ trackPageView,
124
+ dataProcessingOptions
125
+ });
126
+ const manifest = {
127
+ ...metaPixelManifest,
128
+ install
129
+ };
130
+ const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
131
+ pixelId,
132
+ initOptions,
133
+ scriptSrc: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
134
+ });
135
+ return resolved;
136
+ }
137
+ function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOptions }) {
138
+ const initArgs = [
139
+ 'init',
140
+ '{{pixelId}}'
141
+ ];
142
+ if (hasInitOptions) initArgs.push('{{initOptions}}');
143
+ const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
144
+ global: 'fbq',
145
+ initArgs,
146
+ trackStep: getMetaPixelPageViewStep(trackPageView),
147
+ scriptPlaceholder: "{{scriptSrc}}"
148
+ });
149
+ if (void 0 !== dataProcessingOptions) install.unshift({
150
+ type: 'callGlobal',
151
+ global: 'fbq',
152
+ args: getMetaPixelDataProcessingArgs(dataProcessingOptions)
153
+ });
154
+ install.unshift({
155
+ type: 'callGlobal',
156
+ global: 'fbq',
157
+ args: [
158
+ 'consent',
159
+ 'grant'
160
+ ]
161
+ });
162
+ return install;
163
+ }
164
+ function getMetaPixelDataProcessingArgs({ options, country, state }) {
165
+ const args = [
166
+ 'dataProcessingOptions',
167
+ options
168
+ ];
169
+ if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
170
+ return args;
171
+ }
172
+ function getMetaPixelPageViewStep(trackPageView) {
173
+ if (trackPageView) return {
174
+ args: [
175
+ 'track',
176
+ 'PageView'
177
+ ]
178
+ };
179
+ }
180
+ function resolveMetaPixelEventOptions(eventOptions) {
181
+ if ('string' == typeof eventOptions) return {
182
+ eventID: eventOptions
183
+ };
184
+ return eventOptions;
185
+ }
186
+ const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, resolveMetaPixelEventOptions(eventOptions));
187
+ const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, resolveMetaPixelEventOptions(eventOptions));
188
+ const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
189
+ const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
190
+ exports.metaPixel = __webpack_exports__.metaPixel;
191
+ exports.metaPixelCustomEvent = __webpack_exports__.metaPixelCustomEvent;
192
+ exports.metaPixelEvent = __webpack_exports__.metaPixelEvent;
193
+ exports.metaPixelManifest = __webpack_exports__.metaPixelManifest;
194
+ exports.metaPixelSingleCustomEvent = __webpack_exports__.metaPixelSingleCustomEvent;
195
+ exports.metaPixelSingleEvent = __webpack_exports__.metaPixelSingleEvent;
196
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
197
+ "metaPixel",
198
+ "metaPixelCustomEvent",
199
+ "metaPixelEvent",
200
+ "metaPixelManifest",
201
+ "metaPixelSingleCustomEvent",
202
+ "metaPixelSingleEvent"
203
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
204
+ Object.defineProperty(exports, '__esModule', {
205
+ value: true
206
+ });
@@ -0,0 +1,153 @@
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 metaPixelManifest = {
6
+ ...vendorManifestContract,
7
+ vendor: 'meta-pixel',
8
+ category: 'marketing',
9
+ persistAfterConsentRevoked: true,
10
+ bootstrap: [
11
+ {
12
+ type: 'defineStubFunction',
13
+ name: 'fbq',
14
+ queue: {
15
+ property: 'queue'
16
+ },
17
+ dispatchProperty: 'callMethod',
18
+ selfReferences: [
19
+ 'push'
20
+ ],
21
+ aliases: [
22
+ '_fbq'
23
+ ],
24
+ properties: {
25
+ loaded: true,
26
+ version: '2.0'
27
+ },
28
+ ifUndefined: true
29
+ }
30
+ ],
31
+ install: [
32
+ {
33
+ type: 'callGlobal',
34
+ global: 'fbq',
35
+ args: [
36
+ 'consent',
37
+ 'grant'
38
+ ]
39
+ },
40
+ {
41
+ type: 'callGlobal',
42
+ global: 'fbq',
43
+ args: [
44
+ 'init',
45
+ '{{pixelId}}'
46
+ ]
47
+ },
48
+ {
49
+ type: 'callGlobal',
50
+ global: 'fbq',
51
+ args: [
52
+ 'track',
53
+ 'PageView'
54
+ ]
55
+ },
56
+ {
57
+ type: 'loadScript',
58
+ src: "{{scriptSrc}}",
59
+ async: true
60
+ }
61
+ ],
62
+ onConsentGranted: [
63
+ {
64
+ type: 'callGlobal',
65
+ global: 'fbq',
66
+ args: [
67
+ 'consent',
68
+ 'grant'
69
+ ]
70
+ }
71
+ ],
72
+ onConsentDenied: [
73
+ {
74
+ type: 'callGlobal',
75
+ global: 'fbq',
76
+ args: [
77
+ 'consent',
78
+ 'revoke'
79
+ ]
80
+ }
81
+ ]
82
+ };
83
+ function metaPixel({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
84
+ const install = buildMetaPixelInstall({
85
+ hasInitOptions: void 0 !== initOptions,
86
+ trackPageView,
87
+ dataProcessingOptions
88
+ });
89
+ const manifest = {
90
+ ...metaPixelManifest,
91
+ install
92
+ };
93
+ const resolved = resolveManifest(manifest, {
94
+ pixelId,
95
+ initOptions,
96
+ scriptSrc: resolveScriptUrl(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
97
+ });
98
+ return resolved;
99
+ }
100
+ function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOptions }) {
101
+ const initArgs = [
102
+ 'init',
103
+ '{{pixelId}}'
104
+ ];
105
+ if (hasInitOptions) initArgs.push('{{initOptions}}');
106
+ const install = buildQueuePixelInstall({
107
+ global: 'fbq',
108
+ initArgs,
109
+ trackStep: getMetaPixelPageViewStep(trackPageView),
110
+ scriptPlaceholder: "{{scriptSrc}}"
111
+ });
112
+ if (void 0 !== dataProcessingOptions) install.unshift({
113
+ type: 'callGlobal',
114
+ global: 'fbq',
115
+ args: getMetaPixelDataProcessingArgs(dataProcessingOptions)
116
+ });
117
+ install.unshift({
118
+ type: 'callGlobal',
119
+ global: 'fbq',
120
+ args: [
121
+ 'consent',
122
+ 'grant'
123
+ ]
124
+ });
125
+ return install;
126
+ }
127
+ function getMetaPixelDataProcessingArgs({ options, country, state }) {
128
+ const args = [
129
+ 'dataProcessingOptions',
130
+ options
131
+ ];
132
+ if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
133
+ return args;
134
+ }
135
+ function getMetaPixelPageViewStep(trackPageView) {
136
+ if (trackPageView) return {
137
+ args: [
138
+ 'track',
139
+ 'PageView'
140
+ ]
141
+ };
142
+ }
143
+ function resolveMetaPixelEventOptions(eventOptions) {
144
+ if ('string' == typeof eventOptions) return {
145
+ eventID: eventOptions
146
+ };
147
+ return eventOptions;
148
+ }
149
+ const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, resolveMetaPixelEventOptions(eventOptions));
150
+ const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, resolveMetaPixelEventOptions(eventOptions));
151
+ const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
152
+ const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
153
+ export { metaPixel, metaPixelCustomEvent, metaPixelEvent, metaPixelManifest, metaPixelSingleCustomEvent, metaPixelSingleEvent };
@@ -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
  (()=>{
@@ -24,15 +28,16 @@ var __webpack_require__ = {};
24
28
  var __webpack_exports__ = {};
25
29
  __webpack_require__.r(__webpack_exports__);
26
30
  __webpack_require__.d(__webpack_exports__, {
27
- microsoftUetManifest: ()=>microsoftUetManifest,
28
- microsoftUet: ()=>microsoftUet
31
+ microsoftUet: ()=>microsoftUet,
32
+ microsoftUetManifest: ()=>microsoftUetManifest
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 microsoftUetManifest = {
33
37
  ...external_types_cjs_namespaceObject.vendorManifestContract,
34
38
  vendor: 'microsoft-uet',
35
39
  category: 'marketing',
40
+ alwaysLoad: true,
36
41
  persistAfterConsentRevoked: true,
37
42
  bootstrap: [
38
43
  {
@@ -42,6 +47,34 @@ const microsoftUetManifest = {
42
47
  ifUndefined: true
43
48
  }
44
49
  ],
50
+ onBeforeLoadGranted: [
51
+ {
52
+ type: 'callGlobal',
53
+ global: 'uetq',
54
+ method: 'push',
55
+ args: [
56
+ 'consent',
57
+ 'default',
58
+ {
59
+ ad_storage: 'granted'
60
+ }
61
+ ]
62
+ }
63
+ ],
64
+ onBeforeLoadDenied: [
65
+ {
66
+ type: 'callGlobal',
67
+ global: 'uetq',
68
+ method: 'push',
69
+ args: [
70
+ 'consent',
71
+ 'default',
72
+ {
73
+ ad_storage: 'denied'
74
+ }
75
+ ]
76
+ }
77
+ ],
45
78
  install: [
46
79
  {
47
80
  type: 'loadScript',
@@ -69,18 +102,6 @@ const microsoftUetManifest = {
69
102
  args: [
70
103
  'pageLoad'
71
104
  ]
72
- },
73
- {
74
- type: 'callGlobal',
75
- global: 'uetq',
76
- method: 'push',
77
- args: [
78
- 'consent',
79
- 'default',
80
- {
81
- ad_storage: 'granted'
82
- }
83
- ]
84
105
  }
85
106
  ],
86
107
  onConsentGranted: [