shopkit-analytics 1.0.13 → 1.0.15
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/adapters/index.js +11 -3
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +3 -2
- package/dist/affiliate/index.mjs +1 -0
- package/dist/{chunk-VKBE75YB.mjs → chunk-BE3W2SD6.mjs} +2 -1
- package/dist/chunk-BE3W2SD6.mjs.map +1 -0
- package/dist/{chunk-OT32PIVB.mjs → chunk-CJ3NUEQH.mjs} +12 -4
- package/dist/chunk-CJ3NUEQH.mjs.map +1 -0
- package/dist/{chunk-DY7EQ7D2.mjs → chunk-FTZLYNBN.mjs} +3 -3
- package/dist/chunk-NIL3JVRZ.mjs +39 -0
- package/dist/events/index.d.mts +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +10 -2
- package/dist/events/index.js.map +1 -1
- package/dist/events/index.mjs +4 -3
- package/dist/experiment/index.mjs +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +774 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +762 -9
- package/dist/index.mjs.map +1 -1
- package/dist/services/index.mjs +2 -1
- package/dist/{subscriber-VF3IYUCU.mjs → subscriber-K6VCQXNV.mjs} +2 -1
- package/dist/subscriber-K6VCQXNV.mjs.map +1 -0
- package/dist/types.d.mts +8 -3
- package/dist/types.d.ts +8 -3
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/types.mjs +2 -1
- package/dist/utils/index.mjs +1 -0
- package/package.json +1 -1
- package/dist/chunk-OT32PIVB.mjs.map +0 -1
- package/dist/chunk-VKBE75YB.mjs.map +0 -1
- /package/dist/{chunk-DY7EQ7D2.mjs.map → chunk-FTZLYNBN.mjs.map} +0 -0
- /package/dist/{subscriber-VF3IYUCU.mjs.map → chunk-NIL3JVRZ.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -9,6 +9,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
9
9
|
var __esm = (fn, res) => function __init() {
|
|
10
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
11
|
};
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
12
15
|
var __export = (target, all) => {
|
|
13
16
|
for (var name in all)
|
|
14
17
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -259,6 +262,712 @@ var init_subscriber = __esm({
|
|
|
259
262
|
}
|
|
260
263
|
});
|
|
261
264
|
|
|
265
|
+
// ../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs
|
|
266
|
+
var require_interop_require_default = __commonJS({
|
|
267
|
+
"../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs"(exports2) {
|
|
268
|
+
"use strict";
|
|
269
|
+
exports2._ = exports2._interop_require_default = _interop_require_default;
|
|
270
|
+
function _interop_require_default(obj) {
|
|
271
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// ../../node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js
|
|
277
|
+
var require_app_router_context_shared_runtime = __commonJS({
|
|
278
|
+
"../../node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js"(exports2) {
|
|
279
|
+
"use strict";
|
|
280
|
+
"use client";
|
|
281
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
282
|
+
value: true
|
|
283
|
+
});
|
|
284
|
+
function _export(target, all) {
|
|
285
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: all[name]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
_export(exports2, {
|
|
291
|
+
CacheStates: function() {
|
|
292
|
+
return CacheStates;
|
|
293
|
+
},
|
|
294
|
+
AppRouterContext: function() {
|
|
295
|
+
return AppRouterContext;
|
|
296
|
+
},
|
|
297
|
+
LayoutRouterContext: function() {
|
|
298
|
+
return LayoutRouterContext;
|
|
299
|
+
},
|
|
300
|
+
GlobalLayoutRouterContext: function() {
|
|
301
|
+
return GlobalLayoutRouterContext;
|
|
302
|
+
},
|
|
303
|
+
TemplateContext: function() {
|
|
304
|
+
return TemplateContext;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
var _interop_require_default = require_interop_require_default();
|
|
308
|
+
var _react = /* @__PURE__ */ _interop_require_default._(require("react"));
|
|
309
|
+
var CacheStates;
|
|
310
|
+
(function(CacheStates2) {
|
|
311
|
+
CacheStates2["LAZY_INITIALIZED"] = "LAZYINITIALIZED";
|
|
312
|
+
CacheStates2["DATA_FETCH"] = "DATAFETCH";
|
|
313
|
+
CacheStates2["READY"] = "READY";
|
|
314
|
+
})(CacheStates || (CacheStates = {}));
|
|
315
|
+
var AppRouterContext = _react.default.createContext(null);
|
|
316
|
+
var LayoutRouterContext = _react.default.createContext(null);
|
|
317
|
+
var GlobalLayoutRouterContext = _react.default.createContext(null);
|
|
318
|
+
var TemplateContext = _react.default.createContext(null);
|
|
319
|
+
if (process.env.NODE_ENV !== "production") {
|
|
320
|
+
AppRouterContext.displayName = "AppRouterContext";
|
|
321
|
+
LayoutRouterContext.displayName = "LayoutRouterContext";
|
|
322
|
+
GlobalLayoutRouterContext.displayName = "GlobalLayoutRouterContext";
|
|
323
|
+
TemplateContext.displayName = "TemplateContext";
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// ../../node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js
|
|
329
|
+
var require_hooks_client_context_shared_runtime = __commonJS({
|
|
330
|
+
"../../node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js"(exports2) {
|
|
331
|
+
"use strict";
|
|
332
|
+
"use client";
|
|
333
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
334
|
+
value: true
|
|
335
|
+
});
|
|
336
|
+
function _export(target, all) {
|
|
337
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
338
|
+
enumerable: true,
|
|
339
|
+
get: all[name]
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
_export(exports2, {
|
|
343
|
+
SearchParamsContext: function() {
|
|
344
|
+
return SearchParamsContext;
|
|
345
|
+
},
|
|
346
|
+
PathnameContext: function() {
|
|
347
|
+
return PathnameContext;
|
|
348
|
+
},
|
|
349
|
+
PathParamsContext: function() {
|
|
350
|
+
return PathParamsContext;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
var _react = require("react");
|
|
354
|
+
var SearchParamsContext = (0, _react.createContext)(null);
|
|
355
|
+
var PathnameContext = (0, _react.createContext)(null);
|
|
356
|
+
var PathParamsContext = (0, _react.createContext)(null);
|
|
357
|
+
if (process.env.NODE_ENV !== "production") {
|
|
358
|
+
SearchParamsContext.displayName = "SearchParamsContext";
|
|
359
|
+
PathnameContext.displayName = "PathnameContext";
|
|
360
|
+
PathParamsContext.displayName = "PathParamsContext";
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// ../../node_modules/next/dist/client/components/client-hook-in-server-component-error.js
|
|
366
|
+
var require_client_hook_in_server_component_error = __commonJS({
|
|
367
|
+
"../../node_modules/next/dist/client/components/client-hook-in-server-component-error.js"(exports2, module2) {
|
|
368
|
+
"use strict";
|
|
369
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
370
|
+
value: true
|
|
371
|
+
});
|
|
372
|
+
Object.defineProperty(exports2, "clientHookInServerComponentError", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function() {
|
|
375
|
+
return clientHookInServerComponentError;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
var _interop_require_default = require_interop_require_default();
|
|
379
|
+
var _react = /* @__PURE__ */ _interop_require_default._(require("react"));
|
|
380
|
+
function clientHookInServerComponentError(hookName) {
|
|
381
|
+
if (process.env.NODE_ENV !== "production") {
|
|
382
|
+
if (!_react.default.useState) {
|
|
383
|
+
throw new Error("" + hookName + ' only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component');
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
388
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
389
|
+
Object.assign(exports2.default, exports2);
|
|
390
|
+
module2.exports = exports2.default;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
// ../../node_modules/next/dist/client/components/router-reducer/reducers/get-segment-value.js
|
|
396
|
+
var require_get_segment_value = __commonJS({
|
|
397
|
+
"../../node_modules/next/dist/client/components/router-reducer/reducers/get-segment-value.js"(exports2, module2) {
|
|
398
|
+
"use strict";
|
|
399
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
400
|
+
value: true
|
|
401
|
+
});
|
|
402
|
+
Object.defineProperty(exports2, "getSegmentValue", {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
get: function() {
|
|
405
|
+
return getSegmentValue;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
function getSegmentValue(segment) {
|
|
409
|
+
return Array.isArray(segment) ? segment[1] : segment;
|
|
410
|
+
}
|
|
411
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
412
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
413
|
+
Object.assign(exports2.default, exports2);
|
|
414
|
+
module2.exports = exports2.default;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// ../../node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs
|
|
420
|
+
var require_interop_require_wildcard = __commonJS({
|
|
421
|
+
"../../node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs"(exports2) {
|
|
422
|
+
"use strict";
|
|
423
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
424
|
+
if (typeof WeakMap !== "function") return null;
|
|
425
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
426
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
427
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
428
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
429
|
+
})(nodeInterop);
|
|
430
|
+
}
|
|
431
|
+
exports2._ = exports2._interop_require_wildcard = _interop_require_wildcard;
|
|
432
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
433
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
434
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
|
|
435
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
436
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
437
|
+
var newObj = {};
|
|
438
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
439
|
+
for (var key in obj) {
|
|
440
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
441
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
442
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
443
|
+
else newObj[key] = obj[key];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
newObj.default = obj;
|
|
447
|
+
if (cache) cache.set(obj, newObj);
|
|
448
|
+
return newObj;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// ../../node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js
|
|
454
|
+
var require_server_inserted_html_shared_runtime = __commonJS({
|
|
455
|
+
"../../node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js"(exports2) {
|
|
456
|
+
"use strict";
|
|
457
|
+
"use client";
|
|
458
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
459
|
+
value: true
|
|
460
|
+
});
|
|
461
|
+
function _export(target, all) {
|
|
462
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
463
|
+
enumerable: true,
|
|
464
|
+
get: all[name]
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
_export(exports2, {
|
|
468
|
+
ServerInsertedHTMLContext: function() {
|
|
469
|
+
return ServerInsertedHTMLContext;
|
|
470
|
+
},
|
|
471
|
+
useServerInsertedHTML: function() {
|
|
472
|
+
return useServerInsertedHTML;
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
var _interop_require_wildcard = require_interop_require_wildcard();
|
|
476
|
+
var _react = /* @__PURE__ */ _interop_require_wildcard._(require("react"));
|
|
477
|
+
var ServerInsertedHTMLContext = /* @__PURE__ */ _react.default.createContext(null);
|
|
478
|
+
function useServerInsertedHTML(callback) {
|
|
479
|
+
const addInsertedServerHTMLCallback = (0, _react.useContext)(ServerInsertedHTMLContext);
|
|
480
|
+
if (addInsertedServerHTMLCallback) {
|
|
481
|
+
addInsertedServerHTMLCallback(callback);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
// ../../node_modules/next/dist/client/components/async-local-storage.js
|
|
488
|
+
var require_async_local_storage = __commonJS({
|
|
489
|
+
"../../node_modules/next/dist/client/components/async-local-storage.js"(exports2, module2) {
|
|
490
|
+
"use strict";
|
|
491
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
492
|
+
value: true
|
|
493
|
+
});
|
|
494
|
+
Object.defineProperty(exports2, "createAsyncLocalStorage", {
|
|
495
|
+
enumerable: true,
|
|
496
|
+
get: function() {
|
|
497
|
+
return createAsyncLocalStorage;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
var sharedAsyncLocalStorageNotAvailableError = new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");
|
|
501
|
+
var FakeAsyncLocalStorage = class {
|
|
502
|
+
disable() {
|
|
503
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
504
|
+
}
|
|
505
|
+
getStore() {
|
|
506
|
+
return void 0;
|
|
507
|
+
}
|
|
508
|
+
run() {
|
|
509
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
510
|
+
}
|
|
511
|
+
exit() {
|
|
512
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
513
|
+
}
|
|
514
|
+
enterWith() {
|
|
515
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
var maybeGlobalAsyncLocalStorage = globalThis.AsyncLocalStorage;
|
|
519
|
+
function createAsyncLocalStorage() {
|
|
520
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
521
|
+
return new maybeGlobalAsyncLocalStorage();
|
|
522
|
+
}
|
|
523
|
+
return new FakeAsyncLocalStorage();
|
|
524
|
+
}
|
|
525
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
526
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
527
|
+
Object.assign(exports2.default, exports2);
|
|
528
|
+
module2.exports = exports2.default;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
// ../../node_modules/next/dist/client/components/request-async-storage.external.js
|
|
534
|
+
var require_request_async_storage_external = __commonJS({
|
|
535
|
+
"../../node_modules/next/dist/client/components/request-async-storage.external.js"(exports2, module2) {
|
|
536
|
+
"use strict";
|
|
537
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
538
|
+
value: true
|
|
539
|
+
});
|
|
540
|
+
Object.defineProperty(exports2, "requestAsyncStorage", {
|
|
541
|
+
enumerable: true,
|
|
542
|
+
get: function() {
|
|
543
|
+
return requestAsyncStorage;
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
547
|
+
var requestAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
548
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
549
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
550
|
+
Object.assign(exports2.default, exports2);
|
|
551
|
+
module2.exports = exports2.default;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
// ../../node_modules/next/dist/client/components/redirect.js
|
|
557
|
+
var require_redirect = __commonJS({
|
|
558
|
+
"../../node_modules/next/dist/client/components/redirect.js"(exports2, module2) {
|
|
559
|
+
"use strict";
|
|
560
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
561
|
+
value: true
|
|
562
|
+
});
|
|
563
|
+
function _export(target, all) {
|
|
564
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
565
|
+
enumerable: true,
|
|
566
|
+
get: all[name]
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
_export(exports2, {
|
|
570
|
+
RedirectType: function() {
|
|
571
|
+
return RedirectType;
|
|
572
|
+
},
|
|
573
|
+
getRedirectError: function() {
|
|
574
|
+
return getRedirectError;
|
|
575
|
+
},
|
|
576
|
+
redirect: function() {
|
|
577
|
+
return redirect;
|
|
578
|
+
},
|
|
579
|
+
permanentRedirect: function() {
|
|
580
|
+
return permanentRedirect;
|
|
581
|
+
},
|
|
582
|
+
isRedirectError: function() {
|
|
583
|
+
return isRedirectError;
|
|
584
|
+
},
|
|
585
|
+
getURLFromRedirectError: function() {
|
|
586
|
+
return getURLFromRedirectError;
|
|
587
|
+
},
|
|
588
|
+
getRedirectTypeFromError: function() {
|
|
589
|
+
return getRedirectTypeFromError;
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
var _requestasyncstorageexternal = require_request_async_storage_external();
|
|
593
|
+
var REDIRECT_ERROR_CODE = "NEXT_REDIRECT";
|
|
594
|
+
var RedirectType;
|
|
595
|
+
(function(RedirectType2) {
|
|
596
|
+
RedirectType2["push"] = "push";
|
|
597
|
+
RedirectType2["replace"] = "replace";
|
|
598
|
+
})(RedirectType || (RedirectType = {}));
|
|
599
|
+
function getRedirectError(url, type, permanent) {
|
|
600
|
+
if (permanent === void 0) permanent = false;
|
|
601
|
+
const error = new Error(REDIRECT_ERROR_CODE);
|
|
602
|
+
error.digest = REDIRECT_ERROR_CODE + ";" + type + ";" + url + ";" + permanent;
|
|
603
|
+
const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore();
|
|
604
|
+
if (requestStore) {
|
|
605
|
+
error.mutableCookies = requestStore.mutableCookies;
|
|
606
|
+
}
|
|
607
|
+
return error;
|
|
608
|
+
}
|
|
609
|
+
function redirect(url, type) {
|
|
610
|
+
if (type === void 0) type = "replace";
|
|
611
|
+
throw getRedirectError(url, type, false);
|
|
612
|
+
}
|
|
613
|
+
function permanentRedirect(url, type) {
|
|
614
|
+
if (type === void 0) type = "replace";
|
|
615
|
+
throw getRedirectError(url, type, true);
|
|
616
|
+
}
|
|
617
|
+
function isRedirectError(error) {
|
|
618
|
+
if (typeof (error == null ? void 0 : error.digest) !== "string") return false;
|
|
619
|
+
const [errorCode, type, destination, permanent] = error.digest.split(";", 4);
|
|
620
|
+
return errorCode === REDIRECT_ERROR_CODE && (type === "replace" || type === "push") && typeof destination === "string" && (permanent === "true" || permanent === "false");
|
|
621
|
+
}
|
|
622
|
+
function getURLFromRedirectError(error) {
|
|
623
|
+
if (!isRedirectError(error)) return null;
|
|
624
|
+
return error.digest.split(";", 3)[2];
|
|
625
|
+
}
|
|
626
|
+
function getRedirectTypeFromError(error) {
|
|
627
|
+
if (!isRedirectError(error)) {
|
|
628
|
+
throw new Error("Not a redirect error");
|
|
629
|
+
}
|
|
630
|
+
return error.digest.split(";", 2)[1];
|
|
631
|
+
}
|
|
632
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
633
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
634
|
+
Object.assign(exports2.default, exports2);
|
|
635
|
+
module2.exports = exports2.default;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
// ../../node_modules/next/dist/client/components/not-found.js
|
|
641
|
+
var require_not_found = __commonJS({
|
|
642
|
+
"../../node_modules/next/dist/client/components/not-found.js"(exports2, module2) {
|
|
643
|
+
"use strict";
|
|
644
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
645
|
+
value: true
|
|
646
|
+
});
|
|
647
|
+
function _export(target, all) {
|
|
648
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
649
|
+
enumerable: true,
|
|
650
|
+
get: all[name]
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
_export(exports2, {
|
|
654
|
+
notFound: function() {
|
|
655
|
+
return notFound;
|
|
656
|
+
},
|
|
657
|
+
isNotFoundError: function() {
|
|
658
|
+
return isNotFoundError;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
var NOT_FOUND_ERROR_CODE = "NEXT_NOT_FOUND";
|
|
662
|
+
function notFound() {
|
|
663
|
+
const error = new Error(NOT_FOUND_ERROR_CODE);
|
|
664
|
+
error.digest = NOT_FOUND_ERROR_CODE;
|
|
665
|
+
throw error;
|
|
666
|
+
}
|
|
667
|
+
function isNotFoundError(error) {
|
|
668
|
+
return (error == null ? void 0 : error.digest) === NOT_FOUND_ERROR_CODE;
|
|
669
|
+
}
|
|
670
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
671
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
672
|
+
Object.assign(exports2.default, exports2);
|
|
673
|
+
module2.exports = exports2.default;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// ../../node_modules/next/dist/shared/lib/lazy-dynamic/no-ssr-error.js
|
|
679
|
+
var require_no_ssr_error = __commonJS({
|
|
680
|
+
"../../node_modules/next/dist/shared/lib/lazy-dynamic/no-ssr-error.js"(exports2) {
|
|
681
|
+
"use strict";
|
|
682
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
683
|
+
value: true
|
|
684
|
+
});
|
|
685
|
+
function _export(target, all) {
|
|
686
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
687
|
+
enumerable: true,
|
|
688
|
+
get: all[name]
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
_export(exports2, {
|
|
692
|
+
NEXT_DYNAMIC_NO_SSR_CODE: function() {
|
|
693
|
+
return NEXT_DYNAMIC_NO_SSR_CODE;
|
|
694
|
+
},
|
|
695
|
+
throwWithNoSSR: function() {
|
|
696
|
+
return throwWithNoSSR;
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
var NEXT_DYNAMIC_NO_SSR_CODE = "NEXT_DYNAMIC_NO_SSR_CODE";
|
|
700
|
+
function throwWithNoSSR() {
|
|
701
|
+
const error = new Error(NEXT_DYNAMIC_NO_SSR_CODE);
|
|
702
|
+
error.digest = NEXT_DYNAMIC_NO_SSR_CODE;
|
|
703
|
+
throw error;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
// ../../node_modules/next/dist/client/components/static-generation-async-storage.external.js
|
|
709
|
+
var require_static_generation_async_storage_external = __commonJS({
|
|
710
|
+
"../../node_modules/next/dist/client/components/static-generation-async-storage.external.js"(exports2, module2) {
|
|
711
|
+
"use strict";
|
|
712
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
713
|
+
value: true
|
|
714
|
+
});
|
|
715
|
+
Object.defineProperty(exports2, "staticGenerationAsyncStorage", {
|
|
716
|
+
enumerable: true,
|
|
717
|
+
get: function() {
|
|
718
|
+
return staticGenerationAsyncStorage;
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
722
|
+
var staticGenerationAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
723
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
724
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
725
|
+
Object.assign(exports2.default, exports2);
|
|
726
|
+
module2.exports = exports2.default;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
// ../../node_modules/next/dist/client/components/bailout-to-client-rendering.js
|
|
732
|
+
var require_bailout_to_client_rendering = __commonJS({
|
|
733
|
+
"../../node_modules/next/dist/client/components/bailout-to-client-rendering.js"(exports2, module2) {
|
|
734
|
+
"use strict";
|
|
735
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
736
|
+
value: true
|
|
737
|
+
});
|
|
738
|
+
Object.defineProperty(exports2, "bailoutToClientRendering", {
|
|
739
|
+
enumerable: true,
|
|
740
|
+
get: function() {
|
|
741
|
+
return bailoutToClientRendering;
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
var _nossrerror = require_no_ssr_error();
|
|
745
|
+
var _staticgenerationasyncstorageexternal = require_static_generation_async_storage_external();
|
|
746
|
+
function bailoutToClientRendering() {
|
|
747
|
+
const staticGenerationStore = _staticgenerationasyncstorageexternal.staticGenerationAsyncStorage.getStore();
|
|
748
|
+
if (staticGenerationStore == null ? void 0 : staticGenerationStore.forceStatic) {
|
|
749
|
+
return true;
|
|
750
|
+
}
|
|
751
|
+
if (staticGenerationStore == null ? void 0 : staticGenerationStore.isStaticGeneration) {
|
|
752
|
+
(0, _nossrerror.throwWithNoSSR)();
|
|
753
|
+
}
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
757
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
758
|
+
Object.assign(exports2.default, exports2);
|
|
759
|
+
module2.exports = exports2.default;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
// ../../node_modules/next/dist/client/components/navigation.js
|
|
765
|
+
var require_navigation = __commonJS({
|
|
766
|
+
"../../node_modules/next/dist/client/components/navigation.js"(exports2, module2) {
|
|
767
|
+
"use strict";
|
|
768
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
769
|
+
value: true
|
|
770
|
+
});
|
|
771
|
+
function _export(target, all) {
|
|
772
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
773
|
+
enumerable: true,
|
|
774
|
+
get: all[name]
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
_export(exports2, {
|
|
778
|
+
ReadonlyURLSearchParams: function() {
|
|
779
|
+
return ReadonlyURLSearchParams;
|
|
780
|
+
},
|
|
781
|
+
useSearchParams: function() {
|
|
782
|
+
return useSearchParams;
|
|
783
|
+
},
|
|
784
|
+
usePathname: function() {
|
|
785
|
+
return usePathname2;
|
|
786
|
+
},
|
|
787
|
+
ServerInsertedHTMLContext: function() {
|
|
788
|
+
return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext;
|
|
789
|
+
},
|
|
790
|
+
useServerInsertedHTML: function() {
|
|
791
|
+
return _serverinsertedhtmlsharedruntime.useServerInsertedHTML;
|
|
792
|
+
},
|
|
793
|
+
useRouter: function() {
|
|
794
|
+
return useRouter;
|
|
795
|
+
},
|
|
796
|
+
useParams: function() {
|
|
797
|
+
return useParams;
|
|
798
|
+
},
|
|
799
|
+
useSelectedLayoutSegments: function() {
|
|
800
|
+
return useSelectedLayoutSegments;
|
|
801
|
+
},
|
|
802
|
+
useSelectedLayoutSegment: function() {
|
|
803
|
+
return useSelectedLayoutSegment;
|
|
804
|
+
},
|
|
805
|
+
redirect: function() {
|
|
806
|
+
return _redirect.redirect;
|
|
807
|
+
},
|
|
808
|
+
permanentRedirect: function() {
|
|
809
|
+
return _redirect.permanentRedirect;
|
|
810
|
+
},
|
|
811
|
+
RedirectType: function() {
|
|
812
|
+
return _redirect.RedirectType;
|
|
813
|
+
},
|
|
814
|
+
notFound: function() {
|
|
815
|
+
return _notfound.notFound;
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
var _react = require("react");
|
|
819
|
+
var _approutercontextsharedruntime = require_app_router_context_shared_runtime();
|
|
820
|
+
var _hooksclientcontextsharedruntime = require_hooks_client_context_shared_runtime();
|
|
821
|
+
var _clienthookinservercomponenterror = require_client_hook_in_server_component_error();
|
|
822
|
+
var _getsegmentvalue = require_get_segment_value();
|
|
823
|
+
var _serverinsertedhtmlsharedruntime = require_server_inserted_html_shared_runtime();
|
|
824
|
+
var _redirect = require_redirect();
|
|
825
|
+
var _notfound = require_not_found();
|
|
826
|
+
var INTERNAL_URLSEARCHPARAMS_INSTANCE = Symbol("internal for urlsearchparams readonly");
|
|
827
|
+
function readonlyURLSearchParamsError() {
|
|
828
|
+
return new Error("ReadonlyURLSearchParams cannot be modified");
|
|
829
|
+
}
|
|
830
|
+
var ReadonlyURLSearchParams = class {
|
|
831
|
+
[Symbol.iterator]() {
|
|
832
|
+
return this[INTERNAL_URLSEARCHPARAMS_INSTANCE][Symbol.iterator]();
|
|
833
|
+
}
|
|
834
|
+
append() {
|
|
835
|
+
throw readonlyURLSearchParamsError();
|
|
836
|
+
}
|
|
837
|
+
delete() {
|
|
838
|
+
throw readonlyURLSearchParamsError();
|
|
839
|
+
}
|
|
840
|
+
set() {
|
|
841
|
+
throw readonlyURLSearchParamsError();
|
|
842
|
+
}
|
|
843
|
+
sort() {
|
|
844
|
+
throw readonlyURLSearchParamsError();
|
|
845
|
+
}
|
|
846
|
+
constructor(urlSearchParams) {
|
|
847
|
+
this[INTERNAL_URLSEARCHPARAMS_INSTANCE] = urlSearchParams;
|
|
848
|
+
this.entries = urlSearchParams.entries.bind(urlSearchParams);
|
|
849
|
+
this.forEach = urlSearchParams.forEach.bind(urlSearchParams);
|
|
850
|
+
this.get = urlSearchParams.get.bind(urlSearchParams);
|
|
851
|
+
this.getAll = urlSearchParams.getAll.bind(urlSearchParams);
|
|
852
|
+
this.has = urlSearchParams.has.bind(urlSearchParams);
|
|
853
|
+
this.keys = urlSearchParams.keys.bind(urlSearchParams);
|
|
854
|
+
this.values = urlSearchParams.values.bind(urlSearchParams);
|
|
855
|
+
this.toString = urlSearchParams.toString.bind(urlSearchParams);
|
|
856
|
+
this.size = urlSearchParams.size;
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
function useSearchParams() {
|
|
860
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSearchParams");
|
|
861
|
+
const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext);
|
|
862
|
+
const readonlySearchParams = (0, _react.useMemo)(() => {
|
|
863
|
+
if (!searchParams) {
|
|
864
|
+
return null;
|
|
865
|
+
}
|
|
866
|
+
return new ReadonlyURLSearchParams(searchParams);
|
|
867
|
+
}, [
|
|
868
|
+
searchParams
|
|
869
|
+
]);
|
|
870
|
+
if (typeof window === "undefined") {
|
|
871
|
+
const { bailoutToClientRendering } = require_bailout_to_client_rendering();
|
|
872
|
+
if (bailoutToClientRendering()) {
|
|
873
|
+
return readonlySearchParams;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
return readonlySearchParams;
|
|
877
|
+
}
|
|
878
|
+
function usePathname2() {
|
|
879
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("usePathname");
|
|
880
|
+
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext);
|
|
881
|
+
}
|
|
882
|
+
function useRouter() {
|
|
883
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useRouter");
|
|
884
|
+
const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext);
|
|
885
|
+
if (router === null) {
|
|
886
|
+
throw new Error("invariant expected app router to be mounted");
|
|
887
|
+
}
|
|
888
|
+
return router;
|
|
889
|
+
}
|
|
890
|
+
function getSelectedParams(tree, params) {
|
|
891
|
+
if (params === void 0) params = {};
|
|
892
|
+
const parallelRoutes = tree[1];
|
|
893
|
+
for (const parallelRoute of Object.values(parallelRoutes)) {
|
|
894
|
+
const segment = parallelRoute[0];
|
|
895
|
+
const isDynamicParameter = Array.isArray(segment);
|
|
896
|
+
const segmentValue = isDynamicParameter ? segment[1] : segment;
|
|
897
|
+
if (!segmentValue || segmentValue.startsWith("__PAGE__")) continue;
|
|
898
|
+
const isCatchAll = isDynamicParameter && (segment[2] === "c" || segment[2] === "oc");
|
|
899
|
+
if (isCatchAll) {
|
|
900
|
+
params[segment[0]] = segment[1].split("/");
|
|
901
|
+
} else if (isDynamicParameter) {
|
|
902
|
+
params[segment[0]] = segment[1];
|
|
903
|
+
}
|
|
904
|
+
params = getSelectedParams(parallelRoute, params);
|
|
905
|
+
}
|
|
906
|
+
return params;
|
|
907
|
+
}
|
|
908
|
+
function useParams() {
|
|
909
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useParams");
|
|
910
|
+
const globalLayoutRouter = (0, _react.useContext)(_approutercontextsharedruntime.GlobalLayoutRouterContext);
|
|
911
|
+
const pathParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext);
|
|
912
|
+
return (0, _react.useMemo)(() => {
|
|
913
|
+
if (globalLayoutRouter == null ? void 0 : globalLayoutRouter.tree) {
|
|
914
|
+
return getSelectedParams(globalLayoutRouter.tree);
|
|
915
|
+
}
|
|
916
|
+
return pathParams;
|
|
917
|
+
}, [
|
|
918
|
+
globalLayoutRouter == null ? void 0 : globalLayoutRouter.tree,
|
|
919
|
+
pathParams
|
|
920
|
+
]);
|
|
921
|
+
}
|
|
922
|
+
function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) {
|
|
923
|
+
if (first === void 0) first = true;
|
|
924
|
+
if (segmentPath === void 0) segmentPath = [];
|
|
925
|
+
let node;
|
|
926
|
+
if (first) {
|
|
927
|
+
node = tree[1][parallelRouteKey];
|
|
928
|
+
} else {
|
|
929
|
+
const parallelRoutes = tree[1];
|
|
930
|
+
var _parallelRoutes_children;
|
|
931
|
+
node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0];
|
|
932
|
+
}
|
|
933
|
+
if (!node) return segmentPath;
|
|
934
|
+
const segment = node[0];
|
|
935
|
+
const segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment);
|
|
936
|
+
if (!segmentValue || segmentValue.startsWith("__PAGE__")) return segmentPath;
|
|
937
|
+
segmentPath.push(segmentValue);
|
|
938
|
+
return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
|
|
939
|
+
}
|
|
940
|
+
function useSelectedLayoutSegments(parallelRouteKey) {
|
|
941
|
+
if (parallelRouteKey === void 0) parallelRouteKey = "children";
|
|
942
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSelectedLayoutSegments");
|
|
943
|
+
const { tree } = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
|
|
944
|
+
return getSelectedLayoutSegmentPath(tree, parallelRouteKey);
|
|
945
|
+
}
|
|
946
|
+
function useSelectedLayoutSegment(parallelRouteKey) {
|
|
947
|
+
if (parallelRouteKey === void 0) parallelRouteKey = "children";
|
|
948
|
+
(0, _clienthookinservercomponenterror.clientHookInServerComponentError)("useSelectedLayoutSegment");
|
|
949
|
+
const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);
|
|
950
|
+
if (selectedLayoutSegments.length === 0) {
|
|
951
|
+
return null;
|
|
952
|
+
}
|
|
953
|
+
return selectedLayoutSegments[0];
|
|
954
|
+
}
|
|
955
|
+
if ((typeof exports2.default === "function" || typeof exports2.default === "object" && exports2.default !== null) && typeof exports2.default.__esModule === "undefined") {
|
|
956
|
+
Object.defineProperty(exports2.default, "__esModule", { value: true });
|
|
957
|
+
Object.assign(exports2.default, exports2);
|
|
958
|
+
module2.exports = exports2.default;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// ../../node_modules/next/navigation.js
|
|
964
|
+
var require_navigation2 = __commonJS({
|
|
965
|
+
"../../node_modules/next/navigation.js"(exports2, module2) {
|
|
966
|
+
"use strict";
|
|
967
|
+
module2.exports = require_navigation();
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
|
|
262
971
|
// src/index.ts
|
|
263
972
|
var src_exports = {};
|
|
264
973
|
__export(src_exports, {
|
|
@@ -304,8 +1013,7 @@ __export(src_exports, {
|
|
|
304
1013
|
module.exports = __toCommonJS(src_exports);
|
|
305
1014
|
|
|
306
1015
|
// src/ShopkitAnalytics.tsx
|
|
307
|
-
var
|
|
308
|
-
var import_hydrogen_react2 = require("@shopify/hydrogen-react");
|
|
1016
|
+
var import_react4 = require("react");
|
|
309
1017
|
|
|
310
1018
|
// src/logger/index.ts
|
|
311
1019
|
var LOG_LEVELS = {
|
|
@@ -654,6 +1362,7 @@ var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
|
654
1362
|
EventType2["PIN_CODE_ADDED_GK"] = "pin_code_added_gk";
|
|
655
1363
|
EventType2["ADDRESS_ADDED_GK"] = "address_added_gk";
|
|
656
1364
|
EventType2["SPECIFIC"] = "specific";
|
|
1365
|
+
EventType2["SHOPIFY_PAGE_VIEW"] = "shopify_page_view";
|
|
657
1366
|
return EventType2;
|
|
658
1367
|
})(EventType || {});
|
|
659
1368
|
|
|
@@ -737,8 +1446,15 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
737
1446
|
if (!pixelId) {
|
|
738
1447
|
this.logger.warn("Pixel ID not provided. Skipping fbq init.");
|
|
739
1448
|
} else {
|
|
740
|
-
window.fbq("
|
|
741
|
-
|
|
1449
|
+
const isAlreadyInitialized = window._fbq?.loaded || window.fbq?.loaded || document.querySelector(`script[src*="fbevents.js"]`)?.getAttribute("data-pixel-id") === pixelId;
|
|
1450
|
+
if (!isAlreadyInitialized) {
|
|
1451
|
+
window.fbq("init", pixelId);
|
|
1452
|
+
this.logger.info("Successfully initialized", { pixelId: "***" });
|
|
1453
|
+
} else {
|
|
1454
|
+
this.logger.info("Pixel already initialized, skipping init", {
|
|
1455
|
+
pixelId: "***"
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
742
1458
|
}
|
|
743
1459
|
}
|
|
744
1460
|
this.initialized = true;
|
|
@@ -2571,7 +3287,7 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2571
3287
|
return {
|
|
2572
3288
|
...(0, import_hydrogen_react.getClientBrowserParameters)(),
|
|
2573
3289
|
...consent,
|
|
2574
|
-
storefrontId: this.
|
|
3290
|
+
storefrontId: this.shopId,
|
|
2575
3291
|
shopifySalesChannel: import_hydrogen_react.ShopifySalesChannel.headless,
|
|
2576
3292
|
shopId: `gid://shopify/Shop/${this.shopId}`,
|
|
2577
3293
|
currency: this.currency,
|
|
@@ -2601,6 +3317,7 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2601
3317
|
const enhancedEvent = this.enhanceWithExperimentParams(affiliateParams);
|
|
2602
3318
|
try {
|
|
2603
3319
|
switch (event.type) {
|
|
3320
|
+
case "shopify_page_view" /* SHOPIFY_PAGE_VIEW */:
|
|
2604
3321
|
case "page_view" /* PAGE_VIEW */:
|
|
2605
3322
|
const pageViewPayload = this.mergeEventData(enhancedEvent, params);
|
|
2606
3323
|
this.sendPageView(import_hydrogen_react.AnalyticsEventName.PAGE_VIEW, pageViewPayload);
|
|
@@ -3596,6 +4313,56 @@ function useAffiliateSource() {
|
|
|
3596
4313
|
return source;
|
|
3597
4314
|
}
|
|
3598
4315
|
|
|
4316
|
+
// src/shopify/ShopifyAnalyticsScript.tsx
|
|
4317
|
+
var import_hydrogen_react2 = require("@shopify/hydrogen-react");
|
|
4318
|
+
var import_navigation = __toESM(require_navigation2());
|
|
4319
|
+
var import_react3 = require("react");
|
|
4320
|
+
|
|
4321
|
+
// src/events/index.ts
|
|
4322
|
+
init_publisher();
|
|
4323
|
+
init_subscriber();
|
|
4324
|
+
|
|
4325
|
+
// src/shopify/ShopifyAnalyticsScript.tsx
|
|
4326
|
+
function ShopifyAnalyticsScript({
|
|
4327
|
+
domain
|
|
4328
|
+
}) {
|
|
4329
|
+
const pathname = (0, import_navigation.usePathname)();
|
|
4330
|
+
const [sessionValid, setSessionValid] = (0, import_react3.useState)(false);
|
|
4331
|
+
(0, import_hydrogen_react2.useShopifyCookies)({
|
|
4332
|
+
hasUserConsent: true,
|
|
4333
|
+
domain
|
|
4334
|
+
});
|
|
4335
|
+
(0, import_react3.useEffect)(() => {
|
|
4336
|
+
const validateSession = () => {
|
|
4337
|
+
const shopifyY = document.cookie.includes("_shopify_y=");
|
|
4338
|
+
const shopifyS = document.cookie.includes("_shopify_s=");
|
|
4339
|
+
if (shopifyY && shopifyS) {
|
|
4340
|
+
setSessionValid(true);
|
|
4341
|
+
console.log("\u2705 Shopify Analytics session validated");
|
|
4342
|
+
} else {
|
|
4343
|
+
console.warn("\u26A0\uFE0F Shopify session cookies missing");
|
|
4344
|
+
}
|
|
4345
|
+
};
|
|
4346
|
+
const timer = setTimeout(validateSession, 1e3);
|
|
4347
|
+
return () => clearTimeout(timer);
|
|
4348
|
+
}, []);
|
|
4349
|
+
(0, import_react3.useEffect)(() => {
|
|
4350
|
+
if (typeof window !== "undefined") {
|
|
4351
|
+
window.__shopifySessionValid = sessionValid;
|
|
4352
|
+
}
|
|
4353
|
+
}, [sessionValid]);
|
|
4354
|
+
(0, import_react3.useEffect)(() => {
|
|
4355
|
+
const trackPageView = () => {
|
|
4356
|
+
publishEvent({
|
|
4357
|
+
type: "shopify_page_view" /* SHOPIFY_PAGE_VIEW */
|
|
4358
|
+
});
|
|
4359
|
+
};
|
|
4360
|
+
const timer = setTimeout(trackPageView, 1500);
|
|
4361
|
+
return () => clearTimeout(timer);
|
|
4362
|
+
}, [pathname]);
|
|
4363
|
+
return null;
|
|
4364
|
+
}
|
|
4365
|
+
|
|
3599
4366
|
// src/ShopkitAnalytics.tsx
|
|
3600
4367
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3601
4368
|
var ShopkitAnalytics = ({
|
|
@@ -3604,11 +4371,7 @@ var ShopkitAnalytics = ({
|
|
|
3604
4371
|
onInitialized,
|
|
3605
4372
|
onError
|
|
3606
4373
|
}) => {
|
|
3607
|
-
(0,
|
|
3608
|
-
hasUserConsent: true,
|
|
3609
|
-
domain: config.shopify?.domain || ""
|
|
3610
|
-
});
|
|
3611
|
-
(0, import_react3.useEffect)(() => {
|
|
4374
|
+
(0, import_react4.useEffect)(() => {
|
|
3612
4375
|
const initializeAnalytics = async () => {
|
|
3613
4376
|
if (config.autoInitialize === false) return;
|
|
3614
4377
|
const loggerConfig = {
|
|
@@ -3705,15 +4468,12 @@ var ShopkitAnalytics = ({
|
|
|
3705
4468
|
autoCapture: config.affiliate?.autoCapture
|
|
3706
4469
|
}
|
|
3707
4470
|
),
|
|
4471
|
+
config.shopify?.domain && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ShopifyAnalyticsScript, { domain: config.shopify?.domain }),
|
|
3708
4472
|
children ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children }) : null
|
|
3709
4473
|
] });
|
|
3710
4474
|
};
|
|
3711
4475
|
var ShopkitAnalytics_default = ShopkitAnalytics;
|
|
3712
4476
|
|
|
3713
|
-
// src/events/index.ts
|
|
3714
|
-
init_publisher();
|
|
3715
|
-
init_subscriber();
|
|
3716
|
-
|
|
3717
4477
|
// src/services/facebook-capi.ts
|
|
3718
4478
|
var FacebookCAPIService = class {
|
|
3719
4479
|
constructor(config) {
|