@c15t/scripts 2.0.1 → 2.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.
- package/README.md +9 -9
- package/dist/engine/runtime.cjs +11 -0
- package/dist/engine/runtime.js +11 -0
- package/dist/registry.cjs +338 -0
- package/dist/registry.js +292 -0
- package/dist/types.cjs +18 -0
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +51 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +64 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +55 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +74 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +2 -2
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +202 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +31 -14
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +147 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +127 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +2 -2
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +6 -3
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/ahrefs-analytics.cjs +64 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +69 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +3 -3
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +72 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +7 -28
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/hotjar.cjs +81 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +228 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +110 -0
- package/dist/vendors/analytics/microsoft-clarity.js +73 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +119 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +82 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +118 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/{posthog.cjs → vendors/analytics/posthog.cjs} +69 -6
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +66 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +100 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +93 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +76 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +90 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +139 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +85 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +6 -27
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +368 -0
- package/dist-types/types.d.ts +13 -0
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/{linkedin-insights.d.ts → vendors/ads-and-pixels/linkedin-insights.d.ts} +22 -9
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +21 -10
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +20 -5
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +21 -4
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +5 -8
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +86 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +101 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/{posthog.d.ts → vendors/analytics/posthog.d.ts} +47 -5
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +5 -8
- package/package.json +165 -4
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.js +0 -100
- package/dist-types/meta-pixel.d.ts +0 -185
- /package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
function buildPlausibleScriptUrl(options) {
|
|
4
|
+
if (options.scriptId) return `https://plausible.io/js/pa-${options.scriptId}.js`;
|
|
5
|
+
if (options.extension) {
|
|
6
|
+
let extensions;
|
|
7
|
+
extensions = Array.isArray(options.extension) ? options.extension.join('.') : options.extension;
|
|
8
|
+
return `https://plausible.io/js/script.${extensions}.js`;
|
|
9
|
+
}
|
|
10
|
+
return "https://plausible.io/js/script.js";
|
|
11
|
+
}
|
|
12
|
+
function buildPlausibleInitOptions(options) {
|
|
13
|
+
const initOptions = {};
|
|
14
|
+
if (options.customProperties) initOptions.customProperties = options.customProperties;
|
|
15
|
+
if (options.endpoint) initOptions.endpoint = options.endpoint;
|
|
16
|
+
if (options.fileDownloads) initOptions.fileDownloads = options.fileDownloads;
|
|
17
|
+
if (void 0 !== options.hashBasedRouting) initOptions.hashBasedRouting = options.hashBasedRouting;
|
|
18
|
+
if (void 0 !== options.autoCapturePageviews) initOptions.autoCapturePageviews = options.autoCapturePageviews;
|
|
19
|
+
if (void 0 !== options.captureOnLocalhost) initOptions.captureOnLocalhost = options.captureOnLocalhost;
|
|
20
|
+
return initOptions;
|
|
21
|
+
}
|
|
22
|
+
const plausibleAnalyticsManifest = {
|
|
23
|
+
...vendorManifestContract,
|
|
24
|
+
vendor: 'plausible-analytics',
|
|
25
|
+
category: 'measurement',
|
|
26
|
+
bootstrap: [
|
|
27
|
+
{
|
|
28
|
+
type: 'defineStubFunction',
|
|
29
|
+
name: 'plausible',
|
|
30
|
+
queue: {
|
|
31
|
+
property: 'q'
|
|
32
|
+
},
|
|
33
|
+
queueFormat: 'array',
|
|
34
|
+
properties: {
|
|
35
|
+
o: '{{initOptions}}'
|
|
36
|
+
},
|
|
37
|
+
ifUndefined: true
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
install: [
|
|
41
|
+
{
|
|
42
|
+
type: 'loadScript',
|
|
43
|
+
src: "{{scriptUrl}}",
|
|
44
|
+
defer: true,
|
|
45
|
+
attributes: {
|
|
46
|
+
'data-domain': '{{domain}}',
|
|
47
|
+
'data-api': '{{apiAttribute}}'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
function plausibleAnalytics(options) {
|
|
53
|
+
let scriptId;
|
|
54
|
+
if (options.scriptId) scriptId = options.scriptId.trim();
|
|
55
|
+
let domain;
|
|
56
|
+
if (options.domain) domain = options.domain.trim();
|
|
57
|
+
if (!scriptId && !domain) throw new Error("plausibleAnalytics: missing scriptId or domain");
|
|
58
|
+
const normalizedOptions = {
|
|
59
|
+
...options
|
|
60
|
+
};
|
|
61
|
+
if (scriptId) normalizedOptions.scriptId = scriptId;
|
|
62
|
+
else delete normalizedOptions.scriptId;
|
|
63
|
+
if (domain) normalizedOptions.domain = domain;
|
|
64
|
+
else delete normalizedOptions.domain;
|
|
65
|
+
const manifestOptions = {
|
|
66
|
+
scriptUrl: normalizedOptions.scriptUrl ?? buildPlausibleScriptUrl(normalizedOptions),
|
|
67
|
+
domain: void 0,
|
|
68
|
+
apiAttribute: void 0,
|
|
69
|
+
initOptions: buildPlausibleInitOptions(normalizedOptions)
|
|
70
|
+
};
|
|
71
|
+
if (scriptId) {
|
|
72
|
+
manifestOptions.domain = void 0;
|
|
73
|
+
manifestOptions.apiAttribute = void 0;
|
|
74
|
+
} else {
|
|
75
|
+
manifestOptions.domain = domain;
|
|
76
|
+
manifestOptions.apiAttribute = normalizedOptions.endpoint;
|
|
77
|
+
}
|
|
78
|
+
const resolved = resolveManifest(plausibleAnalyticsManifest, manifestOptions);
|
|
79
|
+
return resolved;
|
|
80
|
+
}
|
|
81
|
+
export { plausibleAnalytics, plausibleAnalyticsManifest };
|
|
@@ -27,8 +27,53 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
posthogManifest: ()=>posthogManifest,
|
|
28
28
|
posthog: ()=>posthog
|
|
29
29
|
});
|
|
30
|
-
const external_resolve_cjs_namespaceObject = require("
|
|
31
|
-
const external_types_cjs_namespaceObject = require("
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
33
|
+
const DEFAULT_API_HOST = 'https://eu.i.posthog.com';
|
|
34
|
+
const DEFAULT_SCRIPT_URL = 'https://eu-assets.i.posthog.com/static/array.js';
|
|
35
|
+
const DEFAULT_UI_HOST = 'https://eu.posthog.com';
|
|
36
|
+
const DEFAULTS_DATE = '2026-01-30';
|
|
37
|
+
const REGION_HOSTS = {
|
|
38
|
+
eu: {
|
|
39
|
+
apiHost: DEFAULT_API_HOST,
|
|
40
|
+
uiHost: DEFAULT_UI_HOST,
|
|
41
|
+
scriptUrl: DEFAULT_SCRIPT_URL
|
|
42
|
+
},
|
|
43
|
+
us: {
|
|
44
|
+
apiHost: 'https://us.i.posthog.com',
|
|
45
|
+
uiHost: 'https://us.posthog.com',
|
|
46
|
+
scriptUrl: 'https://us-assets.i.posthog.com/static/array.js'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function normalizeHost(host) {
|
|
50
|
+
return (0, script_url_cjs_namespaceObject.stripTrailingSlashes)(host);
|
|
51
|
+
}
|
|
52
|
+
function regionFromHost(host) {
|
|
53
|
+
const normalized = normalizeHost(host);
|
|
54
|
+
if (/^https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com$/i.test(normalized)) return 'us';
|
|
55
|
+
if (/^https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com$/i.test(normalized)) return 'eu';
|
|
56
|
+
}
|
|
57
|
+
function deriveScriptUrlFromApiHost(apiHost) {
|
|
58
|
+
const normalized = normalizeHost(apiHost);
|
|
59
|
+
const region = regionFromHost(normalized);
|
|
60
|
+
if (region) return REGION_HOSTS[region].scriptUrl;
|
|
61
|
+
return `${normalized}/static/array.js`;
|
|
62
|
+
}
|
|
63
|
+
function resolvePosthogHosts(options) {
|
|
64
|
+
const regionDefaults = REGION_HOSTS[options.region ?? 'eu'];
|
|
65
|
+
const apiHost = normalizeHost(options.apiHost ?? regionDefaults.apiHost);
|
|
66
|
+
const inferredRegion = regionFromHost(apiHost);
|
|
67
|
+
let uiHost;
|
|
68
|
+
uiHost = void 0 !== options.uiHost ? options.uiHost : inferredRegion ? REGION_HOSTS[inferredRegion].uiHost : void 0 !== options.region ? REGION_HOSTS[options.region].uiHost : apiHost;
|
|
69
|
+
let scriptUrl;
|
|
70
|
+
scriptUrl = void 0 !== options.scriptUrl ? options.scriptUrl : void 0 !== options.apiHost ? deriveScriptUrlFromApiHost(apiHost) : regionDefaults.scriptUrl;
|
|
71
|
+
return {
|
|
72
|
+
apiHost,
|
|
73
|
+
uiHost: normalizeHost(uiHost),
|
|
74
|
+
scriptUrl
|
|
75
|
+
};
|
|
76
|
+
}
|
|
32
77
|
const posthogManifest = {
|
|
33
78
|
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
79
|
vendor: 'posthog',
|
|
@@ -49,6 +94,10 @@ const posthogManifest = {
|
|
|
49
94
|
name: 'init',
|
|
50
95
|
behavior: 'noop'
|
|
51
96
|
},
|
|
97
|
+
{
|
|
98
|
+
name: 'capture',
|
|
99
|
+
behavior: 'noop'
|
|
100
|
+
},
|
|
52
101
|
{
|
|
53
102
|
name: 'opt_in_capturing',
|
|
54
103
|
behavior: 'noop'
|
|
@@ -73,7 +122,7 @@ const posthogManifest = {
|
|
|
73
122
|
attributes: {
|
|
74
123
|
crossorigin: 'anonymous',
|
|
75
124
|
'data-api-host': '{{apiHost}}',
|
|
76
|
-
'data-ui-host': '{{
|
|
125
|
+
'data-ui-host': '{{uiHost}}'
|
|
77
126
|
}
|
|
78
127
|
}
|
|
79
128
|
],
|
|
@@ -118,12 +167,26 @@ const posthogManifest = {
|
|
|
118
167
|
]
|
|
119
168
|
};
|
|
120
169
|
function posthog(options) {
|
|
170
|
+
if ('disabled' === options.loadMode) return {
|
|
171
|
+
id: 'posthog',
|
|
172
|
+
category: 'measurement',
|
|
173
|
+
callbackOnly: true
|
|
174
|
+
};
|
|
175
|
+
const { apiHost, uiHost, scriptUrl } = resolvePosthogHosts(options);
|
|
121
176
|
const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(posthogManifest, {
|
|
122
177
|
id: options.id,
|
|
123
|
-
apiHost
|
|
124
|
-
|
|
125
|
-
|
|
178
|
+
apiHost,
|
|
179
|
+
uiHost,
|
|
180
|
+
scriptUrl,
|
|
181
|
+
initOptions: {
|
|
182
|
+
defaults: DEFAULTS_DATE,
|
|
183
|
+
cookieless_mode: 'on_reject',
|
|
184
|
+
...options.initOptions,
|
|
185
|
+
api_host: apiHost,
|
|
186
|
+
ui_host: uiHost
|
|
187
|
+
}
|
|
126
188
|
});
|
|
189
|
+
if ('after-consent' === options.loadMode) resolved.alwaysLoad = void 0;
|
|
127
190
|
return resolved;
|
|
128
191
|
}
|
|
129
192
|
exports.posthog = __webpack_exports__.posthog;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
import { stripTrailingSlashes } from "../_shared/script-url.js";
|
|
4
|
+
const DEFAULT_API_HOST = 'https://eu.i.posthog.com';
|
|
5
|
+
const DEFAULT_SCRIPT_URL = 'https://eu-assets.i.posthog.com/static/array.js';
|
|
6
|
+
const DEFAULT_UI_HOST = 'https://eu.posthog.com';
|
|
7
|
+
const DEFAULTS_DATE = '2026-01-30';
|
|
8
|
+
const REGION_HOSTS = {
|
|
9
|
+
eu: {
|
|
10
|
+
apiHost: DEFAULT_API_HOST,
|
|
11
|
+
uiHost: DEFAULT_UI_HOST,
|
|
12
|
+
scriptUrl: DEFAULT_SCRIPT_URL
|
|
13
|
+
},
|
|
14
|
+
us: {
|
|
15
|
+
apiHost: 'https://us.i.posthog.com',
|
|
16
|
+
uiHost: 'https://us.posthog.com',
|
|
17
|
+
scriptUrl: 'https://us-assets.i.posthog.com/static/array.js'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function normalizeHost(host) {
|
|
21
|
+
return stripTrailingSlashes(host);
|
|
22
|
+
}
|
|
23
|
+
function regionFromHost(host) {
|
|
24
|
+
const normalized = normalizeHost(host);
|
|
25
|
+
if (/^https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com$/i.test(normalized)) return 'us';
|
|
26
|
+
if (/^https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com$/i.test(normalized)) return 'eu';
|
|
27
|
+
}
|
|
28
|
+
function deriveScriptUrlFromApiHost(apiHost) {
|
|
29
|
+
const normalized = normalizeHost(apiHost);
|
|
30
|
+
const region = regionFromHost(normalized);
|
|
31
|
+
if (region) return REGION_HOSTS[region].scriptUrl;
|
|
32
|
+
return `${normalized}/static/array.js`;
|
|
33
|
+
}
|
|
34
|
+
function resolvePosthogHosts(options) {
|
|
35
|
+
const regionDefaults = REGION_HOSTS[options.region ?? 'eu'];
|
|
36
|
+
const apiHost = normalizeHost(options.apiHost ?? regionDefaults.apiHost);
|
|
37
|
+
const inferredRegion = regionFromHost(apiHost);
|
|
38
|
+
let uiHost;
|
|
39
|
+
uiHost = void 0 !== options.uiHost ? options.uiHost : inferredRegion ? REGION_HOSTS[inferredRegion].uiHost : void 0 !== options.region ? REGION_HOSTS[options.region].uiHost : apiHost;
|
|
40
|
+
let scriptUrl;
|
|
41
|
+
scriptUrl = void 0 !== options.scriptUrl ? options.scriptUrl : void 0 !== options.apiHost ? deriveScriptUrlFromApiHost(apiHost) : regionDefaults.scriptUrl;
|
|
42
|
+
return {
|
|
43
|
+
apiHost,
|
|
44
|
+
uiHost: normalizeHost(uiHost),
|
|
45
|
+
scriptUrl
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const posthogManifest = {
|
|
49
|
+
...vendorManifestContract,
|
|
50
|
+
vendor: 'posthog',
|
|
51
|
+
category: 'measurement',
|
|
52
|
+
alwaysLoad: true,
|
|
53
|
+
bootstrap: [
|
|
54
|
+
{
|
|
55
|
+
type: 'setGlobal',
|
|
56
|
+
name: 'posthog',
|
|
57
|
+
value: {},
|
|
58
|
+
ifUndefined: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'defineGlobalMethods',
|
|
62
|
+
target: 'posthog',
|
|
63
|
+
methods: [
|
|
64
|
+
{
|
|
65
|
+
name: 'init',
|
|
66
|
+
behavior: 'noop'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'capture',
|
|
70
|
+
behavior: 'noop'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'opt_in_capturing',
|
|
74
|
+
behavior: 'noop'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'opt_out_capturing',
|
|
78
|
+
behavior: 'noop'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'get_explicit_consent_status',
|
|
82
|
+
behavior: 'return',
|
|
83
|
+
value: 'pending'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
install: [
|
|
89
|
+
{
|
|
90
|
+
type: 'loadScript',
|
|
91
|
+
src: "{{scriptUrl}}",
|
|
92
|
+
async: true,
|
|
93
|
+
attributes: {
|
|
94
|
+
crossorigin: 'anonymous',
|
|
95
|
+
'data-api-host': '{{apiHost}}',
|
|
96
|
+
'data-ui-host': '{{uiHost}}'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
afterLoad: [
|
|
101
|
+
{
|
|
102
|
+
type: 'callGlobal',
|
|
103
|
+
global: 'posthog',
|
|
104
|
+
method: 'init',
|
|
105
|
+
args: [
|
|
106
|
+
'{{id}}',
|
|
107
|
+
'{{initOptions}}'
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
onLoadGranted: [
|
|
112
|
+
{
|
|
113
|
+
type: 'callGlobal',
|
|
114
|
+
global: 'posthog',
|
|
115
|
+
method: 'opt_in_capturing'
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
onLoadDenied: [
|
|
119
|
+
{
|
|
120
|
+
type: 'callGlobal',
|
|
121
|
+
global: 'posthog',
|
|
122
|
+
method: 'opt_out_capturing'
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
onConsentGranted: [
|
|
126
|
+
{
|
|
127
|
+
type: 'callGlobal',
|
|
128
|
+
global: 'posthog',
|
|
129
|
+
method: 'opt_in_capturing'
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
onConsentDenied: [
|
|
133
|
+
{
|
|
134
|
+
type: 'callGlobal',
|
|
135
|
+
global: 'posthog',
|
|
136
|
+
method: 'opt_out_capturing'
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
};
|
|
140
|
+
function posthog(options) {
|
|
141
|
+
if ('disabled' === options.loadMode) return {
|
|
142
|
+
id: 'posthog',
|
|
143
|
+
category: 'measurement',
|
|
144
|
+
callbackOnly: true
|
|
145
|
+
};
|
|
146
|
+
const { apiHost, uiHost, scriptUrl } = resolvePosthogHosts(options);
|
|
147
|
+
const resolved = resolveManifest(posthogManifest, {
|
|
148
|
+
id: options.id,
|
|
149
|
+
apiHost,
|
|
150
|
+
uiHost,
|
|
151
|
+
scriptUrl,
|
|
152
|
+
initOptions: {
|
|
153
|
+
defaults: DEFAULTS_DATE,
|
|
154
|
+
cookieless_mode: 'on_reject',
|
|
155
|
+
...options.initOptions,
|
|
156
|
+
api_host: apiHost,
|
|
157
|
+
ui_host: uiHost
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
if ('after-consent' === options.loadMode) resolved.alwaysLoad = void 0;
|
|
161
|
+
return resolved;
|
|
162
|
+
}
|
|
163
|
+
export { posthog, posthogManifest };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
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
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
promptwatchManifest: ()=>promptwatchManifest,
|
|
28
|
+
promptwatch: ()=>promptwatch
|
|
29
|
+
});
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
33
|
+
const promptwatchManifest = {
|
|
34
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
35
|
+
vendor: 'promptwatch',
|
|
36
|
+
category: 'measurement',
|
|
37
|
+
install: [
|
|
38
|
+
{
|
|
39
|
+
type: 'loadScript',
|
|
40
|
+
src: "{{scriptUrl}}",
|
|
41
|
+
async: true,
|
|
42
|
+
attributes: {
|
|
43
|
+
'data-project-id': '{{projectId}}'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
function promptwatch({ projectId, scriptUrl }) {
|
|
49
|
+
const normalizedProjectId = projectId.trim();
|
|
50
|
+
if (0 === normalizedProjectId.length) throw new Error('promptwatch: invalid projectId - must be a non-empty string');
|
|
51
|
+
const defaultScriptUrl = 'https://ingest.promptwatch.com/js/client.min.js';
|
|
52
|
+
const normalizedScriptUrl = (0, script_url_cjs_namespaceObject.resolveScriptUrl)((0, script_url_cjs_namespaceObject.trimToUndefined)(scriptUrl), defaultScriptUrl);
|
|
53
|
+
return (0, external_resolve_cjs_namespaceObject.resolveManifest)(promptwatchManifest, {
|
|
54
|
+
projectId: normalizedProjectId,
|
|
55
|
+
scriptUrl: normalizedScriptUrl
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.promptwatch = __webpack_exports__.promptwatch;
|
|
59
|
+
exports.promptwatchManifest = __webpack_exports__.promptwatchManifest;
|
|
60
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
+
"promptwatch",
|
|
62
|
+
"promptwatchManifest"
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
|
|
4
|
+
const promptwatchManifest = {
|
|
5
|
+
...vendorManifestContract,
|
|
6
|
+
vendor: 'promptwatch',
|
|
7
|
+
category: 'measurement',
|
|
8
|
+
install: [
|
|
9
|
+
{
|
|
10
|
+
type: 'loadScript',
|
|
11
|
+
src: "{{scriptUrl}}",
|
|
12
|
+
async: true,
|
|
13
|
+
attributes: {
|
|
14
|
+
'data-project-id': '{{projectId}}'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
function promptwatch({ projectId, scriptUrl }) {
|
|
20
|
+
const normalizedProjectId = projectId.trim();
|
|
21
|
+
if (0 === normalizedProjectId.length) throw new Error('promptwatch: invalid projectId - must be a non-empty string');
|
|
22
|
+
const defaultScriptUrl = 'https://ingest.promptwatch.com/js/client.min.js';
|
|
23
|
+
const normalizedScriptUrl = resolveScriptUrl(trimToUndefined(scriptUrl), defaultScriptUrl);
|
|
24
|
+
return resolveManifest(promptwatchManifest, {
|
|
25
|
+
projectId: normalizedProjectId,
|
|
26
|
+
scriptUrl: normalizedScriptUrl
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { promptwatch, promptwatchManifest };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
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
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
rybbitAnalytics: ()=>rybbitAnalytics,
|
|
28
|
+
rybbitAnalyticsManifest: ()=>rybbitAnalyticsManifest
|
|
29
|
+
});
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
|
+
const attributes_cjs_namespaceObject = require("../_shared/attributes.cjs");
|
|
33
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
34
|
+
const rybbitAnalyticsManifest = {
|
|
35
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
36
|
+
vendor: 'rybbit-analytics',
|
|
37
|
+
category: 'measurement',
|
|
38
|
+
install: [
|
|
39
|
+
{
|
|
40
|
+
type: 'loadScript',
|
|
41
|
+
src: "{{scriptUrl}}",
|
|
42
|
+
defer: true,
|
|
43
|
+
attributes: {
|
|
44
|
+
'data-site-id': '{{siteId}}',
|
|
45
|
+
'data-auto-track-pageview': '{{autoTrackPageview}}',
|
|
46
|
+
'data-track-spa': '{{trackSpa}}',
|
|
47
|
+
'data-track-query': '{{trackQuery}}',
|
|
48
|
+
'data-track-outbound': '{{trackOutbound}}',
|
|
49
|
+
'data-track-errors': '{{trackErrors}}',
|
|
50
|
+
'data-session-replay': '{{sessionReplay}}',
|
|
51
|
+
'data-web-vitals': '{{webVitals}}',
|
|
52
|
+
'data-skip-patterns': '{{skipPatterns}}',
|
|
53
|
+
'data-mask-patterns': '{{maskPatterns}}',
|
|
54
|
+
'data-debounce': '{{debounce}}',
|
|
55
|
+
'data-api-key': '{{apiKey}}'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
function getRybbitScriptUrl(options) {
|
|
61
|
+
const url = options.scriptUrl?.trim();
|
|
62
|
+
if (url && url.length > 0) return url;
|
|
63
|
+
if (options.analyticsHost) return (0, script_url_cjs_namespaceObject.joinUrlPath)(options.analyticsHost, "script.js");
|
|
64
|
+
return "https://app.rybbit.io/api/script.js";
|
|
65
|
+
}
|
|
66
|
+
function rybbitAnalytics(options) {
|
|
67
|
+
let siteId;
|
|
68
|
+
siteId = void 0 === options.siteId || null === options.siteId ? '' : String(options.siteId).trim();
|
|
69
|
+
if (0 === siteId.length) throw new Error('rybbitAnalytics: missing siteId');
|
|
70
|
+
let debounce;
|
|
71
|
+
if (void 0 !== options.debounce) debounce = String(options.debounce);
|
|
72
|
+
let skipPatterns;
|
|
73
|
+
if (options.skipPatterns) skipPatterns = JSON.stringify(options.skipPatterns);
|
|
74
|
+
let maskPatterns;
|
|
75
|
+
if (options.maskPatterns) maskPatterns = JSON.stringify(options.maskPatterns);
|
|
76
|
+
return (0, external_resolve_cjs_namespaceObject.resolveManifest)(rybbitAnalyticsManifest, {
|
|
77
|
+
scriptUrl: getRybbitScriptUrl(options),
|
|
78
|
+
siteId,
|
|
79
|
+
autoTrackPageview: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.autoTrackPageview),
|
|
80
|
+
trackSpa: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.trackSpa),
|
|
81
|
+
trackQuery: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.trackQuery),
|
|
82
|
+
trackOutbound: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.trackOutbound),
|
|
83
|
+
trackErrors: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.trackErrors),
|
|
84
|
+
sessionReplay: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.sessionReplay),
|
|
85
|
+
webVitals: (0, attributes_cjs_namespaceObject.booleanDataAttribute)(options.webVitals),
|
|
86
|
+
skipPatterns,
|
|
87
|
+
maskPatterns,
|
|
88
|
+
debounce,
|
|
89
|
+
apiKey: options.apiKey
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
exports.rybbitAnalytics = __webpack_exports__.rybbitAnalytics;
|
|
93
|
+
exports.rybbitAnalyticsManifest = __webpack_exports__.rybbitAnalyticsManifest;
|
|
94
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
95
|
+
"rybbitAnalytics",
|
|
96
|
+
"rybbitAnalyticsManifest"
|
|
97
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
98
|
+
Object.defineProperty(exports, '__esModule', {
|
|
99
|
+
value: true
|
|
100
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
|
+
import { booleanDataAttribute } from "../_shared/attributes.js";
|
|
4
|
+
import { joinUrlPath } from "../_shared/script-url.js";
|
|
5
|
+
const rybbitAnalyticsManifest = {
|
|
6
|
+
...vendorManifestContract,
|
|
7
|
+
vendor: 'rybbit-analytics',
|
|
8
|
+
category: 'measurement',
|
|
9
|
+
install: [
|
|
10
|
+
{
|
|
11
|
+
type: 'loadScript',
|
|
12
|
+
src: "{{scriptUrl}}",
|
|
13
|
+
defer: true,
|
|
14
|
+
attributes: {
|
|
15
|
+
'data-site-id': '{{siteId}}',
|
|
16
|
+
'data-auto-track-pageview': '{{autoTrackPageview}}',
|
|
17
|
+
'data-track-spa': '{{trackSpa}}',
|
|
18
|
+
'data-track-query': '{{trackQuery}}',
|
|
19
|
+
'data-track-outbound': '{{trackOutbound}}',
|
|
20
|
+
'data-track-errors': '{{trackErrors}}',
|
|
21
|
+
'data-session-replay': '{{sessionReplay}}',
|
|
22
|
+
'data-web-vitals': '{{webVitals}}',
|
|
23
|
+
'data-skip-patterns': '{{skipPatterns}}',
|
|
24
|
+
'data-mask-patterns': '{{maskPatterns}}',
|
|
25
|
+
'data-debounce': '{{debounce}}',
|
|
26
|
+
'data-api-key': '{{apiKey}}'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
function getRybbitScriptUrl(options) {
|
|
32
|
+
const url = options.scriptUrl?.trim();
|
|
33
|
+
if (url && url.length > 0) return url;
|
|
34
|
+
if (options.analyticsHost) return joinUrlPath(options.analyticsHost, "script.js");
|
|
35
|
+
return "https://app.rybbit.io/api/script.js";
|
|
36
|
+
}
|
|
37
|
+
function rybbitAnalytics(options) {
|
|
38
|
+
let siteId;
|
|
39
|
+
siteId = void 0 === options.siteId || null === options.siteId ? '' : String(options.siteId).trim();
|
|
40
|
+
if (0 === siteId.length) throw new Error('rybbitAnalytics: missing siteId');
|
|
41
|
+
let debounce;
|
|
42
|
+
if (void 0 !== options.debounce) debounce = String(options.debounce);
|
|
43
|
+
let skipPatterns;
|
|
44
|
+
if (options.skipPatterns) skipPatterns = JSON.stringify(options.skipPatterns);
|
|
45
|
+
let maskPatterns;
|
|
46
|
+
if (options.maskPatterns) maskPatterns = JSON.stringify(options.maskPatterns);
|
|
47
|
+
return resolveManifest(rybbitAnalyticsManifest, {
|
|
48
|
+
scriptUrl: getRybbitScriptUrl(options),
|
|
49
|
+
siteId,
|
|
50
|
+
autoTrackPageview: booleanDataAttribute(options.autoTrackPageview),
|
|
51
|
+
trackSpa: booleanDataAttribute(options.trackSpa),
|
|
52
|
+
trackQuery: booleanDataAttribute(options.trackQuery),
|
|
53
|
+
trackOutbound: booleanDataAttribute(options.trackOutbound),
|
|
54
|
+
trackErrors: booleanDataAttribute(options.trackErrors),
|
|
55
|
+
sessionReplay: booleanDataAttribute(options.sessionReplay),
|
|
56
|
+
webVitals: booleanDataAttribute(options.webVitals),
|
|
57
|
+
skipPatterns,
|
|
58
|
+
maskPatterns,
|
|
59
|
+
debounce,
|
|
60
|
+
apiKey: options.apiKey
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export { rybbitAnalytics, rybbitAnalyticsManifest };
|