@brainfish-ai/widgets-initiator 1.6.1 → 1.7.0-alpha.3
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 +7 -7
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +68 -59
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var je = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
2
|
var Le = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var pe = Object.getOwnPropertySymbols;
|
|
4
4
|
var $e = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var F = (a, t, r) => t in a ?
|
|
5
|
+
var F = (a, t, r) => t in a ? je(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r, L = (a, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
7
|
$e.call(t, r) && F(a, r, t[r]);
|
|
8
8
|
if (pe)
|
|
@@ -10,7 +10,7 @@ var F = (a, t, r) => t in a ? Te(a, t, { enumerable: !0, configurable: !0, writa
|
|
|
10
10
|
Ke.call(t, r) && F(a, r, t[r]);
|
|
11
11
|
return a;
|
|
12
12
|
}, $ = (a, t) => Fe(a, Le(t));
|
|
13
|
-
var
|
|
13
|
+
var _ = (a, t, r) => F(a, typeof t != "symbol" ? t + "" : t, r);
|
|
14
14
|
var m = (a, t, r) => new Promise((d, o) => {
|
|
15
15
|
var n = (s) => {
|
|
16
16
|
try {
|
|
@@ -27,20 +27,20 @@ var m = (a, t, r) => new Promise((d, o) => {
|
|
|
27
27
|
}, i = (s) => s.done ? d(s.value) : Promise.resolve(s.value).then(n, e);
|
|
28
28
|
i((r = r.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var k, H;
|
|
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] = "65d8351e-5447-4dbb-a42e-1db7729f2a76", a._sentryDebugIdIdentifier = "sentry-dbid-65d8351e-5447-4dbb-a42e-1db7729f2a76");
|
|
35
35
|
} catch (r) {
|
|
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: "50484184eb4e18af6665e054d85d45509aab6751" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
|
-
}(
|
|
39
|
+
}(k || (k = {})), k.Sidebar, k.Searchbar;
|
|
40
40
|
class ie extends Error {
|
|
41
41
|
constructor(r, d) {
|
|
42
42
|
super(r, d);
|
|
43
|
-
|
|
43
|
+
_(this, "cause");
|
|
44
44
|
this.name = "BrainfishWidgetError", this.cause = d == null ? void 0 : d.cause, Error.captureStackTrace && Error.captureStackTrace(this, ie), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
|
|
45
45
|
Caused by: ` + this.cause.stack);
|
|
46
46
|
}
|
|
@@ -62,7 +62,7 @@ const x = (a, t, r, d) => {
|
|
|
62
62
|
((e, i, s) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
64
|
const l = i.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.7.0-alpha.3. ${i.message}`, stack: i.stack, cause: { message: l.message, stack: l.stack, cause: l.cause } }) });
|
|
66
66
|
})(a, new ie(o, { cause: n }), d);
|
|
67
67
|
}, We = (a) => m(void 0, null, function* () {
|
|
68
68
|
let { widgetKey: t, apiHost: r } = a;
|
|
@@ -114,7 +114,7 @@ const x = (a, t, r, d) => {
|
|
|
114
114
|
} catch (o) {
|
|
115
115
|
x(t, o, o.message, r);
|
|
116
116
|
}
|
|
117
|
-
}), ge = /* @__PURE__ */ new Set(),
|
|
117
|
+
}), ge = /* @__PURE__ */ new Set(), De = (a, t) => m(void 0, null, function* () {
|
|
118
118
|
const r = se(a.overrides);
|
|
119
119
|
try {
|
|
120
120
|
if (ge.has(a.widgetKey)) return;
|
|
@@ -129,7 +129,7 @@ const x = (a, t, r, d) => {
|
|
|
129
129
|
return l.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
130
|
}(t.settings[i], s));
|
|
131
131
|
}), function(e, i) {
|
|
132
|
-
i.widgetType ===
|
|
132
|
+
i.widgetType === k.Searchbar || i.widgetType === "Search" ? e.SearchWidget.initStandard(i) : e.HelpWidget.initPopup(i);
|
|
133
133
|
}(o, n), ge.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
135
|
} catch (d) {
|
|
@@ -137,28 +137,37 @@ const x = (a, t, r, d) => {
|
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
let he = !1;
|
|
140
|
-
const
|
|
140
|
+
const Ne = function(d, o, n) {
|
|
141
141
|
return m(this, arguments, function* (a, t, r) {
|
|
142
142
|
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", i = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
143
143
|
if (t || x(r, 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
|
|
147
|
-
return ["1", "yes", "true"].includes(
|
|
146
|
+
const u = navigator, c = window, f = (u.doNotTrack || c.doNotTrack || u.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
|
+
return ["1", "yes", "true"].includes(f);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s && i })
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s && i });
|
|
150
|
+
const l = window.BrainfishAnalytics;
|
|
151
|
+
window.BrainfishAnalytics = function() {
|
|
152
|
+
for (var u = arguments.length, c = new Array(u), f = 0; f < u; f++) c[f] = arguments[f];
|
|
153
|
+
if (c[0] === "identify") {
|
|
154
|
+
const g = document.querySelector("#bf-iframe-container .trigger-iframe");
|
|
155
|
+
g != null && g.contentWindow && g.contentWindow.postMessage({ type: "IDENTIFY_DATA", data: c[1] }, "*");
|
|
156
|
+
}
|
|
157
|
+
return l.apply(this, c);
|
|
158
|
+
}, he = !0, yield ((u, c) => m(this, null, function* () {
|
|
150
159
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
x(
|
|
154
|
-
}, document.head.appendChild(
|
|
160
|
+
const f = document.createElement("script");
|
|
161
|
+
f.id = "brainfish-analytics", f.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", f.type = "module", f.async = !0, f.crossOrigin = "anonymous", f.onerror = () => {
|
|
162
|
+
x(u, new Error(`Failed to load script: ${f.src}`), `Failed to load script: ${f.src}`, c);
|
|
163
|
+
}, document.head.appendChild(f);
|
|
155
164
|
}))(r, a);
|
|
156
165
|
} catch (s) {
|
|
157
166
|
x(r, s, "Failed to initialize BrainfishAnalytics", a);
|
|
158
167
|
}
|
|
159
168
|
});
|
|
160
169
|
};
|
|
161
|
-
function
|
|
170
|
+
function B(a, t) {
|
|
162
171
|
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
163
172
|
const d = document.createElement(a);
|
|
164
173
|
return d.className = t, Object.entries(r).forEach((o) => {
|
|
@@ -166,7 +175,7 @@ function M(a, t) {
|
|
|
166
175
|
d.setAttribute(n, e);
|
|
167
176
|
}), d;
|
|
168
177
|
}
|
|
169
|
-
const
|
|
178
|
+
const T = "bf-iframe-container", j = "bf-trigger-button";
|
|
170
179
|
class v {
|
|
171
180
|
static get isWidgetOpen() {
|
|
172
181
|
return this.isOpen;
|
|
@@ -190,14 +199,14 @@ class v {
|
|
|
190
199
|
(t = this.button) === null || t === void 0 || t.classList.add("hidden");
|
|
191
200
|
}
|
|
192
201
|
}
|
|
193
|
-
|
|
194
|
-
function
|
|
202
|
+
_(v, "isOpen", !1), _(v, "button", null), _(v, "icon", null);
|
|
203
|
+
function qe(a) {
|
|
195
204
|
let { widgetHost: t, apiHost: r, widgetKey: d, signal: o } = a;
|
|
196
205
|
window.addEventListener("message", (n) => {
|
|
197
206
|
if (n.origin !== t) return;
|
|
198
207
|
const { type: e } = n.data;
|
|
199
208
|
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
200
|
-
const i = document.querySelector(`.${
|
|
209
|
+
const i = document.querySelector(`.${T}`);
|
|
201
210
|
i.classList.contains("expanded") ? i.classList.remove("expanded") : i.classList.add("expanded");
|
|
202
211
|
}(), e === "TRACK_EVENT") {
|
|
203
212
|
if (!window.BrainfishAnalytics) return;
|
|
@@ -220,7 +229,7 @@ function De(a) {
|
|
|
220
229
|
function de(a) {
|
|
221
230
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
222
231
|
}
|
|
223
|
-
var z = { exports: {} },
|
|
232
|
+
var z = { exports: {} }, D = { exports: {} }, N = { exports: {} };
|
|
224
233
|
(function(a, t) {
|
|
225
234
|
function r(o) {
|
|
226
235
|
return Math.round(255 * o);
|
|
@@ -235,8 +244,8 @@ var z = { exports: {} }, N = { exports: {} }, q = { exports: {} };
|
|
|
235
244
|
var h = e - l / 2;
|
|
236
245
|
return i(c + h, f + h, g + h);
|
|
237
246
|
}, a.exports = t.default;
|
|
238
|
-
})(
|
|
239
|
-
var le =
|
|
247
|
+
})(N, N.exports);
|
|
248
|
+
var le = N.exports, q = { exports: {} };
|
|
240
249
|
(function(a, t) {
|
|
241
250
|
t.__esModule = !0, t.default = void 0;
|
|
242
251
|
var r = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "639", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" };
|
|
@@ -245,8 +254,8 @@ var le = q.exports, D = { exports: {} };
|
|
|
245
254
|
var o = d.toLowerCase();
|
|
246
255
|
return r[o] ? "#" + r[o] : d;
|
|
247
256
|
}, a.exports = t.default;
|
|
248
|
-
})(
|
|
249
|
-
var Re =
|
|
257
|
+
})(q, q.exports);
|
|
258
|
+
var Re = q.exports, R = { exports: {} };
|
|
250
259
|
(function(a, t) {
|
|
251
260
|
function r(s) {
|
|
252
261
|
var l = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -470,7 +479,7 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
470
479
|
return u = s, (l = c).prototype = Object.create(u.prototype), l.prototype.constructor = l, o(l, u), c;
|
|
471
480
|
}(r(Error)), a.exports = t.default;
|
|
472
481
|
})(R, R.exports);
|
|
473
|
-
var
|
|
482
|
+
var S = R.exports;
|
|
474
483
|
(function(a, t) {
|
|
475
484
|
t.__esModule = !0, t.default = function(h) {
|
|
476
485
|
if (typeof h != "string") throw new o.default(3);
|
|
@@ -491,26 +500,26 @@ var k = R.exports;
|
|
|
491
500
|
if (y) return { red: parseInt("" + y[1], 10), green: parseInt("" + y[2], 10), blue: parseInt("" + y[3], 10), alpha: parseFloat("" + y[4]) > 1 ? parseFloat("" + y[4]) / 100 : parseFloat("" + y[4]) };
|
|
492
501
|
var A = f.exec(p);
|
|
493
502
|
if (A) {
|
|
494
|
-
var
|
|
495
|
-
if (!
|
|
496
|
-
return { red: parseInt("" +
|
|
503
|
+
var Ie = parseInt("" + A[1], 10), Oe = parseInt("" + A[2], 10) / 100, Be = parseInt("" + A[3], 10) / 100, fe = "rgb(" + (0, r.default)(Ie, Oe, Be) + ")", I = u.exec(fe);
|
|
504
|
+
if (!I) throw new o.default(4, p, fe);
|
|
505
|
+
return { red: parseInt("" + I[1], 10), green: parseInt("" + I[2], 10), blue: parseInt("" + I[3], 10) };
|
|
497
506
|
}
|
|
498
507
|
var w = g.exec(p.substring(0, 50));
|
|
499
508
|
if (w) {
|
|
500
|
-
var
|
|
501
|
-
if (!
|
|
502
|
-
return { red: parseInt("" +
|
|
509
|
+
var Me = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, Te = parseInt("" + w[3], 10) / 100, ce = "rgb(" + (0, r.default)(Me, Pe, Te) + ")", O = u.exec(ce);
|
|
510
|
+
if (!O) throw new o.default(4, p, ce);
|
|
511
|
+
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
|
|
503
512
|
}
|
|
504
513
|
throw new o.default(5);
|
|
505
514
|
};
|
|
506
|
-
var r = n(le), d = n(Re), o = n(
|
|
515
|
+
var r = n(le), d = n(Re), o = n(S);
|
|
507
516
|
function n(h) {
|
|
508
517
|
return h && h.__esModule ? h : { default: h };
|
|
509
518
|
}
|
|
510
519
|
var e = /^#[a-fA-F0-9]{6}$/, i = /^#[a-fA-F0-9]{8}$/, s = /^#[a-fA-F0-9]{3}$/, l = /^#[a-fA-F0-9]{4}$/, u = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, c = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, f = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, g = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
511
520
|
a.exports = t.default;
|
|
512
|
-
})(
|
|
513
|
-
var ue =
|
|
521
|
+
})(D, D.exports);
|
|
522
|
+
var ue = D.exports;
|
|
514
523
|
(function(a, t) {
|
|
515
524
|
t.__esModule = !0, t.default = function(o) {
|
|
516
525
|
if (o === "transparent") return 0;
|
|
@@ -536,10 +545,10 @@ var Y = { exports: {} }, J = { exports: {} };
|
|
|
536
545
|
return r(d, d.length, []);
|
|
537
546
|
}, a.exports = t.default;
|
|
538
547
|
})(J, J.exports);
|
|
539
|
-
var me,
|
|
540
|
-
me = U, (
|
|
548
|
+
var me, M, we = J.exports, U = { exports: {} };
|
|
549
|
+
me = U, (M = U.exports).__esModule = !0, M.default = void 0, M.default = function(a, t, r) {
|
|
541
550
|
return Math.max(a, Math.min(t, r));
|
|
542
|
-
}, me.exports =
|
|
551
|
+
}, me.exports = M.default;
|
|
543
552
|
var xe = U.exports, G = { exports: {} }, V = { exports: {} };
|
|
544
553
|
(function(a, t) {
|
|
545
554
|
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
@@ -570,23 +579,23 @@ var Je = V.exports;
|
|
|
570
579
|
}
|
|
571
580
|
a.exports = t.default;
|
|
572
581
|
})(G, G.exports);
|
|
573
|
-
var
|
|
582
|
+
var Se = G.exports, Z = { exports: {} }, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} };
|
|
574
583
|
(function(a, t) {
|
|
575
584
|
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
576
585
|
return r.length === 7 && r[1] === r[2] && r[3] === r[4] && r[5] === r[6] ? "#" + r[1] + r[3] + r[5] : r;
|
|
577
586
|
}, a.exports = t.default;
|
|
578
587
|
})(ee, ee.exports);
|
|
579
|
-
var
|
|
588
|
+
var _e = ee.exports, te = { exports: {} };
|
|
580
589
|
(function(a, t) {
|
|
581
590
|
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
582
591
|
var d = r.toString(16);
|
|
583
592
|
return d.length === 1 ? "0" + d : d;
|
|
584
593
|
}, a.exports = t.default;
|
|
585
594
|
})(te, te.exports);
|
|
586
|
-
var
|
|
595
|
+
var ke = te.exports;
|
|
587
596
|
(function(a, t) {
|
|
588
597
|
t.__esModule = !0, t.default = void 0;
|
|
589
|
-
var r = n(le), d = n(
|
|
598
|
+
var r = n(le), d = n(_e), o = n(ke);
|
|
590
599
|
function n(s) {
|
|
591
600
|
return s && s.__esModule ? s : { default: s };
|
|
592
601
|
}
|
|
@@ -607,7 +616,7 @@ var Ce = X.exports;
|
|
|
607
616
|
if (typeof n == "object" && e === void 0 && i === void 0) return (0, r.default)(n.hue, n.saturation, n.lightness);
|
|
608
617
|
throw new d.default(1);
|
|
609
618
|
};
|
|
610
|
-
var r = o(Ce), d = o(
|
|
619
|
+
var r = o(Ce), d = o(S);
|
|
611
620
|
function o(n) {
|
|
612
621
|
return n && n.__esModule ? n : { default: n };
|
|
613
622
|
}
|
|
@@ -620,7 +629,7 @@ var Ue = Q.exports, ne = { exports: {} };
|
|
|
620
629
|
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, r.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, d.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
621
630
|
throw new o.default(2);
|
|
622
631
|
};
|
|
623
|
-
var r = n(Ce), d = n(le), o = n(
|
|
632
|
+
var r = n(Ce), d = n(le), o = n(S);
|
|
624
633
|
function n(e) {
|
|
625
634
|
return e && e.__esModule ? e : { default: e };
|
|
626
635
|
}
|
|
@@ -633,7 +642,7 @@ var Ge = ne.exports, re = { exports: {} };
|
|
|
633
642
|
if (typeof e == "object" && i === void 0 && s === void 0) return (0, r.default)("#" + (0, d.default)(e.red) + (0, d.default)(e.green) + (0, d.default)(e.blue));
|
|
634
643
|
throw new o.default(6);
|
|
635
644
|
};
|
|
636
|
-
var r = n(
|
|
645
|
+
var r = n(_e), d = n(ke), o = n(S);
|
|
637
646
|
function n(e) {
|
|
638
647
|
return e && e.__esModule ? e : { default: e };
|
|
639
648
|
}
|
|
@@ -650,7 +659,7 @@ var Ee = re.exports, ae = { exports: {} };
|
|
|
650
659
|
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, d.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
651
660
|
throw new o.default(7);
|
|
652
661
|
};
|
|
653
|
-
var r = n(ue), d = n(Ee), o = n(
|
|
662
|
+
var r = n(ue), d = n(Ee), o = n(S);
|
|
654
663
|
function n(e) {
|
|
655
664
|
return e && e.__esModule ? e : { default: e };
|
|
656
665
|
}
|
|
@@ -666,7 +675,7 @@ var Ve = ae.exports;
|
|
|
666
675
|
if (u(f)) return (0, r.default)(f);
|
|
667
676
|
throw new e.default(8);
|
|
668
677
|
};
|
|
669
|
-
var r = i(Ue), d = i(Ge), o = i(Ee), n = i(Ve), e = i(
|
|
678
|
+
var r = i(Ue), d = i(Ge), o = i(Ee), n = i(Ve), e = i(S);
|
|
670
679
|
function i(f) {
|
|
671
680
|
return f && f.__esModule ? f : { default: f };
|
|
672
681
|
}
|
|
@@ -684,7 +693,7 @@ var Ve = ae.exports;
|
|
|
684
693
|
var Ae = Z.exports;
|
|
685
694
|
(function(a, t) {
|
|
686
695
|
t.__esModule = !0, t.default = void 0;
|
|
687
|
-
var r = e(we), d = e(xe), o = e(
|
|
696
|
+
var r = e(we), d = e(xe), o = e(Se), n = e(Ae);
|
|
688
697
|
function e(l) {
|
|
689
698
|
return l && l.__esModule ? l : { default: l };
|
|
690
699
|
}
|
|
@@ -708,7 +717,7 @@ const Ze = de(Y.exports);
|
|
|
708
717
|
var oe = { exports: {} };
|
|
709
718
|
(function(a, t) {
|
|
710
719
|
t.__esModule = !0, t.default = void 0;
|
|
711
|
-
var r = e(we), d = e(xe), o = e(
|
|
720
|
+
var r = e(we), d = e(xe), o = e(Se), n = e(Ae);
|
|
712
721
|
function e(l) {
|
|
713
722
|
return l && l.__esModule ? l : { default: l };
|
|
714
723
|
}
|
|
@@ -739,8 +748,8 @@ function Xe(a) {
|
|
|
739
748
|
const e = Ye(d) > 0.5;
|
|
740
749
|
n.textContent = `
|
|
741
750
|
.bf-trigger-button{position:fixed;bottom:16px;right:16px;width:56px;height:56px;border-radius:50%;border:none;box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0)}.bf-iframe-container{position:fixed;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;z-index:999;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out}.bf-iframe-container.open{opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #D4D4D4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}
|
|
742
|
-
.${
|
|
743
|
-
.${
|
|
751
|
+
.${j} { background: ${d}; }
|
|
752
|
+
.${j}:hover {
|
|
744
753
|
background: ${e ? Ze(0.05, d) : Qe(0.05, d)};
|
|
745
754
|
}
|
|
746
755
|
.trigger-button-icon { color: ${o}; }
|
|
@@ -788,7 +797,7 @@ function be(a) {
|
|
|
788
797
|
const ve = /* @__PURE__ */ new Set();
|
|
789
798
|
function nt(a, t) {
|
|
790
799
|
const r = document.createDocumentFragment(), d = function(e) {
|
|
791
|
-
const i =
|
|
800
|
+
const i = B("button", j, { id: `trigger-button-${e}`, "aria-controls": T, "aria-expanded": "false", "data-name": j }), s = B("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
792
801
|
return s.innerHTML = `
|
|
793
802
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
794
803
|
<path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>
|
|
@@ -798,7 +807,7 @@ function nt(a, t) {
|
|
|
798
807
|
</svg>
|
|
799
808
|
`, i.setAttribute("aria-label", "Open Brainfish widget"), i.appendChild(s), v.initialize(i, s), i;
|
|
800
809
|
}(a), { iframeContainer: o, iframe: n } = function(e) {
|
|
801
|
-
const i =
|
|
810
|
+
const i = B("div", T, { id: T, "aria-live": "polite", "aria-hidden": "true" }), s = B("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
802
811
|
return i.appendChild(s), { iframeContainer: i, iframe: s };
|
|
803
812
|
}(t);
|
|
804
813
|
return r.appendChild(d), r.appendChild(o), { fragment: r, iframe: n };
|
|
@@ -815,7 +824,7 @@ const rt = (a, t) => {
|
|
|
815
824
|
const { fragment: l, iframe: u } = nt(a.widgetKey, i), c = new AbortController(), { signal: f } = c;
|
|
816
825
|
u.onload = () => {
|
|
817
826
|
setTimeout(() => {
|
|
818
|
-
et(u, f),
|
|
827
|
+
et(u, f), qe({ widgetHost: d, apiHost: r, widgetKey: a.widgetKey, signal: f }), tt(u, f);
|
|
819
828
|
}, 0);
|
|
820
829
|
}, document.body.appendChild(l), ve.add(a.widgetKey);
|
|
821
830
|
const g = () => {
|
|
@@ -892,7 +901,7 @@ ye.Widgets.init = (a) => m(void 0, null, function* () {
|
|
|
892
901
|
return m(this, null, function* () {
|
|
893
902
|
var l, u, c;
|
|
894
903
|
const f = ((l = n.overrides) === null || l === void 0 ? void 0 : l.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, g = ((c = n.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), h = [];
|
|
895
|
-
g != null && g.startsWith("2.") ? rt(n, e) : h.push(
|
|
904
|
+
g != null && g.startsWith("2.") ? rt(n, e) : h.push(De(n, e)), h.push(Ne(n.widgetKey, e.trackingToken || "", i, s, f));
|
|
896
905
|
const [p] = yield Promise.allSettled(h);
|
|
897
906
|
p && p.status === "fulfilled" && p.value && ye._setRealBrainfish(p.value);
|
|
898
907
|
});
|