@brainfish-ai/widgets-initiator 1.6.0 → 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.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
1
|
+
var je = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
2
|
var Le = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var pe = Object.getOwnPropertySymbols;
|
|
4
|
-
var $e = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
$e.call(t,
|
|
4
|
+
var $e = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable;
|
|
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
|
+
for (var r in t || (t = {}))
|
|
7
|
+
$e.call(t, r) && F(a, r, t[r]);
|
|
8
8
|
if (pe)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var r of pe(t))
|
|
10
|
+
Ke.call(t, r) && F(a, r, t[r]);
|
|
11
11
|
return a;
|
|
12
|
-
}, $ = (a, t) =>
|
|
13
|
-
var
|
|
14
|
-
var m = (a, t,
|
|
15
|
-
var
|
|
12
|
+
}, $ = (a, t) => Fe(a, Le(t));
|
|
13
|
+
var _ = (a, t, r) => F(a, typeof t != "symbol" ? t + "" : t, r);
|
|
14
|
+
var m = (a, t, r) => new Promise((d, o) => {
|
|
15
|
+
var n = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
o(
|
|
17
|
+
i(r.next(s));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
o(l);
|
|
20
20
|
}
|
|
21
21
|
}, e = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
o(
|
|
23
|
+
i(r.throw(s));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
o(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, i = (s) => s.done ? d(s.value) : Promise.resolve(s.value).then(n, e);
|
|
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] = "
|
|
35
|
-
} catch (
|
|
34
|
+
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "65d8351e-5447-4dbb-a42e-1db7729f2a76", a._sentryDebugIdIdentifier = "sentry-dbid-65d8351e-5447-4dbb-a42e-1db7729f2a76");
|
|
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
|
-
constructor(
|
|
42
|
-
super(
|
|
43
|
-
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
41
|
+
constructor(r, d) {
|
|
42
|
+
super(r, d);
|
|
43
|
+
_(this, "cause");
|
|
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
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -50,136 +50,145 @@ 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,
|
|
55
|
-
let o =
|
|
53
|
+
})(H || (H = {}));
|
|
54
|
+
const x = (a, t, r, d) => {
|
|
55
|
+
let o = r, n = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
|
-
|
|
57
|
+
n = JSON.parse(t.message), o += ` - ${n.message || t.message}`;
|
|
58
58
|
} catch (e) {
|
|
59
59
|
o += ` - ${t.message}`;
|
|
60
60
|
}
|
|
61
61
|
else o += ` - ${String(t)}`;
|
|
62
|
-
((e,
|
|
62
|
+
((e, i, s) => {
|
|
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": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.
|
|
66
|
-
})(a, new ie(o, { cause:
|
|
67
|
-
},
|
|
68
|
-
let { widgetKey: t, apiHost:
|
|
69
|
-
return function(
|
|
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.7.0-alpha.3. ${i.message}`, stack: i.stack, cause: { message: l.message, stack: l.stack, cause: l.cause } }) });
|
|
66
|
+
})(a, new ie(o, { cause: n }), d);
|
|
67
|
+
}, We = (a) => m(void 0, null, function* () {
|
|
68
|
+
let { widgetKey: t, apiHost: r } = a;
|
|
69
|
+
return function(d, o, n) {
|
|
70
70
|
return m(this, null, function* () {
|
|
71
|
-
let e,
|
|
72
|
-
for (;
|
|
73
|
-
const s = yield fetch(`${
|
|
71
|
+
let e, i = 0;
|
|
72
|
+
for (; i < 3; ) try {
|
|
73
|
+
const s = yield fetch(`${d}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": n } });
|
|
74
74
|
if (!s.ok) throw new Error(`API call failed with status: ${s.status}`);
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
75
|
+
const l = yield s.json();
|
|
76
|
+
if (!l) throw new Error("Error loading config: empty response");
|
|
77
|
+
return l;
|
|
78
78
|
} catch (s) {
|
|
79
|
-
if (e = s,
|
|
80
|
-
yield new Promise((
|
|
79
|
+
if (e = s, i++, i >= 3) throw x(d, s, "Error fetching config", n), e;
|
|
80
|
+
yield new Promise((l) => setTimeout(l, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}(
|
|
84
|
-
}),
|
|
85
|
-
let { config: t, apiKey:
|
|
83
|
+
}(r, "/api/searchWidgets.getConfigByKey", t);
|
|
84
|
+
}), He = (a) => {
|
|
85
|
+
let { config: t, apiKey: r, apiHost: d } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
|
-
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((
|
|
88
|
-
o[
|
|
89
|
-
}), $(L({}, t), { settings: o, apiHost:
|
|
90
|
-
}, se = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh",
|
|
87
|
+
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((n) => {
|
|
88
|
+
o[n] && (o[n] = o[n].map((e) => e.type === H.CALLBACK && e.value ? $(L({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), $(L({}, t), { settings: o, apiHost: d, widgetMode: t.widgetType, apiKey: r });
|
|
90
|
+
}, se = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", K = (() => {
|
|
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:
|
|
96
|
+
})(), ze = (a) => m(void 0, null, function* () {
|
|
97
|
+
let { apiHost: t, widgetKey: r, version: d } = a;
|
|
98
98
|
try {
|
|
99
|
-
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${
|
|
100
|
-
return { widget: yield ((
|
|
101
|
-
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((s,
|
|
102
|
-
const
|
|
103
|
-
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${d}/dist/web.js`, n = K ? o.replace("web.js", "web.umd.js") : o;
|
|
100
|
+
return { widget: yield ((i) => m(void 0, null, function* () {
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((s, l) => {
|
|
102
|
+
const u = document.createElement("script");
|
|
103
|
+
u.id = "brainfish-widget", u.src = i, u.type = K ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ? s(c) :
|
|
106
|
+
c ? s(c) : l(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
|
-
},
|
|
109
|
-
const f = c,
|
|
110
|
-
|
|
111
|
-
},
|
|
108
|
+
}, u.onerror = (c) => {
|
|
109
|
+
const f = c, g = { message: `Failed to load script: ${i}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
|
|
110
|
+
l(new Error(JSON.stringify(g)));
|
|
111
|
+
}, K || document.head.appendChild(u);
|
|
112
112
|
});
|
|
113
|
-
}))(
|
|
113
|
+
}))(n) };
|
|
114
114
|
} catch (o) {
|
|
115
|
-
x(t, o, o.message,
|
|
115
|
+
x(t, o, o.message, r);
|
|
116
116
|
}
|
|
117
|
-
}), ge = /* @__PURE__ */ new Set(),
|
|
118
|
-
const
|
|
117
|
+
}), ge = /* @__PURE__ */ new Set(), De = (a, t) => m(void 0, null, function* () {
|
|
118
|
+
const r = se(a.overrides);
|
|
119
119
|
try {
|
|
120
120
|
if (ge.has(a.widgetKey)) return;
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
121
|
+
const d = yield ze({ apiHost: r, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (d) {
|
|
123
|
+
const { widget: o } = d, n = He({ config: t, apiKey: a.widgetKey, apiHost: r });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
|
-
let [
|
|
126
|
-
t.settings &&
|
|
127
|
-
let
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
}(t.settings[
|
|
131
|
-
}), function(e,
|
|
132
|
-
|
|
133
|
-
}(o,
|
|
125
|
+
let [i, s] = e;
|
|
126
|
+
t.settings && i in t.settings && (t.settings[i] = function() {
|
|
127
|
+
let l = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
|
+
const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
|
+
return l.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
|
+
}(t.settings[i], s));
|
|
131
|
+
}), function(e, i) {
|
|
132
|
+
i.widgetType === k.Searchbar || i.widgetType === "Search" ? e.SearchWidget.initStandard(i) : e.HelpWidget.initPopup(i);
|
|
133
|
+
}(o, n), ge.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
x(
|
|
135
|
+
} catch (d) {
|
|
136
|
+
x(r, d, d.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
let he = !1;
|
|
140
|
-
const
|
|
141
|
-
return m(this, arguments, function* (a, t,
|
|
142
|
-
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "",
|
|
143
|
-
if (t || x(
|
|
140
|
+
const Ne = function(d, o, n) {
|
|
141
|
+
return m(this, arguments, function* (a, t, r) {
|
|
142
|
+
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", i = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
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 u = navigator,
|
|
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 &&
|
|
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(u, new Error(`Failed to load script: ${
|
|
154
|
-
}, document.head.appendChild(
|
|
155
|
-
}))(
|
|
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);
|
|
164
|
+
}))(r, a);
|
|
156
165
|
} catch (s) {
|
|
157
|
-
x(
|
|
166
|
+
x(r, s, "Failed to initialize BrainfishAnalytics", a);
|
|
158
167
|
}
|
|
159
168
|
});
|
|
160
169
|
};
|
|
161
|
-
function
|
|
162
|
-
let
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
let [
|
|
166
|
-
|
|
167
|
-
}),
|
|
170
|
+
function B(a, t) {
|
|
171
|
+
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
172
|
+
const d = document.createElement(a);
|
|
173
|
+
return d.className = t, Object.entries(r).forEach((o) => {
|
|
174
|
+
let [n, e] = o;
|
|
175
|
+
d.setAttribute(n, e);
|
|
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;
|
|
173
182
|
}
|
|
174
|
-
static initialize(t,
|
|
175
|
-
this.button = t, this.icon =
|
|
183
|
+
static initialize(t, r) {
|
|
184
|
+
this.button = t, this.icon = r, t.addEventListener("click", () => this.toggleIframeVisibility());
|
|
176
185
|
}
|
|
177
186
|
static toggleIframeVisibility() {
|
|
178
187
|
if (!this.button || !this.icon) return;
|
|
179
188
|
this.isOpen = !this.isOpen;
|
|
180
|
-
const t = this.icon.querySelector(".fish-icon"),
|
|
181
|
-
var
|
|
182
|
-
this.isOpen ? (
|
|
189
|
+
const t = this.icon.querySelector(".fish-icon"), r = this.icon.querySelector(".close-icon"), d = document.querySelector(".bf-iframe-container"), o = d == null ? void 0 : d.querySelector("iframe");
|
|
190
|
+
var n;
|
|
191
|
+
this.isOpen ? (d == null || d.classList.add("open"), d == null || d.setAttribute("aria-hidden", "false"), this.button.setAttribute("aria-expanded", "true"), t.classList.remove("visible"), r.classList.add("visible"), o == null || (n = o.contentWindow) === null || n === void 0 || n.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= 576 && this.hideTriggerButton()) : (d == null || d.classList.remove("open"), d == null || d.setAttribute("aria-hidden", "true"), this.button.setAttribute("aria-expanded", "false"), r.classList.remove("visible"), t.classList.add("visible"), this.showTriggerButton(), window.BrainfishAnalytics("track", "Close Widget"));
|
|
183
192
|
}
|
|
184
193
|
static showTriggerButton() {
|
|
185
194
|
var t;
|
|
@@ -190,99 +199,110 @@ 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) {
|
|
204
|
+
let { widgetHost: t, apiHost: r, widgetKey: d, signal: o } = a;
|
|
195
205
|
window.addEventListener("message", (n) => {
|
|
196
|
-
if (n.origin !==
|
|
197
|
-
const { type:
|
|
198
|
-
if (
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
}(),
|
|
206
|
+
if (n.origin !== t) return;
|
|
207
|
+
const { type: e } = n.data;
|
|
208
|
+
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
209
|
+
const i = document.querySelector(`.${T}`);
|
|
210
|
+
i.classList.contains("expanded") ? i.classList.remove("expanded") : i.classList.add("expanded");
|
|
211
|
+
}(), e === "TRACK_EVENT") {
|
|
202
212
|
if (!window.BrainfishAnalytics) return;
|
|
203
|
-
const { eventName:
|
|
204
|
-
window.BrainfishAnalytics("track",
|
|
213
|
+
const { eventName: i, data: s } = n.data;
|
|
214
|
+
window.BrainfishAnalytics("track", i, s);
|
|
215
|
+
}
|
|
216
|
+
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
|
|
217
|
+
const { action: i, searchQueryId: s, query: l, answer: u } = n.data, c = { action: i, searchQueryId: s };
|
|
218
|
+
if (!["function", "callback"].includes(i.type)) return void console.error("Invalid action type", i);
|
|
219
|
+
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[i.id]) return void window.__bfCallbacks[i.id](l, u, c);
|
|
220
|
+
const f = `${r}/api/searchWidgets.callback.codeblocks?apiKey=${d}&codeblockId=${i.id}`, g = document.createElement("script");
|
|
221
|
+
g.src = f, document.head.appendChild(g), g.onload = () => {
|
|
222
|
+
window.__bfCallbacks[i.id](l, u, c), setTimeout(() => {
|
|
223
|
+
document.head.removeChild(g);
|
|
224
|
+
}, 300);
|
|
225
|
+
};
|
|
205
226
|
}
|
|
206
|
-
|
|
207
|
-
}, { signal: t });
|
|
227
|
+
}, { signal: o });
|
|
208
228
|
}
|
|
209
|
-
function
|
|
229
|
+
function de(a) {
|
|
210
230
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
211
231
|
}
|
|
212
|
-
var
|
|
232
|
+
var z = { exports: {} }, D = { exports: {} }, N = { exports: {} };
|
|
213
233
|
(function(a, t) {
|
|
214
|
-
function
|
|
234
|
+
function r(o) {
|
|
215
235
|
return Math.round(255 * o);
|
|
216
236
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
237
|
+
function d(o, n, e) {
|
|
238
|
+
return r(o) + "," + r(n) + "," + r(e);
|
|
219
239
|
}
|
|
220
|
-
t.__esModule = !0, t.default = void 0, t.default = function(o,
|
|
221
|
-
if (
|
|
222
|
-
var s = (o % 360 + 360) % 360 / 60,
|
|
223
|
-
s >= 0 && s < 1 ? (c =
|
|
224
|
-
var
|
|
225
|
-
return
|
|
240
|
+
t.__esModule = !0, t.default = void 0, t.default = function(o, n, e, i) {
|
|
241
|
+
if (i === void 0 && (i = d), n === 0) return i(e, e, e);
|
|
242
|
+
var s = (o % 360 + 360) % 360 / 60, l = (1 - Math.abs(2 * e - 1)) * n, u = l * (1 - Math.abs(s % 2 - 1)), c = 0, f = 0, g = 0;
|
|
243
|
+
s >= 0 && s < 1 ? (c = l, f = u) : s >= 1 && s < 2 ? (c = u, f = l) : s >= 2 && s < 3 ? (f = l, g = u) : s >= 3 && s < 4 ? (f = u, g = l) : s >= 4 && s < 5 ? (c = u, g = l) : s >= 5 && s < 6 && (c = l, g = u);
|
|
244
|
+
var h = e - l / 2;
|
|
245
|
+
return i(c + h, f + h, g + h);
|
|
226
246
|
}, a.exports = t.default;
|
|
227
|
-
})(
|
|
228
|
-
var le =
|
|
247
|
+
})(N, N.exports);
|
|
248
|
+
var le = N.exports, q = { exports: {} };
|
|
229
249
|
(function(a, t) {
|
|
230
250
|
t.__esModule = !0, t.default = void 0;
|
|
231
|
-
var
|
|
232
|
-
t.default = function(
|
|
233
|
-
if (typeof
|
|
234
|
-
var o =
|
|
235
|
-
return
|
|
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" };
|
|
252
|
+
t.default = function(d) {
|
|
253
|
+
if (typeof d != "string") return d;
|
|
254
|
+
var o = d.toLowerCase();
|
|
255
|
+
return r[o] ? "#" + r[o] : d;
|
|
236
256
|
}, a.exports = t.default;
|
|
237
|
-
})(
|
|
238
|
-
var Re =
|
|
257
|
+
})(q, q.exports);
|
|
258
|
+
var Re = q.exports, R = { exports: {} };
|
|
239
259
|
(function(a, t) {
|
|
240
|
-
function
|
|
241
|
-
var
|
|
242
|
-
return
|
|
243
|
-
if (
|
|
260
|
+
function r(s) {
|
|
261
|
+
var l = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
262
|
+
return r = function(u) {
|
|
263
|
+
if (u === null || !function(f) {
|
|
244
264
|
try {
|
|
245
265
|
return Function.toString.call(f).indexOf("[native code]") !== -1;
|
|
246
|
-
} catch (
|
|
266
|
+
} catch (g) {
|
|
247
267
|
return typeof f == "function";
|
|
248
268
|
}
|
|
249
|
-
}(
|
|
250
|
-
if (typeof
|
|
251
|
-
if (
|
|
252
|
-
if (
|
|
253
|
-
|
|
269
|
+
}(u)) return u;
|
|
270
|
+
if (typeof u != "function") throw new TypeError("Super expression must either be null or a function");
|
|
271
|
+
if (l !== void 0) {
|
|
272
|
+
if (l.has(u)) return l.get(u);
|
|
273
|
+
l.set(u, c);
|
|
254
274
|
}
|
|
255
275
|
function c() {
|
|
256
|
-
return function(f,
|
|
257
|
-
if (
|
|
276
|
+
return function(f, g, h) {
|
|
277
|
+
if (d()) return Reflect.construct.apply(null, arguments);
|
|
258
278
|
var p = [null];
|
|
259
|
-
p.push.apply(p,
|
|
279
|
+
p.push.apply(p, g);
|
|
260
280
|
var b = new (f.bind.apply(f, p))();
|
|
261
|
-
return
|
|
262
|
-
}(
|
|
281
|
+
return h && o(b, h.prototype), b;
|
|
282
|
+
}(u, arguments, n(this).constructor);
|
|
263
283
|
}
|
|
264
|
-
return c.prototype = Object.create(
|
|
265
|
-
},
|
|
284
|
+
return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, u);
|
|
285
|
+
}, r(s);
|
|
266
286
|
}
|
|
267
|
-
function
|
|
287
|
+
function d() {
|
|
268
288
|
try {
|
|
269
289
|
var s = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
270
290
|
}));
|
|
271
|
-
} catch (
|
|
291
|
+
} catch (l) {
|
|
272
292
|
}
|
|
273
|
-
return (
|
|
293
|
+
return (d = function() {
|
|
274
294
|
return !!s;
|
|
275
295
|
})();
|
|
276
296
|
}
|
|
277
|
-
function o(s,
|
|
278
|
-
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(
|
|
279
|
-
return
|
|
280
|
-
}, o(s,
|
|
297
|
+
function o(s, l) {
|
|
298
|
+
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
|
|
299
|
+
return u.__proto__ = c, u;
|
|
300
|
+
}, o(s, l);
|
|
281
301
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
284
|
-
return
|
|
285
|
-
},
|
|
302
|
+
function n(s) {
|
|
303
|
+
return n = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(l) {
|
|
304
|
+
return l.__proto__ || Object.getPrototypeOf(l);
|
|
305
|
+
}, n(s);
|
|
286
306
|
}
|
|
287
307
|
t.__esModule = !0, t.default = void 0;
|
|
288
308
|
var e = { 1: `Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
|
@@ -434,213 +454,213 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
434
454
|
|
|
435
455
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
436
456
|
` };
|
|
437
|
-
function
|
|
438
|
-
for (var s = arguments.length,
|
|
439
|
-
var c, f =
|
|
440
|
-
for (c = 1; c <
|
|
441
|
-
return
|
|
442
|
-
f = f.replace(/%[a-z]/,
|
|
457
|
+
function i() {
|
|
458
|
+
for (var s = arguments.length, l = new Array(s), u = 0; u < s; u++) l[u] = arguments[u];
|
|
459
|
+
var c, f = l[0], g = [];
|
|
460
|
+
for (c = 1; c < l.length; c += 1) g.push(l[c]);
|
|
461
|
+
return g.forEach(function(h) {
|
|
462
|
+
f = f.replace(/%[a-z]/, h);
|
|
443
463
|
}), f;
|
|
444
464
|
}
|
|
445
465
|
t.default = function(s) {
|
|
446
|
-
var
|
|
466
|
+
var l, u;
|
|
447
467
|
function c(f) {
|
|
448
|
-
var
|
|
449
|
-
if (process.env.NODE_ENV === "production")
|
|
468
|
+
var g;
|
|
469
|
+
if (process.env.NODE_ENV === "production") g = s.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
|
|
450
470
|
else {
|
|
451
|
-
for (var
|
|
452
|
-
|
|
471
|
+
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), b = 1; b < h; b++) p[b - 1] = arguments[b];
|
|
472
|
+
g = s.call(this, i.apply(void 0, [e[f]].concat(p))) || this;
|
|
453
473
|
}
|
|
454
474
|
return function(C) {
|
|
455
475
|
if (C === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
456
476
|
return C;
|
|
457
|
-
}(
|
|
477
|
+
}(g);
|
|
458
478
|
}
|
|
459
|
-
return
|
|
460
|
-
}(
|
|
479
|
+
return u = s, (l = c).prototype = Object.create(u.prototype), l.prototype.constructor = l, o(l, u), c;
|
|
480
|
+
}(r(Error)), a.exports = t.default;
|
|
461
481
|
})(R, R.exports);
|
|
462
482
|
var S = R.exports;
|
|
463
483
|
(function(a, t) {
|
|
464
|
-
t.__esModule = !0, t.default = function(
|
|
465
|
-
if (typeof
|
|
466
|
-
var p = (0,
|
|
484
|
+
t.__esModule = !0, t.default = function(h) {
|
|
485
|
+
if (typeof h != "string") throw new o.default(3);
|
|
486
|
+
var p = (0, d.default)(h);
|
|
467
487
|
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) };
|
|
468
|
-
if (p.match(
|
|
488
|
+
if (p.match(i)) {
|
|
469
489
|
var b = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
470
490
|
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: b };
|
|
471
491
|
}
|
|
472
492
|
if (p.match(s)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
|
|
473
|
-
if (p.match(
|
|
493
|
+
if (p.match(l)) {
|
|
474
494
|
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
475
495
|
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
476
496
|
}
|
|
477
|
-
var E =
|
|
497
|
+
var E = u.exec(p);
|
|
478
498
|
if (E) return { red: parseInt("" + E[1], 10), green: parseInt("" + E[2], 10), blue: parseInt("" + E[3], 10) };
|
|
479
499
|
var y = c.exec(p.substring(0, 50));
|
|
480
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]) };
|
|
481
501
|
var A = f.exec(p);
|
|
482
502
|
if (A) {
|
|
483
|
-
var Ie = parseInt("" + A[1], 10), Oe = parseInt("" + A[2], 10) / 100,
|
|
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);
|
|
484
504
|
if (!I) throw new o.default(4, p, fe);
|
|
485
505
|
return { red: parseInt("" + I[1], 10), green: parseInt("" + I[2], 10), blue: parseInt("" + I[3], 10) };
|
|
486
506
|
}
|
|
487
|
-
var w =
|
|
507
|
+
var w = g.exec(p.substring(0, 50));
|
|
488
508
|
if (w) {
|
|
489
|
-
var
|
|
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);
|
|
490
510
|
if (!O) throw new o.default(4, p, ce);
|
|
491
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]) };
|
|
492
512
|
}
|
|
493
513
|
throw new o.default(5);
|
|
494
514
|
};
|
|
495
|
-
var
|
|
496
|
-
function
|
|
497
|
-
return
|
|
515
|
+
var r = n(le), d = n(Re), o = n(S);
|
|
516
|
+
function n(h) {
|
|
517
|
+
return h && h.__esModule ? h : { default: h };
|
|
498
518
|
}
|
|
499
|
-
var e = /^#[a-fA-F0-9]{6}$/,
|
|
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;
|
|
500
520
|
a.exports = t.default;
|
|
501
|
-
})(
|
|
502
|
-
var
|
|
521
|
+
})(D, D.exports);
|
|
522
|
+
var ue = D.exports;
|
|
503
523
|
(function(a, t) {
|
|
504
524
|
t.__esModule = !0, t.default = function(o) {
|
|
505
525
|
if (o === "transparent") return 0;
|
|
506
|
-
var
|
|
507
|
-
var c =
|
|
526
|
+
var n = (0, d.default)(o), e = Object.keys(n).map(function(u) {
|
|
527
|
+
var c = n[u] / 255;
|
|
508
528
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
509
|
-
}),
|
|
510
|
-
return parseFloat((0.2126 *
|
|
529
|
+
}), i = e[0], s = e[1], l = e[2];
|
|
530
|
+
return parseFloat((0.2126 * i + 0.7152 * s + 0.0722 * l).toFixed(3));
|
|
511
531
|
};
|
|
512
|
-
var
|
|
532
|
+
var r, d = (r = ue) && r.__esModule ? r : { default: r };
|
|
513
533
|
a.exports = t.default;
|
|
514
|
-
})(
|
|
515
|
-
const Ye =
|
|
534
|
+
})(z, z.exports);
|
|
535
|
+
const Ye = de(z.exports);
|
|
516
536
|
var Y = { exports: {} }, J = { exports: {} };
|
|
517
537
|
(function(a, t) {
|
|
518
|
-
function
|
|
538
|
+
function r(d, o, n) {
|
|
519
539
|
return function() {
|
|
520
|
-
var e =
|
|
521
|
-
return e.length >= o ?
|
|
540
|
+
var e = n.concat(Array.prototype.slice.call(arguments));
|
|
541
|
+
return e.length >= o ? d.apply(this, e) : r(d, o, e);
|
|
522
542
|
};
|
|
523
543
|
}
|
|
524
|
-
t.__esModule = !0, t.default = function(
|
|
525
|
-
return
|
|
544
|
+
t.__esModule = !0, t.default = function(d) {
|
|
545
|
+
return r(d, d.length, []);
|
|
526
546
|
}, a.exports = t.default;
|
|
527
547
|
})(J, J.exports);
|
|
528
|
-
var me,
|
|
529
|
-
me = U, (
|
|
530
|
-
return Math.max(a, Math.min(t,
|
|
531
|
-
}, me.exports =
|
|
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) {
|
|
550
|
+
return Math.max(a, Math.min(t, r));
|
|
551
|
+
}, me.exports = M.default;
|
|
532
552
|
var xe = U.exports, G = { exports: {} }, V = { exports: {} };
|
|
533
553
|
(function(a, t) {
|
|
534
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
535
|
-
var
|
|
536
|
-
if (
|
|
537
|
-
var
|
|
538
|
-
switch (
|
|
554
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
555
|
+
var d, o = r.red / 255, n = r.green / 255, e = r.blue / 255, i = Math.max(o, n, e), s = Math.min(o, n, e), l = (i + s) / 2;
|
|
556
|
+
if (i === s) return r.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: l, alpha: r.alpha } : { hue: 0, saturation: 0, lightness: l };
|
|
557
|
+
var u = i - s, c = l > 0.5 ? u / (2 - i - s) : u / (i + s);
|
|
558
|
+
switch (i) {
|
|
539
559
|
case o:
|
|
540
|
-
|
|
560
|
+
d = (n - e) / u + (n < e ? 6 : 0);
|
|
541
561
|
break;
|
|
542
|
-
case
|
|
543
|
-
|
|
562
|
+
case n:
|
|
563
|
+
d = (e - o) / u + 2;
|
|
544
564
|
break;
|
|
545
565
|
default:
|
|
546
|
-
|
|
566
|
+
d = (o - n) / u + 4;
|
|
547
567
|
}
|
|
548
|
-
return
|
|
568
|
+
return d *= 60, r.alpha !== void 0 ? { hue: d, saturation: c, lightness: l, alpha: r.alpha } : { hue: d, saturation: c, lightness: l };
|
|
549
569
|
}, a.exports = t.default;
|
|
550
570
|
})(V, V.exports);
|
|
551
571
|
var Je = V.exports;
|
|
552
572
|
(function(a, t) {
|
|
553
|
-
t.__esModule = !0, t.default = function(
|
|
554
|
-
return (0,
|
|
573
|
+
t.__esModule = !0, t.default = function(n) {
|
|
574
|
+
return (0, d.default)((0, r.default)(n));
|
|
555
575
|
};
|
|
556
|
-
var
|
|
557
|
-
function o(
|
|
558
|
-
return
|
|
576
|
+
var r = o(ue), d = o(Je);
|
|
577
|
+
function o(n) {
|
|
578
|
+
return n && n.__esModule ? n : { default: n };
|
|
559
579
|
}
|
|
560
580
|
a.exports = t.default;
|
|
561
581
|
})(G, G.exports);
|
|
562
582
|
var Se = G.exports, Z = { exports: {} }, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} };
|
|
563
583
|
(function(a, t) {
|
|
564
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
565
|
-
return
|
|
584
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
585
|
+
return r.length === 7 && r[1] === r[2] && r[3] === r[4] && r[5] === r[6] ? "#" + r[1] + r[3] + r[5] : r;
|
|
566
586
|
}, a.exports = t.default;
|
|
567
587
|
})(ee, ee.exports);
|
|
568
|
-
var
|
|
588
|
+
var _e = ee.exports, te = { exports: {} };
|
|
569
589
|
(function(a, t) {
|
|
570
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
571
|
-
var
|
|
572
|
-
return
|
|
590
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
591
|
+
var d = r.toString(16);
|
|
592
|
+
return d.length === 1 ? "0" + d : d;
|
|
573
593
|
}, a.exports = t.default;
|
|
574
594
|
})(te, te.exports);
|
|
575
|
-
var
|
|
595
|
+
var ke = te.exports;
|
|
576
596
|
(function(a, t) {
|
|
577
597
|
t.__esModule = !0, t.default = void 0;
|
|
578
|
-
var
|
|
579
|
-
function
|
|
598
|
+
var r = n(le), d = n(_e), o = n(ke);
|
|
599
|
+
function n(s) {
|
|
580
600
|
return s && s.__esModule ? s : { default: s };
|
|
581
601
|
}
|
|
582
602
|
function e(s) {
|
|
583
603
|
return (0, o.default)(Math.round(255 * s));
|
|
584
604
|
}
|
|
585
|
-
function
|
|
586
|
-
return (0,
|
|
605
|
+
function i(s, l, u) {
|
|
606
|
+
return (0, d.default)("#" + e(s) + e(l) + e(u));
|
|
587
607
|
}
|
|
588
|
-
t.default = function(s,
|
|
589
|
-
return (0,
|
|
608
|
+
t.default = function(s, l, u) {
|
|
609
|
+
return (0, r.default)(s, l, u, i);
|
|
590
610
|
}, a.exports = t.default;
|
|
591
611
|
})(X, X.exports);
|
|
592
612
|
var Ce = X.exports;
|
|
593
613
|
(function(a, t) {
|
|
594
|
-
t.__esModule = !0, t.default = function(
|
|
595
|
-
if (typeof
|
|
596
|
-
if (typeof
|
|
597
|
-
throw new
|
|
614
|
+
t.__esModule = !0, t.default = function(n, e, i) {
|
|
615
|
+
if (typeof n == "number" && typeof e == "number" && typeof i == "number") return (0, r.default)(n, e, i);
|
|
616
|
+
if (typeof n == "object" && e === void 0 && i === void 0) return (0, r.default)(n.hue, n.saturation, n.lightness);
|
|
617
|
+
throw new d.default(1);
|
|
598
618
|
};
|
|
599
|
-
var
|
|
600
|
-
function o(
|
|
601
|
-
return
|
|
619
|
+
var r = o(Ce), d = o(S);
|
|
620
|
+
function o(n) {
|
|
621
|
+
return n && n.__esModule ? n : { default: n };
|
|
602
622
|
}
|
|
603
623
|
a.exports = t.default;
|
|
604
624
|
})(Q, Q.exports);
|
|
605
625
|
var Ue = Q.exports, ne = { exports: {} };
|
|
606
626
|
(function(a, t) {
|
|
607
|
-
t.__esModule = !0, t.default = function(e,
|
|
608
|
-
if (typeof e == "number" && typeof
|
|
609
|
-
if (typeof e == "object" &&
|
|
627
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
628
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, r.default)(e, i, s) : "rgba(" + (0, d.default)(e, i, s) + "," + l + ")";
|
|
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 + ")";
|
|
610
630
|
throw new o.default(2);
|
|
611
631
|
};
|
|
612
|
-
var
|
|
613
|
-
function
|
|
632
|
+
var r = n(Ce), d = n(le), o = n(S);
|
|
633
|
+
function n(e) {
|
|
614
634
|
return e && e.__esModule ? e : { default: e };
|
|
615
635
|
}
|
|
616
636
|
a.exports = t.default;
|
|
617
637
|
})(ne, ne.exports);
|
|
618
638
|
var Ge = ne.exports, re = { exports: {} };
|
|
619
639
|
(function(a, t) {
|
|
620
|
-
t.__esModule = !0, t.default = function(e,
|
|
621
|
-
if (typeof e == "number" && typeof
|
|
622
|
-
if (typeof e == "object" &&
|
|
640
|
+
t.__esModule = !0, t.default = function(e, i, s) {
|
|
641
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number") return (0, r.default)("#" + (0, d.default)(e) + (0, d.default)(i) + (0, d.default)(s));
|
|
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));
|
|
623
643
|
throw new o.default(6);
|
|
624
644
|
};
|
|
625
|
-
var
|
|
626
|
-
function
|
|
645
|
+
var r = n(_e), d = n(ke), o = n(S);
|
|
646
|
+
function n(e) {
|
|
627
647
|
return e && e.__esModule ? e : { default: e };
|
|
628
648
|
}
|
|
629
649
|
a.exports = t.default;
|
|
630
650
|
})(re, re.exports);
|
|
631
651
|
var Ee = re.exports, ae = { exports: {} };
|
|
632
652
|
(function(a, t) {
|
|
633
|
-
t.__esModule = !0, t.default = function(e,
|
|
634
|
-
if (typeof e == "string" && typeof
|
|
635
|
-
var
|
|
636
|
-
return "rgba(" +
|
|
653
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
654
|
+
if (typeof e == "string" && typeof i == "number") {
|
|
655
|
+
var u = (0, r.default)(e);
|
|
656
|
+
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + i + ")";
|
|
637
657
|
}
|
|
638
|
-
if (typeof e == "number" && typeof
|
|
639
|
-
if (typeof e == "object" &&
|
|
658
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, d.default)(e, i, s) : "rgba(" + e + "," + i + "," + s + "," + l + ")";
|
|
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 + ")";
|
|
640
660
|
throw new o.default(7);
|
|
641
661
|
};
|
|
642
|
-
var
|
|
643
|
-
function
|
|
662
|
+
var r = n(ue), d = n(Ee), o = n(S);
|
|
663
|
+
function n(e) {
|
|
644
664
|
return e && e.__esModule ? e : { default: e };
|
|
645
665
|
}
|
|
646
666
|
a.exports = t.default;
|
|
@@ -649,21 +669,21 @@ var Ve = ae.exports;
|
|
|
649
669
|
(function(a, t) {
|
|
650
670
|
t.__esModule = !0, t.default = function(f) {
|
|
651
671
|
if (typeof f != "object") throw new e.default(8);
|
|
652
|
-
if (
|
|
672
|
+
if (l(f)) return (0, n.default)(f);
|
|
653
673
|
if (s(f)) return (0, o.default)(f);
|
|
654
|
-
if (c(f)) return (0,
|
|
655
|
-
if (
|
|
674
|
+
if (c(f)) return (0, d.default)(f);
|
|
675
|
+
if (u(f)) return (0, r.default)(f);
|
|
656
676
|
throw new e.default(8);
|
|
657
677
|
};
|
|
658
|
-
var
|
|
659
|
-
function
|
|
678
|
+
var r = i(Ue), d = i(Ge), o = i(Ee), n = i(Ve), e = i(S);
|
|
679
|
+
function i(f) {
|
|
660
680
|
return f && f.__esModule ? f : { default: f };
|
|
661
681
|
}
|
|
662
682
|
var s = function(f) {
|
|
663
683
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
664
|
-
},
|
|
684
|
+
}, l = function(f) {
|
|
665
685
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
666
|
-
},
|
|
686
|
+
}, u = function(f) {
|
|
667
687
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
668
688
|
}, c = function(f) {
|
|
669
689
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
|
|
@@ -673,111 +693,111 @@ var Ve = ae.exports;
|
|
|
673
693
|
var Ae = Z.exports;
|
|
674
694
|
(function(a, t) {
|
|
675
695
|
t.__esModule = !0, t.default = void 0;
|
|
676
|
-
var
|
|
677
|
-
function e(
|
|
678
|
-
return
|
|
679
|
-
}
|
|
680
|
-
function
|
|
681
|
-
return
|
|
682
|
-
for (var
|
|
683
|
-
var c = arguments[
|
|
684
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
696
|
+
var r = e(we), d = e(xe), o = e(Se), n = e(Ae);
|
|
697
|
+
function e(l) {
|
|
698
|
+
return l && l.__esModule ? l : { default: l };
|
|
699
|
+
}
|
|
700
|
+
function i() {
|
|
701
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
702
|
+
for (var u = 1; u < arguments.length; u++) {
|
|
703
|
+
var c = arguments[u];
|
|
704
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
685
705
|
}
|
|
686
|
-
return
|
|
687
|
-
},
|
|
706
|
+
return l;
|
|
707
|
+
}, i.apply(this, arguments);
|
|
688
708
|
}
|
|
689
|
-
var s = (0,
|
|
690
|
-
if (
|
|
691
|
-
var c = (0, o.default)(
|
|
692
|
-
return (0,
|
|
709
|
+
var s = (0, r.default)(function(l, u) {
|
|
710
|
+
if (u === "transparent") return u;
|
|
711
|
+
var c = (0, o.default)(u);
|
|
712
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness - parseFloat(l)) }));
|
|
693
713
|
});
|
|
694
714
|
t.default = s, a.exports = t.default;
|
|
695
715
|
})(Y, Y.exports);
|
|
696
|
-
const Ze =
|
|
716
|
+
const Ze = de(Y.exports);
|
|
697
717
|
var oe = { exports: {} };
|
|
698
718
|
(function(a, t) {
|
|
699
719
|
t.__esModule = !0, t.default = void 0;
|
|
700
|
-
var
|
|
701
|
-
function e(
|
|
702
|
-
return
|
|
703
|
-
}
|
|
704
|
-
function
|
|
705
|
-
return
|
|
706
|
-
for (var
|
|
707
|
-
var c = arguments[
|
|
708
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
720
|
+
var r = e(we), d = e(xe), o = e(Se), n = e(Ae);
|
|
721
|
+
function e(l) {
|
|
722
|
+
return l && l.__esModule ? l : { default: l };
|
|
723
|
+
}
|
|
724
|
+
function i() {
|
|
725
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
726
|
+
for (var u = 1; u < arguments.length; u++) {
|
|
727
|
+
var c = arguments[u];
|
|
728
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
709
729
|
}
|
|
710
|
-
return
|
|
711
|
-
},
|
|
730
|
+
return l;
|
|
731
|
+
}, i.apply(this, arguments);
|
|
712
732
|
}
|
|
713
|
-
var s = (0,
|
|
714
|
-
if (
|
|
715
|
-
var c = (0, o.default)(
|
|
716
|
-
return (0,
|
|
733
|
+
var s = (0, r.default)(function(l, u) {
|
|
734
|
+
if (u === "transparent") return u;
|
|
735
|
+
var c = (0, o.default)(u);
|
|
736
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness + parseFloat(l)) }));
|
|
717
737
|
});
|
|
718
738
|
t.default = s, a.exports = t.default;
|
|
719
739
|
})(oe, oe.exports);
|
|
720
|
-
const Qe =
|
|
740
|
+
const Qe = de(oe.exports);
|
|
721
741
|
function Xe(a) {
|
|
722
742
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
723
|
-
var t,
|
|
743
|
+
var t, r;
|
|
724
744
|
(function() {
|
|
725
|
-
let
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
const e = Ye(
|
|
729
|
-
|
|
745
|
+
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
746
|
+
const n = document.createElement("style");
|
|
747
|
+
n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
748
|
+
const e = Ye(d) > 0.5;
|
|
749
|
+
n.textContent = `
|
|
730
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))}}
|
|
731
|
-
.${
|
|
732
|
-
.${
|
|
733
|
-
background: ${e ? Ze(0.05,
|
|
751
|
+
.${j} { background: ${d}; }
|
|
752
|
+
.${j}:hover {
|
|
753
|
+
background: ${e ? Ze(0.05, d) : Qe(0.05, d)};
|
|
734
754
|
}
|
|
735
755
|
.trigger-button-icon { color: ${o}; }
|
|
736
|
-
`, document.head.appendChild(
|
|
737
|
-
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (
|
|
756
|
+
`, document.head.appendChild(n);
|
|
757
|
+
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (r = a.theme) === null || r === void 0 ? void 0 : r.textBaseColor) || "#ffffff");
|
|
738
758
|
}
|
|
739
759
|
}
|
|
740
760
|
function et(a, t) {
|
|
741
|
-
const
|
|
742
|
-
((
|
|
761
|
+
const r = () => {
|
|
762
|
+
((d) => {
|
|
743
763
|
var o;
|
|
744
|
-
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode:
|
|
764
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: d }, "*");
|
|
745
765
|
})(document.body.classList.contains("dark"));
|
|
746
766
|
};
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
|
|
767
|
+
r(), (() => {
|
|
768
|
+
const d = new MutationObserver(r);
|
|
769
|
+
d.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => d.disconnect());
|
|
750
770
|
})();
|
|
751
771
|
}
|
|
752
772
|
function tt(a, t) {
|
|
753
|
-
let
|
|
754
|
-
const
|
|
755
|
-
((
|
|
773
|
+
let r;
|
|
774
|
+
const d = () => {
|
|
775
|
+
((n) => {
|
|
756
776
|
var e;
|
|
757
|
-
const
|
|
758
|
-
(e = a.contentWindow) === null || e === void 0 || e.postMessage(
|
|
777
|
+
const i = { type: "UPDATE_BODY_CLASS", isMobile: n };
|
|
778
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(i, "*"), n && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
|
|
759
779
|
})(document.body.clientWidth <= 576);
|
|
760
780
|
}, o = () => {
|
|
761
|
-
|
|
781
|
+
r && clearTimeout(r), r = window.setTimeout(d, 300);
|
|
762
782
|
};
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
|
|
783
|
+
d(), (() => {
|
|
784
|
+
const n = new ResizeObserver(o);
|
|
785
|
+
n.observe(document.body), t.addEventListener("abort", () => n.disconnect());
|
|
766
786
|
})();
|
|
767
787
|
}
|
|
768
788
|
function be(a) {
|
|
769
789
|
const t = new TextEncoder().encode(a);
|
|
770
790
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
771
|
-
const
|
|
772
|
-
return btoa(
|
|
791
|
+
const r = Array.from(t, (d) => String.fromCharCode(d)).join("");
|
|
792
|
+
return btoa(r);
|
|
773
793
|
}
|
|
774
794
|
if (typeof Buffer != "undefined") return Buffer.from(t).toString("base64");
|
|
775
795
|
throw new Error("[utils.base64Encode]: Unsupported environment");
|
|
776
796
|
}
|
|
777
797
|
const ve = /* @__PURE__ */ new Set();
|
|
778
798
|
function nt(a, t) {
|
|
779
|
-
const
|
|
780
|
-
const
|
|
799
|
+
const r = document.createDocumentFragment(), d = function(e) {
|
|
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" });
|
|
781
801
|
return s.innerHTML = `
|
|
782
802
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
783
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>
|
|
@@ -785,107 +805,107 @@ function nt(a, t) {
|
|
|
785
805
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
786
806
|
<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"/>
|
|
787
807
|
</svg>
|
|
788
|
-
`,
|
|
789
|
-
}(a), { iframeContainer: o, iframe:
|
|
790
|
-
const
|
|
791
|
-
return
|
|
808
|
+
`, i.setAttribute("aria-label", "Open Brainfish widget"), i.appendChild(s), v.initialize(i, s), i;
|
|
809
|
+
}(a), { iframeContainer: o, iframe: n } = function(e) {
|
|
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" });
|
|
811
|
+
return i.appendChild(s), { iframeContainer: i, iframe: s };
|
|
792
812
|
}(t);
|
|
793
|
-
return
|
|
813
|
+
return r.appendChild(d), r.appendChild(o), { fragment: r, iframe: n };
|
|
794
814
|
}
|
|
795
815
|
const rt = (a, t) => {
|
|
796
|
-
const
|
|
816
|
+
const r = se(a.overrides), d = ((o = a.overrides) == null ? void 0 : o.widgetHost) || "https://agent.brainfi.sh";
|
|
797
817
|
var o;
|
|
798
|
-
const { theme:
|
|
818
|
+
const { theme: n, settings: e } = t, i = `${d}/?widgetKey=${a.widgetKey}&themeParam=${be(JSON.stringify(n))}&settingsParam=${be(JSON.stringify(e))}`;
|
|
799
819
|
try {
|
|
800
|
-
if (s = a.widgetKey, ve.has(s) || function(
|
|
801
|
-
return !!document.getElementById(`trigger-button-${
|
|
820
|
+
if (s = a.widgetKey, ve.has(s) || function(h) {
|
|
821
|
+
return !!document.getElementById(`trigger-button-${h}`);
|
|
802
822
|
}(a.widgetKey)) return;
|
|
803
823
|
Xe(t);
|
|
804
|
-
const { fragment:
|
|
805
|
-
|
|
824
|
+
const { fragment: l, iframe: u } = nt(a.widgetKey, i), c = new AbortController(), { signal: f } = c;
|
|
825
|
+
u.onload = () => {
|
|
806
826
|
setTimeout(() => {
|
|
807
|
-
et(
|
|
827
|
+
et(u, f), qe({ widgetHost: d, apiHost: r, widgetKey: a.widgetKey, signal: f }), tt(u, f);
|
|
808
828
|
}, 0);
|
|
809
|
-
}, document.body.appendChild(
|
|
810
|
-
const
|
|
811
|
-
c.abort(), window.removeEventListener("beforeunload",
|
|
829
|
+
}, document.body.appendChild(l), ve.add(a.widgetKey);
|
|
830
|
+
const g = () => {
|
|
831
|
+
c.abort(), window.removeEventListener("beforeunload", g);
|
|
812
832
|
};
|
|
813
|
-
return void window.addEventListener("beforeunload",
|
|
814
|
-
} catch (
|
|
815
|
-
(function(
|
|
816
|
-
x(
|
|
817
|
-
})(
|
|
833
|
+
return void window.addEventListener("beforeunload", g);
|
|
834
|
+
} catch (l) {
|
|
835
|
+
(function(u, c, f) {
|
|
836
|
+
x(u, c, c.message, f);
|
|
837
|
+
})(r, l, a.widgetKey);
|
|
818
838
|
}
|
|
819
839
|
var s;
|
|
820
840
|
};
|
|
821
841
|
let P = null;
|
|
822
842
|
const ye = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (P || (P = /* @__PURE__ */ function() {
|
|
823
843
|
let a = [], t = null;
|
|
824
|
-
function
|
|
844
|
+
function r(o, n) {
|
|
825
845
|
if (t) {
|
|
826
846
|
const e = o.split(".");
|
|
827
|
-
let
|
|
828
|
-
for (let
|
|
829
|
-
const s =
|
|
830
|
-
if (typeof s == "function") return s.apply(
|
|
831
|
-
} else a.push([o,
|
|
847
|
+
let i = t;
|
|
848
|
+
for (let l = 0; l < e.length - 1; l++) i = i[e[l]];
|
|
849
|
+
const s = i[e[e.length - 1]];
|
|
850
|
+
if (typeof s == "function") return s.apply(i, n);
|
|
851
|
+
} else a.push([o, n]);
|
|
832
852
|
}
|
|
833
853
|
return { Widgets: { init: function() {
|
|
834
|
-
for (var o = arguments.length,
|
|
835
|
-
return
|
|
854
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
855
|
+
return r("Widgets.init", n);
|
|
836
856
|
} }, SearchWidget: { initStandard: function() {
|
|
837
|
-
for (var o = arguments.length,
|
|
838
|
-
return
|
|
857
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
858
|
+
return r("SearchWidget.initStandard", n);
|
|
839
859
|
} }, HelpWidget: { initPopup: function() {
|
|
840
|
-
for (var o = arguments.length,
|
|
841
|
-
return
|
|
860
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
861
|
+
return r("HelpWidget.initPopup", n);
|
|
842
862
|
}, close: function() {
|
|
843
|
-
for (var o = arguments.length,
|
|
844
|
-
return
|
|
863
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
864
|
+
return r("HelpWidget.close", n);
|
|
845
865
|
}, open: function() {
|
|
846
|
-
for (var o = arguments.length,
|
|
847
|
-
return
|
|
866
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
867
|
+
return r("HelpWidget.open", n);
|
|
848
868
|
}, toggle: function() {
|
|
849
|
-
for (var o = arguments.length,
|
|
850
|
-
return
|
|
869
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
870
|
+
return r("HelpWidget.toggle", n);
|
|
851
871
|
} }, _setRealBrainfish: function(o) {
|
|
852
872
|
for (t = o; a.length > 0; ) {
|
|
853
|
-
const [
|
|
854
|
-
n
|
|
873
|
+
const [n, e] = a.shift();
|
|
874
|
+
r(n, e);
|
|
855
875
|
}
|
|
856
876
|
} };
|
|
857
877
|
}(), typeof window != "undefined" && (window.Brainfish = P)), P);
|
|
858
|
-
let
|
|
878
|
+
let W = null;
|
|
859
879
|
ye.Widgets.init = (a) => m(void 0, null, function* () {
|
|
860
880
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
861
|
-
for (var
|
|
881
|
+
for (var n = arguments.length, e = new Array(n), i = 0; i < n; i++) e[i] = arguments[i];
|
|
862
882
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
863
883
|
});
|
|
864
|
-
const t = se(a.overrides),
|
|
865
|
-
var
|
|
884
|
+
const t = se(a.overrides), r = ((d = a.overrides) == null ? void 0 : d.analyticsApiHost) || "";
|
|
885
|
+
var d;
|
|
866
886
|
let o;
|
|
867
|
-
if (a.config) o = JSON.parse(((
|
|
887
|
+
if (a.config) o = JSON.parse(((n) => {
|
|
868
888
|
if (typeof window != "undefined" && typeof window.atob == "function") {
|
|
869
|
-
const e = atob(
|
|
870
|
-
for (let
|
|
889
|
+
const e = atob(n), i = e.length, s = new Uint8Array(i);
|
|
890
|
+
for (let l = 0; l < i; l++) s[l] = e.charCodeAt(l);
|
|
871
891
|
return new TextDecoder().decode(s);
|
|
872
892
|
}
|
|
873
|
-
if (typeof Buffer != "undefined") return Buffer.from(
|
|
893
|
+
if (typeof Buffer != "undefined") return Buffer.from(n, "base64").toString("utf-8");
|
|
874
894
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
875
895
|
})(a.config));
|
|
876
896
|
else {
|
|
877
|
-
const { config:
|
|
878
|
-
o =
|
|
897
|
+
const { config: n } = yield We({ widgetKey: a.widgetKey, apiHost: t });
|
|
898
|
+
o = n;
|
|
879
899
|
}
|
|
880
|
-
|
|
900
|
+
W || (W = function(n, e, i, s) {
|
|
881
901
|
return m(this, null, function* () {
|
|
882
|
-
var
|
|
883
|
-
const f = ((
|
|
884
|
-
|
|
885
|
-
const [p] = yield Promise.allSettled(
|
|
902
|
+
var l, u, c;
|
|
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 = [];
|
|
904
|
+
g != null && g.startsWith("2.") ? rt(n, e) : h.push(De(n, e)), h.push(Ne(n.widgetKey, e.trackingToken || "", i, s, f));
|
|
905
|
+
const [p] = yield Promise.allSettled(h);
|
|
886
906
|
p && p.status === "fulfilled" && p.value && ye._setRealBrainfish(p.value);
|
|
887
907
|
});
|
|
888
|
-
}(a, o, t,
|
|
908
|
+
}(a, o, t, r)), yield W;
|
|
889
909
|
});
|
|
890
910
|
const ot = function() {
|
|
891
911
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|