@brainfish-ai/widgets-initiator 1.6.2 → 1.6.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.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
var je = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var F = (a, t, n) => t in a ? je(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n,
|
|
2
|
+
var Le = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var pe = Object.getOwnPropertySymbols;
|
|
4
|
+
var We = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var F = (a, t, n) => t in a ? je(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n, L = (a, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
7
|
+
We.call(t, n) && F(a, n, t[n]);
|
|
8
|
+
if (pe)
|
|
9
|
+
for (var n of pe(t))
|
|
10
10
|
$e.call(t, n) && F(a, n, t[n]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
12
|
+
}, W = (a, t) => Fe(a, Le(t));
|
|
13
13
|
var S = (a, t, n) => F(a, typeof t != "symbol" ? t + "" : t, n);
|
|
14
|
-
var m = (a, t, n) => new Promise((
|
|
14
|
+
var m = (a, t, n) => new Promise((s, o) => {
|
|
15
15
|
var r = (l) => {
|
|
16
16
|
try {
|
|
17
17
|
d(n.next(l));
|
|
18
|
-
} catch (
|
|
19
|
-
o(
|
|
18
|
+
} catch (i) {
|
|
19
|
+
o(i);
|
|
20
20
|
}
|
|
21
21
|
}, e = (l) => {
|
|
22
22
|
try {
|
|
23
23
|
d(n.throw(l));
|
|
24
|
-
} catch (
|
|
25
|
-
o(
|
|
24
|
+
} catch (i) {
|
|
25
|
+
o(i);
|
|
26
26
|
}
|
|
27
|
-
}, d = (l) => l.done ?
|
|
27
|
+
}, d = (l) => l.done ? s(l.value) : Promise.resolve(l.value).then(r, e);
|
|
28
28
|
d((n = n.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var _, K;
|
|
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] = "2cdecea1-17e3-42e1-911c-420698976a9b", a._sentryDebugIdIdentifier = "sentry-dbid-2cdecea1-17e3-42e1-911c-420698976a9b");
|
|
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: "9b05425df40d2aba44bef8a17d5ad68c537c513d" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
|
-
}(
|
|
40
|
-
class
|
|
41
|
-
constructor(n,
|
|
42
|
-
super(n,
|
|
39
|
+
}(_ || (_ = {})), _.Sidebar, _.Searchbar;
|
|
40
|
+
class ie extends Error {
|
|
41
|
+
constructor(n, s) {
|
|
42
|
+
super(n, s);
|
|
43
43
|
S(this, "cause");
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = s == null ? void 0 : s.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
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -50,8 +50,8 @@ Caused by: ` + this.cause.stack);
|
|
|
50
50
|
}
|
|
51
51
|
(function(a) {
|
|
52
52
|
a.LINK = "link", a.CALLBACK = "callback", a.EMAIL = "email", a.PHONE = "phone";
|
|
53
|
-
})(
|
|
54
|
-
const x = (a, t, n,
|
|
53
|
+
})(K || (K = {}));
|
|
54
|
+
const x = (a, t, n, s) => {
|
|
55
55
|
let o = n, r = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
57
|
r = JSON.parse(t.message), o += ` - ${r.message || t.message}`;
|
|
@@ -61,96 +61,96 @@ const x = (a, t, n, i) => {
|
|
|
61
61
|
else o += ` - ${String(t)}`;
|
|
62
62
|
((e, d, l) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
|
-
const
|
|
65
|
-
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.6.
|
|
66
|
-
})(a, new
|
|
67
|
-
},
|
|
64
|
+
const i = d.toJSON();
|
|
65
|
+
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.6.3. ${d.message}`, stack: d.stack, cause: { message: i.message, stack: i.stack, cause: i.cause } }) });
|
|
66
|
+
})(a, new ie(o, { cause: r }), s);
|
|
67
|
+
}, He = (a) => m(void 0, null, function* () {
|
|
68
68
|
let { widgetKey: t, apiHost: n } = a;
|
|
69
|
-
return function(
|
|
69
|
+
return function(s, o, r) {
|
|
70
70
|
return m(this, null, function* () {
|
|
71
71
|
let e, d = 0;
|
|
72
72
|
for (; d < 3; ) try {
|
|
73
|
-
const l = yield fetch(`${
|
|
73
|
+
const l = yield fetch(`${s}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": r } });
|
|
74
74
|
if (!l.ok) throw new Error(`API call failed with status: ${l.status}`);
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
75
|
+
const i = yield l.json();
|
|
76
|
+
if (!i) throw new Error("Error loading config: empty response");
|
|
77
|
+
return i;
|
|
78
78
|
} catch (l) {
|
|
79
|
-
if (e = l, d++, d >= 3) throw x(
|
|
80
|
-
yield new Promise((
|
|
79
|
+
if (e = l, d++, d >= 3) throw x(s, l, "Error fetching config", r), e;
|
|
80
|
+
yield new Promise((i) => setTimeout(i, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}(n, "/api/searchWidgets.getConfigByKey", t);
|
|
84
|
-
}),
|
|
85
|
-
let { config: t, apiKey: n, apiHost:
|
|
84
|
+
}), Ke = (a) => {
|
|
85
|
+
let { config: t, apiKey: n, apiHost: s } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
87
|
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((r) => {
|
|
88
|
-
o[r] && (o[r] = o[r].map((e) => e.type ===
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
88
|
+
o[r] && (o[r] = o[r].map((e) => e.type === K.CALLBACK && e.value ? W(L({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), W(L({}, t), { settings: o, apiHost: s, widgetMode: t.widgetType, apiKey: n });
|
|
90
|
+
}, se = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", $ = (() => {
|
|
91
91
|
if (typeof window == "undefined") return;
|
|
92
92
|
const a = window.navigator.userAgent;
|
|
93
93
|
if (!(a.match(/iPad/i) || a.match(/iPhone/i))) return !1;
|
|
94
94
|
const t = a.match(/OS (\d+)_/i);
|
|
95
95
|
return t && parseInt(t[1], 10) <= 14;
|
|
96
|
-
})(),
|
|
97
|
-
let { apiHost: t, widgetKey: n, version:
|
|
96
|
+
})(), qe = (a) => m(void 0, null, function* () {
|
|
97
|
+
let { apiHost: t, widgetKey: n, version: s } = a;
|
|
98
98
|
try {
|
|
99
|
-
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${s}/dist/web.js`, r = $ ? o.replace("web.js", "web.umd.js") : o;
|
|
100
100
|
return { widget: yield ((d) => m(void 0, null, function* () {
|
|
101
|
-
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((l,
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((l, i) => {
|
|
102
102
|
const u = document.createElement("script");
|
|
103
103
|
u.id = "brainfish-widget", u.src = d, u.type = $ ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ? l(c) :
|
|
106
|
+
c ? l(c) : i(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
108
|
}, u.onerror = (c) => {
|
|
109
109
|
const f = c, g = { message: `Failed to load script: ${d}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
|
|
110
|
-
|
|
110
|
+
i(new Error(JSON.stringify(g)));
|
|
111
111
|
}, $ || document.head.appendChild(u);
|
|
112
112
|
});
|
|
113
113
|
}))(r) };
|
|
114
114
|
} catch (o) {
|
|
115
115
|
x(t, o, o.message, n);
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
118
|
-
const n =
|
|
117
|
+
}), ge = /* @__PURE__ */ new Set(), ze = (a, t) => m(void 0, null, function* () {
|
|
118
|
+
const n = se(a.overrides);
|
|
119
119
|
try {
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
120
|
+
if (ge.has(a.widgetKey)) return;
|
|
121
|
+
const s = yield qe({ apiHost: n, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (s) {
|
|
123
|
+
const { widget: o } = s, r = Ke({ config: t, apiKey: a.widgetKey, apiHost: n });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
125
|
let [d, l] = e;
|
|
126
126
|
t.settings && d in t.settings && (t.settings[d] = function() {
|
|
127
|
-
let
|
|
127
|
+
let i = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
128
|
const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
|
-
return
|
|
129
|
+
return i.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
130
|
}(t.settings[d], l));
|
|
131
131
|
}), function(e, d) {
|
|
132
|
-
d.widgetType ===
|
|
133
|
-
}(o, r),
|
|
132
|
+
d.widgetType === _.Searchbar || d.widgetType === "Search" ? e.SearchWidget.initStandard(d) : e.HelpWidget.initPopup(d);
|
|
133
|
+
}(o, r), ge.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
x(n,
|
|
135
|
+
} catch (s) {
|
|
136
|
+
x(n, s, s.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
let
|
|
140
|
-
const Ne = function(
|
|
139
|
+
let he = !1;
|
|
140
|
+
const Ne = function(s, o, r) {
|
|
141
141
|
return m(this, arguments, function* (a, t, n) {
|
|
142
142
|
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
143
|
-
if (t || x(n, new Error("Access key is required"), "Access key is required", a), !
|
|
143
|
+
if (t || x(n, new Error("Access key is required"), "Access key is required", a), !he) try {
|
|
144
144
|
const l = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
|
-
const
|
|
146
|
+
const i = navigator, u = window, c = (i.doNotTrack || u.doNotTrack || i.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
147
|
return ["1", "yes", "true"].includes(c);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !l, trackAttributes: !l, trackOutgoingLinks: !l, enableRecording: !l && d }),
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !l, trackAttributes: !l, trackOutgoingLinks: !l, enableRecording: !l && d }), he = !0, yield ((i, u) => m(this, null, function* () {
|
|
150
150
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
151
151
|
const c = document.createElement("script");
|
|
152
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
|
-
x(
|
|
153
|
+
x(i, new Error(`Failed to load script: ${c.src}`), `Failed to load script: ${c.src}`, u);
|
|
154
154
|
}, document.head.appendChild(c);
|
|
155
155
|
}))(n, a);
|
|
156
156
|
} catch (l) {
|
|
@@ -160,46 +160,44 @@ const Ne = function(i, o, r) {
|
|
|
160
160
|
};
|
|
161
161
|
function I(a, t) {
|
|
162
162
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
163
|
-
const
|
|
164
|
-
return
|
|
163
|
+
const s = document.createElement(a);
|
|
164
|
+
return s.className = t, Object.entries(n).forEach((o) => {
|
|
165
165
|
let [r, e] = o;
|
|
166
|
-
|
|
167
|
-
}),
|
|
166
|
+
s.setAttribute(r, e);
|
|
167
|
+
}), s;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
170
|
-
class
|
|
169
|
+
const T = "bf-iframe-container", j = "bf-trigger-button";
|
|
170
|
+
class b {
|
|
171
171
|
static get isWidgetOpen() {
|
|
172
172
|
return this.isOpen;
|
|
173
173
|
}
|
|
174
|
-
static initialize(t
|
|
175
|
-
var
|
|
176
|
-
|
|
174
|
+
static initialize(t) {
|
|
175
|
+
var n;
|
|
176
|
+
let { button: s, icon: o, isButtonHidden: r } = t;
|
|
177
|
+
this.button = s || null, this.icon = o || null, this.isButtonHidden = r || !1, s && s.addEventListener("click", () => this.toggleIframeVisibility()), (n = window.Brainfish) !== null && n !== void 0 && n.HelpWidget && (window.Brainfish.HelpWidget.close = () => this.closeWidget(), window.Brainfish.HelpWidget.open = () => this.openWidget());
|
|
177
178
|
}
|
|
178
179
|
static toggleIframeVisibility() {
|
|
179
|
-
|
|
180
|
-
this.isOpen = !this.isOpen;
|
|
181
|
-
const t = this.icon.querySelector(".fish-icon"), n = this.icon.querySelector(".close-icon"), i = document.querySelector(".bf-iframe-container"), o = i == null ? void 0 : i.querySelector("iframe");
|
|
182
|
-
var r;
|
|
183
|
-
this.isOpen ? (i == null || i.classList.add("open"), i == null || i.setAttribute("aria-hidden", "false"), this.button.setAttribute("aria-expanded", "true"), t.classList.remove("visible"), n.classList.add("visible"), o == null || (r = o.contentWindow) === null || r === void 0 || r.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= L && this.hideTriggerButton()) : (i == null || i.classList.remove("open"), i == null || i.setAttribute("aria-hidden", "true"), this.button.setAttribute("aria-expanded", "false"), n.classList.remove("visible"), t.classList.add("visible"), this.showTriggerButton(), window.BrainfishAnalytics("track", "Close Widget"));
|
|
180
|
+
this.isOpen = !this.isOpen, this.isOpen ? this.openWidget() : this.closeWidget();
|
|
184
181
|
}
|
|
185
182
|
static openWidget() {
|
|
186
183
|
var t;
|
|
187
|
-
if (!this.icon) return;
|
|
188
184
|
this.isOpen = !0;
|
|
189
|
-
const n = document.querySelector(".bf-iframe-container"),
|
|
190
|
-
if (n == null || n.classList.add("open"), n == null || n.setAttribute("aria-hidden", "false"),
|
|
185
|
+
const n = document.querySelector(".bf-iframe-container"), s = n == null ? void 0 : n.querySelector("iframe");
|
|
186
|
+
if (n == null || n.classList.add("open"), n == null || n.setAttribute("aria-hidden", "false"), s == null || (t = s.contentWindow) === null || t === void 0 || t.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), this.button && this.icon) {
|
|
191
187
|
const o = this.icon.querySelector(".fish-icon"), r = this.icon.querySelector(".close-icon");
|
|
192
|
-
this.button.setAttribute("aria-expanded", "true"), o.classList.remove("visible"), r.classList.add("visible"),
|
|
188
|
+
this.button.setAttribute("aria-expanded", "true"), o.classList.remove("visible"), r.classList.add("visible"), document.body.clientWidth <= 576 && this.hideTriggerButton();
|
|
193
189
|
}
|
|
190
|
+
window.BrainfishAnalytics("track", "Open Widget");
|
|
194
191
|
}
|
|
195
192
|
static closeWidget() {
|
|
196
193
|
this.isOpen = !1;
|
|
197
194
|
const t = document.querySelector(".bf-iframe-container");
|
|
198
|
-
if (t == null || t.classList.remove("open"), t == null || t.setAttribute("aria-hidden", "true"),
|
|
195
|
+
if (t == null || t.classList.remove("open"), t == null || t.setAttribute("aria-hidden", "true"), this.button && this.icon) {
|
|
199
196
|
this.button.setAttribute("aria-expanded", "false");
|
|
200
|
-
const n = this.icon.querySelector(".fish-icon"),
|
|
201
|
-
n.classList.add("visible"),
|
|
197
|
+
const n = this.icon.querySelector(".fish-icon"), s = this.icon.querySelector(".close-icon");
|
|
198
|
+
n.classList.add("visible"), s.classList.remove("visible"), document.body.clientWidth <= 576 && this.showTriggerButton();
|
|
202
199
|
}
|
|
200
|
+
window.BrainfishAnalytics("track", "Close Widget");
|
|
203
201
|
}
|
|
204
202
|
static showTriggerButton() {
|
|
205
203
|
var t;
|
|
@@ -210,66 +208,66 @@ class v {
|
|
|
210
208
|
(t = this.button) === null || t === void 0 || t.classList.add("hidden");
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
|
-
S(
|
|
214
|
-
function
|
|
215
|
-
let { widgetHost: t, apiHost: n, widgetKey:
|
|
211
|
+
S(b, "isOpen", !1), S(b, "button", null), S(b, "icon", null), S(b, "isButtonHidden", !1);
|
|
212
|
+
function De(a) {
|
|
213
|
+
let { widgetHost: t, apiHost: n, widgetKey: s, signal: o } = a;
|
|
216
214
|
window.addEventListener("message", (r) => {
|
|
217
215
|
if (r.origin !== t) return;
|
|
218
216
|
const { type: e } = r.data;
|
|
219
217
|
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
220
|
-
const d = document.querySelector(`.${
|
|
218
|
+
const d = document.querySelector(`.${T}`);
|
|
221
219
|
d.classList.contains("expanded") ? d.classList.remove("expanded") : d.classList.add("expanded");
|
|
222
220
|
}(), e === "TRACK_EVENT") {
|
|
223
221
|
if (!window.BrainfishAnalytics) return;
|
|
224
222
|
const { eventName: d, data: l } = r.data;
|
|
225
223
|
window.BrainfishAnalytics("track", d, l);
|
|
226
224
|
}
|
|
227
|
-
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"),
|
|
228
|
-
const { action: d, searchQueryId: l, query:
|
|
225
|
+
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), b.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
|
|
226
|
+
const { action: d, searchQueryId: l, query: i, answer: u } = r.data, c = { action: d, searchQueryId: l };
|
|
229
227
|
if (!["function", "callback"].includes(d.type)) return void console.error("Invalid action type", d);
|
|
230
|
-
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[d.id]) return void window.__bfCallbacks[d.id](
|
|
231
|
-
const f = `${n}/api/searchWidgets.callback.codeblocks?apiKey=${
|
|
228
|
+
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[d.id]) return void window.__bfCallbacks[d.id](i, u, c);
|
|
229
|
+
const f = `${n}/api/searchWidgets.callback.codeblocks?apiKey=${s}&codeblockId=${d.id}`, g = document.createElement("script");
|
|
232
230
|
g.src = f, document.head.appendChild(g), g.onload = () => {
|
|
233
|
-
window.__bfCallbacks[d.id](
|
|
231
|
+
window.__bfCallbacks[d.id](i, u, c), setTimeout(() => {
|
|
234
232
|
document.head.removeChild(g);
|
|
235
233
|
}, 300);
|
|
236
234
|
};
|
|
237
235
|
}
|
|
238
236
|
}, { signal: o });
|
|
239
237
|
}
|
|
240
|
-
function
|
|
238
|
+
function de(a) {
|
|
241
239
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
242
240
|
}
|
|
243
|
-
var
|
|
241
|
+
var q = { exports: {} }, z = { exports: {} }, N = { exports: {} };
|
|
244
242
|
(function(a, t) {
|
|
245
243
|
function n(o) {
|
|
246
244
|
return Math.round(255 * o);
|
|
247
245
|
}
|
|
248
|
-
function
|
|
246
|
+
function s(o, r, e) {
|
|
249
247
|
return n(o) + "," + n(r) + "," + n(e);
|
|
250
248
|
}
|
|
251
249
|
t.__esModule = !0, t.default = void 0, t.default = function(o, r, e, d) {
|
|
252
|
-
if (d === void 0 && (d =
|
|
253
|
-
var l = (o % 360 + 360) % 360 / 60,
|
|
254
|
-
l >= 0 && l < 1 ? (c =
|
|
255
|
-
var h = e -
|
|
250
|
+
if (d === void 0 && (d = s), r === 0) return d(e, e, e);
|
|
251
|
+
var l = (o % 360 + 360) % 360 / 60, i = (1 - Math.abs(2 * e - 1)) * r, u = i * (1 - Math.abs(l % 2 - 1)), c = 0, f = 0, g = 0;
|
|
252
|
+
l >= 0 && l < 1 ? (c = i, f = u) : l >= 1 && l < 2 ? (c = u, f = i) : l >= 2 && l < 3 ? (f = i, g = u) : l >= 3 && l < 4 ? (f = u, g = i) : l >= 4 && l < 5 ? (c = u, g = i) : l >= 5 && l < 6 && (c = i, g = u);
|
|
253
|
+
var h = e - i / 2;
|
|
256
254
|
return d(c + h, f + h, g + h);
|
|
257
255
|
}, a.exports = t.default;
|
|
258
256
|
})(N, N.exports);
|
|
259
|
-
var
|
|
257
|
+
var le = N.exports, D = { exports: {} };
|
|
260
258
|
(function(a, t) {
|
|
261
259
|
t.__esModule = !0, t.default = void 0;
|
|
262
260
|
var n = { 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" };
|
|
263
|
-
t.default = function(
|
|
264
|
-
if (typeof
|
|
265
|
-
var o =
|
|
266
|
-
return n[o] ? "#" + n[o] :
|
|
261
|
+
t.default = function(s) {
|
|
262
|
+
if (typeof s != "string") return s;
|
|
263
|
+
var o = s.toLowerCase();
|
|
264
|
+
return n[o] ? "#" + n[o] : s;
|
|
267
265
|
}, a.exports = t.default;
|
|
268
|
-
})(
|
|
269
|
-
var
|
|
266
|
+
})(D, D.exports);
|
|
267
|
+
var Re = D.exports, R = { exports: {} };
|
|
270
268
|
(function(a, t) {
|
|
271
269
|
function n(l) {
|
|
272
|
-
var
|
|
270
|
+
var i = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
273
271
|
return n = function(u) {
|
|
274
272
|
if (u === null || !function(f) {
|
|
275
273
|
try {
|
|
@@ -279,40 +277,40 @@ var Ue = R.exports, U = { exports: {} };
|
|
|
279
277
|
}
|
|
280
278
|
}(u)) return u;
|
|
281
279
|
if (typeof u != "function") throw new TypeError("Super expression must either be null or a function");
|
|
282
|
-
if (
|
|
283
|
-
if (
|
|
284
|
-
|
|
280
|
+
if (i !== void 0) {
|
|
281
|
+
if (i.has(u)) return i.get(u);
|
|
282
|
+
i.set(u, c);
|
|
285
283
|
}
|
|
286
284
|
function c() {
|
|
287
285
|
return function(f, g, h) {
|
|
288
|
-
if (
|
|
286
|
+
if (s()) return Reflect.construct.apply(null, arguments);
|
|
289
287
|
var p = [null];
|
|
290
288
|
p.push.apply(p, g);
|
|
291
|
-
var
|
|
292
|
-
return h && o(
|
|
289
|
+
var v = new (f.bind.apply(f, p))();
|
|
290
|
+
return h && o(v, h.prototype), v;
|
|
293
291
|
}(u, arguments, r(this).constructor);
|
|
294
292
|
}
|
|
295
293
|
return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, u);
|
|
296
294
|
}, n(l);
|
|
297
295
|
}
|
|
298
|
-
function
|
|
296
|
+
function s() {
|
|
299
297
|
try {
|
|
300
298
|
var l = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
301
299
|
}));
|
|
302
|
-
} catch (
|
|
300
|
+
} catch (i) {
|
|
303
301
|
}
|
|
304
|
-
return (
|
|
302
|
+
return (s = function() {
|
|
305
303
|
return !!l;
|
|
306
304
|
})();
|
|
307
305
|
}
|
|
308
|
-
function o(l,
|
|
306
|
+
function o(l, i) {
|
|
309
307
|
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
|
|
310
308
|
return u.__proto__ = c, u;
|
|
311
|
-
}, o(l,
|
|
309
|
+
}, o(l, i);
|
|
312
310
|
}
|
|
313
311
|
function r(l) {
|
|
314
|
-
return r = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(
|
|
315
|
-
return
|
|
312
|
+
return r = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(i) {
|
|
313
|
+
return i.__proto__ || Object.getPrototypeOf(i);
|
|
316
314
|
}, r(l);
|
|
317
315
|
}
|
|
318
316
|
t.__esModule = !0, t.default = void 0;
|
|
@@ -466,20 +464,20 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
466
464
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
467
465
|
` };
|
|
468
466
|
function d() {
|
|
469
|
-
for (var l = arguments.length,
|
|
470
|
-
var c, f =
|
|
471
|
-
for (c = 1; c <
|
|
467
|
+
for (var l = arguments.length, i = new Array(l), u = 0; u < l; u++) i[u] = arguments[u];
|
|
468
|
+
var c, f = i[0], g = [];
|
|
469
|
+
for (c = 1; c < i.length; c += 1) g.push(i[c]);
|
|
472
470
|
return g.forEach(function(h) {
|
|
473
471
|
f = f.replace(/%[a-z]/, h);
|
|
474
472
|
}), f;
|
|
475
473
|
}
|
|
476
474
|
t.default = function(l) {
|
|
477
|
-
var
|
|
475
|
+
var i, u;
|
|
478
476
|
function c(f) {
|
|
479
477
|
var g;
|
|
480
478
|
if (process.env.NODE_ENV === "production") g = l.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
|
|
481
479
|
else {
|
|
482
|
-
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0),
|
|
480
|
+
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), v = 1; v < h; v++) p[v - 1] = arguments[v];
|
|
483
481
|
g = l.call(this, d.apply(void 0, [e[f]].concat(p))) || this;
|
|
484
482
|
}
|
|
485
483
|
return function(C) {
|
|
@@ -487,21 +485,21 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
487
485
|
return C;
|
|
488
486
|
}(g);
|
|
489
487
|
}
|
|
490
|
-
return u = l, (
|
|
488
|
+
return u = l, (i = c).prototype = Object.create(u.prototype), i.prototype.constructor = i, o(i, u), c;
|
|
491
489
|
}(n(Error)), a.exports = t.default;
|
|
492
|
-
})(
|
|
493
|
-
var
|
|
490
|
+
})(R, R.exports);
|
|
491
|
+
var k = R.exports;
|
|
494
492
|
(function(a, t) {
|
|
495
493
|
t.__esModule = !0, t.default = function(h) {
|
|
496
494
|
if (typeof h != "string") throw new o.default(3);
|
|
497
|
-
var p = (0,
|
|
495
|
+
var p = (0, s.default)(h);
|
|
498
496
|
if (p.match(e)) return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16) };
|
|
499
497
|
if (p.match(d)) {
|
|
500
|
-
var
|
|
501
|
-
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha:
|
|
498
|
+
var v = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
499
|
+
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: v };
|
|
502
500
|
}
|
|
503
501
|
if (p.match(l)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
|
|
504
|
-
if (p.match(
|
|
502
|
+
if (p.match(i)) {
|
|
505
503
|
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
506
504
|
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
507
505
|
}
|
|
@@ -511,188 +509,188 @@ var _ = U.exports;
|
|
|
511
509
|
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]) };
|
|
512
510
|
var A = f.exec(p);
|
|
513
511
|
if (A) {
|
|
514
|
-
var
|
|
515
|
-
if (!B) throw new o.default(4, p,
|
|
512
|
+
var Be = parseInt("" + A[1], 10), Oe = parseInt("" + A[2], 10) / 100, Ie = parseInt("" + A[3], 10) / 100, fe = "rgb(" + (0, n.default)(Be, Oe, Ie) + ")", B = u.exec(fe);
|
|
513
|
+
if (!B) throw new o.default(4, p, fe);
|
|
516
514
|
return { red: parseInt("" + B[1], 10), green: parseInt("" + B[2], 10), blue: parseInt("" + B[3], 10) };
|
|
517
515
|
}
|
|
518
516
|
var w = g.exec(p.substring(0, 50));
|
|
519
517
|
if (w) {
|
|
520
|
-
var
|
|
521
|
-
if (!O) throw new o.default(4, p,
|
|
518
|
+
var Me = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, Te = parseInt("" + w[3], 10) / 100, ce = "rgb(" + (0, n.default)(Me, Pe, Te) + ")", O = u.exec(ce);
|
|
519
|
+
if (!O) throw new o.default(4, p, ce);
|
|
522
520
|
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]) };
|
|
523
521
|
}
|
|
524
522
|
throw new o.default(5);
|
|
525
523
|
};
|
|
526
|
-
var n = r(
|
|
524
|
+
var n = r(le), s = r(Re), o = r(k);
|
|
527
525
|
function r(h) {
|
|
528
526
|
return h && h.__esModule ? h : { default: h };
|
|
529
527
|
}
|
|
530
|
-
var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/,
|
|
528
|
+
var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/, i = /^#[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;
|
|
531
529
|
a.exports = t.default;
|
|
532
|
-
})(
|
|
533
|
-
var
|
|
530
|
+
})(z, z.exports);
|
|
531
|
+
var ue = z.exports;
|
|
534
532
|
(function(a, t) {
|
|
535
533
|
t.__esModule = !0, t.default = function(o) {
|
|
536
534
|
if (o === "transparent") return 0;
|
|
537
|
-
var r = (0,
|
|
535
|
+
var r = (0, s.default)(o), e = Object.keys(r).map(function(u) {
|
|
538
536
|
var c = r[u] / 255;
|
|
539
537
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
540
|
-
}), d = e[0], l = e[1],
|
|
541
|
-
return parseFloat((0.2126 * d + 0.7152 * l + 0.0722 *
|
|
538
|
+
}), d = e[0], l = e[1], i = e[2];
|
|
539
|
+
return parseFloat((0.2126 * d + 0.7152 * l + 0.0722 * i).toFixed(3));
|
|
542
540
|
};
|
|
543
|
-
var n,
|
|
541
|
+
var n, s = (n = ue) && n.__esModule ? n : { default: n };
|
|
544
542
|
a.exports = t.default;
|
|
545
|
-
})(
|
|
546
|
-
const Ye =
|
|
543
|
+
})(q, q.exports);
|
|
544
|
+
const Ye = de(q.exports);
|
|
547
545
|
var Y = { exports: {} }, J = { exports: {} };
|
|
548
546
|
(function(a, t) {
|
|
549
|
-
function n(
|
|
547
|
+
function n(s, o, r) {
|
|
550
548
|
return function() {
|
|
551
549
|
var e = r.concat(Array.prototype.slice.call(arguments));
|
|
552
|
-
return e.length >= o ?
|
|
550
|
+
return e.length >= o ? s.apply(this, e) : n(s, o, e);
|
|
553
551
|
};
|
|
554
552
|
}
|
|
555
|
-
t.__esModule = !0, t.default = function(
|
|
556
|
-
return n(
|
|
553
|
+
t.__esModule = !0, t.default = function(s) {
|
|
554
|
+
return n(s, s.length, []);
|
|
557
555
|
}, a.exports = t.default;
|
|
558
556
|
})(J, J.exports);
|
|
559
|
-
var
|
|
560
|
-
|
|
557
|
+
var me, M, we = J.exports, U = { exports: {} };
|
|
558
|
+
me = U, (M = U.exports).__esModule = !0, M.default = void 0, M.default = function(a, t, n) {
|
|
561
559
|
return Math.max(a, Math.min(t, n));
|
|
562
|
-
},
|
|
563
|
-
var
|
|
560
|
+
}, me.exports = M.default;
|
|
561
|
+
var xe = U.exports, G = { exports: {} }, V = { exports: {} };
|
|
564
562
|
(function(a, t) {
|
|
565
563
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
566
|
-
var
|
|
567
|
-
if (d === l) return n.alpha !== void 0 ? { hue: 0, saturation: 0, lightness:
|
|
568
|
-
var u = d - l, c =
|
|
564
|
+
var s, o = n.red / 255, r = n.green / 255, e = n.blue / 255, d = Math.max(o, r, e), l = Math.min(o, r, e), i = (d + l) / 2;
|
|
565
|
+
if (d === l) return n.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: i, alpha: n.alpha } : { hue: 0, saturation: 0, lightness: i };
|
|
566
|
+
var u = d - l, c = i > 0.5 ? u / (2 - d - l) : u / (d + l);
|
|
569
567
|
switch (d) {
|
|
570
568
|
case o:
|
|
571
|
-
|
|
569
|
+
s = (r - e) / u + (r < e ? 6 : 0);
|
|
572
570
|
break;
|
|
573
571
|
case r:
|
|
574
|
-
|
|
572
|
+
s = (e - o) / u + 2;
|
|
575
573
|
break;
|
|
576
574
|
default:
|
|
577
|
-
|
|
575
|
+
s = (o - r) / u + 4;
|
|
578
576
|
}
|
|
579
|
-
return
|
|
577
|
+
return s *= 60, n.alpha !== void 0 ? { hue: s, saturation: c, lightness: i, alpha: n.alpha } : { hue: s, saturation: c, lightness: i };
|
|
580
578
|
}, a.exports = t.default;
|
|
581
|
-
})(
|
|
582
|
-
var Je =
|
|
579
|
+
})(V, V.exports);
|
|
580
|
+
var Je = V.exports;
|
|
583
581
|
(function(a, t) {
|
|
584
582
|
t.__esModule = !0, t.default = function(r) {
|
|
585
|
-
return (0,
|
|
583
|
+
return (0, s.default)((0, n.default)(r));
|
|
586
584
|
};
|
|
587
|
-
var n = o(
|
|
585
|
+
var n = o(ue), s = o(Je);
|
|
588
586
|
function o(r) {
|
|
589
587
|
return r && r.__esModule ? r : { default: r };
|
|
590
588
|
}
|
|
591
589
|
a.exports = t.default;
|
|
592
|
-
})(
|
|
593
|
-
var
|
|
590
|
+
})(G, G.exports);
|
|
591
|
+
var Se = G.exports, Z = { exports: {} }, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} };
|
|
594
592
|
(function(a, t) {
|
|
595
593
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
596
594
|
return n.length === 7 && n[1] === n[2] && n[3] === n[4] && n[5] === n[6] ? "#" + n[1] + n[3] + n[5] : n;
|
|
597
595
|
}, a.exports = t.default;
|
|
598
|
-
})(
|
|
599
|
-
var ke =
|
|
596
|
+
})(ee, ee.exports);
|
|
597
|
+
var ke = ee.exports, te = { exports: {} };
|
|
600
598
|
(function(a, t) {
|
|
601
599
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
602
|
-
var
|
|
603
|
-
return
|
|
600
|
+
var s = n.toString(16);
|
|
601
|
+
return s.length === 1 ? "0" + s : s;
|
|
604
602
|
}, a.exports = t.default;
|
|
605
|
-
})(
|
|
606
|
-
var
|
|
603
|
+
})(te, te.exports);
|
|
604
|
+
var _e = te.exports;
|
|
607
605
|
(function(a, t) {
|
|
608
606
|
t.__esModule = !0, t.default = void 0;
|
|
609
|
-
var n = r(
|
|
607
|
+
var n = r(le), s = r(ke), o = r(_e);
|
|
610
608
|
function r(l) {
|
|
611
609
|
return l && l.__esModule ? l : { default: l };
|
|
612
610
|
}
|
|
613
611
|
function e(l) {
|
|
614
612
|
return (0, o.default)(Math.round(255 * l));
|
|
615
613
|
}
|
|
616
|
-
function d(l,
|
|
617
|
-
return (0,
|
|
614
|
+
function d(l, i, u) {
|
|
615
|
+
return (0, s.default)("#" + e(l) + e(i) + e(u));
|
|
618
616
|
}
|
|
619
|
-
t.default = function(l,
|
|
620
|
-
return (0, n.default)(l,
|
|
617
|
+
t.default = function(l, i, u) {
|
|
618
|
+
return (0, n.default)(l, i, u, d);
|
|
621
619
|
}, a.exports = t.default;
|
|
622
|
-
})(
|
|
623
|
-
var
|
|
620
|
+
})(X, X.exports);
|
|
621
|
+
var Ce = X.exports;
|
|
624
622
|
(function(a, t) {
|
|
625
623
|
t.__esModule = !0, t.default = function(r, e, d) {
|
|
626
624
|
if (typeof r == "number" && typeof e == "number" && typeof d == "number") return (0, n.default)(r, e, d);
|
|
627
625
|
if (typeof r == "object" && e === void 0 && d === void 0) return (0, n.default)(r.hue, r.saturation, r.lightness);
|
|
628
|
-
throw new
|
|
626
|
+
throw new s.default(1);
|
|
629
627
|
};
|
|
630
|
-
var n = o(
|
|
628
|
+
var n = o(Ce), s = o(k);
|
|
631
629
|
function o(r) {
|
|
632
630
|
return r && r.__esModule ? r : { default: r };
|
|
633
631
|
}
|
|
634
632
|
a.exports = t.default;
|
|
635
|
-
})(
|
|
636
|
-
var
|
|
633
|
+
})(Q, Q.exports);
|
|
634
|
+
var Ue = Q.exports, ne = { exports: {} };
|
|
637
635
|
(function(a, t) {
|
|
638
|
-
t.__esModule = !0, t.default = function(e, d, l,
|
|
639
|
-
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof
|
|
640
|
-
if (typeof e == "object" && d === void 0 && l === void 0 &&
|
|
636
|
+
t.__esModule = !0, t.default = function(e, d, l, i) {
|
|
637
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof i == "number") return i >= 1 ? (0, n.default)(e, d, l) : "rgba(" + (0, s.default)(e, d, l) + "," + i + ")";
|
|
638
|
+
if (typeof e == "object" && d === void 0 && l === void 0 && i === void 0) return e.alpha >= 1 ? (0, n.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, s.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
641
639
|
throw new o.default(2);
|
|
642
640
|
};
|
|
643
|
-
var n = r(
|
|
641
|
+
var n = r(Ce), s = r(le), o = r(k);
|
|
644
642
|
function r(e) {
|
|
645
643
|
return e && e.__esModule ? e : { default: e };
|
|
646
644
|
}
|
|
647
645
|
a.exports = t.default;
|
|
648
|
-
})(
|
|
649
|
-
var
|
|
646
|
+
})(ne, ne.exports);
|
|
647
|
+
var Ge = ne.exports, re = { exports: {} };
|
|
650
648
|
(function(a, t) {
|
|
651
649
|
t.__esModule = !0, t.default = function(e, d, l) {
|
|
652
|
-
if (typeof e == "number" && typeof d == "number" && typeof l == "number") return (0, n.default)("#" + (0,
|
|
653
|
-
if (typeof e == "object" && d === void 0 && l === void 0) return (0, n.default)("#" + (0,
|
|
650
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number") return (0, n.default)("#" + (0, s.default)(e) + (0, s.default)(d) + (0, s.default)(l));
|
|
651
|
+
if (typeof e == "object" && d === void 0 && l === void 0) return (0, n.default)("#" + (0, s.default)(e.red) + (0, s.default)(e.green) + (0, s.default)(e.blue));
|
|
654
652
|
throw new o.default(6);
|
|
655
653
|
};
|
|
656
|
-
var n = r(ke),
|
|
654
|
+
var n = r(ke), s = r(_e), o = r(k);
|
|
657
655
|
function r(e) {
|
|
658
656
|
return e && e.__esModule ? e : { default: e };
|
|
659
657
|
}
|
|
660
658
|
a.exports = t.default;
|
|
661
|
-
})(
|
|
662
|
-
var
|
|
659
|
+
})(re, re.exports);
|
|
660
|
+
var Ee = re.exports, ae = { exports: {} };
|
|
663
661
|
(function(a, t) {
|
|
664
|
-
t.__esModule = !0, t.default = function(e, d, l,
|
|
662
|
+
t.__esModule = !0, t.default = function(e, d, l, i) {
|
|
665
663
|
if (typeof e == "string" && typeof d == "number") {
|
|
666
664
|
var u = (0, n.default)(e);
|
|
667
665
|
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + d + ")";
|
|
668
666
|
}
|
|
669
|
-
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof
|
|
670
|
-
if (typeof e == "object" && d === void 0 && l === void 0 &&
|
|
667
|
+
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof i == "number") return i >= 1 ? (0, s.default)(e, d, l) : "rgba(" + e + "," + d + "," + l + "," + i + ")";
|
|
668
|
+
if (typeof e == "object" && d === void 0 && l === void 0 && i === void 0) return e.alpha >= 1 ? (0, s.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
671
669
|
throw new o.default(7);
|
|
672
670
|
};
|
|
673
|
-
var n = r(
|
|
671
|
+
var n = r(ue), s = r(Ee), o = r(k);
|
|
674
672
|
function r(e) {
|
|
675
673
|
return e && e.__esModule ? e : { default: e };
|
|
676
674
|
}
|
|
677
675
|
a.exports = t.default;
|
|
678
|
-
})(
|
|
679
|
-
var
|
|
676
|
+
})(ae, ae.exports);
|
|
677
|
+
var Ve = ae.exports;
|
|
680
678
|
(function(a, t) {
|
|
681
679
|
t.__esModule = !0, t.default = function(f) {
|
|
682
680
|
if (typeof f != "object") throw new e.default(8);
|
|
683
|
-
if (
|
|
681
|
+
if (i(f)) return (0, r.default)(f);
|
|
684
682
|
if (l(f)) return (0, o.default)(f);
|
|
685
|
-
if (c(f)) return (0,
|
|
683
|
+
if (c(f)) return (0, s.default)(f);
|
|
686
684
|
if (u(f)) return (0, n.default)(f);
|
|
687
685
|
throw new e.default(8);
|
|
688
686
|
};
|
|
689
|
-
var n = d(
|
|
687
|
+
var n = d(Ue), s = d(Ge), o = d(Ee), r = d(Ve), e = d(k);
|
|
690
688
|
function d(f) {
|
|
691
689
|
return f && f.__esModule ? f : { default: f };
|
|
692
690
|
}
|
|
693
691
|
var l = function(f) {
|
|
694
692
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
695
|
-
},
|
|
693
|
+
}, i = function(f) {
|
|
696
694
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
697
695
|
}, u = function(f) {
|
|
698
696
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
@@ -700,144 +698,150 @@ var Ze = ie.exports;
|
|
|
700
698
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
|
|
701
699
|
};
|
|
702
700
|
a.exports = t.default;
|
|
703
|
-
})(
|
|
704
|
-
var
|
|
701
|
+
})(Z, Z.exports);
|
|
702
|
+
var Ae = Z.exports;
|
|
705
703
|
(function(a, t) {
|
|
706
704
|
t.__esModule = !0, t.default = void 0;
|
|
707
|
-
var n = e(
|
|
708
|
-
function e(
|
|
709
|
-
return
|
|
705
|
+
var n = e(we), s = e(xe), o = e(Se), r = e(Ae);
|
|
706
|
+
function e(i) {
|
|
707
|
+
return i && i.__esModule ? i : { default: i };
|
|
710
708
|
}
|
|
711
709
|
function d() {
|
|
712
|
-
return d = Object.assign ? Object.assign.bind() : function(
|
|
710
|
+
return d = Object.assign ? Object.assign.bind() : function(i) {
|
|
713
711
|
for (var u = 1; u < arguments.length; u++) {
|
|
714
712
|
var c = arguments[u];
|
|
715
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
713
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (i[f] = c[f]);
|
|
716
714
|
}
|
|
717
|
-
return
|
|
715
|
+
return i;
|
|
718
716
|
}, d.apply(this, arguments);
|
|
719
717
|
}
|
|
720
|
-
var l = (0, n.default)(function(
|
|
718
|
+
var l = (0, n.default)(function(i, u) {
|
|
721
719
|
if (u === "transparent") return u;
|
|
722
720
|
var c = (0, o.default)(u);
|
|
723
|
-
return (0, r.default)(d({}, c, { lightness: (0,
|
|
721
|
+
return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness - parseFloat(i)) }));
|
|
724
722
|
});
|
|
725
723
|
t.default = l, a.exports = t.default;
|
|
726
724
|
})(Y, Y.exports);
|
|
727
|
-
const
|
|
725
|
+
const Ze = de(Y.exports);
|
|
728
726
|
var oe = { exports: {} };
|
|
729
727
|
(function(a, t) {
|
|
730
728
|
t.__esModule = !0, t.default = void 0;
|
|
731
|
-
var n = e(
|
|
732
|
-
function e(
|
|
733
|
-
return
|
|
729
|
+
var n = e(we), s = e(xe), o = e(Se), r = e(Ae);
|
|
730
|
+
function e(i) {
|
|
731
|
+
return i && i.__esModule ? i : { default: i };
|
|
734
732
|
}
|
|
735
733
|
function d() {
|
|
736
|
-
return d = Object.assign ? Object.assign.bind() : function(
|
|
734
|
+
return d = Object.assign ? Object.assign.bind() : function(i) {
|
|
737
735
|
for (var u = 1; u < arguments.length; u++) {
|
|
738
736
|
var c = arguments[u];
|
|
739
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
737
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (i[f] = c[f]);
|
|
740
738
|
}
|
|
741
|
-
return
|
|
739
|
+
return i;
|
|
742
740
|
}, d.apply(this, arguments);
|
|
743
741
|
}
|
|
744
|
-
var l = (0, n.default)(function(
|
|
742
|
+
var l = (0, n.default)(function(i, u) {
|
|
745
743
|
if (u === "transparent") return u;
|
|
746
744
|
var c = (0, o.default)(u);
|
|
747
|
-
return (0, r.default)(d({}, c, { lightness: (0,
|
|
745
|
+
return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness + parseFloat(i)) }));
|
|
748
746
|
});
|
|
749
747
|
t.default = l, a.exports = t.default;
|
|
750
748
|
})(oe, oe.exports);
|
|
751
|
-
const
|
|
752
|
-
function
|
|
749
|
+
const Qe = de(oe.exports);
|
|
750
|
+
function Xe(a) {
|
|
753
751
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
754
752
|
var t, n;
|
|
755
753
|
(function() {
|
|
756
|
-
let
|
|
754
|
+
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
757
755
|
const r = document.createElement("style");
|
|
758
756
|
r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
759
|
-
const e = Ye(
|
|
757
|
+
const e = Ye(s) > 0.5;
|
|
760
758
|
r.textContent = `
|
|
761
759
|
.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))}}
|
|
762
|
-
.${j} { background: ${
|
|
760
|
+
.${j} { background: ${s}; }
|
|
763
761
|
.${j}:hover {
|
|
764
|
-
background: ${e ?
|
|
762
|
+
background: ${e ? Ze(0.05, s) : Qe(0.05, s)};
|
|
765
763
|
}
|
|
766
764
|
.trigger-button-icon { color: ${o}; }
|
|
767
765
|
`, document.head.appendChild(r);
|
|
768
766
|
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (n = a.theme) === null || n === void 0 ? void 0 : n.textBaseColor) || "#ffffff");
|
|
769
767
|
}
|
|
770
768
|
}
|
|
771
|
-
function
|
|
769
|
+
function et(a, t) {
|
|
772
770
|
const n = () => {
|
|
773
|
-
((
|
|
771
|
+
((s) => {
|
|
774
772
|
var o;
|
|
775
|
-
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode:
|
|
773
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: s }, "*");
|
|
776
774
|
})(document.body.classList.contains("dark"));
|
|
777
775
|
};
|
|
778
776
|
n(), (() => {
|
|
779
|
-
const
|
|
780
|
-
|
|
777
|
+
const s = new MutationObserver(n);
|
|
778
|
+
s.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => s.disconnect());
|
|
781
779
|
})();
|
|
782
780
|
}
|
|
783
|
-
function
|
|
781
|
+
function tt(a, t) {
|
|
784
782
|
let n;
|
|
785
|
-
const
|
|
783
|
+
const s = () => {
|
|
786
784
|
((r) => {
|
|
787
785
|
var e;
|
|
788
786
|
const d = { type: "UPDATE_BODY_CLASS", isMobile: r };
|
|
789
|
-
(e = a.contentWindow) === null || e === void 0 || e.postMessage(d, "*"), r && (
|
|
790
|
-
})(document.body.clientWidth <=
|
|
787
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(d, "*"), r && (b.isWidgetOpen ? b.hideTriggerButton() : b.showTriggerButton());
|
|
788
|
+
})(document.body.clientWidth <= 576);
|
|
791
789
|
}, o = () => {
|
|
792
|
-
n && clearTimeout(n), n = window.setTimeout(
|
|
790
|
+
n && clearTimeout(n), n = window.setTimeout(s, 300);
|
|
793
791
|
};
|
|
794
|
-
|
|
792
|
+
s(), (() => {
|
|
795
793
|
const r = new ResizeObserver(o);
|
|
796
794
|
r.observe(document.body), t.addEventListener("abort", () => r.disconnect());
|
|
797
795
|
})();
|
|
798
796
|
}
|
|
799
|
-
function
|
|
797
|
+
function be(a) {
|
|
800
798
|
const t = new TextEncoder().encode(a);
|
|
801
799
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
802
|
-
const n = Array.from(t, (
|
|
800
|
+
const n = Array.from(t, (s) => String.fromCharCode(s)).join("");
|
|
803
801
|
return btoa(n);
|
|
804
802
|
}
|
|
805
803
|
if (typeof Buffer != "undefined") return Buffer.from(t).toString("base64");
|
|
806
804
|
throw new Error("[utils.base64Encode]: Unsupported environment");
|
|
807
805
|
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
806
|
+
const ve = /* @__PURE__ */ new Set();
|
|
807
|
+
function nt(a, t, n) {
|
|
808
|
+
const s = document.createDocumentFragment();
|
|
809
|
+
if (n) b.initialize({ isButtonHidden: n });
|
|
810
|
+
else {
|
|
811
|
+
const { button: e, icon: d } = function(l) {
|
|
812
|
+
const i = I("button", j, { id: `trigger-button-${l}`, "aria-controls": T, "aria-expanded": "false", "data-name": j }), u = I("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
813
|
+
return u.innerHTML = `
|
|
813
814
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
814
815
|
<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>
|
|
815
816
|
</svg>
|
|
816
817
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
817
818
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>
|
|
818
819
|
</svg>
|
|
819
|
-
`,
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
`, i.setAttribute("aria-label", "Open Brainfish widget"), i.appendChild(u), { button: i, icon: u };
|
|
821
|
+
}(a);
|
|
822
|
+
s.appendChild(e), b.initialize({ button: e, icon: d });
|
|
823
|
+
}
|
|
824
|
+
const { iframeContainer: o, iframe: r } = function(e) {
|
|
825
|
+
const d = I("div", T, { id: T, "aria-live": "polite", "aria-hidden": "true" }), l = I("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
826
|
+
return d.appendChild(l), { iframeContainer: d, iframe: l };
|
|
823
827
|
}(t);
|
|
824
|
-
return
|
|
828
|
+
return s.appendChild(o), { fragment: s, iframe: r };
|
|
825
829
|
}
|
|
826
|
-
const
|
|
827
|
-
const n =
|
|
830
|
+
const rt = (a, t) => {
|
|
831
|
+
const n = se(a.overrides), s = ((o = a.overrides) == null ? void 0 : o.widgetHost) || "https://agent.brainfi.sh";
|
|
828
832
|
var o;
|
|
829
|
-
const { theme: r, settings: e } = t, d = `${
|
|
833
|
+
const { theme: r, settings: e } = t, d = `${s}/?widgetKey=${a.widgetKey}&themeParam=${be(JSON.stringify(r))}&settingsParam=${be(JSON.stringify(e))}`, l = e == null ? void 0 : e.hideTriggerButton;
|
|
830
834
|
try {
|
|
831
|
-
if (
|
|
835
|
+
if (i = a.widgetKey, ve.has(i) || function(p) {
|
|
832
836
|
return !!document.getElementById(`trigger-button-${p}`);
|
|
833
837
|
}(a.widgetKey)) return;
|
|
834
|
-
|
|
835
|
-
const { fragment: u, iframe: c } =
|
|
838
|
+
Xe(t);
|
|
839
|
+
const { fragment: u, iframe: c } = nt(a.widgetKey, d, l || !1), f = new AbortController(), { signal: g } = f;
|
|
836
840
|
c.onload = () => {
|
|
837
841
|
setTimeout(() => {
|
|
838
|
-
|
|
842
|
+
et(c, g), De({ widgetHost: s, apiHost: n, widgetKey: a.widgetKey, signal: g }), tt(c, g);
|
|
839
843
|
}, 0);
|
|
840
|
-
}, document.body.appendChild(u),
|
|
844
|
+
}, document.body.appendChild(u), ve.add(a.widgetKey);
|
|
841
845
|
const h = () => {
|
|
842
846
|
f.abort(), window.removeEventListener("beforeunload", h);
|
|
843
847
|
};
|
|
@@ -847,16 +851,16 @@ const at = (a, t) => {
|
|
|
847
851
|
x(c, f, f.message, g);
|
|
848
852
|
})(n, u, a.widgetKey);
|
|
849
853
|
}
|
|
850
|
-
var
|
|
854
|
+
var i;
|
|
851
855
|
};
|
|
852
|
-
let
|
|
853
|
-
const
|
|
856
|
+
let P = null;
|
|
857
|
+
const ye = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (P || (P = /* @__PURE__ */ function() {
|
|
854
858
|
let a = [], t = null;
|
|
855
859
|
function n(o, r) {
|
|
856
860
|
if (t) {
|
|
857
861
|
const e = o.split(".");
|
|
858
862
|
let d = t;
|
|
859
|
-
for (let
|
|
863
|
+
for (let i = 0; i < e.length - 1; i++) d = d[e[i]];
|
|
860
864
|
const l = d[e[e.length - 1]];
|
|
861
865
|
if (typeof l == "function") return l.apply(d, r);
|
|
862
866
|
} else a.push([o, r]);
|
|
@@ -885,44 +889,44 @@ const we = typeof window != "undefined" && window.Brainfish ? window.Brainfish :
|
|
|
885
889
|
n(r, e);
|
|
886
890
|
}
|
|
887
891
|
} };
|
|
888
|
-
}(), typeof window != "undefined" && (window.Brainfish =
|
|
889
|
-
let
|
|
890
|
-
|
|
892
|
+
}(), typeof window != "undefined" && (window.Brainfish = P)), P);
|
|
893
|
+
let H = null;
|
|
894
|
+
ye.Widgets.init = (a) => m(void 0, null, function* () {
|
|
891
895
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
892
896
|
for (var r = arguments.length, e = new Array(r), d = 0; d < r; d++) e[d] = arguments[d];
|
|
893
897
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
894
898
|
});
|
|
895
|
-
const t =
|
|
896
|
-
var
|
|
899
|
+
const t = se(a.overrides), n = ((s = a.overrides) == null ? void 0 : s.analyticsApiHost) || "";
|
|
900
|
+
var s;
|
|
897
901
|
let o;
|
|
898
902
|
if (a.config) o = JSON.parse(((r) => {
|
|
899
903
|
if (typeof window != "undefined" && typeof window.atob == "function") {
|
|
900
904
|
const e = atob(r), d = e.length, l = new Uint8Array(d);
|
|
901
|
-
for (let
|
|
905
|
+
for (let i = 0; i < d; i++) l[i] = e.charCodeAt(i);
|
|
902
906
|
return new TextDecoder().decode(l);
|
|
903
907
|
}
|
|
904
908
|
if (typeof Buffer != "undefined") return Buffer.from(r, "base64").toString("utf-8");
|
|
905
909
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
906
910
|
})(a.config));
|
|
907
911
|
else {
|
|
908
|
-
const { config: r } = yield
|
|
912
|
+
const { config: r } = yield He({ widgetKey: a.widgetKey, apiHost: t });
|
|
909
913
|
o = r;
|
|
910
914
|
}
|
|
911
|
-
|
|
915
|
+
H || (H = function(r, e, d, l) {
|
|
912
916
|
return m(this, null, function* () {
|
|
913
|
-
var
|
|
914
|
-
const f = ((
|
|
915
|
-
g != null && g.startsWith("2.") ?
|
|
917
|
+
var i, u, c;
|
|
918
|
+
const f = ((i = r.overrides) === null || i === void 0 ? void 0 : i.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, g = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), h = [];
|
|
919
|
+
g != null && g.startsWith("2.") ? rt(r, e) : h.push(ze(r, e)), h.push(Ne(r.widgetKey, e.trackingToken || "", d, l, f));
|
|
916
920
|
const [p] = yield Promise.allSettled(h);
|
|
917
|
-
p && p.status === "fulfilled" && p.value &&
|
|
921
|
+
p && p.status === "fulfilled" && p.value && ye._setRealBrainfish(p.value);
|
|
918
922
|
});
|
|
919
|
-
}(a, o, t, n)), yield
|
|
923
|
+
}(a, o, t, n)), yield H;
|
|
920
924
|
});
|
|
921
925
|
const ot = function() {
|
|
922
926
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|
|
923
927
|
};
|
|
924
928
|
export {
|
|
925
929
|
ot as BrainfishAnalytics,
|
|
926
|
-
|
|
930
|
+
ye as default
|
|
927
931
|
};
|
|
928
932
|
//# sourceMappingURL=web.js.map
|