@wix/web5-core 1.63.48 → 1.63.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cjs/index.js +4 -26
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +0 -3
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/types/index.d.ts +0 -1
  6. package/dist/types/index.d.ts.map +1 -1
  7. package/package.json +2 -2
  8. package/dist/cjs/privacy/consentGate.js +0 -129
  9. package/dist/cjs/privacy/consentGate.js.map +0 -1
  10. package/dist/cjs/privacy/consentOverride.js +0 -94
  11. package/dist/cjs/privacy/consentOverride.js.map +0 -1
  12. package/dist/cjs/privacy/detectProvider.js +0 -71
  13. package/dist/cjs/privacy/detectProvider.js.map +0 -1
  14. package/dist/cjs/privacy/index.js +0 -33
  15. package/dist/cjs/privacy/index.js.map +0 -1
  16. package/dist/cjs/privacy/providers/hostSuppliedProvider.js +0 -93
  17. package/dist/cjs/privacy/providers/hostSuppliedProvider.js.map +0 -1
  18. package/dist/cjs/privacy/providers/oneTrustProvider.js +0 -72
  19. package/dist/cjs/privacy/providers/oneTrustProvider.js.map +0 -1
  20. package/dist/cjs/privacy/providers/shopifyProvider.js +0 -181
  21. package/dist/cjs/privacy/providers/shopifyProvider.js.map +0 -1
  22. package/dist/cjs/privacy/types.js +0 -34
  23. package/dist/cjs/privacy/types.js.map +0 -1
  24. package/dist/esm/privacy/consentGate.js +0 -122
  25. package/dist/esm/privacy/consentGate.js.map +0 -1
  26. package/dist/esm/privacy/consentOverride.js +0 -87
  27. package/dist/esm/privacy/consentOverride.js.map +0 -1
  28. package/dist/esm/privacy/detectProvider.js +0 -65
  29. package/dist/esm/privacy/detectProvider.js.map +0 -1
  30. package/dist/esm/privacy/index.js +0 -8
  31. package/dist/esm/privacy/index.js.map +0 -1
  32. package/dist/esm/privacy/providers/hostSuppliedProvider.js +0 -85
  33. package/dist/esm/privacy/providers/hostSuppliedProvider.js.map +0 -1
  34. package/dist/esm/privacy/providers/oneTrustProvider.js +0 -66
  35. package/dist/esm/privacy/providers/oneTrustProvider.js.map +0 -1
  36. package/dist/esm/privacy/providers/shopifyProvider.js +0 -178
  37. package/dist/esm/privacy/providers/shopifyProvider.js.map +0 -1
  38. package/dist/esm/privacy/types.js +0 -30
  39. package/dist/esm/privacy/types.js.map +0 -1
  40. package/dist/types/privacy/consentGate.d.ts +0 -52
  41. package/dist/types/privacy/consentGate.d.ts.map +0 -1
  42. package/dist/types/privacy/consentOverride.d.ts +0 -33
  43. package/dist/types/privacy/consentOverride.d.ts.map +0 -1
  44. package/dist/types/privacy/detectProvider.d.ts +0 -25
  45. package/dist/types/privacy/detectProvider.d.ts.map +0 -1
  46. package/dist/types/privacy/index.d.ts +0 -8
  47. package/dist/types/privacy/index.d.ts.map +0 -1
  48. package/dist/types/privacy/providers/hostSuppliedProvider.d.ts +0 -29
  49. package/dist/types/privacy/providers/hostSuppliedProvider.d.ts.map +0 -1
  50. package/dist/types/privacy/providers/oneTrustProvider.d.ts +0 -15
  51. package/dist/types/privacy/providers/oneTrustProvider.d.ts.map +0 -1
  52. package/dist/types/privacy/providers/shopifyProvider.d.ts +0 -26
  53. package/dist/types/privacy/providers/shopifyProvider.d.ts.map +0 -1
  54. package/dist/types/privacy/types.d.ts +0 -32
  55. package/dist/types/privacy/types.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["ANALYTICS_CATEGORY","MARKETING_CATEGORY","readGroups","window","groups","OnetrustActiveGroups","isOneTrustHost","exports","readSnapshot","console","debug","analytics","marketing","performance","includes","createOneTrustConsentProvider","name","read","subscribe","onChange","publish","addEventListener","removeEventListener"],"sources":["../../../../src/privacy/providers/oneTrustProvider.ts"],"sourcesContent":["/**\n * OneTrust provider — DL #218.\n *\n * Lifted from the consent check that used to live inside\n * `utils/analyticsEvents.ts`, with one deliberate behaviour change: that\n * function returned `true` when OneTrust was absent (\"host is responsible for\n * loading OneTrust\"), which on a Shopify storefront meant unconditional\n * default-allow. Absence is no longer this provider's problem — it is only\n * selected when OneTrust is actually on the page, and absence is handled by\n * the gate's own default.\n */\n\nimport type { ConsentProvider, ConsentSnapshot } from '../types';\n\n/** OneTrust's default taxonomy: C0002 is the performance/analytics category. */\nconst ANALYTICS_CATEGORY = 'C0002';\n/** C0004 is targeting/advertising. */\nconst MARKETING_CATEGORY = 'C0004';\n\nconst readGroups = (): string | null => {\n if (typeof window === 'undefined') {\n return null;\n }\n const groups = (window as unknown as { OnetrustActiveGroups?: unknown })\n .OnetrustActiveGroups;\n return typeof groups === 'string' ? groups : null;\n};\n\nexport const isOneTrustHost = (): boolean => readGroups() !== null;\n\nconst readSnapshot = (): ConsentSnapshot => {\n const groups = readGroups();\n if (groups !== null) {\n try {\n console.debug(`[w5-consent] onetrust: active groups \"${groups}\"`);\n } catch {\n /* never break on a console */\n }\n }\n if (groups === null) {\n return {\n analytics: 'unknown',\n marketing: 'unknown',\n performance: 'unknown',\n };\n }\n // OneTrust publishes the *active* groups, so a category that is absent from\n // a string OneTrust has written is a refusal, not silence.\n const analytics = groups.includes(ANALYTICS_CATEGORY) ? 'granted' : 'denied';\n const marketing = groups.includes(MARKETING_CATEGORY) ? 'granted' : 'denied';\n return { analytics, marketing, performance: analytics };\n};\n\nexport const createOneTrustConsentProvider = (): ConsentProvider => ({\n name: 'onetrust',\n\n read: readSnapshot,\n\n subscribe(onChange) {\n const publish = () => onChange(readSnapshot());\n if (typeof window === 'undefined') {\n return () => {};\n }\n // OneTrust fires this on every banner interaction.\n window.addEventListener('OneTrustGroupsUpdated', publish);\n return () => {\n window.removeEventListener('OneTrustGroupsUpdated', publish);\n };\n },\n});\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA,MAAMA,kBAAkB,GAAG,OAAO;AAClC;AACA,MAAMC,kBAAkB,GAAG,OAAO;AAElC,MAAMC,UAAU,GAAGA,C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IACjB;IACA;IACAA,MAAM,CAACkB,gBAAgB,CAAC,uBAAuB,EAAED,OAAO,CAAC;IACzD,OAAO,MAAM;MACXjB,MAAM,CAACmB,mBAAmB,CAAC,uBAAuB,EAAEF,OAAO,CAAC;IAC9D,CAAC;EACH;AACF,CAAC,CAAC;AAACb,OAAA,CAAAQ,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,181 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.isShopifyHost = exports.createShopifyConsentProvider = void 0;
5
- var _types = require("../types");
6
- /**
7
- * Shopify Customer Privacy API provider — DL #218.
8
- *
9
- * Two things about this API shape the provider:
10
- *
11
- * 1. **It is not on the page by default.** `window.Shopify.customerPrivacy` is
12
- * `undefined` until somebody asks for it with `Shopify.loadFeatures`. The
13
- * theme app extension warms it so it is ready before the bundle mounts;
14
- * this provider still requests it, because the extension may not be
15
- * installed and the request is idempotent.
16
- *
17
- * 2. **`visitorConsentCollected` may have already fired.** The bundle executes
18
- * into an already-rendered storefront page (DL #217), so `read()` answers
19
- * from current state and the event is only ever an update.
20
- *
21
- * The region rule is the one judgement encoded here, and it keys off
22
- * `isRegulationEnforced()` rather than `shouldShowBanner()`. The two are not
23
- * interchangeable: the banner reflects what the *merchant* configured, while
24
- * enforcement reflects what the *visitor's jurisdiction* requires. A store with
25
- * an empty consent configuration reports "no banner needed" everywhere,
26
- * including inside the EU.
27
- */
28
-
29
- const CONSENT_FEATURE = {
30
- name: 'consent-tracking-api',
31
- version: '0.1'
32
- };
33
- const log = (...args) => {
34
- try {
35
- console.debug('[w5-consent] shopify:', ...args);
36
- } catch {
37
- /* never break on a console */
38
- }
39
- };
40
- const getShopify = () => {
41
- if (typeof window === 'undefined') {
42
- return null;
43
- }
44
- return window.Shopify ?? null;
45
- };
46
- const isShopifyHost = () => getShopify() !== null;
47
- exports.isShopifyHost = isShopifyHost;
48
- const toState = value => {
49
- if (value === 'yes') {
50
- return 'granted';
51
- }
52
- if (value === 'no') {
53
- return 'denied';
54
- }
55
- return null;
56
- };
57
- const readSnapshot = () => {
58
- var _getShopify;
59
- const privacy = (_getShopify = getShopify()) == null ? void 0 : _getShopify.customerPrivacy;
60
- if (!privacy) {
61
- log('customerPrivacy API not on the page — no answer available (store has no privacy configuration, or loadFeatures has not resolved yet)');
62
- // The API has not loaded (or the store has no privacy configuration at
63
- // all). Not an answer — the gate holds, and the visitor's own action is
64
- // what unlocks the session.
65
- return _types.UNKNOWN_CONSENT;
66
- }
67
- let consent = {};
68
- try {
69
- consent = (privacy.currentVisitorConsent == null ? void 0 : privacy.currentVisitorConsent()) ?? {};
70
- } catch {
71
- // Present but not ready — treat as no answer yet.
72
- }
73
- const explicitAnalytics = toState(consent.analytics);
74
- const explicitMarketing = toState(consent.marketing);
75
- let allowed = false;
76
- try {
77
- allowed = (privacy.analyticsProcessingAllowed == null ? void 0 : privacy.analyticsProcessingAllowed()) === true;
78
- } catch {
79
- allowed = false;
80
- }
81
-
82
- // Is a privacy regulation in force for *this visitor's* region? This is the
83
- // question that matters, and it is not the same question as "is a banner
84
- // being shown" — see the comment on `enforced` below.
85
- let enforced = null;
86
- let regulation = '';
87
- let region = '';
88
- try {
89
- if (typeof privacy.isRegulationEnforced === 'function') {
90
- enforced = privacy.isRegulationEnforced() === true;
91
- }
92
- regulation = (privacy.getRegulation == null ? void 0 : privacy.getRegulation()) ?? '';
93
- region = (privacy.getRegion == null ? void 0 : privacy.getRegion()) ?? '';
94
- } catch {
95
- enforced = null;
96
- }
97
- let bannerRequired = true;
98
- try {
99
- bannerRequired = (privacy.shouldShowBanner == null ? void 0 : privacy.shouldShowBanner()) !== false;
100
- } catch {
101
- bannerRequired = true;
102
- }
103
-
104
- /*
105
- * Measured on a live store from a Frankfurt IP, with no consent recorded:
106
- *
107
- * region 'DEBE' · regulation 'GDPR' · isRegulationEnforced() true
108
- * shouldShowBanner() false · analyticsProcessingAllowed() TRUE
109
- * getShopPrefs() { limit: [] }
110
- *
111
- * Shopify said tracking was allowed for a GDPR-protected visitor who had
112
- * never been asked, because the *merchant* had configured no consent
113
- * preferences. `shouldShowBanner()` and `analyticsProcessingAllowed()` both
114
- * describe the merchant's setup; neither is a statement about a legal basis.
115
- * A merchant's misconfiguration must not become our tracking decision, so
116
- * under an enforced regulation an absent answer stays `unknown` and the gate
117
- * holds — the visitor's own prompt is then the only thing that unlocks them.
118
- */
119
- const permissiveDefault = allowed || !bannerRequired;
120
- const fallbackWhenUnenforceable = permissiveDefault ? 'granted' : 'unknown';
121
- const analytics = explicitAnalytics ?? (enforced === true ? 'unknown' : fallbackWhenUnenforceable);
122
- const marketing = explicitMarketing ?? (enforced === true ? 'unknown' : !bannerRequired ? 'granted' : 'unknown');
123
- log(`read — visitorConsent.analytics=${consent.analytics ?? '(unset)'} ` + `analyticsProcessingAllowed=${allowed} bannerRequired=${bannerRequired} ` + `region=${region || '?'} regulation=${regulation || '?'} enforced=${enforced === null ? 'unavailable' : enforced}` + (enforced === true && explicitAnalytics === null ? ' → regulated and unanswered, holding' : '') + ` ⇒ ${analytics}`);
124
- return {
125
- analytics,
126
- marketing,
127
- // Shopify has no separate performance bucket. Load telemetry carries an
128
- // app name and a session id to a Wix endpoint, so it answers to the same
129
- // answer analytics does rather than riding for free.
130
- performance: analytics
131
- };
132
- };
133
-
134
- /**
135
- * Ask Shopify to load the consent API if it is not already there. Safe to call
136
- * more than once; the callback re-reads whatever state arrives.
137
- */
138
- const requestConsentApi = onReady => {
139
- const shopify = getShopify();
140
- if (!shopify || shopify.customerPrivacy || !shopify.loadFeatures) {
141
- return;
142
- }
143
- try {
144
- log('requesting consent-tracking-api via Shopify.loadFeatures…');
145
- shopify.loadFeatures([CONSENT_FEATURE], error => {
146
- if (error) {
147
- log('loadFeatures failed — gate stays held', error);
148
- return;
149
- }
150
- log('loadFeatures resolved — re-reading consent');
151
- onReady();
152
- });
153
- } catch {
154
- // Storefronts without the feature simply never resolve; the gate stays
155
- // held and engagement remains the only unlock.
156
- }
157
- };
158
- const createShopifyConsentProvider = () => ({
159
- name: 'shopify-customer-privacy',
160
- read: readSnapshot,
161
- subscribe(onChange) {
162
- const publish = () => {
163
- log('visitorConsentCollected — the visitor answered the banner');
164
- onChange(readSnapshot());
165
- };
166
-
167
- // The visitor may have answered the banner before this bundle existed, so
168
- // the event is an update — never the first read.
169
- if (typeof document !== 'undefined') {
170
- document.addEventListener('visitorConsentCollected', publish);
171
- }
172
- requestConsentApi(() => onChange(readSnapshot()));
173
- return () => {
174
- if (typeof document !== 'undefined') {
175
- document.removeEventListener('visitorConsentCollected', publish);
176
- }
177
- };
178
- }
179
- });
180
- exports.createShopifyConsentProvider = createShopifyConsentProvider;
181
- //# sourceMappingURL=shopifyProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_types","require","CONSENT_FEATURE","name","version","log","args","console","debug","getShopify","window","Shopify","isShopifyHost","exports","toState","value","readSnapshot","_getShopify","privacy","customerPrivacy","UNKNOWN_CONSENT","consent","currentVisitorConsent","explicitAnalytics","analytics","explicitMarketing","marketing","allowed","analyticsProcessingAllowed","enforced","regulation","region","isRegulationEnforced","getRegulation","getRegion","bannerRequired","shouldShowBanner","permissiveDefault","fallbackWhenUnenforceable","performance","requestConsentApi","onReady","shopify","loadFeatures","error","createShopifyConsentProvider","read","subscribe","onChange","publish","document","addEventListener","removeEventListener"],"sources":["../../../../src/privacy/providers/shopifyProvider.ts"],"sourcesContent":["/**\n * Shopify Customer Privacy API provider — DL #218.\n *\n * Two things about this API shape the provider:\n *\n * 1. **It is not on the page by default.** `window.Shopify.customerPrivacy` is\n * `undefined` until somebody asks for it with `Shopify.loadFeatures`. The\n * theme app extension warms it so it is ready before the bundle mounts;\n * this provider still requests it, because the extension may not be\n * installed and the request is idempotent.\n *\n * 2. **`visitorConsentCollected` may have already fired.** The bundle executes\n * into an already-rendered storefront page (DL #217), so `read()` answers\n * from current state and the event is only ever an update.\n *\n * The region rule is the one judgement encoded here, and it keys off\n * `isRegulationEnforced()` rather than `shouldShowBanner()`. The two are not\n * interchangeable: the banner reflects what the *merchant* configured, while\n * enforcement reflects what the *visitor's jurisdiction* requires. A store with\n * an empty consent configuration reports \"no banner needed\" everywhere,\n * including inside the EU.\n */\n\nimport {\n UNKNOWN_CONSENT,\n type ConsentProvider,\n type ConsentSnapshot,\n type ConsentState,\n} from '../types';\n\ntype ShopifyConsentValue = 'yes' | 'no' | '' | undefined;\n\ninterface ShopifyVisitorConsent {\n analytics?: ShopifyConsentValue;\n marketing?: ShopifyConsentValue;\n preferences?: ShopifyConsentValue;\n sale_of_data?: ShopifyConsentValue;\n}\n\ninterface ShopifyCustomerPrivacy {\n analyticsProcessingAllowed?: () => boolean;\n marketingAllowed?: () => boolean;\n currentVisitorConsent?: () => ShopifyVisitorConsent;\n shouldShowBanner?: () => boolean;\n /** Whether a privacy regulation applies to this visitor's region. */\n isRegulationEnforced?: () => boolean;\n /** e.g. 'GDPR', 'CCPA'. */\n getRegulation?: () => string;\n /** e.g. 'DEBE' — country + subdivision. */\n getRegion?: () => string;\n}\n\ninterface ShopifyGlobal {\n customerPrivacy?: ShopifyCustomerPrivacy;\n loadFeatures?: (\n features: { name: string; version: string }[],\n callback: (error?: unknown) => void,\n ) => void;\n}\n\nconst CONSENT_FEATURE = { name: 'consent-tracking-api', version: '0.1' };\n\nconst log = (...args: unknown[]): void => {\n try {\n console.debug('[w5-consent] shopify:', ...args);\n } catch {\n /* never break on a console */\n }\n};\n\nconst getShopify = (): ShopifyGlobal | null => {\n if (typeof window === 'undefined') {\n return null;\n }\n return (window as unknown as { Shopify?: ShopifyGlobal }).Shopify ?? null;\n};\n\nexport const isShopifyHost = (): boolean => getShopify() !== null;\n\nconst toState = (value: ShopifyConsentValue): ConsentState | null => {\n if (value === 'yes') {\n return 'granted';\n }\n if (value === 'no') {\n return 'denied';\n }\n return null;\n};\n\nconst readSnapshot = (): ConsentSnapshot => {\n const privacy = getShopify()?.customerPrivacy;\n if (!privacy) {\n log(\n 'customerPrivacy API not on the page — no answer available (store has no privacy configuration, or loadFeatures has not resolved yet)',\n );\n // The API has not loaded (or the store has no privacy configuration at\n // all). Not an answer — the gate holds, and the visitor's own action is\n // what unlocks the session.\n return UNKNOWN_CONSENT;\n }\n\n let consent: ShopifyVisitorConsent = {};\n try {\n consent = privacy.currentVisitorConsent?.() ?? {};\n } catch {\n // Present but not ready — treat as no answer yet.\n }\n\n const explicitAnalytics = toState(consent.analytics);\n const explicitMarketing = toState(consent.marketing);\n\n let allowed = false;\n try {\n allowed = privacy.analyticsProcessingAllowed?.() === true;\n } catch {\n allowed = false;\n }\n\n // Is a privacy regulation in force for *this visitor's* region? This is the\n // question that matters, and it is not the same question as \"is a banner\n // being shown\" — see the comment on `enforced` below.\n let enforced: boolean | null = null;\n let regulation = '';\n let region = '';\n try {\n if (typeof privacy.isRegulationEnforced === 'function') {\n enforced = privacy.isRegulationEnforced() === true;\n }\n regulation = privacy.getRegulation?.() ?? '';\n region = privacy.getRegion?.() ?? '';\n } catch {\n enforced = null;\n }\n\n let bannerRequired = true;\n try {\n bannerRequired = privacy.shouldShowBanner?.() !== false;\n } catch {\n bannerRequired = true;\n }\n\n /*\n * Measured on a live store from a Frankfurt IP, with no consent recorded:\n *\n * region 'DEBE' · regulation 'GDPR' · isRegulationEnforced() true\n * shouldShowBanner() false · analyticsProcessingAllowed() TRUE\n * getShopPrefs() { limit: [] }\n *\n * Shopify said tracking was allowed for a GDPR-protected visitor who had\n * never been asked, because the *merchant* had configured no consent\n * preferences. `shouldShowBanner()` and `analyticsProcessingAllowed()` both\n * describe the merchant's setup; neither is a statement about a legal basis.\n * A merchant's misconfiguration must not become our tracking decision, so\n * under an enforced regulation an absent answer stays `unknown` and the gate\n * holds — the visitor's own prompt is then the only thing that unlocks them.\n */\n const permissiveDefault = allowed || !bannerRequired;\n const fallbackWhenUnenforceable = permissiveDefault ? 'granted' : 'unknown';\n\n const analytics: ConsentState =\n explicitAnalytics ??\n (enforced === true ? 'unknown' : fallbackWhenUnenforceable);\n\n const marketing: ConsentState =\n explicitMarketing ??\n (enforced === true ? 'unknown' : !bannerRequired ? 'granted' : 'unknown');\n\n log(\n `read — visitorConsent.analytics=${consent.analytics ?? '(unset)'} ` +\n `analyticsProcessingAllowed=${allowed} bannerRequired=${bannerRequired} ` +\n `region=${region || '?'} regulation=${regulation || '?'} enforced=${\n enforced === null ? 'unavailable' : enforced\n }` +\n (enforced === true && explicitAnalytics === null\n ? ' → regulated and unanswered, holding'\n : '') +\n ` ⇒ ${analytics}`,\n );\n\n return {\n analytics,\n marketing,\n // Shopify has no separate performance bucket. Load telemetry carries an\n // app name and a session id to a Wix endpoint, so it answers to the same\n // answer analytics does rather than riding for free.\n performance: analytics,\n };\n};\n\n/**\n * Ask Shopify to load the consent API if it is not already there. Safe to call\n * more than once; the callback re-reads whatever state arrives.\n */\nconst requestConsentApi = (onReady: () => void): void => {\n const shopify = getShopify();\n if (!shopify || shopify.customerPrivacy || !shopify.loadFeatures) {\n return;\n }\n try {\n log('requesting consent-tracking-api via Shopify.loadFeatures…');\n shopify.loadFeatures([CONSENT_FEATURE], (error) => {\n if (error) {\n log('loadFeatures failed — gate stays held', error);\n return;\n }\n log('loadFeatures resolved — re-reading consent');\n onReady();\n });\n } catch {\n // Storefronts without the feature simply never resolve; the gate stays\n // held and engagement remains the only unlock.\n }\n};\n\nexport const createShopifyConsentProvider = (): ConsentProvider => ({\n name: 'shopify-customer-privacy',\n\n read: readSnapshot,\n\n subscribe(onChange) {\n const publish = () => {\n log('visitorConsentCollected — the visitor answered the banner');\n onChange(readSnapshot());\n };\n\n // The visitor may have answered the banner before this bundle existed, so\n // the event is an update — never the first read.\n if (typeof document !== 'undefined') {\n document.addEventListener('visitorConsentCollected', publish);\n }\n requestConsentApi(() => onChange(readSnapshot()));\n\n return () => {\n if (typeof document !== 'undefined') {\n document.removeEventListener('visitorConsentCollected', publish);\n }\n };\n },\n});\n"],"mappings":";;;;AAuBA,IAAAA,MAAA,GAAAC,OAAA;AAvBA;AACA;AACA;AAC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AGA,CAAA,MAAwB;EAClE1C,IAAI,EAAE,0BAA0B;EAEhC2C,IAAI,EAAE9B,YAAY;EAElB+B,SAASA,CAACC,QAAQ,EAAE;IAClB,MAAMC,OAAO,GAAGA,CAAA,KAAM;MACpB5C,GAAG,CAAC,2DAA2D,CAAC;MAChE2C,QAAQ,CAAChC,YAAY,CAAC,CAAC,CAAC;IAC1B,CAAC;;IAED;IACA;IACA,IAAI,OAAOkC,QAAQ,KAAK,WAAW,EAAE;MACnCA,QAAQ,CAACC,gBAAgB,CAAC,yBAAyB,EAAEF,OAAO,CAAC;IAC/D;IACAT,iBAAiB,CAAC,MAAMQ,QAAQ,CAAChC,YAAY,CAAC,CAAC,CAAC,CAAC;IAEjD,OAAO,MAAM;MACX,IAAI,OAAOkC,QAAQ,KAAK,WAAW,EAAE;QACnCA,QAAQ,CAACE,mBAAmB,CAAC,yBAAyB,EAAEH,OAAO,CAAC;MAClE;IACF,CAAC;EACH;AACF,CAAC,CAAC;AAACpC,OAAA,CAAAgC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.UNKNOWN_CONSENT = void 0;
5
- /**
6
- * Consent vocabulary shared by the gate and every provider.
7
- *
8
- * DL #218. Three states, because "we have not been told" is not the same
9
- * answer as "no" and must not be collapsed into one: a visitor who has not
10
- * been asked can still be unlocked by their own action, a visitor who
11
- * refused never can.
12
- */
13
-
14
- /**
15
- * `necessary` is never gated — auth tokens and the configuration fetch are
16
- * what make the widget work at all, and a visitor who loaded the page asked
17
- * for that much. Everything else answers to the gate.
18
- */
19
-
20
- const UNKNOWN_CONSENT = exports.UNKNOWN_CONSENT = Object.freeze({
21
- performance: 'unknown',
22
- analytics: 'unknown',
23
- marketing: 'unknown'
24
- });
25
-
26
- /**
27
- * A consent provider adapts one host's CMP to the gate.
28
- *
29
- * `read()` must answer synchronously with what is known *now*. Providers are
30
- * installed into an already-rendered storefront page (DL #217), so a provider
31
- * that only subscribes is inert — the event it waits for may have fired long
32
- * before the bundle executed. Always read first, then subscribe.
33
- */
34
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UNKNOWN_CONSENT","exports","Object","freeze","performance","analytics","marketing"],"sources":["../../../src/privacy/types.ts"],"sourcesContent":["/**\n * Consent vocabulary shared by the gate and every provider.\n *\n * DL #218. Three states, because \"we have not been told\" is not the same\n * answer as \"no\" and must not be collapsed into one: a visitor who has not\n * been asked can still be unlocked by their own action, a visitor who\n * refused never can.\n */\n\nexport type ConsentState = 'granted' | 'denied' | 'unknown';\n\n/**\n * `necessary` is never gated — auth tokens and the configuration fetch are\n * what make the widget work at all, and a visitor who loaded the page asked\n * for that much. Everything else answers to the gate.\n */\nexport type ConsentPurpose =\n | 'necessary'\n | 'performance'\n | 'analytics'\n | 'marketing';\n\nexport type GatedPurpose = Exclude<ConsentPurpose, 'necessary'>;\n\nexport type ConsentSnapshot = Record<GatedPurpose, ConsentState>;\n\nexport const UNKNOWN_CONSENT: ConsentSnapshot = Object.freeze({\n performance: 'unknown',\n analytics: 'unknown',\n marketing: 'unknown',\n});\n\n/**\n * A consent provider adapts one host's CMP to the gate.\n *\n * `read()` must answer synchronously with what is known *now*. Providers are\n * installed into an already-rendered storefront page (DL #217), so a provider\n * that only subscribes is inert — the event it waits for may have fired long\n * before the bundle executed. Always read first, then subscribe.\n */\nexport interface ConsentProvider {\n readonly name: string;\n read(): ConsentSnapshot;\n subscribe(onChange: (snapshot: ConsentSnapshot) => void): () => void;\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAWO,MAAMA,eAAgC,GAAAC,OAAA,CAAAD,eAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EAC5DC,WAAW,EAAE,SAAS;EACtBC,SAAS,EAAE,SAAS;EACpBC,SAAS,EAAE;AACb,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,122 +0,0 @@
1
- /**
2
- * The consent gate — DL #218 (revised).
3
- *
4
- * Legal cleared analytics/BI transmission to need no consent gate, so the old
5
- * `transmit()` + buffer machinery is gone. What analytics emitters used to route
6
- * through the gate now goes straight to the wire.
7
- *
8
- * Analytics AND performance telemetry both go straight to the wire now, so there
9
- * is nothing left to "transmit"-gate. What remains is the consent SIGNAL —
10
- * snapshot, engagement, provider — behind a single predicate:
11
- *
12
- * - `mayPersistToken()` — whether the visitor's OAuth token may be written to
13
- * localStorage. Persisting the token persists a cross-visit visitor identity
14
- * (its refresh token), which is the one thing consent still governs. Truth
15
- * table: granted → yes; denied → never; unknown → only once the visitor
16
- * engaged.
17
- *
18
- * Engagement (`unlockOnUserAction`, fired when the visitor submits a prompt)
19
- * resolves the `unknown` case — typing a question is a reason to remember this
20
- * visitor for the session — but it never overrides a `denied`.
21
- */
22
-
23
- import { UNKNOWN_CONSENT } from './types.js';
24
- const LOG_PREFIX = '[w5-consent]';
25
- const log = function () {
26
- try {
27
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
- args[_key] = arguments[_key];
29
- }
30
- console.debug(LOG_PREFIX, ...args);
31
- } catch {
32
- // A console that throws must never break anything.
33
- }
34
- };
35
- const describe = s => `analytics=${s.analytics} performance=${s.performance} marketing=${s.marketing}`;
36
- let snapshot = UNKNOWN_CONSENT;
37
- let engaged = false;
38
- let unsubscribeProvider = null;
39
- const listeners = new Set();
40
- const notify = () => {
41
- for (const listener of listeners) {
42
- try {
43
- listener();
44
- } catch {
45
- // A subscriber that throws must not stop the others.
46
- }
47
- }
48
- };
49
-
50
- /**
51
- * Whether the visitor's OAuth token may be persisted to `localStorage`.
52
- *
53
- * Persisting the token persists a cross-visit visitor identity (the refresh
54
- * token re-identifies the visitor on their next visit), so it answers to
55
- * consent — the one thing that still does. Explicit consent wins in both
56
- * directions; engagement resolves only the `unknown` case. The token still
57
- * lives in memory for the session regardless — only the write to storage is
58
- * gated.
59
- */
60
- export const mayPersistToken = () => {
61
- const state = snapshot.analytics;
62
- if (state === 'denied') {
63
- return false;
64
- }
65
- if (state === 'granted') {
66
- return true;
67
- }
68
- return engaged;
69
- };
70
-
71
- /**
72
- * The visitor did something deliberate — submitted a prompt — so we may remember
73
- * them for the session even though no CMP has answered. Unlocks the `unknown`
74
- * case only; it cannot override a `denied`.
75
- */
76
- export const unlockOnUserAction = () => {
77
- if (engaged) {
78
- return;
79
- }
80
- engaged = true;
81
- log('UNLOCK — visitor submitted a prompt');
82
- notify();
83
- };
84
- export const getConsentSnapshot = () => snapshot;
85
- export const subscribeToConsent = listener => {
86
- listeners.add(listener);
87
- return () => {
88
- listeners.delete(listener);
89
- };
90
- };
91
- const applySnapshot = next => {
92
- if (next.analytics === snapshot.analytics && next.marketing === snapshot.marketing && next.performance === snapshot.performance) {
93
- return;
94
- }
95
- log(`ANSWER — ${describe(snapshot)} → ${describe(next)}`);
96
- snapshot = Object.freeze({
97
- ...next
98
- });
99
- notify();
100
- };
101
-
102
- /**
103
- * Install the host's provider. Reads its current state immediately, *then*
104
- * subscribes — DL #217: a listener registered into an already-rendered page is
105
- * bound to an event that may have fired long before the bundle executed, so
106
- * subscribing alone would leave the gate permanently at `unknown`.
107
- */
108
- export const installConsentProvider = next => {
109
- unsubscribeProvider == null || unsubscribeProvider();
110
- const initial = next.read();
111
- log(`provider installed: ${next.name} — reads ${describe(initial)}`);
112
- applySnapshot(initial);
113
- unsubscribeProvider = next.subscribe(applySnapshot);
114
- };
115
- export const resetConsentGateForTests = () => {
116
- unsubscribeProvider == null || unsubscribeProvider();
117
- unsubscribeProvider = null;
118
- snapshot = UNKNOWN_CONSENT;
119
- engaged = false;
120
- listeners.clear();
121
- };
122
- //# sourceMappingURL=consentGate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UNKNOWN_CONSENT","LOG_PREFIX","log","_len","arguments","length","args","Array","_key","console","debug","describe","s","analytics","performance","marketing","snapshot","engaged","unsubscribeProvider","listeners","Set","notify","listener","mayPersistToken","state","unlockOnUserAction","getConsentSnapshot","subscribeToConsent","add","delete","applySnapshot","next","Object","freeze","installConsentProvider","initial","read","name","subscribe","resetConsentGateForTests","clear"],"sources":["../../../src/privacy/consentGate.ts"],"sourcesContent":["/**\n * The consent gate — DL #218 (revised).\n *\n * Legal cleared analytics/BI transmission to need no consent gate, so the old\n * `transmit()` + buffer machinery is gone. What analytics emitters used to route\n * through the gate now goes straight to the wire.\n *\n * Analytics AND performance telemetry both go straight to the wire now, so there\n * is nothing left to \"transmit\"-gate. What remains is the consent SIGNAL —\n * snapshot, engagement, provider — behind a single predicate:\n *\n * - `mayPersistToken()` — whether the visitor's OAuth token may be written to\n * localStorage. Persisting the token persists a cross-visit visitor identity\n * (its refresh token), which is the one thing consent still governs. Truth\n * table: granted → yes; denied → never; unknown → only once the visitor\n * engaged.\n *\n * Engagement (`unlockOnUserAction`, fired when the visitor submits a prompt)\n * resolves the `unknown` case — typing a question is a reason to remember this\n * visitor for the session — but it never overrides a `denied`.\n */\n\nimport {\n UNKNOWN_CONSENT,\n type ConsentProvider,\n type ConsentSnapshot,\n} from './types';\n\nconst LOG_PREFIX = '[w5-consent]';\n\nconst log = (...args: unknown[]): void => {\n try {\n console.debug(LOG_PREFIX, ...args);\n } catch {\n // A console that throws must never break anything.\n }\n};\n\nconst describe = (s: ConsentSnapshot): string =>\n `analytics=${s.analytics} performance=${s.performance} marketing=${s.marketing}`;\n\ntype Listener = () => void;\n\nlet snapshot: ConsentSnapshot = UNKNOWN_CONSENT;\nlet engaged = false;\nlet unsubscribeProvider: (() => void) | null = null;\n\nconst listeners = new Set<Listener>();\n\nconst notify = (): void => {\n for (const listener of listeners) {\n try {\n listener();\n } catch {\n // A subscriber that throws must not stop the others.\n }\n }\n};\n\n/**\n * Whether the visitor's OAuth token may be persisted to `localStorage`.\n *\n * Persisting the token persists a cross-visit visitor identity (the refresh\n * token re-identifies the visitor on their next visit), so it answers to\n * consent — the one thing that still does. Explicit consent wins in both\n * directions; engagement resolves only the `unknown` case. The token still\n * lives in memory for the session regardless — only the write to storage is\n * gated.\n */\nexport const mayPersistToken = (): boolean => {\n const state = snapshot.analytics;\n if (state === 'denied') {\n return false;\n }\n if (state === 'granted') {\n return true;\n }\n return engaged;\n};\n\n/**\n * The visitor did something deliberate — submitted a prompt — so we may remember\n * them for the session even though no CMP has answered. Unlocks the `unknown`\n * case only; it cannot override a `denied`.\n */\nexport const unlockOnUserAction = (): void => {\n if (engaged) {\n return;\n }\n engaged = true;\n log('UNLOCK — visitor submitted a prompt');\n notify();\n};\n\nexport const getConsentSnapshot = (): ConsentSnapshot => snapshot;\n\nexport const subscribeToConsent = (listener: Listener): (() => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n};\n\nconst applySnapshot = (next: ConsentSnapshot): void => {\n if (\n next.analytics === snapshot.analytics &&\n next.marketing === snapshot.marketing &&\n next.performance === snapshot.performance\n ) {\n return;\n }\n log(`ANSWER — ${describe(snapshot)} → ${describe(next)}`);\n snapshot = Object.freeze({ ...next });\n notify();\n};\n\n/**\n * Install the host's provider. Reads its current state immediately, *then*\n * subscribes — DL #217: a listener registered into an already-rendered page is\n * bound to an event that may have fired long before the bundle executed, so\n * subscribing alone would leave the gate permanently at `unknown`.\n */\nexport const installConsentProvider = (next: ConsentProvider): void => {\n unsubscribeProvider?.();\n const initial = next.read();\n log(`provider installed: ${next.name} — reads ${describe(initial)}`);\n applySnapshot(initial);\n unsubscribeProvider = next.subscribe(applySnapshot);\n};\n\nexport const resetConsentGateForTests = (): void => {\n unsubscribeProvider?.();\n unsubscribeProvider = null;\n snapshot = UNKNOWN_CONSENT;\n engaged = false;\n listeners.clear();\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,eAAe,QAGV,SAAS;AAEhB,M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mBAAmB,CAAG,CAAC;EACvBA,mBAAmB,GAAG,IAAI;EAC1BF,QAAQ,GAAGhB,eAAe;EAC1BiB,OAAO,GAAG,KAAK;EACfE,SAAS,CAACqB,KAAK,CAAC,CAAC;AACnB,CAAC","ignoreList":[]}
@@ -1,87 +0,0 @@
1
- /**
2
- * Consent override (debug-only) — DL #218.
3
- *
4
- * Shopify only serves its cookie banner where consent is legally required, so
5
- * from most of the world `shouldShowBanner()` is `false` and there is no way to
6
- * reach the `unknown` or `denied` branches by hand. Development stores often
7
- * have no privacy configuration at all, which pins the gate at `unknown`
8
- * forever. Neither is a bug, and both make the interesting states unreachable
9
- * from a browser.
10
- *
11
- * This forces the gate's answer so all four rows of the truth table can be
12
- * walked on any store, in any region, published or not.
13
- *
14
- * ?w5consent=granted | denied | unknown (one-shot)
15
- * localStorage["w5_consent_override"] (sticky)
16
- *
17
- * **The two are not equally trusted, on purpose.** A link is something one
18
- * person can send another, so a query param may only ever *reduce* what is
19
- * collected: `denied` is honoured anywhere, while `granted` and `unknown` are
20
- * honoured only on a local origin. Turning tracking *on* for someone else by
21
- * sending them a URL is exactly the thing this whole feature exists to
22
- * prevent. On a real storefront, set the localStorage key in devtools — which
23
- * is a deliberate act by the person whose browser it is.
24
- */
25
-
26
- export const CONSENT_OVERRIDE_KEY = 'w5_consent_override';
27
- export const CONSENT_OVERRIDE_QUERY_PARAM = 'w5consent';
28
- const VALID = ['granted', 'denied', 'unknown'];
29
- const isConsentState = value => typeof value === 'string' && VALID.includes(value);
30
-
31
- /** Only a local origin may force a *more* permissive state from a URL. */
32
- const isLocalOrigin = () => {
33
- try {
34
- const {
35
- hostname
36
- } = window.location;
37
- return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local');
38
- } catch {
39
- return false;
40
- }
41
- };
42
- const readQueryParam = () => {
43
- try {
44
- const raw = new URLSearchParams(window.location.search).get(CONSENT_OVERRIDE_QUERY_PARAM);
45
- if (!isConsentState(raw)) {
46
- return null;
47
- }
48
- // `denied` can only ever collect less, so a link may set it anywhere.
49
- if (raw === 'denied' || isLocalOrigin()) {
50
- return raw;
51
- }
52
- console.warn(`[w5-consent] ignoring ?${CONSENT_OVERRIDE_QUERY_PARAM}=${raw} — only "denied" is accepted from a URL off a local origin. ` + `Set localStorage["${CONSENT_OVERRIDE_KEY}"] = "${raw}" instead.`);
53
- return null;
54
- } catch {
55
- return null;
56
- }
57
- };
58
- const readStorage = () => {
59
- try {
60
- const raw = localStorage.getItem(CONSENT_OVERRIDE_KEY);
61
- return isConsentState(raw) ? raw : null;
62
- } catch {
63
- return null;
64
- }
65
- };
66
-
67
- /** The forced consent state, or `null` when no override is active. */
68
- export const getConsentOverride = () => readQueryParam() ?? readStorage();
69
- export const overrideSnapshot = state => ({
70
- analytics: state,
71
- marketing: state,
72
- performance: state
73
- });
74
-
75
- /** Persist the override and apply it on the next load. `null` clears it. */
76
- export const setConsentOverride = state => {
77
- try {
78
- if (state) {
79
- localStorage.setItem(CONSENT_OVERRIDE_KEY, state);
80
- } else {
81
- localStorage.removeItem(CONSENT_OVERRIDE_KEY);
82
- }
83
- } catch {
84
- // Ignore — the override simply won't persist.
85
- }
86
- };
87
- //# sourceMappingURL=consentOverride.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CONSENT_OVERRIDE_KEY","CONSENT_OVERRIDE_QUERY_PARAM","VALID","isConsentState","value","includes","isLocalOrigin","hostname","window","location","endsWith","readQueryParam","raw","URLSearchParams","search","get","console","warn","readStorage","localStorage","getItem","getConsentOverride","overrideSnapshot","state","analytics","marketing","performance","setConsentOverride","setItem","removeItem"],"sources":["../../../src/privacy/consentOverride.ts"],"sourcesContent":["/**\n * Consent override (debug-only) — DL #218.\n *\n * Shopify only serves its cookie banner where consent is legally required, so\n * from most of the world `shouldShowBanner()` is `false` and there is no way to\n * reach the `unknown` or `denied` branches by hand. Development stores often\n * have no privacy configuration at all, which pins the gate at `unknown`\n * forever. Neither is a bug, and both make the interesting states unreachable\n * from a browser.\n *\n * This forces the gate's answer so all four rows of the truth table can be\n * walked on any store, in any region, published or not.\n *\n * ?w5consent=granted | denied | unknown (one-shot)\n * localStorage[\"w5_consent_override\"] (sticky)\n *\n * **The two are not equally trusted, on purpose.** A link is something one\n * person can send another, so a query param may only ever *reduce* what is\n * collected: `denied` is honoured anywhere, while `granted` and `unknown` are\n * honoured only on a local origin. Turning tracking *on* for someone else by\n * sending them a URL is exactly the thing this whole feature exists to\n * prevent. On a real storefront, set the localStorage key in devtools — which\n * is a deliberate act by the person whose browser it is.\n */\n\nimport type { ConsentSnapshot, ConsentState } from './types';\n\nexport const CONSENT_OVERRIDE_KEY = 'w5_consent_override';\nexport const CONSENT_OVERRIDE_QUERY_PARAM = 'w5consent';\n\nconst VALID: readonly ConsentState[] = ['granted', 'denied', 'unknown'];\n\nconst isConsentState = (value: unknown): value is ConsentState =>\n typeof value === 'string' && (VALID as readonly string[]).includes(value);\n\n/** Only a local origin may force a *more* permissive state from a URL. */\nconst isLocalOrigin = (): boolean => {\n try {\n const { hostname } = window.location;\n return (\n hostname === 'localhost' ||\n hostname === '127.0.0.1' ||\n hostname.endsWith('.local')\n );\n } catch {\n return false;\n }\n};\n\nconst readQueryParam = (): ConsentState | null => {\n try {\n const raw = new URLSearchParams(window.location.search).get(\n CONSENT_OVERRIDE_QUERY_PARAM,\n );\n if (!isConsentState(raw)) {\n return null;\n }\n // `denied` can only ever collect less, so a link may set it anywhere.\n if (raw === 'denied' || isLocalOrigin()) {\n return raw;\n }\n console.warn(\n `[w5-consent] ignoring ?${CONSENT_OVERRIDE_QUERY_PARAM}=${raw} — only \"denied\" is accepted from a URL off a local origin. ` +\n `Set localStorage[\"${CONSENT_OVERRIDE_KEY}\"] = \"${raw}\" instead.`,\n );\n return null;\n } catch {\n return null;\n }\n};\n\nconst readStorage = (): ConsentState | null => {\n try {\n const raw = localStorage.getItem(CONSENT_OVERRIDE_KEY);\n return isConsentState(raw) ? raw : null;\n } catch {\n return null;\n }\n};\n\n/** The forced consent state, or `null` when no override is active. */\nexport const getConsentOverride = (): ConsentState | null =>\n readQueryParam() ?? readStorage();\n\nexport const overrideSnapshot = (state: ConsentState): ConsentSnapshot => ({\n analytics: state,\n marketing: state,\n performance: state,\n});\n\n/** Persist the override and apply it on the next load. `null` clears it. */\nexport const setConsentOverride = (state: ConsentState | null): void => {\n try {\n if (state) {\n localStorage.setItem(CONSENT_OVERRIDE_KEY, state);\n } else {\n localStorage.removeItem(CONSENT_OVERRIDE_KEY);\n }\n } catch {\n // Ignore — the override simply won't persist.\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,oBAAoB,GAAG,qBAAqB;AACzD,OAAO,MAAMC,4BAA4B,GAAG,WAAW;AAEvD,MAAMC,KAA8B,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;AAEvE,MAAMC,cAAc,GAAIC,KAAc,IACpC,OAAOA,KAAK,KAAK,QAAQ,IAAKF,KAAK,CAAuBG,QAAQ,CAACD,KAAK,CAAC;;AAE3E;AACA,MAAME,aAAa,GAAGA,CAAA,KAAe;EACnC,IAAI;IACF,MAAM;MAAEC;IAAS,CAAC,GAAGC,MAAM,CAACC,QAAQ;IACpC,OACEF,QAAQ,KAAK,WAAW,IACxBA,QAAQ,KAAK,WAAW,IACxBA,QAAQ,CAACG,QAAQ,CAAC,QAAQ,CAAC;EAE/B,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF,CAAC;AAED,MAAMC,cAAc,GAAGA,CAAA,KAA2B;EAChD,IAAI;IACF,MAAMC,GAAG,GAAG,IAAIC,eAAe,CAACL,MAAM,CAACC,QAAQ,CAACK,MAAM,CAAC,CAACC,GAAG,CACzDd,4BACF,CAAC;IACD,IAAI,CAACE,cAAc,CAACS,GAAG,CAAC,EAAE;MACxB,OAAO,IAAI;IACb;IACA;IACA,IAAIA,GAAG,KAAK,QAAQ,IAAIN,aAAa,CAAC,CAAC,EAAE;MACvC,OAAOM,GAAG;IACZ;IACAI,OAAO,CAACC,IAAI,CACV,0BAA0BhB,4BAA4B,IAAIW,GAAG,8DAA8D,GACzH,qBAAqBZ,oBAAoB,SAASY,GAAG,YACzD,CAAC;IACD,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC;AAED,MAAMM,WAAW,GAAGA,CAAA,KAA2B;EAC7C,IAAI;IACF,MAAMN,GAAG,GAAGO,YAAY,CAACC,OAAO,CAACpB,oBAAoB,CAAC;IACtD,OAAOG,cAAc,CAACS,GAAG,CAAC,GAAGA,GAAG,GAAG,IAAI;EACzC,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA,OAAO,MAAMS,kBAAkB,GAAGA,CAAA,KAChCV,cAAc,CAAC,CAAC,IAAIO,WAAW,CAAC,CAAC;AAEnC,OAAO,MAAMI,gBAAgB,GAAIC,KAAmB,KAAuB;EACzEC,SAAS,EAAED,KAAK;EAChBE,SAAS,EAAEF,KAAK;EAChBG,WAAW,EAAEH;AACf,CAAC,CAAC;;AAEF;AACA,OAAO,MAAMI,kBAAkB,GAAIJ,KAA0B,IAAW;EACtE,IAAI;IACF,IAAIA,KAAK,EAAE;MACTJ,YAAY,CAACS,OAAO,CAAC5B,oBAAoB,EAAEuB,KAAK,CAAC;IACnD,CAAC,MAAM;MACLJ,YAAY,CAACU,UAAU,CAAC7B,oBAAoB,CAAC;IAC/C;EACF,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC","ignoreList":[]}
@@ -1,65 +0,0 @@
1
- /**
2
- * Provider selection — DL #218.
3
- *
4
- * Detected at boot, not configured per client, because a merchant can install
5
- * a CMP long after we deploy and the bundle is not the source of truth for a
6
- * store's behaviour (DL #214).
7
- *
8
- * Order is host-supplied → Shopify → OneTrust → none. A host that publishes an
9
- * answer outranks anything we could sniff, because it knows things we cannot:
10
- * a server-side consent record, a CMP behind its own abstraction, or a legal
11
- * position we have no business guessing at.
12
- *
13
- * When nothing is detected the gate keeps its default — everything `unknown`,
14
- * held until the visitor acts. That is the case on every Shopify store with no
15
- * privacy configuration, which today is most of them.
16
- */
17
-
18
- import { installConsentProvider } from './consentGate.js';
19
- import { getConsentOverride, overrideSnapshot } from './consentOverride.js';
20
- import { createHostSuppliedConsentProvider, hasHostSuppliedConsent } from './providers/hostSuppliedProvider.js';
21
- import { createShopifyConsentProvider, isShopifyHost } from './providers/shopifyProvider.js';
22
- import { createOneTrustConsentProvider, isOneTrustHost } from './providers/oneTrustProvider.js';
23
- export const detectConsentProvider = () => {
24
- // Debug override outranks every real signal, so the states a region or an
25
- // unconfigured store makes unreachable can still be walked by hand.
26
- const forced = getConsentOverride();
27
- if (forced) {
28
- console.warn(`[w5-consent] OVERRIDE ACTIVE — consent forced to "${forced}". This is a debug switch, not a real answer.`);
29
- return {
30
- name: `override:${forced}`,
31
- read: () => overrideSnapshot(forced),
32
- subscribe: () => () => {}
33
- };
34
- }
35
- if (hasHostSuppliedConsent()) {
36
- return createHostSuppliedConsentProvider();
37
- }
38
- if (isShopifyHost()) {
39
- return createShopifyConsentProvider();
40
- }
41
- if (isOneTrustHost()) {
42
- return createOneTrustConsentProvider();
43
- }
44
- return null;
45
- };
46
-
47
- /**
48
- * Install the detected provider, if any. Call once at boot, before the first
49
- * emitter runs — anything raised earlier is held rather than lost, but the
50
- * sooner this runs the less the buffer has to carry.
51
- */
52
- export const initConsentGate = () => {
53
- const provider = detectConsentProvider();
54
- if (provider) {
55
- installConsentProvider(provider);
56
- } else {
57
- try {
58
- console.debug('[w5-consent] no CMP detected (no host-supplied consent, no Shopify customerPrivacy, no OneTrust) — everything held until the visitor submits a prompt');
59
- } catch {
60
- /* never break on a console */
61
- }
62
- }
63
- return provider;
64
- };
65
- //# sourceMappingURL=detectProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["installConsentProvider","getConsentOverride","overrideSnapshot","createHostSuppliedConsentProvider","hasHostSuppliedConsent","createShopifyConsentProvider","isShopifyHost","createOneTrustConsentProvider","isOneTrustHost","detectConsentProvider","forced","console","warn","name","read","subscribe","initConsentGate","provider","debug"],"sources":["../../../src/privacy/detectProvider.ts"],"sourcesContent":["/**\n * Provider selection — DL #218.\n *\n * Detected at boot, not configured per client, because a merchant can install\n * a CMP long after we deploy and the bundle is not the source of truth for a\n * store's behaviour (DL #214).\n *\n * Order is host-supplied → Shopify → OneTrust → none. A host that publishes an\n * answer outranks anything we could sniff, because it knows things we cannot:\n * a server-side consent record, a CMP behind its own abstraction, or a legal\n * position we have no business guessing at.\n *\n * When nothing is detected the gate keeps its default — everything `unknown`,\n * held until the visitor acts. That is the case on every Shopify store with no\n * privacy configuration, which today is most of them.\n */\n\nimport { installConsentProvider } from './consentGate';\nimport { getConsentOverride, overrideSnapshot } from './consentOverride';\nimport type { ConsentProvider } from './types';\nimport {\n createHostSuppliedConsentProvider,\n hasHostSuppliedConsent,\n} from './providers/hostSuppliedProvider';\nimport {\n createShopifyConsentProvider,\n isShopifyHost,\n} from './providers/shopifyProvider';\nimport {\n createOneTrustConsentProvider,\n isOneTrustHost,\n} from './providers/oneTrustProvider';\n\nexport const detectConsentProvider = (): ConsentProvider | null => {\n // Debug override outranks every real signal, so the states a region or an\n // unconfigured store makes unreachable can still be walked by hand.\n const forced = getConsentOverride();\n if (forced) {\n console.warn(\n `[w5-consent] OVERRIDE ACTIVE — consent forced to \"${forced}\". This is a debug switch, not a real answer.`,\n );\n return {\n name: `override:${forced}`,\n read: () => overrideSnapshot(forced),\n subscribe: () => () => {},\n };\n }\n if (hasHostSuppliedConsent()) {\n return createHostSuppliedConsentProvider();\n }\n if (isShopifyHost()) {\n return createShopifyConsentProvider();\n }\n if (isOneTrustHost()) {\n return createOneTrustConsentProvider();\n }\n return null;\n};\n\n/**\n * Install the detected provider, if any. Call once at boot, before the first\n * emitter runs — anything raised earlier is held rather than lost, but the\n * sooner this runs the less the buffer has to carry.\n */\nexport const initConsentGate = (): ConsentProvider | null => {\n const provider = detectConsentProvider();\n if (provider) {\n installConsentProvider(provider);\n } else {\n try {\n console.debug(\n '[w5-consent] no CMP detected (no host-supplied consent, no Shopify customerPrivacy, no OneTrust) — everything held until the visitor submits a prompt',\n );\n } catch {\n /* never break on a console */\n }\n }\n return provider;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,QAAQ,eAAe;AACtD,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ,mBAAmB;AAExE,SACEC,iCAAiC,EACjCC,sBAAsB,QACjB,kCAAkC;AACzC,SACEC,4BAA4B,EAC5BC,aAAa,QACR,6BAA6B;AACpC,SACEC,6BAA6B,EAC7BC,cAAc,QACT,8BAA8B;AAErC,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAA8B;EACjE;EACA;EACA,MAAMC,MAAM,GAAGT,kBAAkB,CAAC,CAAC;EACnC,IAAIS,MAAM,EAAE;IACVC,OAAO,CAACC,IAAI,CACV,qDAAqDF,MAAM,+CAC7D,CAAC;IACD,OAAO;MACLG,IAAI,EAAE,YAAYH,MAAM,EAAE;MAC1BI,IAAI,EAAEA,CAAA,KAAMZ,gBAAgB,CAACQ,MAAM,CAAC;MACpCK,SAAS,EAAEA,CAAA,KAAM,MAAM,CAAC;IAC1B,CAAC;EACH;EACA,IAAIX,sBAAsB,CAAC,CAAC,EAAE;IAC5B,OAAOD,iCAAiC,CAAC,CAAC;EAC5C;EACA,IAAIG,aAAa,CAAC,CAAC,EAAE;IACnB,OAAOD,4BAA4B,CAAC,CAAC;EACvC;EACA,IAAIG,cAAc,CAAC,CAAC,EAAE;IACpB,OAAOD,6BAA6B,CAAC,CAAC;EACxC;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,eAAe,GAAGA,CAAA,KAA8B;EAC3D,MAAMC,QAAQ,GAAGR,qBAAqB,CAAC,CAAC;EACxC,IAAIQ,QAAQ,EAAE;IACZjB,sBAAsB,CAACiB,QAAQ,CAAC;EAClC,CAAC,MAAM;IACL,IAAI;MACFN,OAAO,CAACO,KAAK,CACX,uJACF,CAAC;IACH,CAAC,CAAC,MAAM;MACN;IAAA;EAEJ;EACA,OAAOD,QAAQ;AACjB,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- export { UNKNOWN_CONSENT } from './types.js';
2
- export { unlockOnUserAction, mayPersistToken, getConsentSnapshot, subscribeToConsent, installConsentProvider, resetConsentGateForTests } from './consentGate.js';
3
- export { detectConsentProvider, initConsentGate } from './detectProvider.js';
4
- export { CONSENT_OVERRIDE_KEY, CONSENT_OVERRIDE_QUERY_PARAM, getConsentOverride, setConsentOverride } from './consentOverride.js';
5
- export { createShopifyConsentProvider, isShopifyHost } from './providers/shopifyProvider.js';
6
- export { createOneTrustConsentProvider, isOneTrustHost } from './providers/oneTrustProvider.js';
7
- export { HOST_CONSENT_GLOBAL, createHostSuppliedConsentProvider, hasHostSuppliedConsent, publishHostConsent } from './providers/hostSuppliedProvider.js';
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["UNKNOWN_CONSENT","unlockOnUserAction","mayPersistToken","getConsentSnapshot","subscribeToConsent","installConsentProvider","resetConsentGateForTests","detectConsentProvider","initConsentGate","CONSENT_OVERRIDE_KEY","CONSENT_OVERRIDE_QUERY_PARAM","getConsentOverride","setConsentOverride","createShopifyConsentProvider","isShopifyHost","createOneTrustConsentProvider","isOneTrustHost","HOST_CONSENT_GLOBAL","createHostSuppliedConsentProvider","hasHostSuppliedConsent","publishHostConsent"],"sources":["../../../src/privacy/index.ts"],"sourcesContent":["export {\n type ConsentState,\n type ConsentPurpose,\n type GatedPurpose,\n type ConsentSnapshot,\n type ConsentProvider,\n UNKNOWN_CONSENT,\n} from './types';\n\nexport {\n unlockOnUserAction,\n mayPersistToken,\n getConsentSnapshot,\n subscribeToConsent,\n installConsentProvider,\n resetConsentGateForTests,\n} from './consentGate';\n\nexport { detectConsentProvider, initConsentGate } from './detectProvider';\n\nexport {\n CONSENT_OVERRIDE_KEY,\n CONSENT_OVERRIDE_QUERY_PARAM,\n getConsentOverride,\n setConsentOverride,\n} from './consentOverride';\n\nexport {\n createShopifyConsentProvider,\n isShopifyHost,\n} from './providers/shopifyProvider';\nexport {\n createOneTrustConsentProvider,\n isOneTrustHost,\n} from './providers/oneTrustProvider';\nexport {\n type HostConsentInput,\n HOST_CONSENT_GLOBAL,\n createHostSuppliedConsentProvider,\n hasHostSuppliedConsent,\n publishHostConsent,\n} from './providers/hostSuppliedProvider';\n"],"mappings":"AAAA,SAMEA,eAAe,QACV,SAAS;AAEhB,SACEC,kBAAkB,EAClBC,eAAe,EACfC,kBAAkB,EAClBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,QACnB,eAAe;AAEtB,SAASC,qBAAqB,EAAEC,eAAe,QAAQ,kBAAkB;AAEzE,SACEC,oBAAoB,EACpBC,4BAA4B,EAC5BC,kBAAkB,EAClBC,kBAAkB,QACb,mBAAmB;AAE1B,SACEC,4BAA4B,EAC5BC,aAAa,QACR,6BAA6B;AACpC,SACEC,6BAA6B,EAC7BC,cAAc,QACT,8BAA8B;AACrC,SAEEC,mBAAmB,EACnBC,iCAAiC,EACjCC,sBAAsB,EACtBC,kBAAkB,QACb,kCAAkC","ignoreList":[]}