@twick/timeline 0.15.8 → 0.15.10
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/index.js +143 -121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -121
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3403,7 +3403,7 @@ if (typeof window !== "undefined") {
|
|
|
3403
3403
|
var t = "undefined" != typeof window ? window : void 0, i = "undefined" != typeof globalThis ? globalThis : t;
|
|
3404
3404
|
"undefined" == typeof self && (i.self = i), "undefined" == typeof File && (i.File = function() {
|
|
3405
3405
|
});
|
|
3406
|
-
var e = Array.prototype, r = e.forEach, s = e.indexOf, n = null == i ? void 0 : i.navigator, o = null == i ? void 0 : i.document, a = null == i ? void 0 : i.location, l = null == i ? void 0 : i.fetch, u = null != i && i.XMLHttpRequest && "withCredentials" in new i.XMLHttpRequest() ? i.XMLHttpRequest : void 0, h = null == i ? void 0 : i.AbortController, d = null == n ? void 0 : n.userAgent, v = null != t ? t : {}, c = { DEBUG: false, LIB_VERSION: "1.
|
|
3406
|
+
var e = Array.prototype, r = e.forEach, s = e.indexOf, n = null == i ? void 0 : i.navigator, o = null == i ? void 0 : i.document, a = null == i ? void 0 : i.location, l = null == i ? void 0 : i.fetch, u = null != i && i.XMLHttpRequest && "withCredentials" in new i.XMLHttpRequest() ? i.XMLHttpRequest : void 0, h = null == i ? void 0 : i.AbortController, d = null == n ? void 0 : n.userAgent, v = null != t ? t : {}, c = { DEBUG: false, LIB_VERSION: "1.335.5" };
|
|
3407
3407
|
function f(t2, i2, e2, r2, s2, n2, o2) {
|
|
3408
3408
|
try {
|
|
3409
3409
|
var a2 = t2[n2](o2), l2 = a2.value;
|
|
@@ -3890,8 +3890,12 @@ var Ei = function(i2, e2) {
|
|
|
3890
3890
|
if (r3.type = "text/javascript", r3.crossOrigin = "anonymous", r3.src = i2, r3.onload = (t3) => {
|
|
3891
3891
|
r3.__posthog_loading_callback_fired = true, e2(void 0, t3);
|
|
3892
3892
|
}, r3.onerror = (t3) => e2(t3), t2.config.prepare_external_dependency_script && (r3 = t2.config.prepare_external_dependency_script(r3)), !r3) return e2("prepare_external_dependency_script returned null");
|
|
3893
|
-
|
|
3894
|
-
|
|
3893
|
+
if ("head" === t2.config.external_scripts_inject_target) o.head.appendChild(r3);
|
|
3894
|
+
else {
|
|
3895
|
+
var s3, n3 = o.querySelectorAll("body > script");
|
|
3896
|
+
if (n3.length > 0) null == (s3 = n3[0].parentNode) || s3.insertBefore(r3, n3[0]);
|
|
3897
|
+
else o.body.appendChild(r3);
|
|
3898
|
+
}
|
|
3895
3899
|
};
|
|
3896
3900
|
null != o && o.body ? l2() : null == o || o.addEventListener("DOMContentLoaded", l2);
|
|
3897
3901
|
};
|
|
@@ -5034,8 +5038,10 @@ class ms {
|
|
|
5034
5038
|
else this.N.url !== r2 && (this.Pt(), this.Tt = setTimeout(this.Pt, this.flushToCaptureTimeoutMs)), M(this.N.url) && (this.N.url = r2), this.N.firstMetricTimestamp = M(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();
|
|
5035
5039
|
}
|
|
5036
5040
|
}, this.rt = () => {
|
|
5037
|
-
|
|
5038
|
-
|
|
5041
|
+
if (!this.P) {
|
|
5042
|
+
var t3, i3, e2, r2, s2 = v.__PosthogExtensions__;
|
|
5043
|
+
M(s2) || M(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");
|
|
5044
|
+
}
|
|
5039
5045
|
}, this._instance = t2, this.kt = !(null == (i2 = this._instance.persistence) || !i2.props[Yi]), this.startIfEnabled();
|
|
5040
5046
|
}
|
|
5041
5047
|
get allowedMetrics() {
|
|
@@ -5045,6 +5051,10 @@ class ms {
|
|
|
5045
5051
|
get flushToCaptureTimeoutMs() {
|
|
5046
5052
|
return (R(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_delayed_flush_ms : void 0) || 5e3;
|
|
5047
5053
|
}
|
|
5054
|
+
get useAttribution() {
|
|
5055
|
+
var t2 = R(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_attribution : void 0;
|
|
5056
|
+
return null == t2 || t2;
|
|
5057
|
+
}
|
|
5048
5058
|
get Rt() {
|
|
5049
5059
|
var t2 = R(this._instance.config.capture_performance) && L(this._instance.config.capture_performance.__web_vitals_max_value) ? this._instance.config.capture_performance.__web_vitals_max_value : _s;
|
|
5050
5060
|
return 0 < t2 && t2 <= 6e4 ? _s : t2;
|
|
@@ -5064,8 +5074,13 @@ class ms {
|
|
|
5064
5074
|
}
|
|
5065
5075
|
it(t2) {
|
|
5066
5076
|
var i2, e2;
|
|
5067
|
-
null != (i2 = v.__PosthogExtensions__) && i2.postHogWebVitalsCallbacks
|
|
5068
|
-
|
|
5077
|
+
null != (i2 = v.__PosthogExtensions__) && i2.postHogWebVitalsCallbacks ? t2() : null == (e2 = v.__PosthogExtensions__) || null == e2.loadExternalDependency || e2.loadExternalDependency(this._instance, "web-vitals", (i3) => {
|
|
5078
|
+
var e3;
|
|
5079
|
+
if (i3) gs.error("failed to load script", i3);
|
|
5080
|
+
else {
|
|
5081
|
+
var r2 = null == (e3 = v.__PosthogExtensions__) ? void 0 : e3.loadWebVitalsCallbacks;
|
|
5082
|
+
r2 ? (r2(this.useAttribution), t2()) : t2();
|
|
5083
|
+
}
|
|
5069
5084
|
});
|
|
5070
5085
|
}
|
|
5071
5086
|
Ct() {
|
|
@@ -5621,23 +5636,23 @@ var bn = Si("[FeatureFlags]"), wn = Si("[FeatureFlags]", { debugEnabled: true })
|
|
|
5621
5636
|
}({});
|
|
5622
5637
|
class Rn {
|
|
5623
5638
|
constructor(t2) {
|
|
5624
|
-
this.oi = false, this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this._instance = t2, this.featureFlagEventHandlers = [];
|
|
5639
|
+
this.oi = false, this.ai = false, this.li = false, this.ui = false, this.hi = false, this.di = false, this.vi = false, this.ci = false, this._instance = t2, this.featureFlagEventHandlers = [];
|
|
5625
5640
|
}
|
|
5626
|
-
|
|
5627
|
-
var t2 = this._instance.config.evaluation_environments;
|
|
5628
|
-
return null !=
|
|
5629
|
-
var
|
|
5630
|
-
return
|
|
5641
|
+
fi() {
|
|
5642
|
+
var t2, i2 = null !== (t2 = this._instance.config.evaluation_contexts) && void 0 !== t2 ? t2 : this._instance.config.evaluation_environments;
|
|
5643
|
+
return !this._instance.config.evaluation_environments || this._instance.config.evaluation_contexts || this.ci || (bn.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) => {
|
|
5644
|
+
var i3 = t3 && "string" == typeof t3 && t3.trim().length > 0;
|
|
5645
|
+
return i3 || bn.error("Invalid evaluation context found:", t3, "Expected non-empty string"), i3;
|
|
5631
5646
|
}) : [];
|
|
5632
5647
|
}
|
|
5633
|
-
|
|
5634
|
-
return this.
|
|
5648
|
+
pi() {
|
|
5649
|
+
return this.fi().length > 0;
|
|
5635
5650
|
}
|
|
5636
5651
|
flags() {
|
|
5637
5652
|
if (this._instance.config.__preview_remote_config) this.di = true;
|
|
5638
5653
|
else {
|
|
5639
|
-
var t2 = !this.
|
|
5640
|
-
this.
|
|
5654
|
+
var t2 = !this.gi && (this._instance.config.advanced_disable_feature_flags || this._instance.config.advanced_disable_feature_flags_on_first_load);
|
|
5655
|
+
this.mi({ disableFlags: t2 });
|
|
5641
5656
|
}
|
|
5642
5657
|
}
|
|
5643
5658
|
get hasLoadedFlags() {
|
|
@@ -5670,15 +5685,15 @@ class Rn {
|
|
|
5670
5685
|
return this.oi || (bn.warn(" Overriding feature flag payloads!", { flagPayloads: t2, overriddenPayloads: i2, finalPayloads: e2 }), this.oi = true), e2;
|
|
5671
5686
|
}
|
|
5672
5687
|
reloadFeatureFlags() {
|
|
5673
|
-
this.ui || this._instance.config.advanced_disable_feature_flags || this.
|
|
5674
|
-
this.
|
|
5688
|
+
this.ui || this._instance.config.advanced_disable_feature_flags || this.gi || (this.gi = setTimeout(() => {
|
|
5689
|
+
this.mi();
|
|
5675
5690
|
}, 5));
|
|
5676
5691
|
}
|
|
5677
|
-
|
|
5678
|
-
clearTimeout(this.
|
|
5692
|
+
yi() {
|
|
5693
|
+
clearTimeout(this.gi), this.gi = void 0;
|
|
5679
5694
|
}
|
|
5680
5695
|
ensureFlagsLoaded() {
|
|
5681
|
-
this.ai || this.li || this.
|
|
5696
|
+
this.ai || this.li || this.gi || this.reloadFeatureFlags();
|
|
5682
5697
|
}
|
|
5683
5698
|
setAnonymousDistinctId(t2) {
|
|
5684
5699
|
this.$anon_distinct_id = t2;
|
|
@@ -5686,21 +5701,21 @@ class Rn {
|
|
|
5686
5701
|
setReloadingPaused(t2) {
|
|
5687
5702
|
this.ui = t2;
|
|
5688
5703
|
}
|
|
5689
|
-
|
|
5704
|
+
mi(t2) {
|
|
5690
5705
|
var i2;
|
|
5691
|
-
if (this.
|
|
5706
|
+
if (this.yi(), !this._instance.O()) if (this.li) this.hi = true;
|
|
5692
5707
|
else {
|
|
5693
5708
|
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) };
|
|
5694
|
-
D(r2) || M(r2) || (s2.$device_id = r2), (null != t2 && t2.disableFlags || this._instance.config.advanced_disable_feature_flags) && (s2.disable_flags = true), this.
|
|
5709
|
+
D(r2) || M(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());
|
|
5695
5710
|
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);
|
|
5696
5711
|
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) => {
|
|
5697
5712
|
var i3, e3, r3 = true;
|
|
5698
|
-
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.
|
|
5713
|
+
(200 === t3.statusCode && (this.hi || (this.$anon_distinct_id = void 0), r3 = false), this.li = false, this.di) || (this.di = true, this._instance.bi(null !== (e3 = t3.json) && void 0 !== e3 ? e3 : {}));
|
|
5699
5714
|
if (!s2.disable_flags || this.hi) if (this.vi = !r3, t3.json && null != (i3 = t3.json.quotaLimited) && i3.includes(Cn.FeatureFlags)) bn.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.");
|
|
5700
5715
|
else {
|
|
5701
5716
|
var n3;
|
|
5702
5717
|
if (!s2.disable_flags) this.receivedFeatureFlags(null !== (n3 = t3.json) && void 0 !== n3 ? n3 : {}, r3);
|
|
5703
|
-
this.hi && (this.hi = false, this.
|
|
5718
|
+
this.hi && (this.hi = false, this.mi());
|
|
5704
5719
|
}
|
|
5705
5720
|
} });
|
|
5706
5721
|
}
|
|
@@ -5729,7 +5744,7 @@ class Rn {
|
|
|
5729
5744
|
}
|
|
5730
5745
|
getRemoteConfigPayload(t2, i2) {
|
|
5731
5746
|
var e2 = this._instance.config.token, r2 = { distinct_id: this._instance.get_distinct_id(), token: e2 };
|
|
5732
|
-
this.
|
|
5747
|
+
this.pi() && (r2.evaluation_contexts = this.fi()), this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("flags", "/flags/?v=2&config=true"), data: r2, compression: this._instance.config.disable_compression ? void 0 : $s.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (e3) => {
|
|
5733
5748
|
var r3, s2 = null == (r3 = e3.json) ? void 0 : r3.featureFlagPayloads;
|
|
5734
5749
|
i2((null == s2 ? void 0 : s2[t2]) || void 0);
|
|
5735
5750
|
} });
|
|
@@ -5766,7 +5781,7 @@ class Rn {
|
|
|
5766
5781
|
t3.errorsWhileComputingFlags && (c2 = g({}, e3, c2), f2 = g({}, r3, f2), p2 = g({}, s3, p2)), i3 && i3.register(g({ [xn]: Object.keys(Tn(c2)), [re]: c2 || {}, [$n]: f2 || {}, [ne]: p2 || {} }, u2 ? { [kn]: u2 } : {}, h2 ? { [Pn]: h2 } : {}));
|
|
5767
5782
|
}
|
|
5768
5783
|
}
|
|
5769
|
-
}(t2, this._instance.persistence, e2, r2, s2), this.
|
|
5784
|
+
}(t2, this._instance.persistence, e2, r2, s2), this.wi(i2);
|
|
5770
5785
|
}
|
|
5771
5786
|
}
|
|
5772
5787
|
override(t2, i2) {
|
|
@@ -5774,7 +5789,7 @@ class Rn {
|
|
|
5774
5789
|
}
|
|
5775
5790
|
overrideFeatureFlags(t2) {
|
|
5776
5791
|
if (!this._instance.__loaded || !this._instance.persistence) return bn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");
|
|
5777
|
-
if (false === t2) return this._instance.persistence.unregister(En), this._instance.persistence.unregister(Sn), this.
|
|
5792
|
+
if (false === t2) return this._instance.persistence.unregister(En), this._instance.persistence.unregister(Sn), this.wi(), wn.info("All overrides cleared");
|
|
5778
5793
|
if (t2 && "object" == typeof t2 && ("flags" in t2 || "payloads" in t2)) {
|
|
5779
5794
|
var i2, e2 = t2;
|
|
5780
5795
|
if (this.oi = Boolean(null !== (i2 = e2.suppressWarning) && void 0 !== i2 && i2), "flags" in e2) {
|
|
@@ -5787,13 +5802,13 @@ class Rn {
|
|
|
5787
5802
|
wn.info("Flag overrides set", { flags: e2.flags });
|
|
5788
5803
|
}
|
|
5789
5804
|
}
|
|
5790
|
-
return "payloads" in e2 && (false === e2.payloads ? (this._instance.persistence.unregister(Sn), wn.info("Payload overrides cleared")) : e2.payloads && (this._instance.persistence.register({ [Sn]: e2.payloads }), wn.info("Payload overrides set", { payloads: e2.payloads }))), void this.
|
|
5805
|
+
return "payloads" in e2 && (false === e2.payloads ? (this._instance.persistence.unregister(Sn), wn.info("Payload overrides cleared")) : e2.payloads && (this._instance.persistence.register({ [Sn]: e2.payloads }), wn.info("Payload overrides set", { payloads: e2.payloads }))), void this.wi();
|
|
5791
5806
|
}
|
|
5792
|
-
this.
|
|
5807
|
+
this.wi();
|
|
5793
5808
|
}
|
|
5794
5809
|
onFeatureFlags(t2) {
|
|
5795
5810
|
if (this.addFeatureFlagsHandler(t2), this.ai) {
|
|
5796
|
-
var { flags: i2, flagVariants: e2 } = this.
|
|
5811
|
+
var { flags: i2, flagVariants: e2 } = this.xi();
|
|
5797
5812
|
t2(i2, e2);
|
|
5798
5813
|
}
|
|
5799
5814
|
return () => this.removeFeatureFlagsHandler(t2);
|
|
@@ -5802,7 +5817,7 @@ class Rn {
|
|
|
5802
5817
|
var r2, s2 = (this._instance.get_property(se) || []).find((i3) => i3.flagKey === t2), n2 = { ["$feature_enrollment/" + t2]: i2 }, o2 = { $feature_flag: t2, $feature_enrollment: i2, $set: n2 };
|
|
5803
5818
|
s2 && (o2.$early_access_feature_name = s2.name), e2 && (o2.$feature_enrollment_stage = e2), this._instance.capture("$feature_enrollment_update", o2), this.setPersonPropertiesForFlags(n2, false);
|
|
5804
5819
|
var a2 = g({}, this.getFlagVariants(), { [t2]: i2 });
|
|
5805
|
-
null == (r2 = this._instance.persistence) || r2.register({ [xn]: Object.keys(Tn(a2)), [re]: a2 }), this.
|
|
5820
|
+
null == (r2 = this._instance.persistence) || r2.register({ [xn]: Object.keys(Tn(a2)), [re]: a2 }), this.wi();
|
|
5806
5821
|
}
|
|
5807
5822
|
getEarlyAccessFeatures(t2, i2, e2) {
|
|
5808
5823
|
void 0 === i2 && (i2 = false);
|
|
@@ -5816,12 +5831,12 @@ class Rn {
|
|
|
5816
5831
|
}
|
|
5817
5832
|
} });
|
|
5818
5833
|
}
|
|
5819
|
-
|
|
5834
|
+
xi() {
|
|
5820
5835
|
var t2 = this.getFlags(), i2 = this.getFlagVariants();
|
|
5821
5836
|
return { flags: t2.filter((t3) => i2[t3]), flagVariants: Object.keys(i2).filter((t3) => i2[t3]).reduce((t3, e2) => (t3[e2] = i2[e2], t3), {}) };
|
|
5822
5837
|
}
|
|
5823
|
-
|
|
5824
|
-
var { flags: i2, flagVariants: e2 } = this.
|
|
5838
|
+
wi(t2) {
|
|
5839
|
+
var { flags: i2, flagVariants: e2 } = this.xi();
|
|
5825
5840
|
this.featureFlagEventHandlers.forEach((r2) => r2(i2, e2, { errorsLoading: t2 }));
|
|
5826
5841
|
}
|
|
5827
5842
|
setPersonPropertiesForFlags(t2, i2) {
|
|
@@ -5846,21 +5861,21 @@ class Rn {
|
|
|
5846
5861
|
} else this._instance.unregister(ae);
|
|
5847
5862
|
}
|
|
5848
5863
|
reset() {
|
|
5849
|
-
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.
|
|
5864
|
+
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.yi(), this.oi = false;
|
|
5850
5865
|
}
|
|
5851
5866
|
}
|
|
5852
5867
|
var Fn = ["cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory"];
|
|
5853
5868
|
class Mn {
|
|
5854
5869
|
constructor(t2, i2) {
|
|
5855
|
-
this.R = t2, this.props = {}, this.
|
|
5870
|
+
this.R = t2, this.props = {}, this.Ei = false, this.$i = ((t3) => {
|
|
5856
5871
|
var i3 = "";
|
|
5857
5872
|
return t3.token && (i3 = t3.token.replace(/\+/g, "PL").replace(/\//g, "SL").replace(/=/g, "EQ")), t3.persistence_name ? "ph_" + t3.persistence_name : "ph_" + i3 + "_posthog";
|
|
5858
|
-
})(t2), this.Y = this
|
|
5873
|
+
})(t2), this.Y = this.Si(t2), this.load(), t2.debug && $i.info("Persistence loaded", t2.persistence, g({}, this.props)), this.update_config(t2, t2, i2), this.save();
|
|
5859
5874
|
}
|
|
5860
5875
|
isDisabled() {
|
|
5861
|
-
return !!this.
|
|
5876
|
+
return !!this.ki;
|
|
5862
5877
|
}
|
|
5863
|
-
|
|
5878
|
+
Si(i2) {
|
|
5864
5879
|
-1 === Fn.indexOf(i2.persistence.toLowerCase()) && ($i.critical("Unknown persistence type " + i2.persistence + "; falling back to localStorage+cookie"), i2.persistence = "localStorage+cookie");
|
|
5865
5880
|
var e2 = function(i3) {
|
|
5866
5881
|
void 0 === i3 && (i3 = []);
|
|
@@ -5908,23 +5923,23 @@ class Mn {
|
|
|
5908
5923
|
}), t2;
|
|
5909
5924
|
}
|
|
5910
5925
|
load() {
|
|
5911
|
-
if (!this.
|
|
5912
|
-
var t2 = this.Y.W(this
|
|
5926
|
+
if (!this.ki) {
|
|
5927
|
+
var t2 = this.Y.W(this.$i);
|
|
5913
5928
|
t2 && (this.props = Ri({}, t2));
|
|
5914
5929
|
}
|
|
5915
5930
|
}
|
|
5916
5931
|
save() {
|
|
5917
|
-
this.
|
|
5932
|
+
this.ki || this.Y.G(this.$i, this.props, this.Pi, this.Ti, this.Ii, this.R.debug);
|
|
5918
5933
|
}
|
|
5919
5934
|
remove() {
|
|
5920
|
-
this.Y.V(this
|
|
5935
|
+
this.Y.V(this.$i, false), this.Y.V(this.$i, true);
|
|
5921
5936
|
}
|
|
5922
5937
|
clear() {
|
|
5923
5938
|
this.remove(), this.props = {};
|
|
5924
5939
|
}
|
|
5925
5940
|
register_once(t2, i2, e2) {
|
|
5926
5941
|
if (R(t2)) {
|
|
5927
|
-
M(i2) && (i2 = "None"), this.
|
|
5942
|
+
M(i2) && (i2 = "None"), this.Pi = M(e2) ? this.Ci : e2;
|
|
5928
5943
|
var r2 = false;
|
|
5929
5944
|
if (Ci(t2, (t3, e3) => {
|
|
5930
5945
|
this.props.hasOwnProperty(e3) && this.props[e3] !== i2 || (this.props[e3] = t3, r2 = true);
|
|
@@ -5934,7 +5949,7 @@ class Mn {
|
|
|
5934
5949
|
}
|
|
5935
5950
|
register(t2, i2) {
|
|
5936
5951
|
if (R(t2)) {
|
|
5937
|
-
this.
|
|
5952
|
+
this.Pi = M(i2) ? this.Ci : i2;
|
|
5938
5953
|
var e2 = false;
|
|
5939
5954
|
if (Ci(t2, (i3, r2) => {
|
|
5940
5955
|
t2.hasOwnProperty(r2) && this.props[r2] !== i3 && (this.props[r2] = i3, e2 = true);
|
|
@@ -5946,9 +5961,9 @@ class Mn {
|
|
|
5946
5961
|
t2 in this.props && (delete this.props[t2], this.save());
|
|
5947
5962
|
}
|
|
5948
5963
|
update_campaign_params() {
|
|
5949
|
-
if (!this.
|
|
5964
|
+
if (!this.Ei) {
|
|
5950
5965
|
var t2 = os(this.R.custom_campaign_params, this.R.mask_personal_data_properties, this.R.custom_personal_data_properties);
|
|
5951
|
-
F(Di(t2)) || this.register(t2), this.
|
|
5966
|
+
F(Di(t2)) || this.register(t2), this.Ei = true;
|
|
5952
5967
|
}
|
|
5953
5968
|
}
|
|
5954
5969
|
update_search_keyword() {
|
|
@@ -5985,23 +6000,23 @@ class Mn {
|
|
|
5985
6000
|
}), t2;
|
|
5986
6001
|
}
|
|
5987
6002
|
update_config(t2, i2, e2) {
|
|
5988
|
-
if (this.
|
|
6003
|
+
if (this.Ci = this.Pi = t2.cookie_expiration, this.set_disabled(t2.disable_persistence || !!e2), this.set_cross_subdomain(t2.cross_subdomain_cookie), this.set_secure(t2.secure_cookie), t2.persistence !== i2.persistence || !((t3, i3) => {
|
|
5989
6004
|
if (t3.length !== i3.length) return false;
|
|
5990
6005
|
var e3 = [...t3].sort(), r3 = [...i3].sort();
|
|
5991
6006
|
return e3.every((t4, i4) => t4 === r3[i4]);
|
|
5992
6007
|
})(t2.cookie_persisted_properties || [], i2.cookie_persisted_properties || [])) {
|
|
5993
|
-
var r2 = this
|
|
6008
|
+
var r2 = this.Si(t2), s2 = this.props;
|
|
5994
6009
|
this.clear(), this.Y = r2, this.props = s2, this.save();
|
|
5995
6010
|
}
|
|
5996
6011
|
}
|
|
5997
6012
|
set_disabled(t2) {
|
|
5998
|
-
this.
|
|
6013
|
+
this.ki = t2, this.ki ? this.remove() : this.save();
|
|
5999
6014
|
}
|
|
6000
6015
|
set_cross_subdomain(t2) {
|
|
6001
|
-
t2 !== this.
|
|
6016
|
+
t2 !== this.Ti && (this.Ti = t2, this.remove(), this.save());
|
|
6002
6017
|
}
|
|
6003
6018
|
set_secure(t2) {
|
|
6004
|
-
t2 !== this.
|
|
6019
|
+
t2 !== this.Ii && (this.Ii = t2, this.remove(), this.save());
|
|
6005
6020
|
}
|
|
6006
6021
|
set_event_timer(t2, i2) {
|
|
6007
6022
|
var e2 = this.props[qi] || {};
|
|
@@ -6021,14 +6036,14 @@ class Mn {
|
|
|
6021
6036
|
var On = Si("[Product Tours]"), An = "ph_product_tours";
|
|
6022
6037
|
class Dn {
|
|
6023
6038
|
constructor(t2) {
|
|
6024
|
-
this.
|
|
6039
|
+
this.Ri = null, this.Fi = null, this._instance = t2;
|
|
6025
6040
|
}
|
|
6026
6041
|
onRemoteConfig(t2) {
|
|
6027
6042
|
this._instance.persistence && this._instance.persistence.register({ [Qi]: !(null == t2 || !t2.productTours) }), this.loadIfEnabled();
|
|
6028
6043
|
}
|
|
6029
6044
|
loadIfEnabled() {
|
|
6030
6045
|
var t2, i2;
|
|
6031
|
-
this.
|
|
6046
|
+
this.Ri || ((t2 = this._instance).config.disable_product_tours || null == (i2 = t2.persistence) || !i2.get_property(Qi)) || this.it(() => this.Mi());
|
|
6032
6047
|
}
|
|
6033
6048
|
it(t2) {
|
|
6034
6049
|
var i2, e2;
|
|
@@ -6036,16 +6051,16 @@ class Dn {
|
|
|
6036
6051
|
i3 ? On.error("Could not load product tours script", i3) : t2();
|
|
6037
6052
|
});
|
|
6038
6053
|
}
|
|
6039
|
-
|
|
6054
|
+
Mi() {
|
|
6040
6055
|
var t2;
|
|
6041
|
-
!this.
|
|
6056
|
+
!this.Ri && null != (t2 = v.__PosthogExtensions__) && t2.generateProductTours && (this.Ri = v.__PosthogExtensions__.generateProductTours(this._instance, true));
|
|
6042
6057
|
}
|
|
6043
6058
|
getProductTours(t2, i2) {
|
|
6044
|
-
if (void 0 === i2 && (i2 = false), !I(this.
|
|
6059
|
+
if (void 0 === i2 && (i2 = false), !I(this.Fi) || i2) {
|
|
6045
6060
|
var e2 = this._instance.persistence;
|
|
6046
6061
|
if (e2) {
|
|
6047
6062
|
var r2 = e2.props[An];
|
|
6048
|
-
if (I(r2) && !i2) return this.
|
|
6063
|
+
if (I(r2) && !i2) return this.Fi = r2, void t2(r2, { isLoaded: true });
|
|
6049
6064
|
}
|
|
6050
6065
|
this._instance._send_request({ url: this._instance.requestRouter.endpointFor("api", "/api/product_tours/?token=" + this._instance.config.token), method: "GET", callback: (i3) => {
|
|
6051
6066
|
var r3 = i3.statusCode;
|
|
@@ -6054,50 +6069,50 @@ class Dn {
|
|
|
6054
6069
|
return On.error(s2), void t2([], { isLoaded: false, error: s2 });
|
|
6055
6070
|
}
|
|
6056
6071
|
var n2 = I(i3.json.product_tours) ? i3.json.product_tours : [];
|
|
6057
|
-
this.
|
|
6072
|
+
this.Fi = n2, e2 && e2.register({ [An]: n2 }), t2(n2, { isLoaded: true });
|
|
6058
6073
|
} });
|
|
6059
|
-
} else t2(this.
|
|
6074
|
+
} else t2(this.Fi, { isLoaded: true });
|
|
6060
6075
|
}
|
|
6061
6076
|
getActiveProductTours(t2) {
|
|
6062
|
-
j(this.
|
|
6077
|
+
j(this.Ri) ? t2([], { isLoaded: false, error: "Product tours not loaded" }) : this.Ri.getActiveProductTours(t2);
|
|
6063
6078
|
}
|
|
6064
6079
|
showProductTour(t2) {
|
|
6065
6080
|
var i2;
|
|
6066
|
-
null == (i2 = this.
|
|
6081
|
+
null == (i2 = this.Ri) || i2.showTourById(t2);
|
|
6067
6082
|
}
|
|
6068
6083
|
previewTour(t2) {
|
|
6069
|
-
this.
|
|
6084
|
+
this.Ri ? this.Ri.previewTour(t2) : this.it(() => {
|
|
6070
6085
|
var i2;
|
|
6071
|
-
this.
|
|
6086
|
+
this.Mi(), null == (i2 = this.Ri) || i2.previewTour(t2);
|
|
6072
6087
|
});
|
|
6073
6088
|
}
|
|
6074
6089
|
dismissProductTour() {
|
|
6075
6090
|
var t2;
|
|
6076
|
-
null == (t2 = this.
|
|
6091
|
+
null == (t2 = this.Ri) || t2.dismissTour("user_clicked_skip");
|
|
6077
6092
|
}
|
|
6078
6093
|
nextStep() {
|
|
6079
6094
|
var t2;
|
|
6080
|
-
null == (t2 = this.
|
|
6095
|
+
null == (t2 = this.Ri) || t2.nextStep();
|
|
6081
6096
|
}
|
|
6082
6097
|
previousStep() {
|
|
6083
6098
|
var t2;
|
|
6084
|
-
null == (t2 = this.
|
|
6099
|
+
null == (t2 = this.Ri) || t2.previousStep();
|
|
6085
6100
|
}
|
|
6086
6101
|
clearCache() {
|
|
6087
6102
|
var t2;
|
|
6088
|
-
this.
|
|
6103
|
+
this.Fi = null, null == (t2 = this._instance.persistence) || t2.unregister(An);
|
|
6089
6104
|
}
|
|
6090
6105
|
resetTour(t2) {
|
|
6091
6106
|
var i2;
|
|
6092
|
-
null == (i2 = this.
|
|
6107
|
+
null == (i2 = this.Ri) || i2.resetTour(t2);
|
|
6093
6108
|
}
|
|
6094
6109
|
resetAllTours() {
|
|
6095
6110
|
var t2;
|
|
6096
|
-
null == (t2 = this.
|
|
6111
|
+
null == (t2 = this.Ri) || t2.resetAllTours();
|
|
6097
6112
|
}
|
|
6098
6113
|
cancelPendingTour(t2) {
|
|
6099
6114
|
var i2;
|
|
6100
|
-
null == (i2 = this.
|
|
6115
|
+
null == (i2 = this.Ri) || i2.cancelPendingTour(t2);
|
|
6101
6116
|
}
|
|
6102
6117
|
}
|
|
6103
6118
|
var jn = function(t2) {
|
|
@@ -6140,16 +6155,16 @@ var Kn = "seenSurvey_", Yn = (t2, i2) => {
|
|
|
6140
6155
|
})(Kn, t2), Qn = [zn.Popover, zn.Widget, zn.API], Zn = { ignoreConditions: false, ignoreDelay: false, displayType: Vn.Popover };
|
|
6141
6156
|
class to {
|
|
6142
6157
|
constructor() {
|
|
6143
|
-
this.
|
|
6158
|
+
this.Oi = {}, this.Oi = {};
|
|
6144
6159
|
}
|
|
6145
6160
|
on(t2, i2) {
|
|
6146
|
-
return this.
|
|
6147
|
-
this.
|
|
6161
|
+
return this.Oi[t2] || (this.Oi[t2] = []), this.Oi[t2].push(i2), () => {
|
|
6162
|
+
this.Oi[t2] = this.Oi[t2].filter((t3) => t3 !== i2);
|
|
6148
6163
|
};
|
|
6149
6164
|
}
|
|
6150
6165
|
emit(t2, i2) {
|
|
6151
|
-
for (var e2 of this.
|
|
6152
|
-
for (var r2 of this.
|
|
6166
|
+
for (var e2 of this.Oi[t2] || []) e2(i2);
|
|
6167
|
+
for (var r2 of this.Oi["*"] || []) r2(t2, i2);
|
|
6153
6168
|
}
|
|
6154
6169
|
}
|
|
6155
6170
|
function io(t2, i2, e2) {
|
|
@@ -6172,24 +6187,24 @@ function io(t2, i2, e2) {
|
|
|
6172
6187
|
}
|
|
6173
6188
|
class eo {
|
|
6174
6189
|
constructor(t2) {
|
|
6175
|
-
this.
|
|
6190
|
+
this.Ai = new to(), this.Di = (t3, i2) => this.ji(t3, i2) && this.Li(t3, i2) && this.Ni(t3, i2) && this.Ui(t3, i2), this.ji = (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();
|
|
6176
6191
|
}
|
|
6177
6192
|
init() {
|
|
6178
6193
|
var t2;
|
|
6179
|
-
if (!M(null == (t2 = this._instance) ? void 0 : t2.
|
|
6194
|
+
if (!M(null == (t2 = this._instance) ? void 0 : t2._addCaptureHook)) {
|
|
6180
6195
|
var i2;
|
|
6181
|
-
null == (i2 = this._instance) || i2.
|
|
6196
|
+
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
6182
6197
|
this.on(t3, i3);
|
|
6183
6198
|
});
|
|
6184
6199
|
}
|
|
6185
6200
|
}
|
|
6186
6201
|
register(t2) {
|
|
6187
6202
|
var i2, e2;
|
|
6188
|
-
if (!M(null == (i2 = this._instance) ? void 0 : i2.
|
|
6203
|
+
if (!M(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) && (t2.forEach((t3) => {
|
|
6189
6204
|
var i3, e3;
|
|
6190
|
-
null == (i3 = this.
|
|
6205
|
+
null == (i3 = this.Hi) || i3.add(t3), null == (e3 = t3.steps) || e3.forEach((t4) => {
|
|
6191
6206
|
var i4;
|
|
6192
|
-
null == (i4 = this.
|
|
6207
|
+
null == (i4 = this.zi) || i4.add((null == t4 ? void 0 : t4.event) || "");
|
|
6193
6208
|
});
|
|
6194
6209
|
}), null != (e2 = this._instance) && e2.autocapture)) {
|
|
6195
6210
|
var r2, s2 = /* @__PURE__ */ new Set();
|
|
@@ -6203,8 +6218,8 @@ class eo {
|
|
|
6203
6218
|
}
|
|
6204
6219
|
on(t2, i2) {
|
|
6205
6220
|
var e2;
|
|
6206
|
-
null != i2 && 0 != t2.length && (this.
|
|
6207
|
-
this.Bi(i2, t3) && this.
|
|
6221
|
+
null != i2 && 0 != t2.length && (this.zi.has(t2) || this.zi.has(null == i2 ? void 0 : i2.event)) && this.Hi && (null == (e2 = this.Hi) ? void 0 : e2.size) > 0 && this.Hi.forEach((t3) => {
|
|
6222
|
+
this.Bi(i2, t3) && this.Ai.emit("actionCaptured", t3.name);
|
|
6208
6223
|
});
|
|
6209
6224
|
}
|
|
6210
6225
|
qi(t2) {
|
|
@@ -6212,13 +6227,13 @@ class eo {
|
|
|
6212
6227
|
}
|
|
6213
6228
|
Bi(t2, i2) {
|
|
6214
6229
|
if (null == (null == i2 ? void 0 : i2.steps)) return false;
|
|
6215
|
-
for (var e2 of i2.steps) if (this.
|
|
6230
|
+
for (var e2 of i2.steps) if (this.Di(t2, e2)) return true;
|
|
6216
6231
|
return false;
|
|
6217
6232
|
}
|
|
6218
6233
|
onAction(t2, i2) {
|
|
6219
|
-
return this.
|
|
6234
|
+
return this.Ai.on(t2, i2);
|
|
6220
6235
|
}
|
|
6221
|
-
|
|
6236
|
+
Li(t2, i2) {
|
|
6222
6237
|
if (null != i2 && i2.url) {
|
|
6223
6238
|
var e2, r2 = null == t2 || null == (e2 = t2.properties) ? void 0 : e2.$current_url;
|
|
6224
6239
|
if (!r2 || "string" != typeof r2) return false;
|
|
@@ -6226,7 +6241,7 @@ class eo {
|
|
|
6226
6241
|
}
|
|
6227
6242
|
return true;
|
|
6228
6243
|
}
|
|
6229
|
-
|
|
6244
|
+
Ni(t2, i2) {
|
|
6230
6245
|
return !!this.Wi(t2, i2) && (!!this.Gi(t2, i2) && !!this.Vi(t2, i2));
|
|
6231
6246
|
}
|
|
6232
6247
|
Wi(t2, i2) {
|
|
@@ -6265,7 +6280,7 @@ class eo {
|
|
|
6265
6280
|
var i2;
|
|
6266
6281
|
return null == (null == t2 || null == (i2 = t2.properties) ? void 0 : i2.$elements) ? [] : null == t2 ? void 0 : t2.properties.$elements;
|
|
6267
6282
|
}
|
|
6268
|
-
|
|
6283
|
+
Ui(t2, i2) {
|
|
6269
6284
|
return null == i2 || !i2.properties || 0 === i2.properties.length || _n(i2.properties.reduce((t3, i3) => {
|
|
6270
6285
|
var e2 = I(i3.value) ? i3.value.map(String) : null != i3.value ? [String(i3.value)] : [];
|
|
6271
6286
|
return t3[i3.key] = { values: e2, operator: i3.operator || "exact" }, t3;
|
|
@@ -6302,7 +6317,7 @@ class ro {
|
|
|
6302
6317
|
}
|
|
6303
6318
|
register(t2) {
|
|
6304
6319
|
var i2;
|
|
6305
|
-
M(null == (i2 = this._instance) ? void 0 : i2.
|
|
6320
|
+
M(null == (i2 = this._instance) ? void 0 : i2._addCaptureHook) || (this.ee(t2), this.re(t2));
|
|
6306
6321
|
}
|
|
6307
6322
|
re(t2) {
|
|
6308
6323
|
var i2 = t2.filter((t3) => {
|
|
@@ -6336,7 +6351,7 @@ class ro {
|
|
|
6336
6351
|
return (null == (i3 = t3.conditions) ? void 0 : i3.cancelEvents) && (null == (e3 = t3.conditions) || null == (e3 = e3.cancelEvents) || null == (e3 = e3.values) ? void 0 : e3.length) > 0;
|
|
6337
6352
|
});
|
|
6338
6353
|
if (0 !== e2.length || 0 !== r2.length) {
|
|
6339
|
-
null == (i2 = this._instance) || i2.
|
|
6354
|
+
null == (i2 = this._instance) || i2._addCaptureHook((t3, i3) => {
|
|
6340
6355
|
this.onEvent(t3, i3);
|
|
6341
6356
|
}), this.Ki = this.Zi(t2, jn.Activation), this.Yi = this.Zi(t2, jn.Cancellation);
|
|
6342
6357
|
}
|
|
@@ -6571,11 +6586,11 @@ class no {
|
|
|
6571
6586
|
var r2 = this.ye(t2);
|
|
6572
6587
|
if (r2) {
|
|
6573
6588
|
var s2 = r2;
|
|
6574
|
-
if (null != (e2 = r2.appearance) && e2.surveyPopupDelaySeconds && i2.ignoreDelay && (s2 = g({}, r2, { appearance: g({}, r2.appearance, { surveyPopupDelaySeconds: 0 }) })), false === i2.ignoreConditions) {
|
|
6589
|
+
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) {
|
|
6575
6590
|
var n2 = this.canRenderSurvey(r2);
|
|
6576
6591
|
if (!n2.visible) return void Jn.warn("Survey is not eligible to be displayed: ", n2.disabledReason);
|
|
6577
6592
|
}
|
|
6578
|
-
i2.displayType !== Vn.Inline ? this._surveyManager.handlePopoverSurvey(s2, i2
|
|
6593
|
+
i2.displayType !== Vn.Inline ? this._surveyManager.handlePopoverSurvey(s2, i2) : this.renderSurvey(s2, i2.selector, i2.properties);
|
|
6579
6594
|
} else Jn.warn("Survey not found");
|
|
6580
6595
|
}
|
|
6581
6596
|
}
|
|
@@ -6705,25 +6720,32 @@ class lo {
|
|
|
6705
6720
|
var uo = Si("[RateLimiter]");
|
|
6706
6721
|
class ho {
|
|
6707
6722
|
constructor(t2) {
|
|
6708
|
-
var i2, e2;
|
|
6709
6723
|
this.serverLimits = {}, this.lastEventRateLimited = false, this.checkForLimiting = (t3) => {
|
|
6710
|
-
var
|
|
6711
|
-
if (
|
|
6712
|
-
(JSON.parse(
|
|
6724
|
+
var i2 = t3.text;
|
|
6725
|
+
if (i2 && i2.length) try {
|
|
6726
|
+
(JSON.parse(i2).quota_limited || []).forEach((t4) => {
|
|
6713
6727
|
uo.info((t4 || "events") + " is quota limited."), this.serverLimits[t4] = (/* @__PURE__ */ new Date()).getTime() + 6e4;
|
|
6714
6728
|
});
|
|
6715
6729
|
} catch (t4) {
|
|
6716
|
-
return void uo.warn('could not rate limit - continuing. Error: "' + (null == t4 ? void 0 : t4.message) + '"', { text:
|
|
6730
|
+
return void uo.warn('could not rate limit - continuing. Error: "' + (null == t4 ? void 0 : t4.message) + '"', { text: i2 });
|
|
6717
6731
|
}
|
|
6718
|
-
}, this.instance = t2, this.
|
|
6732
|
+
}, this.instance = t2, this.lastEventRateLimited = this.clientRateLimitContext(true).isRateLimited;
|
|
6733
|
+
}
|
|
6734
|
+
get captureEventsPerSecond() {
|
|
6735
|
+
var t2;
|
|
6736
|
+
return (null == (t2 = this.instance.config.rate_limiting) ? void 0 : t2.events_per_second) || 10;
|
|
6737
|
+
}
|
|
6738
|
+
get captureEventsBurstLimit() {
|
|
6739
|
+
var t2;
|
|
6740
|
+
return Math.max((null == (t2 = this.instance.config.rate_limiting) ? void 0 : t2.events_burst_limit) || 10 * this.captureEventsPerSecond, this.captureEventsPerSecond);
|
|
6719
6741
|
}
|
|
6720
6742
|
clientRateLimitContext(t2) {
|
|
6721
6743
|
var i2, e2, r2;
|
|
6722
6744
|
void 0 === t2 && (t2 = false);
|
|
6723
|
-
var s2 = (/* @__PURE__ */ new Date()).getTime(),
|
|
6724
|
-
|
|
6725
|
-
var
|
|
6726
|
-
return
|
|
6745
|
+
var { captureEventsBurstLimit: s2, captureEventsPerSecond: n2 } = this, o2 = (/* @__PURE__ */ new Date()).getTime(), a2 = null !== (i2 = null == (e2 = this.instance.persistence) ? void 0 : e2.get_property(ve)) && void 0 !== i2 ? i2 : { tokens: s2, last: o2 };
|
|
6746
|
+
a2.tokens += (o2 - a2.last) / 1e3 * n2, a2.last = o2, a2.tokens > s2 && (a2.tokens = s2);
|
|
6747
|
+
var l2 = a2.tokens < 1;
|
|
6748
|
+
return l2 || t2 || (a2.tokens = Math.max(0, a2.tokens - 1)), !l2 || this.lastEventRateLimited || t2 || this.instance.capture("$$client_ingestion_warning", { $$client_ingestion_warning_message: "posthog-js client rate limited. Config is set to " + n2 + " events per second and " + s2 + " events burst limit." }, { skip_client_rate_limiting: true }), this.lastEventRateLimited = l2, null == (r2 = this.instance.persistence) || r2.set_property(ve, a2), { isRateLimited: l2, remainingTokens: a2.tokens };
|
|
6727
6749
|
}
|
|
6728
6750
|
isServerRateLimited(t2) {
|
|
6729
6751
|
var i2 = this.serverLimits[t2 || "events"] || false;
|
|
@@ -6750,20 +6772,20 @@ class co {
|
|
|
6750
6772
|
}
|
|
6751
6773
|
load() {
|
|
6752
6774
|
try {
|
|
6753
|
-
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.
|
|
6775
|
+
if (this.remoteConfig) return vo.info("Using preloaded remote config", this.remoteConfig), void this.bi(this.remoteConfig);
|
|
6754
6776
|
if (this._instance.O()) return void vo.warn("Remote config is disabled. Falling back to local config.");
|
|
6755
6777
|
this.Te((t2) => {
|
|
6756
6778
|
if (!t2) return vo.info("No config found after loading remote JS config. Falling back to JSON."), void this.Ie((t3) => {
|
|
6757
|
-
this.
|
|
6779
|
+
this.bi(t3);
|
|
6758
6780
|
});
|
|
6759
|
-
this.
|
|
6781
|
+
this.bi(t2);
|
|
6760
6782
|
});
|
|
6761
6783
|
} catch (t2) {
|
|
6762
6784
|
vo.error("Error loading remote config", t2);
|
|
6763
6785
|
}
|
|
6764
6786
|
}
|
|
6765
|
-
|
|
6766
|
-
t2 ? this._instance.config.__preview_remote_config ? (this._instance.
|
|
6787
|
+
bi(t2) {
|
|
6788
|
+
t2 ? this._instance.config.__preview_remote_config ? (this._instance.bi(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.");
|
|
6767
6789
|
}
|
|
6768
6790
|
}
|
|
6769
6791
|
var fo = 3e3;
|
|
@@ -6961,7 +6983,7 @@ class xo {
|
|
|
6961
6983
|
};
|
|
6962
6984
|
}
|
|
6963
6985
|
dr() {
|
|
6964
|
-
return "memory" !== this.R.persistence && !this.Xe.
|
|
6986
|
+
return "memory" !== this.R.persistence && !this.Xe.ki && Fr.H();
|
|
6965
6987
|
}
|
|
6966
6988
|
pr(t2) {
|
|
6967
6989
|
t2 !== this.rr && (this.rr = t2, this.dr() && Fr.G(this.ur, t2));
|
|
@@ -7024,7 +7046,7 @@ class So {
|
|
|
7024
7046
|
}
|
|
7025
7047
|
init() {
|
|
7026
7048
|
if (this.isEnabled) {
|
|
7027
|
-
var t2 = this._instance.
|
|
7049
|
+
var t2 = this._instance._addCaptureHook(this.br.bind(this));
|
|
7028
7050
|
this.wr = () => {
|
|
7029
7051
|
t2(), this.yr = [], this.wr = void 0;
|
|
7030
7052
|
};
|
|
@@ -7364,7 +7386,7 @@ var Lo = {}, No = () => {
|
|
|
7364
7386
|
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 && O(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) => {
|
|
7365
7387
|
var i3 = "Bad HTTP status: " + t2.statusCode + " " + t2.text;
|
|
7366
7388
|
$i.error(i3);
|
|
7367
|
-
}, 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 } : {} }))(i2));
|
|
7389
|
+
}, 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));
|
|
7368
7390
|
}, Bo = (t2) => {
|
|
7369
7391
|
var i2 = {};
|
|
7370
7392
|
M(t2.process_person) || (i2.person_profiles = t2.process_person), M(t2.xhr_headers) || (i2.request_headers = t2.xhr_headers), M(t2.cookie_name) || (i2.persistence_name = t2.cookie_name), M(t2.disable_cookie) || (i2.disable_persistence = t2.disable_cookie), M(t2.store_google) || (i2.save_campaign_params = t2.store_google), M(t2.verbose) || (i2.debug = t2.verbose);
|
|
@@ -7481,7 +7503,7 @@ class Wo {
|
|
|
7481
7503
|
}), e2.push(() => {
|
|
7482
7504
|
if (this.os) {
|
|
7483
7505
|
var t3 = this.os;
|
|
7484
|
-
this.os = void 0, this.
|
|
7506
|
+
this.os = void 0, this.bi(t3);
|
|
7485
7507
|
}
|
|
7486
7508
|
}), this.ls(e2, i2);
|
|
7487
7509
|
}
|
|
@@ -7502,10 +7524,10 @@ class Wo {
|
|
|
7502
7524
|
var r2 = Math.round(performance.now() - i2);
|
|
7503
7525
|
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)");
|
|
7504
7526
|
}
|
|
7505
|
-
|
|
7527
|
+
bi(t2) {
|
|
7506
7528
|
var i2, e2, r2, s2, n2, a2, l2, u2, h2;
|
|
7507
7529
|
if (!o || !o.body) return $i.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout(() => {
|
|
7508
|
-
this.
|
|
7530
|
+
this.bi(t2);
|
|
7509
7531
|
}, 500);
|
|
7510
7532
|
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);
|
|
7511
7533
|
}
|
|
@@ -7601,7 +7623,7 @@ class Wo {
|
|
|
7601
7623
|
} else $i.error("No event name provided to posthog.capture");
|
|
7602
7624
|
} else $i.uninitializedWarning("posthog.capture");
|
|
7603
7625
|
}
|
|
7604
|
-
|
|
7626
|
+
_addCaptureHook(t2) {
|
|
7605
7627
|
return this.on("eventCaptured", (i2) => t2(i2.event, i2));
|
|
7606
7628
|
}
|
|
7607
7629
|
calculateEventProperties(t2, i2, e2, r2, s2) {
|
|
@@ -7887,8 +7909,8 @@ class Wo {
|
|
|
7887
7909
|
}
|
|
7888
7910
|
_s() {
|
|
7889
7911
|
var t2, i2, e2, r2, s2 = this.Qr();
|
|
7890
|
-
(null == (t2 = this.persistence) ? void 0 : t2.
|
|
7891
|
-
(null == (i2 = this.sessionPersistence) ? void 0 : i2.
|
|
7912
|
+
(null == (t2 = this.persistence) ? void 0 : t2.ki) !== s2 && (null == (e2 = this.persistence) || e2.set_disabled(s2));
|
|
7913
|
+
(null == (i2 = this.sessionPersistence) ? void 0 : i2.ki) !== s2 && (null == (r2 = this.sessionPersistence) || r2.set_disabled(s2));
|
|
7892
7914
|
return s2;
|
|
7893
7915
|
}
|
|
7894
7916
|
opt_in_capturing(t2) {
|
|
@@ -8131,7 +8153,7 @@ var __POSTHOG_ERROR_MESSAGES = {
|
|
|
8131
8153
|
return PostHogErrorBoundary;
|
|
8132
8154
|
})(React.Component);
|
|
8133
8155
|
const name = "@twick/timeline";
|
|
8134
|
-
const version = "0.15.
|
|
8156
|
+
const version = "0.15.10";
|
|
8135
8157
|
const packageJson = {
|
|
8136
8158
|
name,
|
|
8137
8159
|
version
|