@huloglobal/vendure-plugin-visitor-analytics 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -15
- package/dist/abandoned-cart.controller.d.ts +78 -0
- package/dist/abandoned-cart.controller.d.ts.map +1 -0
- package/dist/abandoned-cart.controller.js +251 -0
- package/dist/abandoned-cart.controller.js.map +1 -0
- package/dist/abandoned-cart.entity.d.ts +61 -0
- package/dist/abandoned-cart.entity.d.ts.map +1 -0
- package/dist/abandoned-cart.entity.js +143 -0
- package/dist/abandoned-cart.entity.js.map +1 -0
- package/dist/abandoned-cart.scanner.d.ts +34 -0
- package/dist/abandoned-cart.scanner.d.ts.map +1 -0
- package/dist/abandoned-cart.scanner.js +85 -0
- package/dist/abandoned-cart.scanner.js.map +1 -0
- package/dist/abandoned-cart.service.d.ts +92 -0
- package/dist/abandoned-cart.service.d.ts.map +1 -0
- package/dist/abandoned-cart.service.js +276 -0
- package/dist/abandoned-cart.service.js.map +1 -0
- package/dist/hulo-storefront.d.ts +17 -0
- package/dist/hulo-storefront.d.ts.map +1 -0
- package/dist/hulo-storefront.js +289 -0
- package/dist/hulo-storefront.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/journey-buffs.controller.d.ts +43 -0
- package/dist/journey-buffs.controller.d.ts.map +1 -0
- package/dist/journey-buffs.controller.js +79 -0
- package/dist/journey-buffs.controller.js.map +1 -0
- package/dist/journey-buffs.service.d.ts +53 -0
- package/dist/journey-buffs.service.d.ts.map +1 -0
- package/dist/journey-buffs.service.js +141 -0
- package/dist/journey-buffs.service.js.map +1 -0
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +30 -3
- package/dist/plugin.js.map +1 -1
- package/dist/product-co-view.entity.d.ts +19 -0
- package/dist/product-co-view.entity.d.ts.map +1 -0
- package/dist/product-co-view.entity.js +52 -0
- package/dist/product-co-view.entity.js.map +1 -0
- package/dist/recommendations.controller.d.ts +72 -0
- package/dist/recommendations.controller.d.ts.map +1 -0
- package/dist/recommendations.controller.js +123 -0
- package/dist/recommendations.controller.js.map +1 -0
- package/dist/recommendations.service.d.ts +62 -0
- package/dist/recommendations.service.d.ts.map +1 -0
- package/dist/recommendations.service.js +167 -0
- package/dist/recommendations.service.js.map +1 -0
- package/dist/search-analytics.controller.d.ts +36 -0
- package/dist/search-analytics.controller.d.ts.map +1 -0
- package/dist/search-analytics.controller.js +86 -0
- package/dist/search-analytics.controller.js.map +1 -0
- package/dist/search-analytics.service.d.ts +36 -0
- package/dist/search-analytics.service.d.ts.map +1 -0
- package/dist/search-analytics.service.js +105 -0
- package/dist/search-analytics.service.js.map +1 -0
- package/dist/storefront-helper.controller.d.ts +16 -0
- package/dist/storefront-helper.controller.d.ts.map +1 -0
- package/dist/storefront-helper.controller.js +56 -0
- package/dist/storefront-helper.controller.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abandoned-cart.service.js","sourceRoot":"","sources":["../src/abandoned-cart.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AACpD,wCAAwD;AACxD,mCAAiD;AAEjD,qCAAsC;AAEtC,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAiDtC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC7B,YAAoB,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;IAAG,CAAC;IAEnD,IAAI;;QACR,MAAM,GAAG,GAAI,IAAA,mBAAU,GAAU,CAAC,WAA6C,CAAC;QAChF,OAAO;YACH,aAAa,EAAE,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,aAAa,mCAAI,EAAE;YACvC,kBAAkB,EAAE,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,kB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,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBAClC,KAAK,EAAE,UAAU,EAAE,QAAQ;aAC9B,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,CAAC;IACL,CAAC;CACJ,CAAA;AAtSY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAEuB,8BAAuB;GAD9C,oBAAoB,CAsShC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single-file storefront helper the plugin serves at /ees/hulo.js.
|
|
3
|
+
*
|
|
4
|
+
* Written as a string constant (not a bundled module) because:
|
|
5
|
+
* - It's tiny (< 6kB minified) — a bundler adds more than the code
|
|
6
|
+
* - It ships to the browser verbatim, no compile step
|
|
7
|
+
* - Customers can inspect / audit it without a source map
|
|
8
|
+
* - It has ZERO npm dependencies at runtime
|
|
9
|
+
*
|
|
10
|
+
* The controller wraps this in a small template that injects the
|
|
11
|
+
* public base URL and a default channel id, so a storefront paste
|
|
12
|
+
* of `<script src="https://backend/ees/hulo.js"></script>` Just Works
|
|
13
|
+
* with no config. Advanced users can call `hulo.configure({ ... })`
|
|
14
|
+
* to override.
|
|
15
|
+
*/
|
|
16
|
+
export declare const HULO_STOREFRONT_JS: (backendBaseUrl: string, defaultChannelId?: number) => string;
|
|
17
|
+
//# sourceMappingURL=hulo-storefront.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hulo-storefront.d.ts","sourceRoot":"","sources":["../src/hulo-storefront.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,EAAE,yBAAoB,KAAG,MA4QjF,CAAC"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HULO_STOREFRONT_JS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The single-file storefront helper the plugin serves at /ees/hulo.js.
|
|
6
|
+
*
|
|
7
|
+
* Written as a string constant (not a bundled module) because:
|
|
8
|
+
* - It's tiny (< 6kB minified) — a bundler adds more than the code
|
|
9
|
+
* - It ships to the browser verbatim, no compile step
|
|
10
|
+
* - Customers can inspect / audit it without a source map
|
|
11
|
+
* - It has ZERO npm dependencies at runtime
|
|
12
|
+
*
|
|
13
|
+
* The controller wraps this in a small template that injects the
|
|
14
|
+
* public base URL and a default channel id, so a storefront paste
|
|
15
|
+
* of `<script src="https://backend/ees/hulo.js"></script>` Just Works
|
|
16
|
+
* with no config. Advanced users can call `hulo.configure({ ... })`
|
|
17
|
+
* to override.
|
|
18
|
+
*/
|
|
19
|
+
const HULO_STOREFRONT_JS = (backendBaseUrl, defaultChannelId = 1) => `
|
|
20
|
+
// hulo storefront helper — @huloglobal/vendure-plugin-visitor-analytics
|
|
21
|
+
// Public domain when served from your own store; do not resell.
|
|
22
|
+
(function (global) {
|
|
23
|
+
var CONFIG = {
|
|
24
|
+
endpoint: ${JSON.stringify(backendBaseUrl.replace(/\/$/, '') + '/ees/track')},
|
|
25
|
+
recoverEndpoint: ${JSON.stringify(backendBaseUrl.replace(/\/$/, '') + '/ees/recover-cart')},
|
|
26
|
+
channelId: ${defaultChannelId},
|
|
27
|
+
debug: false,
|
|
28
|
+
autoRageClick: true,
|
|
29
|
+
autoDeadClick: true,
|
|
30
|
+
autoScroll: false, // not implemented yet — flag reserved
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// ── queue + batched send ─────────────────────────────────────────
|
|
34
|
+
// Every helper below pushes into a queue. Flush on requestIdleCallback
|
|
35
|
+
// or 2s max. Coalesces bursts of events into one HTTP roundtrip.
|
|
36
|
+
var QUEUE = [];
|
|
37
|
+
var FLUSH_TIMER = null;
|
|
38
|
+
function enqueue(event) {
|
|
39
|
+
event.url = event.url || location.href;
|
|
40
|
+
event.channelId = event.channelId || CONFIG.channelId;
|
|
41
|
+
QUEUE.push(event);
|
|
42
|
+
scheduleFlush();
|
|
43
|
+
if (CONFIG.debug) console.log('[hulo]', event);
|
|
44
|
+
}
|
|
45
|
+
function scheduleFlush() {
|
|
46
|
+
if (FLUSH_TIMER) return;
|
|
47
|
+
FLUSH_TIMER = setTimeout(flush, 1500);
|
|
48
|
+
}
|
|
49
|
+
function flush() {
|
|
50
|
+
FLUSH_TIMER = null;
|
|
51
|
+
if (!QUEUE.length) return;
|
|
52
|
+
var batch = QUEUE.splice(0, QUEUE.length);
|
|
53
|
+
var payload = JSON.stringify({ events: batch });
|
|
54
|
+
// Prefer sendBeacon on unload (survives page transitions) and
|
|
55
|
+
// fall back to fetch keepalive for normal calls.
|
|
56
|
+
try {
|
|
57
|
+
if (navigator.sendBeacon) {
|
|
58
|
+
var blob = new Blob([payload], { type: 'application/json' });
|
|
59
|
+
if (navigator.sendBeacon(CONFIG.endpoint, blob)) return;
|
|
60
|
+
}
|
|
61
|
+
} catch (_e) {}
|
|
62
|
+
try {
|
|
63
|
+
fetch(CONFIG.endpoint, {
|
|
64
|
+
method: 'POST', credentials: 'include', keepalive: true,
|
|
65
|
+
headers: { 'content-type': 'application/json' },
|
|
66
|
+
body: payload,
|
|
67
|
+
}).catch(function () { /* silent */ });
|
|
68
|
+
} catch (_e) {}
|
|
69
|
+
}
|
|
70
|
+
// Flush before the page dies.
|
|
71
|
+
window.addEventListener('pagehide', flush, { capture: true });
|
|
72
|
+
window.addEventListener('beforeunload', flush, { capture: true });
|
|
73
|
+
|
|
74
|
+
// ── public API ───────────────────────────────────────────────────
|
|
75
|
+
var hulo = {
|
|
76
|
+
configure: function (opts) { Object.assign(CONFIG, opts || {}); },
|
|
77
|
+
flush: flush,
|
|
78
|
+
|
|
79
|
+
/** Fire once per pageview. Optional — the ingest endpoint infers
|
|
80
|
+
* pageviews from the referrer / URL, but calling this explicitly
|
|
81
|
+
* captures the title too. */
|
|
82
|
+
pageview: function (extra) {
|
|
83
|
+
enqueue(Object.assign({ type: 'pageview', title: document.title }, extra || {}));
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/** Product detail viewed. Store the product id you would use to
|
|
87
|
+
* fetch the product server-side (Vendure product.id). If your
|
|
88
|
+
* storefront uses variants primarily, pass variantId too. */
|
|
89
|
+
productView: function (productId, productVariantId) {
|
|
90
|
+
if (!productId && productId !== 0) return;
|
|
91
|
+
enqueue({
|
|
92
|
+
type: 'event',
|
|
93
|
+
meta: JSON.stringify({
|
|
94
|
+
eventType: 'product_view',
|
|
95
|
+
productId: Number(productId),
|
|
96
|
+
productVariantId: productVariantId != null ? Number(productVariantId) : undefined,
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
/** Item added to cart. Fire on every add — not just the first. */
|
|
102
|
+
addToCart: function (variantId, qty, unitPriceMinor) {
|
|
103
|
+
enqueue({
|
|
104
|
+
type: 'event',
|
|
105
|
+
meta: JSON.stringify({
|
|
106
|
+
eventType: 'add_to_cart',
|
|
107
|
+
variantId: variantId != null ? Number(variantId) : undefined,
|
|
108
|
+
qty: qty != null ? Number(qty) : 1,
|
|
109
|
+
unitPriceMinor: unitPriceMinor != null ? Number(unitPriceMinor) : undefined,
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
/** Cart snapshot — fire on every cart change (add / remove / qty).
|
|
115
|
+
* The abandonment scanner reads only this event, so fire it
|
|
116
|
+
* liberally. Payload shape:
|
|
117
|
+
* { currency, totalMinor, itemCount, items: [{ variantId, name, qty, unitPriceMinor }], email? } */
|
|
118
|
+
cartSnapshot: function (cart) {
|
|
119
|
+
if (!cart || !cart.items || !cart.items.length) return;
|
|
120
|
+
enqueue({
|
|
121
|
+
type: 'event',
|
|
122
|
+
meta: JSON.stringify({
|
|
123
|
+
eventType: 'cart_snapshot',
|
|
124
|
+
currency: (cart.currency || 'GBP').toUpperCase().slice(0, 3),
|
|
125
|
+
totalMinor: Number(cart.totalMinor || 0),
|
|
126
|
+
itemCount: Number(cart.itemCount || cart.items.length),
|
|
127
|
+
items: cart.items.map(function (i) {
|
|
128
|
+
return {
|
|
129
|
+
variantId: i.variantId != null ? Number(i.variantId) : undefined,
|
|
130
|
+
productId: i.productId != null ? Number(i.productId) : undefined,
|
|
131
|
+
name: i.name != null ? String(i.name).slice(0, 200) : undefined,
|
|
132
|
+
qty: Number(i.qty != null ? i.qty : (i.quantity != null ? i.quantity : 1)),
|
|
133
|
+
unitPriceMinor: Number(i.unitPriceMinor != null ? i.unitPriceMinor : (i.unitPrice != null ? i.unitPrice : 0)),
|
|
134
|
+
sku: i.sku != null ? String(i.sku).slice(0, 100) : undefined,
|
|
135
|
+
};
|
|
136
|
+
}).slice(0, 100),
|
|
137
|
+
email: cart.email || undefined,
|
|
138
|
+
countryCode: cart.countryCode || undefined,
|
|
139
|
+
}),
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/** Storefront site search executed. Pass the raw query + the
|
|
144
|
+
* resulting hit count so no-result queries can be aggregated. */
|
|
145
|
+
search: function (query, resultsCount) {
|
|
146
|
+
var q = String(query || '').trim();
|
|
147
|
+
if (!q) return;
|
|
148
|
+
enqueue({
|
|
149
|
+
type: 'event',
|
|
150
|
+
meta: JSON.stringify({
|
|
151
|
+
eventType: 'search',
|
|
152
|
+
query: q.slice(0, 200),
|
|
153
|
+
resultsCount: Math.max(0, Number(resultsCount || 0)),
|
|
154
|
+
}),
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
/** Checkout finished — fires the counter that closes any open
|
|
159
|
+
* abandoned-cart row for this session. Call from your thank-you
|
|
160
|
+
* page. Optionally pass the order code + total. */
|
|
161
|
+
checkoutCompleted: function (orderCode, totalMinor) {
|
|
162
|
+
enqueue({
|
|
163
|
+
type: 'event',
|
|
164
|
+
meta: JSON.stringify({
|
|
165
|
+
eventType: 'checkout_completed',
|
|
166
|
+
orderCode: orderCode ? String(orderCode).slice(0, 64) : undefined,
|
|
167
|
+
totalMinor: totalMinor != null ? Number(totalMinor) : undefined,
|
|
168
|
+
}),
|
|
169
|
+
});
|
|
170
|
+
flush(); // don't wait — the visitor may close the tab immediately
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
/** Rage-click event — fire it yourself if you have a better signal
|
|
174
|
+
* than the built-in detector. */
|
|
175
|
+
rageClick: function (selector, extraMeta) {
|
|
176
|
+
enqueue({
|
|
177
|
+
type: 'event',
|
|
178
|
+
meta: JSON.stringify(Object.assign({
|
|
179
|
+
eventType: 'rage_click',
|
|
180
|
+
selector: selector ? String(selector).slice(0, 200) : undefined,
|
|
181
|
+
}, extraMeta || {})),
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/** Click landed on a non-interactive element. */
|
|
186
|
+
deadClick: function (selector, extraMeta) {
|
|
187
|
+
enqueue({
|
|
188
|
+
type: 'event',
|
|
189
|
+
meta: JSON.stringify(Object.assign({
|
|
190
|
+
eventType: 'dead_click',
|
|
191
|
+
selector: selector ? String(selector).slice(0, 200) : undefined,
|
|
192
|
+
}, extraMeta || {})),
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Restore a cart from a signed recovery token. Fetches the items
|
|
198
|
+
* from the backend and returns them. Your storefront is responsible
|
|
199
|
+
* for calling its own Vendure order API to actually re-add them,
|
|
200
|
+
* because different storefronts frame that call differently.
|
|
201
|
+
*/
|
|
202
|
+
restoreCart: function (token) {
|
|
203
|
+
var t = String(token || '').trim();
|
|
204
|
+
if (!t) return Promise.reject(new Error('missing-token'));
|
|
205
|
+
return fetch(CONFIG.recoverEndpoint + '?t=' + encodeURIComponent(t), {
|
|
206
|
+
credentials: 'include',
|
|
207
|
+
}).then(function (r) { return r.json(); });
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// ── auto rage-click detector ─────────────────────────────────────
|
|
212
|
+
// Any pointerdown ≥ 3 within 500ms in a 20x20px zone counts.
|
|
213
|
+
if (CONFIG.autoRageClick) {
|
|
214
|
+
var recent = [];
|
|
215
|
+
document.addEventListener('pointerdown', function (e) {
|
|
216
|
+
var now = Date.now();
|
|
217
|
+
recent = recent.filter(function (r) { return now - r.t < 500; });
|
|
218
|
+
recent.push({ t: now, x: e.clientX, y: e.clientY, target: e.target });
|
|
219
|
+
var close = recent.filter(function (r) {
|
|
220
|
+
return Math.abs(r.x - e.clientX) < 20 && Math.abs(r.y - e.clientY) < 20;
|
|
221
|
+
});
|
|
222
|
+
if (close.length >= 3) {
|
|
223
|
+
hulo.rageClick(cssPathOf(e.target));
|
|
224
|
+
recent = []; // reset so we don't fire again on the 4th, 5th, etc.
|
|
225
|
+
}
|
|
226
|
+
}, { capture: true, passive: true });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ── auto dead-click detector ─────────────────────────────────────
|
|
230
|
+
// A click that lands on an element with no href / not a button /
|
|
231
|
+
// not a form control and doesn't produce a navigation within 400ms.
|
|
232
|
+
if (CONFIG.autoDeadClick) {
|
|
233
|
+
document.addEventListener('click', function (e) {
|
|
234
|
+
var target = e.target;
|
|
235
|
+
if (!target || target.nodeType !== 1) return;
|
|
236
|
+
if (isInteractive(target)) return;
|
|
237
|
+
var beforeUrl = location.href;
|
|
238
|
+
var beforeScroll = window.scrollY;
|
|
239
|
+
setTimeout(function () {
|
|
240
|
+
if (location.href !== beforeUrl) return;
|
|
241
|
+
if (Math.abs(window.scrollY - beforeScroll) > 50) return;
|
|
242
|
+
// Was there an ancestor with a click handler? Best-effort:
|
|
243
|
+
// walk up and check for onclick, role='button', tabindex.
|
|
244
|
+
var node = target;
|
|
245
|
+
for (var i = 0; i < 4 && node; i++) {
|
|
246
|
+
if (isInteractive(node) || node.onclick) return;
|
|
247
|
+
node = node.parentElement;
|
|
248
|
+
}
|
|
249
|
+
hulo.deadClick(cssPathOf(target));
|
|
250
|
+
}, 400);
|
|
251
|
+
}, { capture: true, passive: true });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function isInteractive(el) {
|
|
255
|
+
if (!el || !el.tagName) return false;
|
|
256
|
+
var tag = el.tagName.toLowerCase();
|
|
257
|
+
if (tag === 'a' || tag === 'button' || tag === 'input' || tag === 'select'
|
|
258
|
+
|| tag === 'textarea' || tag === 'label' || tag === 'summary'
|
|
259
|
+
|| tag === 'details') return true;
|
|
260
|
+
if (el.getAttribute && (el.getAttribute('role') === 'button'
|
|
261
|
+
|| el.getAttribute('role') === 'link'
|
|
262
|
+
|| el.hasAttribute('tabindex'))) return true;
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function cssPathOf(el) {
|
|
267
|
+
if (!el || el.nodeType !== 1) return '';
|
|
268
|
+
var parts = [];
|
|
269
|
+
while (el && el.nodeType === 1 && parts.length < 5) {
|
|
270
|
+
var p = el.tagName.toLowerCase();
|
|
271
|
+
if (el.id) { p += '#' + el.id; parts.unshift(p); break; }
|
|
272
|
+
if (el.className && typeof el.className === 'string') {
|
|
273
|
+
var cls = el.className.trim().split(/\\s+/).slice(0, 2).join('.');
|
|
274
|
+
if (cls) p += '.' + cls;
|
|
275
|
+
}
|
|
276
|
+
parts.unshift(p);
|
|
277
|
+
el = el.parentElement;
|
|
278
|
+
}
|
|
279
|
+
return parts.join(' > ');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
global.hulo = hulo;
|
|
283
|
+
// Auto pageview on load — most callers want it.
|
|
284
|
+
if (document.readyState === 'complete') hulo.pageview();
|
|
285
|
+
else window.addEventListener('load', function () { hulo.pageview(); });
|
|
286
|
+
})(window);
|
|
287
|
+
`;
|
|
288
|
+
exports.HULO_STOREFRONT_JS = HULO_STOREFRONT_JS;
|
|
289
|
+
//# sourceMappingURL=hulo-storefront.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hulo-storefront.js","sourceRoot":"","sources":["../src/hulo-storefront.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACI,MAAM,kBAAkB,GAAG,CAAC,cAAsB,EAAE,gBAAgB,GAAG,CAAC,EAAU,EAAE,CAAC;;;;;gBAK5E,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,YAAY,CAAC;uBACzD,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,mBAAmB,CAAC;iBAC7E,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqQhC,CAAC;AA5QW,QAAA,kBAAkB,sBA4Q7B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,10 @@
|
|
|
4
4
|
export { VisitorAnalyticsPlugin, VisitorAnalyticsPluginOptions } from './plugin';
|
|
5
5
|
export { VisitorTrackingService } from './visitor-tracking.service';
|
|
6
6
|
export { VisitorEvent } from './visitor-event.entity';
|
|
7
|
+
export { AbandonedCart, AbandonedCartStatus } from './abandoned-cart.entity';
|
|
8
|
+
export { ProductCoView } from './product-co-view.entity';
|
|
9
|
+
export { AbandonedCartService, CartSnapshotMeta, AbandonmentOptions, } from './abandoned-cart.service';
|
|
10
|
+
export { RecommendationsService } from './recommendations.service';
|
|
11
|
+
export { SearchAnalyticsService } from './search-analytics.service';
|
|
12
|
+
export { JourneyBuffsService } from './journey-buffs.service';
|
|
7
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,23 @@
|
|
|
3
3
|
* `@huloglobal/vendure-plugin-visitor-analytics` — public exports.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VisitorEvent = exports.VisitorTrackingService = exports.VisitorAnalyticsPlugin = void 0;
|
|
6
|
+
exports.JourneyBuffsService = exports.SearchAnalyticsService = exports.RecommendationsService = exports.AbandonedCartService = exports.ProductCoView = exports.AbandonedCart = exports.VisitorEvent = exports.VisitorTrackingService = exports.VisitorAnalyticsPlugin = void 0;
|
|
7
7
|
var plugin_1 = require("./plugin");
|
|
8
8
|
Object.defineProperty(exports, "VisitorAnalyticsPlugin", { enumerable: true, get: function () { return plugin_1.VisitorAnalyticsPlugin; } });
|
|
9
9
|
var visitor_tracking_service_1 = require("./visitor-tracking.service");
|
|
10
10
|
Object.defineProperty(exports, "VisitorTrackingService", { enumerable: true, get: function () { return visitor_tracking_service_1.VisitorTrackingService; } });
|
|
11
11
|
var visitor_event_entity_1 = require("./visitor-event.entity");
|
|
12
12
|
Object.defineProperty(exports, "VisitorEvent", { enumerable: true, get: function () { return visitor_event_entity_1.VisitorEvent; } });
|
|
13
|
+
var abandoned_cart_entity_1 = require("./abandoned-cart.entity");
|
|
14
|
+
Object.defineProperty(exports, "AbandonedCart", { enumerable: true, get: function () { return abandoned_cart_entity_1.AbandonedCart; } });
|
|
15
|
+
var product_co_view_entity_1 = require("./product-co-view.entity");
|
|
16
|
+
Object.defineProperty(exports, "ProductCoView", { enumerable: true, get: function () { return product_co_view_entity_1.ProductCoView; } });
|
|
17
|
+
var abandoned_cart_service_1 = require("./abandoned-cart.service");
|
|
18
|
+
Object.defineProperty(exports, "AbandonedCartService", { enumerable: true, get: function () { return abandoned_cart_service_1.AbandonedCartService; } });
|
|
19
|
+
var recommendations_service_1 = require("./recommendations.service");
|
|
20
|
+
Object.defineProperty(exports, "RecommendationsService", { enumerable: true, get: function () { return recommendations_service_1.RecommendationsService; } });
|
|
21
|
+
var search_analytics_service_1 = require("./search-analytics.service");
|
|
22
|
+
Object.defineProperty(exports, "SearchAnalyticsService", { enumerable: true, get: function () { return search_analytics_service_1.SearchAnalyticsService; } });
|
|
23
|
+
var journey_buffs_service_1 = require("./journey-buffs.service");
|
|
24
|
+
Object.defineProperty(exports, "JourneyBuffsService", { enumerable: true, get: function () { return journey_buffs_service_1.JourneyBuffsService; } });
|
|
13
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,mCAAiF;AAAxE,gHAAA,sBAAsB,OAAA;AAC/B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,+DAAsD;AAA7C,oHAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,mCAAiF;AAAxE,gHAAA,sBAAsB,OAAA;AAC/B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,+DAAsD;AAA7C,oHAAA,YAAY,OAAA;AACrB,iEAA6E;AAApE,sHAAA,aAAa,OAAA;AACtB,mEAAyD;AAAhD,uHAAA,aAAa,OAAA;AACtB,mEAIkC;AAH9B,8HAAA,oBAAoB,OAAA;AAIxB,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA;AAC/B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RequestContext } from '@vendure/core';
|
|
2
|
+
import { JourneyBuffsService } from './journey-buffs.service';
|
|
3
|
+
export declare class JourneyBuffsController {
|
|
4
|
+
private readonly service;
|
|
5
|
+
constructor(service: JourneyBuffsService);
|
|
6
|
+
/** GET /ees/journey/rage-clicks?days=7&channelId=1&limit=20 */
|
|
7
|
+
rage(ctx: RequestContext, d?: string, ch?: string, l?: string): Promise<{
|
|
8
|
+
items: {
|
|
9
|
+
url: string;
|
|
10
|
+
rageClicks: number;
|
|
11
|
+
uniqueVisitors: number;
|
|
12
|
+
}[];
|
|
13
|
+
}>;
|
|
14
|
+
/** GET /ees/journey/dead-clicks?days=7&channelId=1&limit=20 */
|
|
15
|
+
dead(ctx: RequestContext, d?: string, ch?: string, l?: string): Promise<{
|
|
16
|
+
items: {
|
|
17
|
+
url: string;
|
|
18
|
+
deadClicks: number;
|
|
19
|
+
uniqueVisitors: number;
|
|
20
|
+
}[];
|
|
21
|
+
}>;
|
|
22
|
+
/** GET /ees/journey/session-summary?visitorId=abc&limit=25 */
|
|
23
|
+
summary(ctx: RequestContext, v?: string, l?: string): Promise<{
|
|
24
|
+
error: string;
|
|
25
|
+
visitorId?: undefined;
|
|
26
|
+
items?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
visitorId: string;
|
|
29
|
+
items: {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
startedAt: string;
|
|
32
|
+
endedAt: string;
|
|
33
|
+
durationSec: number;
|
|
34
|
+
pageCount: number;
|
|
35
|
+
addedToCart: boolean;
|
|
36
|
+
checkedOut: boolean;
|
|
37
|
+
rageClicked: boolean;
|
|
38
|
+
intent: "browse" | "consider" | "purchase" | "abandon" | "frustrate" | "bounce";
|
|
39
|
+
}[];
|
|
40
|
+
error?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=journey-buffs.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-buffs.controller.d.ts","sourceRoot":"","sources":["../src/journey-buffs.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,cAAc,EAAqB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBACa,sBAAsB;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,mBAAmB;IAEzD,+DAA+D;IAGzD,IAAI,CACC,GAAG,EAAE,cAAc,EACX,CAAC,CAAC,EAAE,MAAM,EACL,EAAE,CAAC,EAAE,MAAM,EACf,CAAC,CAAC,EAAE,MAAM;;;;;;;IAQ9B,+DAA+D;IAGzD,IAAI,CACC,GAAG,EAAE,cAAc,EACX,CAAC,CAAC,EAAE,MAAM,EACL,EAAE,CAAC,EAAE,MAAM,EACf,CAAC,CAAC,EAAE,MAAM;;;;;;;IAQ9B,8DAA8D;IAGxD,OAAO,CACF,GAAG,EAAE,cAAc,EACN,CAAC,CAAC,EAAE,MAAM,EACd,CAAC,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;CAOjC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.JourneyBuffsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const core_1 = require("@vendure/core");
|
|
18
|
+
const journey_buffs_service_1 = require("./journey-buffs.service");
|
|
19
|
+
let JourneyBuffsController = class JourneyBuffsController {
|
|
20
|
+
constructor(service) {
|
|
21
|
+
this.service = service;
|
|
22
|
+
}
|
|
23
|
+
/** GET /ees/journey/rage-clicks?days=7&channelId=1&limit=20 */
|
|
24
|
+
async rage(ctx, d, ch, l) {
|
|
25
|
+
const items = await this.service.rageClickHotSpots(+(d || 7), +(ch || 1), +(l || 20));
|
|
26
|
+
return { items };
|
|
27
|
+
}
|
|
28
|
+
/** GET /ees/journey/dead-clicks?days=7&channelId=1&limit=20 */
|
|
29
|
+
async dead(ctx, d, ch, l) {
|
|
30
|
+
const items = await this.service.deadClickHotSpots(+(d || 7), +(ch || 1), +(l || 20));
|
|
31
|
+
return { items };
|
|
32
|
+
}
|
|
33
|
+
/** GET /ees/journey/session-summary?visitorId=abc&limit=25 */
|
|
34
|
+
async summary(ctx, v, l) {
|
|
35
|
+
const visitorId = String(v || '').trim();
|
|
36
|
+
if (!visitorId)
|
|
37
|
+
return { error: 'visitorId-required' };
|
|
38
|
+
const items = await this.service.sessionSummary(visitorId, +(l || 25));
|
|
39
|
+
return { visitorId, items };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.JourneyBuffsController = JourneyBuffsController;
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Get)('journey/rage-clicks'),
|
|
45
|
+
(0, core_1.Allow)(core_1.Permission.ReadCustomer),
|
|
46
|
+
__param(0, (0, core_1.Ctx)()),
|
|
47
|
+
__param(1, (0, common_1.Query)('days')),
|
|
48
|
+
__param(2, (0, common_1.Query)('channelId')),
|
|
49
|
+
__param(3, (0, common_1.Query)('limit')),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [core_1.RequestContext, String, String, String]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], JourneyBuffsController.prototype, "rage", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.Get)('journey/dead-clicks'),
|
|
56
|
+
(0, core_1.Allow)(core_1.Permission.ReadCustomer),
|
|
57
|
+
__param(0, (0, core_1.Ctx)()),
|
|
58
|
+
__param(1, (0, common_1.Query)('days')),
|
|
59
|
+
__param(2, (0, common_1.Query)('channelId')),
|
|
60
|
+
__param(3, (0, common_1.Query)('limit')),
|
|
61
|
+
__metadata("design:type", Function),
|
|
62
|
+
__metadata("design:paramtypes", [core_1.RequestContext, String, String, String]),
|
|
63
|
+
__metadata("design:returntype", Promise)
|
|
64
|
+
], JourneyBuffsController.prototype, "dead", null);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, common_1.Get)('journey/session-summary'),
|
|
67
|
+
(0, core_1.Allow)(core_1.Permission.ReadCustomer),
|
|
68
|
+
__param(0, (0, core_1.Ctx)()),
|
|
69
|
+
__param(1, (0, common_1.Query)('visitorId')),
|
|
70
|
+
__param(2, (0, common_1.Query)('limit')),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [core_1.RequestContext, String, String]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], JourneyBuffsController.prototype, "summary", null);
|
|
75
|
+
exports.JourneyBuffsController = JourneyBuffsController = __decorate([
|
|
76
|
+
(0, common_1.Controller)('ees'),
|
|
77
|
+
__metadata("design:paramtypes", [journey_buffs_service_1.JourneyBuffsService])
|
|
78
|
+
], JourneyBuffsController);
|
|
79
|
+
//# sourceMappingURL=journey-buffs.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-buffs.controller.js","sourceRoot":"","sources":["../src/journey-buffs.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,wCAAuE;AACvE,mEAA8D;AAGvD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YAA6B,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAAG,CAAC;IAE7D,+DAA+D;IAGzD,AAAN,KAAK,CAAC,IAAI,CACC,GAAmB,EACX,CAAU,EACL,EAAW,EACf,CAAU;QAE1B,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cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;;qCAHH,qBAAc;;kDAS7B;AAKK;IAFL,IAAA,YAAG,EAAC,qBAAqB,CAAC;IAC1B,IAAA,YAAK,EAAC,iBAAU,CAAC,YAAY,CAAC;IAE1B,WAAA,IAAA,UAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;;qCAHH,qBAAc;;kDAS7B;AAKK;IAFL,IAAA,YAAG,EAAC,yBAAyB,CAAC;IAC9B,IAAA,YAAK,EAAC,iBAAU,CAAC,YAAY,CAAC;IAE1B,WAAA,IAAA,UAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;;qCAFH,qBAAc;;qDAQ7B;iCA7CQ,sBAAsB;IADlC,IAAA,mBAAU,EAAC,KAAK,CAAC;qCAEwB,2CAAmB;GADhD,sBAAsB,CA8ClC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TransactionalConnection } from '@vendure/core';
|
|
2
|
+
/**
|
|
3
|
+
* Zero-schema-cost enrichment endpoints for the per-visitor Journey
|
|
4
|
+
* drawer and store-wide UX signals.
|
|
5
|
+
*
|
|
6
|
+
* Each of these queries reads back over the existing `visitor_event`
|
|
7
|
+
* table where the storefront has fired named custom events. No new
|
|
8
|
+
* columns, no new tables — the storefront helper is documented in the
|
|
9
|
+
* plugin README and dispatches events into the existing
|
|
10
|
+
* `POST /ees/track` endpoint.
|
|
11
|
+
*/
|
|
12
|
+
export declare class JourneyBuffsService {
|
|
13
|
+
private connection;
|
|
14
|
+
constructor(connection: TransactionalConnection);
|
|
15
|
+
/**
|
|
16
|
+
* Store-wide rage-click hot spots — the URLs where visitors are
|
|
17
|
+
* most frustrated. `hulo.rageClick(url, selector)` on the
|
|
18
|
+
* storefront populates the underlying event.
|
|
19
|
+
*/
|
|
20
|
+
rageClickHotSpots(sinceDays?: number, channelId?: number, limit?: number): Promise<Array<{
|
|
21
|
+
url: string;
|
|
22
|
+
rageClicks: number;
|
|
23
|
+
uniqueVisitors: number;
|
|
24
|
+
}>>;
|
|
25
|
+
/**
|
|
26
|
+
* Dead-click hot spots — clicks on non-interactive elements. Same
|
|
27
|
+
* shape as rage-click aggregation but keyed on the `dead_click`
|
|
28
|
+
* event type. Useful for spotting elements that LOOK clickable
|
|
29
|
+
* (styled headings, disabled buttons, decorative cards).
|
|
30
|
+
*/
|
|
31
|
+
deadClickHotSpots(sinceDays?: number, channelId?: number, limit?: number): Promise<Array<{
|
|
32
|
+
url: string;
|
|
33
|
+
deadClicks: number;
|
|
34
|
+
uniqueVisitors: number;
|
|
35
|
+
}>>;
|
|
36
|
+
/**
|
|
37
|
+
* Per-visitor session summary — one row per session with a
|
|
38
|
+
* heuristic `intent` label. Used to enrich the Journey drawer
|
|
39
|
+
* with a one-line "what did this session do".
|
|
40
|
+
*/
|
|
41
|
+
sessionSummary(visitorId: string, limit?: number): Promise<Array<{
|
|
42
|
+
sessionId: string;
|
|
43
|
+
startedAt: string;
|
|
44
|
+
endedAt: string;
|
|
45
|
+
durationSec: number;
|
|
46
|
+
pageCount: number;
|
|
47
|
+
addedToCart: boolean;
|
|
48
|
+
checkedOut: boolean;
|
|
49
|
+
rageClicked: boolean;
|
|
50
|
+
intent: 'browse' | 'consider' | 'purchase' | 'abandon' | 'frustrate' | 'bounce';
|
|
51
|
+
}>>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=journey-buffs.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-buffs.service.d.ts","sourceRoot":"","sources":["../src/journey-buffs.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD;;;;;;;;;GASG;AACH,qBACa,mBAAmB;IAChB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,uBAAuB;IAEvD;;;;OAIG;IACG,iBAAiB,CAAC,SAAS,SAAI,EAAE,SAAS,SAAI,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7E,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IAwBH;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,SAAI,EAAE,SAAS,SAAI,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7E,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IAwBH;;;;OAIG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC/D,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,OAAO,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;KACnF,CAAC,CAAC;CA+CN"}
|