@wix/web5-core 1.63.43 → 1.63.45

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 (49) hide show
  1. package/dist/cjs/client/applyThemeOverrides.js +41 -9
  2. package/dist/cjs/client/applyThemeOverrides.js.map +1 -1
  3. package/dist/cjs/client/themeDebug.js +15 -6
  4. package/dist/cjs/client/themeDebug.js.map +1 -1
  5. package/dist/cjs/index.js +16 -13
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/privacy/consentGate.js +32 -178
  8. package/dist/cjs/privacy/consentGate.js.map +1 -1
  9. package/dist/cjs/privacy/index.js +2 -9
  10. package/dist/cjs/privacy/index.js.map +1 -1
  11. package/dist/cjs/theme/themeScheme.js +375 -0
  12. package/dist/cjs/theme/themeScheme.js.map +1 -0
  13. package/dist/cjs/theme/tokenContract.js +8 -1
  14. package/dist/cjs/theme/tokenContract.js.map +1 -1
  15. package/dist/cjs/utils/analyticsEvents.js +16 -37
  16. package/dist/cjs/utils/analyticsEvents.js.map +1 -1
  17. package/dist/esm/client/applyThemeOverrides.js +42 -10
  18. package/dist/esm/client/applyThemeOverrides.js.map +1 -1
  19. package/dist/esm/client/themeDebug.js +15 -6
  20. package/dist/esm/client/themeDebug.js.map +1 -1
  21. package/dist/esm/index.js +4 -3
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/privacy/consentGate.js +30 -173
  24. package/dist/esm/privacy/consentGate.js.map +1 -1
  25. package/dist/esm/privacy/index.js +1 -1
  26. package/dist/esm/privacy/index.js.map +1 -1
  27. package/dist/esm/theme/themeScheme.js +372 -0
  28. package/dist/esm/theme/themeScheme.js.map +1 -0
  29. package/dist/esm/theme/tokenContract.js +7 -0
  30. package/dist/esm/theme/tokenContract.js.map +1 -1
  31. package/dist/esm/utils/analyticsEvents.js +16 -36
  32. package/dist/esm/utils/analyticsEvents.js.map +1 -1
  33. package/dist/types/client/applyThemeOverrides.d.ts +1 -1
  34. package/dist/types/client/applyThemeOverrides.d.ts.map +1 -1
  35. package/dist/types/client/themeDebug.d.ts +2 -2
  36. package/dist/types/client/themeDebug.d.ts.map +1 -1
  37. package/dist/types/index.d.ts +4 -3
  38. package/dist/types/index.d.ts.map +1 -1
  39. package/dist/types/privacy/consentGate.d.ts +28 -61
  40. package/dist/types/privacy/consentGate.d.ts.map +1 -1
  41. package/dist/types/privacy/index.d.ts +1 -1
  42. package/dist/types/privacy/index.d.ts.map +1 -1
  43. package/dist/types/theme/themeScheme.d.ts +79 -0
  44. package/dist/types/theme/themeScheme.d.ts.map +1 -0
  45. package/dist/types/theme/tokenContract.d.ts +6 -0
  46. package/dist/types/theme/tokenContract.d.ts.map +1 -1
  47. package/dist/types/utils/analyticsEvents.d.ts +0 -10
  48. package/dist/types/utils/analyticsEvents.d.ts.map +1 -1
  49. package/package.json +2 -2
@@ -1,36 +1,26 @@
1
1
  /**
2
- * The consent gate — DL #218.
2
+ * The consent gate — DL #218 (revised).
3
3
  *
4
- * Every BI, telemetry and analytics emitter in web5 goes through `transmit()`
5
- * instead of calling its transport directly. The gate exists because the
6
- * consent signal resolves *after* the events that need it: Shopify's consent
7
- * API is not on the page by default and has to be requested, and the fedops
8
- * app-load pair fires inside that window. A boolean checked at each call site
9
- * can only ever drop an event that is already in flight; the gate can hold it.
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.
10
7
  *
11
- * Two independent unlocks, and they do not compose as a plain "either/or":
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:
12
11
  *
13
- * | consent | engaged | result |
14
- * |-----------|---------|---------------------------------|
15
- * | granted | either | transmit |
16
- * | unknown | no | hold in the buffer |
17
- * | unknown | yes | transmit, and flush what's held |
18
- * | denied | yes | still nothing |
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.
19
17
  *
20
- * Denied outranks engaged. A visitor who refused analytics in the banner does
21
- * not re-enable tracking by typing a question.
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`.
22
21
  */
23
22
 
24
23
  import { UNKNOWN_CONSENT } from './types.js';
25
-
26
- /** Held events are dropped past this many — a runaway emitter must not become a leak. */
27
- const DEFAULT_BUFFER_LIMIT = 50;
28
-
29
- /**
30
- * One prefix for the whole consent trail, so `[w5-consent]` in the console
31
- * filter shows the full story: which CMP was found, what it answered, and for
32
- * every event whether it was sent, held, dropped or replayed.
33
- */
34
24
  const LOG_PREFIX = '[w5-consent]';
35
25
  const log = function () {
36
26
  try {
@@ -39,55 +29,36 @@ const log = function () {
39
29
  }
40
30
  console.debug(LOG_PREFIX, ...args);
41
31
  } catch {
42
- // A console that throws must never break a send.
32
+ // A console that throws must never break anything.
43
33
  }
44
34
  };
45
35
  const describe = s => `analytics=${s.analytics} performance=${s.performance} marketing=${s.marketing}`;
46
36
  let snapshot = UNKNOWN_CONSENT;
47
37
  let engaged = false;
48
- let provider = null;
49
38
  let unsubscribeProvider = null;
50
- let buffer = [];
51
- let bufferLimit = DEFAULT_BUFFER_LIMIT;
52
- let droppedFromOverflow = 0;
53
39
  const listeners = new Set();
54
-
55
- /**
56
- * Cached so `getGateView` is referentially stable between changes —
57
- * `useSyncExternalStore` re-renders forever if the snapshot is a fresh object
58
- * on every read.
59
- */
60
- let view = Object.freeze({
61
- consent: UNKNOWN_CONSENT,
62
- engaged: false
63
- });
64
- const rebuildView = () => {
65
- view = Object.freeze({
66
- consent: snapshot,
67
- engaged
68
- });
69
- };
70
40
  const notify = () => {
71
41
  for (const listener of listeners) {
72
42
  try {
73
43
  listener();
74
44
  } catch {
75
- // A subscriber that throws must not stop the others, or stop a flush.
45
+ // A subscriber that throws must not stop the others.
76
46
  }
77
47
  }
78
48
  };
79
49
 
80
50
  /**
81
- * Whether an event for `purpose` may go on the wire right now.
51
+ * Whether the visitor's OAuth token may be persisted to `localStorage`.
82
52
  *
83
- * `necessary` is always allowed. For everything else: explicit consent wins in
84
- * both directions, and engagement resolves only the `unknown` case.
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.
85
59
  */
86
- export const mayTransmit = purpose => {
87
- if (purpose === 'necessary') {
88
- return true;
89
- }
90
- const state = snapshot[purpose];
60
+ export const mayPersistToken = () => {
61
+ const state = snapshot.analytics;
91
62
  if (state === 'denied') {
92
63
  return false;
93
64
  }
@@ -98,112 +69,19 @@ export const mayTransmit = purpose => {
98
69
  };
99
70
 
100
71
  /**
101
- * Release everything the gate is holding that is now allowed, and drop
102
- * everything that is now refused. Anything still `unknown` stays held.
103
- *
104
- * Order is preserved among released events, but a flush necessarily emits them
105
- * later than they were raised — a held app-load event reaches the wire after
106
- * the prompt that unlocked it. Anything reading these as a timeline has to
107
- * know that.
108
- */
109
- const settleBuffer = () => {
110
- if (buffer.length === 0) {
111
- return;
112
- }
113
- const stillHeld = [];
114
- const releasing = [];
115
- for (const held of buffer) {
116
- if (mayTransmit(held.purpose)) {
117
- releasing.push(held);
118
- } else if (snapshot[held.purpose] === 'denied') {
119
- // dropped on the floor, deliberately and permanently
120
- } else {
121
- stillHeld.push(held);
122
- }
123
- }
124
- const dropped = buffer.length - stillHeld.length - releasing.length;
125
- buffer = stillHeld;
126
- if (releasing.length || dropped) {
127
- log(`settle — releasing ${releasing.length}` + (dropped ? `, dropping ${dropped} (refused)` : '') + (stillHeld.length ? `, still holding ${stillHeld.length}` : ''));
128
- }
129
- for (const held of releasing) {
130
- try {
131
- log(` ↳ REPLAY ${held.label} (${held.purpose})`);
132
- held.send();
133
- } catch {
134
- // A failed send must not strand the rest of the flush.
135
- }
136
- }
137
- };
138
-
139
- /**
140
- * The single entry point for anything that would put a request on the wire.
141
- *
142
- * Allowed → sent now. Refused → dropped. Not yet known → held until an unlock
143
- * settles it, or discarded with the page.
144
- */
145
- export const transmit = function (purpose, send, label) {
146
- if (label === void 0) {
147
- label = 'event';
148
- }
149
- if (mayTransmit(purpose)) {
150
- log(`SEND ${label} (${purpose}) — allowed`);
151
- send();
152
- return;
153
- }
154
- if (purpose !== 'necessary' && snapshot[purpose] === 'denied') {
155
- log(`DROP ${label} (${purpose}) — visitor refused`);
156
- return;
157
- }
158
- if (buffer.length >= bufferLimit) {
159
- droppedFromOverflow += 1;
160
- log(`DROP ${label} (${purpose}) — buffer full at ${bufferLimit}, ${droppedFromOverflow} lost`);
161
- return;
162
- }
163
- buffer.push({
164
- purpose: purpose,
165
- send,
166
- label
167
- });
168
- log(`HOLD ${label} (${purpose}) — no answer yet, ${buffer.length} held`);
169
- };
170
-
171
- /**
172
- * The visitor did something deliberate — submitted a prompt — so the session
173
- * may be measured even though no CMP has answered.
174
- *
175
- * This is the unlock that keeps web5 measurable at all: on a Shopify store
176
- * with no privacy configuration the consent API never loads, consent stays
177
- * `unknown` forever, and without this every store would report nothing.
178
- *
179
- * It unlocks **transmission only**. Persistent identity stays gated on real
180
- * consent (see `mayPersistIdentity`) — typing a question is a reason to
181
- * measure the session, not a reason to persist an identifier across visits.
182
- * It also cannot override a `denied`.
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`.
183
75
  */
184
76
  export const unlockOnUserAction = () => {
185
77
  if (engaged) {
186
78
  return;
187
79
  }
188
80
  engaged = true;
189
- log(`UNLOCK — visitor submitted a prompt; ${buffer.length} held event(s) to settle`);
190
- rebuildView();
191
- settleBuffer();
81
+ log('UNLOCK — visitor submitted a prompt');
192
82
  notify();
193
83
  };
194
-
195
- /** Whether the visitor has taken the deliberate action that unlocks the session. */
196
- export const isUserEngaged = () => engaged;
197
-
198
- /**
199
- * Persistent, cross-visit storage of a visitor identifier requires real
200
- * consent — engagement is deliberately not enough.
201
- */
202
- export const mayPersistIdentity = () => snapshot.analytics === 'granted';
203
84
  export const getConsentSnapshot = () => snapshot;
204
-
205
- /** Referentially stable between changes, for `useSyncExternalStore`. */
206
- export const getGateView = () => view;
207
85
  export const subscribeToConsent = listener => {
208
86
  listeners.add(listener);
209
87
  return () => {
@@ -218,8 +96,6 @@ const applySnapshot = next => {
218
96
  snapshot = Object.freeze({
219
97
  ...next
220
98
  });
221
- rebuildView();
222
- settleBuffer();
223
99
  notify();
224
100
  };
225
101
 
@@ -231,35 +107,16 @@ const applySnapshot = next => {
231
107
  */
232
108
  export const installConsentProvider = next => {
233
109
  unsubscribeProvider == null || unsubscribeProvider();
234
- provider = next;
235
110
  const initial = next.read();
236
111
  log(`provider installed: ${next.name} — reads ${describe(initial)}`);
237
112
  applySnapshot(initial);
238
113
  unsubscribeProvider = next.subscribe(applySnapshot);
239
114
  };
240
- export const getInstalledProviderName = () => {
241
- var _provider;
242
- return ((_provider = provider) == null ? void 0 : _provider.name) ?? null;
243
- };
244
- export const setConsentBufferLimit = limit => {
245
- bufferLimit = Math.max(0, limit);
246
- };
247
-
248
- /** Diagnostics only — how much the gate is holding, and what it had to drop. */
249
- export const getConsentGateStats = () => ({
250
- held: buffer.length,
251
- droppedFromOverflow
252
- });
253
115
  export const resetConsentGateForTests = () => {
254
116
  unsubscribeProvider == null || unsubscribeProvider();
255
117
  unsubscribeProvider = null;
256
- provider = null;
257
118
  snapshot = UNKNOWN_CONSENT;
258
119
  engaged = false;
259
- buffer = [];
260
- bufferLimit = DEFAULT_BUFFER_LIMIT;
261
- droppedFromOverflow = 0;
262
120
  listeners.clear();
263
- rebuildView();
264
121
  };
265
122
  //# sourceMappingURL=consentGate.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UNKNOWN_CONSENT","DEFAULT_BUFFER_LIMIT","LOG_PREFIX","log","_len","arguments","length","args","Array","_key","console","debug","describe","s","analytics","performance","marketing","snapshot","engaged","provider","unsubscribeProvider","buffer","bufferLimit","droppedFromOverflow","listeners","Set","view","Object","freeze","consent","rebuildView","notify","listener","mayTransmit","purpose","state","settleBuffer","stillHeld","releasing","held","push","dropped","label","send","transmit","unlockOnUserAction","isUserEngaged","mayPersistIdentity","getConsentSnapshot","getGateView","subscribeToConsent","add","delete","applySnapshot","next","installConsentProvider","initial","read","name","subscribe","getInstalledProviderName","_provider","setConsentBufferLimit","limit","Math","max","getConsentGateStats","resetConsentGateForTests","clear"],"sources":["../../../src/privacy/consentGate.ts"],"sourcesContent":["/**\n * The consent gate — DL #218.\n *\n * Every BI, telemetry and analytics emitter in web5 goes through `transmit()`\n * instead of calling its transport directly. The gate exists because the\n * consent signal resolves *after* the events that need it: Shopify's consent\n * API is not on the page by default and has to be requested, and the fedops\n * app-load pair fires inside that window. A boolean checked at each call site\n * can only ever drop an event that is already in flight; the gate can hold it.\n *\n * Two independent unlocks, and they do not compose as a plain \"either/or\":\n *\n * | consent | engaged | result |\n * |-----------|---------|---------------------------------|\n * | granted | either | transmit |\n * | unknown | no | hold in the buffer |\n * | unknown | yes | transmit, and flush what's held |\n * | denied | yes | still nothing |\n *\n * Denied outranks engaged. A visitor who refused analytics in the banner does\n * not re-enable tracking by typing a question.\n */\n\nimport {\n UNKNOWN_CONSENT,\n type ConsentProvider,\n type ConsentPurpose,\n type ConsentSnapshot,\n type GatedPurpose,\n} from './types';\n\n/** Held events are dropped past this many — a runaway emitter must not become a leak. */\nconst DEFAULT_BUFFER_LIMIT = 50;\n\n/**\n * One prefix for the whole consent trail, so `[w5-consent]` in the console\n * filter shows the full story: which CMP was found, what it answered, and for\n * every event whether it was sent, held, dropped or replayed.\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 a send.\n }\n};\n\nconst describe = (s: ConsentSnapshot): string =>\n `analytics=${s.analytics} performance=${s.performance} marketing=${s.marketing}`;\n\ninterface HeldEvent {\n purpose: GatedPurpose;\n send: () => void;\n label: string;\n}\n\nexport interface GateView {\n consent: ConsentSnapshot;\n engaged: boolean;\n}\n\ntype Listener = () => void;\n\nlet snapshot: ConsentSnapshot = UNKNOWN_CONSENT;\nlet engaged = false;\nlet provider: ConsentProvider | null = null;\nlet unsubscribeProvider: (() => void) | null = null;\nlet buffer: HeldEvent[] = [];\nlet bufferLimit = DEFAULT_BUFFER_LIMIT;\nlet droppedFromOverflow = 0;\n\nconst listeners = new Set<Listener>();\n\n/**\n * Cached so `getGateView` is referentially stable between changes —\n * `useSyncExternalStore` re-renders forever if the snapshot is a fresh object\n * on every read.\n */\nlet view: GateView = Object.freeze({\n consent: UNKNOWN_CONSENT,\n engaged: false,\n});\n\nconst rebuildView = (): void => {\n view = Object.freeze({ consent: snapshot, engaged });\n};\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, or stop a flush.\n }\n }\n};\n\n/**\n * Whether an event for `purpose` may go on the wire right now.\n *\n * `necessary` is always allowed. For everything else: explicit consent wins in\n * both directions, and engagement resolves only the `unknown` case.\n */\nexport const mayTransmit = (purpose: ConsentPurpose): boolean => {\n if (purpose === 'necessary') {\n return true;\n }\n const state = snapshot[purpose];\n if (state === 'denied') {\n return false;\n }\n if (state === 'granted') {\n return true;\n }\n return engaged;\n};\n\n/**\n * Release everything the gate is holding that is now allowed, and drop\n * everything that is now refused. Anything still `unknown` stays held.\n *\n * Order is preserved among released events, but a flush necessarily emits them\n * later than they were raised — a held app-load event reaches the wire after\n * the prompt that unlocked it. Anything reading these as a timeline has to\n * know that.\n */\nconst settleBuffer = (): void => {\n if (buffer.length === 0) {\n return;\n }\n const stillHeld: HeldEvent[] = [];\n const releasing: HeldEvent[] = [];\n\n for (const held of buffer) {\n if (mayTransmit(held.purpose)) {\n releasing.push(held);\n } else if (snapshot[held.purpose] === 'denied') {\n // dropped on the floor, deliberately and permanently\n } else {\n stillHeld.push(held);\n }\n }\n\n const dropped = buffer.length - stillHeld.length - releasing.length;\n buffer = stillHeld;\n\n if (releasing.length || dropped) {\n log(\n `settle — releasing ${releasing.length}` +\n (dropped ? `, dropping ${dropped} (refused)` : '') +\n (stillHeld.length ? `, still holding ${stillHeld.length}` : ''),\n );\n }\n\n for (const held of releasing) {\n try {\n log(` ↳ REPLAY ${held.label} (${held.purpose})`);\n held.send();\n } catch {\n // A failed send must not strand the rest of the flush.\n }\n }\n};\n\n/**\n * The single entry point for anything that would put a request on the wire.\n *\n * Allowed → sent now. Refused → dropped. Not yet known → held until an unlock\n * settles it, or discarded with the page.\n */\nexport const transmit = (\n purpose: ConsentPurpose,\n send: () => void,\n label = 'event',\n): void => {\n if (mayTransmit(purpose)) {\n log(`SEND ${label} (${purpose}) — allowed`);\n send();\n return;\n }\n if (purpose !== 'necessary' && snapshot[purpose] === 'denied') {\n log(`DROP ${label} (${purpose}) — visitor refused`);\n return;\n }\n if (buffer.length >= bufferLimit) {\n droppedFromOverflow += 1;\n log(\n `DROP ${label} (${purpose}) — buffer full at ${bufferLimit}, ${droppedFromOverflow} lost`,\n );\n return;\n }\n buffer.push({ purpose: purpose as GatedPurpose, send, label });\n log(`HOLD ${label} (${purpose}) — no answer yet, ${buffer.length} held`);\n};\n\n/**\n * The visitor did something deliberate — submitted a prompt — so the session\n * may be measured even though no CMP has answered.\n *\n * This is the unlock that keeps web5 measurable at all: on a Shopify store\n * with no privacy configuration the consent API never loads, consent stays\n * `unknown` forever, and without this every store would report nothing.\n *\n * It unlocks **transmission only**. Persistent identity stays gated on real\n * consent (see `mayPersistIdentity`) — typing a question is a reason to\n * measure the session, not a reason to persist an identifier across visits.\n * It also cannot override a `denied`.\n */\nexport const unlockOnUserAction = (): void => {\n if (engaged) {\n return;\n }\n engaged = true;\n log(\n `UNLOCK — visitor submitted a prompt; ${buffer.length} held event(s) to settle`,\n );\n rebuildView();\n settleBuffer();\n notify();\n};\n\n/** Whether the visitor has taken the deliberate action that unlocks the session. */\nexport const isUserEngaged = (): boolean => engaged;\n\n/**\n * Persistent, cross-visit storage of a visitor identifier requires real\n * consent — engagement is deliberately not enough.\n */\nexport const mayPersistIdentity = (): boolean =>\n snapshot.analytics === 'granted';\n\nexport const getConsentSnapshot = (): ConsentSnapshot => snapshot;\n\n/** Referentially stable between changes, for `useSyncExternalStore`. */\nexport const getGateView = (): GateView => view;\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 rebuildView();\n settleBuffer();\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 provider = next;\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 getInstalledProviderName = (): string | null =>\n provider?.name ?? null;\n\nexport const setConsentBufferLimit = (limit: number): void => {\n bufferLimit = Math.max(0, limit);\n};\n\n/** Diagnostics only — how much the gate is holding, and what it had to drop. */\nexport const getConsentGateStats = (): {\n held: number;\n droppedFromOverflow: number;\n} => ({ held: buffer.length, droppedFromOverflow });\n\nexport const resetConsentGateForTests = (): void => {\n unsubscribeProvider?.();\n unsubscribeProvider = null;\n provider = null;\n snapshot = UNKNOWN_CONSENT;\n engaged = false;\n buffer = [];\n bufferLimit = DEFAULT_BUFFER_LIMIT;\n droppedFromOverflow = 0;\n listeners.clear();\n rebuildView();\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;;AAEA,SACEA,eAAe,QAKV,SAAS;;AAEhB;AACA,MAAMC,oBAAoB,GAAG,EAAE;;AAE/B;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,cAAc;AAEjC,MAAMC,GAAG,GAAG,SAAAA,CAAA,EAA8B;EACxC,IAAI;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADUC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAEhBC,OAAO,CAACC,KAAK,CAACT,UAAU,EAAE,GAAGK,IAAI,CAAC;EACpC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAED,MAAMK,QAAQ,GAAIC,CAAkB,IAClC,aAAaA,CAAC,CAACC,SAAS,gBAAgBD,CAAC,CAACE,WAAW,cAAcF,CAAC,CAACG,SAAS,EAAE;AAelF,IAAIC,QAAyB,GAAGjB,eAAe;AAC/C,IAAIkB,OAAO,GAAG,KAAK;AACnB,IAAIC,QAAgC,GAAG,IAAI;AAC3C,IAAIC,mBAAwC,GAAG,IAAI;AACnD,IAAIC,MAAmB,GAAG,EAAE;AAC5B,IAAIC,WAAW,GAAGrB,oBAAoB;AACtC,IAAIsB,mBAAmB,GAAG,CAAC;AAE3B,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;;AAErC;AACA;AACA;AACA;AACA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B,CAAG,CAAC;EACvBA,mBAAmB,GAAG,IAAI;EAC1BD,QAAQ,GAAG,IAAI;EACfF,QAAQ,GAAGjB,eAAe;EAC1BkB,OAAO,GAAG,KAAK;EACfG,MAAM,GAAG,EAAE;EACXC,WAAW,GAAGrB,oBAAoB;EAClCsB,mBAAmB,GAAG,CAAC;EACvBC,SAAS,CAAC4C,KAAK,CAAC,CAAC;EACjBtC,WAAW,CAAC,CAAC;AACf,CAAC","ignoreList":[]}
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,MAAMC,UAAU,GAAG,cAAc;AAEjC,MAAMC,GAAG,GAAG,SAAAA,CAAA,EAA8B;EACxC,IAAI;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADUC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAEhBC,OAAO,CAACC,KAAK,CAACT,UAAU,EAAE,GAAGK,IAAI,CAAC;EACpC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ,CAAC;AAED,MAAMK,QAAQ,GAAIC,CAAkB,IAClC,aAAaA,CAAC,CAACC,SAAS,gBAAgBD,CAAC,CAACE,WAAW,cAAcF,CAAC,CAACG,SAAS,EAAE;AAIlF,IAAIC,QAAyB,GAAGhB,eAAe;AAC/C,IAAIiB,OAAO,GAAG,KAAK;AACnB,IAAIC,mBAAwC,GAAG,IAAI;AAEnD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AAErC,MAAMC,MAAM,GAAGA,CAAA,KAAY;EACzB,KAAK,MAAMC,QAAQ,IAAIH,SAAS,EAAE;IAChC,IAAI;MACFG,QAAQ,CAAC,CAAC;IACZ,CAAC,CAAC,MAAM;MACN;IAAA;EAEJ;AACF,CA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IAAqB,IAAW;EACrEb,mBAAmB,YAAnBA,mBAAmB,CAAG,CAAC;EACvB,MAAMiB,OAAO,GAAGJ,IAAI,CAACK,IAAI,CAAC,CAAC;EAC3BlC,GAAG,CAAC,uBAAuB6B,IAAI,CAACM,IAAI,YAAY1B,QAAQ,CAACwB,OAAO,CAAC,EAAE,CAAC;EACpEL,aAAa,CAACK,OAAO,CAAC;EACtBjB,mBAAmB,GAAGa,IAAI,CAACO,SAAS,CAACR,aAAa,CAAC;AACrD,CAAC;AAED,OAAO,MAAMS,wBAAwB,GAAGA,CAAA,KAAY;EAClDrB,mBAAmB,YAAnBA,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,5 +1,5 @@
1
1
  export { UNKNOWN_CONSENT } from './types.js';
2
- export { transmit, mayTransmit, unlockOnUserAction, isUserEngaged, mayPersistIdentity, getConsentSnapshot, getGateView, subscribeToConsent, installConsentProvider, getInstalledProviderName, setConsentBufferLimit, getConsentGateStats, resetConsentGateForTests } from './consentGate.js';
2
+ export { unlockOnUserAction, mayPersistToken, getConsentSnapshot, subscribeToConsent, installConsentProvider, resetConsentGateForTests } from './consentGate.js';
3
3
  export { detectConsentProvider, initConsentGate } from './detectProvider.js';
4
4
  export { CONSENT_OVERRIDE_KEY, CONSENT_OVERRIDE_QUERY_PARAM, getConsentOverride, setConsentOverride } from './consentOverride.js';
5
5
  export { createShopifyConsentProvider, isShopifyHost } from './providers/shopifyProvider.js';
@@ -1 +1 @@
1
- {"version":3,"names":["UNKNOWN_CONSENT","transmit","mayTransmit","unlockOnUserAction","isUserEngaged","mayPersistIdentity","getConsentSnapshot","getGateView","subscribeToConsent","installConsentProvider","getInstalledProviderName","setConsentBufferLimit","getConsentGateStats","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 type GateView,\n transmit,\n mayTransmit,\n unlockOnUserAction,\n isUserEngaged,\n mayPersistIdentity,\n getConsentSnapshot,\n getGateView,\n subscribeToConsent,\n installConsentProvider,\n getInstalledProviderName,\n setConsentBufferLimit,\n getConsentGateStats,\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,SAEEC,QAAQ,EACRC,WAAW,EACXC,kBAAkB,EAClBC,aAAa,EACbC,kBAAkB,EAClBC,kBAAkB,EAClBC,WAAW,EACXC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,EACxBC,qBAAqB,EACrBC,mBAAmB,EACnBC,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":[]}
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":[]}