sdk-sample 0.0.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/dist/components/trackedButton/index.d.ts +1 -0
- package/dist/components/trackedButton/tracked-button.d.ts +13 -0
- package/dist/components/trackedForm/index.d.ts +1 -0
- package/dist/components/trackedForm/tracked-form.d.ts +11 -0
- package/dist/components/trackedPage/index.d.ts +1 -0
- package/dist/components/trackedPage/tracked-page.d.ts +10 -0
- package/dist/index.d.ts +11 -0
- package/dist/sdk/event-manager.d.ts +11 -0
- package/dist/sdk/queue-manager.d.ts +21 -0
- package/dist/sdk/react-hooks.d.ts +36 -0
- package/dist/sdk/schema-manager.d.ts +33 -0
- package/dist/sdk/strategy-manager.d.ts +14 -0
- package/dist/sdk/tracker.d.ts +41 -0
- package/dist/sdk-sample.js +1060 -0
- package/dist/sdk-sample.umd.cjs +30 -0
- package/dist/types/index.d.ts +74 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
var hr = Object.defineProperty;
|
|
2
|
+
var gr = (u, t, a) => t in u ? hr(u, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : u[t] = a;
|
|
3
|
+
var T = (u, t, a) => gr(u, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import Ce, { createContext as mr, useRef as z, useContext as yr, useEffect as re } from "react";
|
|
5
|
+
class br {
|
|
6
|
+
// Enrich base info for every event
|
|
7
|
+
getBaseInfo() {
|
|
8
|
+
return {
|
|
9
|
+
timestamp: Date.now(),
|
|
10
|
+
url: window.location.href,
|
|
11
|
+
userAgent: navigator.userAgent
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Factory method to create an event with base info.
|
|
16
|
+
* @param eventName Name of the event
|
|
17
|
+
* @param params Event parameters
|
|
18
|
+
* @returns Enriched event object
|
|
19
|
+
*/
|
|
20
|
+
createEvent(t, a) {
|
|
21
|
+
return {
|
|
22
|
+
eventName: t,
|
|
23
|
+
...this.getBaseInfo(),
|
|
24
|
+
...a
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class Er {
|
|
29
|
+
constructor(t, a = 5, o = 2e3) {
|
|
30
|
+
T(this, "queue", []);
|
|
31
|
+
T(this, "strategyManager");
|
|
32
|
+
T(this, "batchSize");
|
|
33
|
+
T(this, "timer", null);
|
|
34
|
+
T(this, "interval");
|
|
35
|
+
this.strategyManager = t, this.batchSize = a, this.interval = o;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Add an event to the queue.
|
|
39
|
+
* @param event Event to track
|
|
40
|
+
* @param immediate Whether to send immediately
|
|
41
|
+
*/
|
|
42
|
+
addEvent(t, a = !1) {
|
|
43
|
+
if (a) {
|
|
44
|
+
this.strategyManager.send([t], "xhr");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.queue.push(t), this.queue.length >= this.batchSize ? this.flush() : this.timer || (this.timer = window.setTimeout(() => {
|
|
48
|
+
this.flush();
|
|
49
|
+
}, this.interval));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Flush the current queue via XHR.
|
|
53
|
+
*/
|
|
54
|
+
flush() {
|
|
55
|
+
if (this.queue.length === 0) return;
|
|
56
|
+
const t = [...this.queue];
|
|
57
|
+
this.queue = [], this.timer && (clearTimeout(this.timer), this.timer = null), this.strategyManager.send(t, "xhr");
|
|
58
|
+
}
|
|
59
|
+
flushOnUnload() {
|
|
60
|
+
this.queue.length !== 0 && (this.strategyManager.send(this.queue, "beacon"), this.queue = []);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class wr {
|
|
64
|
+
constructor(t) {
|
|
65
|
+
T(this, "endpoint");
|
|
66
|
+
this.endpoint = t;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Send data using the specified strategy.
|
|
70
|
+
* @param data Data to send
|
|
71
|
+
* @param strategy Reporting strategy (xhr, beacon, img)
|
|
72
|
+
*/
|
|
73
|
+
send(t, a = "xhr") {
|
|
74
|
+
const o = JSON.stringify(t);
|
|
75
|
+
switch (a) {
|
|
76
|
+
case "beacon":
|
|
77
|
+
this.sendBeacon(o);
|
|
78
|
+
break;
|
|
79
|
+
case "img":
|
|
80
|
+
this.sendImg(t);
|
|
81
|
+
break;
|
|
82
|
+
case "xhr":
|
|
83
|
+
default:
|
|
84
|
+
this.sendXHR(o);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
sendBeacon(t) {
|
|
89
|
+
if (navigator.sendBeacon) {
|
|
90
|
+
const a = new Blob([t], { type: "application/json" });
|
|
91
|
+
navigator.sendBeacon(this.endpoint, a);
|
|
92
|
+
} else
|
|
93
|
+
this.sendXHR(t);
|
|
94
|
+
}
|
|
95
|
+
sendXHR(t) {
|
|
96
|
+
const a = new XMLHttpRequest();
|
|
97
|
+
a.open("POST", this.endpoint, !0), a.setRequestHeader("Content-Type", "application/json"), a.send(t);
|
|
98
|
+
}
|
|
99
|
+
sendImg(t) {
|
|
100
|
+
const a = new URLSearchParams(t).toString(), o = new Image();
|
|
101
|
+
o.src = `${this.endpoint}?${a}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const Rr = {
|
|
105
|
+
version: "1.0.0",
|
|
106
|
+
events: {
|
|
107
|
+
pageView: { priority: "low", params: { pageTitle: { type: "string" }, referrer: { type: "string" } } },
|
|
108
|
+
pageStay: { priority: "low", params: { duration: { type: "number" }, scrollDepth: { type: "number" } } },
|
|
109
|
+
exposure: { priority: "low", params: { componentId: { type: "string" }, componentName: { type: "string" }, duration: { type: "number" } } },
|
|
110
|
+
buttonClick: { priority: "medium", params: { buttonId: { type: "string" }, buttonText: { type: "string" }, pageUrl: { type: "string" }, extra: { type: "object" } } },
|
|
111
|
+
formSubmit: { priority: "medium", params: { formId: { type: "string" }, formData: { type: "object" } } },
|
|
112
|
+
purchase: { priority: "high", params: { orderId: { type: "string" }, amount: { type: "number" }, currency: { type: "string" }, items: { type: "array" } } },
|
|
113
|
+
performance: { priority: "low", params: { fcp: { type: "number" }, lcp: { type: "number" }, ttfb: { type: "number" } } },
|
|
114
|
+
error: { priority: "high", params: { message: { type: "string" }, stack: { type: "string" }, filename: { type: "string" }, lineno: { type: "number" }, colno: { type: "number" } } }
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
class Tr {
|
|
118
|
+
constructor(t) {
|
|
119
|
+
T(this, "schema", Rr);
|
|
120
|
+
t && this.loadConfig(t);
|
|
121
|
+
}
|
|
122
|
+
loadConfig(t) {
|
|
123
|
+
console.log(`[SchemaManager] Loading config version ${t.version}`), this.schema = {
|
|
124
|
+
version: t.version,
|
|
125
|
+
events: { ...this.schema.events, ...t.events }
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validate event parameters against the schema.
|
|
130
|
+
* @param eventName Name of the event
|
|
131
|
+
* @param params Event parameters
|
|
132
|
+
* @returns Validation result
|
|
133
|
+
*/
|
|
134
|
+
validate(t, a = {}) {
|
|
135
|
+
const o = this.schema.events[t];
|
|
136
|
+
if (!o)
|
|
137
|
+
return { valid: !1, errors: [`Event '${t}' is not defined in the schema.`] };
|
|
138
|
+
const f = [];
|
|
139
|
+
for (const [m, h] of Object.entries(o.params)) {
|
|
140
|
+
const p = a[m];
|
|
141
|
+
if (h.required && p == null) {
|
|
142
|
+
f.push(`Missing required parameter: '${m}'`);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (p !== void 0) {
|
|
146
|
+
const v = this.getType(p);
|
|
147
|
+
v !== h.type && h.type !== "object" && f.push(`Parameter '${m}' expected type '${h.type}' but got '${v}'`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
valid: f.length === 0,
|
|
152
|
+
errors: f
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
getEventPriority(t) {
|
|
156
|
+
var a;
|
|
157
|
+
return ((a = this.schema.events[t]) == null ? void 0 : a.priority) || "low";
|
|
158
|
+
}
|
|
159
|
+
getType(t) {
|
|
160
|
+
return Array.isArray(t) ? "array" : typeof t;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
class _r {
|
|
164
|
+
constructor(t) {
|
|
165
|
+
T(this, "eventManager");
|
|
166
|
+
T(this, "queueManager");
|
|
167
|
+
T(this, "strategyManager");
|
|
168
|
+
T(this, "schemaManager");
|
|
169
|
+
T(this, "isInitialized", !1);
|
|
170
|
+
T(this, "debug", !1);
|
|
171
|
+
this.eventManager = new br(), this.strategyManager = new wr(t.endpoint), this.queueManager = new Er(this.strategyManager), this.schemaManager = new Tr(), this.debug = !!t.debug, t.autoTrack && this.initAutoTracking(), this.setupUnload(), this.isInitialized = !0;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Safe execution wrapper to handle errors based on debug mode.
|
|
175
|
+
* @param fn Function to execute safely
|
|
176
|
+
*/
|
|
177
|
+
safeRun(t) {
|
|
178
|
+
try {
|
|
179
|
+
t();
|
|
180
|
+
} catch (a) {
|
|
181
|
+
if (this.debug)
|
|
182
|
+
throw console.error("[Tracker SDK Error]", a), a;
|
|
183
|
+
console.warn("[Tracker SDK] Suppressed Error:", a);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Load dynamic schema (IDL/JSON) for event validation.
|
|
188
|
+
* @param config Schema configuration
|
|
189
|
+
*/
|
|
190
|
+
loadSchema(t) {
|
|
191
|
+
this.schemaManager.loadConfig(t);
|
|
192
|
+
}
|
|
193
|
+
// Implementation
|
|
194
|
+
trackEvent(t, a, o) {
|
|
195
|
+
this.safeRun(() => {
|
|
196
|
+
if (!this.isInitialized) {
|
|
197
|
+
this.debug && console.warn("Tracker not initialized");
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const f = this.schemaManager.validate(t, a);
|
|
201
|
+
if (!f.valid) {
|
|
202
|
+
const p = `[Validation Fail] Event '${t}': ${f.errors.join("; ")}`;
|
|
203
|
+
if (this.debug)
|
|
204
|
+
throw new Error(p);
|
|
205
|
+
console.warn(p);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const m = this.eventManager.createEvent(t, a);
|
|
209
|
+
let h = o;
|
|
210
|
+
h === void 0 && (h = this.schemaManager.getEventPriority(t) === "high"), this.queueManager.addEvent(m, h);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
initAutoTracking() {
|
|
214
|
+
this.safeRun(() => {
|
|
215
|
+
this.trackPageView(), this.trackClicks(), this.trackErrors(), this.trackPerformance();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
trackPageView() {
|
|
219
|
+
this.trackEvent("pageView", {
|
|
220
|
+
pageTitle: document.title,
|
|
221
|
+
referrer: document.referrer
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
trackClicks() {
|
|
225
|
+
window.addEventListener("click", (t) => {
|
|
226
|
+
this.safeRun(() => {
|
|
227
|
+
const o = t.target.closest("[data-event]");
|
|
228
|
+
if (o) {
|
|
229
|
+
const f = o.getAttribute("id") || o.getAttribute("data-event") || "unknown", m = o.innerText || "";
|
|
230
|
+
this.trackEvent("buttonClick", {
|
|
231
|
+
buttonId: f,
|
|
232
|
+
buttonText: m,
|
|
233
|
+
pageUrl: window.location.href
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}, !0);
|
|
238
|
+
}
|
|
239
|
+
trackErrors() {
|
|
240
|
+
window.addEventListener("error", (t) => {
|
|
241
|
+
this.safeRun(() => {
|
|
242
|
+
this.trackEvent("error", {
|
|
243
|
+
message: t.message,
|
|
244
|
+
filename: t.filename,
|
|
245
|
+
lineno: t.lineno,
|
|
246
|
+
colno: t.colno
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}), window.addEventListener("unhandledrejection", (t) => {
|
|
250
|
+
this.safeRun(() => {
|
|
251
|
+
this.trackEvent("error", {
|
|
252
|
+
message: `Unhandled Promise Rejection: ${t.reason}`
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
trackPerformance() {
|
|
258
|
+
"PerformanceObserver" in window && (new PerformanceObserver((o) => {
|
|
259
|
+
for (const f of o.getEntries())
|
|
260
|
+
f.name;
|
|
261
|
+
}).observe({ type: "paint", buffered: !0 }), new PerformanceObserver((o) => {
|
|
262
|
+
o.getEntries().length > 0;
|
|
263
|
+
}).observe({ type: "largest-contentful-paint", buffered: !0 })), window.addEventListener("load", () => {
|
|
264
|
+
this.safeRun(() => {
|
|
265
|
+
const t = performance.getEntriesByType("navigation")[0];
|
|
266
|
+
t && this.trackEvent("performance", {
|
|
267
|
+
fcp: 0,
|
|
268
|
+
lcp: 0,
|
|
269
|
+
ttfb: t.responseStart - t.requestStart
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
setupUnload() {
|
|
275
|
+
window.addEventListener("visibilitychange", () => {
|
|
276
|
+
document.visibilityState === "hidden" && this.queueManager.flushOnUnload();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
var ee = { exports: {} }, F = {};
|
|
281
|
+
/**
|
|
282
|
+
* @license React
|
|
283
|
+
* react-jsx-runtime.production.min.js
|
|
284
|
+
*
|
|
285
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the MIT license found in the
|
|
288
|
+
* LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/
|
|
290
|
+
var Pe;
|
|
291
|
+
function kr() {
|
|
292
|
+
if (Pe) return F;
|
|
293
|
+
Pe = 1;
|
|
294
|
+
var u = Ce, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, f = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
295
|
+
function h(p, v, _) {
|
|
296
|
+
var b, S = {}, P = null, L = null;
|
|
297
|
+
_ !== void 0 && (P = "" + _), v.key !== void 0 && (P = "" + v.key), v.ref !== void 0 && (L = v.ref);
|
|
298
|
+
for (b in v) o.call(v, b) && !m.hasOwnProperty(b) && (S[b] = v[b]);
|
|
299
|
+
if (p && p.defaultProps) for (b in v = p.defaultProps, v) S[b] === void 0 && (S[b] = v[b]);
|
|
300
|
+
return { $$typeof: t, type: p, key: P, ref: L, props: S, _owner: f.current };
|
|
301
|
+
}
|
|
302
|
+
return F.Fragment = a, F.jsx = h, F.jsxs = h, F;
|
|
303
|
+
}
|
|
304
|
+
var $ = {};
|
|
305
|
+
/**
|
|
306
|
+
* @license React
|
|
307
|
+
* react-jsx-runtime.development.js
|
|
308
|
+
*
|
|
309
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the MIT license found in the
|
|
312
|
+
* LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/
|
|
314
|
+
var xe;
|
|
315
|
+
function Sr() {
|
|
316
|
+
return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
317
|
+
var u = Ce, t = Symbol.for("react.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), p = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), te = Symbol.iterator, De = "@@iterator";
|
|
318
|
+
function Ie(e) {
|
|
319
|
+
if (e === null || typeof e != "object")
|
|
320
|
+
return null;
|
|
321
|
+
var r = te && e[te] || e[De];
|
|
322
|
+
return typeof r == "function" ? r : null;
|
|
323
|
+
}
|
|
324
|
+
var j = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
325
|
+
function E(e) {
|
|
326
|
+
{
|
|
327
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
|
|
328
|
+
n[i - 1] = arguments[i];
|
|
329
|
+
Me("error", e, n);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function Me(e, r, n) {
|
|
333
|
+
{
|
|
334
|
+
var i = j.ReactDebugCurrentFrame, l = i.getStackAddendum();
|
|
335
|
+
l !== "" && (r += "%s", n = n.concat([l]));
|
|
336
|
+
var d = n.map(function(c) {
|
|
337
|
+
return String(c);
|
|
338
|
+
});
|
|
339
|
+
d.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, d);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
var Ae = !1, Fe = !1, $e = !1, Ue = !1, qe = !1, ne;
|
|
343
|
+
ne = Symbol.for("react.module.reference");
|
|
344
|
+
function Le(e) {
|
|
345
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === m || qe || e === f || e === _ || e === b || Ue || e === L || Ae || Fe || $e || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === S || e.$$typeof === h || e.$$typeof === p || e.$$typeof === v || // This needs to include all possible module reference object
|
|
346
|
+
// types supported by any Flight configuration anywhere since
|
|
347
|
+
// we don't know which Flight build this will end up being used
|
|
348
|
+
// with.
|
|
349
|
+
e.$$typeof === ne || e.getModuleId !== void 0));
|
|
350
|
+
}
|
|
351
|
+
function Ve(e, r, n) {
|
|
352
|
+
var i = e.displayName;
|
|
353
|
+
if (i)
|
|
354
|
+
return i;
|
|
355
|
+
var l = r.displayName || r.name || "";
|
|
356
|
+
return l !== "" ? n + "(" + l + ")" : n;
|
|
357
|
+
}
|
|
358
|
+
function ae(e) {
|
|
359
|
+
return e.displayName || "Context";
|
|
360
|
+
}
|
|
361
|
+
function O(e) {
|
|
362
|
+
if (e == null)
|
|
363
|
+
return null;
|
|
364
|
+
if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
365
|
+
return e.displayName || e.name || null;
|
|
366
|
+
if (typeof e == "string")
|
|
367
|
+
return e;
|
|
368
|
+
switch (e) {
|
|
369
|
+
case o:
|
|
370
|
+
return "Fragment";
|
|
371
|
+
case a:
|
|
372
|
+
return "Portal";
|
|
373
|
+
case m:
|
|
374
|
+
return "Profiler";
|
|
375
|
+
case f:
|
|
376
|
+
return "StrictMode";
|
|
377
|
+
case _:
|
|
378
|
+
return "Suspense";
|
|
379
|
+
case b:
|
|
380
|
+
return "SuspenseList";
|
|
381
|
+
}
|
|
382
|
+
if (typeof e == "object")
|
|
383
|
+
switch (e.$$typeof) {
|
|
384
|
+
case p:
|
|
385
|
+
var r = e;
|
|
386
|
+
return ae(r) + ".Consumer";
|
|
387
|
+
case h:
|
|
388
|
+
var n = e;
|
|
389
|
+
return ae(n._context) + ".Provider";
|
|
390
|
+
case v:
|
|
391
|
+
return Ve(e, e.render, "ForwardRef");
|
|
392
|
+
case S:
|
|
393
|
+
var i = e.displayName || null;
|
|
394
|
+
return i !== null ? i : O(e.type) || "Memo";
|
|
395
|
+
case P: {
|
|
396
|
+
var l = e, d = l._payload, c = l._init;
|
|
397
|
+
try {
|
|
398
|
+
return O(c(d));
|
|
399
|
+
} catch {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
var x = Object.assign, M = 0, ie, oe, se, ue, ce, le, fe;
|
|
407
|
+
function de() {
|
|
408
|
+
}
|
|
409
|
+
de.__reactDisabledLog = !0;
|
|
410
|
+
function Ye() {
|
|
411
|
+
{
|
|
412
|
+
if (M === 0) {
|
|
413
|
+
ie = console.log, oe = console.info, se = console.warn, ue = console.error, ce = console.group, le = console.groupCollapsed, fe = console.groupEnd;
|
|
414
|
+
var e = {
|
|
415
|
+
configurable: !0,
|
|
416
|
+
enumerable: !0,
|
|
417
|
+
value: de,
|
|
418
|
+
writable: !0
|
|
419
|
+
};
|
|
420
|
+
Object.defineProperties(console, {
|
|
421
|
+
info: e,
|
|
422
|
+
log: e,
|
|
423
|
+
warn: e,
|
|
424
|
+
error: e,
|
|
425
|
+
group: e,
|
|
426
|
+
groupCollapsed: e,
|
|
427
|
+
groupEnd: e
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
M++;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function We() {
|
|
434
|
+
{
|
|
435
|
+
if (M--, M === 0) {
|
|
436
|
+
var e = {
|
|
437
|
+
configurable: !0,
|
|
438
|
+
enumerable: !0,
|
|
439
|
+
writable: !0
|
|
440
|
+
};
|
|
441
|
+
Object.defineProperties(console, {
|
|
442
|
+
log: x({}, e, {
|
|
443
|
+
value: ie
|
|
444
|
+
}),
|
|
445
|
+
info: x({}, e, {
|
|
446
|
+
value: oe
|
|
447
|
+
}),
|
|
448
|
+
warn: x({}, e, {
|
|
449
|
+
value: se
|
|
450
|
+
}),
|
|
451
|
+
error: x({}, e, {
|
|
452
|
+
value: ue
|
|
453
|
+
}),
|
|
454
|
+
group: x({}, e, {
|
|
455
|
+
value: ce
|
|
456
|
+
}),
|
|
457
|
+
groupCollapsed: x({}, e, {
|
|
458
|
+
value: le
|
|
459
|
+
}),
|
|
460
|
+
groupEnd: x({}, e, {
|
|
461
|
+
value: fe
|
|
462
|
+
})
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
M < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
var H = j.ReactCurrentDispatcher, J;
|
|
469
|
+
function V(e, r, n) {
|
|
470
|
+
{
|
|
471
|
+
if (J === void 0)
|
|
472
|
+
try {
|
|
473
|
+
throw Error();
|
|
474
|
+
} catch (l) {
|
|
475
|
+
var i = l.stack.trim().match(/\n( *(at )?)/);
|
|
476
|
+
J = i && i[1] || "";
|
|
477
|
+
}
|
|
478
|
+
return `
|
|
479
|
+
` + J + e;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
var K = !1, Y;
|
|
483
|
+
{
|
|
484
|
+
var Be = typeof WeakMap == "function" ? WeakMap : Map;
|
|
485
|
+
Y = new Be();
|
|
486
|
+
}
|
|
487
|
+
function pe(e, r) {
|
|
488
|
+
if (!e || K)
|
|
489
|
+
return "";
|
|
490
|
+
{
|
|
491
|
+
var n = Y.get(e);
|
|
492
|
+
if (n !== void 0)
|
|
493
|
+
return n;
|
|
494
|
+
}
|
|
495
|
+
var i;
|
|
496
|
+
K = !0;
|
|
497
|
+
var l = Error.prepareStackTrace;
|
|
498
|
+
Error.prepareStackTrace = void 0;
|
|
499
|
+
var d;
|
|
500
|
+
d = H.current, H.current = null, Ye();
|
|
501
|
+
try {
|
|
502
|
+
if (r) {
|
|
503
|
+
var c = function() {
|
|
504
|
+
throw Error();
|
|
505
|
+
};
|
|
506
|
+
if (Object.defineProperty(c.prototype, "props", {
|
|
507
|
+
set: function() {
|
|
508
|
+
throw Error();
|
|
509
|
+
}
|
|
510
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
511
|
+
try {
|
|
512
|
+
Reflect.construct(c, []);
|
|
513
|
+
} catch (R) {
|
|
514
|
+
i = R;
|
|
515
|
+
}
|
|
516
|
+
Reflect.construct(e, [], c);
|
|
517
|
+
} else {
|
|
518
|
+
try {
|
|
519
|
+
c.call();
|
|
520
|
+
} catch (R) {
|
|
521
|
+
i = R;
|
|
522
|
+
}
|
|
523
|
+
e.call(c.prototype);
|
|
524
|
+
}
|
|
525
|
+
} else {
|
|
526
|
+
try {
|
|
527
|
+
throw Error();
|
|
528
|
+
} catch (R) {
|
|
529
|
+
i = R;
|
|
530
|
+
}
|
|
531
|
+
e();
|
|
532
|
+
}
|
|
533
|
+
} catch (R) {
|
|
534
|
+
if (R && i && typeof R.stack == "string") {
|
|
535
|
+
for (var s = R.stack.split(`
|
|
536
|
+
`), w = i.stack.split(`
|
|
537
|
+
`), g = s.length - 1, y = w.length - 1; g >= 1 && y >= 0 && s[g] !== w[y]; )
|
|
538
|
+
y--;
|
|
539
|
+
for (; g >= 1 && y >= 0; g--, y--)
|
|
540
|
+
if (s[g] !== w[y]) {
|
|
541
|
+
if (g !== 1 || y !== 1)
|
|
542
|
+
do
|
|
543
|
+
if (g--, y--, y < 0 || s[g] !== w[y]) {
|
|
544
|
+
var k = `
|
|
545
|
+
` + s[g].replace(" at new ", " at ");
|
|
546
|
+
return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, k), k;
|
|
547
|
+
}
|
|
548
|
+
while (g >= 1 && y >= 0);
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
} finally {
|
|
553
|
+
K = !1, H.current = d, We(), Error.prepareStackTrace = l;
|
|
554
|
+
}
|
|
555
|
+
var I = e ? e.displayName || e.name : "", C = I ? V(I) : "";
|
|
556
|
+
return typeof e == "function" && Y.set(e, C), C;
|
|
557
|
+
}
|
|
558
|
+
function ze(e, r, n) {
|
|
559
|
+
return pe(e, !1);
|
|
560
|
+
}
|
|
561
|
+
function He(e) {
|
|
562
|
+
var r = e.prototype;
|
|
563
|
+
return !!(r && r.isReactComponent);
|
|
564
|
+
}
|
|
565
|
+
function W(e, r, n) {
|
|
566
|
+
if (e == null)
|
|
567
|
+
return "";
|
|
568
|
+
if (typeof e == "function")
|
|
569
|
+
return pe(e, He(e));
|
|
570
|
+
if (typeof e == "string")
|
|
571
|
+
return V(e);
|
|
572
|
+
switch (e) {
|
|
573
|
+
case _:
|
|
574
|
+
return V("Suspense");
|
|
575
|
+
case b:
|
|
576
|
+
return V("SuspenseList");
|
|
577
|
+
}
|
|
578
|
+
if (typeof e == "object")
|
|
579
|
+
switch (e.$$typeof) {
|
|
580
|
+
case v:
|
|
581
|
+
return ze(e.render);
|
|
582
|
+
case S:
|
|
583
|
+
return W(e.type, r, n);
|
|
584
|
+
case P: {
|
|
585
|
+
var i = e, l = i._payload, d = i._init;
|
|
586
|
+
try {
|
|
587
|
+
return W(d(l), r, n);
|
|
588
|
+
} catch {
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return "";
|
|
593
|
+
}
|
|
594
|
+
var A = Object.prototype.hasOwnProperty, ve = {}, he = j.ReactDebugCurrentFrame;
|
|
595
|
+
function B(e) {
|
|
596
|
+
if (e) {
|
|
597
|
+
var r = e._owner, n = W(e.type, e._source, r ? r.type : null);
|
|
598
|
+
he.setExtraStackFrame(n);
|
|
599
|
+
} else
|
|
600
|
+
he.setExtraStackFrame(null);
|
|
601
|
+
}
|
|
602
|
+
function Je(e, r, n, i, l) {
|
|
603
|
+
{
|
|
604
|
+
var d = Function.call.bind(A);
|
|
605
|
+
for (var c in e)
|
|
606
|
+
if (d(e, c)) {
|
|
607
|
+
var s = void 0;
|
|
608
|
+
try {
|
|
609
|
+
if (typeof e[c] != "function") {
|
|
610
|
+
var w = Error((i || "React class") + ": " + n + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
611
|
+
throw w.name = "Invariant Violation", w;
|
|
612
|
+
}
|
|
613
|
+
s = e[c](r, c, i, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
614
|
+
} catch (g) {
|
|
615
|
+
s = g;
|
|
616
|
+
}
|
|
617
|
+
s && !(s instanceof Error) && (B(l), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", i || "React class", n, c, typeof s), B(null)), s instanceof Error && !(s.message in ve) && (ve[s.message] = !0, B(l), E("Failed %s type: %s", n, s.message), B(null));
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
var Ke = Array.isArray;
|
|
622
|
+
function N(e) {
|
|
623
|
+
return Ke(e);
|
|
624
|
+
}
|
|
625
|
+
function Ne(e) {
|
|
626
|
+
{
|
|
627
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
628
|
+
return n;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
function Xe(e) {
|
|
632
|
+
try {
|
|
633
|
+
return ge(e), !1;
|
|
634
|
+
} catch {
|
|
635
|
+
return !0;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function ge(e) {
|
|
639
|
+
return "" + e;
|
|
640
|
+
}
|
|
641
|
+
function me(e) {
|
|
642
|
+
if (Xe(e))
|
|
643
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ne(e)), ge(e);
|
|
644
|
+
}
|
|
645
|
+
var ye = j.ReactCurrentOwner, Ge = {
|
|
646
|
+
key: !0,
|
|
647
|
+
ref: !0,
|
|
648
|
+
__self: !0,
|
|
649
|
+
__source: !0
|
|
650
|
+
}, be, Ee;
|
|
651
|
+
function Qe(e) {
|
|
652
|
+
if (A.call(e, "ref")) {
|
|
653
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
654
|
+
if (r && r.isReactWarning)
|
|
655
|
+
return !1;
|
|
656
|
+
}
|
|
657
|
+
return e.ref !== void 0;
|
|
658
|
+
}
|
|
659
|
+
function Ze(e) {
|
|
660
|
+
if (A.call(e, "key")) {
|
|
661
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
662
|
+
if (r && r.isReactWarning)
|
|
663
|
+
return !1;
|
|
664
|
+
}
|
|
665
|
+
return e.key !== void 0;
|
|
666
|
+
}
|
|
667
|
+
function er(e, r) {
|
|
668
|
+
typeof e.ref == "string" && ye.current;
|
|
669
|
+
}
|
|
670
|
+
function rr(e, r) {
|
|
671
|
+
{
|
|
672
|
+
var n = function() {
|
|
673
|
+
be || (be = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
674
|
+
};
|
|
675
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
676
|
+
get: n,
|
|
677
|
+
configurable: !0
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function tr(e, r) {
|
|
682
|
+
{
|
|
683
|
+
var n = function() {
|
|
684
|
+
Ee || (Ee = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
685
|
+
};
|
|
686
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
687
|
+
get: n,
|
|
688
|
+
configurable: !0
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
var nr = function(e, r, n, i, l, d, c) {
|
|
693
|
+
var s = {
|
|
694
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
695
|
+
$$typeof: t,
|
|
696
|
+
// Built-in properties that belong on the element
|
|
697
|
+
type: e,
|
|
698
|
+
key: r,
|
|
699
|
+
ref: n,
|
|
700
|
+
props: c,
|
|
701
|
+
// Record the component responsible for creating this element.
|
|
702
|
+
_owner: d
|
|
703
|
+
};
|
|
704
|
+
return s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
705
|
+
configurable: !1,
|
|
706
|
+
enumerable: !1,
|
|
707
|
+
writable: !0,
|
|
708
|
+
value: !1
|
|
709
|
+
}), Object.defineProperty(s, "_self", {
|
|
710
|
+
configurable: !1,
|
|
711
|
+
enumerable: !1,
|
|
712
|
+
writable: !1,
|
|
713
|
+
value: i
|
|
714
|
+
}), Object.defineProperty(s, "_source", {
|
|
715
|
+
configurable: !1,
|
|
716
|
+
enumerable: !1,
|
|
717
|
+
writable: !1,
|
|
718
|
+
value: l
|
|
719
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
720
|
+
};
|
|
721
|
+
function ar(e, r, n, i, l) {
|
|
722
|
+
{
|
|
723
|
+
var d, c = {}, s = null, w = null;
|
|
724
|
+
n !== void 0 && (me(n), s = "" + n), Ze(r) && (me(r.key), s = "" + r.key), Qe(r) && (w = r.ref, er(r, l));
|
|
725
|
+
for (d in r)
|
|
726
|
+
A.call(r, d) && !Ge.hasOwnProperty(d) && (c[d] = r[d]);
|
|
727
|
+
if (e && e.defaultProps) {
|
|
728
|
+
var g = e.defaultProps;
|
|
729
|
+
for (d in g)
|
|
730
|
+
c[d] === void 0 && (c[d] = g[d]);
|
|
731
|
+
}
|
|
732
|
+
if (s || w) {
|
|
733
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
734
|
+
s && rr(c, y), w && tr(c, y);
|
|
735
|
+
}
|
|
736
|
+
return nr(e, s, w, l, i, ye.current, c);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
var X = j.ReactCurrentOwner, we = j.ReactDebugCurrentFrame;
|
|
740
|
+
function D(e) {
|
|
741
|
+
if (e) {
|
|
742
|
+
var r = e._owner, n = W(e.type, e._source, r ? r.type : null);
|
|
743
|
+
we.setExtraStackFrame(n);
|
|
744
|
+
} else
|
|
745
|
+
we.setExtraStackFrame(null);
|
|
746
|
+
}
|
|
747
|
+
var G;
|
|
748
|
+
G = !1;
|
|
749
|
+
function Q(e) {
|
|
750
|
+
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
751
|
+
}
|
|
752
|
+
function Re() {
|
|
753
|
+
{
|
|
754
|
+
if (X.current) {
|
|
755
|
+
var e = O(X.current.type);
|
|
756
|
+
if (e)
|
|
757
|
+
return `
|
|
758
|
+
|
|
759
|
+
Check the render method of \`` + e + "`.";
|
|
760
|
+
}
|
|
761
|
+
return "";
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
function ir(e) {
|
|
765
|
+
return "";
|
|
766
|
+
}
|
|
767
|
+
var Te = {};
|
|
768
|
+
function or(e) {
|
|
769
|
+
{
|
|
770
|
+
var r = Re();
|
|
771
|
+
if (!r) {
|
|
772
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
773
|
+
n && (r = `
|
|
774
|
+
|
|
775
|
+
Check the top-level render call using <` + n + ">.");
|
|
776
|
+
}
|
|
777
|
+
return r;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
function _e(e, r) {
|
|
781
|
+
{
|
|
782
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
783
|
+
return;
|
|
784
|
+
e._store.validated = !0;
|
|
785
|
+
var n = or(r);
|
|
786
|
+
if (Te[n])
|
|
787
|
+
return;
|
|
788
|
+
Te[n] = !0;
|
|
789
|
+
var i = "";
|
|
790
|
+
e && e._owner && e._owner !== X.current && (i = " It was passed a child from " + O(e._owner.type) + "."), D(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, i), D(null);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
function ke(e, r) {
|
|
794
|
+
{
|
|
795
|
+
if (typeof e != "object")
|
|
796
|
+
return;
|
|
797
|
+
if (N(e))
|
|
798
|
+
for (var n = 0; n < e.length; n++) {
|
|
799
|
+
var i = e[n];
|
|
800
|
+
Q(i) && _e(i, r);
|
|
801
|
+
}
|
|
802
|
+
else if (Q(e))
|
|
803
|
+
e._store && (e._store.validated = !0);
|
|
804
|
+
else if (e) {
|
|
805
|
+
var l = Ie(e);
|
|
806
|
+
if (typeof l == "function" && l !== e.entries)
|
|
807
|
+
for (var d = l.call(e), c; !(c = d.next()).done; )
|
|
808
|
+
Q(c.value) && _e(c.value, r);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
function sr(e) {
|
|
813
|
+
{
|
|
814
|
+
var r = e.type;
|
|
815
|
+
if (r == null || typeof r == "string")
|
|
816
|
+
return;
|
|
817
|
+
var n;
|
|
818
|
+
if (typeof r == "function")
|
|
819
|
+
n = r.propTypes;
|
|
820
|
+
else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
|
|
821
|
+
// Inner props are checked in the reconciler.
|
|
822
|
+
r.$$typeof === S))
|
|
823
|
+
n = r.propTypes;
|
|
824
|
+
else
|
|
825
|
+
return;
|
|
826
|
+
if (n) {
|
|
827
|
+
var i = O(r);
|
|
828
|
+
Je(n, e.props, "prop", i, e);
|
|
829
|
+
} else if (r.PropTypes !== void 0 && !G) {
|
|
830
|
+
G = !0;
|
|
831
|
+
var l = O(r);
|
|
832
|
+
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
|
|
833
|
+
}
|
|
834
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function ur(e) {
|
|
838
|
+
{
|
|
839
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
840
|
+
var i = r[n];
|
|
841
|
+
if (i !== "children" && i !== "key") {
|
|
842
|
+
D(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), D(null);
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
e.ref !== null && (D(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
var Se = {};
|
|
850
|
+
function Oe(e, r, n, i, l, d) {
|
|
851
|
+
{
|
|
852
|
+
var c = Le(e);
|
|
853
|
+
if (!c) {
|
|
854
|
+
var s = "";
|
|
855
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
856
|
+
var w = ir();
|
|
857
|
+
w ? s += w : s += Re();
|
|
858
|
+
var g;
|
|
859
|
+
e === null ? g = "null" : N(e) ? g = "array" : e !== void 0 && e.$$typeof === t ? (g = "<" + (O(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, s);
|
|
860
|
+
}
|
|
861
|
+
var y = ar(e, r, n, l, d);
|
|
862
|
+
if (y == null)
|
|
863
|
+
return y;
|
|
864
|
+
if (c) {
|
|
865
|
+
var k = r.children;
|
|
866
|
+
if (k !== void 0)
|
|
867
|
+
if (i)
|
|
868
|
+
if (N(k)) {
|
|
869
|
+
for (var I = 0; I < k.length; I++)
|
|
870
|
+
ke(k[I], e);
|
|
871
|
+
Object.freeze && Object.freeze(k);
|
|
872
|
+
} else
|
|
873
|
+
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
874
|
+
else
|
|
875
|
+
ke(k, e);
|
|
876
|
+
}
|
|
877
|
+
if (A.call(r, "key")) {
|
|
878
|
+
var C = O(e), R = Object.keys(r).filter(function(vr) {
|
|
879
|
+
return vr !== "key";
|
|
880
|
+
}), Z = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
881
|
+
if (!Se[C + Z]) {
|
|
882
|
+
var pr = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
|
|
883
|
+
E(`A props object containing a "key" prop is being spread into JSX:
|
|
884
|
+
let props = %s;
|
|
885
|
+
<%s {...props} />
|
|
886
|
+
React keys must be passed directly to JSX without using spread:
|
|
887
|
+
let props = %s;
|
|
888
|
+
<%s key={someKey} {...props} />`, Z, C, pr, C), Se[C + Z] = !0;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return e === o ? ur(y) : sr(y), y;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
function cr(e, r, n) {
|
|
895
|
+
return Oe(e, r, n, !0);
|
|
896
|
+
}
|
|
897
|
+
function lr(e, r, n) {
|
|
898
|
+
return Oe(e, r, n, !1);
|
|
899
|
+
}
|
|
900
|
+
var fr = lr, dr = cr;
|
|
901
|
+
$.Fragment = o, $.jsx = fr, $.jsxs = dr;
|
|
902
|
+
}()), $;
|
|
903
|
+
}
|
|
904
|
+
process.env.NODE_ENV === "production" ? ee.exports = kr() : ee.exports = Sr();
|
|
905
|
+
var U = ee.exports;
|
|
906
|
+
const je = mr(null), Cr = ({ config: u, children: t }) => {
|
|
907
|
+
const a = z(null);
|
|
908
|
+
return a.current || (a.current = new _r(u)), /* @__PURE__ */ U.jsx(je.Provider, { value: a.current, children: t });
|
|
909
|
+
}, q = () => {
|
|
910
|
+
const u = yr(je);
|
|
911
|
+
if (!u)
|
|
912
|
+
throw new Error("useTracker must be used within a TrackerProvider");
|
|
913
|
+
return u;
|
|
914
|
+
}, Or = (u) => {
|
|
915
|
+
const t = q();
|
|
916
|
+
re(() => {
|
|
917
|
+
t.trackEvent("pageView", {
|
|
918
|
+
pageTitle: u || document.title,
|
|
919
|
+
referrer: document.referrer
|
|
920
|
+
});
|
|
921
|
+
}, [t, u]);
|
|
922
|
+
}, jr = () => {
|
|
923
|
+
const u = q(), t = z(Date.now());
|
|
924
|
+
re(() => (t.current = Date.now(), () => {
|
|
925
|
+
const a = Date.now() - t.current, o = Math.round((window.scrollY + window.innerHeight) / document.body.scrollHeight * 100);
|
|
926
|
+
u.trackEvent("pageStay", {
|
|
927
|
+
duration: a,
|
|
928
|
+
scrollDepth: o
|
|
929
|
+
});
|
|
930
|
+
}), [u]);
|
|
931
|
+
}, Dr = (u, t) => {
|
|
932
|
+
const a = q(), o = z(null), f = z(null);
|
|
933
|
+
return re(() => {
|
|
934
|
+
const m = o.current;
|
|
935
|
+
if (!m) return;
|
|
936
|
+
const h = new IntersectionObserver((p) => {
|
|
937
|
+
p.forEach((v) => {
|
|
938
|
+
if (v.isIntersecting)
|
|
939
|
+
f.current = Date.now();
|
|
940
|
+
else if (f.current) {
|
|
941
|
+
const _ = Date.now() - f.current;
|
|
942
|
+
a.trackEvent("exposure", {
|
|
943
|
+
componentId: u,
|
|
944
|
+
componentName: t,
|
|
945
|
+
duration: _
|
|
946
|
+
}), f.current = null;
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
}, { threshold: 0.5 });
|
|
950
|
+
return h.observe(m), () => {
|
|
951
|
+
if (h.disconnect(), f.current) {
|
|
952
|
+
const p = Date.now() - f.current;
|
|
953
|
+
a.trackEvent("exposure", {
|
|
954
|
+
componentId: u,
|
|
955
|
+
componentName: t,
|
|
956
|
+
duration: p
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
};
|
|
960
|
+
}, [a, u, t]), o;
|
|
961
|
+
}, Ir = ({
|
|
962
|
+
eventId: u,
|
|
963
|
+
buttonName: t,
|
|
964
|
+
extraParams: a,
|
|
965
|
+
children: o,
|
|
966
|
+
onClick: f,
|
|
967
|
+
...m
|
|
968
|
+
}) => {
|
|
969
|
+
const h = q(), p = (v) => {
|
|
970
|
+
h.trackEvent("buttonClick", {
|
|
971
|
+
buttonId: u || m.id || "unknown-btn",
|
|
972
|
+
buttonText: t,
|
|
973
|
+
pageUrl: window.location.href,
|
|
974
|
+
extra: a
|
|
975
|
+
}), f && f(v);
|
|
976
|
+
};
|
|
977
|
+
return /* @__PURE__ */ U.jsx(
|
|
978
|
+
"button",
|
|
979
|
+
{
|
|
980
|
+
onClick: p,
|
|
981
|
+
...m,
|
|
982
|
+
children: o
|
|
983
|
+
}
|
|
984
|
+
);
|
|
985
|
+
}, Mr = ({ pageTitle: u, children: t }) => (Or(u), /* @__PURE__ */ U.jsx(U.Fragment, { children: t })), Ar = ({
|
|
986
|
+
formId: u,
|
|
987
|
+
children: t,
|
|
988
|
+
onSubmit: a,
|
|
989
|
+
transformData: o,
|
|
990
|
+
...f
|
|
991
|
+
}) => {
|
|
992
|
+
const m = q(), h = (p) => {
|
|
993
|
+
p.preventDefault();
|
|
994
|
+
const v = new FormData(p.currentTarget), _ = {};
|
|
995
|
+
o ? Object.assign(_, o(v)) : v.forEach((b, S) => {
|
|
996
|
+
_[S] = b.toString();
|
|
997
|
+
}), m.trackEvent("formSubmit", {
|
|
998
|
+
formId: u,
|
|
999
|
+
formData: _
|
|
1000
|
+
}), a && a(p);
|
|
1001
|
+
};
|
|
1002
|
+
return /* @__PURE__ */ U.jsx(
|
|
1003
|
+
"form",
|
|
1004
|
+
{
|
|
1005
|
+
onSubmit: h,
|
|
1006
|
+
...f,
|
|
1007
|
+
children: t
|
|
1008
|
+
}
|
|
1009
|
+
);
|
|
1010
|
+
}, Fr = {
|
|
1011
|
+
pageView: {
|
|
1012
|
+
priority: "low",
|
|
1013
|
+
params: ["pageTitle", "referrer"]
|
|
1014
|
+
},
|
|
1015
|
+
pageStay: {
|
|
1016
|
+
priority: "low",
|
|
1017
|
+
params: ["duration", "scrollDepth"]
|
|
1018
|
+
},
|
|
1019
|
+
exposure: {
|
|
1020
|
+
priority: "low",
|
|
1021
|
+
params: ["componentId", "componentName", "duration"]
|
|
1022
|
+
},
|
|
1023
|
+
buttonClick: {
|
|
1024
|
+
priority: "medium",
|
|
1025
|
+
params: ["buttonId", "buttonText", "pageUrl", "extra"]
|
|
1026
|
+
},
|
|
1027
|
+
formSubmit: {
|
|
1028
|
+
priority: "medium",
|
|
1029
|
+
params: ["formId", "formData"]
|
|
1030
|
+
},
|
|
1031
|
+
purchase: {
|
|
1032
|
+
priority: "high",
|
|
1033
|
+
// Critical event
|
|
1034
|
+
params: ["orderId", "amount", "currency", "items"]
|
|
1035
|
+
},
|
|
1036
|
+
performance: {
|
|
1037
|
+
priority: "low",
|
|
1038
|
+
params: ["fcp", "lcp", "ttfb"]
|
|
1039
|
+
},
|
|
1040
|
+
error: {
|
|
1041
|
+
priority: "high",
|
|
1042
|
+
params: ["message", "stack", "filename", "lineno", "colno"]
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
export {
|
|
1046
|
+
br as EventManager,
|
|
1047
|
+
Fr as EventSchema,
|
|
1048
|
+
Er as QueueManager,
|
|
1049
|
+
Tr as SchemaManager,
|
|
1050
|
+
wr as StrategyManager,
|
|
1051
|
+
Ir as TrackedButton,
|
|
1052
|
+
Ar as TrackedForm,
|
|
1053
|
+
Mr as TrackedPage,
|
|
1054
|
+
_r as Tracker,
|
|
1055
|
+
Cr as TrackerProvider,
|
|
1056
|
+
Dr as useExposure,
|
|
1057
|
+
jr as usePageStay,
|
|
1058
|
+
Or as usePageView,
|
|
1059
|
+
q as useTracker
|
|
1060
|
+
};
|