@brainfish-ai/widgets-initiator 1.5.2-alpha.1 → 1.6.0
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/web.cjs.js +3 -3
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +7 -7
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -31,10 +31,10 @@ var _, z;
|
|
|
31
31
|
(function() {
|
|
32
32
|
try {
|
|
33
33
|
var a = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, t = new a.Error().stack;
|
|
34
|
-
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "
|
|
34
|
+
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "f5ce7c80-c3f2-4add-90bb-4a7e41b9d696", a._sentryDebugIdIdentifier = "sentry-dbid-f5ce7c80-c3f2-4add-90bb-4a7e41b9d696");
|
|
35
35
|
} catch (n) {
|
|
36
36
|
}
|
|
37
|
-
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "
|
|
37
|
+
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "18e27120541df46d79a1a60398b242824660e266" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
39
|
}(_ || (_ = {})), _.Sidebar, _.Searchbar;
|
|
40
40
|
class ie extends Error {
|
|
@@ -62,7 +62,7 @@ const x = (a, t, n, i) => {
|
|
|
62
62
|
((e, l, s) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
64
|
const u = l.toJSON();
|
|
65
|
-
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.
|
|
65
|
+
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.6.0. ${l.message}`, stack: l.stack, cause: { message: u.message, stack: u.stack, cause: u.cause } }) });
|
|
66
66
|
})(a, new ie(o, { cause: r }), i);
|
|
67
67
|
}, Ke = (a) => m(void 0, null, function* () {
|
|
68
68
|
let { widgetKey: t, apiHost: n } = a;
|
|
@@ -143,13 +143,13 @@ const De = function(i, o, r) {
|
|
|
143
143
|
if (t || x(n, new Error("Access key is required"), "Access key is required", a), !he) try {
|
|
144
144
|
const s = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
|
-
const u =
|
|
147
|
-
return
|
|
146
|
+
const u = navigator, d = window, c = (u.doNotTrack || d.doNotTrack || u.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
|
+
return ["1", "yes", "true"].includes(c);
|
|
148
148
|
})();
|
|
149
149
|
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s && l }), he = !0, yield ((u, d) => m(this, null, function* () {
|
|
150
150
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
151
151
|
const c = document.createElement("script");
|
|
152
|
-
c.id = "brainfish-analytics", c.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@
|
|
152
|
+
c.id = "brainfish-analytics", c.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", c.type = "module", c.async = !0, c.crossOrigin = "anonymous", c.onerror = () => {
|
|
153
153
|
x(u, new Error(`Failed to load script: ${c.src}`), `Failed to load script: ${c.src}`, d);
|
|
154
154
|
}, document.head.appendChild(c);
|
|
155
155
|
}))(n, a);
|
|
@@ -787,7 +787,7 @@ function nt(a, t) {
|
|
|
787
787
|
</svg>
|
|
788
788
|
`, l.setAttribute("aria-label", "Open Brainfish widget"), l.appendChild(s), v.initialize(l, s), l;
|
|
789
789
|
}(a), { iframeContainer: o, iframe: r } = function(e) {
|
|
790
|
-
const l = M("div", j, { id: j, "aria-live": "polite", "aria-hidden": "true" }), s = M("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups", allow: "clipboard-write", role: "dialog" });
|
|
790
|
+
const l = M("div", j, { id: j, "aria-live": "polite", "aria-hidden": "true" }), s = M("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
791
791
|
return l.appendChild(s), { iframeContainer: l, iframe: s };
|
|
792
792
|
}(t);
|
|
793
793
|
return n.appendChild(i), n.appendChild(o), { fragment: n, iframe: r };
|