@payment-kit-js/vanilla 0.4.1 → 0.5.2
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/airwallex-apple-pay-adapter-BE15xREr.mjs +237 -0
- package/dist/airwallex-apple-pay-adapter-BE15xREr.mjs.map +1 -0
- package/dist/airwallex-apple-pay-adapter-I_pnNYdy.d.mts +98 -0
- package/dist/airwallex-apple-pay-adapter-I_pnNYdy.d.mts.map +1 -0
- package/dist/{airwallex-google-pay-adapter-BCmTZip5.mjs → airwallex-google-pay-adapter-CHol_8f2.mjs} +1 -1
- package/dist/{airwallex-google-pay-adapter-BCmTZip5.mjs.map → airwallex-google-pay-adapter-CHol_8f2.mjs.map} +1 -1
- package/dist/{airwallex-google-pay-adapter-Be2Af4N9.d.mts → airwallex-google-pay-adapter-CY379Rre.d.mts} +1 -1
- package/dist/{airwallex-google-pay-adapter-Be2Af4N9.d.mts.map → airwallex-google-pay-adapter-CY379Rre.d.mts.map} +1 -1
- package/dist/cdn/paymentkit.js +789 -420
- package/dist/cdn/paymentkit.js.map +4 -4
- package/dist/cdn/paymentkit.min.js +6 -6
- package/dist/cdn/paymentkit.min.js.map +4 -4
- package/dist/{connect-card-BrtCmsjz.mjs → connect-card-CMZkeppE.mjs} +1 -1
- package/dist/{connect-card-BrtCmsjz.mjs.map → connect-card-CMZkeppE.mjs.map} +1 -1
- package/dist/{connect-card-DTfXuTsW.d.mts → connect-card-Cxy51W6t.d.mts} +1 -1
- package/dist/{connect-card-DTfXuTsW.d.mts.map → connect-card-Cxy51W6t.d.mts.map} +1 -1
- package/dist/connect-tunnel-x-BhVAej5Q.mjs.map +1 -1
- package/dist/{connect-tunnel-x-Dxcg5Y7Y.d.mts → connect-tunnel-x-lv6Wtdme.d.mts} +6 -1
- package/dist/connect-tunnel-x-lv6Wtdme.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +76 -14
- package/dist/index.mjs.map +1 -1
- package/dist/{next-action-handlers-BZs04hYb.mjs → next-action-handlers-CTx8tRt0.mjs} +1 -1
- package/dist/{next-action-handlers-BZs04hYb.mjs.map → next-action-handlers-CTx8tRt0.mjs.map} +1 -1
- package/dist/payment-methods/airwallex-apple-pay-adapter.d.mts +2 -0
- package/dist/payment-methods/airwallex-apple-pay-adapter.mjs +3 -0
- package/dist/payment-methods/airwallex-google-pay-adapter.d.mts +1 -1
- package/dist/payment-methods/airwallex-google-pay-adapter.mjs +1 -1
- package/dist/payment-methods/apple-pay.d.mts +37 -17
- package/dist/payment-methods/apple-pay.d.mts.map +1 -1
- package/dist/payment-methods/apple-pay.mjs +203 -37
- package/dist/payment-methods/apple-pay.mjs.map +1 -1
- package/dist/payment-methods/card.d.mts +3 -3
- package/dist/payment-methods/card.d.mts.map +1 -1
- package/dist/payment-methods/card.mjs +208 -41
- package/dist/payment-methods/card.mjs.map +1 -1
- package/dist/payment-methods/google-pay.d.mts +5 -5
- package/dist/payment-methods/google-pay.d.mts.map +1 -1
- package/dist/payment-methods/google-pay.mjs +6 -7
- package/dist/payment-methods/google-pay.mjs.map +1 -1
- package/dist/payment-methods/next-action-handlers.mjs +1 -1
- package/dist/payment-methods/paypal.d.mts +3 -3
- package/dist/payment-methods/paypal.mjs +3 -3
- package/dist/payment-methods/paypal.mjs.map +1 -1
- package/dist/payment-methods/stripe-apple-pay-adapter.d.mts +1 -1
- package/dist/payment-methods/stripe-apple-pay-adapter.mjs +1 -1
- package/dist/payment-methods/stripe-google-pay-adapter.d.mts +1 -1
- package/dist/payment-methods/stripe-google-pay-adapter.mjs +1 -1
- package/dist/payment-methods/vgs-collect-loader.d.mts +28 -0
- package/dist/payment-methods/vgs-collect-loader.d.mts.map +1 -0
- package/dist/payment-methods/vgs-collect-loader.mjs +3 -0
- package/dist/penpal/connect-card.d.mts +1 -1
- package/dist/penpal/connect-card.mjs +1 -1
- package/dist/penpal/connect-tunnel-x.d.mts +1 -1
- package/dist/{stripe-apple-pay-adapter-Bg7nCy3P.mjs → stripe-apple-pay-adapter-Cd9LVNnp.mjs} +1 -1
- package/dist/{stripe-apple-pay-adapter-Bg7nCy3P.mjs.map → stripe-apple-pay-adapter-Cd9LVNnp.mjs.map} +1 -1
- package/dist/{stripe-apple-pay-adapter-Bq3f1mqv.d.mts → stripe-apple-pay-adapter-DhpGclW9.d.mts} +1 -1
- package/dist/{stripe-apple-pay-adapter-Bq3f1mqv.d.mts.map → stripe-apple-pay-adapter-DhpGclW9.d.mts.map} +1 -1
- package/dist/{stripe-google-pay-adapter-xktEycOD.d.mts → stripe-google-pay-adapter-C3NCBSO3.d.mts} +1 -1
- package/dist/{stripe-google-pay-adapter-xktEycOD.d.mts.map → stripe-google-pay-adapter-C3NCBSO3.d.mts.map} +1 -1
- package/dist/{stripe-google-pay-adapter-DjrgDYWe.mjs → stripe-google-pay-adapter-CqcUEoM3.mjs} +1 -1
- package/dist/{stripe-google-pay-adapter-DjrgDYWe.mjs.map → stripe-google-pay-adapter-CqcUEoM3.mjs.map} +1 -1
- package/dist/{types-CPuloCtF.d.mts → types-CZk3V0Qt.d.mts} +24 -6
- package/dist/types-CZk3V0Qt.d.mts.map +1 -0
- package/dist/{utils-Dgyk7RkM.mjs → utils-B70Y8YcZ.mjs} +20 -9
- package/dist/utils-B70Y8YcZ.mjs.map +1 -0
- package/dist/vgs-collect-loader-D3_xOA-G.mjs +93 -0
- package/dist/vgs-collect-loader-D3_xOA-G.mjs.map +1 -0
- package/package.json +4 -2
- package/dist/connect-tunnel-x-Dxcg5Y7Y.d.mts.map +0 -1
- package/dist/types-CPuloCtF.d.mts.map +0 -1
- package/dist/utils-Dgyk7RkM.mjs.map +0 -1
package/dist/cdn/paymentkit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PaymentKit.js v0.
|
|
2
|
+
* PaymentKit.js v0.5.2
|
|
3
3
|
* https://paymentkit.com
|
|
4
4
|
*
|
|
5
5
|
* @license MIT
|
|
@@ -42,7 +42,7 @@ var PaymentKit = (() => {
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
// package.json
|
|
45
|
-
var version = "0.
|
|
45
|
+
var version = "0.5.2";
|
|
46
46
|
|
|
47
47
|
// src/analytics/mock-adapter.ts
|
|
48
48
|
var MockAnalyticsAdapter = class {
|
|
@@ -101,7 +101,7 @@ var PaymentKit = (() => {
|
|
|
101
101
|
var h = null == i ? void 0 : i.AbortController;
|
|
102
102
|
var d = null == n ? void 0 : n.userAgent;
|
|
103
103
|
var v = null != t ? t : {};
|
|
104
|
-
var c = { DEBUG: false, LIB_VERSION: "1.
|
|
104
|
+
var c = { DEBUG: false, LIB_VERSION: "1.341.0" };
|
|
105
105
|
function f(t2, i2, e2, r2, s2, n2, o2) {
|
|
106
106
|
try {
|
|
107
107
|
var a2 = t2[n2](o2), l2 = a2.value;
|
|
@@ -144,7 +144,7 @@ var PaymentKit = (() => {
|
|
|
144
144
|
return e2;
|
|
145
145
|
}
|
|
146
146
|
var m = ["amazonbot", "amazonproductbot", "app.hypefactors.com", "applebot", "archive.org_bot", "awariobot", "backlinksextendedbot", "baiduspider", "bingbot", "bingpreview", "chrome-lighthouse", "dataforseobot", "deepscan", "duckduckbot", "facebookexternal", "facebookcatalog", "http://yandex.com/bots", "hubspot", "ia_archiver", "leikibot", "linkedinbot", "meta-externalagent", "mj12bot", "msnbot", "nessus", "petalbot", "pinterest", "prerender", "rogerbot", "screaming frog", "sebot-wa", "sitebulb", "slackbot", "slurp", "trendictionbot", "turnitin", "twitterbot", "vercel-screenshot", "vercelbot", "yahoo! slurp", "yandexbot", "zoombot", "bot.htm", "bot.php", "(bot;", "bot/", "crawler", "ahrefsbot", "ahrefssiteaudit", "semrushbot", "siteauditbot", "splitsignalbot", "gptbot", "oai-searchbot", "chatgpt-user", "perplexitybot", "better uptime bot", "sentryuptimebot", "uptimerobot", "headlesschrome", "cypress", "google-hoteladsverifier", "adsbot-google", "apis-google", "duplexweb-google", "feedfetcher-google", "google favicon", "google web preview", "google-read-aloud", "googlebot", "googleother", "google-cloudvertexbot", "googleweblight", "mediapartners-google", "storebot-google", "google-inspectiontool", "bytespider"];
|
|
147
|
-
var
|
|
147
|
+
var b = function(t2, i2) {
|
|
148
148
|
if (void 0 === i2 && (i2 = []), !t2) return false;
|
|
149
149
|
var e2 = t2.toLowerCase();
|
|
150
150
|
return m.concat(i2).some((t3) => {
|
|
@@ -152,7 +152,7 @@ var PaymentKit = (() => {
|
|
|
152
152
|
return -1 !== e2.indexOf(i3);
|
|
153
153
|
});
|
|
154
154
|
};
|
|
155
|
-
var
|
|
155
|
+
var y = ["$snapshot", "$pageview", "$pageleave", "$set", "survey dismissed", "survey sent", "survey shown", "$identify", "$groupidentify", "$create_alias", "$$client_ingestion_warning", "$web_experiment_applied", "$feature_enrollment_update", "$feature_flag_called"];
|
|
156
156
|
function w(t2, i2) {
|
|
157
157
|
return -1 !== t2.indexOf(i2);
|
|
158
158
|
}
|
|
@@ -178,16 +178,16 @@ var PaymentKit = (() => {
|
|
|
178
178
|
}
|
|
179
179
|
return false;
|
|
180
180
|
};
|
|
181
|
-
var
|
|
182
|
-
var
|
|
183
|
-
var A = (t2) =>
|
|
184
|
-
var
|
|
185
|
-
var
|
|
181
|
+
var O = (t2) => void 0 === t2;
|
|
182
|
+
var M = (t2) => "[object String]" == T.call(t2);
|
|
183
|
+
var A = (t2) => M(t2) && 0 === t2.trim().length;
|
|
184
|
+
var j = (t2) => null === t2;
|
|
185
|
+
var D = (t2) => O(t2) || j(t2);
|
|
186
186
|
var L = (t2) => "[object Number]" == T.call(t2) && t2 == t2;
|
|
187
187
|
var N = (t2) => L(t2) && t2 > 0;
|
|
188
188
|
var U = (t2) => "[object Boolean]" === T.call(t2);
|
|
189
189
|
var z = (t2) => t2 instanceof FormData;
|
|
190
|
-
var H = (t2) => w(
|
|
190
|
+
var H = (t2) => w(y, t2);
|
|
191
191
|
function B(t2) {
|
|
192
192
|
return null === t2 || "object" != typeof t2;
|
|
193
193
|
}
|
|
@@ -195,7 +195,7 @@ var PaymentKit = (() => {
|
|
|
195
195
|
return Object.prototype.toString.call(t2) === "[object " + i2 + "]";
|
|
196
196
|
}
|
|
197
197
|
function W(t2) {
|
|
198
|
-
return !
|
|
198
|
+
return !O(Event) && function(t3, i2) {
|
|
199
199
|
try {
|
|
200
200
|
return t3 instanceof i2;
|
|
201
201
|
} catch (t4) {
|
|
@@ -250,8 +250,8 @@ var PaymentKit = (() => {
|
|
|
250
250
|
var gt = pt + " Mini";
|
|
251
251
|
var _t = "Edge";
|
|
252
252
|
var mt = "Microsoft " + _t;
|
|
253
|
-
var
|
|
254
|
-
var
|
|
253
|
+
var bt = "Firefox";
|
|
254
|
+
var yt = bt + " " + Q;
|
|
255
255
|
var wt = "Nintendo";
|
|
256
256
|
var xt = "PlayStation";
|
|
257
257
|
var Et = "Xbox";
|
|
@@ -264,11 +264,11 @@ var PaymentKit = (() => {
|
|
|
264
264
|
var Ct = "Generic";
|
|
265
265
|
var Rt = Ct + " " + X.toLowerCase();
|
|
266
266
|
var Ft = Ct + " " + tt.toLowerCase();
|
|
267
|
-
var
|
|
268
|
-
var
|
|
269
|
-
var At = new RegExp("Version/" +
|
|
270
|
-
var
|
|
271
|
-
var
|
|
267
|
+
var Ot = "Konqueror";
|
|
268
|
+
var Mt = "(\\d+(\\.\\d+)?)";
|
|
269
|
+
var At = new RegExp("Version/" + Mt);
|
|
270
|
+
var jt = new RegExp(Et, "i");
|
|
271
|
+
var Dt = new RegExp(xt + " \\w+", "i");
|
|
272
272
|
var Lt = new RegExp(wt + " \\w+", "i");
|
|
273
273
|
var Nt = new RegExp(ot + "|PlayBook|BB10", "i");
|
|
274
274
|
var Ut = { "NT3.51": "NT 3.11", "NT4.0": "NT 4.0", "5.0": "2000", 5.1: "XP", 5.2: "XP", "6.0": "Vista", 6.1: "7", 6.2: "8", 6.3: "8.1", 6.4: "10", "10.0": "10" };
|
|
@@ -279,12 +279,12 @@ var PaymentKit = (() => {
|
|
|
279
279
|
return w(t3, nt) && !w(t3, ht) && !w(t3, Z);
|
|
280
280
|
}(t2);
|
|
281
281
|
var Wt = function(t2, i2) {
|
|
282
|
-
return i2 = i2 || "", w(t2, " OPR/") && w(t2, "Mini") ? gt : w(t2, " OPR/") ? pt : Nt.test(t2) ? ot : w(t2, "IE" + X) || w(t2, "WPDesktop") ? ft : w(t2, lt) ? ut : w(t2, _t) || w(t2, "Edg/") ? mt : w(t2, "FBIOS") ? "Facebook " + X : w(t2, "UCWEB") || w(t2, "UCBrowser") ? "UC Browser" : w(t2, "CriOS") ? vt : w(t2, "CrMo") || w(t2, ht) ? ht : w(t2, Z) && w(t2, nt) ? $t : w(t2, "FxiOS") ?
|
|
282
|
+
return i2 = i2 || "", w(t2, " OPR/") && w(t2, "Mini") ? gt : w(t2, " OPR/") ? pt : Nt.test(t2) ? ot : w(t2, "IE" + X) || w(t2, "WPDesktop") ? ft : w(t2, lt) ? ut : w(t2, _t) || w(t2, "Edg/") ? mt : w(t2, "FBIOS") ? "Facebook " + X : w(t2, "UCWEB") || w(t2, "UCBrowser") ? "UC Browser" : w(t2, "CriOS") ? vt : w(t2, "CrMo") || w(t2, ht) ? ht : w(t2, Z) && w(t2, nt) ? $t : w(t2, "FxiOS") ? yt : w(t2.toLowerCase(), Ot.toLowerCase()) ? Ot : qt(t2, i2) ? w(t2, X) ? St : nt : w(t2, bt) ? bt : w(t2, "MSIE") || w(t2, "Trident/") ? ct : w(t2, "Gecko") ? bt : "";
|
|
283
283
|
};
|
|
284
|
-
var Gt = { [ft]: [new RegExp("rv:" +
|
|
284
|
+
var Gt = { [ft]: [new RegExp("rv:" + Mt)], [mt]: [new RegExp(_t + "?\\/" + Mt)], [ht]: [new RegExp("(" + ht + "|CrMo)\\/" + Mt)], [vt]: [new RegExp("CriOS\\/" + Mt)], "UC Browser": [new RegExp("(UCBrowser|UCWEB)\\/" + Mt)], [nt]: [At], [St]: [At], [pt]: [new RegExp("(Opera|OPR)\\/" + Mt)], [bt]: [new RegExp(bt + "\\/" + Mt)], [yt]: [new RegExp("FxiOS\\/" + Mt)], [Ot]: [new RegExp("Konqueror[:/]?" + Mt, "i")], [ot]: [new RegExp(ot + " " + Mt), At], [$t]: [new RegExp("android\\s" + Mt, "i")], [ut]: [new RegExp(lt + "\\/" + Mt)], [ct]: [new RegExp("(rv:|MSIE )" + Mt)], Mozilla: [new RegExp("rv:" + Mt)] };
|
|
285
285
|
var Vt = function(t2, i2) {
|
|
286
286
|
var e2 = Wt(t2, i2), r2 = Gt[e2];
|
|
287
|
-
if (
|
|
287
|
+
if (O(r2)) return null;
|
|
288
288
|
for (var s2 = 0; s2 < r2.length; s2++) {
|
|
289
289
|
var n2 = r2[s2], o2 = t2.match(n2);
|
|
290
290
|
if (o2) return parseFloat(o2[o2.length - 2]);
|
|
@@ -308,7 +308,7 @@ var PaymentKit = (() => {
|
|
|
308
308
|
return [Q, ""];
|
|
309
309
|
}], [/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i, (t2) => {
|
|
310
310
|
var i2 = "";
|
|
311
|
-
return t2 && t2.length >= 3 && (i2 =
|
|
311
|
+
return t2 && t2.length >= 3 && (i2 = O(t2[2]) ? t2[3] : t2[2]), ["watchOS", i2];
|
|
312
312
|
}], [new RegExp("(" + Z + " (\\d+)\\.(\\d+)\\.?(\\d+)?|" + Z + ")", "i"), (t2) => {
|
|
313
313
|
if (t2 && t2[2]) {
|
|
314
314
|
var i2 = [t2[2], t2[3], t2[4] || "0"];
|
|
@@ -324,7 +324,7 @@ var PaymentKit = (() => {
|
|
|
324
324
|
return i2;
|
|
325
325
|
}], [/Mac/i, ["Mac OS X", ""]], [/CrOS/, [dt, ""]], [/Linux|debian/i, ["Linux", ""]]];
|
|
326
326
|
var Kt = function(t2) {
|
|
327
|
-
return Lt.test(t2) ? wt :
|
|
327
|
+
return Lt.test(t2) ? wt : Dt.test(t2) ? xt : jt.test(t2) ? Et : new RegExp(It, "i").test(t2) ? It : new RegExp("(" + Pt + "|WPDesktop)", "i").test(t2) ? Pt : /iPad/.test(t2) ? et : /iPod/.test(t2) ? "iPod Touch" : /iPhone/.test(t2) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t2) ? st : Nt.test(t2) ? ot : /(kobo)\s(ereader|touch)/i.test(t2) ? "Kobo" : new RegExp(Tt, "i").test(t2) ? Tt : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t2) || /(kf[a-z]+)( bui|\)).+silk\//i.test(t2) ? "Kindle Fire" : /(Android|ZTE)/i.test(t2) ? new RegExp(X).test(t2) && !/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t2) || /pixel[\daxl ]{1,6}/i.test(t2) && !/pixel c/i.test(t2) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t2) || /lmy47v/i.test(t2) && !/QTAQZ3/i.test(t2) ? Z : it : new RegExp("(pda|" + X + ")", "i").test(t2) ? Rt : new RegExp(tt, "i").test(t2) && !new RegExp(tt + " pc", "i").test(t2) ? Ft : "";
|
|
328
328
|
};
|
|
329
329
|
var Yt = (t2) => t2 instanceof Error;
|
|
330
330
|
function Xt(t2) {
|
|
@@ -408,7 +408,7 @@ var PaymentKit = (() => {
|
|
|
408
408
|
var Zt = "?";
|
|
409
409
|
function ti(t2, i2, e2, r2, s2) {
|
|
410
410
|
var n2 = { platform: t2, filename: i2, function: "<anonymous>" === e2 ? Zt : e2, in_app: true };
|
|
411
|
-
return
|
|
411
|
+
return O(r2) || (n2.lineno = r2), O(s2) || (n2.colno = s2), n2;
|
|
412
412
|
}
|
|
413
413
|
var ii = (t2, i2) => {
|
|
414
414
|
var e2 = -1 !== t2.indexOf("safari-extension"), r2 = -1 !== t2.indexOf("safari-web-extension");
|
|
@@ -485,7 +485,7 @@ var PaymentKit = (() => {
|
|
|
485
485
|
return this.isDOMException(t2) || this.isDOMError(t2);
|
|
486
486
|
}
|
|
487
487
|
coerce(t2, i2) {
|
|
488
|
-
var e2 =
|
|
488
|
+
var e2 = M(t2.stack);
|
|
489
489
|
return { type: this.getType(t2), value: this.getValue(t2), stack: e2 ? t2.stack : void 0, cause: t2.cause ? i2.next(t2.cause) : void 0, synthetic: false };
|
|
490
490
|
}
|
|
491
491
|
getType(t2) {
|
|
@@ -556,7 +556,7 @@ var PaymentKit = (() => {
|
|
|
556
556
|
}
|
|
557
557
|
return "";
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var bi = class {
|
|
560
560
|
match(t2) {
|
|
561
561
|
return "object" == typeof t2 && null !== t2;
|
|
562
562
|
}
|
|
@@ -577,7 +577,7 @@ var PaymentKit = (() => {
|
|
|
577
577
|
return (e2 && "Object" !== e2 ? "'" + e2 + "'" : "Object") + " captured as exception with keys: " + mi(t2);
|
|
578
578
|
}
|
|
579
579
|
isSeverityLevel(t2) {
|
|
580
|
-
return
|
|
580
|
+
return M(t2) && !A(t2) && _i.indexOf(t2) >= 0;
|
|
581
581
|
}
|
|
582
582
|
getErrorPropertyFromObject(t2) {
|
|
583
583
|
for (var i2 in t2) if (Object.prototype.hasOwnProperty.call(t2, i2)) {
|
|
@@ -594,7 +594,7 @@ var PaymentKit = (() => {
|
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
|
-
var
|
|
597
|
+
var yi = class {
|
|
598
598
|
match(t2) {
|
|
599
599
|
return W(t2);
|
|
600
600
|
}
|
|
@@ -632,7 +632,7 @@ var PaymentKit = (() => {
|
|
|
632
632
|
};
|
|
633
633
|
var Ei = function(i2, e2) {
|
|
634
634
|
var { debugEnabled: r2 } = void 0 === e2 ? {} : e2, s2 = { k: function(e3) {
|
|
635
|
-
if (t && (c.DEBUG || v.POSTHOG_DEBUG || r2) && !
|
|
635
|
+
if (t && (c.DEBUG || v.POSTHOG_DEBUG || r2) && !O(t.console) && t.console) {
|
|
636
636
|
for (var s3 = ("__rrweb_original__" in t.console[e3]) ? t.console[e3].__rrweb_original__ : t.console[e3], n2 = arguments.length, o2 = new Array(n2 > 1 ? n2 - 1 : 0), a2 = 1; a2 < n2; a2++) o2[a2 - 1] = arguments[a2];
|
|
637
637
|
s3(i2, ...o2);
|
|
638
638
|
}
|
|
@@ -706,7 +706,7 @@ var PaymentKit = (() => {
|
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
708
|
function Ci(t2, i2, e2) {
|
|
709
|
-
if (!
|
|
709
|
+
if (!D(t2)) {
|
|
710
710
|
if (I(t2)) return Ii(t2, i2, e2);
|
|
711
711
|
if (z(t2)) {
|
|
712
712
|
for (var r2 of t2.entries()) if (i2.call(e2, r2[1], r2[0]) === Ti) return;
|
|
@@ -727,11 +727,11 @@ var PaymentKit = (() => {
|
|
|
727
727
|
});
|
|
728
728
|
}), t2;
|
|
729
729
|
};
|
|
730
|
-
function
|
|
730
|
+
function Oi(t2) {
|
|
731
731
|
for (var i2 = Object.keys(t2), e2 = i2.length, r2 = new Array(e2); e2--; ) r2[e2] = [i2[e2], t2[i2[e2]]];
|
|
732
732
|
return r2;
|
|
733
733
|
}
|
|
734
|
-
var
|
|
734
|
+
var Mi = function(t2) {
|
|
735
735
|
try {
|
|
736
736
|
return t2();
|
|
737
737
|
} catch (t3) {
|
|
@@ -748,14 +748,14 @@ var PaymentKit = (() => {
|
|
|
748
748
|
}
|
|
749
749
|
};
|
|
750
750
|
};
|
|
751
|
-
var
|
|
751
|
+
var ji = function(t2) {
|
|
752
752
|
var i2 = {};
|
|
753
753
|
return Ci(t2, function(t3, e2) {
|
|
754
|
-
(
|
|
754
|
+
(M(t3) && t3.length > 0 || L(t3)) && (i2[e2] = t3);
|
|
755
755
|
}), i2;
|
|
756
756
|
};
|
|
757
|
-
function
|
|
758
|
-
return e2 = t2, r2 = (t3) =>
|
|
757
|
+
function Di(t2, i2) {
|
|
758
|
+
return e2 = t2, r2 = (t3) => M(t3) && !j(i2) ? t3.slice(0, i2) : t3, s2 = /* @__PURE__ */ new Set(), function t3(i3, e3) {
|
|
759
759
|
return i3 !== Object(i3) ? r2 ? r2(i3, e3) : i3 : s2.has(i3) ? void 0 : (s2.add(i3), I(i3) ? (n2 = [], Ii(i3, (i4) => {
|
|
760
760
|
n2.push(t3(i4));
|
|
761
761
|
})) : (n2 = {}, Ci(i3, (i4, e4) => {
|
|
@@ -768,7 +768,7 @@ var PaymentKit = (() => {
|
|
|
768
768
|
var Li = ["herokuapp.com", "vercel.app", "netlify.app"];
|
|
769
769
|
function Ni(t2) {
|
|
770
770
|
var i2 = null == t2 ? void 0 : t2.hostname;
|
|
771
|
-
if (!
|
|
771
|
+
if (!M(i2)) return false;
|
|
772
772
|
var e2 = i2.split(".").slice(-2).join(".");
|
|
773
773
|
for (var r2 of Li) if (e2 === r2) return false;
|
|
774
774
|
return true;
|
|
@@ -811,8 +811,8 @@ var PaymentKit = (() => {
|
|
|
811
811
|
var ge = "$epp";
|
|
812
812
|
var _e = "__POSTHOG_TOOLBAR__";
|
|
813
813
|
var me = "$posthog_cookieless";
|
|
814
|
-
var
|
|
815
|
-
function
|
|
814
|
+
var be = [Hi, Bi, "__cmpns", qi, "$session_recording_enabled_server_side", Gi, ie, re, Ji, he, se, ne, ae, oe, le, ue, de, ve, ce, fe, ge, pe, "$conversations_widget_session_id", "$conversations_ticket_id", "$conversations_widget_state", "$conversations_user_traits"];
|
|
815
|
+
function ye(t2) {
|
|
816
816
|
return t2 instanceof Element && (t2.id === _e || !(null == t2.closest || !t2.closest(".toolbar-global-fade-container")));
|
|
817
817
|
}
|
|
818
818
|
function we(t2) {
|
|
@@ -849,7 +849,7 @@ var PaymentKit = (() => {
|
|
|
849
849
|
return Se(i2);
|
|
850
850
|
}
|
|
851
851
|
function Te(t2) {
|
|
852
|
-
return
|
|
852
|
+
return D(t2) ? null : x(t2).split(/(\s+)/).filter((t3) => Ke(t3)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
|
|
853
853
|
}
|
|
854
854
|
function Ie(t2) {
|
|
855
855
|
var i2 = "";
|
|
@@ -859,35 +859,35 @@ var PaymentKit = (() => {
|
|
|
859
859
|
}), x(i2);
|
|
860
860
|
}
|
|
861
861
|
function Ce(t2) {
|
|
862
|
-
return
|
|
862
|
+
return O(t2.target) ? t2.srcElement || null : null != (i2 = t2.target) && i2.shadowRoot ? t2.composedPath()[0] || null : t2.target || null;
|
|
863
863
|
var i2;
|
|
864
864
|
}
|
|
865
865
|
var Re = ["a", "button", "form", "input", "select", "textarea", "label"];
|
|
866
866
|
function Fe(t2, i2) {
|
|
867
|
-
if (
|
|
867
|
+
if (O(i2)) return true;
|
|
868
868
|
var e2, r2 = function(t3) {
|
|
869
869
|
if (i2.some((i3) => t3.matches(i3))) return { v: true };
|
|
870
870
|
};
|
|
871
871
|
for (var s2 of t2) if (e2 = r2(s2)) return e2.v;
|
|
872
872
|
return false;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function Oe(t2) {
|
|
875
875
|
var i2 = t2.parentNode;
|
|
876
876
|
return !(!i2 || !we(i2)) && i2;
|
|
877
877
|
}
|
|
878
|
-
var
|
|
878
|
+
var Me = ["next", "previous", "prev", ">", "<"];
|
|
879
879
|
var Ae = 10;
|
|
880
|
-
var
|
|
881
|
-
function
|
|
880
|
+
var je = [".ph-no-rageclick", ".ph-no-capture"];
|
|
881
|
+
function De(i2, e2) {
|
|
882
882
|
if (!t || Le(i2)) return false;
|
|
883
883
|
var r2, s2, n2;
|
|
884
|
-
U(e2) ? (r2 = !!e2 &&
|
|
884
|
+
U(e2) ? (r2 = !!e2 && je, s2 = void 0) : (r2 = null !== (n2 = null == e2 ? void 0 : e2.css_selector_ignorelist) && void 0 !== n2 ? n2 : je, s2 = null == e2 ? void 0 : e2.content_ignorelist);
|
|
885
885
|
if (false === r2) return false;
|
|
886
886
|
var { targetElementList: o2 } = Ne(i2, false);
|
|
887
887
|
return !function(t2, i3) {
|
|
888
|
-
if (false === t2 ||
|
|
888
|
+
if (false === t2 || O(t2)) return false;
|
|
889
889
|
var e3;
|
|
890
|
-
if (true === t2) e3 =
|
|
890
|
+
if (true === t2) e3 = Me;
|
|
891
891
|
else {
|
|
892
892
|
if (!I(t2)) return false;
|
|
893
893
|
if (t2.length > Ae) return $i.error("[PostHog] content_ignorelist array cannot exceed " + Ae + " items. Use css_selector_ignorelist for more complex matching."), false;
|
|
@@ -907,7 +907,7 @@ var PaymentKit = (() => {
|
|
|
907
907
|
if (!t || Le(i2)) return { parentIsUsefulElement: false, targetElementList: [] };
|
|
908
908
|
for (var r2 = false, s2 = [i2], n2 = i2; n2.parentNode && !xe(n2, "body"); ) if ($e(n2.parentNode)) s2.push(n2.parentNode.host), n2 = n2.parentNode.host;
|
|
909
909
|
else {
|
|
910
|
-
var o2 =
|
|
910
|
+
var o2 = Oe(n2);
|
|
911
911
|
if (!o2) break;
|
|
912
912
|
if (e2 || Re.indexOf(o2.tagName.toLowerCase()) > -1) r2 = true;
|
|
913
913
|
else {
|
|
@@ -930,7 +930,7 @@ var PaymentKit = (() => {
|
|
|
930
930
|
var { parentIsUsefulElement: d2, targetElementList: v2 } = Ne(i2, s2);
|
|
931
931
|
if (!function(t2, i3) {
|
|
932
932
|
var e3 = null == i3 ? void 0 : i3.element_allowlist;
|
|
933
|
-
if (
|
|
933
|
+
if (O(e3)) return true;
|
|
934
934
|
var r3, s3 = function(t3) {
|
|
935
935
|
if (e3.some((i4) => t3.tagName.toLowerCase() === i4)) return { v: true };
|
|
936
936
|
};
|
|
@@ -961,13 +961,13 @@ var PaymentKit = (() => {
|
|
|
961
961
|
}
|
|
962
962
|
if (w(Pe(t2), "ph-include")) return true;
|
|
963
963
|
var r2 = t2.type || "";
|
|
964
|
-
if (
|
|
964
|
+
if (M(r2)) switch (r2.toLowerCase()) {
|
|
965
965
|
case "hidden":
|
|
966
966
|
case "password":
|
|
967
967
|
return false;
|
|
968
968
|
}
|
|
969
969
|
var s2 = t2.name || t2.id || "";
|
|
970
|
-
if (
|
|
970
|
+
if (M(s2)) {
|
|
971
971
|
if (/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s2.replace(/[^a-zA-Z0-9]/g, ""))) return false;
|
|
972
972
|
}
|
|
973
973
|
return true;
|
|
@@ -982,8 +982,8 @@ var PaymentKit = (() => {
|
|
|
982
982
|
var Ve = new RegExp("^(" + Ge + ")$");
|
|
983
983
|
var Je = new RegExp("(" + Ge + ")");
|
|
984
984
|
function Ke(t2, i2) {
|
|
985
|
-
if (void 0 === i2 && (i2 = true),
|
|
986
|
-
if (
|
|
985
|
+
if (void 0 === i2 && (i2 = true), D(t2)) return false;
|
|
986
|
+
if (M(t2)) {
|
|
987
987
|
if (t2 = x(t2), (i2 ? qe : We).test((t2 || "").replace(/[- ]/g, ""))) return false;
|
|
988
988
|
if ((i2 ? Ve : Je).test(t2)) return false;
|
|
989
989
|
}
|
|
@@ -1011,13 +1011,13 @@ var PaymentKit = (() => {
|
|
|
1011
1011
|
var i3, e2, r2 = "";
|
|
1012
1012
|
if (t4.tag_name && (r2 += t4.tag_name), t4.attr_class) for (var s2 of (t4.attr_class.sort(), t4.attr_class)) r2 += "." + s2.replace(/"/g, "");
|
|
1013
1013
|
var n2 = g({}, t4.text ? { text: t4.text } : {}, { "nth-child": null !== (i3 = t4.nth_child) && void 0 !== i3 ? i3 : 0, "nth-of-type": null !== (e2 = t4.nth_of_type) && void 0 !== e2 ? e2 : 0 }, t4.href ? { href: t4.href } : {}, t4.attr_id ? { attr_id: t4.attr_id } : {}, t4.attributes), o2 = {};
|
|
1014
|
-
return
|
|
1014
|
+
return Oi(n2).sort((t5, i4) => {
|
|
1015
1015
|
var [e3] = t5, [r3] = i4;
|
|
1016
1016
|
return e3.localeCompare(r3);
|
|
1017
1017
|
}).forEach((t5) => {
|
|
1018
1018
|
var [i4, e3] = t5;
|
|
1019
1019
|
return o2[Ze(i4.toString())] = Ze(e3.toString());
|
|
1020
|
-
}), r2 += ":", r2 +=
|
|
1020
|
+
}), r2 += ":", r2 += Oi(o2).map((t5) => {
|
|
1021
1021
|
var [i4, e3] = t5;
|
|
1022
1022
|
return i4 + '="' + e3 + '"';
|
|
1023
1023
|
}).join("");
|
|
@@ -1026,7 +1026,7 @@ var PaymentKit = (() => {
|
|
|
1026
1026
|
}(function(t3) {
|
|
1027
1027
|
return t3.map((t4) => {
|
|
1028
1028
|
var i2, e2, r2 = { text: null == (i2 = t4.$el_text) ? void 0 : i2.slice(0, 400), tag_name: t4.tag_name, href: null == (e2 = t4.attr__href) ? void 0 : e2.slice(0, 2048), attr_class: tr(t4), attr_id: t4.attr__id, nth_child: t4.nth_child, nth_of_type: t4.nth_of_type, attributes: {} };
|
|
1029
|
-
return
|
|
1029
|
+
return Oi(t4).filter((t5) => {
|
|
1030
1030
|
var [i3] = t5;
|
|
1031
1031
|
return 0 === i3.indexOf("attr__");
|
|
1032
1032
|
}).forEach((t5) => {
|
|
@@ -1060,14 +1060,14 @@ var PaymentKit = (() => {
|
|
|
1060
1060
|
};
|
|
1061
1061
|
var er = (t2) => {
|
|
1062
1062
|
var i2 = null == o ? void 0 : o.createElement("a");
|
|
1063
|
-
return
|
|
1063
|
+
return O(i2) ? null : (i2.href = t2, i2);
|
|
1064
1064
|
};
|
|
1065
1065
|
var rr = function(t2, i2) {
|
|
1066
1066
|
var e2, r2;
|
|
1067
1067
|
void 0 === i2 && (i2 = "&");
|
|
1068
1068
|
var s2 = [];
|
|
1069
1069
|
return Ci(t2, function(t3, i3) {
|
|
1070
|
-
|
|
1070
|
+
O(t3) || O(i3) || "undefined" === i3 || (e2 = encodeURIComponent(((t4) => t4 instanceof File)(t3) ? t3.name : t3.toString()), r2 = encodeURIComponent(i3), s2[s2.length] = r2 + "=" + e2);
|
|
1071
1071
|
}), s2.join(i2);
|
|
1072
1072
|
};
|
|
1073
1073
|
var sr = function(t2, i2) {
|
|
@@ -1121,7 +1121,7 @@ var PaymentKit = (() => {
|
|
|
1121
1121
|
return "" !== t3;
|
|
1122
1122
|
})), Ci(t2.attributes, function(e3) {
|
|
1123
1123
|
var s3;
|
|
1124
|
-
if ((!He(t2) || -1 !== ["name", "id", "class", "aria-label"].indexOf(e3.name)) && ((null == r2 || !r2.includes(e3.name)) && !i2 && Ke(e3.value) && (s3 = e3.name, !
|
|
1124
|
+
if ((!He(t2) || -1 !== ["name", "id", "class", "aria-label"].indexOf(e3.name)) && ((null == r2 || !r2.includes(e3.name)) && !i2 && Ke(e3.value) && (s3 = e3.name, !M(s3) || "_ngcontent" !== s3.substring(0, 10) && "_nghost" !== s3.substring(0, 7)))) {
|
|
1125
1125
|
var o3 = e3.value;
|
|
1126
1126
|
"class" === e3.name && (o3 = Se(o3).join(" ")), n2["attr__" + e3.name] = ur(1024, o3);
|
|
1127
1127
|
}
|
|
@@ -1150,8 +1150,8 @@ var PaymentKit = (() => {
|
|
|
1150
1150
|
if (a2 || ("a" === i2.tagName.toLowerCase() || "button" === i2.tagName.toLowerCase() ? c2[0].$el_text = Ye(i2) : c2[0].$el_text = Ie(i2)), p2) {
|
|
1151
1151
|
var _2, m2;
|
|
1152
1152
|
c2[0].attr__href = p2;
|
|
1153
|
-
var
|
|
1154
|
-
|
|
1153
|
+
var b2 = null == (_2 = er(p2)) ? void 0 : _2.host, y2 = null == t || null == (m2 = t.location) ? void 0 : m2.host;
|
|
1154
|
+
b2 && y2 && b2 !== y2 && (v2 = p2);
|
|
1155
1155
|
}
|
|
1156
1156
|
return { props: Ri({ $event_type: n2.type, $ce_version: 1 }, u2 ? {} : { $elements: c2 }, { $elements_chain: Qe(c2) }, null != (r2 = c2[0]) && r2.$el_text ? { $el_text: null == (s2 = c2[0]) ? void 0 : s2.$el_text } : {}, v2 && "click" === n2.type ? { $external_click_url: v2 } : {}, f2) };
|
|
1157
1157
|
}
|
|
@@ -1169,14 +1169,14 @@ var PaymentKit = (() => {
|
|
|
1169
1169
|
var i2 = (i3) => {
|
|
1170
1170
|
i3 = i3 || (null == t ? void 0 : t.event);
|
|
1171
1171
|
try {
|
|
1172
|
-
this.
|
|
1172
|
+
this.O(i3);
|
|
1173
1173
|
} catch (t2) {
|
|
1174
1174
|
lr.error("Failed to capture event", t2);
|
|
1175
1175
|
}
|
|
1176
1176
|
};
|
|
1177
1177
|
if (zi(o, "submit", i2, { capture: true }), zi(o, "change", i2, { capture: true }), zi(o, "click", i2, { capture: true }), this.R.capture_copied_text) {
|
|
1178
1178
|
var e2 = (i3) => {
|
|
1179
|
-
i3 = i3 || (null == t ? void 0 : t.event), this.
|
|
1179
|
+
i3 = i3 || (null == t ? void 0 : t.event), this.O(i3, ar);
|
|
1180
1180
|
};
|
|
1181
1181
|
zi(o, "copy", e2, { capture: true }), zi(o, "cut", e2, { capture: true });
|
|
1182
1182
|
}
|
|
@@ -1203,14 +1203,14 @@ var PaymentKit = (() => {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
get isEnabled() {
|
|
1205
1205
|
var t2, i2, e2 = null == (t2 = this.instance.persistence) ? void 0 : t2.props[Wi], r2 = this.T;
|
|
1206
|
-
if (
|
|
1206
|
+
if (j(r2) && !U(e2) && !this.instance.M()) return false;
|
|
1207
1207
|
var s2 = null !== (i2 = this.T) && void 0 !== i2 ? i2 : !!e2;
|
|
1208
1208
|
return !!this.instance.config.autocapture && !s2;
|
|
1209
1209
|
}
|
|
1210
|
-
|
|
1210
|
+
O(i2, e2) {
|
|
1211
1211
|
if (void 0 === e2 && (e2 = "$autocapture"), this.isEnabled) {
|
|
1212
1212
|
var r2, s2 = Ce(i2);
|
|
1213
|
-
if (Ee(s2) && (s2 = s2.parentNode || null), "$autocapture" === e2 && "click" === i2.type && i2 instanceof MouseEvent) this.instance.config.rageclick && null != (r2 = this.rageclicks) && r2.isRageClick(i2.clientX, i2.clientY, i2.timeStamp || (/* @__PURE__ */ new Date()).getTime()) &&
|
|
1213
|
+
if (Ee(s2) && (s2 = s2.parentNode || null), "$autocapture" === e2 && "click" === i2.type && i2 instanceof MouseEvent) this.instance.config.rageclick && null != (r2 = this.rageclicks) && r2.isRageClick(i2.clientX, i2.clientY, i2.timeStamp || (/* @__PURE__ */ new Date()).getTime()) && De(s2, this.instance.config.rageclick) && this.O(i2, "$rageclick");
|
|
1214
1214
|
var n2 = e2 === ar;
|
|
1215
1215
|
if (s2 && Ue(s2, i2, this.R, n2, n2 ? ["copy", "cut"] : void 0)) {
|
|
1216
1216
|
var { props: o2, explicitNoCapture: a2 } = vr(s2, { e: i2, maskAllElementAttributes: this.instance.config.mask_all_element_attributes, maskAllText: this.instance.config.mask_all_text, elementAttributeIgnoreList: this.R.element_attribute_ignorelist, elementsChainAsString: this.I });
|
|
@@ -1265,14 +1265,14 @@ var PaymentKit = (() => {
|
|
|
1265
1265
|
};
|
|
1266
1266
|
var gr = class {
|
|
1267
1267
|
constructor() {
|
|
1268
|
-
this.A = 0, this.
|
|
1268
|
+
this.A = 0, this.j = 0, this.D = new br();
|
|
1269
1269
|
}
|
|
1270
1270
|
generate() {
|
|
1271
1271
|
var t2 = this.generateOrAbort();
|
|
1272
|
-
if (
|
|
1272
|
+
if (O(t2)) {
|
|
1273
1273
|
this.A = 0;
|
|
1274
1274
|
var i2 = this.generateOrAbort();
|
|
1275
|
-
if (
|
|
1275
|
+
if (O(i2)) throw new Error("Could not generate UUID after timestamp reset");
|
|
1276
1276
|
return i2;
|
|
1277
1277
|
}
|
|
1278
1278
|
return t2;
|
|
@@ -1282,12 +1282,12 @@ var PaymentKit = (() => {
|
|
|
1282
1282
|
if (t2 > this.A) this.A = t2, this.L();
|
|
1283
1283
|
else {
|
|
1284
1284
|
if (!(t2 + 1e4 > this.A)) return;
|
|
1285
|
-
this.
|
|
1285
|
+
this.j++, this.j > 4398046511103 && (this.A++, this.L());
|
|
1286
1286
|
}
|
|
1287
|
-
return pr.fromFieldsV7(this.A, Math.trunc(this.
|
|
1287
|
+
return pr.fromFieldsV7(this.A, Math.trunc(this.j / Math.pow(2, 30)), this.j & Math.pow(2, 30) - 1, this.D.nextUint32());
|
|
1288
1288
|
}
|
|
1289
1289
|
L() {
|
|
1290
|
-
this.
|
|
1290
|
+
this.j = 1024 * this.D.nextUint32() + (1023 & this.D.nextUint32());
|
|
1291
1291
|
}
|
|
1292
1292
|
};
|
|
1293
1293
|
var _r;
|
|
@@ -1296,8 +1296,8 @@ var PaymentKit = (() => {
|
|
|
1296
1296
|
for (var i2 = 0; i2 < t2.length; i2++) t2[i2] = 65536 * Math.trunc(65536 * Math.random()) + Math.trunc(65536 * Math.random());
|
|
1297
1297
|
return t2;
|
|
1298
1298
|
};
|
|
1299
|
-
t && !
|
|
1300
|
-
var
|
|
1299
|
+
t && !O(t.crypto) && crypto.getRandomValues && (mr = (t2) => crypto.getRandomValues(t2));
|
|
1300
|
+
var br = class {
|
|
1301
1301
|
constructor() {
|
|
1302
1302
|
this.N = new Uint32Array(8), this.U = 1 / 0;
|
|
1303
1303
|
}
|
|
@@ -1305,7 +1305,7 @@ var PaymentKit = (() => {
|
|
|
1305
1305
|
return this.U >= this.N.length && (mr(this.N), this.U = 0), this.N[this.U++];
|
|
1306
1306
|
}
|
|
1307
1307
|
};
|
|
1308
|
-
var
|
|
1308
|
+
var yr = () => wr().toString();
|
|
1309
1309
|
var wr = () => (_r || (_r = new gr())).generate();
|
|
1310
1310
|
var xr = "";
|
|
1311
1311
|
var Er = /[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;
|
|
@@ -1315,7 +1315,7 @@ var PaymentKit = (() => {
|
|
|
1315
1315
|
if (void 0 === i3 && (i3 = o), xr) return xr;
|
|
1316
1316
|
if (!i3) return "";
|
|
1317
1317
|
if (["localhost", "127.0.0.1"].includes(t3)) return "";
|
|
1318
|
-
for (var e3 = t3.split("."), r3 = Math.min(e3.length, 8), s2 = "dmn_chk_" +
|
|
1318
|
+
for (var e3 = t3.split("."), r3 = Math.min(e3.length, 8), s2 = "dmn_chk_" + yr(); !xr && r3--; ) {
|
|
1319
1319
|
var n2 = e3.slice(r3).join("."), a2 = s2 + "=1;domain=." + n2 + ";path=/";
|
|
1320
1320
|
i3.cookie = a2 + ";max-age=3", i3.cookie.includes(s2) && (i3.cookie = a2 + ";max-age=0", xr = n2);
|
|
1321
1321
|
}
|
|
@@ -1374,9 +1374,9 @@ var PaymentKit = (() => {
|
|
|
1374
1374
|
} };
|
|
1375
1375
|
var kr = null;
|
|
1376
1376
|
var Pr = { H: function() {
|
|
1377
|
-
if (!
|
|
1377
|
+
if (!j(kr)) return kr;
|
|
1378
1378
|
var i2 = true;
|
|
1379
|
-
if (
|
|
1379
|
+
if (O(t)) i2 = false;
|
|
1380
1380
|
else try {
|
|
1381
1381
|
var e2 = "__mplssupport__";
|
|
1382
1382
|
Pr.G(e2, "xyz"), '"xyz"' !== Pr.q(e2) && (i2 = false), Pr.V(e2);
|
|
@@ -1429,8 +1429,8 @@ var PaymentKit = (() => {
|
|
|
1429
1429
|
} };
|
|
1430
1430
|
var Rr = null;
|
|
1431
1431
|
var Fr = { H: function() {
|
|
1432
|
-
if (!
|
|
1433
|
-
if (Rr = true,
|
|
1432
|
+
if (!j(Rr)) return Rr;
|
|
1433
|
+
if (Rr = true, O(t)) Rr = false;
|
|
1434
1434
|
else try {
|
|
1435
1435
|
var i2 = "__support__";
|
|
1436
1436
|
Fr.G(i2, "xyz"), '"xyz"' !== Fr.q(i2) && (Rr = false), Fr.V(i2);
|
|
@@ -1466,10 +1466,10 @@ var PaymentKit = (() => {
|
|
|
1466
1466
|
Fr.B(t2);
|
|
1467
1467
|
}
|
|
1468
1468
|
} };
|
|
1469
|
-
var
|
|
1469
|
+
var Or = function(t2) {
|
|
1470
1470
|
return t2[t2.PENDING = -1] = "PENDING", t2[t2.DENIED = 0] = "DENIED", t2[t2.GRANTED = 1] = "GRANTED", t2;
|
|
1471
1471
|
}({});
|
|
1472
|
-
var
|
|
1472
|
+
var Mr = class {
|
|
1473
1473
|
constructor(t2) {
|
|
1474
1474
|
this._instance = t2;
|
|
1475
1475
|
}
|
|
@@ -1477,16 +1477,16 @@ var PaymentKit = (() => {
|
|
|
1477
1477
|
return this._instance.config;
|
|
1478
1478
|
}
|
|
1479
1479
|
get consent() {
|
|
1480
|
-
return this.J() ?
|
|
1480
|
+
return this.J() ? Or.DENIED : this.K;
|
|
1481
1481
|
}
|
|
1482
1482
|
isOptedOut() {
|
|
1483
|
-
return "always" === this.R.cookieless_mode || (this.consent ===
|
|
1483
|
+
return "always" === this.R.cookieless_mode || (this.consent === Or.DENIED || this.consent === Or.PENDING && (this.R.opt_out_capturing_by_default || "on_reject" === this.R.cookieless_mode));
|
|
1484
1484
|
}
|
|
1485
1485
|
isOptedIn() {
|
|
1486
1486
|
return !this.isOptedOut();
|
|
1487
1487
|
}
|
|
1488
1488
|
isExplicitlyOptedOut() {
|
|
1489
|
-
return this.consent ===
|
|
1489
|
+
return this.consent === Or.DENIED;
|
|
1490
1490
|
}
|
|
1491
1491
|
optInOut(t2) {
|
|
1492
1492
|
this.Y.G(this.X, t2 ? 1 : 0, this.R.cookie_expiration, this.R.cross_subdomain_cookie, this.R.secure_cookie);
|
|
@@ -1500,7 +1500,7 @@ var PaymentKit = (() => {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
get K() {
|
|
1502
1502
|
var t2 = this.Y.q(this.X);
|
|
1503
|
-
return V(t2) ?
|
|
1503
|
+
return V(t2) ? Or.GRANTED : w(J, t2) ? Or.DENIED : Or.PENDING;
|
|
1504
1504
|
}
|
|
1505
1505
|
get Y() {
|
|
1506
1506
|
if (!this.Z) {
|
|
@@ -1516,8 +1516,8 @@ var PaymentKit = (() => {
|
|
|
1516
1516
|
}
|
|
1517
1517
|
};
|
|
1518
1518
|
var Ar = Si("[Dead Clicks]");
|
|
1519
|
-
var
|
|
1520
|
-
var
|
|
1519
|
+
var jr = () => true;
|
|
1520
|
+
var Dr = (t2) => {
|
|
1521
1521
|
var i2, e2 = !(null == (i2 = t2.instance.persistence) || !i2.get_property(Xi)), r2 = t2.instance.config.capture_dead_clicks;
|
|
1522
1522
|
return U(r2) ? r2 : !!R(r2) || e2;
|
|
1523
1523
|
};
|
|
@@ -1573,7 +1573,7 @@ var PaymentKit = (() => {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
vt() {
|
|
1575
1575
|
var t2 = this._instance.config.capture_exceptions, i2 = { capture_unhandled_errors: false, capture_unhandled_rejections: false, capture_console_errors: false };
|
|
1576
|
-
return R(t2) ? i2 = g({}, i2, t2) : (
|
|
1576
|
+
return R(t2) ? i2 = g({}, i2, t2) : (O(t2) ? this.ht : t2) && (i2 = g({}, i2, { capture_unhandled_errors: true, capture_unhandled_rejections: true })), i2;
|
|
1577
1577
|
}
|
|
1578
1578
|
get isEnabled() {
|
|
1579
1579
|
return this.R.capture_console_errors || this.R.capture_unhandled_errors || this.R.capture_unhandled_rejections;
|
|
@@ -1639,7 +1639,7 @@ var PaymentKit = (() => {
|
|
|
1639
1639
|
t2.call(this, i3, e3, s2), r2._t("pushState");
|
|
1640
1640
|
}), null != (e2 = t.history.replaceState) && e2.__posthog_wrapped__ || zr(t.history, "replaceState", (t2) => function(i3, e3, s2) {
|
|
1641
1641
|
t2.call(this, i3, e3, s2), r2._t("replaceState");
|
|
1642
|
-
}), this.
|
|
1642
|
+
}), this.bt();
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
_t(i2) {
|
|
@@ -1651,7 +1651,7 @@ var PaymentKit = (() => {
|
|
|
1651
1651
|
$i.error("Error capturing " + i2 + " pageview", t2);
|
|
1652
1652
|
}
|
|
1653
1653
|
}
|
|
1654
|
-
|
|
1654
|
+
bt() {
|
|
1655
1655
|
if (!this.ft) {
|
|
1656
1656
|
var i2 = () => {
|
|
1657
1657
|
this._t("popstate");
|
|
@@ -1670,7 +1670,7 @@ var PaymentKit = (() => {
|
|
|
1670
1670
|
var e3 = t3.config.segment;
|
|
1671
1671
|
if (!e3) return i3();
|
|
1672
1672
|
var r2 = (e4) => {
|
|
1673
|
-
var r3 = () => e4.anonymousId() ||
|
|
1673
|
+
var r3 = () => e4.anonymousId() || yr();
|
|
1674
1674
|
t3.config.get_device_id = r3, e4.id() && (t3.register({ distinct_id: e4.id(), $device_id: r3() }), t3.persistence.set_property(he, "identified")), i3();
|
|
1675
1675
|
}, s2 = e3.user();
|
|
1676
1676
|
"then" in s2 && C(s2.then) ? s2.then(r2) : r2(s2);
|
|
@@ -1719,7 +1719,7 @@ var PaymentKit = (() => {
|
|
|
1719
1719
|
constructor(t2) {
|
|
1720
1720
|
this.instance = t2;
|
|
1721
1721
|
}
|
|
1722
|
-
|
|
1722
|
+
yt(t2) {
|
|
1723
1723
|
v.ph_toolbar_state = t2;
|
|
1724
1724
|
}
|
|
1725
1725
|
wt() {
|
|
@@ -1738,7 +1738,7 @@ var PaymentKit = (() => {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
e2 = null == t ? void 0 : t.localStorage;
|
|
1740
1740
|
}
|
|
1741
|
-
var s2, n2 = Jr || or(i2.hash, "__posthog") || or(i2.hash, "state"), a2 = n2 ?
|
|
1741
|
+
var s2, n2 = Jr || or(i2.hash, "__posthog") || or(i2.hash, "state"), a2 = n2 ? Mi(() => JSON.parse(atob(decodeURIComponent(n2)))) || Mi(() => JSON.parse(decodeURIComponent(n2))) : null;
|
|
1742
1742
|
return a2 && "ph_authorize" === a2.action ? ((s2 = a2).source = "url", s2 && Object.keys(s2).length > 0 && (a2.desiredHash ? i2.hash = a2.desiredHash : r2 ? r2.replaceState(r2.state, "", i2.pathname + i2.search) : i2.hash = "")) : ((s2 = JSON.parse(e2.getItem(Kr) || "{}")).source = "localstorage", delete s2.userIntent), !(!s2.token || this.instance.config.token !== s2.token) && (this.loadToolbar(s2), true);
|
|
1743
1743
|
} catch (t2) {
|
|
1744
1744
|
return false;
|
|
@@ -1746,7 +1746,7 @@ var PaymentKit = (() => {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
xt(t2) {
|
|
1748
1748
|
var i2 = v.ph_load_toolbar || v.ph_load_editor;
|
|
1749
|
-
!
|
|
1749
|
+
!D(i2) && C(i2) ? i2(t2, this.instance) : Yr.warn("No toolbar load function found");
|
|
1750
1750
|
}
|
|
1751
1751
|
loadToolbar(i2) {
|
|
1752
1752
|
var e2 = !(null == o || !o.getElementById(_e));
|
|
@@ -1755,11 +1755,11 @@ var PaymentKit = (() => {
|
|
|
1755
1755
|
if (t.localStorage.setItem(Kr, JSON.stringify(g({}, s2, { source: void 0 }))), this.wt() === Xr.LOADED) this.xt(s2);
|
|
1756
1756
|
else if (this.wt() === Xr.UNINITIALIZED) {
|
|
1757
1757
|
var n2;
|
|
1758
|
-
this.
|
|
1759
|
-
if (t2) return Yr.error("[Toolbar] Failed to load", t2), void this.
|
|
1760
|
-
this.
|
|
1758
|
+
this.yt(Xr.LOADING), null == (n2 = v.__PosthogExtensions__) || null == n2.loadExternalDependency || n2.loadExternalDependency(this.instance, "toolbar", (t2) => {
|
|
1759
|
+
if (t2) return Yr.error("[Toolbar] Failed to load", t2), void this.yt(Xr.UNINITIALIZED);
|
|
1760
|
+
this.yt(Xr.LOADED), this.xt(s2);
|
|
1761
1761
|
}), zi(t, "turbolinks:load", () => {
|
|
1762
|
-
this.
|
|
1762
|
+
this.yt(Xr.UNINITIALIZED), this.loadToolbar(s2);
|
|
1763
1763
|
});
|
|
1764
1764
|
}
|
|
1765
1765
|
return true;
|
|
@@ -1776,8 +1776,8 @@ var PaymentKit = (() => {
|
|
|
1776
1776
|
constructor(t2) {
|
|
1777
1777
|
this.$t = void 0, this.St = void 0, this.rt = () => {
|
|
1778
1778
|
var t3, i2;
|
|
1779
|
-
|
|
1780
|
-
|
|
1779
|
+
O(this.$t) && (null == (t3 = v.__PosthogExtensions__) || null == (t3 = t3.tracingHeadersPatchFns) || t3._patchXHR(this._instance.config.__add_tracing_headers || [], this._instance.get_distinct_id(), this._instance.sessionManager));
|
|
1780
|
+
O(this.St) && (null == (i2 = v.__PosthogExtensions__) || null == (i2 = i2.tracingHeadersPatchFns) || i2._patchFetch(this._instance.config.__add_tracing_headers || [], this._instance.get_distinct_id(), this._instance.sessionManager));
|
|
1781
1781
|
}, this._instance = t2;
|
|
1782
1782
|
}
|
|
1783
1783
|
it(t2) {
|
|
@@ -1816,7 +1816,7 @@ var PaymentKit = (() => {
|
|
|
1816
1816
|
var i2 = function(t3) {
|
|
1817
1817
|
return t3 ? 0 === t3.search(is + "google.([^/?]*)") ? "google" : 0 === t3.search(is + "bing.com") ? "bing" : 0 === t3.search(is + "yahoo.com") ? "yahoo" : 0 === t3.search(is + "duckduckgo.com") ? "duckduckgo" : null : null;
|
|
1818
1818
|
}(t2), e2 = "yahoo" != i2 ? "q" : "p", r2 = {};
|
|
1819
|
-
if (!
|
|
1819
|
+
if (!j(i2)) {
|
|
1820
1820
|
r2.$search_engine = i2;
|
|
1821
1821
|
var s2 = o ? sr(o.referrer, e2) : "";
|
|
1822
1822
|
s2.length && (r2.ph_keyword = s2);
|
|
@@ -1871,7 +1871,7 @@ var PaymentKit = (() => {
|
|
|
1871
1871
|
}
|
|
1872
1872
|
return ["", ""];
|
|
1873
1873
|
}(d);
|
|
1874
|
-
return Ri(
|
|
1874
|
+
return Ri(ji({ $os: l2, $os_version: u2, $browser: Wt(d, navigator.vendor), $device: Kt(d), $device_type: (s2 = d, n2 = Kt(s2), n2 === et || n2 === it || "Kobo" === n2 || "Kindle Fire" === n2 || n2 === Ft ? tt : n2 === wt || n2 === Et || n2 === xt || n2 === It ? "Console" : n2 === st ? "Wearable" : n2 ? X : "Desktop"), $timezone: cs(), $timezone_offset: fs() }), { $current_url: nr(null == a ? void 0 : a.href, o2, ss), $host: null == a ? void 0 : a.host, $pathname: null == a ? void 0 : a.pathname, $raw_user_agent: d.length > 1e3 ? d.substring(0, 997) + "..." : d, $browser_version: Vt(d, navigator.vendor), $browser_language: us(), $browser_language_prefix: (r2 = us(), "string" == typeof r2 ? r2.split("-")[0] : void 0), $screen_height: null == t ? void 0 : t.screen.height, $screen_width: null == t ? void 0 : t.screen.width, $viewport_height: null == t ? void 0 : t.innerHeight, $viewport_width: null == t ? void 0 : t.innerWidth, $lib: "web", $lib_version: c.LIB_VERSION, $insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10), $time: Date.now() / 1e3 });
|
|
1875
1875
|
}
|
|
1876
1876
|
var gs = Si("[Web Vitals]");
|
|
1877
1877
|
var _s = 9e5;
|
|
@@ -1882,24 +1882,24 @@ var PaymentKit = (() => {
|
|
|
1882
1882
|
clearTimeout(this.Tt), 0 !== this.N.metrics.length && (this._instance.capture("$web_vitals", this.N.metrics.reduce((t3, i3) => g({}, t3, { ["$web_vitals_" + i3.name + "_event"]: g({}, i3), ["$web_vitals_" + i3.name + "_value"]: i3.value }), {})), this.N = { url: void 0, metrics: [], firstMetricTimestamp: void 0 });
|
|
1883
1883
|
}, this.It = (t3) => {
|
|
1884
1884
|
var i3, e2 = null == (i3 = this._instance.sessionManager) ? void 0 : i3.checkAndGetSessionAndWindowId(true);
|
|
1885
|
-
if (
|
|
1885
|
+
if (O(e2)) gs.error("Could not read session ID. Dropping metrics!");
|
|
1886
1886
|
else {
|
|
1887
1887
|
this.N = this.N || { url: void 0, metrics: [], firstMetricTimestamp: void 0 };
|
|
1888
1888
|
var r2 = this.Ct();
|
|
1889
|
-
if (!
|
|
1889
|
+
if (!O(r2)) if (D(null == t3 ? void 0 : t3.name) || D(null == t3 ? void 0 : t3.value)) gs.error("Invalid metric received", t3);
|
|
1890
1890
|
else if (this.Rt && t3.value >= this.Rt) gs.error("Ignoring metric with value >= " + this.Rt, t3);
|
|
1891
|
-
else this.N.url !== r2 && (this.Pt(), this.Tt = setTimeout(this.Pt, this.flushToCaptureTimeoutMs)),
|
|
1891
|
+
else this.N.url !== r2 && (this.Pt(), this.Tt = setTimeout(this.Pt, this.flushToCaptureTimeoutMs)), O(this.N.url) && (this.N.url = r2), this.N.firstMetricTimestamp = O(this.N.firstMetricTimestamp) ? Date.now() : this.N.firstMetricTimestamp, t3.attribution && t3.attribution.interactionTargetElement && (t3.attribution.interactionTargetElement = void 0), this.N.metrics.push(g({}, t3, { $current_url: r2, $session_id: e2.sessionId, $window_id: e2.windowId, timestamp: Date.now() })), this.N.metrics.length === this.allowedMetrics.length && this.Pt();
|
|
1892
1892
|
}
|
|
1893
1893
|
}, this.rt = () => {
|
|
1894
1894
|
if (!this.P) {
|
|
1895
1895
|
var t3, i3, e2, r2, s2 = v.__PosthogExtensions__;
|
|
1896
|
-
|
|
1896
|
+
O(s2) || O(s2.postHogWebVitalsCallbacks) || ({ onLCP: t3, onCLS: i3, onFCP: e2, onINP: r2 } = s2.postHogWebVitalsCallbacks), t3 && i3 && e2 && r2 ? (this.allowedMetrics.indexOf("LCP") > -1 && t3(this.It.bind(this)), this.allowedMetrics.indexOf("CLS") > -1 && i3(this.It.bind(this)), this.allowedMetrics.indexOf("FCP") > -1 && e2(this.It.bind(this)), this.allowedMetrics.indexOf("INP") > -1 && r2(this.It.bind(this)), this.P = true) : gs.error("web vitals callbacks not loaded - not starting");
|
|
1897
1897
|
}
|
|
1898
1898
|
}, this._instance = t2, this.kt = !(null == (i2 = this._instance.persistence) || !i2.props[Yi]), this.startIfEnabled();
|
|
1899
1899
|
}
|
|
1900
1900
|
get allowedMetrics() {
|
|
1901
1901
|
var t2, i2, e2 = R(this._instance.config.capture_performance) ? null == (t2 = this._instance.config.capture_performance) ? void 0 : t2.web_vitals_allowed_metrics : void 0;
|
|
1902
|
-
return
|
|
1902
|
+
return D(e2) ? (null == (i2 = this._instance.persistence) ? void 0 : i2.props[Zi]) || ["CLS", "FCP", "INP", "LCP"] : e2;
|
|
1903
1903
|
}
|
|
1904
1904
|
get flushToCaptureTimeoutMs() {
|
|
1905
1905
|
return (R(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_delayed_flush_ms : void 0) || 5e3;
|
|
@@ -1944,8 +1944,8 @@ var PaymentKit = (() => {
|
|
|
1944
1944
|
gs.error("Could not determine current URL");
|
|
1945
1945
|
}
|
|
1946
1946
|
};
|
|
1947
|
-
var
|
|
1948
|
-
function
|
|
1947
|
+
var bs = Si("[Heatmaps]");
|
|
1948
|
+
function ys(t2) {
|
|
1949
1949
|
return R(t2) && "clientX" in t2 && "clientY" in t2 && L(t2.clientX) && L(t2.clientY);
|
|
1950
1950
|
}
|
|
1951
1951
|
var ws = class {
|
|
@@ -1958,12 +1958,12 @@ var PaymentKit = (() => {
|
|
|
1958
1958
|
return R(this.instance.config.capture_heatmaps) && this.instance.config.capture_heatmaps.flush_interval_milliseconds && (t2 = this.instance.config.capture_heatmaps.flush_interval_milliseconds), t2;
|
|
1959
1959
|
}
|
|
1960
1960
|
get isEnabled() {
|
|
1961
|
-
return
|
|
1961
|
+
return D(this.instance.config.capture_heatmaps) ? D(this.instance.config.enable_heatmaps) ? this.kt : this.instance.config.enable_heatmaps : false !== this.instance.config.capture_heatmaps;
|
|
1962
1962
|
}
|
|
1963
1963
|
startIfEnabled() {
|
|
1964
1964
|
if (this.isEnabled) {
|
|
1965
1965
|
if (this.P) return;
|
|
1966
|
-
|
|
1966
|
+
bs.info("starting..."), this.Ot(), this.Mt();
|
|
1967
1967
|
} else {
|
|
1968
1968
|
var t2;
|
|
1969
1969
|
clearInterval(null !== (t2 = this.Ft) && void 0 !== t2 ? t2 : void 0), this.At(), this.getAndClearBuffer();
|
|
@@ -1977,16 +1977,16 @@ var PaymentKit = (() => {
|
|
|
1977
1977
|
var t2 = this.N;
|
|
1978
1978
|
return this.N = void 0, t2;
|
|
1979
1979
|
}
|
|
1980
|
-
|
|
1981
|
-
this.
|
|
1980
|
+
jt(t2) {
|
|
1981
|
+
this.Dt(t2.originalEvent, "deadclick");
|
|
1982
1982
|
}
|
|
1983
|
-
|
|
1983
|
+
Mt() {
|
|
1984
1984
|
this.Ft && clearInterval(this.Ft), this.Ft = function(t2) {
|
|
1985
1985
|
return "visible" === (null == t2 ? void 0 : t2.visibilityState);
|
|
1986
1986
|
}(o) ? setInterval(this.Lt.bind(this), this.flushIntervalMilliseconds) : null;
|
|
1987
1987
|
}
|
|
1988
|
-
|
|
1989
|
-
t && o && (this.Nt = this.Lt.bind(this), zi(t, "beforeunload", this.Nt), this.Ut = (i2) => this.
|
|
1988
|
+
Ot() {
|
|
1989
|
+
t && o && (this.Nt = this.Lt.bind(this), zi(t, "beforeunload", this.Nt), this.Ut = (i2) => this.Dt(i2 || (null == t ? void 0 : t.event)), zi(o, "click", this.Ut, { capture: true }), this.zt = (i2) => this.Ht(i2 || (null == t ? void 0 : t.event)), zi(o, "mousemove", this.zt, { capture: true }), this.Bt = new Lr(this.instance, jr, this.jt.bind(this)), this.Bt.startIfEnabled(), this.qt = this.Mt.bind(this), zi(o, "visibilitychange", this.qt), this.P = true);
|
|
1990
1990
|
}
|
|
1991
1991
|
At() {
|
|
1992
1992
|
var i2;
|
|
@@ -1997,21 +1997,21 @@ var PaymentKit = (() => {
|
|
|
1997
1997
|
for (var s3 = i3; s3 && we(s3) && !xe(s3, "body"); ) {
|
|
1998
1998
|
if (s3 === r3) return false;
|
|
1999
1999
|
if (w(e3, null == t ? void 0 : t.getComputedStyle(s3).position)) return true;
|
|
2000
|
-
s3 =
|
|
2000
|
+
s3 = Oe(s3);
|
|
2001
2001
|
}
|
|
2002
2002
|
return false;
|
|
2003
2003
|
}(Ce(i2), ["fixed", "sticky"], n2);
|
|
2004
2004
|
return { x: i2.clientX + (o2 ? 0 : s2), y: i2.clientY + (o2 ? 0 : r2), target_fixed: o2, type: e2 };
|
|
2005
2005
|
}
|
|
2006
|
-
|
|
2006
|
+
Dt(t2, i2) {
|
|
2007
2007
|
var e2;
|
|
2008
|
-
if (void 0 === i2 && (i2 = "click"), !
|
|
2008
|
+
if (void 0 === i2 && (i2 = "click"), !ye(t2.target) && ys(t2)) {
|
|
2009
2009
|
var r2 = this.Gt(t2, i2);
|
|
2010
2010
|
null != (e2 = this.rageclicks) && e2.isRageClick(t2.clientX, t2.clientY, (/* @__PURE__ */ new Date()).getTime()) && this.Vt(g({}, r2, { type: "rageclick" })), this.Vt(r2);
|
|
2011
2011
|
}
|
|
2012
2012
|
}
|
|
2013
2013
|
Ht(t2) {
|
|
2014
|
-
!
|
|
2014
|
+
!ye(t2.target) && ys(t2) && (clearTimeout(this.Wt), this.Wt = setTimeout(() => {
|
|
2015
2015
|
this.Vt(this.Gt(t2, "mousemove"));
|
|
2016
2016
|
}, 500));
|
|
2017
2017
|
}
|
|
@@ -2057,7 +2057,7 @@ var PaymentKit = (() => {
|
|
|
2057
2057
|
var r2 = { $pageview_id: i2, $prev_pageview_id: e2.pageViewId }, s2 = this._instance.scrollManager.getContext();
|
|
2058
2058
|
if (s2 && !this._instance.config.disable_scroll_properties) {
|
|
2059
2059
|
var { maxScrollHeight: n2, lastScrollY: o2, maxScrollY: a2, maxContentHeight: l2, lastContentY: u2, maxContentY: h2 } = s2;
|
|
2060
|
-
if (!(
|
|
2060
|
+
if (!(O(n2) || O(o2) || O(a2) || O(l2) || O(u2) || O(h2))) {
|
|
2061
2061
|
n2 = Math.ceil(n2), o2 = Math.ceil(o2), a2 = Math.ceil(a2), l2 = Math.ceil(l2), u2 = Math.ceil(u2), h2 = Math.ceil(h2);
|
|
2062
2062
|
var d2 = n2 <= 1 ? 1 : K(o2 / n2, 0, 1, $i), v2 = n2 <= 1 ? 1 : K(a2 / n2, 0, 1, $i), c2 = l2 <= 1 ? 1 : K(u2 / l2, 0, 1, $i), f2 = l2 <= 1 ? 1 : K(h2 / l2, 0, 1, $i);
|
|
2063
2063
|
r2 = Ri(r2, { $prev_pageview_last_scroll: o2, $prev_pageview_last_scroll_percentage: d2, $prev_pageview_max_scroll: a2, $prev_pageview_max_scroll_percentage: v2, $prev_pageview_last_content: u2, $prev_pageview_last_content_percentage: c2, $prev_pageview_max_content: h2, $prev_pageview_max_content_percentage: f2 });
|
|
@@ -2082,17 +2082,17 @@ var PaymentKit = (() => {
|
|
|
2082
2082
|
return [e2, s2];
|
|
2083
2083
|
};
|
|
2084
2084
|
var Fs = Rs(Ts, 2);
|
|
2085
|
-
var
|
|
2086
|
-
var
|
|
2087
|
-
|
|
2088
|
-
for (As = Rs(Is, 0)[1],
|
|
2089
|
-
Ls = (43690 &
|
|
2090
|
-
Ls = (61680 & (Ls = (52428 & Ls) >>> 2 | (13107 & Ls) << 2)) >>> 4 | (3855 & Ls) << 4, Ds
|
|
2085
|
+
var Os = Fs[0];
|
|
2086
|
+
var Ms = Fs[1];
|
|
2087
|
+
Os[28] = 258, Ms[258] = 28;
|
|
2088
|
+
for (As = Rs(Is, 0)[1], js = new ks(32768), Ds = 0; Ds < 32768; ++Ds) {
|
|
2089
|
+
Ls = (43690 & Ds) >>> 1 | (21845 & Ds) << 1;
|
|
2090
|
+
Ls = (61680 & (Ls = (52428 & Ls) >>> 2 | (13107 & Ls) << 2)) >>> 4 | (3855 & Ls) << 4, js[Ds] = ((65280 & Ls) >>> 8 | (255 & Ls) << 8) >>> 1;
|
|
2091
2091
|
}
|
|
2092
2092
|
var Ls;
|
|
2093
2093
|
var As;
|
|
2094
|
-
var Ds;
|
|
2095
2094
|
var js;
|
|
2095
|
+
var Ds;
|
|
2096
2096
|
var Ns = function(t2, i2, e2) {
|
|
2097
2097
|
for (var r2 = t2.length, s2 = 0, n2 = new ks(i2); s2 < r2; ++s2) ++n2[t2[s2] - 1];
|
|
2098
2098
|
var o2, a2 = new ks(i2);
|
|
@@ -2100,17 +2100,17 @@ var PaymentKit = (() => {
|
|
|
2100
2100
|
if (e2) {
|
|
2101
2101
|
o2 = new ks(1 << i2);
|
|
2102
2102
|
var l2 = 15 - i2;
|
|
2103
|
-
for (s2 = 0; s2 < r2; ++s2) if (t2[s2]) for (var u2 = s2 << 4 | t2[s2], h2 = i2 - t2[s2], d2 = a2[t2[s2] - 1]++ << h2, v2 = d2 | (1 << h2) - 1; d2 <= v2; ++d2) o2[
|
|
2104
|
-
} else for (o2 = new ks(r2), s2 = 0; s2 < r2; ++s2) o2[s2] =
|
|
2103
|
+
for (s2 = 0; s2 < r2; ++s2) if (t2[s2]) for (var u2 = s2 << 4 | t2[s2], h2 = i2 - t2[s2], d2 = a2[t2[s2] - 1]++ << h2, v2 = d2 | (1 << h2) - 1; d2 <= v2; ++d2) o2[js[d2] >>> l2] = u2;
|
|
2104
|
+
} else for (o2 = new ks(r2), s2 = 0; s2 < r2; ++s2) o2[s2] = js[a2[t2[s2] - 1]++] >>> 15 - t2[s2];
|
|
2105
2105
|
return o2;
|
|
2106
2106
|
};
|
|
2107
2107
|
var Us = new Ss(288);
|
|
2108
|
-
for (
|
|
2109
|
-
for (
|
|
2110
|
-
for (
|
|
2111
|
-
for (
|
|
2108
|
+
for (Ds = 0; Ds < 144; ++Ds) Us[Ds] = 8;
|
|
2109
|
+
for (Ds = 144; Ds < 256; ++Ds) Us[Ds] = 9;
|
|
2110
|
+
for (Ds = 256; Ds < 280; ++Ds) Us[Ds] = 7;
|
|
2111
|
+
for (Ds = 280; Ds < 288; ++Ds) Us[Ds] = 8;
|
|
2112
2112
|
var zs = new Ss(32);
|
|
2113
|
-
for (
|
|
2113
|
+
for (Ds = 0; Ds < 32; ++Ds) zs[Ds] = 5;
|
|
2114
2114
|
var Hs = Ns(Us, 9, 0);
|
|
2115
2115
|
var Bs = Ns(zs, 5, 0);
|
|
2116
2116
|
var qs = function(t2) {
|
|
@@ -2158,12 +2158,12 @@ var PaymentKit = (() => {
|
|
|
2158
2158
|
p2 += _2 - (1 << f2 - c2[m2]), c2[m2] = i2;
|
|
2159
2159
|
}
|
|
2160
2160
|
for (p2 >>>= g2; p2 > 0; ) {
|
|
2161
|
-
var
|
|
2162
|
-
c2[
|
|
2161
|
+
var b2 = n2[r2].s;
|
|
2162
|
+
c2[b2] < i2 ? p2 -= 1 << i2 - c2[b2]++ - 1 : ++r2;
|
|
2163
2163
|
}
|
|
2164
2164
|
for (; r2 >= 0 && p2; --r2) {
|
|
2165
|
-
var
|
|
2166
|
-
c2[
|
|
2165
|
+
var y2 = n2[r2].s;
|
|
2166
|
+
c2[y2] == i2 && (--c2[y2], ++p2);
|
|
2167
2167
|
}
|
|
2168
2168
|
f2 = i2;
|
|
2169
2169
|
}
|
|
@@ -2202,30 +2202,30 @@ var PaymentKit = (() => {
|
|
|
2202
2202
|
};
|
|
2203
2203
|
var Zs = function(t2, i2, e2, r2, s2, n2, o2, a2, l2, u2, h2) {
|
|
2204
2204
|
Gs(i2, h2++, e2), ++s2[256];
|
|
2205
|
-
for (var d2 = Js(s2, 15), v2 = d2[0], c2 = d2[1], f2 = Js(n2, 15), p2 = f2[0], g2 = f2[1], _2 = Ys(v2), m2 = _2[0],
|
|
2205
|
+
for (var d2 = Js(s2, 15), v2 = d2[0], c2 = d2[1], f2 = Js(n2, 15), p2 = f2[0], g2 = f2[1], _2 = Ys(v2), m2 = _2[0], b2 = _2[1], y2 = Ys(p2), w2 = y2[0], x2 = y2[1], E2 = new ks(19), S2 = 0; S2 < m2.length; ++S2) E2[31 & m2[S2]]++;
|
|
2206
2206
|
for (S2 = 0; S2 < w2.length; ++S2) E2[31 & w2[S2]]++;
|
|
2207
2207
|
for (var k2 = Js(E2, 7), P2 = k2[0], T2 = k2[1], I2 = 19; I2 > 4 && !P2[Cs[I2 - 1]]; --I2) ;
|
|
2208
|
-
var C2, R2, F2,
|
|
2209
|
-
if (
|
|
2210
|
-
if (Gs(i2, h2, 1 + (
|
|
2211
|
-
C2 = Ns(v2, c2, 0), R2 = v2, F2 = Ns(p2, g2, 0),
|
|
2212
|
-
var
|
|
2213
|
-
Gs(i2, h2,
|
|
2208
|
+
var C2, R2, F2, O2, M2 = u2 + 5 << 3, A2 = Xs(s2, Us) + Xs(n2, zs) + o2, j2 = Xs(s2, v2) + Xs(n2, p2) + o2 + 14 + 3 * I2 + Xs(E2, P2) + (2 * E2[16] + 3 * E2[17] + 7 * E2[18]);
|
|
2209
|
+
if (M2 <= A2 && M2 <= j2) return Qs(i2, h2, t2.subarray(l2, l2 + u2));
|
|
2210
|
+
if (Gs(i2, h2, 1 + (j2 < A2)), h2 += 2, j2 < A2) {
|
|
2211
|
+
C2 = Ns(v2, c2, 0), R2 = v2, F2 = Ns(p2, g2, 0), O2 = p2;
|
|
2212
|
+
var D2 = Ns(P2, T2, 0);
|
|
2213
|
+
Gs(i2, h2, b2 - 257), Gs(i2, h2 + 5, x2 - 1), Gs(i2, h2 + 10, I2 - 4), h2 += 14;
|
|
2214
2214
|
for (S2 = 0; S2 < I2; ++S2) Gs(i2, h2 + 3 * S2, P2[Cs[S2]]);
|
|
2215
2215
|
h2 += 3 * I2;
|
|
2216
2216
|
for (var L2 = [m2, w2], N2 = 0; N2 < 2; ++N2) {
|
|
2217
2217
|
var U2 = L2[N2];
|
|
2218
2218
|
for (S2 = 0; S2 < U2.length; ++S2) {
|
|
2219
2219
|
var z2 = 31 & U2[S2];
|
|
2220
|
-
Gs(i2, h2,
|
|
2220
|
+
Gs(i2, h2, D2[z2]), h2 += P2[z2], z2 > 15 && (Gs(i2, h2, U2[S2] >>> 5 & 127), h2 += U2[S2] >>> 12);
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
2223
|
-
} else C2 = Hs, R2 = Us, F2 = Bs,
|
|
2223
|
+
} else C2 = Hs, R2 = Us, F2 = Bs, O2 = zs;
|
|
2224
2224
|
for (S2 = 0; S2 < a2; ++S2) if (r2[S2] > 255) {
|
|
2225
2225
|
z2 = r2[S2] >>> 18 & 31;
|
|
2226
2226
|
Vs(i2, h2, C2[z2 + 257]), h2 += R2[z2 + 257], z2 > 7 && (Gs(i2, h2, r2[S2] >>> 23 & 31), h2 += Ts[z2]);
|
|
2227
2227
|
var H2 = 31 & r2[S2];
|
|
2228
|
-
Vs(i2, h2, F2[H2]), h2 +=
|
|
2228
|
+
Vs(i2, h2, F2[H2]), h2 += O2[H2], H2 > 3 && (Vs(i2, h2, r2[S2] >>> 5 & 8191), h2 += Is[H2]);
|
|
2229
2229
|
} else Vs(i2, h2, C2[r2[S2]]), h2 += R2[r2[S2]];
|
|
2230
2230
|
return Vs(i2, h2, C2[256]), h2 + R2[256];
|
|
2231
2231
|
};
|
|
@@ -2245,35 +2245,35 @@ var PaymentKit = (() => {
|
|
|
2245
2245
|
d2 < o2 ? u2 = Qs(l2, u2, t3.subarray(h2, d2)) : (l2[h2] = n2, u2 = Qs(l2, u2, t3.subarray(h2, o2)));
|
|
2246
2246
|
}
|
|
2247
2247
|
else {
|
|
2248
|
-
for (var v2 = tn[i3 - 1], c2 = v2 >>> 13, f2 = 8191 & v2, p2 = (1 << e3) - 1, g2 = new ks(32768), _2 = new ks(p2 + 1), m2 = Math.ceil(e3 / 3),
|
|
2249
|
-
return (t3[i4] ^ t3[i4 + 1] << m2 ^ t3[i4 + 2] <<
|
|
2248
|
+
for (var v2 = tn[i3 - 1], c2 = v2 >>> 13, f2 = 8191 & v2, p2 = (1 << e3) - 1, g2 = new ks(32768), _2 = new ks(p2 + 1), m2 = Math.ceil(e3 / 3), b2 = 2 * m2, y2 = function(i4) {
|
|
2249
|
+
return (t3[i4] ^ t3[i4 + 1] << m2 ^ t3[i4 + 2] << b2) & p2;
|
|
2250
2250
|
}, w2 = new Ps(25e3), x2 = new ks(288), E2 = new ks(32), S2 = 0, k2 = 0, P2 = (h2 = 0, 0), T2 = 0, I2 = 0; h2 < o2; ++h2) {
|
|
2251
|
-
var C2 =
|
|
2251
|
+
var C2 = y2(h2), R2 = 32767 & h2, F2 = _2[C2];
|
|
2252
2252
|
if (g2[R2] = F2, _2[C2] = R2, T2 <= h2) {
|
|
2253
|
-
var
|
|
2254
|
-
if ((S2 > 7e3 || P2 > 24576) &&
|
|
2253
|
+
var O2 = o2 - h2;
|
|
2254
|
+
if ((S2 > 7e3 || P2 > 24576) && O2 > 423) {
|
|
2255
2255
|
u2 = Zs(t3, l2, 0, w2, x2, E2, k2, P2, I2, h2 - I2, u2), P2 = S2 = k2 = 0, I2 = h2;
|
|
2256
|
-
for (var
|
|
2257
|
-
for (
|
|
2256
|
+
for (var M2 = 0; M2 < 286; ++M2) x2[M2] = 0;
|
|
2257
|
+
for (M2 = 0; M2 < 30; ++M2) E2[M2] = 0;
|
|
2258
2258
|
}
|
|
2259
|
-
var A2 = 2,
|
|
2260
|
-
if (
|
|
2259
|
+
var A2 = 2, j2 = 0, D2 = f2, L2 = R2 - F2 & 32767;
|
|
2260
|
+
if (O2 > 2 && C2 == y2(h2 - L2)) for (var N2 = Math.min(c2, O2) - 1, U2 = Math.min(32767, h2), z2 = Math.min(258, O2); L2 <= U2 && --D2 && R2 != F2; ) {
|
|
2261
2261
|
if (t3[h2 + A2] == t3[h2 + A2 - L2]) {
|
|
2262
2262
|
for (var H2 = 0; H2 < z2 && t3[h2 + H2] == t3[h2 + H2 - L2]; ++H2) ;
|
|
2263
2263
|
if (H2 > A2) {
|
|
2264
|
-
if (A2 = H2,
|
|
2264
|
+
if (A2 = H2, j2 = L2, H2 > N2) break;
|
|
2265
2265
|
var B2 = Math.min(L2, H2 - 2), q2 = 0;
|
|
2266
|
-
for (
|
|
2267
|
-
var W2 = h2 - L2 +
|
|
2266
|
+
for (M2 = 0; M2 < B2; ++M2) {
|
|
2267
|
+
var W2 = h2 - L2 + M2 + 32768 & 32767, G2 = W2 - g2[W2] + 32768 & 32767;
|
|
2268
2268
|
G2 > q2 && (q2 = G2, F2 = W2);
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
}
|
|
2272
2272
|
L2 += (R2 = F2) - (F2 = g2[R2]) + 32768 & 32767;
|
|
2273
2273
|
}
|
|
2274
|
-
if (
|
|
2275
|
-
w2[P2++] = 268435456 |
|
|
2276
|
-
var V2 = 31 &
|
|
2274
|
+
if (j2) {
|
|
2275
|
+
w2[P2++] = 268435456 | Ms[A2] << 18 | As[j2];
|
|
2276
|
+
var V2 = 31 & Ms[A2], J2 = 31 & As[j2];
|
|
2277
2277
|
k2 += Ts[V2] + Is[J2], ++x2[257 + V2], ++E2[J2], T2 = h2 + A2, ++S2;
|
|
2278
2278
|
} else w2[P2++] = t3[h2], ++x2[t3[h2]];
|
|
2279
2279
|
}
|
|
@@ -2311,7 +2311,7 @@ var PaymentKit = (() => {
|
|
|
2311
2311
|
var i2, e2, r2, s2, n2 = "";
|
|
2312
2312
|
for (i2 = e2 = 0, r2 = (t2 = (t2 + "").replace(/\r\n/g, "\n").replace(/\r/g, "\n")).length, s2 = 0; s2 < r2; s2++) {
|
|
2313
2313
|
var o2 = t2.charCodeAt(s2), a2 = null;
|
|
2314
|
-
o2 < 128 ? e2++ : a2 = o2 > 127 && o2 < 2048 ? String.fromCharCode(o2 >> 6 | 192, 63 & o2 | 128) : String.fromCharCode(o2 >> 12 | 224, o2 >> 6 & 63 | 128, 63 & o2 | 128),
|
|
2314
|
+
o2 < 128 ? e2++ : a2 = o2 > 127 && o2 < 2048 ? String.fromCharCode(o2 >> 6 | 192, 63 & o2 | 128) : String.fromCharCode(o2 >> 12 | 224, o2 >> 6 & 63 | 128, 63 & o2 | 128), j(a2) || (e2 > i2 && (n2 += t2.substring(i2, e2)), n2 += a2, i2 = e2 = s2 + 1);
|
|
2315
2315
|
}
|
|
2316
2316
|
return e2 > i2 && (n2 += t2.substring(i2, t2.length)), n2;
|
|
2317
2317
|
};
|
|
@@ -2446,16 +2446,16 @@ var PaymentKit = (() => {
|
|
|
2446
2446
|
function _n(t2, i2) {
|
|
2447
2447
|
return !t2 || Object.entries(t2).every((t3) => {
|
|
2448
2448
|
var [e2, r2] = t3, s2 = null == i2 ? void 0 : i2[e2];
|
|
2449
|
-
if (
|
|
2449
|
+
if (O(s2) || j(s2)) return false;
|
|
2450
2450
|
var n2 = [String(s2)], o2 = pn[r2.operator];
|
|
2451
2451
|
return !!o2 && o2(r2.values, n2);
|
|
2452
2452
|
});
|
|
2453
2453
|
}
|
|
2454
2454
|
var mn = Si("[Error tracking]");
|
|
2455
|
-
var
|
|
2455
|
+
var bn = class {
|
|
2456
2456
|
constructor(t2) {
|
|
2457
2457
|
var i2, e2;
|
|
2458
|
-
this.Zt = [], this.ti = new Qt([new vi(), new xi(), new fi(), new ci(), new
|
|
2458
|
+
this.Zt = [], this.ti = new Qt([new vi(), new xi(), new fi(), new ci(), new yi(), new bi(), new gi(), new wi()], di()), this._instance = t2, this.Zt = null !== (i2 = null == (e2 = this._instance.persistence) ? void 0 : e2.get_property(Ji)) && void 0 !== i2 ? i2 : [];
|
|
2459
2459
|
}
|
|
2460
2460
|
onRemoteConfig(t2) {
|
|
2461
2461
|
var i2, e2, r2, s2 = null !== (i2 = null == (e2 = t2.errorTracking) ? void 0 : e2.suppressionRules) && void 0 !== i2 ? i2 : [], n2 = null == (r2 = t2.errorTracking) ? void 0 : r2.captureExtensionExceptions;
|
|
@@ -2481,7 +2481,7 @@ var PaymentKit = (() => {
|
|
|
2481
2481
|
if (0 === t2.length) return false;
|
|
2482
2482
|
var i2 = t2.reduce((t3, i3) => {
|
|
2483
2483
|
var { type: e2, value: r2 } = i3;
|
|
2484
|
-
return
|
|
2484
|
+
return M(e2) && e2.length > 0 && t3.$exception_types.push(e2), M(r2) && r2.length > 0 && t3.$exception_values.push(r2), t3;
|
|
2485
2485
|
}, { $exception_types: [], $exception_values: [] });
|
|
2486
2486
|
return this.Zt.some((t3) => {
|
|
2487
2487
|
var e2 = t3.values.map((t4) => {
|
|
@@ -2505,10 +2505,10 @@ var PaymentKit = (() => {
|
|
|
2505
2505
|
return false;
|
|
2506
2506
|
}
|
|
2507
2507
|
ei(t2) {
|
|
2508
|
-
return !
|
|
2508
|
+
return !D(t2) && I(t2);
|
|
2509
2509
|
}
|
|
2510
2510
|
};
|
|
2511
|
-
var
|
|
2511
|
+
var yn = Si("[FeatureFlags]");
|
|
2512
2512
|
var wn = Si("[FeatureFlags]", { debugEnabled: true });
|
|
2513
2513
|
var xn = "$active_feature_flags";
|
|
2514
2514
|
var En = "$override_feature_flags";
|
|
@@ -2518,7 +2518,7 @@ var PaymentKit = (() => {
|
|
|
2518
2518
|
var Pn = "$feature_flag_evaluated_at";
|
|
2519
2519
|
var Tn = (t2) => {
|
|
2520
2520
|
var i2 = {};
|
|
2521
|
-
for (var [e2, r2] of
|
|
2521
|
+
for (var [e2, r2] of Oi(t2 || {})) r2 && (i2[e2] = r2);
|
|
2522
2522
|
return i2;
|
|
2523
2523
|
};
|
|
2524
2524
|
var In = (t2) => {
|
|
@@ -2532,7 +2532,7 @@ var PaymentKit = (() => {
|
|
|
2532
2532
|
}).map((t3) => {
|
|
2533
2533
|
var e2;
|
|
2534
2534
|
return [t3, null == (e2 = i2[t3].metadata) ? void 0 : e2.payload];
|
|
2535
|
-
}))) :
|
|
2535
|
+
}))) : yn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"), t2;
|
|
2536
2536
|
};
|
|
2537
2537
|
var Cn = function(t2) {
|
|
2538
2538
|
return t2.FeatureFlags = "feature_flags", t2.Recordings = "recordings", t2;
|
|
@@ -2543,9 +2543,9 @@ var PaymentKit = (() => {
|
|
|
2543
2543
|
}
|
|
2544
2544
|
fi() {
|
|
2545
2545
|
var t2, i2 = null !== (t2 = this._instance.config.evaluation_contexts) && void 0 !== t2 ? t2 : this._instance.config.evaluation_environments;
|
|
2546
|
-
return !this._instance.config.evaluation_environments || this._instance.config.evaluation_contexts || this.ci || (
|
|
2546
|
+
return !this._instance.config.evaluation_environments || this._instance.config.evaluation_contexts || this.ci || (yn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."), this.ci = true), null != i2 && i2.length ? i2.filter((t3) => {
|
|
2547
2547
|
var i3 = t3 && "string" == typeof t3 && t3.trim().length > 0;
|
|
2548
|
-
return i3 ||
|
|
2548
|
+
return i3 || yn.error("Invalid evaluation context found:", t3, "Expected non-empty string"), i3;
|
|
2549
2549
|
}) : [];
|
|
2550
2550
|
}
|
|
2551
2551
|
pi() {
|
|
@@ -2569,30 +2569,30 @@ var PaymentKit = (() => {
|
|
|
2569
2569
|
if (!e2 && !i2) return t2 || {};
|
|
2570
2570
|
var r2 = Ri({}, t2 || {}), s2 = [.../* @__PURE__ */ new Set([...Object.keys(e2 || {}), ...Object.keys(i2 || {})])];
|
|
2571
2571
|
for (var n2 of s2) {
|
|
2572
|
-
var o2, a2, l2 = r2[n2], u2 = null == i2 ? void 0 : i2[n2], h2 =
|
|
2572
|
+
var o2, a2, l2 = r2[n2], u2 = null == i2 ? void 0 : i2[n2], h2 = O(u2) ? null !== (o2 = null == l2 ? void 0 : l2.enabled) && void 0 !== o2 && o2 : !!u2, d2 = O(u2) ? l2.variant : "string" == typeof u2 ? u2 : void 0, v2 = null == e2 ? void 0 : e2[n2], c2 = g({}, l2, { enabled: h2, variant: h2 ? null != d2 ? d2 : null == l2 ? void 0 : l2.variant : void 0 });
|
|
2573
2573
|
if (h2 !== (null == l2 ? void 0 : l2.enabled) && (c2.original_enabled = null == l2 ? void 0 : l2.enabled), d2 !== (null == l2 ? void 0 : l2.variant) && (c2.original_variant = null == l2 ? void 0 : l2.variant), v2) c2.metadata = g({}, null == l2 ? void 0 : l2.metadata, { payload: v2, original_payload: null == l2 || null == (a2 = l2.metadata) ? void 0 : a2.payload });
|
|
2574
2574
|
r2[n2] = c2;
|
|
2575
2575
|
}
|
|
2576
|
-
return this.oi || (
|
|
2576
|
+
return this.oi || (yn.warn(" Overriding feature flag details!", { flagDetails: t2, overriddenPayloads: e2, finalDetails: r2 }), this.oi = true), r2;
|
|
2577
2577
|
}
|
|
2578
2578
|
getFlagVariants() {
|
|
2579
2579
|
var t2 = this._instance.get_property(re), i2 = this._instance.get_property(En);
|
|
2580
2580
|
if (!i2) return t2 || {};
|
|
2581
2581
|
for (var e2 = Ri({}, t2), r2 = Object.keys(i2), s2 = 0; s2 < r2.length; s2++) e2[r2[s2]] = i2[r2[s2]];
|
|
2582
|
-
return this.oi || (
|
|
2582
|
+
return this.oi || (yn.warn(" Overriding feature flags!", { enabledFlags: t2, overriddenFlags: i2, finalFlags: e2 }), this.oi = true), e2;
|
|
2583
2583
|
}
|
|
2584
2584
|
getFlagPayloads() {
|
|
2585
2585
|
var t2 = this._instance.get_property($n), i2 = this._instance.get_property(Sn);
|
|
2586
2586
|
if (!i2) return t2 || {};
|
|
2587
2587
|
for (var e2 = Ri({}, t2 || {}), r2 = Object.keys(i2), s2 = 0; s2 < r2.length; s2++) e2[r2[s2]] = i2[r2[s2]];
|
|
2588
|
-
return this.oi || (
|
|
2588
|
+
return this.oi || (yn.warn(" Overriding feature flag payloads!", { flagPayloads: t2, overriddenPayloads: i2, finalPayloads: e2 }), this.oi = true), e2;
|
|
2589
2589
|
}
|
|
2590
2590
|
reloadFeatureFlags() {
|
|
2591
2591
|
this.ui || this._instance.config.advanced_disable_feature_flags || this.gi || (this.gi = setTimeout(() => {
|
|
2592
2592
|
this.mi();
|
|
2593
2593
|
}, 5));
|
|
2594
2594
|
}
|
|
2595
|
-
|
|
2595
|
+
bi() {
|
|
2596
2596
|
clearTimeout(this.gi), this.gi = void 0;
|
|
2597
2597
|
}
|
|
2598
2598
|
ensureFlagsLoaded() {
|
|
@@ -2606,15 +2606,15 @@ var PaymentKit = (() => {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
mi(t2) {
|
|
2608
2608
|
var i2;
|
|
2609
|
-
if (this.
|
|
2609
|
+
if (this.bi(), !this._instance.M()) if (this.li) this.hi = true;
|
|
2610
2610
|
else {
|
|
2611
2611
|
var e2 = this._instance.config.token, r2 = this._instance.get_property("$device_id"), s2 = { token: e2, distinct_id: this._instance.get_distinct_id(), groups: this._instance.getGroups(), $anon_distinct_id: this.$anon_distinct_id, person_properties: g({}, (null == (i2 = this._instance.persistence) ? void 0 : i2.get_initial_props()) || {}, this._instance.get_property(oe) || {}), group_properties: this._instance.get_property(ae) };
|
|
2612
|
-
|
|
2612
|
+
j(r2) || O(r2) || (s2.$device_id = r2), (null != t2 && t2.disableFlags || this._instance.config.advanced_disable_feature_flags) && (s2.disable_flags = true), this.pi() && (s2.evaluation_contexts = this.fi());
|
|
2613
2613
|
var n2 = this._instance.config.__preview_remote_config, o2 = n2 ? "/flags/?v=2" : "/flags/?v=2&config=true", a2 = this._instance.config.advanced_only_evaluate_survey_feature_flags ? "&only_evaluate_survey_feature_flags=true" : "", l2 = this._instance.requestRouter.endpointFor("flags", o2 + a2);
|
|
2614
2614
|
n2 && (s2.timezone = cs()), this.li = true, this._instance._send_request({ method: "POST", url: l2, data: s2, compression: this._instance.config.disable_compression ? void 0 : $s.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (t3) => {
|
|
2615
2615
|
var i3, e3, r3 = true;
|
|
2616
|
-
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.
|
|
2617
|
-
if (!s2.disable_flags || this.hi) if (this.vi = !r3, t3.json && null != (i3 = t3.json.quotaLimited) && i3.includes(Cn.FeatureFlags))
|
|
2616
|
+
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.yi(null !== (e3 = t3.json) && void 0 !== e3 ? e3 : {}));
|
|
2617
|
+
if (!s2.disable_flags || this.hi) if (this.vi = !r3, t3.json && null != (i3 = t3.json.quotaLimited) && i3.includes(Cn.FeatureFlags)) yn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");
|
|
2618
2618
|
else {
|
|
2619
2619
|
var n3;
|
|
2620
2620
|
if (!s2.disable_flags) this.receivedFeatureFlags(null !== (n3 = t3.json) && void 0 !== n3 ? n3 : {}, r3);
|
|
@@ -2629,7 +2629,7 @@ var PaymentKit = (() => {
|
|
|
2629
2629
|
var r2 = this.getFeatureFlagResult(t2, i2);
|
|
2630
2630
|
return null !== (e2 = null == r2 ? void 0 : r2.variant) && void 0 !== e2 ? e2 : null == r2 ? void 0 : r2.enabled;
|
|
2631
2631
|
}
|
|
2632
|
-
|
|
2632
|
+
yn.warn('getFeatureFlag for key "' + t2 + `" failed. Feature flags didn't load in time.`);
|
|
2633
2633
|
}
|
|
2634
2634
|
getFeatureFlagDetails(t2) {
|
|
2635
2635
|
return this.getFlagsWithDetails()[t2];
|
|
@@ -2644,21 +2644,21 @@ var PaymentKit = (() => {
|
|
|
2644
2644
|
if ((i2.send_event || !("send_event" in i2)) && (!(t2 in u2) || !u2[t2].includes(o2))) {
|
|
2645
2645
|
var h2, d2, v2, c2, f2, p2, g2, _2, m2;
|
|
2646
2646
|
I(u2[t2]) ? u2[t2].push(o2) : u2[t2] = [o2], null == (h2 = this._instance.persistence) || h2.register({ [ue]: u2 });
|
|
2647
|
-
var
|
|
2648
|
-
|
|
2649
|
-
var w2, x2 = null !== (f2 = null ==
|
|
2650
|
-
if (x2 && (
|
|
2651
|
-
this._instance.capture("$feature_flag_called",
|
|
2647
|
+
var b2 = this.getFeatureFlagDetails(t2), y2 = { $feature_flag: t2, $feature_flag_response: s2, $feature_flag_payload: n2 || null, $feature_flag_request_id: a2, $feature_flag_evaluated_at: l2, $feature_flag_bootstrapped_response: (null == (d2 = this._instance.config.bootstrap) || null == (d2 = d2.featureFlags) ? void 0 : d2[t2]) || null, $feature_flag_bootstrapped_payload: (null == (v2 = this._instance.config.bootstrap) || null == (v2 = v2.featureFlagPayloads) ? void 0 : v2[t2]) || null, $used_bootstrap_value: !this.vi };
|
|
2648
|
+
O(null == b2 || null == (c2 = b2.metadata) ? void 0 : c2.version) || (y2.$feature_flag_version = b2.metadata.version);
|
|
2649
|
+
var w2, x2 = null !== (f2 = null == b2 || null == (p2 = b2.reason) ? void 0 : p2.description) && void 0 !== f2 ? f2 : null == b2 || null == (g2 = b2.reason) ? void 0 : g2.code;
|
|
2650
|
+
if (x2 && (y2.$feature_flag_reason = x2), null != b2 && null != (_2 = b2.metadata) && _2.id && (y2.$feature_flag_id = b2.metadata.id), O(null == b2 ? void 0 : b2.original_variant) && O(null == b2 ? void 0 : b2.original_enabled) || (y2.$feature_flag_original_response = O(b2.original_variant) ? b2.original_enabled : b2.original_variant), null != b2 && null != (m2 = b2.metadata) && m2.original_payload) y2.$feature_flag_original_payload = null == b2 || null == (w2 = b2.metadata) ? void 0 : w2.original_payload;
|
|
2651
|
+
this._instance.capture("$feature_flag_called", y2);
|
|
2652
2652
|
}
|
|
2653
2653
|
if (r2) {
|
|
2654
2654
|
var E2 = n2;
|
|
2655
|
-
if (!
|
|
2655
|
+
if (!O(n2)) try {
|
|
2656
2656
|
E2 = JSON.parse(n2);
|
|
2657
2657
|
} catch (t3) {
|
|
2658
2658
|
}
|
|
2659
2659
|
return { key: t2, enabled: !!s2, variant: "string" == typeof s2 ? s2 : void 0, payload: E2 };
|
|
2660
2660
|
}
|
|
2661
|
-
} else
|
|
2661
|
+
} else yn.warn('getFeatureFlagResult for key "' + t2 + `" failed. Feature flags didn't load in time.`);
|
|
2662
2662
|
}
|
|
2663
2663
|
getRemoteConfigPayload(t2, i2) {
|
|
2664
2664
|
var e2 = this._instance.config.token, r2 = { distinct_id: this._instance.get_distinct_id(), token: e2 };
|
|
@@ -2670,9 +2670,9 @@ var PaymentKit = (() => {
|
|
|
2670
2670
|
isFeatureEnabled(t2, i2) {
|
|
2671
2671
|
if (void 0 === i2 && (i2 = {}), this.ai || this.getFlags() && this.getFlags().length > 0) {
|
|
2672
2672
|
var e2 = this.getFeatureFlag(t2, i2);
|
|
2673
|
-
return
|
|
2673
|
+
return O(e2) ? void 0 : !!e2;
|
|
2674
2674
|
}
|
|
2675
|
-
|
|
2675
|
+
yn.warn('isFeatureEnabled for key "' + t2 + `" failed. Feature flags didn't load in time.`);
|
|
2676
2676
|
}
|
|
2677
2677
|
addFeatureFlagsHandler(t2) {
|
|
2678
2678
|
this.featureFlagEventHandlers.push(t2);
|
|
@@ -2690,23 +2690,39 @@ var PaymentKit = (() => {
|
|
|
2690
2690
|
if (a2) {
|
|
2691
2691
|
var u2 = t3.requestId, h2 = t3.evaluatedAt;
|
|
2692
2692
|
if (I(a2)) {
|
|
2693
|
-
|
|
2693
|
+
yn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");
|
|
2694
2694
|
var d2 = {};
|
|
2695
2695
|
if (a2) for (var v2 = 0; v2 < a2.length; v2++) d2[a2[v2]] = true;
|
|
2696
2696
|
i3 && i3.register({ [xn]: a2, [re]: d2 });
|
|
2697
2697
|
} else {
|
|
2698
2698
|
var c2 = a2, f2 = l2, p2 = o2;
|
|
2699
|
-
t3.errorsWhileComputingFlags
|
|
2699
|
+
if (t3.errorsWhileComputingFlags) if (o2) {
|
|
2700
|
+
var _2 = new Set(Object.keys(o2).filter((t4) => {
|
|
2701
|
+
var i4;
|
|
2702
|
+
return !(null != (i4 = o2[t4]) && i4.failed);
|
|
2703
|
+
}));
|
|
2704
|
+
c2 = g({}, e3, Object.fromEntries(Object.entries(c2).filter((t4) => {
|
|
2705
|
+
var [i4] = t4;
|
|
2706
|
+
return _2.has(i4);
|
|
2707
|
+
}))), f2 = g({}, r3, Object.fromEntries(Object.entries(f2 || {}).filter((t4) => {
|
|
2708
|
+
var [i4] = t4;
|
|
2709
|
+
return _2.has(i4);
|
|
2710
|
+
}))), p2 = g({}, s3, Object.fromEntries(Object.entries(p2 || {}).filter((t4) => {
|
|
2711
|
+
var [i4] = t4;
|
|
2712
|
+
return _2.has(i4);
|
|
2713
|
+
})));
|
|
2714
|
+
} else c2 = g({}, e3, c2), f2 = g({}, r3, f2), p2 = g({}, s3, p2);
|
|
2715
|
+
i3 && i3.register(g({ [xn]: Object.keys(Tn(c2)), [re]: c2 || {}, [$n]: f2 || {}, [ne]: p2 || {} }, u2 ? { [kn]: u2 } : {}, h2 ? { [Pn]: h2 } : {}));
|
|
2700
2716
|
}
|
|
2701
2717
|
}
|
|
2702
2718
|
}(t2, this._instance.persistence, e2, r2, s2), this.wi(i2);
|
|
2703
2719
|
}
|
|
2704
2720
|
}
|
|
2705
2721
|
override(t2, i2) {
|
|
2706
|
-
void 0 === i2 && (i2 = false),
|
|
2722
|
+
void 0 === i2 && (i2 = false), yn.warn("override is deprecated. Please use overrideFeatureFlags instead."), this.overrideFeatureFlags({ flags: t2, suppressWarning: i2 });
|
|
2707
2723
|
}
|
|
2708
2724
|
overrideFeatureFlags(t2) {
|
|
2709
|
-
if (!this._instance.__loaded || !this._instance.persistence) return
|
|
2725
|
+
if (!this._instance.__loaded || !this._instance.persistence) return yn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");
|
|
2710
2726
|
if (false === t2) return this._instance.persistence.unregister(En), this._instance.persistence.unregister(Sn), this.wi(), wn.info("All overrides cleared");
|
|
2711
2727
|
if (t2 && "object" == typeof t2 && ("flags" in t2 || "payloads" in t2)) {
|
|
2712
2728
|
var i2, e2 = t2;
|
|
@@ -2779,11 +2795,11 @@ var PaymentKit = (() => {
|
|
|
2779
2795
|
} else this._instance.unregister(ae);
|
|
2780
2796
|
}
|
|
2781
2797
|
reset() {
|
|
2782
|
-
this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.$anon_distinct_id = void 0, this.
|
|
2798
|
+
this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.$anon_distinct_id = void 0, this.bi(), this.oi = false;
|
|
2783
2799
|
}
|
|
2784
2800
|
};
|
|
2785
2801
|
var Fn = ["cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory"];
|
|
2786
|
-
var
|
|
2802
|
+
var On = class {
|
|
2787
2803
|
constructor(t2, i2) {
|
|
2788
2804
|
this.R = t2, this.props = {}, this.Ei = false, this.$i = ((t3) => {
|
|
2789
2805
|
var i3 = "";
|
|
@@ -2834,7 +2850,7 @@ var PaymentKit = (() => {
|
|
|
2834
2850
|
var t2 = {};
|
|
2835
2851
|
return Ci(this.props, function(i2, e2) {
|
|
2836
2852
|
if (e2 === re && R(i2)) for (var r2 = Object.keys(i2), n2 = 0; n2 < r2.length; n2++) t2["$feature/" + r2[n2]] = i2[r2[n2]];
|
|
2837
|
-
else a2 = e2, l2 = false, (
|
|
2853
|
+
else a2 = e2, l2 = false, (j(o2 = be) ? l2 : s && o2.indexOf === s ? -1 != o2.indexOf(a2) : (Ci(o2, function(t3) {
|
|
2838
2854
|
if (l2 || (l2 = t3 === a2)) return Ti;
|
|
2839
2855
|
}), l2)) || (t2[e2] = i2);
|
|
2840
2856
|
var o2, a2, l2;
|
|
@@ -2857,7 +2873,7 @@ var PaymentKit = (() => {
|
|
|
2857
2873
|
}
|
|
2858
2874
|
register_once(t2, i2, e2) {
|
|
2859
2875
|
if (R(t2)) {
|
|
2860
|
-
|
|
2876
|
+
O(i2) && (i2 = "None"), this.Pi = O(e2) ? this.Ci : e2;
|
|
2861
2877
|
var r2 = false;
|
|
2862
2878
|
if (Ci(t2, (t3, e3) => {
|
|
2863
2879
|
this.props.hasOwnProperty(e3) && this.props[e3] !== i2 || (this.props[e3] = t3, r2 = true);
|
|
@@ -2867,7 +2883,7 @@ var PaymentKit = (() => {
|
|
|
2867
2883
|
}
|
|
2868
2884
|
register(t2, i2) {
|
|
2869
2885
|
if (R(t2)) {
|
|
2870
|
-
this.Pi =
|
|
2886
|
+
this.Pi = O(i2) ? this.Ci : i2;
|
|
2871
2887
|
var e2 = false;
|
|
2872
2888
|
if (Ci(t2, (i3, r2) => {
|
|
2873
2889
|
t2.hasOwnProperty(r2) && this.props[r2] !== i3 && (this.props[r2] = i3, e2 = true);
|
|
@@ -2881,7 +2897,7 @@ var PaymentKit = (() => {
|
|
|
2881
2897
|
update_campaign_params() {
|
|
2882
2898
|
if (!this.Ei) {
|
|
2883
2899
|
var t2 = os(this.R.custom_campaign_params, this.R.mask_personal_data_properties, this.R.custom_personal_data_properties);
|
|
2884
|
-
F(
|
|
2900
|
+
F(ji(t2)) || this.register(t2), this.Ei = true;
|
|
2885
2901
|
}
|
|
2886
2902
|
}
|
|
2887
2903
|
update_search_keyword() {
|
|
@@ -2942,7 +2958,7 @@ var PaymentKit = (() => {
|
|
|
2942
2958
|
}
|
|
2943
2959
|
remove_event_timer(t2) {
|
|
2944
2960
|
var i2 = (this.props[qi] || {})[t2];
|
|
2945
|
-
return
|
|
2961
|
+
return O(i2) || (delete this.props[qi][t2], this.save()), i2;
|
|
2946
2962
|
}
|
|
2947
2963
|
get_property(t2) {
|
|
2948
2964
|
return this.props[t2];
|
|
@@ -2951,9 +2967,9 @@ var PaymentKit = (() => {
|
|
|
2951
2967
|
this.props[t2] = i2, this.save();
|
|
2952
2968
|
}
|
|
2953
2969
|
};
|
|
2954
|
-
var
|
|
2970
|
+
var Mn = Si("[Product Tours]");
|
|
2955
2971
|
var An = "ph_product_tours";
|
|
2956
|
-
var
|
|
2972
|
+
var jn = class {
|
|
2957
2973
|
constructor(t2) {
|
|
2958
2974
|
this.Ri = null, this.Fi = null, this._instance = t2;
|
|
2959
2975
|
}
|
|
@@ -2962,15 +2978,15 @@ var PaymentKit = (() => {
|
|
|
2962
2978
|
}
|
|
2963
2979
|
loadIfEnabled() {
|
|
2964
2980
|
var t2, i2;
|
|
2965
|
-
this.Ri || ((t2 = this._instance).config.disable_product_tours || null == (i2 = t2.persistence) || !i2.get_property(Qi)) || this.it(() => this.
|
|
2981
|
+
this.Ri || ((t2 = this._instance).config.disable_product_tours || null == (i2 = t2.persistence) || !i2.get_property(Qi)) || this.it(() => this.Oi());
|
|
2966
2982
|
}
|
|
2967
2983
|
it(t2) {
|
|
2968
2984
|
var i2, e2;
|
|
2969
2985
|
null != (i2 = v.__PosthogExtensions__) && i2.generateProductTours ? t2() : null == (e2 = v.__PosthogExtensions__) || null == e2.loadExternalDependency || e2.loadExternalDependency(this._instance, "product-tours", (i3) => {
|
|
2970
|
-
i3 ?
|
|
2986
|
+
i3 ? Mn.error("Could not load product tours script", i3) : t2();
|
|
2971
2987
|
});
|
|
2972
2988
|
}
|
|
2973
|
-
|
|
2989
|
+
Oi() {
|
|
2974
2990
|
var t2;
|
|
2975
2991
|
!this.Ri && null != (t2 = v.__PosthogExtensions__) && t2.generateProductTours && (this.Ri = v.__PosthogExtensions__.generateProductTours(this._instance, true));
|
|
2976
2992
|
}
|
|
@@ -2985,7 +3001,7 @@ var PaymentKit = (() => {
|
|
|
2985
3001
|
var r3 = i3.statusCode;
|
|
2986
3002
|
if (200 !== r3 || !i3.json) {
|
|
2987
3003
|
var s2 = "Product Tours API could not be loaded, status: " + r3;
|
|
2988
|
-
return
|
|
3004
|
+
return Mn.error(s2), void t2([], { isLoaded: false, error: s2 });
|
|
2989
3005
|
}
|
|
2990
3006
|
var n2 = I(i3.json.product_tours) ? i3.json.product_tours : [];
|
|
2991
3007
|
this.Fi = n2, e2 && e2.register({ [An]: n2 }), t2(n2, { isLoaded: true });
|
|
@@ -2993,7 +3009,7 @@ var PaymentKit = (() => {
|
|
|
2993
3009
|
} else t2(this.Fi, { isLoaded: true });
|
|
2994
3010
|
}
|
|
2995
3011
|
getActiveProductTours(t2) {
|
|
2996
|
-
|
|
3012
|
+
D(this.Ri) ? t2([], { isLoaded: false, error: "Product tours not loaded" }) : this.Ri.getActiveProductTours(t2);
|
|
2997
3013
|
}
|
|
2998
3014
|
showProductTour(t2) {
|
|
2999
3015
|
var i2;
|
|
@@ -3002,7 +3018,7 @@ var PaymentKit = (() => {
|
|
|
3002
3018
|
previewTour(t2) {
|
|
3003
3019
|
this.Ri ? this.Ri.previewTour(t2) : this.it(() => {
|
|
3004
3020
|
var i2;
|
|
3005
|
-
this.
|
|
3021
|
+
this.Oi(), null == (i2 = this.Ri) || i2.previewTour(t2);
|
|
3006
3022
|
});
|
|
3007
3023
|
}
|
|
3008
3024
|
dismissProductTour() {
|
|
@@ -3034,7 +3050,7 @@ var PaymentKit = (() => {
|
|
|
3034
3050
|
null == (i2 = this.Ri) || i2.cancelPendingTour(t2);
|
|
3035
3051
|
}
|
|
3036
3052
|
};
|
|
3037
|
-
var
|
|
3053
|
+
var Dn = function(t2) {
|
|
3038
3054
|
return t2.Activation = "events", t2.Cancellation = "cancelEvents", t2;
|
|
3039
3055
|
}({});
|
|
3040
3056
|
var Ln = function(t2) {
|
|
@@ -3081,20 +3097,20 @@ var PaymentKit = (() => {
|
|
|
3081
3097
|
var Zn = { ignoreConditions: false, ignoreDelay: false, displayType: Vn.Popover };
|
|
3082
3098
|
var to = class {
|
|
3083
3099
|
constructor() {
|
|
3084
|
-
this.
|
|
3100
|
+
this.Mi = {}, this.Mi = {};
|
|
3085
3101
|
}
|
|
3086
3102
|
on(t2, i2) {
|
|
3087
|
-
return this.
|
|
3088
|
-
this.
|
|
3103
|
+
return this.Mi[t2] || (this.Mi[t2] = []), this.Mi[t2].push(i2), () => {
|
|
3104
|
+
this.Mi[t2] = this.Mi[t2].filter((t3) => t3 !== i2);
|
|
3089
3105
|
};
|
|
3090
3106
|
}
|
|
3091
3107
|
emit(t2, i2) {
|
|
3092
|
-
for (var e2 of this.
|
|
3093
|
-
for (var r2 of this.
|
|
3108
|
+
for (var e2 of this.Mi[t2] || []) e2(i2);
|
|
3109
|
+
for (var r2 of this.Mi["*"] || []) r2(t2, i2);
|
|
3094
3110
|
}
|
|
3095
3111
|
};
|
|
3096
3112
|
function io(t2, i2, e2) {
|
|
3097
|
-
if (
|
|
3113
|
+
if (D(t2)) return false;
|
|
3098
3114
|
switch (e2) {
|
|
3099
3115
|
case "exact":
|
|
3100
3116
|
return t2 === i2;
|
|
@@ -3113,11 +3129,11 @@ var PaymentKit = (() => {
|
|
|
3113
3129
|
}
|
|
3114
3130
|
var eo = class {
|
|
3115
3131
|
constructor(t2) {
|
|
3116
|
-
this.Ai = new to(), this.
|
|
3132
|
+
this.Ai = new to(), this.ji = (t3, i2) => this.Di(t3, i2) && this.Li(t3, i2) && this.Ni(t3, i2) && this.Ui(t3, i2), this.Di = (t3, i2) => null == i2 || !i2.event || (null == t3 ? void 0 : t3.event) === (null == i2 ? void 0 : i2.event), this._instance = t2, this.zi = /* @__PURE__ */ new Set(), this.Hi = /* @__PURE__ */ new Set();
|
|
3117
3133
|
}
|
|
3118
3134
|
init() {
|
|
3119
3135
|
var t2;
|
|
3120
|
-
if (!
|
|
3136
|
+
if (!O(null == (t2 = this._instance) ? void 0 : t2._addCaptureHook)) {
|
|
3121
3137
|
var i2;
|
|
3122
3138
|
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
3123
3139
|
this.on(t3, i3);
|
|
@@ -3126,7 +3142,7 @@ var PaymentKit = (() => {
|
|
|
3126
3142
|
}
|
|
3127
3143
|
register(t2) {
|
|
3128
3144
|
var i2, e2;
|
|
3129
|
-
if (!
|
|
3145
|
+
if (!O(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) && (t2.forEach((t3) => {
|
|
3130
3146
|
var i3, e3;
|
|
3131
3147
|
null == (i3 = this.Hi) || i3.add(t3), null == (e3 = t3.steps) || e3.forEach((t4) => {
|
|
3132
3148
|
var i4;
|
|
@@ -3153,7 +3169,7 @@ var PaymentKit = (() => {
|
|
|
3153
3169
|
}
|
|
3154
3170
|
Bi(t2, i2) {
|
|
3155
3171
|
if (null == (null == i2 ? void 0 : i2.steps)) return false;
|
|
3156
|
-
for (var e2 of i2.steps) if (this.
|
|
3172
|
+
for (var e2 of i2.steps) if (this.ji(t2, e2)) return true;
|
|
3157
3173
|
return false;
|
|
3158
3174
|
}
|
|
3159
3175
|
onAction(t2, i2) {
|
|
@@ -3185,7 +3201,7 @@ var PaymentKit = (() => {
|
|
|
3185
3201
|
if (r2.length > 0) return r2.some((t3) => io(t3.text, i2.text, i2.text_matching || "exact") || io(t3.$el_text, i2.text, i2.text_matching || "exact"));
|
|
3186
3202
|
var s2, n2, o2, a2 = (null == t2 || null == (e2 = t2.properties) ? void 0 : e2.$elements_chain) || "";
|
|
3187
3203
|
return !!a2 && (s2 = function(t3) {
|
|
3188
|
-
for (var i3, e3 = [], r3 = /(?::|")text="(.*?)"/g; !
|
|
3204
|
+
for (var i3, e3 = [], r3 = /(?::|")text="(.*?)"/g; !D(i3 = r3.exec(t3)); ) e3.includes(i3[1]) || e3.push(i3[1]);
|
|
3189
3205
|
return e3;
|
|
3190
3206
|
}(a2), n2 = i2.text, o2 = i2.text_matching || "exact", s2.some((t3) => io(t3, n2, o2)));
|
|
3191
3207
|
}
|
|
@@ -3233,7 +3249,7 @@ var PaymentKit = (() => {
|
|
|
3233
3249
|
}), e2;
|
|
3234
3250
|
}
|
|
3235
3251
|
te(t2, i2, e2) {
|
|
3236
|
-
var r2 = (e2 ===
|
|
3252
|
+
var r2 = (e2 === Dn.Activation ? this.Ki : this.Yi).get(t2), s2 = [];
|
|
3237
3253
|
return this.ie((t3) => {
|
|
3238
3254
|
s2 = t3.filter((t4) => null == r2 ? void 0 : r2.includes(t4.id));
|
|
3239
3255
|
}), s2.filter((r3) => {
|
|
@@ -3243,7 +3259,7 @@ var PaymentKit = (() => {
|
|
|
3243
3259
|
}
|
|
3244
3260
|
register(t2) {
|
|
3245
3261
|
var i2;
|
|
3246
|
-
|
|
3262
|
+
O(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) || (this.ee(t2), this.re(t2));
|
|
3247
3263
|
}
|
|
3248
3264
|
re(t2) {
|
|
3249
3265
|
var i2 = t2.filter((t3) => {
|
|
@@ -3279,7 +3295,7 @@ var PaymentKit = (() => {
|
|
|
3279
3295
|
if (0 !== e2.length || 0 !== r2.length) {
|
|
3280
3296
|
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
3281
3297
|
this.onEvent(t3, i3);
|
|
3282
|
-
}), this.Ki = this.Zi(t2,
|
|
3298
|
+
}), this.Ki = this.Zi(t2, Dn.Activation), this.Yi = this.Zi(t2, Dn.Cancellation);
|
|
3283
3299
|
}
|
|
3284
3300
|
}
|
|
3285
3301
|
onEvent(t2, i2) {
|
|
@@ -3294,7 +3310,7 @@ var PaymentKit = (() => {
|
|
|
3294
3310
|
}
|
|
3295
3311
|
} else {
|
|
3296
3312
|
if (this.Yi.has(t2)) {
|
|
3297
|
-
var d2 = this.te(t2, i2,
|
|
3313
|
+
var d2 = this.te(t2, i2, Dn.Cancellation);
|
|
3298
3314
|
d2.length > 0 && (r2.info("cancel event matched, cancelling items", { event: t2, itemsToCancel: d2.map((t3) => t3.id) }), d2.forEach((t3) => {
|
|
3299
3315
|
var i3 = o2.indexOf(t3.id);
|
|
3300
3316
|
i3 >= 0 && o2.splice(i3, 1), this.ue(t3.id);
|
|
@@ -3302,7 +3318,7 @@ var PaymentKit = (() => {
|
|
|
3302
3318
|
}
|
|
3303
3319
|
if (this.Ki.has(t2)) {
|
|
3304
3320
|
r2.info("event name matched", { event: t2, eventPayload: i2, items: this.Ki.get(t2) });
|
|
3305
|
-
var v2 = this.te(t2, i2,
|
|
3321
|
+
var v2 = this.te(t2, i2, Dn.Activation);
|
|
3306
3322
|
this.le(o2.concat(v2.map((t3) => t3.id) || []));
|
|
3307
3323
|
}
|
|
3308
3324
|
}
|
|
@@ -3364,7 +3380,7 @@ var PaymentKit = (() => {
|
|
|
3364
3380
|
onRemoteConfig(t2) {
|
|
3365
3381
|
if (!this._instance.config.disable_surveys) {
|
|
3366
3382
|
var i2 = t2.surveys;
|
|
3367
|
-
if (
|
|
3383
|
+
if (D(i2)) return Jn.warn("Flags not loaded yet. Not loading surveys.");
|
|
3368
3384
|
var e2 = I(i2);
|
|
3369
3385
|
this.ve = e2 ? i2.length > 0 : i2, Jn.info("flags response received, isSurveysEnabled: " + this.ve), this.loadIfEnabled();
|
|
3370
3386
|
}
|
|
@@ -3384,7 +3400,7 @@ var PaymentKit = (() => {
|
|
|
3384
3400
|
else {
|
|
3385
3401
|
var t2 = null == v ? void 0 : v.__PosthogExtensions__;
|
|
3386
3402
|
if (t2) {
|
|
3387
|
-
if (!
|
|
3403
|
+
if (!O(this.ve) || this._instance.config.advanced_enable_surveys) {
|
|
3388
3404
|
var i2 = this.ve || this._instance.config.advanced_enable_surveys;
|
|
3389
3405
|
this.ce = true;
|
|
3390
3406
|
try {
|
|
@@ -3458,32 +3474,32 @@ var PaymentKit = (() => {
|
|
|
3458
3474
|
}
|
|
3459
3475
|
}
|
|
3460
3476
|
getActiveMatchingSurveys(t2, i2) {
|
|
3461
|
-
if (void 0 === i2 && (i2 = false), !
|
|
3477
|
+
if (void 0 === i2 && (i2 = false), !D(this._surveyManager)) return this._surveyManager.getActiveMatchingSurveys(t2, i2);
|
|
3462
3478
|
Jn.warn("init was not called");
|
|
3463
3479
|
}
|
|
3464
|
-
|
|
3480
|
+
be(t2) {
|
|
3465
3481
|
var i2 = null;
|
|
3466
3482
|
return this.getSurveys((e2) => {
|
|
3467
3483
|
var r2;
|
|
3468
3484
|
i2 = null !== (r2 = e2.find((i3) => i3.id === t2)) && void 0 !== r2 ? r2 : null;
|
|
3469
3485
|
}), i2;
|
|
3470
3486
|
}
|
|
3471
|
-
|
|
3472
|
-
if (
|
|
3473
|
-
var i2 = "string" == typeof t2 ? this.
|
|
3487
|
+
ye(t2) {
|
|
3488
|
+
if (D(this._surveyManager)) return { eligible: false, reason: "SDK is not enabled or survey functionality is not yet loaded" };
|
|
3489
|
+
var i2 = "string" == typeof t2 ? this.be(t2) : t2;
|
|
3474
3490
|
return i2 ? this._surveyManager.checkSurveyEligibility(i2) : { eligible: false, reason: "Survey not found" };
|
|
3475
3491
|
}
|
|
3476
3492
|
canRenderSurvey(t2) {
|
|
3477
|
-
if (
|
|
3478
|
-
var i2 = this.
|
|
3493
|
+
if (D(this._surveyManager)) return Jn.warn("init was not called"), { visible: false, disabledReason: "SDK is not enabled or survey functionality is not yet loaded" };
|
|
3494
|
+
var i2 = this.ye(t2);
|
|
3479
3495
|
return { visible: i2.eligible, disabledReason: i2.reason };
|
|
3480
3496
|
}
|
|
3481
3497
|
canRenderSurveyAsync(t2, i2) {
|
|
3482
|
-
return
|
|
3498
|
+
return D(this._surveyManager) ? (Jn.warn("init was not called"), Promise.resolve({ visible: false, disabledReason: "SDK is not enabled or survey functionality is not yet loaded" })) : new Promise((e2) => {
|
|
3483
3499
|
this.getSurveys((i3) => {
|
|
3484
3500
|
var r2, s2 = null !== (r2 = i3.find((i4) => i4.id === t2)) && void 0 !== r2 ? r2 : null;
|
|
3485
3501
|
if (s2) {
|
|
3486
|
-
var n2 = this.
|
|
3502
|
+
var n2 = this.ye(s2);
|
|
3487
3503
|
e2({ visible: n2.eligible, disabledReason: n2.reason });
|
|
3488
3504
|
} else e2({ visible: false, disabledReason: "Survey not found" });
|
|
3489
3505
|
}, i2);
|
|
@@ -3491,9 +3507,9 @@ var PaymentKit = (() => {
|
|
|
3491
3507
|
}
|
|
3492
3508
|
renderSurvey(t2, i2, e2) {
|
|
3493
3509
|
var r2;
|
|
3494
|
-
if (
|
|
3510
|
+
if (D(this._surveyManager)) Jn.warn("init was not called");
|
|
3495
3511
|
else {
|
|
3496
|
-
var s2 = "string" == typeof t2 ? this.
|
|
3512
|
+
var s2 = "string" == typeof t2 ? this.be(t2) : t2;
|
|
3497
3513
|
if (null != s2 && s2.id) if (Qn.includes(s2.type)) {
|
|
3498
3514
|
var n2 = null == o ? void 0 : o.querySelector(i2);
|
|
3499
3515
|
if (n2) return null != (r2 = s2.appearance) && r2.surveyPopupDelaySeconds ? (Jn.info("Rendering survey " + s2.id + " with delay of " + s2.appearance.surveyPopupDelaySeconds + " seconds"), void setTimeout(() => {
|
|
@@ -3507,9 +3523,9 @@ var PaymentKit = (() => {
|
|
|
3507
3523
|
}
|
|
3508
3524
|
displaySurvey(t2, i2) {
|
|
3509
3525
|
var e2;
|
|
3510
|
-
if (
|
|
3526
|
+
if (D(this._surveyManager)) Jn.warn("init was not called");
|
|
3511
3527
|
else {
|
|
3512
|
-
var r2 = this.
|
|
3528
|
+
var r2 = this.be(t2);
|
|
3513
3529
|
if (r2) {
|
|
3514
3530
|
var s2 = r2;
|
|
3515
3531
|
if (null != (e2 = r2.appearance) && e2.surveyPopupDelaySeconds && i2.ignoreDelay && (s2 = g({}, r2, { appearance: g({}, r2.appearance, { surveyPopupDelaySeconds: 0 }) })), i2.displayType !== Vn.Popover && i2.initialResponses && Jn.warn("initialResponses is only supported for popover surveys. prefill will not be applied."), false === i2.ignoreConditions) {
|
|
@@ -3521,7 +3537,7 @@ var PaymentKit = (() => {
|
|
|
3521
3537
|
}
|
|
3522
3538
|
}
|
|
3523
3539
|
cancelPendingSurvey(t2) {
|
|
3524
|
-
|
|
3540
|
+
D(this._surveyManager) ? Jn.warn("init was not called") : this._surveyManager.cancelSurvey(t2);
|
|
3525
3541
|
}
|
|
3526
3542
|
handlePageUnload() {
|
|
3527
3543
|
var t2;
|
|
@@ -3536,7 +3552,7 @@ var PaymentKit = (() => {
|
|
|
3536
3552
|
onRemoteConfig(t2) {
|
|
3537
3553
|
if (!this._instance.config.disable_conversations) {
|
|
3538
3554
|
var i2 = t2.conversations;
|
|
3539
|
-
|
|
3555
|
+
D(i2) || (U(i2) ? this.we = i2 : (this.we = i2.enabled, this.Ee = i2), this.loadIfEnabled());
|
|
3540
3556
|
}
|
|
3541
3557
|
}
|
|
3542
3558
|
reset() {
|
|
@@ -3546,7 +3562,7 @@ var PaymentKit = (() => {
|
|
|
3546
3562
|
loadIfEnabled() {
|
|
3547
3563
|
if (!this._conversationsManager && !this.xe && !(this._instance.config.disable_conversations || this._instance.config.cookieless_mode && this._instance.consent.isOptedOut())) {
|
|
3548
3564
|
var t2 = null == v ? void 0 : v.__PosthogExtensions__;
|
|
3549
|
-
if (t2 && !
|
|
3565
|
+
if (t2 && !O(this.we) && this.we) if (this.Ee && this.Ee.token) {
|
|
3550
3566
|
this.xe = true;
|
|
3551
3567
|
try {
|
|
3552
3568
|
var i2 = t2.initConversations;
|
|
@@ -3580,7 +3596,7 @@ var PaymentKit = (() => {
|
|
|
3580
3596
|
this._conversationsManager && this._conversationsManager.hide();
|
|
3581
3597
|
}
|
|
3582
3598
|
isAvailable() {
|
|
3583
|
-
return true === this.we && !
|
|
3599
|
+
return true === this.we && !j(this._conversationsManager);
|
|
3584
3600
|
}
|
|
3585
3601
|
isVisible() {
|
|
3586
3602
|
var t2, i2;
|
|
@@ -3626,7 +3642,7 @@ var PaymentKit = (() => {
|
|
|
3626
3642
|
}
|
|
3627
3643
|
onRemoteConfig(t2) {
|
|
3628
3644
|
var i2, e2 = null == (i2 = t2.logs) ? void 0 : i2.captureConsoleLogs;
|
|
3629
|
-
!
|
|
3645
|
+
!D(e2) && e2 && (this.ke = true, this.loadIfEnabled());
|
|
3630
3646
|
}
|
|
3631
3647
|
reset() {
|
|
3632
3648
|
}
|
|
@@ -3698,35 +3714,35 @@ var PaymentKit = (() => {
|
|
|
3698
3714
|
}
|
|
3699
3715
|
load() {
|
|
3700
3716
|
try {
|
|
3701
|
-
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.
|
|
3702
|
-
if (this._instance.
|
|
3717
|
+
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.yi(this.remoteConfig);
|
|
3718
|
+
if (this._instance.M()) return void vo.warn("Remote config is disabled. Falling back to local config.");
|
|
3703
3719
|
this.Te((t2) => {
|
|
3704
3720
|
if (!t2) return vo.info("No config found after loading remote JS config. Falling back to JSON."), void this.Ie((t3) => {
|
|
3705
|
-
this.
|
|
3721
|
+
this.yi(t3);
|
|
3706
3722
|
});
|
|
3707
|
-
this.
|
|
3723
|
+
this.yi(t2);
|
|
3708
3724
|
});
|
|
3709
3725
|
} catch (t2) {
|
|
3710
3726
|
vo.error("Error loading remote config", t2);
|
|
3711
3727
|
}
|
|
3712
3728
|
}
|
|
3713
|
-
|
|
3714
|
-
t2 ? this._instance.config.__preview_remote_config ? (this._instance.
|
|
3729
|
+
yi(t2) {
|
|
3730
|
+
t2 ? this._instance.config.__preview_remote_config ? (this._instance.yi(t2), false !== t2.hasFeatureFlags && this._instance.featureFlags.ensureFlagsLoaded()) : vo.info("__preview_remote_config is disabled. Logging config instead", t2) : vo.error("Failed to fetch remote config from PostHog.");
|
|
3715
3731
|
}
|
|
3716
3732
|
};
|
|
3717
3733
|
var fo = 3e3;
|
|
3718
3734
|
var po = class {
|
|
3719
3735
|
constructor(t2, i2) {
|
|
3720
|
-
this.Ce = true, this.Re = [], this.Fe = K((null == i2 ? void 0 : i2.flush_interval_ms) || fo, 250, 5e3, $i.createLogger("flush interval"), fo), this.
|
|
3736
|
+
this.Ce = true, this.Re = [], this.Fe = K((null == i2 ? void 0 : i2.flush_interval_ms) || fo, 250, 5e3, $i.createLogger("flush interval"), fo), this.Oe = t2;
|
|
3721
3737
|
}
|
|
3722
3738
|
enqueue(t2) {
|
|
3723
|
-
this.Re.push(t2), this.
|
|
3739
|
+
this.Re.push(t2), this.Me || this.Ae();
|
|
3724
3740
|
}
|
|
3725
3741
|
unload() {
|
|
3726
|
-
this.
|
|
3727
|
-
var t2 = this.Re.length > 0 ? this.
|
|
3742
|
+
this.je();
|
|
3743
|
+
var t2 = this.Re.length > 0 ? this.De() : {}, i2 = Object.values(t2);
|
|
3728
3744
|
[...i2.filter((t3) => 0 === t3.url.indexOf("/e")), ...i2.filter((t3) => 0 !== t3.url.indexOf("/e"))].map((t3) => {
|
|
3729
|
-
this.
|
|
3745
|
+
this.Oe(g({}, t3, { transport: "sendBeacon" }));
|
|
3730
3746
|
});
|
|
3731
3747
|
}
|
|
3732
3748
|
enable() {
|
|
@@ -3734,33 +3750,33 @@ var PaymentKit = (() => {
|
|
|
3734
3750
|
}
|
|
3735
3751
|
Ae() {
|
|
3736
3752
|
var t2 = this;
|
|
3737
|
-
this.Ce || (this.
|
|
3738
|
-
if (this.
|
|
3739
|
-
var i2 = this.
|
|
3753
|
+
this.Ce || (this.Me = setTimeout(() => {
|
|
3754
|
+
if (this.je(), this.Re.length > 0) {
|
|
3755
|
+
var i2 = this.De(), e2 = function() {
|
|
3740
3756
|
var e3 = i2[r2], s2 = (/* @__PURE__ */ new Date()).getTime();
|
|
3741
3757
|
e3.data && I(e3.data) && Ci(e3.data, (t3) => {
|
|
3742
3758
|
t3.offset = Math.abs(t3.timestamp - s2), delete t3.timestamp;
|
|
3743
|
-
}), t2.
|
|
3759
|
+
}), t2.Oe(e3);
|
|
3744
3760
|
};
|
|
3745
3761
|
for (var r2 in i2) e2();
|
|
3746
3762
|
}
|
|
3747
3763
|
}, this.Fe));
|
|
3748
3764
|
}
|
|
3749
|
-
De() {
|
|
3750
|
-
clearTimeout(this.Oe), this.Oe = void 0;
|
|
3751
|
-
}
|
|
3752
3765
|
je() {
|
|
3766
|
+
clearTimeout(this.Me), this.Me = void 0;
|
|
3767
|
+
}
|
|
3768
|
+
De() {
|
|
3753
3769
|
var t2 = {};
|
|
3754
3770
|
return Ci(this.Re, (i2) => {
|
|
3755
3771
|
var e2, r2 = i2, s2 = (r2 ? r2.batchKey : null) || r2.url;
|
|
3756
|
-
|
|
3772
|
+
O(t2[s2]) && (t2[s2] = g({}, r2, { data: [] })), null == (e2 = t2[s2].data) || e2.push(r2.data);
|
|
3757
3773
|
}), this.Re = [], t2;
|
|
3758
3774
|
}
|
|
3759
3775
|
};
|
|
3760
3776
|
var go = ["retriesPerformedSoFar"];
|
|
3761
3777
|
var _o = class {
|
|
3762
3778
|
constructor(i2) {
|
|
3763
|
-
this.Le = false, this.Ne = 3e3, this.Re = [], this._instance = i2, this.Re = [], this.Ue = true, !
|
|
3779
|
+
this.Le = false, this.Ne = 3e3, this.Re = [], this._instance = i2, this.Re = [], this.Ue = true, !O(t) && "onLine" in t.navigator && (this.Ue = t.navigator.onLine, this.ze = () => {
|
|
3764
3780
|
this.Ue = true, this.Lt();
|
|
3765
3781
|
}, this.He = () => {
|
|
3766
3782
|
this.Ue = false;
|
|
@@ -3797,7 +3813,7 @@ var PaymentKit = (() => {
|
|
|
3797
3813
|
if (this.Re = i2, e2.length > 0) for (var { requestOptions: r2 } of e2) this.retriableRequest(r2);
|
|
3798
3814
|
}
|
|
3799
3815
|
unload() {
|
|
3800
|
-
for (var { requestOptions: i2 } of (this.We && (clearTimeout(this.We), this.We = void 0), this.Le = false,
|
|
3816
|
+
for (var { requestOptions: i2 } of (this.We && (clearTimeout(this.We), this.We = void 0), this.Le = false, O(t) || (this.ze && (t.removeEventListener("online", this.ze), this.ze = void 0), this.He && (t.removeEventListener("offline", this.He), this.He = void 0)), this.Re)) try {
|
|
3801
3817
|
this._instance._send_request(g({}, i2, { transport: "sendBeacon" }));
|
|
3802
3818
|
} catch (t2) {
|
|
3803
3819
|
$i.error(t2);
|
|
@@ -3847,8 +3863,8 @@ var PaymentKit = (() => {
|
|
|
3847
3863
|
return t && (t.scrollX || t.pageXOffset || t.document.documentElement.scrollLeft) || 0;
|
|
3848
3864
|
}
|
|
3849
3865
|
};
|
|
3850
|
-
var
|
|
3851
|
-
var
|
|
3866
|
+
var bo = (t2) => ds(null == t2 ? void 0 : t2.config.mask_personal_data_properties, null == t2 ? void 0 : t2.config.custom_personal_data_properties);
|
|
3867
|
+
var yo = class {
|
|
3852
3868
|
constructor(t2, i2, e2, r2) {
|
|
3853
3869
|
this.Je = (t3) => {
|
|
3854
3870
|
var i3 = this.Ke();
|
|
@@ -3856,7 +3872,7 @@ var PaymentKit = (() => {
|
|
|
3856
3872
|
var e3 = { sessionId: t3, props: this.Ye(this._instance) };
|
|
3857
3873
|
this.Xe.register({ [de]: e3 });
|
|
3858
3874
|
}
|
|
3859
|
-
}, this._instance = t2, this.Qe = i2, this.Xe = e2, this.Ye = r2 ||
|
|
3875
|
+
}, this._instance = t2, this.Qe = i2, this.Xe = e2, this.Ye = r2 || bo, this.Qe.onSessionId(this.Je);
|
|
3860
3876
|
}
|
|
3861
3877
|
Ke() {
|
|
3862
3878
|
return this.Xe.props[de];
|
|
@@ -3867,7 +3883,7 @@ var PaymentKit = (() => {
|
|
|
3867
3883
|
}
|
|
3868
3884
|
getSessionProps() {
|
|
3869
3885
|
var t2 = {};
|
|
3870
|
-
return Ci(
|
|
3886
|
+
return Ci(ji(this.getSetOnceProps()), (i2, e2) => {
|
|
3871
3887
|
"$current_url" === e2 && (e2 = "url"), t2["$session_entry_" + E(e2)] = i2;
|
|
3872
3888
|
}), t2;
|
|
3873
3889
|
}
|
|
@@ -3881,7 +3897,7 @@ var PaymentKit = (() => {
|
|
|
3881
3897
|
var r2;
|
|
3882
3898
|
if (this.tr = [], this.ir = void 0, this.Ze = new to(), this.er = (t3, i3) => !(!N(t3) || !N(i3)) && Math.abs(t3 - i3) > this.sessionTimeoutMs, !t2.persistence) throw new Error("SessionIdManager requires a PostHogPersistence instance");
|
|
3883
3899
|
if ("always" === t2.config.cookieless_mode) throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');
|
|
3884
|
-
this.R = t2.config, this.Xe = t2.persistence, this.rr = void 0, this.sr = void 0, this._sessionStartTimestamp = null, this._sessionActivityTimestamp = null, this.nr = i2 ||
|
|
3900
|
+
this.R = t2.config, this.Xe = t2.persistence, this.rr = void 0, this.sr = void 0, this._sessionStartTimestamp = null, this._sessionActivityTimestamp = null, this.nr = i2 || yr, this.ar = e2 || yr;
|
|
3885
3901
|
var s2 = this.R.persistence_name || this.R.token, n2 = this.R.session_idle_timeout_seconds || 1800;
|
|
3886
3902
|
if (this._sessionTimeoutMs = 1e3 * K(n2, 60, 36e3, wo.createLogger("session_idle_timeout_seconds"), 1800), t2.register({ $configured_session_timeout_ms: this._sessionTimeoutMs }), this.lr(), this.ur = "ph_" + s2 + "_window_id", this.hr = "ph_" + s2 + "_primary_window_exists", this.dr()) {
|
|
3887
3903
|
var o2 = Fr.W(this.ur), a2 = Fr.W(this.hr);
|
|
@@ -3904,7 +3920,7 @@ var PaymentKit = (() => {
|
|
|
3904
3920
|
return this._sessionTimeoutMs;
|
|
3905
3921
|
}
|
|
3906
3922
|
onSessionId(t2) {
|
|
3907
|
-
return
|
|
3923
|
+
return O(this.tr) && (this.tr = []), this.tr.push(t2), this.sr && t2(this.sr, this.rr), () => {
|
|
3908
3924
|
this.tr = this.tr.filter((i2) => i2 !== t2);
|
|
3909
3925
|
};
|
|
3910
3926
|
}
|
|
@@ -3956,15 +3972,15 @@ var PaymentKit = (() => {
|
|
|
3956
3972
|
var $o = Si("[SiteApps]");
|
|
3957
3973
|
var So = class {
|
|
3958
3974
|
constructor(t2) {
|
|
3959
|
-
this._instance = t2, this.
|
|
3975
|
+
this._instance = t2, this.br = [], this.apps = {};
|
|
3960
3976
|
}
|
|
3961
3977
|
get isEnabled() {
|
|
3962
3978
|
return !!this._instance.config.opt_in_site_apps;
|
|
3963
3979
|
}
|
|
3964
|
-
|
|
3980
|
+
yr(t2, i2) {
|
|
3965
3981
|
if (i2) {
|
|
3966
3982
|
var e2 = this.globalsForEvent(i2);
|
|
3967
|
-
this.
|
|
3983
|
+
this.br.push(e2), this.br.length > 1e3 && (this.br = this.br.slice(10));
|
|
3968
3984
|
}
|
|
3969
3985
|
}
|
|
3970
3986
|
get siteAppLoaders() {
|
|
@@ -3973,9 +3989,9 @@ var PaymentKit = (() => {
|
|
|
3973
3989
|
}
|
|
3974
3990
|
init() {
|
|
3975
3991
|
if (this.isEnabled) {
|
|
3976
|
-
var t2 = this._instance._addCaptureHook(this.
|
|
3992
|
+
var t2 = this._instance._addCaptureHook(this.yr.bind(this));
|
|
3977
3993
|
this.wr = () => {
|
|
3978
|
-
t2(), this.
|
|
3994
|
+
t2(), this.br = [], this.wr = void 0;
|
|
3979
3995
|
};
|
|
3980
3996
|
}
|
|
3981
3997
|
}
|
|
@@ -3990,7 +4006,7 @@ var PaymentKit = (() => {
|
|
|
3990
4006
|
setupSiteApp(t2) {
|
|
3991
4007
|
var i2 = this.apps[t2.id], e2 = () => {
|
|
3992
4008
|
var e3;
|
|
3993
|
-
(!i2.errored && this.
|
|
4009
|
+
(!i2.errored && this.br.length && ($o.info("Processing " + this.br.length + " events for site app with id " + t2.id), this.br.forEach((t3) => null == i2.processEvent ? void 0 : i2.processEvent(t3)), i2.processedBuffer = true), Object.values(this.apps).every((t3) => t3.processedBuffer || t3.errored)) && (null == (e3 = this.wr) || e3.call(this));
|
|
3994
4010
|
}, r2 = false, s2 = (s3) => {
|
|
3995
4011
|
i2.errored = !s3, i2.loaded = true, $o.info("Site app with id " + t2.id + " " + (s3 ? "loaded" : "errored")), r2 && e2();
|
|
3996
4012
|
};
|
|
@@ -4040,10 +4056,10 @@ var PaymentKit = (() => {
|
|
|
4040
4056
|
var ko = function(t2, i2) {
|
|
4041
4057
|
if (!t2) return false;
|
|
4042
4058
|
var e2 = t2.userAgent;
|
|
4043
|
-
if (e2 &&
|
|
4059
|
+
if (e2 && b(e2, i2)) return true;
|
|
4044
4060
|
try {
|
|
4045
4061
|
var r2 = null == t2 ? void 0 : t2.userAgentData;
|
|
4046
|
-
if (null != r2 && r2.brands && r2.brands.some((t3) =>
|
|
4062
|
+
if (null != r2 && r2.brands && r2.brands.some((t3) => b(null == t3 ? void 0 : t3.brand, i2))) return true;
|
|
4047
4063
|
} catch (t3) {
|
|
4048
4064
|
}
|
|
4049
4065
|
return !!t2.webdriver;
|
|
@@ -4095,7 +4111,7 @@ var PaymentKit = (() => {
|
|
|
4095
4111
|
var e2;
|
|
4096
4112
|
if (i2.Pr) _Ro.kr("setting flag key ", t5.feature_flag_key, " to web experiment ", t5), null == (e2 = i2.Pr) || e2.set(t5.feature_flag_key, t5);
|
|
4097
4113
|
var r2 = i2._instance.getFeatureFlag(t5.feature_flag_key);
|
|
4098
|
-
|
|
4114
|
+
M(r2) && t5.variants[r2] && i2.Tr(t5.name, r2, t5.variants[r2].transforms);
|
|
4099
4115
|
} else if (t5.variants) for (var s2 in t5.variants) {
|
|
4100
4116
|
var n2 = t5.variants[s2];
|
|
4101
4117
|
_Ro.Ir(n2) && i2.Tr(t5.name, s2, n2.transforms);
|
|
@@ -4109,7 +4125,7 @@ var PaymentKit = (() => {
|
|
|
4109
4125
|
onFeatureFlags(t2) {
|
|
4110
4126
|
if (this._is_bot()) _Ro.kr("Refusing to render web experiment since the viewer is a likely bot");
|
|
4111
4127
|
else if (!this._instance.config.disable_web_experiments) {
|
|
4112
|
-
if (
|
|
4128
|
+
if (D(this.Pr)) return this.Pr = /* @__PURE__ */ new Map(), this.loadIfEnabled(), void this.previewWebExperiment();
|
|
4113
4129
|
_Ro.kr("applying feature flags", t2), t2.forEach((t3) => {
|
|
4114
4130
|
var i2;
|
|
4115
4131
|
if (this.Pr && null != (i2 = this.Pr) && i2.has(t3)) {
|
|
@@ -4146,11 +4162,11 @@ var PaymentKit = (() => {
|
|
|
4146
4162
|
r2 && r2.length > 0 && (_Ro.kr("Previewing web experiment [" + r2[0].name + "] with variant [" + i2 + "]"), this.Tr(r2[0].name, i2, r2[0].variants[i2].transforms));
|
|
4147
4163
|
}
|
|
4148
4164
|
static Ir(t2) {
|
|
4149
|
-
return !
|
|
4165
|
+
return !D(t2.conditions) && (_Ro.Rr(t2) && _Ro.Fr(t2));
|
|
4150
4166
|
}
|
|
4151
4167
|
static Rr(t2) {
|
|
4152
4168
|
var i2;
|
|
4153
|
-
if (
|
|
4169
|
+
if (D(t2.conditions) || D(null == (i2 = t2.conditions) ? void 0 : i2.url)) return true;
|
|
4154
4170
|
var e2, r2, s2, n2 = _Ro.getWindowLocation();
|
|
4155
4171
|
return !!n2 && (null == (e2 = t2.conditions) || !e2.url || Co[null !== (r2 = null == (s2 = t2.conditions) ? void 0 : s2.urlMatchType) && void 0 !== r2 ? r2 : "icontains"](t2.conditions.url, n2));
|
|
4156
4172
|
}
|
|
@@ -4159,7 +4175,7 @@ var PaymentKit = (() => {
|
|
|
4159
4175
|
}
|
|
4160
4176
|
static Fr(t2) {
|
|
4161
4177
|
var i2;
|
|
4162
|
-
if (
|
|
4178
|
+
if (D(t2.conditions) || D(null == (i2 = t2.conditions) ? void 0 : i2.utm)) return true;
|
|
4163
4179
|
var e2 = os();
|
|
4164
4180
|
if (e2.utm_source) {
|
|
4165
4181
|
var r2, s2, n2, o2, a2, l2, u2, h2, d2 = null == (r2 = t2.conditions) || null == (r2 = r2.utm) || !r2.utm_campaign || (null == (s2 = t2.conditions) || null == (s2 = s2.utm) ? void 0 : s2.utm_campaign) == e2.utm_campaign, v2 = null == (n2 = t2.conditions) || null == (n2 = n2.utm) || !n2.utm_source || (null == (o2 = t2.conditions) || null == (o2 = o2.utm) ? void 0 : o2.utm_source) == e2.utm_source, c2 = null == (a2 = t2.conditions) || null == (a2 = a2.utm) || !a2.utm_medium || (null == (l2 = t2.conditions) || null == (l2 = l2.utm) ? void 0 : l2.utm_medium) == e2.utm_medium, f2 = null == (u2 = t2.conditions) || null == (u2 = u2.utm) || !u2.utm_term || (null == (h2 = t2.conditions) || null == (h2 = h2.utm) ? void 0 : h2.utm_term) == e2.utm_term;
|
|
@@ -4189,8 +4205,8 @@ var PaymentKit = (() => {
|
|
|
4189
4205
|
}
|
|
4190
4206
|
};
|
|
4191
4207
|
var Fo = Si("[PostHog ExternalIntegrations]");
|
|
4192
|
-
var
|
|
4193
|
-
var
|
|
4208
|
+
var Oo = { intercom: "intercom-integration", crispChat: "crisp-chat-integration" };
|
|
4209
|
+
var Mo = class {
|
|
4194
4210
|
constructor(t2) {
|
|
4195
4211
|
this._instance = t2;
|
|
4196
4212
|
}
|
|
@@ -4204,7 +4220,7 @@ var PaymentKit = (() => {
|
|
|
4204
4220
|
startIfEnabledOrStop() {
|
|
4205
4221
|
var t2 = this, i2 = function(i3) {
|
|
4206
4222
|
var e3, s3, n2;
|
|
4207
|
-
(!r2 || null != (e3 = v.__PosthogExtensions__) && null != (e3 = e3.integrations) && e3[i3] || t2.it(
|
|
4223
|
+
(!r2 || null != (e3 = v.__PosthogExtensions__) && null != (e3 = e3.integrations) && e3[i3] || t2.it(Oo[i3], () => {
|
|
4208
4224
|
var e4;
|
|
4209
4225
|
null == (e4 = v.__PosthogExtensions__) || null == (e4 = e4.integrations) || null == (e4 = e4[i3]) || e4.start(t2._instance);
|
|
4210
4226
|
}), !r2 && null != (s3 = v.__PosthogExtensions__) && null != (s3 = s3.integrations) && s3[i3]) && (null == (n2 = v.__PosthogExtensions__) || null == (n2 = n2.integrations) || null == (n2 = n2[i3]) || n2.stop());
|
|
@@ -4216,17 +4232,17 @@ var PaymentKit = (() => {
|
|
|
4216
4232
|
}
|
|
4217
4233
|
};
|
|
4218
4234
|
var Ao = "[SessionRecording]";
|
|
4219
|
-
var
|
|
4220
|
-
var
|
|
4235
|
+
var jo = Si(Ao);
|
|
4236
|
+
var Do = class {
|
|
4221
4237
|
get started() {
|
|
4222
4238
|
var t2;
|
|
4223
|
-
return !(null == (t2 = this.
|
|
4239
|
+
return !(null == (t2 = this.Or) || !t2.isStarted);
|
|
4224
4240
|
}
|
|
4225
4241
|
get status() {
|
|
4226
|
-
return this.
|
|
4242
|
+
return this.Or ? this.Or.status : this.Mr && !this.Ar ? "disabled" : "lazy_loading";
|
|
4227
4243
|
}
|
|
4228
4244
|
constructor(t2) {
|
|
4229
|
-
if (this._forceAllowLocalhostNetworkCapture = false, this.
|
|
4245
|
+
if (this._forceAllowLocalhostNetworkCapture = false, this.Mr = false, this.jr = void 0, this._instance = t2, !this._instance.sessionManager) throw jo.error("started without valid sessionManager"), new Error(Ao + " started without valid sessionManager. This is a bug.");
|
|
4230
4246
|
if ("always" === this._instance.config.cookieless_mode) throw new Error(Ao + ' cannot be used with cookieless_mode="always"');
|
|
4231
4247
|
}
|
|
4232
4248
|
get Ar() {
|
|
@@ -4235,21 +4251,21 @@ var PaymentKit = (() => {
|
|
|
4235
4251
|
}
|
|
4236
4252
|
startIfEnabledOrStop(t2) {
|
|
4237
4253
|
var i2;
|
|
4238
|
-
if (!this.Ar || null == (i2 = this.
|
|
4239
|
-
var e2 = !
|
|
4240
|
-
this.Ar && e2 ? (this.
|
|
4254
|
+
if (!this.Ar || null == (i2 = this.Or) || !i2.isStarted) {
|
|
4255
|
+
var e2 = !O(Object.assign) && !O(Array.from);
|
|
4256
|
+
this.Ar && e2 ? (this.Dr(t2), jo.info("starting")) : this.stopRecording();
|
|
4241
4257
|
}
|
|
4242
4258
|
}
|
|
4243
|
-
|
|
4259
|
+
Dr(t2) {
|
|
4244
4260
|
var i2, e2, r2;
|
|
4245
4261
|
this.Ar && (null != v && null != (i2 = v.__PosthogExtensions__) && null != (i2 = i2.rrweb) && i2.record && null != (e2 = v.__PosthogExtensions__) && e2.initSessionRecording ? this.Lr(t2) : null == (r2 = v.__PosthogExtensions__) || null == r2.loadExternalDependency || r2.loadExternalDependency(this._instance, this.Nr, (i3) => {
|
|
4246
|
-
if (i3) return
|
|
4262
|
+
if (i3) return jo.error("could not load recorder", i3);
|
|
4247
4263
|
this.Lr(t2);
|
|
4248
4264
|
}));
|
|
4249
4265
|
}
|
|
4250
4266
|
stopRecording() {
|
|
4251
4267
|
var t2, i2;
|
|
4252
|
-
null == (t2 = this.
|
|
4268
|
+
null == (t2 = this.jr) || t2.call(this), this.jr = void 0, null == (i2 = this.Or) || i2.stop();
|
|
4253
4269
|
}
|
|
4254
4270
|
Ur() {
|
|
4255
4271
|
var t2;
|
|
@@ -4258,20 +4274,20 @@ var PaymentKit = (() => {
|
|
|
4258
4274
|
zr(t2) {
|
|
4259
4275
|
if (this._instance.persistence) {
|
|
4260
4276
|
var i2, e2, r2 = this._instance.persistence, s2 = () => {
|
|
4261
|
-
var i3 = false === t2.sessionRecording ? void 0 : t2.sessionRecording, e3 = null == i3 ? void 0 : i3.sampleRate, s3 =
|
|
4262
|
-
|
|
4277
|
+
var i3 = false === t2.sessionRecording ? void 0 : t2.sessionRecording, e3 = null == i3 ? void 0 : i3.sampleRate, s3 = D(e3) ? null : parseFloat(e3);
|
|
4278
|
+
D(s3) && this.Ur();
|
|
4263
4279
|
var n2 = null == i3 ? void 0 : i3.minimumDurationMilliseconds;
|
|
4264
|
-
r2.register({ [te]: g({ enabled: !!i3 }, i3, { networkPayloadCapture: g({ capturePerformance: t2.capturePerformance }, null == i3 ? void 0 : i3.networkPayloadCapture), canvasRecording: { enabled: null == i3 ? void 0 : i3.recordCanvas, fps: null == i3 ? void 0 : i3.canvasFps, quality: null == i3 ? void 0 : i3.canvasQuality }, sampleRate: s3, minimumDurationMilliseconds:
|
|
4280
|
+
r2.register({ [te]: g({ enabled: !!i3 }, i3, { networkPayloadCapture: g({ capturePerformance: t2.capturePerformance }, null == i3 ? void 0 : i3.networkPayloadCapture), canvasRecording: { enabled: null == i3 ? void 0 : i3.recordCanvas, fps: null == i3 ? void 0 : i3.canvasFps, quality: null == i3 ? void 0 : i3.canvasQuality }, sampleRate: s3, minimumDurationMilliseconds: O(n2) ? null : n2, endpoint: null == i3 ? void 0 : i3.endpoint, triggerMatchType: null == i3 ? void 0 : i3.triggerMatchType, masking: null == i3 ? void 0 : i3.masking, urlTriggers: null == i3 ? void 0 : i3.urlTriggers }) });
|
|
4265
4281
|
};
|
|
4266
|
-
s2(), null == (i2 = this.
|
|
4282
|
+
s2(), null == (i2 = this.jr) || i2.call(this), this.jr = null == (e2 = this._instance.sessionManager) ? void 0 : e2.onSessionId(s2);
|
|
4267
4283
|
}
|
|
4268
4284
|
}
|
|
4269
4285
|
onRemoteConfig(t2) {
|
|
4270
|
-
"sessionRecording" in t2 ? false !== t2.sessionRecording ? (this.zr(t2), this.
|
|
4286
|
+
"sessionRecording" in t2 ? false !== t2.sessionRecording ? (this.zr(t2), this.Mr = true, this.startIfEnabledOrStop()) : this.Mr = true : jo.info("skipping remote config with no sessionRecording", t2);
|
|
4271
4287
|
}
|
|
4272
4288
|
log(t2, i2) {
|
|
4273
4289
|
var e2;
|
|
4274
|
-
void 0 === i2 && (i2 = "log"), null != (e2 = this.
|
|
4290
|
+
void 0 === i2 && (i2 = "log"), null != (e2 = this.Or) && e2.log ? this.Or.log(t2, i2) : jo.warn("log called before recorder was ready");
|
|
4275
4291
|
}
|
|
4276
4292
|
get Nr() {
|
|
4277
4293
|
var t2, i2, e2 = null == (t2 = this._instance) || null == (t2 = t2.persistence) ? void 0 : t2.get_property(te);
|
|
@@ -4280,35 +4296,35 @@ var PaymentKit = (() => {
|
|
|
4280
4296
|
Lr(t2) {
|
|
4281
4297
|
var i2, e2;
|
|
4282
4298
|
if (null == (i2 = v.__PosthogExtensions__) || !i2.initSessionRecording) throw Error("Called on script loaded before session recording is available");
|
|
4283
|
-
this.
|
|
4284
|
-
this.
|
|
4299
|
+
this.Or || (this.Or = null == (e2 = v.__PosthogExtensions__) ? void 0 : e2.initSessionRecording(this._instance), this.Or._forceAllowLocalhostNetworkCapture = this._forceAllowLocalhostNetworkCapture);
|
|
4300
|
+
this.Or.start(t2);
|
|
4285
4301
|
}
|
|
4286
4302
|
onRRwebEmit(t2) {
|
|
4287
4303
|
var i2;
|
|
4288
|
-
null == (i2 = this.
|
|
4304
|
+
null == (i2 = this.Or) || null == i2.onRRwebEmit || i2.onRRwebEmit(t2);
|
|
4289
4305
|
}
|
|
4290
4306
|
overrideLinkedFlag() {
|
|
4291
4307
|
var t2, i2;
|
|
4292
|
-
this.
|
|
4293
|
-
null == (t2 = this.
|
|
4308
|
+
this.Or || (null == (i2 = this._instance.persistence) || i2.register({ $replay_override_linked_flag: true }));
|
|
4309
|
+
null == (t2 = this.Or) || t2.overrideLinkedFlag();
|
|
4294
4310
|
}
|
|
4295
4311
|
overrideSampling() {
|
|
4296
4312
|
var t2, i2;
|
|
4297
|
-
this.
|
|
4298
|
-
null == (t2 = this.
|
|
4313
|
+
this.Or || (null == (i2 = this._instance.persistence) || i2.register({ $replay_override_sampling: true }));
|
|
4314
|
+
null == (t2 = this.Or) || t2.overrideSampling();
|
|
4299
4315
|
}
|
|
4300
4316
|
overrideTrigger(t2) {
|
|
4301
4317
|
var i2, e2;
|
|
4302
|
-
this.
|
|
4303
|
-
null == (i2 = this.
|
|
4318
|
+
this.Or || (null == (e2 = this._instance.persistence) || e2.register({ ["url" === t2 ? "$replay_override_url_trigger" : "$replay_override_event_trigger"]: true }));
|
|
4319
|
+
null == (i2 = this.Or) || i2.overrideTrigger(t2);
|
|
4304
4320
|
}
|
|
4305
4321
|
get sdkDebugProperties() {
|
|
4306
4322
|
var t2;
|
|
4307
|
-
return (null == (t2 = this.
|
|
4323
|
+
return (null == (t2 = this.Or) ? void 0 : t2.sdkDebugProperties) || { $recording_status: this.status };
|
|
4308
4324
|
}
|
|
4309
4325
|
tryAddCustomEvent(t2, i2) {
|
|
4310
4326
|
var e2;
|
|
4311
|
-
return !(null == (e2 = this.
|
|
4327
|
+
return !(null == (e2 = this.Or) || !e2.tryAddCustomEvent(t2, i2));
|
|
4312
4328
|
}
|
|
4313
4329
|
};
|
|
4314
4330
|
var Lo = {};
|
|
@@ -4318,16 +4334,16 @@ var PaymentKit = (() => {
|
|
|
4318
4334
|
var zo = !an && -1 === (null == d ? void 0 : d.indexOf("MSIE")) && -1 === (null == d ? void 0 : d.indexOf("Mozilla"));
|
|
4319
4335
|
var Ho = (i2) => {
|
|
4320
4336
|
var e2;
|
|
4321
|
-
return g({ api_host: "https://us.i.posthog.com", flags_api_host: null, ui_host: null, token: "", autocapture: true, cross_subdomain_cookie: Ni(null == o ? void 0 : o.location), persistence: "localStorage+cookie", persistence_name: "", cookie_persisted_properties: [], loaded: No, save_campaign_params: true, custom_campaign_params: [], custom_blocked_useragents: [], save_referrer: true, capture_pageleave: "if_capture_pageview", defaults: null != i2 ? i2 : "unset", __preview_deferred_init_extensions: false, debug: a &&
|
|
4337
|
+
return g({ api_host: "https://us.i.posthog.com", flags_api_host: null, ui_host: null, token: "", autocapture: true, cross_subdomain_cookie: Ni(null == o ? void 0 : o.location), persistence: "localStorage+cookie", persistence_name: "", cookie_persisted_properties: [], loaded: No, save_campaign_params: true, custom_campaign_params: [], custom_blocked_useragents: [], save_referrer: true, capture_pageleave: "if_capture_pageview", defaults: null != i2 ? i2 : "unset", __preview_deferred_init_extensions: false, debug: a && M(null == a ? void 0 : a.search) && -1 !== a.search.indexOf("__posthog_debug=true") || false, cookie_expiration: 365, upgrade: false, disable_session_recording: false, disable_persistence: false, disable_web_experiments: true, disable_surveys: false, disable_surveys_automatic_display: false, disable_conversations: false, disable_product_tours: true, disable_external_dependency_loading: false, enable_recording_console_log: void 0, secure_cookie: "https:" === (null == t || null == (e2 = t.location) ? void 0 : e2.protocol), ip: false, opt_out_capturing_by_default: false, opt_out_persistence_by_default: false, opt_out_useragent_filter: false, opt_out_capturing_persistence_type: "localStorage", consent_persistence_name: null, opt_out_capturing_cookie_prefix: null, opt_in_site_apps: false, property_denylist: [], respect_dnt: false, sanitize_properties: null, request_headers: {}, request_batching: true, properties_string_max_length: 65535, mask_all_element_attributes: false, mask_all_text: false, mask_personal_data_properties: false, custom_personal_data_properties: [], advanced_disable_flags: false, advanced_disable_decide: false, advanced_disable_feature_flags: false, advanced_disable_feature_flags_on_first_load: false, advanced_only_evaluate_survey_feature_flags: false, advanced_enable_surveys: false, advanced_disable_toolbar_metrics: false, feature_flag_request_timeout_ms: 3e3, surveys_request_timeout_ms: 1e4, on_request_error: (t2) => {
|
|
4322
4338
|
var i3 = "Bad HTTP status: " + t2.statusCode + " " + t2.text;
|
|
4323
4339
|
$i.error(i3);
|
|
4324
|
-
}, get_device_id: (t2) => t2, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: false, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms: fo }, error_tracking: {}, _onCapture: No, __preview_eager_load_replay: false }, ((t2) => ({ rageclick: !(t2 && t2 >= "2025-11-30") || { content_ignorelist: true }, capture_pageview: !(t2 && t2 >= "2025-05-24") || "history_change", session_recording: t2 && t2 >= "2025-11-30" ? { strictMinimumDuration: true } : {}, external_scripts_inject_target: t2 && t2 >= "2026-01-30" ? "head" : "body" }))(i2));
|
|
4340
|
+
}, get_device_id: (t2) => t2, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: false, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms: fo }, error_tracking: {}, _onCapture: No, __preview_eager_load_replay: false }, ((t2) => ({ rageclick: !(t2 && t2 >= "2025-11-30") || { content_ignorelist: true }, capture_pageview: !(t2 && t2 >= "2025-05-24") || "history_change", session_recording: t2 && t2 >= "2025-11-30" ? { strictMinimumDuration: true } : {}, external_scripts_inject_target: t2 && t2 >= "2026-01-30" ? "head" : "body", internal_or_test_user_hostname: t2 && t2 >= "2026-01-30" ? /^(localhost|127\.0\.0\.1)$/ : void 0 }))(i2));
|
|
4325
4341
|
};
|
|
4326
4342
|
var Bo = (t2) => {
|
|
4327
4343
|
var i2 = {};
|
|
4328
|
-
|
|
4344
|
+
O(t2.process_person) || (i2.person_profiles = t2.process_person), O(t2.xhr_headers) || (i2.request_headers = t2.xhr_headers), O(t2.cookie_name) || (i2.persistence_name = t2.cookie_name), O(t2.disable_cookie) || (i2.disable_persistence = t2.disable_cookie), O(t2.store_google) || (i2.save_campaign_params = t2.store_google), O(t2.verbose) || (i2.debug = t2.verbose);
|
|
4329
4345
|
var e2 = Ri({}, i2, t2);
|
|
4330
|
-
return I(t2.property_blacklist) && (
|
|
4346
|
+
return I(t2.property_blacklist) && (O(t2.property_denylist) ? e2.property_denylist = t2.property_blacklist : I(t2.property_denylist) ? e2.property_denylist = [...t2.property_blacklist, ...t2.property_denylist] : $i.error("Invalid value for property_denylist config: " + t2.property_denylist)), e2;
|
|
4331
4347
|
};
|
|
4332
4348
|
var qo = class {
|
|
4333
4349
|
constructor() {
|
|
@@ -4353,11 +4369,11 @@ var PaymentKit = (() => {
|
|
|
4353
4369
|
this.webPerformance = new qo(), this.Br = false, this.version = c.LIB_VERSION, this.qr = new to(), this._calculate_event_properties = this.calculateEventProperties.bind(this), this.config = Ho(), this.SentryIntegration = Vr, this.sentryIntegration = (t2) => function(t3, i2) {
|
|
4354
4370
|
var e2 = Gr(t3, i2);
|
|
4355
4371
|
return { name: Wr, processEvent: (t4) => e2(t4) };
|
|
4356
|
-
}(this, t2), this.__request_queue = [], this.__loaded = false, this.analyticsDefaultEndpoint = "/e/", this.Wr = false, this.Gr = null, this.Vr = null, this.Jr = null, this.featureFlags = new Rn(this), this.toolbar = new Qr(this), this.scrollManager = new mo(this), this.pageViewManager = new xs(this), this.surveys = new no(this), this.conversations = new ao(this), this.logs = new lo(this), this.experiments = new Ro(this), this.exceptions = new
|
|
4357
|
-
var r2 =
|
|
4372
|
+
}(this, t2), this.__request_queue = [], this.__loaded = false, this.analyticsDefaultEndpoint = "/e/", this.Wr = false, this.Gr = null, this.Vr = null, this.Jr = null, this.featureFlags = new Rn(this), this.toolbar = new Qr(this), this.scrollManager = new mo(this), this.pageViewManager = new xs(this), this.surveys = new no(this), this.conversations = new ao(this), this.logs = new lo(this), this.experiments = new Ro(this), this.exceptions = new bn(this), this.rateLimiter = new ho(this), this.requestRouter = new Io(this), this.consent = new Mr(this), this.externalIntegrations = new Mo(this), this.people = { set: (t2, i2, e2) => {
|
|
4373
|
+
var r2 = M(t2) ? { [t2]: i2 } : t2;
|
|
4358
4374
|
this.setPersonProperties(r2), null == e2 || e2({});
|
|
4359
4375
|
}, set_once: (t2, i2, e2) => {
|
|
4360
|
-
var r2 =
|
|
4376
|
+
var r2 = M(t2) ? { [t2]: i2 } : t2;
|
|
4361
4377
|
this.setPersonProperties(void 0, r2), null == e2 || e2({});
|
|
4362
4378
|
} }, this.on("eventCaptured", (t2) => $i.info('send "' + (null == t2 ? void 0 : t2.event) + '"', t2));
|
|
4363
4379
|
}
|
|
@@ -4370,18 +4386,18 @@ var PaymentKit = (() => {
|
|
|
4370
4386
|
}
|
|
4371
4387
|
_init(i2, e2, r2) {
|
|
4372
4388
|
var s2;
|
|
4373
|
-
if (void 0 === e2 && (e2 = {}),
|
|
4389
|
+
if (void 0 === e2 && (e2 = {}), O(i2) || A(i2)) return $i.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"), this;
|
|
4374
4390
|
if (this.__loaded) return console.warn("[PostHog.js]", "You have already initialized PostHog! Re-initializing is a no-op"), this;
|
|
4375
4391
|
this.__loaded = true, this.config = {}, e2.debug = this.Kr(e2.debug), this.Yr = e2, this.Xr = [], e2.person_profiles && (this.Vr = e2.person_profiles), this.set_config(Ri({}, Ho(e2.defaults), Bo(e2), { name: r2, token: i2 })), this.config.on_xhr_error && $i.error("on_xhr_error is deprecated. Use on_request_error instead"), this.compression = e2.disable_compression ? void 0 : $s.GZipJS;
|
|
4376
4392
|
var n2 = this.Qr();
|
|
4377
|
-
this.persistence = new
|
|
4393
|
+
this.persistence = new On(this.config, n2), this.sessionPersistence = "sessionStorage" === this.config.persistence || "memory" === this.config.persistence ? this.persistence : new On(g({}, this.config, { persistence: "sessionStorage" }), n2);
|
|
4378
4394
|
var o2 = g({}, this.persistence.props), a2 = g({}, this.sessionPersistence.props);
|
|
4379
4395
|
this.register({ $initialization_time: (/* @__PURE__ */ new Date()).toISOString() }), this.Zr = new po((t2) => this.ts(t2), this.config.request_queue_config), this.es = new _o(this), this.__request_queue = [];
|
|
4380
4396
|
var l2 = "always" === this.config.cookieless_mode || "on_reject" === this.config.cookieless_mode && this.consent.isExplicitlyOptedOut();
|
|
4381
|
-
if (l2 || (this.sessionManager = new xo(this), this.sessionPropsManager = new
|
|
4397
|
+
if (l2 || (this.sessionManager = new xo(this), this.sessionPropsManager = new yo(this, this.sessionManager, this.persistence)), this.config.__preview_deferred_init_extensions ? ($i.info("Deferring extension initialization to improve startup performance"), setTimeout(() => {
|
|
4382
4398
|
this.rs(l2);
|
|
4383
4399
|
}, 0)) : ($i.info("Initializing extensions synchronously"), this.rs(l2)), c.DEBUG = c.DEBUG || this.config.debug, c.DEBUG && $i.info("Starting in debug mode", { this: this, config: e2, thisC: g({}, this.config), p: o2, s: a2 }), void 0 !== (null == (s2 = e2.bootstrap) ? void 0 : s2.distinctID)) {
|
|
4384
|
-
var u2, h2, d2 = this.config.get_device_id(
|
|
4400
|
+
var u2, h2, d2 = this.config.get_device_id(yr()), v2 = null != (u2 = e2.bootstrap) && u2.isIdentifiedID ? d2 : e2.bootstrap.distinctID;
|
|
4385
4401
|
this.persistence.set_property(he, null != (h2 = e2.bootstrap) && h2.isIdentifiedID ? "identified" : "anonymous"), this.register({ distinct_id: e2.bootstrap.distinctID, $device_id: v2 });
|
|
4386
4402
|
}
|
|
4387
4403
|
if (this.ss()) {
|
|
@@ -4400,8 +4416,8 @@ var PaymentKit = (() => {
|
|
|
4400
4416
|
}
|
|
4401
4417
|
if (l2) this.register_once({ distinct_id: me, $device_id: null }, "");
|
|
4402
4418
|
else if (!this.get_distinct_id()) {
|
|
4403
|
-
var
|
|
4404
|
-
this.register_once({ distinct_id:
|
|
4419
|
+
var b2 = this.config.get_device_id(yr());
|
|
4420
|
+
this.register_once({ distinct_id: b2, $device_id: b2 }, ""), this.persistence.set_property(he, "anonymous");
|
|
4405
4421
|
}
|
|
4406
4422
|
return zi(t, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this), { passive: false }), this.toolbar.maybeLoadToolbar(), e2.segment ? qr(this, () => this.ns()) : this.ns(), C(this.config._onCapture) && this.config._onCapture !== No && ($i.warn("onCapture is deprecated. Please use `before_send` instead"), this.on("eventCaptured", (t2) => this.config._onCapture(t2.event, t2))), this.config.ip && $i.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'), this;
|
|
4407
4423
|
}
|
|
@@ -4415,7 +4431,7 @@ var PaymentKit = (() => {
|
|
|
4415
4431
|
var t3;
|
|
4416
4432
|
this.siteApps = new So(this), null == (t3 = this.siteApps) || t3.init();
|
|
4417
4433
|
}), t2 || e2.push(() => {
|
|
4418
|
-
this.sessionRecording = new
|
|
4434
|
+
this.sessionRecording = new Do(this), this.sessionRecording.startIfEnabledOrStop();
|
|
4419
4435
|
}), this.config.disable_scroll_properties || e2.push(() => {
|
|
4420
4436
|
this.scrollManager.startMeasuringScrollPosition();
|
|
4421
4437
|
}), e2.push(() => {
|
|
@@ -4427,7 +4443,7 @@ var PaymentKit = (() => {
|
|
|
4427
4443
|
}), e2.push(() => {
|
|
4428
4444
|
this.conversations.loadIfEnabled();
|
|
4429
4445
|
}), e2.push(() => {
|
|
4430
|
-
this.productTours = new
|
|
4446
|
+
this.productTours = new jn(this), this.productTours.loadIfEnabled();
|
|
4431
4447
|
}), e2.push(() => {
|
|
4432
4448
|
this.heatmaps = new ws(this), this.heatmaps.startIfEnabled();
|
|
4433
4449
|
}), e2.push(() => {
|
|
@@ -4435,11 +4451,11 @@ var PaymentKit = (() => {
|
|
|
4435
4451
|
}), e2.push(() => {
|
|
4436
4452
|
this.exceptionObserver = new Ur(this), this.exceptionObserver.startIfEnabledOrStop();
|
|
4437
4453
|
}), e2.push(() => {
|
|
4438
|
-
this.deadClicksAutocapture = new Lr(this,
|
|
4454
|
+
this.deadClicksAutocapture = new Lr(this, Dr), this.deadClicksAutocapture.startIfEnabled();
|
|
4439
4455
|
}), e2.push(() => {
|
|
4440
4456
|
if (this.os) {
|
|
4441
4457
|
var t3 = this.os;
|
|
4442
|
-
this.os = void 0, this.
|
|
4458
|
+
this.os = void 0, this.yi(t3);
|
|
4443
4459
|
}
|
|
4444
4460
|
}), this.ls(e2, i2);
|
|
4445
4461
|
}
|
|
@@ -4460,20 +4476,24 @@ var PaymentKit = (() => {
|
|
|
4460
4476
|
var r2 = Math.round(performance.now() - i2);
|
|
4461
4477
|
this.register_for_session({ $sdk_debug_extensions_init_method: this.config.__preview_deferred_init_extensions ? "deferred" : "synchronous", $sdk_debug_extensions_init_time_ms: r2 }), this.config.__preview_deferred_init_extensions && $i.info("PostHog extensions initialized (" + r2 + "ms)");
|
|
4462
4478
|
}
|
|
4463
|
-
|
|
4479
|
+
yi(t2) {
|
|
4464
4480
|
var i2, e2, r2, s2, n2, a2, l2, u2, h2;
|
|
4465
4481
|
if (!o || !o.body) return $i.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout(() => {
|
|
4466
|
-
this.
|
|
4482
|
+
this.yi(t2);
|
|
4467
4483
|
}, 500);
|
|
4468
4484
|
this.config.__preview_deferred_init_extensions && (this.os = t2), this.compression = void 0, t2.supportedCompression && !this.config.disable_compression && (this.compression = w(t2.supportedCompression, $s.GZipJS) ? $s.GZipJS : w(t2.supportedCompression, $s.Base64) ? $s.Base64 : void 0), null != (i2 = t2.analytics) && i2.endpoint && (this.analyticsDefaultEndpoint = t2.analytics.endpoint), this.set_config({ person_profiles: this.Vr ? this.Vr : "identified_only" }), null == (e2 = this.siteApps) || e2.onRemoteConfig(t2), null == (r2 = this.sessionRecording) || r2.onRemoteConfig(t2), null == (s2 = this.autocapture) || s2.onRemoteConfig(t2), null == (n2 = this.heatmaps) || n2.onRemoteConfig(t2), this.surveys.onRemoteConfig(t2), this.logs.onRemoteConfig(t2), this.conversations.onRemoteConfig(t2), null == (a2 = this.productTours) || a2.onRemoteConfig(t2), null == (l2 = this.webVitalsAutocapture) || l2.onRemoteConfig(t2), null == (u2 = this.exceptionObserver) || u2.onRemoteConfig(t2), this.exceptions.onRemoteConfig(t2), null == (h2 = this.deadClicksAutocapture) || h2.onRemoteConfig(t2);
|
|
4469
4485
|
}
|
|
4470
4486
|
ns() {
|
|
4471
4487
|
try {
|
|
4472
4488
|
this.config.loaded(this);
|
|
4473
|
-
} catch (
|
|
4474
|
-
$i.critical("`loaded` function failed",
|
|
4489
|
+
} catch (t3) {
|
|
4490
|
+
$i.critical("`loaded` function failed", t3);
|
|
4491
|
+
}
|
|
4492
|
+
if (this.us(), this.config.internal_or_test_user_hostname && null != a && a.hostname) {
|
|
4493
|
+
var t2 = a.hostname, i2 = this.config.internal_or_test_user_hostname;
|
|
4494
|
+
("string" == typeof i2 ? t2 === i2 : i2.test(t2)) && this.setInternalOrTestUser();
|
|
4475
4495
|
}
|
|
4476
|
-
this.
|
|
4496
|
+
this.config.capture_pageview && setTimeout(() => {
|
|
4477
4497
|
(this.consent.isOptedIn() || "always" === this.config.cookieless_mode) && this.hs();
|
|
4478
4498
|
}, 1), new co(this).load(), this.featureFlags.flags();
|
|
4479
4499
|
}
|
|
@@ -4531,21 +4551,21 @@ var PaymentKit = (() => {
|
|
|
4531
4551
|
capture(t2, i2, e2) {
|
|
4532
4552
|
var r2;
|
|
4533
4553
|
if (this.__loaded && this.persistence && this.sessionPersistence && this.Zr) {
|
|
4534
|
-
if (this.is_capturing()) if (!
|
|
4554
|
+
if (this.is_capturing()) if (!O(t2) && M(t2)) {
|
|
4535
4555
|
var s2 = !this.config.opt_out_useragent_filter && this._is_bot();
|
|
4536
4556
|
if (!(s2 && !this.config.__preview_capture_bot_pageviews)) {
|
|
4537
4557
|
var n2 = null != e2 && e2.skip_client_rate_limiting ? void 0 : this.rateLimiter.clientRateLimitContext();
|
|
4538
4558
|
if (null == n2 || !n2.isRateLimited) {
|
|
4539
|
-
null != i2 && i2.$current_url && !
|
|
4540
|
-
var o2 = /* @__PURE__ */ new Date(), a2 = (null == e2 ? void 0 : e2.timestamp) || o2, l2 =
|
|
4559
|
+
null != i2 && i2.$current_url && !M(null == i2 ? void 0 : i2.$current_url) && ($i.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."), null == i2 || delete i2.$current_url), this.sessionPersistence.update_search_keyword(), this.config.save_campaign_params && this.sessionPersistence.update_campaign_params(), this.config.save_referrer && this.sessionPersistence.update_referrer_info(), (this.config.save_campaign_params || this.config.save_referrer) && this.persistence.set_initial_person_info();
|
|
4560
|
+
var o2 = /* @__PURE__ */ new Date(), a2 = (null == e2 ? void 0 : e2.timestamp) || o2, l2 = yr(), u2 = { uuid: l2, event: t2, properties: this.calculateEventProperties(t2, i2 || {}, a2, l2) };
|
|
4541
4561
|
"$pageview" === t2 && this.config.__preview_capture_bot_pageviews && s2 && (u2.event = "$bot_pageview", u2.properties.$browser_type = "bot"), n2 && (u2.properties.$lib_rate_limit_remaining_tokens = n2.remainingTokens), (null == e2 ? void 0 : e2.$set) && (u2.$set = null == e2 ? void 0 : e2.$set);
|
|
4542
4562
|
var h2, d2 = "$groupidentify" !== t2, v2 = this.vs(null == e2 ? void 0 : e2.$set_once, d2);
|
|
4543
|
-
if (v2 && (u2.$set_once = v2), (u2 =
|
|
4563
|
+
if (v2 && (u2.$set_once = v2), (u2 = Di(u2, null != e2 && e2._noTruncate ? null : this.config.properties_string_max_length)).timestamp = a2, O(null == e2 ? void 0 : e2.timestamp) || (u2.properties.$event_time_override_provided = true, u2.properties.$event_time_override_system_time = o2), t2 === Wn.DISMISSED || t2 === Wn.SENT) {
|
|
4544
4564
|
var c2 = null == i2 ? void 0 : i2[Gn.SURVEY_ID], f2 = null == i2 ? void 0 : i2[Gn.SURVEY_ITERATION];
|
|
4545
4565
|
h2 = { id: c2, current_iteration: f2 }, localStorage.getItem(Xn(h2)) || localStorage.setItem(Xn(h2), "true"), u2.$set = g({}, u2.$set, { [Yn({ id: c2, current_iteration: f2 }, t2 === Wn.SENT ? "responded" : "dismissed")]: true });
|
|
4546
4566
|
} else t2 === Wn.SHOWN && (u2.$set = g({}, u2.$set, { [Gn.SURVEY_LAST_SEEN_DATE]: (/* @__PURE__ */ new Date()).toISOString() }));
|
|
4547
4567
|
var p2 = g({}, u2.properties.$set, u2.$set);
|
|
4548
|
-
if (F(p2) || this.setPersonPropertiesForFlags(p2), !
|
|
4568
|
+
if (F(p2) || this.setPersonPropertiesForFlags(p2), !D(this.config.before_send)) {
|
|
4549
4569
|
var _2 = this.cs(u2);
|
|
4550
4570
|
if (!_2) return;
|
|
4551
4571
|
u2 = _2;
|
|
@@ -4567,7 +4587,7 @@ var PaymentKit = (() => {
|
|
|
4567
4587
|
var n2 = s2 ? void 0 : this.persistence.remove_event_timer(t2), a2 = g({}, i2);
|
|
4568
4588
|
if (a2.token = this.config.token, a2.$config_defaults = this.config.defaults, ("always" == this.config.cookieless_mode || "on_reject" == this.config.cookieless_mode && this.consent.isExplicitlyOptedOut()) && (a2.$cookieless_mode = true), "$snapshot" === t2) {
|
|
4569
4589
|
var l2 = g({}, this.persistence.properties(), this.sessionPersistence.properties());
|
|
4570
|
-
return a2.distinct_id = l2.distinct_id, (!
|
|
4590
|
+
return a2.distinct_id = l2.distinct_id, (!M(a2.distinct_id) && !L(a2.distinct_id) || A(a2.distinct_id)) && $i.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"), a2;
|
|
4571
4591
|
}
|
|
4572
4592
|
var u2, h2 = ps(this.config.mask_personal_data_properties, this.config.custom_personal_data_properties);
|
|
4573
4593
|
if (this.sessionManager) {
|
|
@@ -4581,7 +4601,7 @@ var PaymentKit = (() => {
|
|
|
4581
4601
|
} catch (t3) {
|
|
4582
4602
|
a2.$sdk_debug_error_capturing_properties = String(t3);
|
|
4583
4603
|
}
|
|
4584
|
-
if (this.requestRouter.region === Po.CUSTOM && (a2.$lib_custom_api_host = this.config.api_host), u2 = "$pageview" !== t2 || s2 ? "$pageleave" !== t2 || s2 ? this.pageViewManager.doEvent() : this.pageViewManager.doPageLeave(e2) : this.pageViewManager.doPageView(e2, r2), a2 = Ri(a2, u2), "$pageview" === t2 && o && (a2.title = o.title), !
|
|
4604
|
+
if (this.requestRouter.region === Po.CUSTOM && (a2.$lib_custom_api_host = this.config.api_host), u2 = "$pageview" !== t2 || s2 ? "$pageleave" !== t2 || s2 ? this.pageViewManager.doEvent() : this.pageViewManager.doPageLeave(e2) : this.pageViewManager.doPageView(e2, r2), a2 = Ri(a2, u2), "$pageview" === t2 && o && (a2.title = o.title), !O(n2)) {
|
|
4585
4605
|
var p2 = e2.getTime() - n2;
|
|
4586
4606
|
a2.$duration = parseFloat((p2 / 1e3).toFixed(3));
|
|
4587
4607
|
}
|
|
@@ -4642,7 +4662,7 @@ var PaymentKit = (() => {
|
|
|
4642
4662
|
var r2 = null != e2 && e2.merge ? this.featureFlags.getFlagVariants() : {}, s2 = null != e2 && e2.merge ? this.featureFlags.getFlagPayloads() : {}, n2 = g({}, r2, t2), o2 = g({}, s2, i2), a2 = {};
|
|
4643
4663
|
for (var [l2, u2] of Object.entries(n2)) {
|
|
4644
4664
|
var h2 = "string" == typeof u2;
|
|
4645
|
-
a2[l2] = { key: l2, enabled: !!h2 || Boolean(u2), variant: h2 ? u2 : void 0, reason: void 0, metadata:
|
|
4665
|
+
a2[l2] = { key: l2, enabled: !!h2 || Boolean(u2), variant: h2 ? u2 : void 0, reason: void 0, metadata: O(null == o2 ? void 0 : o2[l2]) ? void 0 : { id: 0, version: void 0, description: void 0, payload: o2[l2] } };
|
|
4646
4666
|
}
|
|
4647
4667
|
this.featureFlags.receivedFeatureFlags({ flags: a2 });
|
|
4648
4668
|
}
|
|
@@ -4737,7 +4757,7 @@ var PaymentKit = (() => {
|
|
|
4737
4757
|
var n2 = this.get_property("$device_id");
|
|
4738
4758
|
if (this.consent.reset(), null == (i2 = this.persistence) || i2.clear(), null == (e2 = this.sessionPersistence) || e2.clear(), this.surveys.reset(), this.featureFlags.reset(), null == (r2 = this.persistence) || r2.set_property(he, "anonymous"), null == (s2 = this.sessionManager) || s2.resetSessionId(), this.Jr = null, "always" === this.config.cookieless_mode) this.register_once({ distinct_id: me, $device_id: null }, "");
|
|
4739
4759
|
else {
|
|
4740
|
-
var o2 = this.config.get_device_id(
|
|
4760
|
+
var o2 = this.config.get_device_id(yr());
|
|
4741
4761
|
this.register_once({ distinct_id: o2, $device_id: t2 ? o2 : n2 }, "");
|
|
4742
4762
|
}
|
|
4743
4763
|
this.register({ $last_posthog_reset: (/* @__PURE__ */ new Date()).toISOString() }, 1);
|
|
@@ -4763,7 +4783,7 @@ var PaymentKit = (() => {
|
|
|
4763
4783
|
return r2;
|
|
4764
4784
|
}
|
|
4765
4785
|
alias(t2, i2) {
|
|
4766
|
-
return t2 === this.get_property(Hi) ? ($i.critical("Attempting to create alias for existing People user - aborting."), -2) : this.ps("posthog.alias") ? (
|
|
4786
|
+
return t2 === this.get_property(Hi) ? ($i.critical("Attempting to create alias for existing People user - aborting."), -2) : this.ps("posthog.alias") ? (O(i2) && (i2 = this.get_distinct_id()), t2 !== i2 ? (this.gs(Bi, t2), this.capture("$create_alias", { alias: t2, distinct_id: i2 })) : ($i.warn("alias matches current distinct_id - skipping api call."), this.identify(t2), -1)) : void 0;
|
|
4767
4787
|
}
|
|
4768
4788
|
set_config(t2) {
|
|
4769
4789
|
var i2 = g({}, this.config);
|
|
@@ -4771,7 +4791,7 @@ var PaymentKit = (() => {
|
|
|
4771
4791
|
var e2, r2, s2, n2, o2, a2, l2;
|
|
4772
4792
|
Ri(this.config, Bo(t2));
|
|
4773
4793
|
var u2 = this.Qr();
|
|
4774
|
-
null == (e2 = this.persistence) || e2.update_config(this.config, i2, u2), this.sessionPersistence = "sessionStorage" === this.config.persistence || "memory" === this.config.persistence ? this.persistence : new
|
|
4794
|
+
null == (e2 = this.persistence) || e2.update_config(this.config, i2, u2), this.sessionPersistence = "sessionStorage" === this.config.persistence || "memory" === this.config.persistence ? this.persistence : new On(g({}, this.config, { persistence: "sessionStorage" }), u2);
|
|
4775
4795
|
var h2 = this.Kr(this.config.debug);
|
|
4776
4796
|
U(h2) && (this.config.debug = h2), U(this.config.debug) && (this.config.debug ? (c.DEBUG = true, Pr.H() && Pr.G("ph_debug", "true"), $i.info("set_config", { config: t2, oldConfig: i2, newConfig: g({}, this.config) })) : (c.DEBUG = false, Pr.H() && Pr.V("ph_debug"))), null == (r2 = this.exceptionObserver) || r2.onConfigChange(), null == (s2 = this.sessionRecording) || s2.startIfEnabledOrStop(), null == (n2 = this.autocapture) || n2.startIfEnabled(), null == (o2 = this.heatmaps) || o2.startIfEnabled(), null == (a2 = this.exceptionObserver) || a2.startIfEnabledOrStop(), this.surveys.loadIfEnabled(), this._s(), null == (l2 = this.externalIntegrations) || l2.startIfEnabledOrStop();
|
|
4777
4797
|
}
|
|
@@ -4833,6 +4853,9 @@ var PaymentKit = (() => {
|
|
|
4833
4853
|
createPersonProfile() {
|
|
4834
4854
|
this.fs() || this.ps("posthog.createPersonProfile") && this.setPersonProperties({}, {});
|
|
4835
4855
|
}
|
|
4856
|
+
setInternalOrTestUser() {
|
|
4857
|
+
this.ps("posthog.setInternalOrTestUser") && this.setPersonProperties({ $internal_or_test_user: true });
|
|
4858
|
+
}
|
|
4836
4859
|
ps(t2) {
|
|
4837
4860
|
return "never" === this.config.person_profiles ? ($i.error(t2 + ' was called, but process_person is set to "never". This call will be ignored.'), false) : (this.gs(ge, true), true);
|
|
4838
4861
|
}
|
|
@@ -4851,8 +4874,8 @@ var PaymentKit = (() => {
|
|
|
4851
4874
|
var i2;
|
|
4852
4875
|
if ("always" !== this.config.cookieless_mode) {
|
|
4853
4876
|
var e2, r2, s2;
|
|
4854
|
-
if ("on_reject" === this.config.cookieless_mode && this.consent.isExplicitlyOptedOut()) this.reset(true), null == (e2 = this.sessionManager) || e2.destroy(), null == (r2 = this.pageViewManager) || r2.destroy(), this.sessionManager = new xo(this), this.pageViewManager = new xs(this), this.persistence && (this.sessionPropsManager = new
|
|
4855
|
-
if (this.consent.optInOut(true), this._s(), this.us(), null == (i2 = this.sessionRecording) || i2.startIfEnabledOrStop(), "on_reject" == this.config.cookieless_mode && this.surveys.loadIfEnabled(),
|
|
4877
|
+
if ("on_reject" === this.config.cookieless_mode && this.consent.isExplicitlyOptedOut()) this.reset(true), null == (e2 = this.sessionManager) || e2.destroy(), null == (r2 = this.pageViewManager) || r2.destroy(), this.sessionManager = new xo(this), this.pageViewManager = new xs(this), this.persistence && (this.sessionPropsManager = new yo(this, this.sessionManager, this.persistence)), this.sessionRecording = new Do(this), this.sessionRecording.startIfEnabledOrStop();
|
|
4878
|
+
if (this.consent.optInOut(true), this._s(), this.us(), null == (i2 = this.sessionRecording) || i2.startIfEnabledOrStop(), "on_reject" == this.config.cookieless_mode && this.surveys.loadIfEnabled(), O(null == t2 ? void 0 : t2.captureEventName) || null != t2 && t2.captureEventName) this.capture(null !== (s2 = null == t2 ? void 0 : t2.captureEventName) && void 0 !== s2 ? s2 : "$opt_in", null == t2 ? void 0 : t2.captureProperties, { send_instantly: true });
|
|
4856
4879
|
this.config.capture_pageview && this.hs();
|
|
4857
4880
|
} else $i.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored');
|
|
4858
4881
|
}
|
|
@@ -4868,7 +4891,7 @@ var PaymentKit = (() => {
|
|
|
4868
4891
|
}
|
|
4869
4892
|
get_explicit_consent_status() {
|
|
4870
4893
|
var t2 = this.consent.consent;
|
|
4871
|
-
return t2 ===
|
|
4894
|
+
return t2 === Or.GRANTED ? "granted" : t2 === Or.DENIED ? "denied" : "pending";
|
|
4872
4895
|
}
|
|
4873
4896
|
is_capturing() {
|
|
4874
4897
|
return "always" === this.config.cookieless_mode || ("on_reject" === this.config.cookieless_mode ? this.consent.isExplicitlyOptedOut() || this.consent.isOptedIn() : !this.has_opted_out_capturing());
|
|
@@ -4885,15 +4908,15 @@ var PaymentKit = (() => {
|
|
|
4885
4908
|
debug(i2) {
|
|
4886
4909
|
false === i2 ? (null == t || t.console.log("You've disabled debug mode."), this.set_config({ debug: false })) : (null == t || t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."), this.set_config({ debug: true }));
|
|
4887
4910
|
}
|
|
4888
|
-
|
|
4911
|
+
M() {
|
|
4889
4912
|
var t2, i2, e2, r2, s2, n2, o2, a2 = this.Yr || {};
|
|
4890
|
-
return "advanced_disable_flags" in a2 ? !!a2.advanced_disable_flags : false !== this.config.advanced_disable_flags ? !!this.config.advanced_disable_flags : true === this.config.advanced_disable_decide ? ($i.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."), true) : (e2 = "advanced_disable_decide", r2 = false, s2 = $i, n2 = (i2 = "advanced_disable_flags") in (t2 = a2) && !
|
|
4913
|
+
return "advanced_disable_flags" in a2 ? !!a2.advanced_disable_flags : false !== this.config.advanced_disable_flags ? !!this.config.advanced_disable_flags : true === this.config.advanced_disable_decide ? ($i.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."), true) : (e2 = "advanced_disable_decide", r2 = false, s2 = $i, n2 = (i2 = "advanced_disable_flags") in (t2 = a2) && !D(t2[i2]), o2 = e2 in t2 && !D(t2[e2]), n2 ? t2[i2] : o2 ? (s2 && s2.warn("Config field '" + e2 + "' is deprecated. Please use '" + i2 + "' instead. The old field will be removed in a future major version."), t2[e2]) : r2);
|
|
4891
4914
|
}
|
|
4892
4915
|
cs(t2) {
|
|
4893
|
-
if (
|
|
4916
|
+
if (D(this.config.before_send)) return t2;
|
|
4894
4917
|
var i2 = I(this.config.before_send) ? this.config.before_send : [this.config.before_send], e2 = t2;
|
|
4895
4918
|
for (var r2 of i2) {
|
|
4896
|
-
if (e2 = r2(e2),
|
|
4919
|
+
if (e2 = r2(e2), D(e2)) {
|
|
4897
4920
|
var s2 = "Event '" + t2.event + "' was rejected in beforeSend function";
|
|
4898
4921
|
return H(t2.event) ? $i.warn(s2 + ". This can cause unexpected behavior.") : $i.info(s2), null;
|
|
4899
4922
|
}
|
|
@@ -5105,12 +5128,14 @@ var PaymentKit = (() => {
|
|
|
5105
5128
|
|
|
5106
5129
|
// src/analytics/checkout-timing.ts
|
|
5107
5130
|
var _CheckoutTimingTracker = class _CheckoutTimingTracker {
|
|
5108
|
-
constructor(checkoutSessionId) {
|
|
5131
|
+
constructor(checkoutSessionId, requestId) {
|
|
5109
5132
|
__publicField(this, "startTime");
|
|
5110
5133
|
__publicField(this, "checkoutSessionId");
|
|
5134
|
+
__publicField(this, "requestId");
|
|
5111
5135
|
__publicField(this, "inputReadyTracked", false);
|
|
5112
5136
|
this.startTime = performance.now();
|
|
5113
5137
|
this.checkoutSessionId = checkoutSessionId;
|
|
5138
|
+
this.requestId = requestId;
|
|
5114
5139
|
}
|
|
5115
5140
|
/**
|
|
5116
5141
|
* Track when SDK is initialized and ready.
|
|
@@ -5122,6 +5147,7 @@ var PaymentKit = (() => {
|
|
|
5122
5147
|
_CheckoutTimingTracker.pageReadyTracked = true;
|
|
5123
5148
|
AnalyticsService.capture("checkout_page_ready", {
|
|
5124
5149
|
checkout_session_id: this.checkoutSessionId,
|
|
5150
|
+
request_id: this.requestId,
|
|
5125
5151
|
elapsed_ms: this.getElapsedMs()
|
|
5126
5152
|
});
|
|
5127
5153
|
}
|
|
@@ -5135,6 +5161,7 @@ var PaymentKit = (() => {
|
|
|
5135
5161
|
this.inputReadyTracked = true;
|
|
5136
5162
|
AnalyticsService.capture("checkout_input_ready", {
|
|
5137
5163
|
checkout_session_id: this.checkoutSessionId,
|
|
5164
|
+
request_id: this.requestId,
|
|
5138
5165
|
elapsed_ms: this.getElapsedMs()
|
|
5139
5166
|
});
|
|
5140
5167
|
}
|
|
@@ -5144,6 +5171,7 @@ var PaymentKit = (() => {
|
|
|
5144
5171
|
trackSubmit() {
|
|
5145
5172
|
AnalyticsService.capture("checkout_submit", {
|
|
5146
5173
|
checkout_session_id: this.checkoutSessionId,
|
|
5174
|
+
request_id: this.requestId,
|
|
5147
5175
|
elapsed_ms: this.getElapsedMs()
|
|
5148
5176
|
});
|
|
5149
5177
|
}
|
|
@@ -5156,6 +5184,7 @@ var PaymentKit = (() => {
|
|
|
5156
5184
|
AnalyticsService.capture("checkout_success", {
|
|
5157
5185
|
checkout_session_id: this.checkoutSessionId,
|
|
5158
5186
|
checkout_attempt_id: checkoutAttemptId,
|
|
5187
|
+
request_id: this.requestId,
|
|
5159
5188
|
total_elapsed_ms: this.getElapsedMs()
|
|
5160
5189
|
});
|
|
5161
5190
|
}
|
|
@@ -5170,6 +5199,7 @@ var PaymentKit = (() => {
|
|
|
5170
5199
|
AnalyticsService.capture("checkout_fail", {
|
|
5171
5200
|
checkout_session_id: this.checkoutSessionId,
|
|
5172
5201
|
checkout_attempt_id: checkoutAttemptId,
|
|
5202
|
+
request_id: this.requestId,
|
|
5173
5203
|
error_code: errorCode,
|
|
5174
5204
|
error_message: errorMessage,
|
|
5175
5205
|
total_elapsed_ms: this.getElapsedMs()
|
|
@@ -6013,15 +6043,11 @@ var PaymentKit = (() => {
|
|
|
6013
6043
|
var TunnelXManager = _TunnelXManager;
|
|
6014
6044
|
|
|
6015
6045
|
// src/types.ts
|
|
6016
|
-
var
|
|
6046
|
+
var STATIC_ENVIRONMENT_URLS = {
|
|
6017
6047
|
local: {
|
|
6018
6048
|
baseUrl: "http://localhost:9101",
|
|
6019
6049
|
apiBaseUrl: "http://localhost:9000"
|
|
6020
6050
|
},
|
|
6021
|
-
loclx: {
|
|
6022
|
-
baseUrl: "https://pkmateuscportal.loclx.io",
|
|
6023
|
-
apiBaseUrl: "https://pkmateusapi.loclx.io"
|
|
6024
|
-
},
|
|
6025
6051
|
sandbox: {
|
|
6026
6052
|
baseUrl: "https://staging.paymentkit.com/customer",
|
|
6027
6053
|
apiBaseUrl: "https://staging.paymentkit.com"
|
|
@@ -6031,11 +6057,35 @@ var PaymentKit = (() => {
|
|
|
6031
6057
|
apiBaseUrl: "https://paymentkit.com"
|
|
6032
6058
|
}
|
|
6033
6059
|
};
|
|
6060
|
+
function getTunnelUrls() {
|
|
6061
|
+
if (typeof window !== "undefined") {
|
|
6062
|
+
const params = new URLSearchParams(window.location.search);
|
|
6063
|
+
const apiBaseUrl = params.get("api_base_url");
|
|
6064
|
+
if (apiBaseUrl) {
|
|
6065
|
+
return {
|
|
6066
|
+
baseUrl: window.location.origin,
|
|
6067
|
+
apiBaseUrl
|
|
6068
|
+
};
|
|
6069
|
+
}
|
|
6070
|
+
const hostname = window.location.hostname;
|
|
6071
|
+
if (hostname.includes("loclx.io")) {
|
|
6072
|
+
const apiHostname = hostname.replace(/cportal|playground/, "api");
|
|
6073
|
+
return {
|
|
6074
|
+
baseUrl: `https://${hostname}`,
|
|
6075
|
+
apiBaseUrl: `https://${apiHostname}`
|
|
6076
|
+
};
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
6079
|
+
return STATIC_ENVIRONMENT_URLS.local;
|
|
6080
|
+
}
|
|
6034
6081
|
function getUrlsForEnvironment(environment) {
|
|
6082
|
+
if (environment === "tunnel") {
|
|
6083
|
+
return getTunnelUrls();
|
|
6084
|
+
}
|
|
6035
6085
|
const env = environment;
|
|
6036
|
-
const urls =
|
|
6086
|
+
const urls = STATIC_ENVIRONMENT_URLS[env];
|
|
6037
6087
|
if (!urls) {
|
|
6038
|
-
throw new Error(`Invalid environment: ${environment}. Must be one of: local,
|
|
6088
|
+
throw new Error(`Invalid environment: ${environment}. Must be one of: local, tunnel, sandbox, production`);
|
|
6039
6089
|
}
|
|
6040
6090
|
return urls;
|
|
6041
6091
|
}
|
|
@@ -6056,15 +6106,26 @@ var PaymentKit = (() => {
|
|
|
6056
6106
|
// src/utils/checkout-request-id.ts
|
|
6057
6107
|
var ENV_TO_SLUG = {
|
|
6058
6108
|
local: "dev",
|
|
6059
|
-
|
|
6109
|
+
tunnel: "dev",
|
|
6060
6110
|
sandbox: "stg",
|
|
6061
6111
|
production: "prod"
|
|
6062
6112
|
};
|
|
6113
|
+
var WINDOW_KEY = "__paymentKitRequestId__";
|
|
6063
6114
|
function generateCheckoutRequestId(environment) {
|
|
6064
6115
|
const envSlug = ENV_TO_SLUG[environment] || "dev";
|
|
6065
6116
|
const randomPart = nanoid(12);
|
|
6066
6117
|
return `pk_${envSlug}_${randomPart}`;
|
|
6067
6118
|
}
|
|
6119
|
+
function getOrCreateCheckoutRequestId(environment) {
|
|
6120
|
+
if (typeof window !== "undefined" && window[WINDOW_KEY]) {
|
|
6121
|
+
return window[WINDOW_KEY];
|
|
6122
|
+
}
|
|
6123
|
+
const requestId = generateCheckoutRequestId(environment);
|
|
6124
|
+
if (typeof window !== "undefined") {
|
|
6125
|
+
window[WINDOW_KEY] = requestId;
|
|
6126
|
+
}
|
|
6127
|
+
return requestId;
|
|
6128
|
+
}
|
|
6068
6129
|
function withRequestId(checkoutRequestId) {
|
|
6069
6130
|
return {
|
|
6070
6131
|
headers: {
|
|
@@ -6412,12 +6473,22 @@ var PaymentKit = (() => {
|
|
|
6412
6473
|
};
|
|
6413
6474
|
return { unmount, connection };
|
|
6414
6475
|
};
|
|
6415
|
-
var PaymentKit = ({
|
|
6476
|
+
var PaymentKit = ({
|
|
6477
|
+
environment,
|
|
6478
|
+
secureToken,
|
|
6479
|
+
paymentMethods,
|
|
6480
|
+
cardTokenizationMode,
|
|
6481
|
+
vgsVaultId,
|
|
6482
|
+
vgsEnvironment,
|
|
6483
|
+
__enableAnalyticsTestMode
|
|
6484
|
+
}) => {
|
|
6416
6485
|
const { baseUrl, apiBaseUrl } = getUrlsForEnvironment(environment);
|
|
6417
6486
|
console.log(`[PaymentKit] v${version} initialized (env: ${environment})`);
|
|
6487
|
+
const checkoutRequestId = getOrCreateCheckoutRequestId(environment);
|
|
6488
|
+
console.log(`[PaymentKit] checkout_request_id: ${checkoutRequestId}`);
|
|
6418
6489
|
AnalyticsService.init(apiBaseUrl, __enableAnalyticsTestMode);
|
|
6419
6490
|
AnalyticsService.identify(secureToken);
|
|
6420
|
-
const timingTracker = new CheckoutTimingTracker(secureToken);
|
|
6491
|
+
const timingTracker = new CheckoutTimingTracker(secureToken, checkoutRequestId);
|
|
6421
6492
|
timingTracker.trackPageReady();
|
|
6422
6493
|
const { connection: tunnelXConnection, unmount: unmountTunnelX } = createTunnelXConnection(
|
|
6423
6494
|
baseUrl,
|
|
@@ -6430,8 +6501,53 @@ var PaymentKit = (() => {
|
|
|
6430
6501
|
secureToken,
|
|
6431
6502
|
environment,
|
|
6432
6503
|
tunnelXConnection,
|
|
6433
|
-
timingTracker
|
|
6504
|
+
timingTracker,
|
|
6505
|
+
checkoutRequestId,
|
|
6506
|
+
cardTokenizationMode,
|
|
6507
|
+
vgsVaultId,
|
|
6508
|
+
vgsEnvironment,
|
|
6509
|
+
_sessionConfigReady: void 0
|
|
6434
6510
|
};
|
|
6511
|
+
if (cardTokenizationMode === void 0) {
|
|
6512
|
+
const sessionConfigUrl = `${apiBaseUrl}/api/checkout-sessions/token/${secureToken}`;
|
|
6513
|
+
console.log(
|
|
6514
|
+
`[PaymentKit] cardTokenizationMode not provided \u2014 auto-detecting from session API: ${sessionConfigUrl}`
|
|
6515
|
+
);
|
|
6516
|
+
paymentKitStates._sessionConfigReady = fetch(sessionConfigUrl).then((resp) => {
|
|
6517
|
+
if (!resp.ok) {
|
|
6518
|
+
console.warn(`[PaymentKit] Session config fetch failed with status ${resp.status}`);
|
|
6519
|
+
return null;
|
|
6520
|
+
}
|
|
6521
|
+
return resp.json();
|
|
6522
|
+
}).then((session) => {
|
|
6523
|
+
if (session && typeof session === "object" && typeof session.card_tokenization_mode === "string") {
|
|
6524
|
+
paymentKitStates.cardTokenizationMode = session.card_tokenization_mode || "direct";
|
|
6525
|
+
console.log(
|
|
6526
|
+
`[PaymentKit] Session config detected \u2014 cardTokenizationMode: ${paymentKitStates.cardTokenizationMode}`
|
|
6527
|
+
);
|
|
6528
|
+
const vaultId = session.vgs_vault_id;
|
|
6529
|
+
const vgsEnv = session.vgs_environment;
|
|
6530
|
+
if (vaultId && /^tnt[a-z0-9]+$/.test(vaultId) && (vgsEnv === "sandbox" || vgsEnv === "live")) {
|
|
6531
|
+
paymentKitStates.vgsVaultId = vaultId;
|
|
6532
|
+
paymentKitStates.vgsEnvironment = vgsEnv;
|
|
6533
|
+
console.log(`[PaymentKit] VGS config valid \u2014 vaultId: ${vaultId}, environment: ${vgsEnv}`);
|
|
6534
|
+
} else if (paymentKitStates.cardTokenizationMode === "vgs") {
|
|
6535
|
+
console.warn(
|
|
6536
|
+
`[PaymentKit] Invalid VGS config from session API (vaultId: ${vaultId}, env: ${vgsEnv}), falling back to direct mode`
|
|
6537
|
+
);
|
|
6538
|
+
paymentKitStates.cardTokenizationMode = "direct";
|
|
6539
|
+
}
|
|
6540
|
+
} else {
|
|
6541
|
+
console.log("[PaymentKit] Session response missing card_tokenization_mode \u2014 defaulting to direct mode");
|
|
6542
|
+
paymentKitStates.cardTokenizationMode = "direct";
|
|
6543
|
+
}
|
|
6544
|
+
}).catch((err) => {
|
|
6545
|
+
console.error("[PaymentKit] Session config fetch error \u2014 falling back to direct mode:", err);
|
|
6546
|
+
paymentKitStates.cardTokenizationMode = "direct";
|
|
6547
|
+
});
|
|
6548
|
+
} else {
|
|
6549
|
+
console.log(`[PaymentKit] cardTokenizationMode explicitly set: ${cardTokenizationMode}`);
|
|
6550
|
+
}
|
|
6435
6551
|
const pmInstances = paymentMethods.map((paymentMethod) => paymentMethod(paymentKitStates));
|
|
6436
6552
|
const externalFuncsMapByPm = pmInstances.reduce(
|
|
6437
6553
|
(acc, { name, externalFuncs }) => {
|
|
@@ -6696,6 +6812,82 @@ var PaymentKit = (() => {
|
|
|
6696
6812
|
}
|
|
6697
6813
|
};
|
|
6698
6814
|
|
|
6815
|
+
// src/payment-methods/vgs-collect-loader.ts
|
|
6816
|
+
var VGS_COLLECT_CDN = "https://js.verygoodvault.com/vgs-collect/3.2.1/vgs-collect.js";
|
|
6817
|
+
var loadPromise = null;
|
|
6818
|
+
function loadVgsCollectScript() {
|
|
6819
|
+
if (loadPromise) {
|
|
6820
|
+
console.log("[PaymentKit] VGS Collect CDN load already in progress \u2014 reusing promise");
|
|
6821
|
+
return loadPromise;
|
|
6822
|
+
}
|
|
6823
|
+
loadPromise = new Promise((resolve, reject) => {
|
|
6824
|
+
if (typeof window !== "undefined" && window.VGSCollect) {
|
|
6825
|
+
console.log("[PaymentKit] VGS Collect JS already available on window");
|
|
6826
|
+
resolve();
|
|
6827
|
+
return;
|
|
6828
|
+
}
|
|
6829
|
+
console.log(`[PaymentKit] Loading VGS Collect JS from CDN: ${VGS_COLLECT_CDN}`);
|
|
6830
|
+
const script = document.createElement("script");
|
|
6831
|
+
script.src = VGS_COLLECT_CDN;
|
|
6832
|
+
script.async = true;
|
|
6833
|
+
script.onload = () => {
|
|
6834
|
+
console.log("[PaymentKit] VGS Collect JS loaded successfully from CDN");
|
|
6835
|
+
resolve();
|
|
6836
|
+
};
|
|
6837
|
+
script.onerror = () => {
|
|
6838
|
+
console.error(`[PaymentKit] Failed to load VGS Collect JS from CDN: ${VGS_COLLECT_CDN}`);
|
|
6839
|
+
loadPromise = null;
|
|
6840
|
+
reject(new Error("Failed to load VGS Collect JS"));
|
|
6841
|
+
};
|
|
6842
|
+
document.head.appendChild(script);
|
|
6843
|
+
});
|
|
6844
|
+
return loadPromise;
|
|
6845
|
+
}
|
|
6846
|
+
function initVgsCollect(vaultId, environment) {
|
|
6847
|
+
if (!window.VGSCollect) {
|
|
6848
|
+
throw new Error("VGS Collect JS not loaded. Call loadVgsCollectScript() first.");
|
|
6849
|
+
}
|
|
6850
|
+
return window.VGSCollect.create(vaultId, environment, () => {
|
|
6851
|
+
});
|
|
6852
|
+
}
|
|
6853
|
+
function createVgsCardFields(form, mountPoints, css, onFocusChangeCallbacks) {
|
|
6854
|
+
const fieldCss = css ?? {
|
|
6855
|
+
height: "46px",
|
|
6856
|
+
"font-size": "1rem",
|
|
6857
|
+
color: "#18181b",
|
|
6858
|
+
"font-family": "ui-sans-serif, system-ui, sans-serif"
|
|
6859
|
+
};
|
|
6860
|
+
const panField = form.cardNumberField(mountPoints.pan, {
|
|
6861
|
+
placeholder: "Card number",
|
|
6862
|
+
validations: ["required", "validCardNumber"],
|
|
6863
|
+
css: fieldCss
|
|
6864
|
+
});
|
|
6865
|
+
const expField = form.cardExpirationDateField(mountPoints.exp, {
|
|
6866
|
+
placeholder: "MM / YY",
|
|
6867
|
+
validations: ["required", "validCardExpirationDate"],
|
|
6868
|
+
css: fieldCss
|
|
6869
|
+
});
|
|
6870
|
+
const cvcField = form.cardCVCField(mountPoints.cvc, {
|
|
6871
|
+
placeholder: "123",
|
|
6872
|
+
validations: ["required", "validCardSecurityCode"],
|
|
6873
|
+
css: fieldCss
|
|
6874
|
+
});
|
|
6875
|
+
if (onFocusChangeCallbacks) {
|
|
6876
|
+
const fieldMap = [
|
|
6877
|
+
[panField, "card_pan"],
|
|
6878
|
+
[expField, "card_exp"],
|
|
6879
|
+
[cvcField, "card_cvc"]
|
|
6880
|
+
];
|
|
6881
|
+
for (const [field, key] of fieldMap) {
|
|
6882
|
+
const cb = onFocusChangeCallbacks[key];
|
|
6883
|
+
if (cb) {
|
|
6884
|
+
field.on("focus", () => cb(true));
|
|
6885
|
+
field.on("blur", () => cb(false));
|
|
6886
|
+
}
|
|
6887
|
+
}
|
|
6888
|
+
}
|
|
6889
|
+
}
|
|
6890
|
+
|
|
6699
6891
|
// src/payment-methods/card.ts
|
|
6700
6892
|
var splitName = (fullName) => {
|
|
6701
6893
|
const trimmed = fullName.trim();
|
|
@@ -6725,52 +6917,154 @@ var PaymentKit = (() => {
|
|
|
6725
6917
|
return (type, options) => {
|
|
6726
6918
|
const { style, onLoaded, onFocusChange } = options;
|
|
6727
6919
|
const mountIFrame = (parentSelector) => {
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6920
|
+
let cleanupVgs;
|
|
6921
|
+
let cleanupDirect;
|
|
6922
|
+
let cancelled = false;
|
|
6923
|
+
const doMount = () => {
|
|
6924
|
+
if (cancelled) return;
|
|
6925
|
+
const isVgsMode = states.cardTokenizationMode === "vgs";
|
|
6926
|
+
console.log(
|
|
6927
|
+
`[PaymentKit] card.doMount(${type}) \u2014 mode: ${states.cardTokenizationMode}, vgsVaultId: ${states.vgsVaultId ?? "unset"}, vgsEnvironment: ${states.vgsEnvironment ?? "unset"}`
|
|
6928
|
+
);
|
|
6929
|
+
if (isVgsMode && states.vgsVaultId && states.vgsEnvironment) {
|
|
6930
|
+
if (onFocusChange) {
|
|
6931
|
+
if (!states.vgsFocusCallbacks) states.vgsFocusCallbacks = {};
|
|
6932
|
+
states.vgsFocusCallbacks[type] = onFocusChange;
|
|
6933
|
+
}
|
|
6934
|
+
if (type === "card_pan") {
|
|
6935
|
+
const vaultId = states.vgsVaultId;
|
|
6936
|
+
const vgsEnv = states.vgsEnvironment;
|
|
6937
|
+
console.log(`[PaymentKit] VGS mode active \u2014 loading VGS Collect CDN for vault ${vaultId} (${vgsEnv})...`);
|
|
6938
|
+
const VGS_CDN_TIMEOUT_MS = 15e3;
|
|
6939
|
+
let cdnTimeoutId;
|
|
6940
|
+
Promise.race([
|
|
6941
|
+
loadVgsCollectScript(),
|
|
6942
|
+
new Promise((_2, reject) => {
|
|
6943
|
+
cdnTimeoutId = setTimeout(() => {
|
|
6944
|
+
console.warn(`[PaymentKit] VGS Collect CDN load timed out after ${VGS_CDN_TIMEOUT_MS / 1e3}s`);
|
|
6945
|
+
reject(new Error("VGS Collect CDN load timed out"));
|
|
6946
|
+
}, VGS_CDN_TIMEOUT_MS);
|
|
6947
|
+
})
|
|
6948
|
+
]).finally(() => clearTimeout(cdnTimeoutId)).then(() => {
|
|
6949
|
+
if (cancelled) return;
|
|
6950
|
+
console.log("[PaymentKit] VGS Collect CDN loaded \u2014 initializing form...");
|
|
6951
|
+
const form = initVgsCollect(vaultId, vgsEnv);
|
|
6952
|
+
if (cancelled) {
|
|
6953
|
+
form.unmount();
|
|
6954
|
+
return;
|
|
6955
|
+
}
|
|
6956
|
+
states.vgsForm = form;
|
|
6957
|
+
const css = style ? Object.fromEntries(
|
|
6958
|
+
Object.entries(style).map(([k2, v2]) => [k2.replace(/([A-Z])/g, "-$1").toLowerCase(), v2])
|
|
6959
|
+
) : void 0;
|
|
6960
|
+
const expSelector = parentSelector.replace(/card[-_]pan/, (m2) => m2.replace("pan", "exp"));
|
|
6961
|
+
const cvcSelector = parentSelector.replace(/card[-_]pan/, (m2) => m2.replace("pan", "cvc"));
|
|
6962
|
+
if (expSelector === parentSelector || cvcSelector === parentSelector) {
|
|
6963
|
+
const msg = `[PaymentKit] Failed to derive exp/cvc selectors from "${parentSelector}". Expected a selector containing "card-pan" or "card_pan".`;
|
|
6964
|
+
console.error(msg);
|
|
6965
|
+
onLoaded?.();
|
|
6966
|
+
return;
|
|
6967
|
+
}
|
|
6968
|
+
console.log(
|
|
6969
|
+
`[PaymentKit] Creating VGS card fields \u2014 pan: ${parentSelector}, exp: ${expSelector}, cvc: ${cvcSelector}`
|
|
6970
|
+
);
|
|
6971
|
+
createVgsCardFields(
|
|
6972
|
+
form,
|
|
6973
|
+
{
|
|
6974
|
+
pan: parentSelector,
|
|
6975
|
+
exp: expSelector,
|
|
6976
|
+
cvc: cvcSelector
|
|
6977
|
+
},
|
|
6978
|
+
css,
|
|
6979
|
+
states.vgsFocusCallbacks
|
|
6980
|
+
);
|
|
6981
|
+
console.log("[PaymentKit] VGS card fields created successfully");
|
|
6982
|
+
timingTracker.trackInputReady();
|
|
6983
|
+
onLoaded?.();
|
|
6984
|
+
}).catch((err) => {
|
|
6985
|
+
console.error("[PaymentKit] Failed to load VGS Collect script. Card input will not be available:", err);
|
|
6986
|
+
onLoaded?.();
|
|
6987
|
+
});
|
|
6988
|
+
}
|
|
6989
|
+
if (type !== "card_pan") {
|
|
6990
|
+
onLoaded?.();
|
|
6991
|
+
}
|
|
6992
|
+
cleanupVgs = () => {
|
|
6993
|
+
if (type === "card_pan" && states.vgsForm) {
|
|
6994
|
+
states.vgsForm.unmount();
|
|
6995
|
+
states.vgsForm = void 0;
|
|
6996
|
+
}
|
|
6997
|
+
};
|
|
6998
|
+
return;
|
|
6999
|
+
}
|
|
7000
|
+
if (isVgsMode) {
|
|
7001
|
+
console.warn(
|
|
7002
|
+
`[PaymentKit] VGS mode requested but config incomplete (vgsVaultId: ${states.vgsVaultId ?? "unset"}, vgsEnvironment: ${states.vgsEnvironment ?? "unset"}) \u2014 using direct mode`
|
|
7003
|
+
);
|
|
7004
|
+
}
|
|
7005
|
+
const parent = $(parentSelector);
|
|
7006
|
+
const params = {
|
|
7007
|
+
checkout_token: secureToken,
|
|
7008
|
+
api_base_url: apiBaseUrl
|
|
7009
|
+
};
|
|
7010
|
+
if (style) {
|
|
7011
|
+
params.style = JSON.stringify(style);
|
|
7012
|
+
}
|
|
7013
|
+
const iframe = createCheckoutIFrame(type.replace("_", "-"), baseUrl, params);
|
|
7014
|
+
cleanupDirect = () => {
|
|
7015
|
+
const connection = cardInputConnections[type];
|
|
7016
|
+
connection?.destroy();
|
|
7017
|
+
parent.removeChild(iframe);
|
|
7018
|
+
states.cardInputConnections[type] = void 0;
|
|
7019
|
+
};
|
|
7020
|
+
parent.appendChild(iframe);
|
|
7021
|
+
iframe.onload = () => {
|
|
7022
|
+
if (type === "card_pan") {
|
|
7023
|
+
timingTracker.trackInputReady();
|
|
7024
|
+
}
|
|
7025
|
+
const connection = connectToCardIframe(iframe, {
|
|
7026
|
+
onLoaded: onLoaded || (() => {
|
|
7027
|
+
}),
|
|
7028
|
+
onFocusChange: onFocusChange || (() => {
|
|
7029
|
+
})
|
|
7030
|
+
});
|
|
7031
|
+
states.cardInputConnections[type] = connection;
|
|
7032
|
+
};
|
|
6732
7033
|
};
|
|
6733
|
-
if (
|
|
6734
|
-
|
|
7034
|
+
if (states._sessionConfigReady) {
|
|
7035
|
+
states._sessionConfigReady.then(doMount);
|
|
7036
|
+
} else {
|
|
7037
|
+
doMount();
|
|
6735
7038
|
}
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
7039
|
+
return {
|
|
7040
|
+
unmount: () => {
|
|
7041
|
+
cancelled = true;
|
|
7042
|
+
cleanupVgs?.();
|
|
7043
|
+
cleanupDirect?.();
|
|
6741
7044
|
}
|
|
6742
|
-
const connection = connectToCardIframe(iframe, {
|
|
6743
|
-
onLoaded: onLoaded || (() => {
|
|
6744
|
-
}),
|
|
6745
|
-
onFocusChange: onFocusChange || (() => {
|
|
6746
|
-
})
|
|
6747
|
-
});
|
|
6748
|
-
states.cardInputConnections[type] = connection;
|
|
6749
|
-
};
|
|
6750
|
-
const unmount = () => {
|
|
6751
|
-
const connection = cardInputConnections[type];
|
|
6752
|
-
connection?.destroy();
|
|
6753
|
-
parent.removeChild(iframe);
|
|
6754
|
-
states.cardInputConnections[type] = void 0;
|
|
6755
7045
|
};
|
|
6756
|
-
return { unmount };
|
|
6757
7046
|
};
|
|
6758
7047
|
return { mount: mountIFrame };
|
|
6759
7048
|
};
|
|
6760
7049
|
};
|
|
6761
7050
|
var defSubmitPayment = (states) => {
|
|
6762
7051
|
const submitPayment = async (fields) => {
|
|
6763
|
-
|
|
7052
|
+
if (states._sessionConfigReady) await states._sessionConfigReady;
|
|
7053
|
+
const isVgsMode = states.cardTokenizationMode === "vgs";
|
|
7054
|
+
const { timingTracker, checkoutRequestId } = states;
|
|
6764
7055
|
timingTracker.trackSubmit();
|
|
6765
|
-
const checkoutRequestId = generateCheckoutRequestId(environment);
|
|
6766
7056
|
const requestOptions = withRequestId(checkoutRequestId);
|
|
6767
|
-
console.log(`[Card] Generated checkout_request_id: ${checkoutRequestId}`);
|
|
6768
7057
|
const tunnelX = await TunnelXManager.createFromPenpalConnection(states.tunnelXConnection);
|
|
6769
|
-
const validateCardResult = await validateCardFields(states);
|
|
6770
7058
|
const validateFormResult = await validateFormFields(fields);
|
|
6771
|
-
if (!
|
|
7059
|
+
if (!isVgsMode) {
|
|
7060
|
+
const validateCardResult = await validateCardFields(states);
|
|
7061
|
+
if (!(validateCardResult.isSuccess && validateFormResult.isSuccess)) {
|
|
7062
|
+
timingTracker.trackFail(null, "validation_error", "Form validation failed");
|
|
7063
|
+
return { errors: { ...validateCardResult.errors, ...validateFormResult.errors } };
|
|
7064
|
+
}
|
|
7065
|
+
} else if (!validateFormResult.isSuccess) {
|
|
6772
7066
|
timingTracker.trackFail(null, "validation_error", "Form validation failed");
|
|
6773
|
-
return { errors:
|
|
7067
|
+
return { errors: validateFormResult.errors };
|
|
6774
7068
|
}
|
|
6775
7069
|
if (!states.cardSetupIntentId) {
|
|
6776
7070
|
const res = await tunnelX.publicEndpoints.createCardSetupIntent({
|
|
@@ -6778,10 +7072,19 @@ var PaymentKit = (() => {
|
|
|
6778
7072
|
});
|
|
6779
7073
|
states.cardSetupIntentId = res.cardSetupIntentId;
|
|
6780
7074
|
}
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
7075
|
+
if (isVgsMode) {
|
|
7076
|
+
console.log("[PaymentKit] Submitting card via VGS CMP...");
|
|
7077
|
+
const vgsSubmitResult = await submitVgsCardFields(states, tunnelX);
|
|
7078
|
+
if (!vgsSubmitResult.isSuccess) {
|
|
7079
|
+
timingTracker.trackFail(null, "card_submit_error", "VGS card submission failed");
|
|
7080
|
+
return { errors: vgsSubmitResult.errors };
|
|
7081
|
+
}
|
|
7082
|
+
} else {
|
|
7083
|
+
const submitCardResult = await submitCardFields(states);
|
|
7084
|
+
if (!submitCardResult.isSuccess) {
|
|
7085
|
+
timingTracker.trackFail(null, "card_submit_error", "Card submission failed");
|
|
7086
|
+
return { errors: submitCardResult.errors };
|
|
7087
|
+
}
|
|
6785
7088
|
}
|
|
6786
7089
|
const cardSetupIntent = await tunnelX.publicEndpoints.getCardSetupIntent({
|
|
6787
7090
|
cardSetupIntentId: states.cardSetupIntentId,
|
|
@@ -6874,6 +7177,70 @@ var PaymentKit = (() => {
|
|
|
6874
7177
|
};
|
|
6875
7178
|
return submitPayment;
|
|
6876
7179
|
};
|
|
7180
|
+
var fetchCollectToken = async (apiBaseUrl, secureToken) => {
|
|
7181
|
+
const resp = await fetch(`${apiBaseUrl}/api/card-setup-intents/${secureToken}/collect-token`, {
|
|
7182
|
+
method: "POST",
|
|
7183
|
+
headers: { "Content-Type": "application/json" }
|
|
7184
|
+
});
|
|
7185
|
+
if (!resp.ok) {
|
|
7186
|
+
throw new Error(`Failed to get collect token: ${resp.status}`);
|
|
7187
|
+
}
|
|
7188
|
+
const data = await resp.json();
|
|
7189
|
+
return data.access_token;
|
|
7190
|
+
};
|
|
7191
|
+
var submitVgsCardFields = async (states, tunnelX) => {
|
|
7192
|
+
const { vgsForm, cardSetupIntentId, secureToken, apiBaseUrl } = states;
|
|
7193
|
+
const errors = {};
|
|
7194
|
+
if (!vgsForm) {
|
|
7195
|
+
errors.card_pan = "required";
|
|
7196
|
+
return { errors, isSuccess: false };
|
|
7197
|
+
}
|
|
7198
|
+
if (!cardSetupIntentId) {
|
|
7199
|
+
errors.root = "Card setup intent not created";
|
|
7200
|
+
return { errors, isSuccess: false };
|
|
7201
|
+
}
|
|
7202
|
+
try {
|
|
7203
|
+
const accessToken = await fetchCollectToken(apiBaseUrl, secureToken);
|
|
7204
|
+
const VGS_CREATE_CARD_TIMEOUT_MS = 3e4;
|
|
7205
|
+
let createCardTimeoutId;
|
|
7206
|
+
const cardResult = await Promise.race([
|
|
7207
|
+
new Promise((resolve, reject) => {
|
|
7208
|
+
vgsForm.createCard(
|
|
7209
|
+
{
|
|
7210
|
+
auth: accessToken,
|
|
7211
|
+
data: { cardholder: {} }
|
|
7212
|
+
},
|
|
7213
|
+
(_status, cardObject) => resolve(cardObject),
|
|
7214
|
+
(error) => reject(error)
|
|
7215
|
+
);
|
|
7216
|
+
}),
|
|
7217
|
+
new Promise((_2, reject) => {
|
|
7218
|
+
createCardTimeoutId = setTimeout(
|
|
7219
|
+
() => reject(new Error("VGS createCard timed out")),
|
|
7220
|
+
VGS_CREATE_CARD_TIMEOUT_MS
|
|
7221
|
+
);
|
|
7222
|
+
})
|
|
7223
|
+
]).finally(() => clearTimeout(createCardTimeoutId));
|
|
7224
|
+
const { pan_alias, cvc_alias, exp_month, exp_year } = cardResult.data.attributes;
|
|
7225
|
+
const fullYear = exp_year < 100 ? 2e3 + exp_year : exp_year;
|
|
7226
|
+
const formattedExp = `${String(exp_month).padStart(2, "0")}/${fullYear}`;
|
|
7227
|
+
await tunnelX.publicEndpoints.updateCardSetupIntent({
|
|
7228
|
+
checkoutToken: secureToken,
|
|
7229
|
+
cardSetupIntentId,
|
|
7230
|
+
updateCardSetupIntentReq: {
|
|
7231
|
+
cardPan: pan_alias,
|
|
7232
|
+
cardExp: formattedExp,
|
|
7233
|
+
cardCvc: cvc_alias,
|
|
7234
|
+
fraudMetadata: collectFraudMetadata()
|
|
7235
|
+
}
|
|
7236
|
+
});
|
|
7237
|
+
return { errors: {}, isSuccess: true };
|
|
7238
|
+
} catch (err) {
|
|
7239
|
+
console.error("[PaymentKit] VGS CMP createCard failed:", err);
|
|
7240
|
+
errors.root = "Card submission failed";
|
|
7241
|
+
return { errors, isSuccess: false };
|
|
7242
|
+
}
|
|
7243
|
+
};
|
|
6877
7244
|
var submitCardFields = async (states) => {
|
|
6878
7245
|
const errors = {};
|
|
6879
7246
|
const { cardSetupIntentId, cardInputConnections } = states;
|
|
@@ -6913,7 +7280,8 @@ var PaymentKit = (() => {
|
|
|
6913
7280
|
};
|
|
6914
7281
|
};
|
|
6915
7282
|
var CardPaymentMethod = definePaymentMethod((paymentKitStates) => {
|
|
6916
|
-
const localStates =
|
|
7283
|
+
const localStates = Object.create(paymentKitStates);
|
|
7284
|
+
localStates.cardInputConnections = {};
|
|
6917
7285
|
return {
|
|
6918
7286
|
name: "card",
|
|
6919
7287
|
externalFuncs: {
|
|
@@ -6922,6 +7290,10 @@ var PaymentKit = (() => {
|
|
|
6922
7290
|
internalFuncs: {
|
|
6923
7291
|
submitPayment: defSubmitPayment(localStates),
|
|
6924
7292
|
cleanup: () => {
|
|
7293
|
+
if (localStates.vgsForm) {
|
|
7294
|
+
localStates.vgsForm.unmount();
|
|
7295
|
+
localStates.vgsForm = void 0;
|
|
7296
|
+
}
|
|
6925
7297
|
for (const connection of Object.values(localStates.cardInputConnections)) {
|
|
6926
7298
|
connection?.destroy();
|
|
6927
7299
|
}
|
|
@@ -7240,9 +7612,6 @@ var PaymentKit = (() => {
|
|
|
7240
7612
|
if (!options?.processorId) {
|
|
7241
7613
|
return { processor_id: "Processor ID is required" };
|
|
7242
7614
|
}
|
|
7243
|
-
if (!options?.customerInfo?.first_name || !options?.customerInfo?.last_name) {
|
|
7244
|
-
return { customer_name: "Customer first and last name are required" };
|
|
7245
|
-
}
|
|
7246
7615
|
return null;
|
|
7247
7616
|
}
|
|
7248
7617
|
function getMockScenarioStr(mockScenario) {
|
|
@@ -7452,8 +7821,8 @@ var PaymentKit = (() => {
|
|
|
7452
7821
|
}
|
|
7453
7822
|
try {
|
|
7454
7823
|
const mockScenarioStr = getMockScenarioStr(gpayOptions.mockScenario);
|
|
7455
|
-
const checkoutRequestId =
|
|
7456
|
-
console.log(`[GooglePay]
|
|
7824
|
+
const checkoutRequestId = getOrCreateCheckoutRequestId(environment);
|
|
7825
|
+
console.log(`[GooglePay] Using checkout_request_id: ${checkoutRequestId}`);
|
|
7457
7826
|
const startResult = await callStartEndpoint(
|
|
7458
7827
|
apiBaseUrl,
|
|
7459
7828
|
secureToken,
|
|
@@ -7524,8 +7893,8 @@ var PaymentKit = (() => {
|
|
|
7524
7893
|
};
|
|
7525
7894
|
}
|
|
7526
7895
|
try {
|
|
7527
|
-
const checkoutRequestId =
|
|
7528
|
-
console.log(`[PayPal]
|
|
7896
|
+
const checkoutRequestId = getOrCreateCheckoutRequestId(environment);
|
|
7897
|
+
console.log(`[PayPal] Using checkout_request_id: ${checkoutRequestId}`);
|
|
7529
7898
|
const startResponse = await fetch(`${apiBaseUrl}/api/checkout/${secureToken}/paypal/start`, {
|
|
7530
7899
|
method: "POST",
|
|
7531
7900
|
headers: {
|