@c15t/scripts 2.0.0-rc.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/databuddy.cjs +103 -48
- package/dist/databuddy.js +99 -47
- package/dist/engine/compile.cjs +126 -0
- package/dist/engine/compile.js +89 -0
- package/dist/engine/runtime.cjs +379 -0
- package/dist/engine/runtime.js +345 -0
- package/dist/google-tag-manager.cjs +78 -86
- package/dist/google-tag-manager.js +74 -79
- package/dist/google-tag.cjs +86 -37
- package/dist/google-tag.js +82 -36
- package/dist/linkedin-insights.cjs +51 -33
- package/dist/linkedin-insights.js +46 -31
- package/dist/meta-pixel.cjs +90 -28
- package/dist/meta-pixel.js +86 -27
- package/dist/microsoft-uet.cjs +90 -50
- package/dist/microsoft-uet.js +86 -49
- package/dist/posthog.cjs +100 -51
- package/dist/posthog.js +96 -50
- package/dist/resolve.cjs +67 -0
- package/dist/resolve.js +33 -0
- package/dist/tiktok-pixel.cjs +91 -29
- package/dist/tiktok-pixel.js +86 -27
- package/dist/types.cjs +47 -0
- package/dist/types.js +7 -0
- package/dist/x-pixel.cjs +48 -14
- package/dist/x-pixel.js +43 -12
- package/dist-types/databuddy.d.ts +144 -0
- package/dist-types/engine/compile.d.ts +3 -0
- package/dist-types/engine/runtime.d.ts +3 -0
- package/dist-types/engine.test.d.ts +1 -0
- package/dist-types/google-tag-manager.d.ts +97 -0
- package/dist-types/google-tag.d.ts +96 -0
- package/dist-types/helpers.test.d.ts +1 -0
- package/dist-types/linkedin-insights.d.ts +79 -0
- package/{dist → dist-types}/meta-pixel.d.ts +61 -14
- package/dist-types/microsoft-uet.d.ts +94 -0
- package/dist-types/posthog.d.ts +112 -0
- package/dist-types/resolve.d.ts +9 -0
- package/dist-types/tiktok-pixel.d.ts +91 -0
- package/dist-types/types.d.ts +259 -0
- package/{dist → dist-types}/x-pixel.d.ts +38 -12
- package/package.json +9 -8
- package/dist/databuddy.d.ts +0 -104
- package/dist/databuddy.d.ts.map +0 -1
- package/dist/google-tag-manager.d.ts +0 -63
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag.d.ts +0 -38
- package/dist/google-tag.d.ts.map +0 -1
- package/dist/linkedin-insights.d.ts +0 -48
- package/dist/linkedin-insights.d.ts.map +0 -1
- package/dist/meta-pixel.d.ts.map +0 -1
- package/dist/microsoft-uet.d.ts +0 -40
- package/dist/microsoft-uet.d.ts.map +0 -1
- package/dist/posthog.d.ts +0 -54
- package/dist/posthog.d.ts.map +0 -1
- package/dist/tiktok-pixel.d.ts +0 -44
- package/dist/tiktok-pixel.d.ts.map +0 -1
- package/dist/x-pixel.d.ts.map +0 -1
package/dist/posthog.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -24,64 +24,113 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
posthogManifest: ()=>posthogManifest,
|
|
27
28
|
posthog: ()=>posthog
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
async: true,
|
|
43
|
-
attributes: {
|
|
44
|
-
crossorigin: 'anonymous',
|
|
45
|
-
'data-api-host': options.apiHost,
|
|
46
|
-
'data-ui-host': options.apiHost
|
|
47
|
-
},
|
|
48
|
-
alwaysLoad: true,
|
|
49
|
-
onBeforeLoad: (rest)=>{
|
|
50
|
-
if (!window.posthog) window.posthog = {
|
|
51
|
-
init: ()=>{},
|
|
52
|
-
opt_in_capturing: ()=>{},
|
|
53
|
-
opt_out_capturing: ()=>{},
|
|
54
|
-
get_explicit_consent_status: ()=>'pending'
|
|
55
|
-
};
|
|
56
|
-
script?.onBeforeLoad?.(rest);
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
32
|
+
const posthogManifest = {
|
|
33
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
|
+
vendor: 'posthog',
|
|
35
|
+
category: 'measurement',
|
|
36
|
+
alwaysLoad: true,
|
|
37
|
+
bootstrap: [
|
|
38
|
+
{
|
|
39
|
+
type: 'setGlobal',
|
|
40
|
+
name: 'posthog',
|
|
41
|
+
value: {},
|
|
42
|
+
ifUndefined: true
|
|
57
43
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
44
|
+
{
|
|
45
|
+
type: 'defineGlobalMethods',
|
|
46
|
+
target: 'posthog',
|
|
47
|
+
methods: [
|
|
48
|
+
{
|
|
49
|
+
name: 'init',
|
|
50
|
+
behavior: 'noop'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'opt_in_capturing',
|
|
54
|
+
behavior: 'noop'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'opt_out_capturing',
|
|
58
|
+
behavior: 'noop'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'get_explicit_consent_status',
|
|
62
|
+
behavior: 'return',
|
|
63
|
+
value: 'pending'
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
install: [
|
|
69
|
+
{
|
|
70
|
+
type: 'loadScript',
|
|
71
|
+
src: "{{scriptUrl}}",
|
|
72
|
+
async: true,
|
|
73
|
+
attributes: {
|
|
74
|
+
crossorigin: 'anonymous',
|
|
75
|
+
'data-api-host': '{{apiHost}}',
|
|
76
|
+
'data-ui-host': '{{apiHost}}'
|
|
67
77
|
}
|
|
68
|
-
script?.onLoad?.({
|
|
69
|
-
hasConsent,
|
|
70
|
-
...rest
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
onConsentChange: ({ hasConsent, ...rest })=>{
|
|
74
|
-
handleConsentOpt(hasConsent);
|
|
75
|
-
script?.onConsentChange?.({
|
|
76
|
-
hasConsent,
|
|
77
|
-
...rest
|
|
78
|
-
});
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
],
|
|
80
|
+
afterLoad: [
|
|
81
|
+
{
|
|
82
|
+
type: 'callGlobal',
|
|
83
|
+
global: 'posthog',
|
|
84
|
+
method: 'init',
|
|
85
|
+
args: [
|
|
86
|
+
'{{id}}',
|
|
87
|
+
'{{initOptions}}'
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
onLoadGranted: [
|
|
92
|
+
{
|
|
93
|
+
type: 'callGlobal',
|
|
94
|
+
global: 'posthog',
|
|
95
|
+
method: 'opt_in_capturing'
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
onLoadDenied: [
|
|
99
|
+
{
|
|
100
|
+
type: 'callGlobal',
|
|
101
|
+
global: 'posthog',
|
|
102
|
+
method: 'opt_out_capturing'
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
onConsentGranted: [
|
|
106
|
+
{
|
|
107
|
+
type: 'callGlobal',
|
|
108
|
+
global: 'posthog',
|
|
109
|
+
method: 'opt_in_capturing'
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
onConsentDenied: [
|
|
113
|
+
{
|
|
114
|
+
type: 'callGlobal',
|
|
115
|
+
global: 'posthog',
|
|
116
|
+
method: 'opt_out_capturing'
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
};
|
|
120
|
+
function posthog(options) {
|
|
121
|
+
const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(posthogManifest, {
|
|
122
|
+
id: options.id,
|
|
123
|
+
apiHost: options.apiHost ?? 'https://eu.i.posthog.com',
|
|
124
|
+
scriptUrl: options.scriptUrl ?? 'https://eu-assets.i.posthog.com/static/array.js',
|
|
125
|
+
initOptions: options.initOptions ?? {}
|
|
126
|
+
});
|
|
127
|
+
return resolved;
|
|
81
128
|
}
|
|
82
129
|
exports.posthog = __webpack_exports__.posthog;
|
|
130
|
+
exports.posthogManifest = __webpack_exports__.posthogManifest;
|
|
83
131
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
84
|
-
"posthog"
|
|
132
|
+
"posthog",
|
|
133
|
+
"posthogManifest"
|
|
85
134
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
86
135
|
Object.defineProperty(exports, '__esModule', {
|
|
87
136
|
value: true
|
package/dist/posthog.js
CHANGED
|
@@ -1,54 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
async: true,
|
|
15
|
-
attributes: {
|
|
16
|
-
crossorigin: 'anonymous',
|
|
17
|
-
'data-api-host': options.apiHost,
|
|
18
|
-
'data-ui-host': options.apiHost
|
|
19
|
-
},
|
|
20
|
-
alwaysLoad: true,
|
|
21
|
-
onBeforeLoad: (rest)=>{
|
|
22
|
-
if (!window.posthog) window.posthog = {
|
|
23
|
-
init: ()=>{},
|
|
24
|
-
opt_in_capturing: ()=>{},
|
|
25
|
-
opt_out_capturing: ()=>{},
|
|
26
|
-
get_explicit_consent_status: ()=>'pending'
|
|
27
|
-
};
|
|
28
|
-
script?.onBeforeLoad?.(rest);
|
|
1
|
+
import { resolveManifest } from "./resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "./types.js";
|
|
3
|
+
const posthogManifest = {
|
|
4
|
+
...vendorManifestContract,
|
|
5
|
+
vendor: 'posthog',
|
|
6
|
+
category: 'measurement',
|
|
7
|
+
alwaysLoad: true,
|
|
8
|
+
bootstrap: [
|
|
9
|
+
{
|
|
10
|
+
type: 'setGlobal',
|
|
11
|
+
name: 'posthog',
|
|
12
|
+
value: {},
|
|
13
|
+
ifUndefined: true
|
|
29
14
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
15
|
+
{
|
|
16
|
+
type: 'defineGlobalMethods',
|
|
17
|
+
target: 'posthog',
|
|
18
|
+
methods: [
|
|
19
|
+
{
|
|
20
|
+
name: 'init',
|
|
21
|
+
behavior: 'noop'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'opt_in_capturing',
|
|
25
|
+
behavior: 'noop'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'opt_out_capturing',
|
|
29
|
+
behavior: 'noop'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'get_explicit_consent_status',
|
|
33
|
+
behavior: 'return',
|
|
34
|
+
value: 'pending'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
install: [
|
|
40
|
+
{
|
|
41
|
+
type: 'loadScript',
|
|
42
|
+
src: "{{scriptUrl}}",
|
|
43
|
+
async: true,
|
|
44
|
+
attributes: {
|
|
45
|
+
crossorigin: 'anonymous',
|
|
46
|
+
'data-api-host': '{{apiHost}}',
|
|
47
|
+
'data-ui-host': '{{apiHost}}'
|
|
39
48
|
}
|
|
40
|
-
script?.onLoad?.({
|
|
41
|
-
hasConsent,
|
|
42
|
-
...rest
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onConsentChange: ({ hasConsent, ...rest })=>{
|
|
46
|
-
handleConsentOpt(hasConsent);
|
|
47
|
-
script?.onConsentChange?.({
|
|
48
|
-
hasConsent,
|
|
49
|
-
...rest
|
|
50
|
-
});
|
|
51
49
|
}
|
|
52
|
-
|
|
50
|
+
],
|
|
51
|
+
afterLoad: [
|
|
52
|
+
{
|
|
53
|
+
type: 'callGlobal',
|
|
54
|
+
global: 'posthog',
|
|
55
|
+
method: 'init',
|
|
56
|
+
args: [
|
|
57
|
+
'{{id}}',
|
|
58
|
+
'{{initOptions}}'
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
onLoadGranted: [
|
|
63
|
+
{
|
|
64
|
+
type: 'callGlobal',
|
|
65
|
+
global: 'posthog',
|
|
66
|
+
method: 'opt_in_capturing'
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
onLoadDenied: [
|
|
70
|
+
{
|
|
71
|
+
type: 'callGlobal',
|
|
72
|
+
global: 'posthog',
|
|
73
|
+
method: 'opt_out_capturing'
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
onConsentGranted: [
|
|
77
|
+
{
|
|
78
|
+
type: 'callGlobal',
|
|
79
|
+
global: 'posthog',
|
|
80
|
+
method: 'opt_in_capturing'
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
onConsentDenied: [
|
|
84
|
+
{
|
|
85
|
+
type: 'callGlobal',
|
|
86
|
+
global: 'posthog',
|
|
87
|
+
method: 'opt_out_capturing'
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
function posthog(options) {
|
|
92
|
+
const resolved = resolveManifest(posthogManifest, {
|
|
93
|
+
id: options.id,
|
|
94
|
+
apiHost: options.apiHost ?? 'https://eu.i.posthog.com',
|
|
95
|
+
scriptUrl: options.scriptUrl ?? 'https://eu-assets.i.posthog.com/static/array.js',
|
|
96
|
+
initOptions: options.initOptions ?? {}
|
|
97
|
+
});
|
|
98
|
+
return resolved;
|
|
53
99
|
}
|
|
54
|
-
export { posthog };
|
|
100
|
+
export { posthog, posthogManifest };
|
package/dist/resolve.cjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
resolveManifest: ()=>resolveManifest
|
|
28
|
+
});
|
|
29
|
+
const compile_cjs_namespaceObject = require("./engine/compile.cjs");
|
|
30
|
+
const runtime_cjs_namespaceObject = require("./engine/runtime.cjs");
|
|
31
|
+
const manifestCache = new WeakMap();
|
|
32
|
+
function serializeConfigValue(value) {
|
|
33
|
+
if (void 0 === value) return 'undefined';
|
|
34
|
+
if (null === value) return 'null';
|
|
35
|
+
if (Array.isArray(value)) return `[${value.map((item)=>serializeConfigValue(item)).join(',')}]`;
|
|
36
|
+
if ('object' == typeof value) {
|
|
37
|
+
const entries = Object.entries(value).sort(([left], [right])=>left.localeCompare(right));
|
|
38
|
+
return `{${entries.map(([key, nestedValue])=>`${JSON.stringify(key)}:${serializeConfigValue(nestedValue)}`).join(',')}}`;
|
|
39
|
+
}
|
|
40
|
+
return `${typeof value}:${String(value)}`;
|
|
41
|
+
}
|
|
42
|
+
function getManifestCacheKey(config) {
|
|
43
|
+
return serializeConfigValue(config);
|
|
44
|
+
}
|
|
45
|
+
function getCompiledManifest(manifest, config) {
|
|
46
|
+
const cacheKey = getManifestCacheKey(config);
|
|
47
|
+
let configCache = manifestCache.get(manifest);
|
|
48
|
+
if (!configCache) {
|
|
49
|
+
configCache = new Map();
|
|
50
|
+
manifestCache.set(manifest, configCache);
|
|
51
|
+
}
|
|
52
|
+
const cached = configCache.get(cacheKey);
|
|
53
|
+
if (cached) return cached;
|
|
54
|
+
const compiled = (0, compile_cjs_namespaceObject.compileManifest)(manifest, config);
|
|
55
|
+
configCache.set(cacheKey, compiled);
|
|
56
|
+
return compiled;
|
|
57
|
+
}
|
|
58
|
+
function resolveManifest(manifest, config = {}) {
|
|
59
|
+
return (0, runtime_cjs_namespaceObject.resolvedManifestToScript)(getCompiledManifest(manifest, config));
|
|
60
|
+
}
|
|
61
|
+
exports.resolveManifest = __webpack_exports__.resolveManifest;
|
|
62
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
63
|
+
"resolveManifest"
|
|
64
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
65
|
+
Object.defineProperty(exports, '__esModule', {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { compileManifest } from "./engine/compile.js";
|
|
2
|
+
import { resolvedManifestToScript } from "./engine/runtime.js";
|
|
3
|
+
const manifestCache = new WeakMap();
|
|
4
|
+
function serializeConfigValue(value) {
|
|
5
|
+
if (void 0 === value) return 'undefined';
|
|
6
|
+
if (null === value) return 'null';
|
|
7
|
+
if (Array.isArray(value)) return `[${value.map((item)=>serializeConfigValue(item)).join(',')}]`;
|
|
8
|
+
if ('object' == typeof value) {
|
|
9
|
+
const entries = Object.entries(value).sort(([left], [right])=>left.localeCompare(right));
|
|
10
|
+
return `{${entries.map(([key, nestedValue])=>`${JSON.stringify(key)}:${serializeConfigValue(nestedValue)}`).join(',')}}`;
|
|
11
|
+
}
|
|
12
|
+
return `${typeof value}:${String(value)}`;
|
|
13
|
+
}
|
|
14
|
+
function getManifestCacheKey(config) {
|
|
15
|
+
return serializeConfigValue(config);
|
|
16
|
+
}
|
|
17
|
+
function getCompiledManifest(manifest, config) {
|
|
18
|
+
const cacheKey = getManifestCacheKey(config);
|
|
19
|
+
let configCache = manifestCache.get(manifest);
|
|
20
|
+
if (!configCache) {
|
|
21
|
+
configCache = new Map();
|
|
22
|
+
manifestCache.set(manifest, configCache);
|
|
23
|
+
}
|
|
24
|
+
const cached = configCache.get(cacheKey);
|
|
25
|
+
if (cached) return cached;
|
|
26
|
+
const compiled = compileManifest(manifest, config);
|
|
27
|
+
configCache.set(cacheKey, compiled);
|
|
28
|
+
return compiled;
|
|
29
|
+
}
|
|
30
|
+
function resolveManifest(manifest, config = {}) {
|
|
31
|
+
return resolvedManifestToScript(getCompiledManifest(manifest, config));
|
|
32
|
+
}
|
|
33
|
+
export { resolveManifest };
|
package/dist/tiktok-pixel.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -24,40 +24,102 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
tiktokPixel: ()=>tiktokPixel
|
|
27
|
+
tiktokPixel: ()=>tiktokPixel,
|
|
28
|
+
tiktokPixelManifest: ()=>tiktokPixelManifest
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}(window, document, 'ttq');
|
|
42
|
-
`.trim(),
|
|
43
|
-
persistAfterConsentRevoked: true,
|
|
44
|
-
onLoad: (rest)=>{
|
|
45
|
-
window.ttq.grantConsent();
|
|
46
|
-
if (script?.onLoad) script.onLoad(rest);
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
32
|
+
const tiktokPixelManifest = {
|
|
33
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
|
+
vendor: 'tiktok-pixel',
|
|
35
|
+
category: 'marketing',
|
|
36
|
+
persistAfterConsentRevoked: true,
|
|
37
|
+
bootstrap: [
|
|
38
|
+
{
|
|
39
|
+
type: 'setGlobal',
|
|
40
|
+
name: 'TiktokAnalyticsObject',
|
|
41
|
+
value: 'ttq'
|
|
47
42
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
{
|
|
44
|
+
type: 'setGlobal',
|
|
45
|
+
name: 'ttq',
|
|
46
|
+
value: [],
|
|
47
|
+
ifUndefined: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: 'defineQueueMethods',
|
|
51
|
+
target: 'ttq',
|
|
52
|
+
methods: [
|
|
53
|
+
'page',
|
|
54
|
+
'track',
|
|
55
|
+
'identify',
|
|
56
|
+
'instances',
|
|
57
|
+
'debug',
|
|
58
|
+
'on',
|
|
59
|
+
'off',
|
|
60
|
+
'once',
|
|
61
|
+
'ready',
|
|
62
|
+
'alias',
|
|
63
|
+
'group',
|
|
64
|
+
'enableCookie',
|
|
65
|
+
'disableCookie',
|
|
66
|
+
'holdConsent',
|
|
67
|
+
'revokeConsent',
|
|
68
|
+
'grantConsent'
|
|
69
|
+
]
|
|
55
70
|
}
|
|
56
|
-
|
|
71
|
+
],
|
|
72
|
+
install: [
|
|
73
|
+
{
|
|
74
|
+
type: 'callGlobal',
|
|
75
|
+
global: 'ttq',
|
|
76
|
+
method: 'grantConsent'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'callGlobal',
|
|
80
|
+
global: 'ttq',
|
|
81
|
+
method: 'page'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'loadScript',
|
|
85
|
+
src: "{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq",
|
|
86
|
+
async: true
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
afterLoad: [
|
|
90
|
+
{
|
|
91
|
+
type: 'callGlobal',
|
|
92
|
+
global: 'ttq',
|
|
93
|
+
method: 'grantConsent'
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
onConsentGranted: [
|
|
97
|
+
{
|
|
98
|
+
type: 'callGlobal',
|
|
99
|
+
global: 'ttq',
|
|
100
|
+
method: 'grantConsent'
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
onConsentDenied: [
|
|
104
|
+
{
|
|
105
|
+
type: 'callGlobal',
|
|
106
|
+
global: 'ttq',
|
|
107
|
+
method: 'revokeConsent'
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
};
|
|
111
|
+
function tiktokPixel({ pixelId, scriptSrc }) {
|
|
112
|
+
const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(tiktokPixelManifest, {
|
|
113
|
+
pixelId,
|
|
114
|
+
scriptSrc: scriptSrc ?? 'https://analytics.tiktok.com/i18n/pixel/events.js'
|
|
115
|
+
});
|
|
116
|
+
return resolved;
|
|
57
117
|
}
|
|
58
118
|
exports.tiktokPixel = __webpack_exports__.tiktokPixel;
|
|
119
|
+
exports.tiktokPixelManifest = __webpack_exports__.tiktokPixelManifest;
|
|
59
120
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
60
|
-
"tiktokPixel"
|
|
121
|
+
"tiktokPixel",
|
|
122
|
+
"tiktokPixelManifest"
|
|
61
123
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
62
124
|
Object.defineProperty(exports, '__esModule', {
|
|
63
125
|
value: true
|