@modernconsent/vendors 0.0.1 → 1.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 +138 -0
- package/dist/{abtasty-3G4JRT5W.js → abtasty-TXEYAILL.js} +9 -8
- package/dist/abtasty-TXEYAILL.js.map +1 -0
- package/dist/abtasty.js +25 -5
- package/dist/abtasty.js.map +1 -1
- package/dist/{amplitude-CFLVTHYV.js → amplitude-IGI75YH7.js} +9 -8
- package/dist/amplitude-IGI75YH7.js.map +1 -0
- package/dist/amplitude.js +25 -5
- package/dist/amplitude.js.map +1 -1
- package/dist/{chunk-6JXWYPMF.js → chunk-6B3YLQSK.js} +4 -4
- package/dist/chunk-6B3YLQSK.js.map +1 -0
- package/dist/chunk-DDAAVRWG.js +23 -0
- package/dist/chunk-DDAAVRWG.js.map +1 -0
- package/dist/{clarity-KJPNK3FJ.js → clarity-QBRU244I.js} +8 -7
- package/dist/clarity-QBRU244I.js.map +1 -0
- package/dist/clarity.js +25 -5
- package/dist/clarity.js.map +1 -1
- package/dist/{criteo-XKQPP2XY.js → criteo-2H2CRDXP.js} +9 -8
- package/dist/criteo-2H2CRDXP.js.map +1 -0
- package/dist/criteo.js +25 -5
- package/dist/criteo.js.map +1 -1
- package/dist/{gcmads-LKOHK6MW.js → gcmads-YVAENKKY.js} +7 -6
- package/dist/gcmads-YVAENKKY.js.map +1 -0
- package/dist/gcmads.js +24 -4
- package/dist/gcmads.js.map +1 -1
- package/dist/{google-analytics-SSTM7QMW.js → google-analytics-JOABQFPR.js} +12 -10
- package/dist/google-analytics-JOABQFPR.js.map +1 -0
- package/dist/google-analytics.js +28 -7
- package/dist/google-analytics.js.map +1 -1
- package/dist/{googleads-XPXUKIXQ.js → googleads-77QWCNY7.js} +10 -8
- package/dist/googleads-77QWCNY7.js.map +1 -0
- package/dist/googleads.js +26 -5
- package/dist/googleads.js.map +1 -1
- package/dist/{gtm-WFI6ABNK.js → gtm-JQJM45DJ.js} +9 -8
- package/dist/gtm-JQJM45DJ.js.map +1 -0
- package/dist/gtm.js +25 -5
- package/dist/gtm.js.map +1 -1
- package/dist/{hotjar-YCFHYSKB.js → hotjar-FP5JBVGV.js} +8 -7
- package/dist/hotjar-FP5JBVGV.js.map +1 -0
- package/dist/hotjar.js +25 -5
- package/dist/hotjar.js.map +1 -1
- package/dist/{hubspot-TLVPT4LG.js → hubspot-IRLKUIFW.js} +9 -8
- package/dist/hubspot-IRLKUIFW.js.map +1 -0
- package/dist/hubspot.js +25 -5
- package/dist/hubspot.js.map +1 -1
- package/dist/index.js +27 -26
- package/dist/index.js.map +1 -1
- package/dist/{intercom-4MUKJZOV.js → intercom-AFLW2SDL.js} +8 -7
- package/dist/intercom-AFLW2SDL.js.map +1 -0
- package/dist/intercom.js +25 -5
- package/dist/intercom.js.map +1 -1
- package/dist/{linkedin-insight-EH5OICV7.js → linkedin-insight-R27MCUAD.js} +8 -7
- package/dist/linkedin-insight-R27MCUAD.js.map +1 -0
- package/dist/linkedin-insight.js +25 -5
- package/dist/linkedin-insight.js.map +1 -1
- package/dist/{matomo-H4JJCYJR.js → matomo-K7PMMEER.js} +8 -7
- package/dist/matomo-K7PMMEER.js.map +1 -0
- package/dist/matomo.js +25 -5
- package/dist/matomo.js.map +1 -1
- package/dist/{meta-pixel-26NJ4GZJ.js → meta-pixel-ETCGZ67X.js} +9 -8
- package/dist/meta-pixel-ETCGZ67X.js.map +1 -0
- package/dist/meta-pixel.js +25 -5
- package/dist/meta-pixel.js.map +1 -1
- package/dist/{piano-analytics-CZXSQQNF.js → piano-analytics-PYW2KRXV.js} +9 -8
- package/dist/piano-analytics-PYW2KRXV.js.map +1 -0
- package/dist/piano-analytics.js +25 -5
- package/dist/piano-analytics.js.map +1 -1
- package/dist/{pinterest-pixel-B7J3RCSI.js → pinterest-pixel-ITU3VSVD.js} +9 -8
- package/dist/pinterest-pixel-ITU3VSVD.js.map +1 -0
- package/dist/pinterest-pixel.js +25 -5
- package/dist/pinterest-pixel.js.map +1 -1
- package/dist/{plausible-GI4L4SM4.js → plausible-MMSOZIIW.js} +11 -9
- package/dist/plausible-MMSOZIIW.js.map +1 -0
- package/dist/plausible.js +27 -6
- package/dist/plausible.js.map +1 -1
- package/dist/{posthog-N2HG7XOO.js → posthog-L7EXSFZC.js} +7 -6
- package/dist/posthog-L7EXSFZC.js.map +1 -0
- package/dist/posthog.js +24 -4
- package/dist/posthog.js.map +1 -1
- package/dist/{reddit-pixel-SKXRCFEF.js → reddit-pixel-L2VYBXVD.js} +9 -8
- package/dist/reddit-pixel-L2VYBXVD.js.map +1 -0
- package/dist/reddit-pixel.js +25 -5
- package/dist/reddit-pixel.js.map +1 -1
- package/dist/{segment-GZJFC57W.js → segment-UMYN3DMI.js} +8 -7
- package/dist/segment-UMYN3DMI.js.map +1 -0
- package/dist/segment.js +25 -5
- package/dist/segment.js.map +1 -1
- package/dist/{sentry-UIBASRVZ.js → sentry-OUDOP4LY.js} +11 -9
- package/dist/sentry-OUDOP4LY.js.map +1 -0
- package/dist/sentry.js +27 -6
- package/dist/sentry.js.map +1 -1
- package/dist/{smartsupp-I6XHQISS.js → smartsupp-6BE5XS4D.js} +8 -7
- package/dist/smartsupp-6BE5XS4D.js.map +1 -0
- package/dist/smartsupp.js +25 -5
- package/dist/smartsupp.js.map +1 -1
- package/dist/{snapchat-pixel-SYR3ZSSB.js → snapchat-pixel-JZ5FWGOA.js} +8 -7
- package/dist/snapchat-pixel-JZ5FWGOA.js.map +1 -0
- package/dist/snapchat-pixel.js +25 -5
- package/dist/snapchat-pixel.js.map +1 -1
- package/dist/{tiktok-pixel-FDGVKGOH.js → tiktok-pixel-QOD6ZSME.js} +8 -7
- package/dist/tiktok-pixel-QOD6ZSME.js.map +1 -0
- package/dist/tiktok-pixel.js +25 -5
- package/dist/tiktok-pixel.js.map +1 -1
- package/package.json +2 -2
- package/dist/abtasty-3G4JRT5W.js.map +0 -1
- package/dist/amplitude-CFLVTHYV.js.map +0 -1
- package/dist/chunk-6JXWYPMF.js.map +0 -1
- package/dist/clarity-KJPNK3FJ.js.map +0 -1
- package/dist/criteo-XKQPP2XY.js.map +0 -1
- package/dist/gcmads-LKOHK6MW.js.map +0 -1
- package/dist/google-analytics-SSTM7QMW.js.map +0 -1
- package/dist/googleads-XPXUKIXQ.js.map +0 -1
- package/dist/gtm-WFI6ABNK.js.map +0 -1
- package/dist/hotjar-YCFHYSKB.js.map +0 -1
- package/dist/hubspot-TLVPT4LG.js.map +0 -1
- package/dist/intercom-4MUKJZOV.js.map +0 -1
- package/dist/linkedin-insight-EH5OICV7.js.map +0 -1
- package/dist/matomo-H4JJCYJR.js.map +0 -1
- package/dist/meta-pixel-26NJ4GZJ.js.map +0 -1
- package/dist/piano-analytics-CZXSQQNF.js.map +0 -1
- package/dist/pinterest-pixel-B7J3RCSI.js.map +0 -1
- package/dist/plausible-GI4L4SM4.js.map +0 -1
- package/dist/posthog-N2HG7XOO.js.map +0 -1
- package/dist/reddit-pixel-SKXRCFEF.js.map +0 -1
- package/dist/segment-GZJFC57W.js.map +0 -1
- package/dist/sentry-UIBASRVZ.js.map +0 -1
- package/dist/smartsupp-I6XHQISS.js.map +0 -1
- package/dist/snapchat-pixel-SYR3ZSSB.js.map +0 -1
- package/dist/tiktok-pixel-FDGVKGOH.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# @modernconsent/vendors
|
|
2
|
+
|
|
3
|
+
24 built-in vendor modules for [ModernConsent](https://github.com/kschnekenburger/modern-consent). Each vendor is lazy-loaded on demand — zero vendor code is bundled unless activated.
|
|
4
|
+
|
|
5
|
+
All vendors include **fr/en translations** for purpose labels (used in `displayMode: 'purpose'`).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @modernconsent/vendors
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### With npm (recommended)
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { useBuiltinVendors } from '@modernconsent/vendors';
|
|
19
|
+
|
|
20
|
+
useBuiltinVendors();
|
|
21
|
+
|
|
22
|
+
window.modernConsent('vendor', {
|
|
23
|
+
name: 'google-analytics',
|
|
24
|
+
config: { measurementId: 'G-XXXXXXXXXX' },
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With CDN
|
|
29
|
+
|
|
30
|
+
Host vendor files on your CDN and set `cdnBase`:
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
window.modernConsent('config', {
|
|
34
|
+
cdnBase: 'https://cdn.example.com/mc-vendors',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Fetches https://cdn.example.com/mc-vendors/google-analytics.js
|
|
38
|
+
window.modernConsent('vendor', {
|
|
39
|
+
name: 'google-analytics',
|
|
40
|
+
config: { measurementId: 'G-XXXXXXXXXX' },
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Built-in Vendors
|
|
45
|
+
|
|
46
|
+
<details open>
|
|
47
|
+
<summary><strong>Analytics (13)</strong></summary>
|
|
48
|
+
|
|
49
|
+
| Key | Name | Config | Consent |
|
|
50
|
+
| ------------------ | ------------------ | ------------------------------------------ | ---------------- |
|
|
51
|
+
| `google-analytics` | Google Analytics | `measurementId: string` | Required |
|
|
52
|
+
| `gtm` | Google Tag Manager | `containerId: string` | Required |
|
|
53
|
+
| `matomo` | Matomo | `siteId: string`, `trackerUrl: string` | Required |
|
|
54
|
+
| `clarity` | Microsoft Clarity | `projectId: string` | Required |
|
|
55
|
+
| `hotjar` | Hotjar | `siteId: string` | Required |
|
|
56
|
+
| `hubspot` | HubSpot | `portalId: string` | Required |
|
|
57
|
+
| `amplitude` | Amplitude | `apiKey: string` | Required |
|
|
58
|
+
| `piano-analytics` | Piano Analytics | `siteId: string`, `collectDomain?: string` | Required |
|
|
59
|
+
| `posthog` | PostHog | `apiKey: string`, `instance?: string` | Required |
|
|
60
|
+
| `sentry` | Sentry | `dsn: string`, `version?: string` | Required |
|
|
61
|
+
| `abtasty` | AB Tasty | `accountId: string` | Required |
|
|
62
|
+
| `segment` | Segment | `writeKey: string` | Required |
|
|
63
|
+
| `plausible` | Plausible | `domain: string`, `instanceUrl?: string` | **Not required** |
|
|
64
|
+
|
|
65
|
+
</details>
|
|
66
|
+
|
|
67
|
+
<details open>
|
|
68
|
+
<summary><strong>Advertising (9)</strong></summary>
|
|
69
|
+
|
|
70
|
+
| Key | Name | Config | Consent |
|
|
71
|
+
| ------------------ | ------------------------- | ---------------------------- | -------- |
|
|
72
|
+
| `googleads` | Google Ads | `tagId: string` | Required |
|
|
73
|
+
| `gcmads` | Google Ads (Personalized) | _(auto-linked by googleads)_ | Required |
|
|
74
|
+
| `meta-pixel` | Meta Pixel | `pixelId: string` | Required |
|
|
75
|
+
| `linkedin-insight` | LinkedIn Insight Tag | `partnerId: string` | Required |
|
|
76
|
+
| `tiktok-pixel` | TikTok Pixel | `pixelId: string` | Required |
|
|
77
|
+
| `criteo` | Criteo | `accountId: string` | Required |
|
|
78
|
+
| `pinterest-pixel` | Pinterest Tag | `tagId: string` | Required |
|
|
79
|
+
| `snapchat-pixel` | Snapchat Pixel | `pixelId: string` | Required |
|
|
80
|
+
| `reddit-pixel` | Reddit Pixel | `pixelId: string` | Required |
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
84
|
+
<details open>
|
|
85
|
+
<summary><strong>Support (2)</strong></summary>
|
|
86
|
+
|
|
87
|
+
| Key | Name | Config | Consent |
|
|
88
|
+
| ----------- | --------- | --------------- | -------- |
|
|
89
|
+
| `intercom` | Intercom | `appId: string` | Required |
|
|
90
|
+
| `smartsupp` | Smartsupp | `key: string` | Required |
|
|
91
|
+
|
|
92
|
+
</details>
|
|
93
|
+
|
|
94
|
+
## Custom Vendors
|
|
95
|
+
|
|
96
|
+
You don't need this package for custom vendors. Register them inline:
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
window.modernConsent('vendor', {
|
|
100
|
+
name: 'my-tracker',
|
|
101
|
+
label: 'My Tracker',
|
|
102
|
+
description: 'Our internal analytics tool.',
|
|
103
|
+
category: 'Analytics',
|
|
104
|
+
requireConsent: true,
|
|
105
|
+
artifacts: ['_mt_id', '_mt_session'],
|
|
106
|
+
setup(config) {
|
|
107
|
+
// Runs at page load (e.g. set consent defaults)
|
|
108
|
+
},
|
|
109
|
+
init(config) {
|
|
110
|
+
// Runs when consent is granted
|
|
111
|
+
const s = document.createElement('script');
|
|
112
|
+
s.src = 'https://example.com/tracker.js';
|
|
113
|
+
document.head.appendChild(s);
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Vendor Lifecycle
|
|
119
|
+
|
|
120
|
+
Each vendor can implement two hooks:
|
|
121
|
+
|
|
122
|
+
| Hook | When | Use case |
|
|
123
|
+
| --------------- | --------------------------- | -------------------------------------------------------------- |
|
|
124
|
+
| `setup(config)` | Immediately at registration | Set consent defaults (e.g. Google Consent Mode `default deny`) |
|
|
125
|
+
| `init(config)` | When consent is granted | Load scripts, initialize SDKs |
|
|
126
|
+
|
|
127
|
+
In **Consent-Only mode** (`consentOnly: true`), `init()` is never called — only `setup()` runs.
|
|
128
|
+
|
|
129
|
+
## Related Packages
|
|
130
|
+
|
|
131
|
+
| Package | Description |
|
|
132
|
+
| ------------------------------------------------------------------------------ | ----------------------------------------- |
|
|
133
|
+
| [`@modernconsent/core`](https://www.npmjs.com/package/@modernconsent/core) | Consent engine, state, events, cookie |
|
|
134
|
+
| [`@modernconsent/widget`](https://www.npmjs.com/package/@modernconsent/widget) | Web Component UI (banner + details panel) |
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { loadScript } from './chunk-
|
|
1
|
+
import { loadScript } from './chunk-6B3YLQSK.js';
|
|
2
2
|
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
import { __spreadProps, __spreadValues } from './chunk-DDAAVRWG.js';
|
|
3
4
|
|
|
4
5
|
// src/abtasty.ts
|
|
5
|
-
var ABTasty = {
|
|
6
|
+
var ABTasty = __spreadProps(__spreadValues({
|
|
6
7
|
name: "AB Tasty",
|
|
7
8
|
category: "Analytics",
|
|
8
|
-
description: "A/B testing, feature flagging et personnalisation de l'exp\xE9rience utilisateur."
|
|
9
|
-
|
|
9
|
+
description: "A/B testing, feature flagging et personnalisation de l'exp\xE9rience utilisateur."
|
|
10
|
+
}, PURPOSE_ANALYTICS), {
|
|
10
11
|
requireConsent: true,
|
|
11
12
|
artifacts: ["ABTasty", "ABTastySession"],
|
|
12
13
|
init: (config) => {
|
|
13
|
-
if (!config
|
|
14
|
+
if (!(config == null ? void 0 : config.accountId)) return;
|
|
14
15
|
loadScript(`https://try.abtasty.com/${config.accountId}.js`);
|
|
15
16
|
}
|
|
16
|
-
};
|
|
17
|
+
});
|
|
17
18
|
var abtasty_default = ABTasty;
|
|
18
19
|
|
|
19
20
|
export { abtasty_default as default };
|
|
20
|
-
//# sourceMappingURL=abtasty-
|
|
21
|
-
//# sourceMappingURL=abtasty-
|
|
21
|
+
//# sourceMappingURL=abtasty-TXEYAILL.js.map
|
|
22
|
+
//# sourceMappingURL=abtasty-TXEYAILL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/abtasty.ts"],"names":[],"mappings":";;;;;AAQA,IAAM,OAAA,GAAiC,aAAA,CAAA,cAAA,CAAA;AAAA,EACrC,IAAA,EAAM,UAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa;AAAA,CAAA,EACV,iBAAA,CAAA,EAJkC;AAAA,EAKrC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,SAAA,EAAW,gBAAgB,CAAA;AAAA,EACvC,IAAA,EAAM,CAAC,MAAA,KAA0B;AAC/B,IAAA,IAAI,EAAC,iCAAQ,SAAA,CAAA,EAAW;AACxB,IAAA,UAAA,CAAW,CAAA,wBAAA,EAA2B,MAAA,CAAO,SAAS,CAAA,GAAA,CAAK,CAAA;AAAA,EAC7D;AACF,CAAA,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"abtasty-TXEYAILL.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype ABTastyConfig = {\n accountId: string;\n};\n\nconst ABTasty: Vendor<ABTastyConfig> = {\n name: 'AB Tasty',\n category: 'Analytics',\n description: \"A/B testing, feature flagging et personnalisation de l'expérience utilisateur.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['ABTasty', 'ABTastySession'],\n init: (config: ABTastyConfig) => {\n if (!config?.accountId) return;\n loadScript(`https://try.abtasty.com/${config.accountId}.js`);\n },\n};\n\nexport default ABTasty;\n"]}
|
package/dist/abtasty.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/utils/loader.ts
|
|
2
22
|
function loadScript(src, callback, attrs = {}) {
|
|
3
23
|
return new Promise((resolve, reject) => {
|
|
@@ -34,18 +54,18 @@ var PURPOSE_ANALYTICS = {
|
|
|
34
54
|
};
|
|
35
55
|
|
|
36
56
|
// src/abtasty.ts
|
|
37
|
-
var ABTasty = {
|
|
57
|
+
var ABTasty = __spreadProps(__spreadValues({
|
|
38
58
|
name: "AB Tasty",
|
|
39
59
|
category: "Analytics",
|
|
40
|
-
description: "A/B testing, feature flagging et personnalisation de l'exp\xE9rience utilisateur."
|
|
41
|
-
|
|
60
|
+
description: "A/B testing, feature flagging et personnalisation de l'exp\xE9rience utilisateur."
|
|
61
|
+
}, PURPOSE_ANALYTICS), {
|
|
42
62
|
requireConsent: true,
|
|
43
63
|
artifacts: ["ABTasty", "ABTastySession"],
|
|
44
64
|
init: (config) => {
|
|
45
|
-
if (!config
|
|
65
|
+
if (!(config == null ? void 0 : config.accountId)) return;
|
|
46
66
|
loadScript(`https://try.abtasty.com/${config.accountId}.js`);
|
|
47
67
|
}
|
|
48
|
-
};
|
|
68
|
+
});
|
|
49
69
|
var abtasty_default = ABTasty;
|
|
50
70
|
|
|
51
71
|
export { abtasty_default as default };
|
package/dist/abtasty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/abtasty.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/abtasty.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,UAAA,CACd,GAAA,EACA,QAAA,EACA,KAAA,GAAgC,EAAC,EAClB;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AAItC,IAAA,IAAI,QAAA,CAAS,aAAA,CAAc,CAAA,YAAA,EAAe,GAAG,IAAI,CAAA,EAAG;AAClD,MAAA,OAAA,EAAQ;AAER,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,IAAA,MAAA,CAAO,GAAA,GAAM,GAAA;AACb,IAAA,MAAA,CAAO,KAAA,GAAQ,IAAA;AAEf,IAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAAA,IAChC;AAEA,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,EAAQ;AACR,IACF,CAAA;AAEA,IAAA,MAAA,CAAO,UAAU,MAAM;AACrB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,uBAAA,EAA0B,GAAG,EAAE,CAAC,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,MAAM,CAAA;AAAA,EAClC,CAAC,CAAA;AACH;;;AC5BO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACNA,IAAM,OAAA,GAAiC,aAAA,CAAA,cAAA,CAAA;AAAA,EACrC,IAAA,EAAM,UAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa;AAAA,CAAA,EACV,iBAAA,CAAA,EAJkC;AAAA,EAKrC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,SAAA,EAAW,gBAAgB,CAAA;AAAA,EACvC,IAAA,EAAM,CAAC,MAAA,KAA0B;AAC/B,IAAA,IAAI,EAAC,iCAAQ,SAAA,CAAA,EAAW;AACxB,IAAA,UAAA,CAAW,CAAA,wBAAA,EAA2B,MAAA,CAAO,SAAS,CAAA,GAAA,CAAK,CAAA;AAAA,EAC7D;AACF,CAAA,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"abtasty.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n","/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype ABTastyConfig = {\n accountId: string;\n};\n\nconst ABTasty: Vendor<ABTastyConfig> = {\n name: 'AB Tasty',\n category: 'Analytics',\n description: \"A/B testing, feature flagging et personnalisation de l'expérience utilisateur.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['ABTasty', 'ABTastySession'],\n init: (config: ABTastyConfig) => {\n if (!config?.accountId) return;\n loadScript(`https://try.abtasty.com/${config.accountId}.js`);\n },\n};\n\nexport default ABTasty;\n"]}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { loadScript } from './chunk-
|
|
1
|
+
import { loadScript } from './chunk-6B3YLQSK.js';
|
|
2
2
|
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
import { __spreadProps, __spreadValues } from './chunk-DDAAVRWG.js';
|
|
3
4
|
|
|
4
5
|
// src/amplitude.ts
|
|
5
|
-
var Amplitude = {
|
|
6
|
+
var Amplitude = __spreadProps(__spreadValues({
|
|
6
7
|
name: "Amplitude",
|
|
7
8
|
category: "Analytics",
|
|
8
|
-
description: "Analyse produit : \xE9v\xE9nements, funnels, cohortes et r\xE9tention utilisateur."
|
|
9
|
-
|
|
9
|
+
description: "Analyse produit : \xE9v\xE9nements, funnels, cohortes et r\xE9tention utilisateur."
|
|
10
|
+
}, PURPOSE_ANALYTICS), {
|
|
10
11
|
requireConsent: true,
|
|
11
12
|
artifacts: ["amp_", "AMP_unsent"],
|
|
12
13
|
init: (config) => {
|
|
13
|
-
if (!config
|
|
14
|
+
if (!(config == null ? void 0 : config.apiKey)) return;
|
|
14
15
|
loadScript("https://cdn.amplitude.com/libs/analytics-browser-2.11.1-min.js.gz").then(() => {
|
|
15
16
|
if (window.amplitude) {
|
|
16
17
|
window.amplitude.init(config.apiKey);
|
|
17
18
|
}
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
};
|
|
21
|
+
});
|
|
21
22
|
var amplitude_default = Amplitude;
|
|
22
23
|
|
|
23
24
|
export { amplitude_default as default };
|
|
24
|
-
//# sourceMappingURL=amplitude-
|
|
25
|
-
//# sourceMappingURL=amplitude-
|
|
25
|
+
//# sourceMappingURL=amplitude-IGI75YH7.js.map
|
|
26
|
+
//# sourceMappingURL=amplitude-IGI75YH7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/amplitude.ts"],"names":[],"mappings":";;;;;AAQA,IAAM,SAAA,GAAqC,aAAA,CAAA,cAAA,CAAA;AAAA,EACzC,IAAA,EAAM,WAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa;AAAA,CAAA,EACV,iBAAA,CAAA,EAJsC;AAAA,EAKzC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,MAAA,EAAQ,YAAY,CAAA;AAAA,EAChC,IAAA,EAAM,CAAC,MAAA,KAA4B;AACjC,IAAA,IAAI,EAAC,iCAAQ,MAAA,CAAA,EAAQ;AAErB,IAAA,UAAA,CAAW,mEAAmE,CAAA,CAAE,IAAA,CAAK,MAAM;AACzF,MAAA,IAAK,OAAe,SAAA,EAAW;AAC7B,QAAC,MAAA,CAAe,SAAA,CAAU,IAAA,CAAK,MAAA,CAAO,MAAM,CAAA;AAAA,MAC9C;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF,CAAA,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"amplitude-IGI75YH7.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype AmplitudeConfig = {\n apiKey: string;\n};\n\nconst Amplitude: Vendor<AmplitudeConfig> = {\n name: 'Amplitude',\n category: 'Analytics',\n description: 'Analyse produit : événements, funnels, cohortes et rétention utilisateur.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['amp_', 'AMP_unsent'],\n init: (config: AmplitudeConfig) => {\n if (!config?.apiKey) return;\n\n loadScript('https://cdn.amplitude.com/libs/analytics-browser-2.11.1-min.js.gz').then(() => {\n if ((window as any).amplitude) {\n (window as any).amplitude.init(config.apiKey);\n }\n });\n },\n};\n\nexport default Amplitude;\n"]}
|
package/dist/amplitude.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/utils/loader.ts
|
|
2
22
|
function loadScript(src, callback, attrs = {}) {
|
|
3
23
|
return new Promise((resolve, reject) => {
|
|
@@ -34,22 +54,22 @@ var PURPOSE_ANALYTICS = {
|
|
|
34
54
|
};
|
|
35
55
|
|
|
36
56
|
// src/amplitude.ts
|
|
37
|
-
var Amplitude = {
|
|
57
|
+
var Amplitude = __spreadProps(__spreadValues({
|
|
38
58
|
name: "Amplitude",
|
|
39
59
|
category: "Analytics",
|
|
40
|
-
description: "Analyse produit : \xE9v\xE9nements, funnels, cohortes et r\xE9tention utilisateur."
|
|
41
|
-
|
|
60
|
+
description: "Analyse produit : \xE9v\xE9nements, funnels, cohortes et r\xE9tention utilisateur."
|
|
61
|
+
}, PURPOSE_ANALYTICS), {
|
|
42
62
|
requireConsent: true,
|
|
43
63
|
artifacts: ["amp_", "AMP_unsent"],
|
|
44
64
|
init: (config) => {
|
|
45
|
-
if (!config
|
|
65
|
+
if (!(config == null ? void 0 : config.apiKey)) return;
|
|
46
66
|
loadScript("https://cdn.amplitude.com/libs/analytics-browser-2.11.1-min.js.gz").then(() => {
|
|
47
67
|
if (window.amplitude) {
|
|
48
68
|
window.amplitude.init(config.apiKey);
|
|
49
69
|
}
|
|
50
70
|
});
|
|
51
71
|
}
|
|
52
|
-
};
|
|
72
|
+
});
|
|
53
73
|
var amplitude_default = Amplitude;
|
|
54
74
|
|
|
55
75
|
export { amplitude_default as default };
|
package/dist/amplitude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/amplitude.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/amplitude.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAO,SAAS,UAAA,CACd,GAAA,EACA,QAAA,EACA,KAAA,GAAgC,EAAC,EAClB;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AAItC,IAAA,IAAI,QAAA,CAAS,aAAA,CAAc,CAAA,YAAA,EAAe,GAAG,IAAI,CAAA,EAAG;AAClD,MAAA,OAAA,EAAQ;AAER,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,IAAA,MAAA,CAAO,GAAA,GAAM,GAAA;AACb,IAAA,MAAA,CAAO,KAAA,GAAQ,IAAA;AAEf,IAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAAA,IAChC;AAEA,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,EAAQ;AACR,IACF,CAAA;AAEA,IAAA,MAAA,CAAO,UAAU,MAAM;AACrB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,uBAAA,EAA0B,GAAG,EAAE,CAAC,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,MAAM,CAAA;AAAA,EAClC,CAAC,CAAA;AACH;;;AC5BO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACNA,IAAM,SAAA,GAAqC,aAAA,CAAA,cAAA,CAAA;AAAA,EACzC,IAAA,EAAM,WAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa;AAAA,CAAA,EACV,iBAAA,CAAA,EAJsC;AAAA,EAKzC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,MAAA,EAAQ,YAAY,CAAA;AAAA,EAChC,IAAA,EAAM,CAAC,MAAA,KAA4B;AACjC,IAAA,IAAI,EAAC,iCAAQ,MAAA,CAAA,EAAQ;AAErB,IAAA,UAAA,CAAW,mEAAmE,CAAA,CAAE,IAAA,CAAK,MAAM;AACzF,MAAA,IAAK,OAAe,SAAA,EAAW;AAC7B,QAAC,MAAA,CAAe,SAAA,CAAU,IAAA,CAAK,MAAA,CAAO,MAAM,CAAA;AAAA,MAC9C;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF,CAAA,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"amplitude.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n","/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype AmplitudeConfig = {\n apiKey: string;\n};\n\nconst Amplitude: Vendor<AmplitudeConfig> = {\n name: 'Amplitude',\n category: 'Analytics',\n description: 'Analyse produit : événements, funnels, cohortes et rétention utilisateur.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['amp_', 'AMP_unsent'],\n init: (config: AmplitudeConfig) => {\n if (!config?.apiKey) return;\n\n loadScript('https://cdn.amplitude.com/libs/analytics-browser-2.11.1-min.js.gz').then(() => {\n if ((window as any).amplitude) {\n (window as any).amplitude.init(config.apiKey);\n }\n });\n },\n};\n\nexport default Amplitude;\n"]}
|
|
@@ -3,7 +3,7 @@ function loadScript(src, callback, attrs = {}) {
|
|
|
3
3
|
return new Promise((resolve, reject) => {
|
|
4
4
|
if (document.querySelector(`script[src="${src}"]`)) {
|
|
5
5
|
resolve();
|
|
6
|
-
callback
|
|
6
|
+
callback == null ? void 0 : callback();
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const script = document.createElement("script");
|
|
@@ -14,7 +14,7 @@ function loadScript(src, callback, attrs = {}) {
|
|
|
14
14
|
}
|
|
15
15
|
script.onload = () => {
|
|
16
16
|
resolve();
|
|
17
|
-
callback
|
|
17
|
+
callback == null ? void 0 : callback();
|
|
18
18
|
};
|
|
19
19
|
script.onerror = () => {
|
|
20
20
|
reject(new Error(`Failed to load script: ${src}`));
|
|
@@ -24,5 +24,5 @@ function loadScript(src, callback, attrs = {}) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export { loadScript };
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-6B3YLQSK.js.map
|
|
28
|
+
//# sourceMappingURL=chunk-6B3YLQSK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts"],"names":[],"mappings":";AAAO,SAAS,UAAA,CACd,GAAA,EACA,QAAA,EACA,KAAA,GAAgC,EAAC,EAClB;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AAItC,IAAA,IAAI,QAAA,CAAS,aAAA,CAAc,CAAA,YAAA,EAAe,GAAG,IAAI,CAAA,EAAG;AAClD,MAAA,OAAA,EAAQ;AACR,MAAA,QAAA,IAAA,IAAA,GAAA,MAAA,GAAA,QAAA,EAAA;AACA,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,IAAA,MAAA,CAAO,GAAA,GAAM,GAAA;AACb,IAAA,MAAA,CAAO,KAAA,GAAQ,IAAA;AAEf,IAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAAA,IAChC;AAEA,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,EAAQ;AACR,MAAA,QAAA,IAAA,IAAA,GAAA,MAAA,GAAA,QAAA,EAAA;AAAA,IACF,CAAA;AAEA,IAAA,MAAA,CAAO,UAAU,MAAM;AACrB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,uBAAA,EAA0B,GAAG,EAAE,CAAC,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,MAAM,CAAA;AAAA,EAClC,CAAC,CAAA;AACH","file":"chunk-6B3YLQSK.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
export { __spreadProps, __spreadValues };
|
|
22
|
+
//# sourceMappingURL=chunk-DDAAVRWG.js.map
|
|
23
|
+
//# sourceMappingURL=chunk-DDAAVRWG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DDAAVRWG.js"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
2
|
+
import { __spreadProps, __spreadValues } from './chunk-DDAAVRWG.js';
|
|
2
3
|
|
|
3
4
|
// src/clarity.ts
|
|
4
|
-
var Clarity = {
|
|
5
|
+
var Clarity = __spreadProps(__spreadValues({
|
|
5
6
|
name: "Microsoft Clarity",
|
|
6
7
|
category: "Analytics",
|
|
7
|
-
description: "Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs."
|
|
8
|
-
|
|
8
|
+
description: "Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs."
|
|
9
|
+
}, PURPOSE_ANALYTICS), {
|
|
9
10
|
requireConsent: true,
|
|
10
11
|
artifacts: ["_clck", "_clsk", "CLID", "ANONCHK", "MR", "MUID", "SM"],
|
|
11
12
|
init: (config) => {
|
|
12
|
-
if (!config
|
|
13
|
+
if (!(config == null ? void 0 : config.projectId)) return;
|
|
13
14
|
(function(c, l, a, r, i) {
|
|
14
15
|
c[a] = c[a] || function(...args) {
|
|
15
16
|
(c[a].q = c[a].q || []).push(args);
|
|
@@ -21,9 +22,9 @@ var Clarity = {
|
|
|
21
22
|
y.parentNode.insertBefore(t, y);
|
|
22
23
|
})(window, document, "clarity", "script", config.projectId);
|
|
23
24
|
}
|
|
24
|
-
};
|
|
25
|
+
});
|
|
25
26
|
var clarity_default = Clarity;
|
|
26
27
|
|
|
27
28
|
export { clarity_default as default };
|
|
28
|
-
//# sourceMappingURL=clarity-
|
|
29
|
-
//# sourceMappingURL=clarity-
|
|
29
|
+
//# sourceMappingURL=clarity-QBRU244I.js.map
|
|
30
|
+
//# sourceMappingURL=clarity-QBRU244I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/clarity.ts"],"names":[],"mappings":";;;;AAaA,IAAM,OAAA,GAAiC,aAAA,CAAA,cAAA,CAAA;AAAA,EACrC,IAAA,EAAM,mBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EACE;AAAA,CAAA,EACC,iBAAA,CAAA,EALkC;AAAA,EAMrC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,OAAA,EAAS,OAAA,EAAS,QAAQ,SAAA,EAAW,IAAA,EAAM,QAAQ,IAAI,CAAA;AAAA,EACnE,IAAA,EAAM,CAAC,MAAA,KAA0B;AAC/B,IAAA,IAAI,EAAC,iCAAQ,SAAA,CAAA,EAAW;AAExB,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAQ,CAAA,EAAQ,GAAW,CAAA,EAAW;AACvD,MAAA,CAAA,CAAE,CAAC,CAAA,GACD,CAAA,CAAE,CAAC,CAAA,IACH,YAAa,IAAA,EAAa;AACxB,QAAA,CAAC,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,IAAK,EAAC,EAAG,IAAA,CAAK,IAAI,CAAA;AAAA,MACnC,CAAA;AACF,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,aAAA,CAAc,CAAC,CAAA;AAC3B,MAAA,CAAA,CAAE,KAAA,GAAQ,IAAA;AACV,MAAA,CAAA,CAAE,MAAM,6BAAA,GAAgC,CAAA;AACxC,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,oBAAA,CAAqB,CAAC,EAAE,CAAC,CAAA;AACrC,MAAA,CAAA,CAAE,UAAA,CAAY,YAAA,CAAa,CAAA,EAAG,CAAC,CAAA;AAAA,IACjC,GAAG,MAAA,EAAQ,QAAA,EAAU,SAAA,EAAW,QAAA,EAAU,OAAO,SAAS,CAAA;AAAA,EAC5D;AACF,CAAA,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"clarity-QBRU244I.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype ClarityConfig = {\n projectId: string;\n};\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\nconst Clarity: Vendor<ClarityConfig> = {\n name: 'Microsoft Clarity',\n category: 'Analytics',\n description:\n 'Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['_clck', '_clsk', 'CLID', 'ANONCHK', 'MR', 'MUID', 'SM'],\n init: (config: ClarityConfig) => {\n if (!config?.projectId) return;\n\n (function (c: any, l: any, a: any, r: string, i: string) {\n c[a] =\n c[a] ||\n function (...args: any[]) {\n (c[a].q = c[a].q || []).push(args);\n };\n const t = l.createElement(r) as HTMLScriptElement;\n t.async = true;\n t.src = 'https://www.clarity.ms/tag/' + i;\n const y = l.getElementsByTagName(r)[0] as HTMLScriptElement;\n y.parentNode!.insertBefore(t, y);\n })(window, document, 'clarity', 'script', config.projectId);\n },\n};\n\nexport default Clarity;\n"]}
|
package/dist/clarity.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/utils/purposes.ts
|
|
2
22
|
var PURPOSE_ANALYTICS = {
|
|
3
23
|
purposeLabel: {
|
|
@@ -11,15 +31,15 @@ var PURPOSE_ANALYTICS = {
|
|
|
11
31
|
};
|
|
12
32
|
|
|
13
33
|
// src/clarity.ts
|
|
14
|
-
var Clarity = {
|
|
34
|
+
var Clarity = __spreadProps(__spreadValues({
|
|
15
35
|
name: "Microsoft Clarity",
|
|
16
36
|
category: "Analytics",
|
|
17
|
-
description: "Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs."
|
|
18
|
-
|
|
37
|
+
description: "Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs."
|
|
38
|
+
}, PURPOSE_ANALYTICS), {
|
|
19
39
|
requireConsent: true,
|
|
20
40
|
artifacts: ["_clck", "_clsk", "CLID", "ANONCHK", "MR", "MUID", "SM"],
|
|
21
41
|
init: (config) => {
|
|
22
|
-
if (!config
|
|
42
|
+
if (!(config == null ? void 0 : config.projectId)) return;
|
|
23
43
|
(function(c, l, a, r, i) {
|
|
24
44
|
c[a] = c[a] || function(...args) {
|
|
25
45
|
(c[a].q = c[a].q || []).push(args);
|
|
@@ -31,7 +51,7 @@ var Clarity = {
|
|
|
31
51
|
y.parentNode.insertBefore(t, y);
|
|
32
52
|
})(window, document, "clarity", "script", config.projectId);
|
|
33
53
|
}
|
|
34
|
-
};
|
|
54
|
+
});
|
|
35
55
|
var clarity_default = Clarity;
|
|
36
56
|
|
|
37
57
|
export { clarity_default as default };
|
package/dist/clarity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/purposes.ts","../src/clarity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/utils/purposes.ts","../src/clarity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACDA,IAAM,OAAA,GAAiC,aAAA,CAAA,cAAA,CAAA;AAAA,EACrC,IAAA,EAAM,mBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EACE;AAAA,CAAA,EACC,iBAAA,CAAA,EALkC;AAAA,EAMrC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,OAAA,EAAS,OAAA,EAAS,QAAQ,SAAA,EAAW,IAAA,EAAM,QAAQ,IAAI,CAAA;AAAA,EACnE,IAAA,EAAM,CAAC,MAAA,KAA0B;AAC/B,IAAA,IAAI,EAAC,iCAAQ,SAAA,CAAA,EAAW;AAExB,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAQ,CAAA,EAAQ,GAAW,CAAA,EAAW;AACvD,MAAA,CAAA,CAAE,CAAC,CAAA,GACD,CAAA,CAAE,CAAC,CAAA,IACH,YAAa,IAAA,EAAa;AACxB,QAAA,CAAC,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,IAAK,EAAC,EAAG,IAAA,CAAK,IAAI,CAAA;AAAA,MACnC,CAAA;AACF,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,aAAA,CAAc,CAAC,CAAA;AAC3B,MAAA,CAAA,CAAE,KAAA,GAAQ,IAAA;AACV,MAAA,CAAA,CAAE,MAAM,6BAAA,GAAgC,CAAA;AACxC,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,oBAAA,CAAqB,CAAC,EAAE,CAAC,CAAA;AACrC,MAAA,CAAA,CAAE,UAAA,CAAY,YAAA,CAAa,CAAA,EAAG,CAAC,CAAA;AAAA,IACjC,GAAG,MAAA,EAAQ,QAAA,EAAU,SAAA,EAAW,QAAA,EAAU,OAAO,SAAS,CAAA;AAAA,EAC5D;AACF,CAAA,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"clarity.js","sourcesContent":["/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype ClarityConfig = {\n projectId: string;\n};\n\ndeclare global {\n interface Window {\n clarity: (...args: any[]) => void;\n }\n}\n\nconst Clarity: Vendor<ClarityConfig> = {\n name: 'Microsoft Clarity',\n category: 'Analytics',\n description:\n 'Enregistrement de sessions et cartes de chaleur pour comprendre le comportement des utilisateurs.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: ['_clck', '_clsk', 'CLID', 'ANONCHK', 'MR', 'MUID', 'SM'],\n init: (config: ClarityConfig) => {\n if (!config?.projectId) return;\n\n (function (c: any, l: any, a: any, r: string, i: string) {\n c[a] =\n c[a] ||\n function (...args: any[]) {\n (c[a].q = c[a].q || []).push(args);\n };\n const t = l.createElement(r) as HTMLScriptElement;\n t.async = true;\n t.src = 'https://www.clarity.ms/tag/' + i;\n const y = l.getElementsByTagName(r)[0] as HTMLScriptElement;\n y.parentNode!.insertBefore(t, y);\n })(window, document, 'clarity', 'script', config.projectId);\n },\n};\n\nexport default Clarity;\n"]}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { loadScript } from './chunk-
|
|
1
|
+
import { loadScript } from './chunk-6B3YLQSK.js';
|
|
2
2
|
import { PURPOSE_ADS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
import { __spreadProps, __spreadValues } from './chunk-DDAAVRWG.js';
|
|
3
4
|
|
|
4
5
|
// src/criteo.ts
|
|
5
|
-
var Criteo = {
|
|
6
|
+
var Criteo = __spreadProps(__spreadValues({
|
|
6
7
|
name: "Criteo",
|
|
7
8
|
category: "Publicit\xE9",
|
|
8
|
-
description: "Reciblage publicitaire et annonces display dynamiques."
|
|
9
|
-
|
|
9
|
+
description: "Reciblage publicitaire et annonces display dynamiques."
|
|
10
|
+
}, PURPOSE_ADS), {
|
|
10
11
|
requireConsent: true,
|
|
11
12
|
artifacts: ["cto_bundle", "cto_bidid", "cto_optout", "criteo_write_test"],
|
|
12
13
|
init: (config) => {
|
|
13
|
-
if (!config
|
|
14
|
+
if (!(config == null ? void 0 : config.accountId)) return;
|
|
14
15
|
window.criteo_q = window.criteo_q || [];
|
|
15
16
|
window.criteo_q.push({ event: "setAccount", account: config.accountId }, { event: "viewPage" });
|
|
16
17
|
loadScript("https://static.criteo.net/js/ld/ld.js", void 0, { async: "true" });
|
|
17
18
|
}
|
|
18
|
-
};
|
|
19
|
+
});
|
|
19
20
|
var criteo_default = Criteo;
|
|
20
21
|
|
|
21
22
|
export { criteo_default as default };
|
|
22
|
-
//# sourceMappingURL=criteo-
|
|
23
|
-
//# sourceMappingURL=criteo-
|
|
23
|
+
//# sourceMappingURL=criteo-2H2CRDXP.js.map
|
|
24
|
+
//# sourceMappingURL=criteo-2H2CRDXP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/criteo.ts"],"names":[],"mappings":";;;;;AAcA,IAAM,MAAA,GAA+B,aAAA,CAAA,cAAA,CAAA;AAAA,EACnC,IAAA,EAAM,QAAA;AAAA,EACN,QAAA,EAAU,cAAA;AAAA,EACV,WAAA,EAAa;AAAA,CAAA,EACV,WAAA,CAAA,EAJgC;AAAA,EAKnC,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,YAAA,EAAc,WAAA,EAAa,cAAc,mBAAmB,CAAA;AAAA,EACxE,IAAA,EAAM,CAAC,MAAA,KAAyB;AAC9B,IAAA,IAAI,EAAC,iCAAQ,SAAA,CAAA,EAAW;AAExB,IAAA,MAAA,CAAO,QAAA,GAAW,MAAA,CAAO,QAAA,IAAY,EAAC;AACtC,IAAA,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,EAAE,KAAA,EAAO,YAAA,EAAc,OAAA,EAAS,MAAA,CAAO,SAAA,EAAU,EAAG,EAAE,KAAA,EAAO,UAAA,EAAY,CAAA;AAE9F,IAAA,UAAA,CAAW,uCAAA,EAAyC,MAAA,EAAW,EAAE,KAAA,EAAO,QAAQ,CAAA;AAAA,EAClF;AACF,CAAA,CAAA;AAEA,IAAO,cAAA,GAAQ","file":"criteo-2H2CRDXP.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ADS } from './utils/purposes';\n\ntype CriteoConfig = {\n accountId: string;\n};\n\ndeclare global {\n interface Window {\n criteo_q: any[];\n }\n}\n\nconst Criteo: Vendor<CriteoConfig> = {\n name: 'Criteo',\n category: 'Publicité',\n description: 'Reciblage publicitaire et annonces display dynamiques.',\n ...PURPOSE_ADS,\n requireConsent: true,\n artifacts: ['cto_bundle', 'cto_bidid', 'cto_optout', 'criteo_write_test'],\n init: (config: CriteoConfig) => {\n if (!config?.accountId) return;\n\n window.criteo_q = window.criteo_q || [];\n window.criteo_q.push({ event: 'setAccount', account: config.accountId }, { event: 'viewPage' });\n\n loadScript('https://static.criteo.net/js/ld/ld.js', undefined, { async: 'true' });\n },\n};\n\nexport default Criteo;\n"]}
|