@refraction-ui/react 0.9.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2249 -916
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2083 -766
- package/dist/index.js.map +1 -1
- package/dist/internal/conversation/index.d.cts +235 -0
- package/dist/internal/conversation/index.d.ts +235 -0
- package/dist/internal/cookie-consent/index.d.cts +77 -0
- package/dist/internal/cookie-consent/index.d.ts +77 -0
- package/dist/internal/react-conversation/index.d.cts +97 -0
- package/dist/internal/react-conversation/index.d.ts +97 -0
- package/dist/internal/react-cookie-consent/index.d.cts +46 -0
- package/dist/internal/react-cookie-consent/index.d.ts +46 -0
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -24668,12 +24668,12 @@ function nr(t2) {
|
|
|
24668
24668
|
function Or(t2, e2) {
|
|
24669
24669
|
var { organization: i2, projectId: r2, prefix: s2, severityAllowList: n2 = ["error"], sendExceptionsToPostHog: o2 = true } = void 0 === e2 ? {} : e2;
|
|
24670
24670
|
return (e3) => {
|
|
24671
|
-
var a2, l2, u2,
|
|
24671
|
+
var a2, l2, u2, h5, d2;
|
|
24672
24672
|
if ("*" !== n2 && !n2.includes(e3.level) || !t2.__loaded) return e3;
|
|
24673
24673
|
e3.tags || (e3.tags = {});
|
|
24674
24674
|
var v2 = t2.requestRouter.endpointFor("ui", "/project/" + t2.config.token + "/person/" + t2.get_distinct_id());
|
|
24675
24675
|
e3.tags["PostHog Person URL"] = v2, t2.sessionRecordingStarted() && (e3.tags["PostHog Recording URL"] = t2.get_session_replay_url({ withTimestamp: true }));
|
|
24676
|
-
var c2, p2 = (null == (a2 = e3.exception) ? void 0 : a2.values) || [], _2 = p2.map(((t3) => f({}, t3, { stacktrace: t3.stacktrace ? f({}, t3.stacktrace, { type: "raw", frames: (t3.stacktrace.frames || []).map(((t4) => f({}, t4, { platform: "web:javascript" }))) }) : void 0 }))), g2 = { $exception_message: (null == (l2 = p2[0]) ? void 0 : l2.value) || e3.message, $exception_type: null == (u2 = p2[0]) ? void 0 : u2.type, $exception_level: e3.level, $exception_list: _2, $sentry_event_id: e3.event_id, $sentry_exception: e3.exception, $sentry_exception_message: (null == (
|
|
24676
|
+
var c2, p2 = (null == (a2 = e3.exception) ? void 0 : a2.values) || [], _2 = p2.map(((t3) => f({}, t3, { stacktrace: t3.stacktrace ? f({}, t3.stacktrace, { type: "raw", frames: (t3.stacktrace.frames || []).map(((t4) => f({}, t4, { platform: "web:javascript" }))) }) : void 0 }))), g2 = { $exception_message: (null == (l2 = p2[0]) ? void 0 : l2.value) || e3.message, $exception_type: null == (u2 = p2[0]) ? void 0 : u2.type, $exception_level: e3.level, $exception_list: _2, $sentry_event_id: e3.event_id, $sentry_exception: e3.exception, $sentry_exception_message: (null == (h5 = p2[0]) ? void 0 : h5.value) || e3.message, $sentry_exception_type: null == (d2 = p2[0]) ? void 0 : d2.type, $sentry_tags: e3.tags };
|
|
24677
24677
|
return i2 && r2 && (g2.$sentry_url = (s2 || "https://sentry.io/organizations/") + i2 + "/issues/?project=" + r2 + "&query=" + e3.event_id), o2 && (null == (c2 = t2.exceptions) || c2.sendExceptionEvent(g2)), e3;
|
|
24678
24678
|
};
|
|
24679
24679
|
}
|
|
@@ -24756,31 +24756,31 @@ function Zs(t2, e2) {
|
|
|
24756
24756
|
i2.p(t2);
|
|
24757
24757
|
var s2, n2, o2, a2, l2, u2 = (a2 = 10 + ((s2 = e2).filename && s2.filename.length + 1 || 0), l2 = 8, (function(t3, e3, i3, r3, s3, n3) {
|
|
24758
24758
|
var o3 = t3.length, a3 = new xs(r3 + o3 + 5 * (1 + Math.floor(o3 / 7e3)) + s3), l3 = a3.subarray(r3, a3.length - s3), u3 = 0;
|
|
24759
|
-
if (!e3 || 8 > o3) for (var
|
|
24760
|
-
var d2 =
|
|
24761
|
-
o3 > d2 ? u3 = Ys(l3, u3, t3.subarray(
|
|
24759
|
+
if (!e3 || 8 > o3) for (var h6 = 0; o3 >= h6; h6 += 65535) {
|
|
24760
|
+
var d2 = h6 + 65535;
|
|
24761
|
+
o3 > d2 ? u3 = Ys(l3, u3, t3.subarray(h6, d2)) : (l3[h6] = true, u3 = Ys(l3, u3, t3.subarray(h6, o3)));
|
|
24762
24762
|
}
|
|
24763
24763
|
else {
|
|
24764
24764
|
for (var v2 = Ks[e3 - 1], c2 = v2 >>> 13, p2 = 8191 & v2, f2 = (1 << i3) - 1, _2 = new Es(32768), g2 = new Es(f2 + 1), m2 = Math.ceil(i3 / 3), b2 = 2 * m2, y2 = function(e4) {
|
|
24765
24765
|
return (t3[e4] ^ t3[e4 + 1] << m2 ^ t3[e4 + 2] << b2) & f2;
|
|
24766
|
-
}, w2 = new Ss(25e3), x2 = new Es(288), E2 = new Es(32), S2 = 0, T2 = 0, k2 = (
|
|
24767
|
-
var O2 = y2(
|
|
24768
|
-
if (_2[I2] = C2, g2[O2] = I2,
|
|
24769
|
-
var A2 = o3 -
|
|
24766
|
+
}, w2 = new Ss(25e3), x2 = new Es(288), E2 = new Es(32), S2 = 0, T2 = 0, k2 = (h6 = 0, 0), R2 = 0, P2 = 0; o3 > h6; ++h6) {
|
|
24767
|
+
var O2 = y2(h6), I2 = 32767 & h6, C2 = g2[O2];
|
|
24768
|
+
if (_2[I2] = C2, g2[O2] = I2, h6 >= R2) {
|
|
24769
|
+
var A2 = o3 - h6;
|
|
24770
24770
|
if ((S2 > 7e3 || k2 > 24576) && A2 > 423) {
|
|
24771
|
-
u3 = Js(t3, l3, 0, w2, x2, E2, T2, k2, P2,
|
|
24771
|
+
u3 = Js(t3, l3, 0, w2, x2, E2, T2, k2, P2, h6 - P2, u3), k2 = S2 = T2 = 0, P2 = h6;
|
|
24772
24772
|
for (var F3 = 0; 286 > F3; ++F3) x2[F3] = 0;
|
|
24773
24773
|
for (F3 = 0; 30 > F3; ++F3) E2[F3] = 0;
|
|
24774
24774
|
}
|
|
24775
24775
|
var M3 = 2, D2 = 0, U2 = p2, L2 = I2 - C2 & 32767;
|
|
24776
|
-
if (A2 > 2 && O2 == y2(
|
|
24777
|
-
if (t3[
|
|
24778
|
-
for (var B2 = 0; z2 > B2 && t3[
|
|
24776
|
+
if (A2 > 2 && O2 == y2(h6 - L2)) for (var N2 = Math.min(c2, A2) - 1, j2 = Math.min(32767, h6), z2 = Math.min(258, A2); j2 >= L2 && --U2 && I2 != C2; ) {
|
|
24777
|
+
if (t3[h6 + M3] == t3[h6 + M3 - L2]) {
|
|
24778
|
+
for (var B2 = 0; z2 > B2 && t3[h6 + B2] == t3[h6 + B2 - L2]; ++B2) ;
|
|
24779
24779
|
if (B2 > M3) {
|
|
24780
24780
|
if (M3 = B2, D2 = L2, B2 > N2) break;
|
|
24781
24781
|
var H2 = Math.min(L2, B2 - 2), q2 = 0;
|
|
24782
24782
|
for (F3 = 0; H2 > F3; ++F3) {
|
|
24783
|
-
var V2 =
|
|
24783
|
+
var V2 = h6 - L2 + F3 + 32768 & 32767, W2 = V2 - _2[V2] + 32768 & 32767;
|
|
24784
24784
|
W2 > q2 && (q2 = W2, C2 = V2);
|
|
24785
24785
|
}
|
|
24786
24786
|
}
|
|
@@ -24790,21 +24790,21 @@ function Zs(t2, e2) {
|
|
|
24790
24790
|
if (D2) {
|
|
24791
24791
|
w2[k2++] = 268435456 | Os[M3] << 18 | Is[D2];
|
|
24792
24792
|
var G2 = 31 & Os[M3], Y2 = 31 & Is[D2];
|
|
24793
|
-
T2 += $s[G2] + Ts[Y2], ++x2[257 + G2], ++E2[Y2], R2 =
|
|
24794
|
-
} else w2[k2++] = t3[
|
|
24793
|
+
T2 += $s[G2] + Ts[Y2], ++x2[257 + G2], ++E2[Y2], R2 = h6 + M3, ++S2;
|
|
24794
|
+
} else w2[k2++] = t3[h6], ++x2[t3[h6]];
|
|
24795
24795
|
}
|
|
24796
24796
|
}
|
|
24797
|
-
u3 = Js(t3, l3, true, w2, x2, E2, T2, k2, P2,
|
|
24797
|
+
u3 = Js(t3, l3, true, w2, x2, E2, T2, k2, P2, h6 - P2, u3);
|
|
24798
24798
|
}
|
|
24799
24799
|
return zs(a3, 0, r3 + js(u3) + s3);
|
|
24800
|
-
})(n2 = t2, null == (o2 = e2).level ? 6 : o2.level, null == o2.mem ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(n2.length)))) : 12 + o2.mem, a2, l2)),
|
|
24800
|
+
})(n2 = t2, null == (o2 = e2).level ? 6 : o2.level, null == o2.mem ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(n2.length)))) : 12 + o2.mem, a2, l2)), h5 = u2.length;
|
|
24801
24801
|
return (function(t3, e3) {
|
|
24802
24802
|
var i3 = e3.filename;
|
|
24803
24803
|
if (t3[0] = 31, t3[1] = 139, t3[2] = 8, t3[8] = 2 > e3.level ? 4 : 9 == e3.level ? 2 : 0, t3[9] = 3, 0 != e3.mtime && Qs(t3, 4, Math.floor(new Date(e3.mtime || Date.now()) / 1e3)), i3) {
|
|
24804
24804
|
t3[3] = 8;
|
|
24805
24805
|
for (var r3 = 0; i3.length >= r3; ++r3) t3[r3 + 10] = i3.charCodeAt(r3);
|
|
24806
24806
|
}
|
|
24807
|
-
})(u2, e2), Qs(u2,
|
|
24807
|
+
})(u2, e2), Qs(u2, h5 - 8, i2.d()), Qs(u2, h5 - 4, r2), u2;
|
|
24808
24808
|
}
|
|
24809
24809
|
function Sn(t2, e2, i2) {
|
|
24810
24810
|
return on({ distinct_id: t2, userPropertiesToSet: e2, userPropertiesToSetOnce: i2 });
|
|
@@ -24942,13 +24942,13 @@ function No(t2) {
|
|
|
24942
24942
|
function jo(e2, i2) {
|
|
24943
24943
|
var r2, s2, { e: n2, maskAllElementAttributes: o2, maskAllText: a2, elementAttributeIgnoreList: l2, elementsChainAsString: u2 } = i2;
|
|
24944
24944
|
if (!so(e2)) return { props: {} };
|
|
24945
|
-
for (var
|
|
24945
|
+
for (var h5 = [e2], d2 = e2; d2.parentNode && !no(d2, "body"); ) if (ao(d2.parentNode)) h5.push(d2.parentNode.host), d2 = d2.parentNode.host;
|
|
24946
24946
|
else {
|
|
24947
24947
|
if (!so(d2.parentNode)) break;
|
|
24948
|
-
|
|
24948
|
+
h5.push(d2.parentNode), d2 = d2.parentNode;
|
|
24949
24949
|
}
|
|
24950
24950
|
var v2, c2, p2 = [], _2 = {}, g2 = false, m2 = false;
|
|
24951
|
-
if (Ki(
|
|
24951
|
+
if (Ki(h5, ((t2) => {
|
|
24952
24952
|
var e3 = xo(t2);
|
|
24953
24953
|
if (no(t2, "a")) {
|
|
24954
24954
|
var i3 = t2.getAttribute("href");
|
|
@@ -25051,7 +25051,7 @@ function sa(t2, e2, i2) {
|
|
|
25051
25051
|
return false;
|
|
25052
25052
|
}
|
|
25053
25053
|
}
|
|
25054
|
-
var t, e, i, r, s, n, o, a, l, u,
|
|
25054
|
+
var t, e, i, r, s, n, o, a, l, u, h4, d, v, g, m, b, y, w, x, E, S, k, R, O, I, C, A, F2, M2, D, U, L, N, j, z, B, H, q, V, W, G, Y, Q, Z, tt, it, rt, st, nt, ot, at, lt, ut, ht, dt, vt, ct, pt, ft, _t, gt, mt, bt, yt, wt, xt, Et, St, $t, Tt, kt, Rt, Pt, Ot, It, Ct, At, Ft, Mt, Dt, Ut, Lt, Nt, jt, zt, Bt, Ht, qt, Vt, Wt, Gt, Yt, Jt, Kt, Xt, Qt, Zt, te, ee, ie, re, ae, le, he, de, ve, ce, pe, fe, _e, ge, me, be, ye, we, xe, Ee, Se, Te, ke, Re, Pe, Oe, Ie, Ce, Ae, Me, Ue, Le, Ne, je, ze, Be, He, qe, Ve, We, Ge, Ye, Je, Ke, Xe, Qe, Ze, ti, ei, ii, ri, si, ni, oi, ai, li, ui, hi, di, vi, ci, pi, fi, _i, gi, mi, bi, yi, wi, xi, Ei, Si, $i, Ti, ki, Ri, Pi, Oi, Ii, Ci, Ai, Fi, Mi, Di, Ui, Li, Ni, ji, zi, Bi, Hi, qi, Vi, Wi, Gi, Yi, Xi, Zi, tr, er, ir, or, ar, lr, ur, hr, dr, vr, cr, pr, fr, _r, gr, mr, br, yr, wr, xr, Er, Sr, $r, Tr, kr, Rr, Pr, Ir, Cr, Ar, Fr, Mr, Dr, Ur, Lr, Nr, jr, zr, Br, Hr, Yr, ts, es, is, rs, ss, ns, os, as, ls, us, hs, ds, vs, cs, ps, fs, _s, gs, ms, bs, ys, ws, xs, Es, Ss, $s, Ts, ks, Rs, Ps, Os, Fs, Is, Cs, As, Ms, Ds, Us, Ls, Ns, js, zs, Bs, Hs, qs, Vs, Ws, Gs, Ys, Js, Ks, Xs, Qs, tn, en, rn, sn, nn, on, an, ln, un, hn, dn, vn, cn2, pn, fn, _n, gn, mn, bn, yn, wn, xn, En, $n, Tn, Rn, Pn, On, In, Cn, An, Fn, Mn, Dn, Un, Ln, Nn, jn, zn, Bn, Hn, qn, Vn, Wn, Gn, Yn, Jn, Kn, Xn, Qn, Zn, to, eo, io, fo, mo, bo, yo, wo, So, $o, To, ko, Ro, Po, Mo, Do, Uo, zo, Ho, qo, Vo, Wo, Go, Yo, Jo, Ko, Xo, Qo, ta, ea, ia, ra, na, oa, aa, la, ua, ha, da, va, ca, pa, fa, _a12, ga, ma, ba, ya, wa, xa, Ea, Sa, $a, Ta, ka, Ra, Pa, Oa, Ia, Ca, Aa, Fa, Ma, Da, Ua, La;
|
|
25055
25055
|
var init_module = __esm({
|
|
25056
25056
|
"../../node_modules/.pnpm/posthog-js@1.373.5/node_modules/posthog-js/dist/module.js"() {
|
|
25057
25057
|
t = "undefined" != typeof window ? window : void 0;
|
|
@@ -25066,7 +25066,7 @@ var init_module = __esm({
|
|
|
25066
25066
|
a = null == e ? void 0 : e.AbortController;
|
|
25067
25067
|
l = null == e ? void 0 : e.CompressionStream;
|
|
25068
25068
|
u = null == i ? void 0 : i.userAgent;
|
|
25069
|
-
|
|
25069
|
+
h4 = null != t ? t : {};
|
|
25070
25070
|
d = "1.373.5";
|
|
25071
25071
|
v = { DEBUG: false, LIB_VERSION: d, LIB_NAME: "web", JS_SDK_VERSION: d };
|
|
25072
25072
|
m = (function(t2) {
|
|
@@ -25561,7 +25561,7 @@ var init_module = __esm({
|
|
|
25561
25561
|
};
|
|
25562
25562
|
Ue = function(e2, i2) {
|
|
25563
25563
|
var { debugEnabled: r2 } = void 0 === i2 ? {} : i2, s2 = { k(i3) {
|
|
25564
|
-
if (t && (v.DEBUG ||
|
|
25564
|
+
if (t && (v.DEBUG || h4.POSTHOG_DEBUG || r2) && !N(t.console) && t.console) {
|
|
25565
25565
|
for (var s3 = ("__rrweb_original__" in t.console[i3]) ? t.console[i3].__rrweb_original__ : t.console[i3], n2 = arguments.length, o2 = new Array(n2 > 1 ? n2 - 1 : 0), a2 = 1; n2 > a2; a2++) o2[a2 - 1] = arguments[a2];
|
|
25566
25566
|
s3(e2, ...o2);
|
|
25567
25567
|
}
|
|
@@ -25615,7 +25615,7 @@ var init_module = __esm({
|
|
|
25615
25615
|
};
|
|
25616
25616
|
null != r && r.body ? l2() : null == r || r.addEventListener("DOMContentLoaded", l2);
|
|
25617
25617
|
};
|
|
25618
|
-
|
|
25618
|
+
h4.__PosthogExtensions__ = h4.__PosthogExtensions__ || {}, h4.__PosthogExtensions__.loadExternalDependency = (t2, e2, i2) => {
|
|
25619
25619
|
if ("remote-config" !== e2) {
|
|
25620
25620
|
var r2;
|
|
25621
25621
|
if (t2.config.__preview_external_dependency_versioned_paths) r2 = t2.requestRouter.endpointFor("assets", "/static/" + t2.version + "/" + e2 + ".js");
|
|
@@ -25632,7 +25632,7 @@ var init_module = __esm({
|
|
|
25632
25632
|
var o2 = t2.requestRouter.endpointFor("assets", "/array/" + t2.config.token + "/config.js");
|
|
25633
25633
|
ze(t2, o2, i2);
|
|
25634
25634
|
}
|
|
25635
|
-
},
|
|
25635
|
+
}, h4.__PosthogExtensions__.loadSiteApp = (t2, e2, i2) => {
|
|
25636
25636
|
var r2 = t2.requestRouter.endpointFor("api", e2);
|
|
25637
25637
|
ze(t2, r2, i2);
|
|
25638
25638
|
};
|
|
@@ -25854,8 +25854,8 @@ var init_module = __esm({
|
|
|
25854
25854
|
u2.setTime(u2.getTime() + 864e5 * i2), o2 = "; expires=" + u2.toUTCString();
|
|
25855
25855
|
}
|
|
25856
25856
|
n2 && (a2 = "; secure");
|
|
25857
|
-
var
|
|
25858
|
-
return
|
|
25857
|
+
var h5 = t2 + "=" + encodeURIComponent(JSON.stringify(e2)) + o2 + "; SameSite=Lax; path=/" + l2 + a2;
|
|
25858
|
+
return h5.length > 3686.4 && Le.warn("cookieStore warning: large cookie, len=" + h5.length), r.cookie = h5, h5;
|
|
25859
25859
|
} catch (t3) {
|
|
25860
25860
|
return;
|
|
25861
25861
|
}
|
|
@@ -26000,7 +26000,7 @@ var init_module = __esm({
|
|
|
26000
26000
|
return this.ar;
|
|
26001
26001
|
}
|
|
26002
26002
|
rr() {
|
|
26003
|
-
return !!this.qt.respect_dnt && [null == i ? void 0 : i.doNotTrack, null == i ? void 0 : i.msDoNotTrack,
|
|
26003
|
+
return !!this.qt.respect_dnt && [null == i ? void 0 : i.doNotTrack, null == i ? void 0 : i.msDoNotTrack, h4.doNotTrack].some(((t2) => Z(t2)));
|
|
26004
26004
|
}
|
|
26005
26005
|
};
|
|
26006
26006
|
Sr = Ne("[Dead Clicks]");
|
|
@@ -26026,16 +26026,16 @@ var init_module = __esm({
|
|
|
26026
26026
|
}
|
|
26027
26027
|
lr(t2) {
|
|
26028
26028
|
var e2, i2;
|
|
26029
|
-
null != (e2 =
|
|
26029
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.initDeadClicksAutocapture && t2(), null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this.instance, "dead-clicks-autocapture", ((e3) => {
|
|
26030
26030
|
e3 ? Sr.error("failed to load script", e3) : t2();
|
|
26031
26031
|
}));
|
|
26032
26032
|
}
|
|
26033
26033
|
hr() {
|
|
26034
26034
|
var t2;
|
|
26035
26035
|
if (r) {
|
|
26036
|
-
if (!this.ur && null != (t2 =
|
|
26036
|
+
if (!this.ur && null != (t2 = h4.__PosthogExtensions__) && t2.initDeadClicksAutocapture) {
|
|
26037
26037
|
var e2 = U(this.instance.config.capture_dead_clicks) ? this.instance.config.capture_dead_clicks : {};
|
|
26038
|
-
e2.__onCapture = this.onCapture, this.ur =
|
|
26038
|
+
e2.__onCapture = this.onCapture, this.ur = h4.__PosthogExtensions__.initDeadClicksAutocapture(this.instance, e2), this.ur.start(r), Sr.info("starting...");
|
|
26039
26039
|
}
|
|
26040
26040
|
} else Sr.error("`document` not found. Cannot start.");
|
|
26041
26041
|
}
|
|
@@ -26083,11 +26083,11 @@ var init_module = __esm({
|
|
|
26083
26083
|
if (!i2) return { $pageview_id: e2 };
|
|
26084
26084
|
var r2 = { $pageview_id: e2, $prev_pageview_id: i2.pageViewId }, s2 = this._instance.scrollManager.getContext();
|
|
26085
26085
|
if (s2 && !this._instance.config.disable_scroll_properties) {
|
|
26086
|
-
var { maxScrollHeight: n2, lastScrollY: o2, maxScrollY: a2, maxContentHeight: l2, lastContentY: u2, maxContentY:
|
|
26087
|
-
if (!(N(n2) || N(o2) || N(a2) || N(l2) || N(u2) || N(
|
|
26088
|
-
n2 = Math.ceil(n2), o2 = Math.ceil(o2), a2 = Math.ceil(a2), l2 = Math.ceil(l2), u2 = Math.ceil(u2),
|
|
26089
|
-
var d2 = n2 > 1 ? et(o2 / n2, 0, 1, Le) : 1, v2 = n2 > 1 ? et(a2 / n2, 0, 1, Le) : 1, c2 = l2 > 1 ? et(u2 / l2, 0, 1, Le) : 1, p2 = l2 > 1 ? et(
|
|
26090
|
-
r2 = Xi(r2, { $prev_pageview_last_scroll: o2, $prev_pageview_last_scroll_percentage: d2, $prev_pageview_max_scroll: a2, $prev_pageview_max_scroll_percentage: v2, $prev_pageview_last_content: u2, $prev_pageview_last_content_percentage: c2, $prev_pageview_max_content:
|
|
26086
|
+
var { maxScrollHeight: n2, lastScrollY: o2, maxScrollY: a2, maxContentHeight: l2, lastContentY: u2, maxContentY: h5 } = s2;
|
|
26087
|
+
if (!(N(n2) || N(o2) || N(a2) || N(l2) || N(u2) || N(h5))) {
|
|
26088
|
+
n2 = Math.ceil(n2), o2 = Math.ceil(o2), a2 = Math.ceil(a2), l2 = Math.ceil(l2), u2 = Math.ceil(u2), h5 = Math.ceil(h5);
|
|
26089
|
+
var d2 = n2 > 1 ? et(o2 / n2, 0, 1, Le) : 1, v2 = n2 > 1 ? et(a2 / n2, 0, 1, Le) : 1, c2 = l2 > 1 ? et(u2 / l2, 0, 1, Le) : 1, p2 = l2 > 1 ? et(h5 / l2, 0, 1, Le) : 1;
|
|
26090
|
+
r2 = Xi(r2, { $prev_pageview_last_scroll: o2, $prev_pageview_last_scroll_percentage: d2, $prev_pageview_max_scroll: a2, $prev_pageview_max_scroll_percentage: v2, $prev_pageview_last_content: u2, $prev_pageview_last_content_percentage: c2, $prev_pageview_max_content: h5, $prev_pageview_max_content_percentage: p2 });
|
|
26091
26091
|
}
|
|
26092
26092
|
}
|
|
26093
26093
|
return i2.pathname && (r2.$prev_pageview_pathname = i2.pathname), i2.timestamp && (r2.$prev_pageview_duration = (t2.getTime() - i2.timestamp.getTime()) / 1e3), r2;
|
|
@@ -26122,9 +26122,9 @@ var init_module = __esm({
|
|
|
26122
26122
|
};
|
|
26123
26123
|
Ur = function(t2, e2, i2) {
|
|
26124
26124
|
if (!t2 || !e2 || !e2.length) return t2;
|
|
26125
|
-
for (var r2 = t2.split("#"), s2 = r2[1], n2 = (r2[0] || "").split("?"), o2 = n2[1], a2 = n2[0], l2 = (o2 || "").split("&"), u2 = [],
|
|
26126
|
-
var d2 = l2[
|
|
26127
|
-
M2(d2) && (e2.includes(d2[0]) ? u2.push(d2[0] + "=" + i2) : u2.push(l2[
|
|
26125
|
+
for (var r2 = t2.split("#"), s2 = r2[1], n2 = (r2[0] || "").split("?"), o2 = n2[1], a2 = n2[0], l2 = (o2 || "").split("&"), u2 = [], h5 = 0; l2.length > h5; h5++) {
|
|
26126
|
+
var d2 = l2[h5].split("=");
|
|
26127
|
+
M2(d2) && (e2.includes(d2[0]) ? u2.push(d2[0] + "=" + i2) : u2.push(l2[h5]));
|
|
26128
26128
|
}
|
|
26129
26129
|
var v2 = a2;
|
|
26130
26130
|
return null != o2 && (v2 += "?" + u2.join("&")), null != s2 && (v2 += "#" + s2), v2;
|
|
@@ -26380,11 +26380,11 @@ var init_module = __esm({
|
|
|
26380
26380
|
}
|
|
26381
26381
|
get remoteConfig() {
|
|
26382
26382
|
var t2;
|
|
26383
|
-
return null == (t2 =
|
|
26383
|
+
return null == (t2 = h4._POSTHOG_REMOTE_CONFIG) || null == (t2 = t2[this._instance.config.token]) ? void 0 : t2.config;
|
|
26384
26384
|
}
|
|
26385
26385
|
Mr(t2) {
|
|
26386
26386
|
var e2, i2;
|
|
26387
|
-
null != (e2 =
|
|
26387
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.loadExternalDependency ? null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, "remote-config", (() => t2(this.remoteConfig))) : t2();
|
|
26388
26388
|
}
|
|
26389
26389
|
Pr(t2) {
|
|
26390
26390
|
this._instance._send_request({ method: "GET", url: this._instance.requestRouter.endpointFor("assets", "/array/" + this._instance.config.token + "/config"), callback(e2) {
|
|
@@ -26453,7 +26453,7 @@ var init_module = __esm({
|
|
|
26453
26453
|
if (i2) {
|
|
26454
26454
|
o2 = new Es(1 << e2);
|
|
26455
26455
|
var l2 = 15 - e2;
|
|
26456
|
-
for (s2 = 0; r2 > s2; ++s2) if (t2[s2]) for (var u2 = s2 << 4 | t2[s2],
|
|
26456
|
+
for (s2 = 0; r2 > s2; ++s2) if (t2[s2]) for (var u2 = s2 << 4 | t2[s2], h5 = e2 - t2[s2], d2 = a2[t2[s2] - 1]++ << h5, v2 = d2 | (1 << h5) - 1; v2 >= d2; ++d2) o2[Cs[d2] >>> l2] = u2;
|
|
26457
26457
|
} else for (o2 = new Es(r2), s2 = 0; r2 > s2; ++s2) o2[s2] = Cs[a2[t2[s2] - 1]++] >>> 15 - t2[s2];
|
|
26458
26458
|
return o2;
|
|
26459
26459
|
};
|
|
@@ -26493,11 +26493,11 @@ var init_module = __esm({
|
|
|
26493
26493
|
i2.sort((function(t3, e3) {
|
|
26494
26494
|
return t3.f - e3.f;
|
|
26495
26495
|
})), i2.push({ s: -1, f: 25001 });
|
|
26496
|
-
var a2 = i2[0], l2 = i2[1], u2 = 0,
|
|
26497
|
-
for (i2[0] = { s: -1, f: a2.f + l2.f, l: a2, r: l2 };
|
|
26496
|
+
var a2 = i2[0], l2 = i2[1], u2 = 0, h5 = 1, d2 = 2;
|
|
26497
|
+
for (i2[0] = { s: -1, f: a2.f + l2.f, l: a2, r: l2 }; h5 != s2 - 1; ) a2 = i2[i2[d2].f > i2[u2].f ? u2++ : d2++], l2 = i2[u2 != h5 && i2[d2].f > i2[u2].f ? u2++ : d2++], i2[h5++] = { s: -1, f: a2.f + l2.f, l: a2, r: l2 };
|
|
26498
26498
|
var v2 = n2[0].s;
|
|
26499
26499
|
for (r2 = 1; s2 > r2; ++r2) n2[r2].s > v2 && (v2 = n2[r2].s);
|
|
26500
|
-
var c2 = new Es(v2 + 1), p2 = Vs(i2[
|
|
26500
|
+
var c2 = new Es(v2 + 1), p2 = Vs(i2[h5 - 1], c2, 0);
|
|
26501
26501
|
if (p2 > e2) {
|
|
26502
26502
|
r2 = 0;
|
|
26503
26503
|
var f2 = 0, _2 = p2 - e2, g2 = 1 << _2;
|
|
@@ -26551,30 +26551,30 @@ var init_module = __esm({
|
|
|
26551
26551
|
for (var n2 = 0; r2 > n2; ++n2) t2[s2 + n2 + 4] = i2[n2];
|
|
26552
26552
|
return 8 * (s2 + 4 + r2);
|
|
26553
26553
|
};
|
|
26554
|
-
Js = function(t2, e2, i2, r2, s2, n2, o2, a2, l2, u2,
|
|
26555
|
-
Bs(e2,
|
|
26554
|
+
Js = function(t2, e2, i2, r2, s2, n2, o2, a2, l2, u2, h5) {
|
|
26555
|
+
Bs(e2, h5++, i2), ++s2[256];
|
|
26556
26556
|
for (var d2 = qs(s2, 15), v2 = d2[0], c2 = d2[1], p2 = qs(n2, 15), f2 = p2[0], _2 = p2[1], g2 = Ws(v2), m2 = g2[0], b2 = g2[1], y2 = Ws(f2), w2 = y2[0], x2 = y2[1], E2 = new Es(19), S2 = 0; m2.length > S2; ++S2) E2[31 & m2[S2]]++;
|
|
26557
26557
|
for (S2 = 0; w2.length > S2; ++S2) E2[31 & w2[S2]]++;
|
|
26558
26558
|
for (var T2 = qs(E2, 7), k2 = T2[0], R2 = T2[1], P2 = 19; P2 > 4 && !k2[ks[P2 - 1]]; --P2) ;
|
|
26559
26559
|
var O2, I2, C2, A2, F3 = u2 + 5 << 3, M3 = Gs(s2, Ds) + Gs(n2, Us) + o2, D2 = Gs(s2, v2) + Gs(n2, f2) + o2 + 14 + 3 * P2 + Gs(E2, k2) + (2 * E2[16] + 3 * E2[17] + 7 * E2[18]);
|
|
26560
|
-
if (M3 >= F3 && D2 >= F3) return Ys(e2,
|
|
26561
|
-
if (Bs(e2,
|
|
26560
|
+
if (M3 >= F3 && D2 >= F3) return Ys(e2, h5, t2.subarray(l2, l2 + u2));
|
|
26561
|
+
if (Bs(e2, h5, 1 + (M3 > D2)), h5 += 2, M3 > D2) {
|
|
26562
26562
|
O2 = Ms(v2, c2, 0), I2 = v2, C2 = Ms(f2, _2, 0), A2 = f2;
|
|
26563
26563
|
var U2 = Ms(k2, R2, 0);
|
|
26564
|
-
for (Bs(e2,
|
|
26565
|
-
|
|
26564
|
+
for (Bs(e2, h5, b2 - 257), Bs(e2, h5 + 5, x2 - 1), Bs(e2, h5 + 10, P2 - 4), h5 += 14, S2 = 0; P2 > S2; ++S2) Bs(e2, h5 + 3 * S2, k2[ks[S2]]);
|
|
26565
|
+
h5 += 3 * P2;
|
|
26566
26566
|
for (var L2 = [m2, w2], N2 = 0; 2 > N2; ++N2) {
|
|
26567
26567
|
var j2 = L2[N2];
|
|
26568
|
-
for (S2 = 0; j2.length > S2; ++S2) Bs(e2,
|
|
26568
|
+
for (S2 = 0; j2.length > S2; ++S2) Bs(e2, h5, U2[z2 = 31 & j2[S2]]), h5 += k2[z2], z2 > 15 && (Bs(e2, h5, j2[S2] >>> 5 & 127), h5 += j2[S2] >>> 12);
|
|
26569
26569
|
}
|
|
26570
26570
|
} else O2 = Ls, I2 = Ds, C2 = Ns, A2 = Us;
|
|
26571
26571
|
for (S2 = 0; a2 > S2; ++S2) if (r2[S2] > 255) {
|
|
26572
26572
|
var z2;
|
|
26573
|
-
Hs(e2,
|
|
26573
|
+
Hs(e2, h5, O2[257 + (z2 = r2[S2] >>> 18 & 31)]), h5 += I2[z2 + 257], z2 > 7 && (Bs(e2, h5, r2[S2] >>> 23 & 31), h5 += $s[z2]);
|
|
26574
26574
|
var B2 = 31 & r2[S2];
|
|
26575
|
-
Hs(e2,
|
|
26576
|
-
} else Hs(e2,
|
|
26577
|
-
return Hs(e2,
|
|
26575
|
+
Hs(e2, h5, C2[B2]), h5 += A2[B2], B2 > 3 && (Hs(e2, h5, r2[S2] >>> 5 & 8191), h5 += Ts[B2]);
|
|
26576
|
+
} else Hs(e2, h5, O2[r2[S2]]), h5 += I2[r2[S2]];
|
|
26577
|
+
return Hs(e2, h5, O2[256]), h5 + I2[256];
|
|
26578
26578
|
};
|
|
26579
26579
|
Ks = new Ss([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
|
|
26580
26580
|
Xs = (function() {
|
|
@@ -26669,12 +26669,12 @@ var init_module = __esm({
|
|
|
26669
26669
|
Ki(t2.headers, (function(t3, e3) {
|
|
26670
26670
|
u2.append(e3, t3);
|
|
26671
26671
|
})), s2 && u2.append("Content-Type", s2);
|
|
26672
|
-
var
|
|
26672
|
+
var h5 = null;
|
|
26673
26673
|
if (a) {
|
|
26674
26674
|
var d2 = new a();
|
|
26675
|
-
|
|
26675
|
+
h5 = { signal: d2.signal, timeout: setTimeout((() => d2.abort()), t2.timeout) };
|
|
26676
26676
|
}
|
|
26677
|
-
n(i2, f({ method: (null == t2 ? void 0 : t2.method) || "GET", headers: u2, keepalive: "POST" === t2.method && 52428.8 > (l2 || 0), body: o2, signal: null == (e2 =
|
|
26677
|
+
n(i2, f({ method: (null == t2 ? void 0 : t2.method) || "GET", headers: u2, keepalive: "POST" === t2.method && 52428.8 > (l2 || 0), body: o2, signal: null == (e2 = h5) ? void 0 : e2.signal }, t2.fetchOptions)).then(((e3) => e3.text().then(((i3) => {
|
|
26678
26678
|
var r3 = { statusCode: e3.status, text: i3 };
|
|
26679
26679
|
if (200 === e3.status) try {
|
|
26680
26680
|
r3.json = JSON.parse(i3);
|
|
@@ -26684,7 +26684,7 @@ var init_module = __esm({
|
|
|
26684
26684
|
null == t2.callback || t2.callback(r3);
|
|
26685
26685
|
})))).catch(((e3) => {
|
|
26686
26686
|
Le.error(e3), null == t2.callback || t2.callback({ statusCode: 0, error: e3 });
|
|
26687
|
-
})).finally((() =>
|
|
26687
|
+
})).finally((() => h5 ? clearTimeout(h5.timeout) : null));
|
|
26688
26688
|
} }), o && dn.push({ transport: "XHR", method(t2) {
|
|
26689
26689
|
var e2 = new o(), { url: i2, encodedBody: r2 } = ln(t2);
|
|
26690
26690
|
e2.open(t2.method || "GET", i2, true);
|
|
@@ -26950,10 +26950,10 @@ var init_module = __esm({
|
|
|
26950
26950
|
}
|
|
26951
26951
|
checkAndGetSessionAndWindowId(t2, e2) {
|
|
26952
26952
|
if (void 0 === t2 && (t2 = false), void 0 === e2 && (e2 = null), this.qt.cookieless_mode === Ni) throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');
|
|
26953
|
-
var i2 = e2 || (/* @__PURE__ */ new Date()).getTime(), [r2, s2, n2] = this.ki(), o2 = this.Si(), a2 = V(n2) && Math.abs(i2 - n2) > 864e5, l2 = false, u2 = !s2,
|
|
26954
|
-
u2 ||
|
|
26953
|
+
var i2 = e2 || (/* @__PURE__ */ new Date()).getTime(), [r2, s2, n2] = this.ki(), o2 = this.Si(), a2 = V(n2) && Math.abs(i2 - n2) > 864e5, l2 = false, u2 = !s2, h5 = !u2 && !t2 && this.hi(i2, r2);
|
|
26954
|
+
u2 || h5 || a2 ? (s2 = this.vi(), o2 = this.fi(), yn.info("new session ID generated", { sessionId: s2, windowId: o2, changeReason: { noSessionId: u2, activityTimeout: h5, sessionPastMaximumLength: a2 } }), n2 = i2, l2 = true) : o2 || (o2 = this.fi(), l2 = true);
|
|
26955
26955
|
var d2 = V(r2) && t2 && !a2 ? r2 : i2, v2 = V(n2) ? n2 : (/* @__PURE__ */ new Date()).getTime();
|
|
26956
|
-
return this.xi(o2), this.bi(s2, d2, v2), t2 || this.pi(), l2 && this.ui.forEach(((t3) => t3(s2, o2, l2 ? { noSessionId: u2, activityTimeout:
|
|
26956
|
+
return this.xi(o2), this.bi(s2, d2, v2), t2 || this.pi(), l2 && this.ui.forEach(((t3) => t3(s2, o2, l2 ? { noSessionId: u2, activityTimeout: h5, sessionPastMaximumLength: a2 } : void 0))), { sessionId: s2, windowId: o2, sessionStartTimestamp: v2, changeReason: l2 ? { noSessionId: u2, activityTimeout: h5, sessionPastMaximumLength: a2 } : void 0, lastActivityTimestamp: r2 };
|
|
26957
26957
|
}
|
|
26958
26958
|
pi() {
|
|
26959
26959
|
clearTimeout(this.Ci), this.Ci = setTimeout((() => {
|
|
@@ -27054,7 +27054,7 @@ var init_module = __esm({
|
|
|
27054
27054
|
}
|
|
27055
27055
|
lr(t2, e2) {
|
|
27056
27056
|
var i2;
|
|
27057
|
-
null == (i2 =
|
|
27057
|
+
null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, t2, ((t3) => {
|
|
27058
27058
|
if (t3) return Dn.error("failed to load script", t3);
|
|
27059
27059
|
e2();
|
|
27060
27060
|
}));
|
|
@@ -27062,10 +27062,10 @@ var init_module = __esm({
|
|
|
27062
27062
|
startIfEnabledOrStop() {
|
|
27063
27063
|
var t2 = this, e2 = function(e3) {
|
|
27064
27064
|
var i3, s3, n2;
|
|
27065
|
-
!r2 || null != (i3 =
|
|
27065
|
+
!r2 || null != (i3 = h4.__PosthogExtensions__) && null != (i3 = i3.integrations) && i3[e3] || t2.lr(Un[e3], (() => {
|
|
27066
27066
|
var i4;
|
|
27067
|
-
null == (i4 =
|
|
27068
|
-
})), !r2 && null != (s3 =
|
|
27067
|
+
null == (i4 = h4.__PosthogExtensions__) || null == (i4 = i4.integrations) || null == (i4 = i4[e3]) || i4.start(t2._instance);
|
|
27068
|
+
})), !r2 && null != (s3 = h4.__PosthogExtensions__) && null != (s3 = s3.integrations) && s3[e3] && (null == (n2 = h4.__PosthogExtensions__) || null == (n2 = n2.integrations) || null == (n2 = n2[e3]) || n2.stop());
|
|
27069
27069
|
};
|
|
27070
27070
|
for (var [i2, r2] of Object.entries(null !== (s2 = this._instance.config.integrations) && void 0 !== s2 ? s2 : {})) {
|
|
27071
27071
|
var s2;
|
|
@@ -27161,12 +27161,12 @@ var init_module = __esm({
|
|
|
27161
27161
|
if (u2 || (this.sessionManager = new wn(this), this.sessionPropsManager = new mn(this, this.sessionManager, this.persistence)), this.config.__preview_deferred_init_extensions ? (Le.info("Deferring extension initialization to improve startup performance"), setTimeout((() => {
|
|
27162
27162
|
this.Vi(u2);
|
|
27163
27163
|
}), 0)) : (Le.info("Initializing extensions synchronously"), this.Vi(u2)), v.DEBUG = v.DEBUG || this.config.debug, v.DEBUG && Le.info("Starting in debug mode", { this: this, config: i2, thisC: f({}, this.config), p: a2, s: l2 }), !this.config.identity_distinct_id || null != (s2 = i2.bootstrap) && s2.distinctID || (i2.bootstrap = f({}, i2.bootstrap, { distinctID: this.config.identity_distinct_id, isIdentifiedID: true })), void 0 !== (null == (n2 = i2.bootstrap) ? void 0 : n2.distinctID)) {
|
|
27164
|
-
var
|
|
27165
|
-
if (i2.bootstrap.isIdentifiedID && null != d2 && d2 !==
|
|
27166
|
-
else if (i2.bootstrap.isIdentifiedID && null != d2 && d2 !==
|
|
27164
|
+
var h5 = i2.bootstrap.distinctID, d2 = this.get_distinct_id(), c2 = this.persistence.get_property($i);
|
|
27165
|
+
if (i2.bootstrap.isIdentifiedID && null != d2 && d2 !== h5 && c2 === ji) this.identify(h5);
|
|
27166
|
+
else if (i2.bootstrap.isIdentifiedID && null != d2 && d2 !== h5 && c2 === zi) Le.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");
|
|
27167
27167
|
else {
|
|
27168
|
-
var p2 = this.config.get_device_id(dr()), _2 = i2.bootstrap.isIdentifiedID ? p2 :
|
|
27169
|
-
this.persistence.set_property($i, i2.bootstrap.isIdentifiedID ? zi : ji), this.register({ distinct_id:
|
|
27168
|
+
var p2 = this.config.get_device_id(dr()), _2 = i2.bootstrap.isIdentifiedID ? p2 : h5;
|
|
27169
|
+
this.persistence.set_property($i, i2.bootstrap.isIdentifiedID ? zi : ji), this.register({ distinct_id: h5, $device_id: _2 });
|
|
27170
27170
|
}
|
|
27171
27171
|
}
|
|
27172
27172
|
if (u2) this.register_once({ distinct_id: Ai, $device_id: null }, "");
|
|
@@ -27202,19 +27202,19 @@ var init_module = __esm({
|
|
|
27202
27202
|
})(this, (() => this.Wi())) : this.Wi(), D(this.config._onCapture) && this.config._onCapture !== Bn && (Le.warn("onCapture is deprecated. Please use `before_send` instead"), this.on("eventCaptured", ((t2) => this.config._onCapture(t2.event, t2)))), this.config.ip && Le.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'), this;
|
|
27203
27203
|
}
|
|
27204
27204
|
Vi(t2) {
|
|
27205
|
-
var e2, i2, r2, s2, n2, o2, a2, l2 = performance.now(), u2 = f({}, _Zn.__defaultExtensionClasses, this.config.__extensionClasses),
|
|
27206
|
-
u2.featureFlags && this.Pi.push(this.featureFlags = null !== (e2 = this.featureFlags) && void 0 !== e2 ? e2 : new u2.featureFlags(this)), u2.exceptions && this.Pi.push(this.exceptions = null !== (i2 = this.exceptions) && void 0 !== i2 ? i2 : new u2.exceptions(this)), u2.historyAutocapture && this.Pi.push(this.historyAutocapture = new u2.historyAutocapture(this)), u2.tracingHeaders && this.Pi.push(new u2.tracingHeaders(this)), u2.siteApps && this.Pi.push(this.siteApps = new u2.siteApps(this)), u2.sessionRecording && !t2 && this.Pi.push(this.sessionRecording = new u2.sessionRecording(this)), this.config.disable_scroll_properties ||
|
|
27205
|
+
var e2, i2, r2, s2, n2, o2, a2, l2 = performance.now(), u2 = f({}, _Zn.__defaultExtensionClasses, this.config.__extensionClasses), h5 = [];
|
|
27206
|
+
u2.featureFlags && this.Pi.push(this.featureFlags = null !== (e2 = this.featureFlags) && void 0 !== e2 ? e2 : new u2.featureFlags(this)), u2.exceptions && this.Pi.push(this.exceptions = null !== (i2 = this.exceptions) && void 0 !== i2 ? i2 : new u2.exceptions(this)), u2.historyAutocapture && this.Pi.push(this.historyAutocapture = new u2.historyAutocapture(this)), u2.tracingHeaders && this.Pi.push(new u2.tracingHeaders(this)), u2.siteApps && this.Pi.push(this.siteApps = new u2.siteApps(this)), u2.sessionRecording && !t2 && this.Pi.push(this.sessionRecording = new u2.sessionRecording(this)), this.config.disable_scroll_properties || h5.push((() => {
|
|
27207
27207
|
this.scrollManager.startMeasuringScrollPosition();
|
|
27208
27208
|
})), u2.autocapture && this.Pi.push(this.autocapture = new u2.autocapture(this)), u2.surveys && this.Pi.push(this.surveys = null !== (r2 = this.surveys) && void 0 !== r2 ? r2 : new u2.surveys(this)), u2.logs && this.Pi.push(this.logs = null !== (s2 = this.logs) && void 0 !== s2 ? s2 : new u2.logs(this)), u2.conversations && this.Pi.push(this.conversations = null !== (n2 = this.conversations) && void 0 !== n2 ? n2 : new u2.conversations(this)), u2.productTours && this.Pi.push(this.productTours = new u2.productTours(this)), u2.heatmaps && this.Pi.push(this.heatmaps = new u2.heatmaps(this)), u2.webVitalsAutocapture && this.Pi.push(this.webVitalsAutocapture = new u2.webVitalsAutocapture(this)), u2.exceptionObserver && this.Pi.push(this.exceptionObserver = new u2.exceptionObserver(this)), u2.deadClicksAutocapture && this.Pi.push(this.deadClicksAutocapture = new u2.deadClicksAutocapture(this, Tr)), u2.toolbar && this.Pi.push(this.toolbar = null !== (o2 = this.toolbar) && void 0 !== o2 ? o2 : new u2.toolbar(this)), u2.experiments && this.Pi.push(this.experiments = null !== (a2 = this.experiments) && void 0 !== a2 ? a2 : new u2.experiments(this)), this.Pi.forEach(((t3) => {
|
|
27209
|
-
t3.initialize &&
|
|
27209
|
+
t3.initialize && h5.push((() => {
|
|
27210
27210
|
null == t3.initialize || t3.initialize();
|
|
27211
27211
|
}));
|
|
27212
|
-
})),
|
|
27212
|
+
})), h5.push((() => {
|
|
27213
27213
|
if (this.Zi) {
|
|
27214
27214
|
var t3 = this.Zi;
|
|
27215
27215
|
this.Zi = void 0, this.Rr(t3);
|
|
27216
27216
|
}
|
|
27217
|
-
})), this.Gi(
|
|
27217
|
+
})), this.Gi(h5, l2);
|
|
27218
27218
|
}
|
|
27219
27219
|
Gi(t2, e2) {
|
|
27220
27220
|
for (; t2.length > 0; ) {
|
|
@@ -27336,7 +27336,7 @@ var init_module = __esm({
|
|
|
27336
27336
|
var u2 = null != i2 && i2.skip_client_rate_limiting ? void 0 : this.rateLimiter.clientRateLimitContext();
|
|
27337
27337
|
if (null == u2 || !u2.isRateLimited) {
|
|
27338
27338
|
null != e2 && e2.$current_url && !j(null == e2 ? void 0 : e2.$current_url) && (Le.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."), null == e2 || delete e2.$current_url), "$exception" !== t2 || null != i2 && i2.en || Le.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."), this.sessionPersistence.update_search_keyword(), this.config.save_campaign_params && this.sessionPersistence.update_campaign_params(), this.config.save_referrer && this.sessionPersistence.update_referrer_info(), (this.config.save_campaign_params || this.config.save_referrer) && this.persistence.set_initial_person_info();
|
|
27339
|
-
var
|
|
27339
|
+
var h5 = /* @__PURE__ */ new Date(), d2 = (null == i2 ? void 0 : i2.timestamp) || h5, v2 = (null == i2 ? void 0 : i2.uuid) || dr(), c2 = { uuid: v2, event: t2, properties: this.calculateEventProperties(t2, e2 || {}, d2, v2) };
|
|
27340
27340
|
t2 === Vi && this.config.__preview_capture_bot_pageviews && l2 && (c2.event = "$bot_pageview", c2.properties.$browser_type = "bot"), u2 && (c2.properties.$lib_rate_limit_remaining_tokens = u2.remainingTokens), (null == i2 ? void 0 : i2.$set) && (c2.$set = null == i2 ? void 0 : i2.$set);
|
|
27341
27341
|
var p2, _2, g2, m2 = this.tn(null == i2 ? void 0 : i2.$set_once, t2 !== Yi, t2 === Gi);
|
|
27342
27342
|
if (m2 && (c2.$set_once = m2), null != i2 && i2._noTruncate || (s2 = this.config.properties_string_max_length, n2 = c2, o2 = (t3) => j(t3) ? t3.slice(0, s2) : t3, a2 = /* @__PURE__ */ new Set(), c2 = (function t3(e3, i3) {
|
|
@@ -27346,7 +27346,7 @@ var init_module = __esm({
|
|
|
27346
27346
|
a2.has(e4) || (r3[i4] = t3(e4));
|
|
27347
27347
|
}))), r3);
|
|
27348
27348
|
var r3;
|
|
27349
|
-
})(n2)), c2.timestamp = d2, N(null == i2 ? void 0 : i2.timestamp) || (c2.properties.$event_time_override_provided = true, c2.properties.$event_time_override_system_time =
|
|
27349
|
+
})(n2)), c2.timestamp = d2, N(null == i2 ? void 0 : i2.timestamp) || (c2.properties.$event_time_override_provided = true, c2.properties.$event_time_override_system_time = h5), t2 === hs.DISMISSED || t2 === hs.SENT) {
|
|
27350
27350
|
var b2 = null == e2 ? void 0 : e2[ds.SURVEY_ID], y2 = null == e2 ? void 0 : e2[ds.SURVEY_ITERATION];
|
|
27351
27351
|
((t3) => {
|
|
27352
27352
|
try {
|
|
@@ -27385,45 +27385,45 @@ var init_module = __esm({
|
|
|
27385
27385
|
}
|
|
27386
27386
|
calculateEventProperties(e2, i2, n2, o2, a2) {
|
|
27387
27387
|
if (n2 = n2 || /* @__PURE__ */ new Date(), !this.persistence || !this.sessionPersistence) return i2;
|
|
27388
|
-
var l2 = a2 ? void 0 : this.persistence.remove_event_timer(e2),
|
|
27389
|
-
if (
|
|
27388
|
+
var l2 = a2 ? void 0 : this.persistence.remove_event_timer(e2), h5 = f({}, i2);
|
|
27389
|
+
if (h5.token = this.config.token, h5.$config_defaults = this.config.defaults, this.Ri() && (h5.$cookieless_mode = true), "$snapshot" === e2) {
|
|
27390
27390
|
var d2 = f({}, this.persistence.properties(), this.sessionPersistence.properties());
|
|
27391
|
-
return
|
|
27391
|
+
return h5.distinct_id = d2.distinct_id, (!j(h5.distinct_id) && !q(h5.distinct_id) || z(h5.distinct_id)) && Le.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"), h5;
|
|
27392
27392
|
}
|
|
27393
27393
|
var c2, p2 = (function(e3, i3) {
|
|
27394
27394
|
var r2, n3, o3, a3;
|
|
27395
27395
|
if (!u) return {};
|
|
27396
|
-
var l3,
|
|
27396
|
+
var l3, h6, d3, c3, p3, f2, _3, g3, m3 = e3 ? [...jr, ...i3 || []] : [], [b3, y3] = (function(t2) {
|
|
27397
27397
|
for (var e4 = 0; Zt.length > e4; e4++) {
|
|
27398
27398
|
var [i4, r3] = Zt[e4], s2 = i4.exec(t2), n4 = s2 && (D(r3) ? r3(s2, t2) : r3);
|
|
27399
27399
|
if (n4) return n4;
|
|
27400
27400
|
}
|
|
27401
27401
|
return ["", ""];
|
|
27402
27402
|
})(u);
|
|
27403
|
-
return Xi(er({ $os: b3, $os_version: y3, $browser: Kt(u, navigator.vendor), $device: te(u), $device_type: (
|
|
27403
|
+
return Xi(er({ $os: b3, $os_version: y3, $browser: Kt(u, navigator.vendor), $device: te(u), $device_type: (h6 = u, d3 = { userAgentDataPlatform: null == (r2 = navigator) || null == (r2 = r2.userAgentData) ? void 0 : r2.platform, maxTouchPoints: null == (n3 = navigator) ? void 0 : n3.maxTouchPoints, screenWidth: null == t || null == (o3 = t.screen) ? void 0 : o3.width, screenHeight: null == t || null == (a3 = t.screen) ? void 0 : a3.height, devicePixelRatio: null == t ? void 0 : t.devicePixelRatio }, g3 = te(h6), g3 === dt || g3 === ht || "Kobo" === g3 || "Kindle Fire" === g3 || g3 === zt ? ut : g3 === Ot || g3 === Ct || g3 === It || g3 === Lt ? "Console" : g3 === ct ? "Wearable" : g3 ? ot : "Android" === (null == d3 ? void 0 : d3.userAgentDataPlatform) && (null !== (c3 = null == d3 ? void 0 : d3.maxTouchPoints) && void 0 !== c3 ? c3 : 0) > 0 ? 600 > Math.min(null !== (p3 = null == d3 ? void 0 : d3.screenWidth) && void 0 !== p3 ? p3 : 0, null !== (f2 = null == d3 ? void 0 : d3.screenHeight) && void 0 !== f2 ? f2 : 0) / (null !== (_3 = null == d3 ? void 0 : d3.devicePixelRatio) && void 0 !== _3 ? _3 : 1) ? ot : ut : "Desktop"), $timezone: Qr(), $timezone_offset: Zr() }), { $current_url: Ur(null == s ? void 0 : s.href, m3, Br), $host: null == s ? void 0 : s.host, $pathname: null == s ? void 0 : s.pathname, $raw_user_agent: u.length > 1e3 ? u.substring(0, 997) + "..." : u, $browser_version: Qt(u, navigator.vendor), $browser_language: Gr(), $browser_language_prefix: (l3 = Gr(), "string" == typeof l3 ? l3.split("-")[0] : void 0), $screen_height: null == t ? void 0 : t.screen.height, $screen_width: null == t ? void 0 : t.screen.width, $viewport_height: null == t ? void 0 : t.innerHeight, $viewport_width: null == t ? void 0 : t.innerWidth, $lib: v.LIB_NAME, $lib_version: v.LIB_VERSION, $insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10), $time: Date.now() / 1e3 });
|
|
27404
27404
|
})(this.config.mask_personal_data_properties, this.config.custom_personal_data_properties);
|
|
27405
27405
|
if (this.sessionManager) {
|
|
27406
27406
|
var { sessionId: _2, windowId: g2 } = this.sessionManager.checkAndGetSessionAndWindowId(a2, n2.getTime());
|
|
27407
|
-
|
|
27407
|
+
h5.$session_id = _2, h5.$window_id = g2;
|
|
27408
27408
|
}
|
|
27409
|
-
this.sessionPropsManager && Xi(
|
|
27409
|
+
this.sessionPropsManager && Xi(h5, this.sessionPropsManager.getSessionProps());
|
|
27410
27410
|
try {
|
|
27411
27411
|
var m2;
|
|
27412
|
-
this.sessionRecording && Xi(
|
|
27412
|
+
this.sessionRecording && Xi(h5, this.sessionRecording.sdkDebugProperties), h5.$sdk_debug_retry_queue_size = null == (m2 = this.zi) ? void 0 : m2.length;
|
|
27413
27413
|
} catch (t2) {
|
|
27414
|
-
|
|
27414
|
+
h5.$sdk_debug_error_capturing_properties = String(t2);
|
|
27415
27415
|
}
|
|
27416
|
-
if (this.requestRouter.region === Rn && (
|
|
27416
|
+
if (this.requestRouter.region === Rn && (h5.$lib_custom_api_host = this.config.api_host), c2 = e2 !== Vi || a2 ? e2 !== Wi || a2 ? this.pageViewManager.doEvent() : this.pageViewManager.doPageLeave(n2) : this.pageViewManager.doPageView(n2, o2), h5 = Xi(h5, c2), e2 === Vi && r && (h5.title = r.title), !N(l2)) {
|
|
27417
27417
|
var b2 = n2.getTime() - l2;
|
|
27418
|
-
|
|
27418
|
+
h5.$duration = parseFloat((b2 / 1e3).toFixed(3));
|
|
27419
27419
|
}
|
|
27420
|
-
u && this.config.opt_out_useragent_filter && (
|
|
27421
|
-
delete
|
|
27420
|
+
u && this.config.opt_out_useragent_filter && (h5.$browser_type = this._is_bot() ? "bot" : "browser"), (h5 = Xi({}, p2, this.persistence.properties(), this.sessionPersistence.properties(), h5)).$is_identified = this._isIdentified(), M2(this.config.property_denylist) ? Ki(this.config.property_denylist, (function(t2) {
|
|
27421
|
+
delete h5[t2];
|
|
27422
27422
|
})) : Le.error(Wn + this.config.property_denylist + " or property_blacklist config: " + this.config.property_blacklist);
|
|
27423
27423
|
var y2 = this.config.sanitize_properties;
|
|
27424
|
-
y2 && (Le.error(Vn),
|
|
27424
|
+
y2 && (Le.error(Vn), h5 = y2(h5, e2));
|
|
27425
27425
|
var w2 = this.nn();
|
|
27426
|
-
return
|
|
27426
|
+
return h5.$process_person_profile = w2, w2 && !a2 && this.sn("_calculate_event_properties"), h5;
|
|
27427
27427
|
}
|
|
27428
27428
|
tn(t2, e2, i2) {
|
|
27429
27429
|
var r2;
|
|
@@ -27582,8 +27582,8 @@ var init_module = __esm({
|
|
|
27582
27582
|
var u2 = this.get_property(He);
|
|
27583
27583
|
if (this.consent.reset(), null == (e2 = this.persistence) || e2.clear(), null == (i2 = this.sessionPersistence) || i2.clear(), null == (r2 = this.surveys) || r2.reset(), null == (s2 = this.Yi) || s2.stop(), null == (n2 = this.featureFlags) || n2.reset(), null == (o2 = this.conversations) || o2.reset(), null == (a2 = this.persistence) || a2.set_property($i, ji), null == (l2 = this.sessionManager) || l2.resetSessionId(), this.$i = null, this.config.cookieless_mode === Ni) this.register_once({ distinct_id: Ai, $device_id: null }, "");
|
|
27584
27584
|
else {
|
|
27585
|
-
var
|
|
27586
|
-
this.register_once({ distinct_id:
|
|
27585
|
+
var h5 = this.config.get_device_id(dr());
|
|
27586
|
+
this.register_once({ distinct_id: h5, $device_id: t2 ? h5 : u2 }, "");
|
|
27587
27587
|
}
|
|
27588
27588
|
this.register({ $last_posthog_reset: (/* @__PURE__ */ new Date()).toISOString() }, 1), delete this.config.identity_distinct_id, delete this.config.identity_hash, this.reloadFeatureFlags();
|
|
27589
27589
|
}
|
|
@@ -27621,12 +27621,12 @@ var init_module = __esm({
|
|
|
27621
27621
|
set_config(t2) {
|
|
27622
27622
|
var e2 = f({}, this.config);
|
|
27623
27623
|
if (U(t2)) {
|
|
27624
|
-
var i2, r2, s2, n2, o2, a2, l2, u2,
|
|
27624
|
+
var i2, r2, s2, n2, o2, a2, l2, u2, h5, d2;
|
|
27625
27625
|
Xi(this.config, Xn(t2));
|
|
27626
27626
|
var c2 = this.Hi();
|
|
27627
27627
|
null == (i2 = this.persistence) || i2.update_config(this.config, e2, c2), this.sessionPersistence = "sessionStorage" === this.config.persistence || "memory" === this.config.persistence ? this.persistence : new es(f({}, this.config, { persistence: "sessionStorage" }), c2);
|
|
27628
27628
|
var p2 = this.Di(this.config.debug);
|
|
27629
|
-
W(p2) && (this.config.debug = p2), W(this.config.debug) && (this.config.debug ? (v.DEBUG = true, gr.R() && gr.N("ph_debug", true), Le.info("set_config", { config: t2, oldConfig: e2, newConfig: f({}, this.config) })) : (v.DEBUG = false, gr.R() && gr.q("ph_debug"))), null == (r2 = this.exceptionObserver) || r2.onConfigChange(), null == (s2 = this.exceptions) || s2.onConfigChange(), null == (n2 = this.sessionRecording) || n2.startIfEnabledOrStop(), null == (o2 = this.autocapture) || o2.startIfEnabled(), null == (a2 = this.heatmaps) || a2.startIfEnabled(), null == (l2 = this.exceptionObserver) || l2.startIfEnabledOrStop(), null == (u2 = this.deadClicksAutocapture) || u2.startIfEnabledOrStop(), null == (
|
|
27629
|
+
W(p2) && (this.config.debug = p2), W(this.config.debug) && (this.config.debug ? (v.DEBUG = true, gr.R() && gr.N("ph_debug", true), Le.info("set_config", { config: t2, oldConfig: e2, newConfig: f({}, this.config) })) : (v.DEBUG = false, gr.R() && gr.q("ph_debug"))), null == (r2 = this.exceptionObserver) || r2.onConfigChange(), null == (s2 = this.exceptions) || s2.onConfigChange(), null == (n2 = this.sessionRecording) || n2.startIfEnabledOrStop(), null == (o2 = this.autocapture) || o2.startIfEnabled(), null == (a2 = this.heatmaps) || a2.startIfEnabled(), null == (l2 = this.exceptionObserver) || l2.startIfEnabledOrStop(), null == (u2 = this.deadClicksAutocapture) || u2.startIfEnabledOrStop(), null == (h5 = this.surveys) || h5.loadIfEnabled(), this.cn(), null == (d2 = this.externalIntegrations) || d2.startIfEnabledOrStop();
|
|
27630
27630
|
}
|
|
27631
27631
|
}
|
|
27632
27632
|
_overrideSDKInfo(t2, e2) {
|
|
@@ -27722,8 +27722,8 @@ var init_module = __esm({
|
|
|
27722
27722
|
var a2, l2 = null !== (s2 = null == (n2 = this.config.__extensionClasses) ? void 0 : n2.sessionRecording) && void 0 !== s2 ? s2 : null == (o2 = _Zn.__defaultExtensionClasses) ? void 0 : o2.sessionRecording;
|
|
27723
27723
|
l2 && (this.sessionRecording = this.Mi(this.sessionRecording, new l2(this)), this.Qi && (null == (a2 = this.sessionRecording) || null == a2.onRemoteConfig || a2.onRemoteConfig(this.Qi)));
|
|
27724
27724
|
}
|
|
27725
|
-
var u2,
|
|
27726
|
-
this.consent.optInOut(true), this.cn(), this.Ji(), null == (e2 = this.sessionRecording) || e2.startIfEnabledOrStop(), this.config.cookieless_mode == Li && (null == (u2 = this.surveys) || u2.loadIfEnabled()), (N(null == t2 ? void 0 : t2.captureEventName) || null != t2 && t2.captureEventName) && this.capture(null !== (
|
|
27725
|
+
var u2, h5;
|
|
27726
|
+
this.consent.optInOut(true), this.cn(), this.Ji(), null == (e2 = this.sessionRecording) || e2.startIfEnabledOrStop(), this.config.cookieless_mode == Li && (null == (u2 = this.surveys) || u2.loadIfEnabled()), (N(null == t2 ? void 0 : t2.captureEventName) || null != t2 && t2.captureEventName) && this.capture(null !== (h5 = null == t2 ? void 0 : t2.captureEventName) && void 0 !== h5 ? h5 : "$opt_in", null == t2 ? void 0 : t2.captureProperties, { send_instantly: true }), this.config.capture_pageview && this.Ki();
|
|
27727
27727
|
} else Le.warn(Hn);
|
|
27728
27728
|
}
|
|
27729
27729
|
opt_out_capturing() {
|
|
@@ -28018,8 +28018,8 @@ var init_module = __esm({
|
|
|
28018
28018
|
r2.info("event matched, removing item from activated items", { event: t2, eventPayload: e2, existingActivatedItems: o2 });
|
|
28019
28019
|
var u2 = (null == e2 || null == (a2 = e2.properties) ? void 0 : a2.$survey_id) || (null == e2 || null == (l2 = e2.properties) ? void 0 : l2.$product_tour_id);
|
|
28020
28020
|
if (u2) {
|
|
28021
|
-
var
|
|
28022
|
-
0 >
|
|
28021
|
+
var h5 = o2.indexOf(u2);
|
|
28022
|
+
0 > h5 || (o2.splice(h5, 1), this.qn(o2));
|
|
28023
28023
|
}
|
|
28024
28024
|
} else {
|
|
28025
28025
|
if (this.En.has(t2)) {
|
|
@@ -28188,7 +28188,7 @@ var init_module = __esm({
|
|
|
28188
28188
|
if (H(t2.conditions) || H(null == (e2 = t2.conditions) ? void 0 : e2.utm)) return true;
|
|
28189
28189
|
var i2 = qr();
|
|
28190
28190
|
if (i2.utm_source) {
|
|
28191
|
-
var r2, s2, n2, o2, a2, l2, u2,
|
|
28191
|
+
var r2, s2, n2, o2, a2, l2, u2, h5, d2 = null == (r2 = t2.conditions) || null == (r2 = r2.utm) || !r2.utm_campaign || (null == (s2 = t2.conditions) || null == (s2 = s2.utm) ? void 0 : s2.utm_campaign) == i2.utm_campaign, v2 = null == (n2 = t2.conditions) || null == (n2 = n2.utm) || !n2.utm_source || (null == (o2 = t2.conditions) || null == (o2 = o2.utm) ? void 0 : o2.utm_source) == i2.utm_source, c2 = null == (a2 = t2.conditions) || null == (a2 = a2.utm) || !a2.utm_medium || (null == (l2 = t2.conditions) || null == (l2 = l2.utm) ? void 0 : l2.utm_medium) == i2.utm_medium, p2 = null == (u2 = t2.conditions) || null == (u2 = u2.utm) || !u2.utm_term || (null == (h5 = t2.conditions) || null == (h5 = h5.utm) ? void 0 : h5.utm_term) == i2.utm_term;
|
|
28192
28192
|
return d2 && c2 && p2 && v2;
|
|
28193
28193
|
}
|
|
28194
28194
|
return false;
|
|
@@ -28256,8 +28256,8 @@ var init_module = __esm({
|
|
|
28256
28256
|
updateFlags(t2, e2, i2) {
|
|
28257
28257
|
var r2 = null != i2 && i2.merge ? this.getFlagVariants() : {}, s2 = null != i2 && i2.merge ? this.getFlagPayloads() : {}, n2 = f({}, r2, t2), o2 = f({}, s2, e2), a2 = {};
|
|
28258
28258
|
for (var [l2, u2] of Object.entries(n2)) {
|
|
28259
|
-
var
|
|
28260
|
-
a2[l2] = { key: l2, enabled: !!
|
|
28259
|
+
var h5 = "string" == typeof u2;
|
|
28260
|
+
a2[l2] = { key: l2, enabled: !!h5 || Boolean(u2), variant: h5 ? u2 : void 0, reason: void 0, metadata: N(null == o2 ? void 0 : o2[l2]) ? void 0 : { id: 0, version: void 0, description: void 0, payload: o2[l2] } };
|
|
28261
28261
|
}
|
|
28262
28262
|
this.receivedFeatureFlags({ flags: a2 });
|
|
28263
28263
|
}
|
|
@@ -28272,8 +28272,8 @@ var init_module = __esm({
|
|
|
28272
28272
|
if (!i2 && !e2) return t2 || {};
|
|
28273
28273
|
var r2 = Xi({}, t2 || {}), s2 = [.../* @__PURE__ */ new Set([...Object.keys(i2 || {}), ...Object.keys(e2 || {})])];
|
|
28274
28274
|
for (var n2 of s2) {
|
|
28275
|
-
var o2, a2, l2 = r2[n2], u2 = null == e2 ? void 0 : e2[n2],
|
|
28276
|
-
|
|
28275
|
+
var o2, a2, l2 = r2[n2], u2 = null == e2 ? void 0 : e2[n2], h5 = N(u2) ? null !== (o2 = null == l2 ? void 0 : l2.enabled) && void 0 !== o2 && o2 : !!u2, d2 = N(u2) ? l2.variant : "string" == typeof u2 ? u2 : void 0, v2 = null == i2 ? void 0 : i2[n2], c2 = f({}, l2, { enabled: h5, variant: h5 ? null != d2 ? d2 : null == l2 ? void 0 : l2.variant : void 0 });
|
|
28276
|
+
h5 !== (null == l2 ? void 0 : l2.enabled) && (c2.original_enabled = null == l2 ? void 0 : l2.enabled), d2 !== (null == l2 ? void 0 : l2.variant) && (c2.original_variant = null == l2 ? void 0 : l2.variant), v2 && (c2.metadata = f({}, null == l2 ? void 0 : l2.metadata, { payload: v2, original_payload: null == l2 || null == (a2 = l2.metadata) ? void 0 : a2.payload })), r2[n2] = c2;
|
|
28277
28277
|
}
|
|
28278
28278
|
return this.Kn || (ca.warn(" Overriding feature flag details!", { flagDetails: t2, overriddenPayloads: i2, finalDetails: r2 }), this.Kn = true), r2;
|
|
28279
28279
|
}
|
|
@@ -28347,8 +28347,8 @@ var init_module = __esm({
|
|
|
28347
28347
|
if (!this.ls()) {
|
|
28348
28348
|
var i2 = this.getFlagVariants(), r2 = t2 in i2, s2 = i2[t2], n2 = this.getFlagPayloads()[t2], o2 = String(s2), a2 = this.os(ci) || void 0, l2 = this.os(Si) || void 0, u2 = this.os(wi) || {};
|
|
28349
28349
|
if (this.qt.advanced_feature_flags_dedup_per_session) {
|
|
28350
|
-
var
|
|
28351
|
-
d2 && d2 !== v2 && (u2 = {}, null == (
|
|
28350
|
+
var h5, d2 = this._instance.get_session_id(), v2 = this.os(xi);
|
|
28351
|
+
d2 && d2 !== v2 && (u2 = {}, null == (h5 = this.ni) || h5.register({ [wi]: u2, [xi]: d2 }));
|
|
28352
28352
|
}
|
|
28353
28353
|
if ((e2.send_event || !("send_event" in e2)) && (!(t2 in u2) || !u2[t2].includes(o2))) {
|
|
28354
28354
|
var c2, p2, f2, _2, g2, m2, b2, y2, w2, x2;
|
|
@@ -28413,7 +28413,7 @@ var init_module = __esm({
|
|
|
28413
28413
|
})))) : ca.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"), t4;
|
|
28414
28414
|
})(t3), a2 = o2.flags, l2 = o2.featureFlags, u2 = o2.featureFlagPayloads;
|
|
28415
28415
|
if (l2) {
|
|
28416
|
-
var
|
|
28416
|
+
var h5 = t3.requestId, d2 = t3.evaluatedAt;
|
|
28417
28417
|
if (M2(l2)) {
|
|
28418
28418
|
ca.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");
|
|
28419
28419
|
var v2 = {};
|
|
@@ -28438,7 +28438,7 @@ var init_module = __esm({
|
|
|
28438
28438
|
return m2.has(e4);
|
|
28439
28439
|
}))));
|
|
28440
28440
|
} else p2 = f({}, i3, p2), _2 = f({}, r3, _2), g2 = f({}, s3, g2);
|
|
28441
|
-
e3 && e3.register(f({ [ui]: Object.keys(ga(p2)), [li]: p2 || {}, [vi]: _2 || {}, [di]: g2 || {} },
|
|
28441
|
+
e3 && e3.register(f({ [ui]: Object.keys(ga(p2)), [li]: p2 || {}, [vi]: _2 || {}, [di]: g2 || {} }, h5 ? { [ci]: h5 } : {}, d2 ? { [Si]: d2 } : {}));
|
|
28442
28442
|
}
|
|
28443
28443
|
}
|
|
28444
28444
|
})(t2, this.ni, r2, s2, n2, i2), e2 || (this.ss = false), this.ps(e2);
|
|
@@ -28565,7 +28565,7 @@ var init_module = __esm({
|
|
|
28565
28565
|
}
|
|
28566
28566
|
xs(t2) {
|
|
28567
28567
|
var e2, i2, r2;
|
|
28568
|
-
this.ws && (this.bs !== Yo && this.bs !== Jo && (this.bs = Go), null !=
|
|
28568
|
+
this.ws && (this.bs !== Yo && this.bs !== Jo && (this.bs = Go), null != h4 && null != (e2 = h4.__PosthogExtensions__) && null != (e2 = e2.rrweb) && e2.record && null != (i2 = h4.__PosthogExtensions__) && i2.initSessionRecording ? this.Ss(t2) : null == (r2 = h4.__PosthogExtensions__) || null == r2.loadExternalDependency || r2.loadExternalDependency(this._instance, this.ks, ((e3) => {
|
|
28569
28569
|
if (e3) return Xo.error("could not load recorder", e3);
|
|
28570
28570
|
this.Ss(t2);
|
|
28571
28571
|
})));
|
|
@@ -28622,8 +28622,8 @@ var init_module = __esm({
|
|
|
28622
28622
|
}
|
|
28623
28623
|
Ss(t2) {
|
|
28624
28624
|
var e2, i2;
|
|
28625
|
-
if (null == (e2 =
|
|
28626
|
-
if (this.ys || (this.ys = null == (i2 =
|
|
28625
|
+
if (null == (e2 = h4.__PosthogExtensions__) || !e2.initSessionRecording) return Xo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."), void this._instance.register_for_session({ [Di]: true });
|
|
28626
|
+
if (this.ys || (this.ys = null == (i2 = h4.__PosthogExtensions__) ? void 0 : i2.initSessionRecording(this._instance), this.ys._forceAllowLocalhostNetworkCapture = this._forceAllowLocalhostNetworkCapture), !this.Ms()) {
|
|
28627
28627
|
if (this.bs === Jo || this.bs === Yo) return;
|
|
28628
28628
|
return this.bs = Yo, Xo.info("persisted remote config is stale, requesting fresh config before starting"), void new bs(this._instance).load();
|
|
28629
28629
|
}
|
|
@@ -28747,8 +28747,8 @@ var init_module = __esm({
|
|
|
28747
28747
|
if (null != (o3 = r3) && o3.url_allowlist && !uo(r3.url_allowlist)) return false;
|
|
28748
28748
|
if (null != (a3 = r3) && a3.url_ignorelist && uo(r3.url_ignorelist)) return false;
|
|
28749
28749
|
if (null != (l3 = r3) && l3.dom_event_allowlist) {
|
|
28750
|
-
var
|
|
28751
|
-
if (
|
|
28750
|
+
var h6 = r3.dom_event_allowlist;
|
|
28751
|
+
if (h6 && !h6.some(((t2) => i3.type === t2))) return false;
|
|
28752
28752
|
}
|
|
28753
28753
|
var { parentIsUsefulElement: d3, targetElementList: v2 } = wo(e3, s3);
|
|
28754
28754
|
if (!(function(t2, e4) {
|
|
@@ -28781,9 +28781,9 @@ var init_module = __esm({
|
|
|
28781
28781
|
if (a2) return false;
|
|
28782
28782
|
var l2 = this.getElementSelectors(s2);
|
|
28783
28783
|
if (l2 && l2.length > 0 && (o2.$element_selectors = l2), i2 === Do) {
|
|
28784
|
-
var u2,
|
|
28785
|
-
if (!
|
|
28786
|
-
o2.$selected_content =
|
|
28784
|
+
var u2, h5 = vo(null == t || null == (u2 = t.getSelection()) ? void 0 : u2.toString()), d2 = e2.type || "clipboard";
|
|
28785
|
+
if (!h5) return false;
|
|
28786
|
+
o2.$selected_content = h5, o2.$copy_type = d2;
|
|
28787
28787
|
}
|
|
28788
28788
|
return this.instance.capture(i2, o2), true;
|
|
28789
28789
|
}
|
|
@@ -28936,7 +28936,7 @@ var init_module = __esm({
|
|
|
28936
28936
|
}
|
|
28937
28937
|
}, this.so = () => {
|
|
28938
28938
|
if (!this.Ps) {
|
|
28939
|
-
var t3, e3, i2, r2, s2 =
|
|
28939
|
+
var t3, e3, i2, r2, s2 = h4.__PosthogExtensions__;
|
|
28940
28940
|
N(s2) || N(s2.postHogWebVitalsCallbacks) || ({ onLCP: t3, onCLS: e3, onFCP: i2, onINP: r2 } = s2.postHogWebVitalsCallbacks), t3 && e3 && i2 && r2 ? (this.allowedMetrics.indexOf("LCP") > -1 && t3(this.ht.bind(this)), this.allowedMetrics.indexOf("CLS") > -1 && e3(this.ht.bind(this)), this.allowedMetrics.indexOf("FCP") > -1 && i2(this.ht.bind(this)), this.allowedMetrics.indexOf("INP") > -1 && r2(this.ht.bind(this)), this.Ps = true) : qo.error("web vitals callbacks not loaded - not starting");
|
|
28941
28941
|
}
|
|
28942
28942
|
}, this._instance = t2, this.js = !(null == (e2 = this._instance.persistence) || !e2.props[Xe]), this.startIfEnabled();
|
|
@@ -28976,7 +28976,7 @@ var init_module = __esm({
|
|
|
28976
28976
|
}
|
|
28977
28977
|
lr(t2) {
|
|
28978
28978
|
var e2, i2;
|
|
28979
|
-
null != (e2 =
|
|
28979
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.postHogWebVitalsCallbacks ? t2() : null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, this.useAttribution ? "web-vitals-with-attribution" : "web-vitals", ((e3) => {
|
|
28980
28980
|
e3 ? qo.error("failed to load script", e3) : t2();
|
|
28981
28981
|
}));
|
|
28982
28982
|
}
|
|
@@ -28994,8 +28994,8 @@ var init_module = __esm({
|
|
|
28994
28994
|
var i2, r2, s2;
|
|
28995
28995
|
this.so = () => {
|
|
28996
28996
|
var e3;
|
|
28997
|
-
if (t && this.isEnabled && null != (e3 =
|
|
28998
|
-
var i3 =
|
|
28997
|
+
if (t && this.isEnabled && null != (e3 = h4.__PosthogExtensions__) && e3.errorWrappingFunctions) {
|
|
28998
|
+
var i3 = h4.__PosthogExtensions__.errorWrappingFunctions.wrapOnError, r3 = h4.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection, s3 = h4.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;
|
|
28999
28999
|
try {
|
|
29000
29000
|
!this.ao && this.qt.capture_unhandled_errors && (this.ao = i3(this.captureException.bind(this))), !this.uo && this.qt.capture_unhandled_rejections && (this.uo = r3(this.captureException.bind(this))), !this.lo && this.qt.capture_console_errors && (this.lo = s3(this.captureException.bind(this)));
|
|
29001
29001
|
} catch (t2) {
|
|
@@ -29016,7 +29016,7 @@ var init_module = __esm({
|
|
|
29016
29016
|
}
|
|
29017
29017
|
lr(t2) {
|
|
29018
29018
|
var e2, i2;
|
|
29019
|
-
null != (e2 =
|
|
29019
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.errorWrappingFunctions && t2(), null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, "exception-autocapture", ((e3) => {
|
|
29020
29020
|
if (e3) return zo.error("failed to load script", e3);
|
|
29021
29021
|
t2();
|
|
29022
29022
|
}));
|
|
@@ -29048,9 +29048,9 @@ var init_module = __esm({
|
|
|
29048
29048
|
var l2 = me.test(a2) ? a2.replace(me, "$1") : a2;
|
|
29049
29049
|
if (!l2.match(/\S*Error: /)) {
|
|
29050
29050
|
for (var u2 of i3) {
|
|
29051
|
-
var
|
|
29052
|
-
if (
|
|
29053
|
-
s2.push(
|
|
29051
|
+
var h5 = u2(l2, t3);
|
|
29052
|
+
if (h5) {
|
|
29053
|
+
s2.push(h5);
|
|
29054
29054
|
break;
|
|
29055
29055
|
}
|
|
29056
29056
|
}
|
|
@@ -29186,13 +29186,13 @@ var init_module = __esm({
|
|
|
29186
29186
|
}
|
|
29187
29187
|
lr(t2) {
|
|
29188
29188
|
var e2, i2;
|
|
29189
|
-
null != (e2 =
|
|
29189
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.generateProductTours ? t2() : null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, "product-tours", ((e3) => {
|
|
29190
29190
|
e3 ? ta.error("Could not load product tours script", e3) : t2();
|
|
29191
29191
|
}));
|
|
29192
29192
|
}
|
|
29193
29193
|
Po() {
|
|
29194
29194
|
var t2;
|
|
29195
|
-
!this.Eo && null != (t2 =
|
|
29195
|
+
!this.Eo && null != (t2 = h4.__PosthogExtensions__) && t2.generateProductTours && (this.Eo = h4.__PosthogExtensions__.generateProductTours(this._instance, true));
|
|
29196
29196
|
}
|
|
29197
29197
|
getProductTours(t2, e2) {
|
|
29198
29198
|
if (void 0 === e2 && (e2 = false), !M2(this.Mo) || e2) {
|
|
@@ -29269,7 +29269,7 @@ var init_module = __esm({
|
|
|
29269
29269
|
}
|
|
29270
29270
|
get siteAppLoaders() {
|
|
29271
29271
|
var t2;
|
|
29272
|
-
return null == (t2 =
|
|
29272
|
+
return null == (t2 = h4._POSTHOG_REMOTE_CONFIG) || null == (t2 = t2[this._instance.config.token]) ? void 0 : t2.siteApps;
|
|
29273
29273
|
}
|
|
29274
29274
|
initialize() {
|
|
29275
29275
|
if (this.isEnabled) {
|
|
@@ -29282,8 +29282,8 @@ var init_module = __esm({
|
|
|
29282
29282
|
globalsForEvent(t2) {
|
|
29283
29283
|
var e2, i2, r2, s2, n2, o2, a2;
|
|
29284
29284
|
if (!t2) throw new Error("Event payload is required");
|
|
29285
|
-
var l2 = {}, u2 = this._instance.get_property("$groups") || [],
|
|
29286
|
-
for (var [d2, v2] of Object.entries(
|
|
29285
|
+
var l2 = {}, u2 = this._instance.get_property("$groups") || [], h5 = this._instance.get_property("$stored_group_properties") || {};
|
|
29286
|
+
for (var [d2, v2] of Object.entries(h5)) l2[d2] = { id: u2[d2], type: d2, properties: v2 };
|
|
29287
29287
|
var { $set_once: c2, $set: p2 } = t2;
|
|
29288
29288
|
return { event: f({}, _(t2, ea), { properties: f({}, t2.properties, p2 ? { $set: f({}, null !== (e2 = null == (i2 = t2.properties) ? void 0 : i2.$set) && void 0 !== e2 ? e2 : {}, p2) } : {}, c2 ? { $set_once: f({}, null !== (r2 = null == (s2 = t2.properties) ? void 0 : s2.$set_once) && void 0 !== r2 ? r2 : {}, c2) } : {}), elements_chain: null !== (n2 = null == (o2 = t2.properties) ? void 0 : o2.$elements_chain) && void 0 !== n2 ? n2 : "", distinct_id: null == (a2 = t2.properties) ? void 0 : a2.distinct_id }), person: { properties: this._instance.get_property("$stored_person_properties") }, groups: l2 };
|
|
29289
29289
|
}
|
|
@@ -29329,7 +29329,7 @@ var init_module = __esm({
|
|
|
29329
29329
|
if (null == (i2 = this.Lo) || i2.call(this), null != (r2 = t2.siteApps) && r2.length) if (this.isEnabled) {
|
|
29330
29330
|
var n2 = function(t3) {
|
|
29331
29331
|
var e3;
|
|
29332
|
-
|
|
29332
|
+
h4["__$$ph_site_app_" + t3] = s2._instance, null == (e3 = h4.__PosthogExtensions__) || null == e3.loadSiteApp || e3.loadSiteApp(s2._instance, a2, ((e4) => {
|
|
29333
29333
|
if (e4) return ia.error(ra + t3, e4);
|
|
29334
29334
|
}));
|
|
29335
29335
|
};
|
|
@@ -29341,7 +29341,7 @@ var init_module = __esm({
|
|
|
29341
29341
|
constructor(t2) {
|
|
29342
29342
|
this.No = void 0, this.$o = void 0, this.so = () => {
|
|
29343
29343
|
var t3, e2, i2 = this.Do() || [];
|
|
29344
|
-
N(this.No) && (null == (t3 =
|
|
29344
|
+
N(this.No) && (null == (t3 = h4.__PosthogExtensions__) || null == (t3 = t3.tracingHeadersPatchFns) || t3._patchXHR(i2, this._instance.get_distinct_id(), this._instance.sessionManager)), N(this.$o) && (null == (e2 = h4.__PosthogExtensions__) || null == (e2 = e2.tracingHeadersPatchFns) || e2._patchFetch(i2, this._instance.get_distinct_id(), this._instance.sessionManager));
|
|
29345
29345
|
}, this._instance = t2;
|
|
29346
29346
|
}
|
|
29347
29347
|
initialize() {
|
|
@@ -29349,7 +29349,7 @@ var init_module = __esm({
|
|
|
29349
29349
|
}
|
|
29350
29350
|
lr(t2) {
|
|
29351
29351
|
var e2, i2;
|
|
29352
|
-
null != (e2 =
|
|
29352
|
+
null != (e2 = h4.__PosthogExtensions__) && e2.tracingHeadersPatchFns && t2(), null == (i2 = h4.__PosthogExtensions__) || null == i2.loadExternalDependency || i2.loadExternalDependency(this._instance, "tracing-headers", ((e3) => {
|
|
29353
29353
|
if (e3) return Ho.error("failed to load script", e3);
|
|
29354
29354
|
t2();
|
|
29355
29355
|
}));
|
|
@@ -29394,7 +29394,7 @@ var init_module = __esm({
|
|
|
29394
29394
|
else if (this.qt.disable_surveys) Cn.info(ua);
|
|
29395
29395
|
else if (this.qt.cookieless_mode && this._instance.consent.isOptedOut()) Cn.info("Not loading surveys in cookieless mode without consent.");
|
|
29396
29396
|
else {
|
|
29397
|
-
var t2 = null ==
|
|
29397
|
+
var t2 = null == h4 ? void 0 : h4.__PosthogExtensions__;
|
|
29398
29398
|
if (t2) {
|
|
29399
29399
|
if (!N(this.qo) || this.qt.advanced_enable_surveys) {
|
|
29400
29400
|
var e2 = this.qo || this.qt.advanced_enable_surveys;
|
|
@@ -29456,8 +29456,8 @@ var init_module = __esm({
|
|
|
29456
29456
|
return !(null == (e4 = t4.conditions) || null == (e4 = e4.actions) || null == (e4 = e4.values) || !e4.length);
|
|
29457
29457
|
})(t3))));
|
|
29458
29458
|
u2.length > 0 && (null == (a2 = this._surveyEventReceiver) || a2.register(u2)), null == (r3 = this._instance.persistence) || r3.register({ [mi]: l2 });
|
|
29459
|
-
var
|
|
29460
|
-
t2(l2,
|
|
29459
|
+
var h5 = { isLoaded: true };
|
|
29460
|
+
t2(l2, h5), null == i2 || i2({ surveys: l2, context: h5 });
|
|
29461
29461
|
} }));
|
|
29462
29462
|
}
|
|
29463
29463
|
Vo(t2) {
|
|
@@ -29544,11 +29544,11 @@ var init_module = __esm({
|
|
|
29544
29544
|
this.instance = t2;
|
|
29545
29545
|
}
|
|
29546
29546
|
Go(t2) {
|
|
29547
|
-
|
|
29547
|
+
h4.ph_toolbar_state = t2;
|
|
29548
29548
|
}
|
|
29549
29549
|
Qo() {
|
|
29550
29550
|
var t2;
|
|
29551
|
-
return null !== (t2 =
|
|
29551
|
+
return null !== (t2 = h4.ph_toolbar_state) && void 0 !== t2 ? t2 : 0;
|
|
29552
29552
|
}
|
|
29553
29553
|
initialize() {
|
|
29554
29554
|
return this.maybeLoadToolbar();
|
|
@@ -29573,7 +29573,7 @@ var init_module = __esm({
|
|
|
29573
29573
|
}
|
|
29574
29574
|
}
|
|
29575
29575
|
Jo(t2) {
|
|
29576
|
-
var e2 =
|
|
29576
|
+
var e2 = h4.ph_load_toolbar || h4.ph_load_editor;
|
|
29577
29577
|
!H(e2) && D(e2) ? e2(t2, this.instance) : va.warn("No toolbar load function found");
|
|
29578
29578
|
}
|
|
29579
29579
|
loadToolbar(e2) {
|
|
@@ -29583,7 +29583,7 @@ var init_module = __esm({
|
|
|
29583
29583
|
if (t.localStorage.setItem(da, JSON.stringify(f({}, n2, { source: void 0 }))), 2 === this.Qo()) this.Jo(n2);
|
|
29584
29584
|
else if (0 === this.Qo()) {
|
|
29585
29585
|
var o2;
|
|
29586
|
-
this.Go(1), null == (o2 =
|
|
29586
|
+
this.Go(1), null == (o2 = h4.__PosthogExtensions__) || null == o2.loadExternalDependency || o2.loadExternalDependency(this.instance, "toolbar", ((t2) => {
|
|
29587
29587
|
if (t2) return va.error("[Toolbar] Failed to load", t2), void this.Go(0);
|
|
29588
29588
|
this.Go(2), this.Jo(n2);
|
|
29589
29589
|
})), sr(t, "turbolinks:load", (() => {
|
|
@@ -29619,7 +29619,7 @@ var init_module = __esm({
|
|
|
29619
29619
|
}
|
|
29620
29620
|
loadIfEnabled() {
|
|
29621
29621
|
if (!(this._conversationsManager || this.Xo || this._instance.config.disable_conversations || nr(this._instance.config) || this._instance.config.cookieless_mode && this._instance.consent.isOptedOut())) {
|
|
29622
|
-
var t2 = null ==
|
|
29622
|
+
var t2 = null == h4 ? void 0 : h4.__PosthogExtensions__;
|
|
29623
29623
|
if (t2 && !N(this.Yo) && this.Yo) if (this.ea && this.ea.token) {
|
|
29624
29624
|
this.Xo = true;
|
|
29625
29625
|
try {
|
|
@@ -29736,7 +29736,7 @@ var init_module = __esm({
|
|
|
29736
29736
|
}
|
|
29737
29737
|
loadIfEnabled() {
|
|
29738
29738
|
if (this.ia && !this.na) {
|
|
29739
|
-
var t2 = null ==
|
|
29739
|
+
var t2 = null == h4 ? void 0 : h4.__PosthogExtensions__;
|
|
29740
29740
|
if (t2) {
|
|
29741
29741
|
var e2 = t2.loadExternalDependency;
|
|
29742
29742
|
e2 ? e2(this._instance, "logs", ((e3) => {
|
|
@@ -29752,13 +29752,13 @@ var init_module = __esm({
|
|
|
29752
29752
|
var a2 = null !== (e2 = null == (i2 = this._instance.config.logs) ? void 0 : i2.flushIntervalMs) && void 0 !== e2 ? e2 : 3e3, l2 = null !== (r2 = null == (s2 = this._instance.config.logs) ? void 0 : s2.maxLogsPerInterval) && void 0 !== r2 ? r2 : 1e3, u2 = Date.now();
|
|
29753
29753
|
if (a2 > u2 - this.aa || (this.aa = u2, this.oa = 0, this.ua = false), l2 > this.oa) {
|
|
29754
29754
|
this.oa++;
|
|
29755
|
-
var
|
|
29755
|
+
var h5 = (function(t3, e3) {
|
|
29756
29756
|
var i3 = t3.level || "info", { text: r3, number: s3 } = ie[i3] || re, n3 = String(Date.now()) + "000000", o3 = {};
|
|
29757
29757
|
e3.distinctId && (o3.posthogDistinctId = e3.distinctId), e3.sessionId && (o3.sessionId = e3.sessionId), e3.currentUrl && (o3["url.full"] = e3.currentUrl), e3.screenName && (o3["screen.name"] = e3.screenName), e3.appState && (o3["app.state"] = e3.appState), e3.activeFeatureFlags && e3.activeFeatureFlags.length > 0 && (o3.feature_flags = e3.activeFeatureFlags);
|
|
29758
29758
|
var a3 = f({}, o3, t3.attributes || {}), l3 = { timeUnixNano: n3, observedTimeUnixNano: n3, severityNumber: s3, severityText: r3, body: { stringValue: t3.body }, attributes: ne(a3) };
|
|
29759
29759
|
return t3.trace_id && (l3.traceId = t3.trace_id), t3.span_id && (l3.spanId = t3.span_id), N(t3.trace_flags) || (l3.flags = t3.trace_flags), l3;
|
|
29760
29760
|
})(t2, this.la());
|
|
29761
|
-
this.sa.push({ record:
|
|
29761
|
+
this.sa.push({ record: h5 }), (null !== (n2 = null == (o2 = this._instance.config.logs) ? void 0 : o2.maxBufferSize) && void 0 !== n2 ? n2 : 100) > this.sa.length ? this.ha() : this.flushLogs();
|
|
29762
29762
|
} else this.ua || (this.Gt.warn("captureLog dropping logs: exceeded " + l2 + " logs per " + a2 + "ms"), this.ua = true);
|
|
29763
29763
|
} else this.Gt.warn("captureLog requires a body");
|
|
29764
29764
|
}
|
|
@@ -29787,7 +29787,7 @@ var init_module = __esm({
|
|
|
29787
29787
|
var { sessionId: i2 } = this._instance.sessionManager.checkAndGetSessionAndWindowId(true);
|
|
29788
29788
|
e2.sessionId = i2;
|
|
29789
29789
|
}
|
|
29790
|
-
if (null !=
|
|
29790
|
+
if (null != h4 && null != (t2 = h4.location) && t2.href && (e2.currentUrl = h4.location.href), this._instance.featureFlags) {
|
|
29791
29791
|
var r2 = this._instance.featureFlags.getFlags();
|
|
29792
29792
|
r2 && r2.length > 0 && (e2.activeFeatureFlags = r2);
|
|
29793
29793
|
}
|
|
@@ -32609,240 +32609,1862 @@ var CommandSeparator = React11__namespace.forwardRef(
|
|
|
32609
32609
|
);
|
|
32610
32610
|
CommandSeparator.displayName = "CommandSeparator";
|
|
32611
32611
|
|
|
32612
|
-
// ../
|
|
32613
|
-
function
|
|
32614
|
-
|
|
32615
|
-
|
|
32616
|
-
|
|
32617
|
-
|
|
32618
|
-
|
|
32619
|
-
|
|
32620
|
-
const
|
|
32621
|
-
if (
|
|
32622
|
-
|
|
32623
|
-
|
|
32624
|
-
|
|
32625
|
-
|
|
32626
|
-
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
|
|
32630
|
-
|
|
32631
|
-
|
|
32632
|
-
const
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
|
|
32639
|
-
|
|
32640
|
-
|
|
32641
|
-
|
|
32642
|
-
|
|
32643
|
-
|
|
32644
|
-
|
|
32645
|
-
}
|
|
32646
|
-
var
|
|
32647
|
-
|
|
32648
|
-
|
|
32649
|
-
|
|
32650
|
-
(
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32654
|
-
|
|
32655
|
-
|
|
32656
|
-
|
|
32657
|
-
|
|
32658
|
-
|
|
32659
|
-
|
|
32660
|
-
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
|
|
32672
|
-
|
|
32673
|
-
|
|
32674
|
-
|
|
32675
|
-
onSelect: api.eventHandlers.onSelectStart,
|
|
32676
|
-
...props,
|
|
32677
|
-
children: [
|
|
32678
|
-
children,
|
|
32679
|
-
api.watermarkConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
32680
|
-
"div",
|
|
32681
|
-
{
|
|
32682
|
-
className: watermarkVariants(),
|
|
32683
|
-
"aria-hidden": "true",
|
|
32684
|
-
style: {
|
|
32685
|
-
opacity: api.watermarkConfig.opacity,
|
|
32686
|
-
transform: `rotate(${api.watermarkConfig.angle}deg)`,
|
|
32687
|
-
backgroundImage: `repeating-linear-gradient(
|
|
32688
|
-
${api.watermarkConfig.angle}deg,
|
|
32689
|
-
transparent,
|
|
32690
|
-
transparent 80px,
|
|
32691
|
-
currentColor 80px,
|
|
32692
|
-
currentColor 80px
|
|
32693
|
-
)`
|
|
32694
|
-
},
|
|
32695
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "100%", height: "100%", children: [
|
|
32696
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
32697
|
-
"pattern",
|
|
32698
|
-
{
|
|
32699
|
-
id: "rfr-watermark",
|
|
32700
|
-
x: "0",
|
|
32701
|
-
y: "0",
|
|
32702
|
-
width: "200",
|
|
32703
|
-
height: "200",
|
|
32704
|
-
patternUnits: "userSpaceOnUse",
|
|
32705
|
-
patternTransform: `rotate(${api.watermarkConfig.angle})`,
|
|
32706
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
32707
|
-
"text",
|
|
32708
|
-
{
|
|
32709
|
-
x: "0",
|
|
32710
|
-
y: "100",
|
|
32711
|
-
fill: "currentColor",
|
|
32712
|
-
fontSize: "16",
|
|
32713
|
-
fontFamily: "sans-serif",
|
|
32714
|
-
children: api.watermarkConfig.text
|
|
32715
|
-
}
|
|
32716
|
-
)
|
|
32717
|
-
}
|
|
32718
|
-
) }),
|
|
32719
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", fill: "url(#rfr-watermark)" })
|
|
32720
|
-
] })
|
|
32721
|
-
}
|
|
32722
|
-
)
|
|
32723
|
-
]
|
|
32724
|
-
}
|
|
32725
|
-
);
|
|
32726
|
-
}
|
|
32727
|
-
);
|
|
32728
|
-
ContentProtection.displayName = "ContentProtection";
|
|
32729
|
-
|
|
32730
|
-
// ../data-table/dist/index.js
|
|
32731
|
-
function createDataTable(props) {
|
|
32732
|
-
const {
|
|
32733
|
-
columns,
|
|
32734
|
-
data,
|
|
32735
|
-
sortBy: initialSortBy,
|
|
32736
|
-
sortDir: initialSortDir = "asc",
|
|
32737
|
-
onSort,
|
|
32738
|
-
filters: initialFilters
|
|
32739
|
-
} = props;
|
|
32740
|
-
let sortBy = initialSortBy ?? null;
|
|
32741
|
-
let sortDir = initialSortDir;
|
|
32742
|
-
let filters = { ...initialFilters ?? {} };
|
|
32743
|
-
function getFilteredData() {
|
|
32744
|
-
let result = [...data];
|
|
32745
|
-
for (const [columnId, filterValue] of Object.entries(filters)) {
|
|
32746
|
-
if (!filterValue) continue;
|
|
32747
|
-
const col = columns.find((c2) => c2.id === columnId);
|
|
32748
|
-
if (!col) continue;
|
|
32749
|
-
const lowerFilter = filterValue.toLowerCase();
|
|
32750
|
-
result = result.filter((row) => {
|
|
32751
|
-
const cellValue = col.accessor(row);
|
|
32752
|
-
return String(cellValue ?? "").toLowerCase().includes(lowerFilter);
|
|
32753
|
-
});
|
|
32754
|
-
}
|
|
32755
|
-
return result;
|
|
32612
|
+
// ../conversation/dist/index.js
|
|
32613
|
+
function byTime(a2, b2) {
|
|
32614
|
+
return a2.timestamp.getTime() - b2.timestamp.getTime();
|
|
32615
|
+
}
|
|
32616
|
+
function findMessage(messages, id) {
|
|
32617
|
+
return messages.find((m2) => m2.id === id);
|
|
32618
|
+
}
|
|
32619
|
+
function rootIdOf(messages, id) {
|
|
32620
|
+
const m2 = findMessage(messages, id);
|
|
32621
|
+
if (!m2) return id;
|
|
32622
|
+
return m2.parentId ?? m2.id;
|
|
32623
|
+
}
|
|
32624
|
+
function selectRoots(messages) {
|
|
32625
|
+
return messages.filter((m2) => !m2.parentId).sort(byTime);
|
|
32626
|
+
}
|
|
32627
|
+
function selectReplies(messages, rootId) {
|
|
32628
|
+
return messages.filter((m2) => m2.parentId === rootId).sort(byTime);
|
|
32629
|
+
}
|
|
32630
|
+
function selectThreadMessages(messages, rootId) {
|
|
32631
|
+
const root = findMessage(messages, rootId);
|
|
32632
|
+
const replies = selectReplies(messages, rootId);
|
|
32633
|
+
return root ? [root, ...replies] : replies;
|
|
32634
|
+
}
|
|
32635
|
+
function getReplyCount(messages, rootId) {
|
|
32636
|
+
return messages.reduce((n2, m2) => m2.parentId === rootId ? n2 + 1 : n2, 0);
|
|
32637
|
+
}
|
|
32638
|
+
function selectMainTimeline(messages, mode) {
|
|
32639
|
+
if (mode === "panel") return selectRoots(messages);
|
|
32640
|
+
return [...messages].sort(byTime);
|
|
32641
|
+
}
|
|
32642
|
+
function selectTimelineFromState(state) {
|
|
32643
|
+
return selectMainTimeline(state.messages, state.threadingMode);
|
|
32644
|
+
}
|
|
32645
|
+
var DEFAULT_ASSISTANT = { id: "assistant", name: "Assistant" };
|
|
32646
|
+
var DEFAULT_USER = { id: "user", name: "You" };
|
|
32647
|
+
var DEFAULT_TITLE = "New conversation";
|
|
32648
|
+
function defaultGenerateTitle(firstMessage) {
|
|
32649
|
+
const firstLine = firstMessage.split("\n", 1)[0].trim();
|
|
32650
|
+
if (firstLine.length <= 48) return firstLine || DEFAULT_TITLE;
|
|
32651
|
+
return `${firstLine.slice(0, 47).trimEnd()}\u2026`;
|
|
32652
|
+
}
|
|
32653
|
+
function createConversation(config = {}) {
|
|
32654
|
+
const assistant = config.assistant ?? DEFAULT_ASSISTANT;
|
|
32655
|
+
const currentUser = config.currentUser ?? DEFAULT_USER;
|
|
32656
|
+
const generateTitle = config.generateTitle ?? defaultGenerateTitle;
|
|
32657
|
+
let transport = config.transport;
|
|
32658
|
+
let threadingMode = config.threadingMode ?? "inline";
|
|
32659
|
+
const conversations = /* @__PURE__ */ new Map();
|
|
32660
|
+
const messagesByConv = /* @__PURE__ */ new Map();
|
|
32661
|
+
let activeConversationId = config.activeConversationId ?? null;
|
|
32662
|
+
let openThreadRootId = null;
|
|
32663
|
+
let status = "idle";
|
|
32664
|
+
let error = null;
|
|
32665
|
+
let abortController = null;
|
|
32666
|
+
for (const c2 of config.conversations ?? []) {
|
|
32667
|
+
conversations.set(c2.id, c2);
|
|
32668
|
+
messagesByConv.set(c2.id, []);
|
|
32669
|
+
}
|
|
32670
|
+
for (const [conversationId, msgs] of Object.entries(config.messages ?? {})) {
|
|
32671
|
+
messagesByConv.set(conversationId, [...msgs]);
|
|
32672
|
+
}
|
|
32673
|
+
if (activeConversationId === null && config.conversations?.length) {
|
|
32674
|
+
activeConversationId = config.conversations[0].id;
|
|
32756
32675
|
}
|
|
32757
|
-
|
|
32758
|
-
|
|
32759
|
-
|
|
32760
|
-
|
|
32761
|
-
|
|
32762
|
-
|
|
32763
|
-
|
|
32764
|
-
|
|
32765
|
-
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
32769
|
-
});
|
|
32676
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
32677
|
+
let snapshot = buildSnapshot();
|
|
32678
|
+
function buildSnapshot() {
|
|
32679
|
+
return {
|
|
32680
|
+
conversations: orderedConversations(),
|
|
32681
|
+
activeConversationId,
|
|
32682
|
+
messages: activeConversationId ? messagesByConv.get(activeConversationId) ?? [] : [],
|
|
32683
|
+
openThreadRootId,
|
|
32684
|
+
threadingMode,
|
|
32685
|
+
status,
|
|
32686
|
+
error
|
|
32687
|
+
};
|
|
32770
32688
|
}
|
|
32771
|
-
function
|
|
32772
|
-
|
|
32773
|
-
|
|
32774
|
-
if (sortBy === columnId) {
|
|
32775
|
-
sortDir = sortDir === "asc" ? "desc" : "asc";
|
|
32776
|
-
} else {
|
|
32777
|
-
sortBy = columnId;
|
|
32778
|
-
sortDir = "asc";
|
|
32779
|
-
}
|
|
32780
|
-
onSort?.(sortBy, sortDir);
|
|
32689
|
+
function emit2() {
|
|
32690
|
+
snapshot = buildSnapshot();
|
|
32691
|
+
for (const l2 of listeners) l2();
|
|
32781
32692
|
}
|
|
32782
|
-
function
|
|
32783
|
-
|
|
32693
|
+
function orderedConversations() {
|
|
32694
|
+
return [...conversations.values()].sort(
|
|
32695
|
+
(a2, b2) => b2.updatedAt.getTime() - a2.updatedAt.getTime()
|
|
32696
|
+
);
|
|
32784
32697
|
}
|
|
32785
|
-
function
|
|
32786
|
-
const
|
|
32787
|
-
|
|
32698
|
+
function touch(conversationId) {
|
|
32699
|
+
const c2 = conversations.get(conversationId);
|
|
32700
|
+
if (c2) conversations.set(conversationId, { ...c2, updatedAt: /* @__PURE__ */ new Date() });
|
|
32701
|
+
}
|
|
32702
|
+
function ensureActiveConversation(opts) {
|
|
32703
|
+
if (opts?.conversationId) {
|
|
32704
|
+
if (!conversations.has(opts.conversationId)) createConversationInternal({}, opts.conversationId);
|
|
32705
|
+
return opts.conversationId;
|
|
32706
|
+
}
|
|
32707
|
+
if (activeConversationId && conversations.has(activeConversationId)) return activeConversationId;
|
|
32708
|
+
return createConversationInternal({}).id;
|
|
32709
|
+
}
|
|
32710
|
+
function createConversationInternal(opts, id) {
|
|
32711
|
+
const now = /* @__PURE__ */ new Date();
|
|
32712
|
+
const conversation = {
|
|
32713
|
+
id: id ?? generateId("rfr-conv"),
|
|
32714
|
+
title: opts.title ?? DEFAULT_TITLE,
|
|
32715
|
+
createdAt: now,
|
|
32716
|
+
updatedAt: now,
|
|
32717
|
+
metadata: opts.metadata
|
|
32788
32718
|
};
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
|
-
|
|
32719
|
+
conversations.set(conversation.id, conversation);
|
|
32720
|
+
messagesByConv.set(conversation.id, []);
|
|
32721
|
+
activeConversationId = conversation.id;
|
|
32722
|
+
return conversation;
|
|
32723
|
+
}
|
|
32724
|
+
async function streamReply(conversationId, assistantMsg, userMsg, history) {
|
|
32725
|
+
abortController = new AbortController();
|
|
32726
|
+
status = "streaming";
|
|
32727
|
+
emit2();
|
|
32728
|
+
try {
|
|
32729
|
+
const stream = transport.send({
|
|
32730
|
+
conversationId,
|
|
32731
|
+
message: userMsg,
|
|
32732
|
+
history,
|
|
32733
|
+
parentId: assistantMsg.parentId,
|
|
32734
|
+
signal: abortController.signal
|
|
32735
|
+
});
|
|
32736
|
+
for await (const chunk of stream) {
|
|
32737
|
+
if (chunk.content !== void 0) assistantMsg.content = chunk.content;
|
|
32738
|
+
if (chunk.delta) assistantMsg.content += chunk.delta;
|
|
32739
|
+
if (chunk.metadata) {
|
|
32740
|
+
assistantMsg.metadata = { ...assistantMsg.metadata, ...chunk.metadata };
|
|
32741
|
+
}
|
|
32742
|
+
emit2();
|
|
32743
|
+
if (abortController.signal.aborted) break;
|
|
32744
|
+
}
|
|
32745
|
+
assistantMsg.status = "sent";
|
|
32746
|
+
status = "idle";
|
|
32747
|
+
error = null;
|
|
32748
|
+
} catch (err) {
|
|
32749
|
+
if (abortController.signal.aborted) {
|
|
32750
|
+
assistantMsg.status = "sent";
|
|
32751
|
+
status = "idle";
|
|
32792
32752
|
} else {
|
|
32793
|
-
|
|
32753
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
32754
|
+
assistantMsg.status = "error";
|
|
32755
|
+
assistantMsg.error = message;
|
|
32756
|
+
status = "error";
|
|
32757
|
+
error = message;
|
|
32794
32758
|
}
|
|
32759
|
+
} finally {
|
|
32760
|
+
abortController = null;
|
|
32761
|
+
touch(conversationId);
|
|
32762
|
+
emit2();
|
|
32795
32763
|
}
|
|
32796
|
-
return props2;
|
|
32797
32764
|
}
|
|
32798
|
-
function
|
|
32799
|
-
|
|
32800
|
-
|
|
32801
|
-
"data-column": col.id
|
|
32802
|
-
};
|
|
32803
|
-
}
|
|
32804
|
-
function getRowProps(_row, index) {
|
|
32805
|
-
return {
|
|
32806
|
-
role: "row",
|
|
32807
|
-
"data-row-index": index
|
|
32808
|
-
};
|
|
32765
|
+
function historyFor(list, parentId) {
|
|
32766
|
+
const scope = parentId ? selectThreadMessages(list, parentId) : selectRoots(list);
|
|
32767
|
+
return scope.filter((m2) => m2.status !== "error");
|
|
32809
32768
|
}
|
|
32810
|
-
|
|
32811
|
-
|
|
32812
|
-
return
|
|
32813
|
-
|
|
32814
|
-
|
|
32815
|
-
|
|
32816
|
-
|
|
32817
|
-
|
|
32818
|
-
|
|
32819
|
-
|
|
32820
|
-
|
|
32821
|
-
|
|
32822
|
-
|
|
32823
|
-
|
|
32824
|
-
|
|
32769
|
+
const api = {
|
|
32770
|
+
getState() {
|
|
32771
|
+
return snapshot;
|
|
32772
|
+
},
|
|
32773
|
+
subscribe(listener) {
|
|
32774
|
+
listeners.add(listener);
|
|
32775
|
+
return () => listeners.delete(listener);
|
|
32776
|
+
},
|
|
32777
|
+
newConversation(opts) {
|
|
32778
|
+
const conversation = createConversationInternal(opts ?? {});
|
|
32779
|
+
openThreadRootId = null;
|
|
32780
|
+
emit2();
|
|
32781
|
+
return conversation;
|
|
32782
|
+
},
|
|
32783
|
+
selectConversation(conversationId) {
|
|
32784
|
+
if (!conversations.has(conversationId) || activeConversationId === conversationId) return;
|
|
32785
|
+
activeConversationId = conversationId;
|
|
32786
|
+
openThreadRootId = null;
|
|
32787
|
+
emit2();
|
|
32788
|
+
},
|
|
32789
|
+
deleteConversation(conversationId) {
|
|
32790
|
+
if (!conversations.has(conversationId)) return;
|
|
32791
|
+
conversations.delete(conversationId);
|
|
32792
|
+
messagesByConv.delete(conversationId);
|
|
32793
|
+
if (activeConversationId === conversationId) {
|
|
32794
|
+
activeConversationId = orderedConversations()[0]?.id ?? null;
|
|
32795
|
+
openThreadRootId = null;
|
|
32796
|
+
}
|
|
32797
|
+
emit2();
|
|
32798
|
+
},
|
|
32799
|
+
renameConversation(conversationId, title) {
|
|
32800
|
+
const c2 = conversations.get(conversationId);
|
|
32801
|
+
if (!c2) return;
|
|
32802
|
+
conversations.set(conversationId, { ...c2, title });
|
|
32803
|
+
emit2();
|
|
32804
|
+
},
|
|
32805
|
+
appendMessage(message) {
|
|
32806
|
+
const list = messagesByConv.get(message.conversationId);
|
|
32807
|
+
if (!list) return;
|
|
32808
|
+
list.push(message);
|
|
32809
|
+
touch(message.conversationId);
|
|
32810
|
+
emit2();
|
|
32811
|
+
},
|
|
32812
|
+
editMessage(messageId, content) {
|
|
32813
|
+
if (!activeConversationId) return;
|
|
32814
|
+
const list = messagesByConv.get(activeConversationId);
|
|
32815
|
+
const msg = list.find((m2) => m2.id === messageId);
|
|
32816
|
+
if (!msg) return;
|
|
32817
|
+
msg.content = content;
|
|
32818
|
+
msg.edited = true;
|
|
32819
|
+
emit2();
|
|
32820
|
+
},
|
|
32821
|
+
deleteMessage(messageId) {
|
|
32822
|
+
if (!activeConversationId) return;
|
|
32823
|
+
const list = messagesByConv.get(activeConversationId);
|
|
32824
|
+
const msg = list.find((m2) => m2.id === messageId);
|
|
32825
|
+
if (!msg) return;
|
|
32826
|
+
const removeIds = /* @__PURE__ */ new Set([messageId]);
|
|
32827
|
+
if (!msg.parentId) {
|
|
32828
|
+
for (const r2 of list) if (r2.parentId === messageId) removeIds.add(r2.id);
|
|
32829
|
+
}
|
|
32830
|
+
const next = list.filter((m2) => !removeIds.has(m2.id));
|
|
32831
|
+
messagesByConv.set(activeConversationId, next);
|
|
32832
|
+
if (openThreadRootId && removeIds.has(openThreadRootId)) openThreadRootId = null;
|
|
32833
|
+
emit2();
|
|
32834
|
+
},
|
|
32835
|
+
react(messageId, emoji) {
|
|
32836
|
+
if (!activeConversationId) return;
|
|
32837
|
+
const list = messagesByConv.get(activeConversationId);
|
|
32838
|
+
const msg = list.find((m2) => m2.id === messageId);
|
|
32839
|
+
if (!msg) return;
|
|
32840
|
+
const reactions = [...msg.reactions ?? []];
|
|
32841
|
+
const idx = reactions.findIndex((r2) => r2.emoji === emoji);
|
|
32842
|
+
if (idx === -1) {
|
|
32843
|
+
reactions.push({ emoji, count: 1, userReacted: true });
|
|
32844
|
+
} else {
|
|
32845
|
+
const r2 = reactions[idx];
|
|
32846
|
+
if (r2.userReacted) {
|
|
32847
|
+
const count = r2.count - 1;
|
|
32848
|
+
if (count <= 0) reactions.splice(idx, 1);
|
|
32849
|
+
else reactions[idx] = { ...r2, count, userReacted: false };
|
|
32850
|
+
} else {
|
|
32851
|
+
reactions[idx] = { ...r2, count: r2.count + 1, userReacted: true };
|
|
32852
|
+
}
|
|
32853
|
+
}
|
|
32854
|
+
msg.reactions = reactions;
|
|
32855
|
+
emit2();
|
|
32856
|
+
},
|
|
32857
|
+
async sendMessage(content, opts) {
|
|
32858
|
+
const trimmed = content.trim();
|
|
32859
|
+
if (!trimmed && !opts?.attachments?.length) return;
|
|
32860
|
+
const conversationId = ensureActiveConversation(opts);
|
|
32861
|
+
const list = messagesByConv.get(conversationId);
|
|
32862
|
+
const parentId = opts?.replyTo ? rootIdOf(list, opts.replyTo) : void 0;
|
|
32863
|
+
const isFirstRoot = !parentId && selectRoots(list).length === 0;
|
|
32864
|
+
const userMsg = {
|
|
32865
|
+
id: generateId("rfr-msg"),
|
|
32866
|
+
conversationId,
|
|
32867
|
+
role: "user",
|
|
32868
|
+
author: currentUser,
|
|
32869
|
+
content: trimmed,
|
|
32870
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
32871
|
+
status: "sent",
|
|
32872
|
+
parentId,
|
|
32873
|
+
attachments: opts?.attachments,
|
|
32874
|
+
metadata: opts?.metadata
|
|
32875
|
+
};
|
|
32876
|
+
list.push(userMsg);
|
|
32877
|
+
const conversation = conversations.get(conversationId);
|
|
32878
|
+
if (isFirstRoot && conversation.title === DEFAULT_TITLE) {
|
|
32879
|
+
conversations.set(conversationId, { ...conversation, title: generateTitle(trimmed) });
|
|
32880
|
+
}
|
|
32881
|
+
touch(conversationId);
|
|
32882
|
+
if (!transport) {
|
|
32883
|
+
status = "idle";
|
|
32884
|
+
emit2();
|
|
32885
|
+
return;
|
|
32886
|
+
}
|
|
32887
|
+
const history = historyFor(list, parentId).filter((m2) => m2.id !== userMsg.id);
|
|
32888
|
+
const assistantMsg = {
|
|
32889
|
+
id: generateId("rfr-msg"),
|
|
32890
|
+
conversationId,
|
|
32891
|
+
role: "assistant",
|
|
32892
|
+
author: assistant,
|
|
32893
|
+
content: "",
|
|
32894
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
32895
|
+
status: "streaming",
|
|
32896
|
+
parentId
|
|
32825
32897
|
};
|
|
32898
|
+
list.push(assistantMsg);
|
|
32899
|
+
await streamReply(conversationId, assistantMsg, userMsg, history);
|
|
32900
|
+
},
|
|
32901
|
+
async retryLast() {
|
|
32902
|
+
if (!activeConversationId || !transport) return;
|
|
32903
|
+
const list = messagesByConv.get(activeConversationId);
|
|
32904
|
+
const last = list[list.length - 1];
|
|
32905
|
+
const parentId = last?.parentId;
|
|
32906
|
+
if (last && last.role === "assistant" && last.status === "error") list.pop();
|
|
32907
|
+
const scope = parentId ? selectThreadMessages(list, parentId) : selectRoots(list);
|
|
32908
|
+
const lastUser = [...scope].reverse().find((m2) => m2.role === "user");
|
|
32909
|
+
if (!lastUser) return;
|
|
32910
|
+
const history = historyFor(list, parentId);
|
|
32911
|
+
const assistantMsg = {
|
|
32912
|
+
id: generateId("rfr-msg"),
|
|
32913
|
+
conversationId: activeConversationId,
|
|
32914
|
+
role: "assistant",
|
|
32915
|
+
author: assistant,
|
|
32916
|
+
content: "",
|
|
32917
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
32918
|
+
status: "streaming",
|
|
32919
|
+
parentId
|
|
32920
|
+
};
|
|
32921
|
+
list.push(assistantMsg);
|
|
32922
|
+
await streamReply(activeConversationId, assistantMsg, lastUser, history);
|
|
32826
32923
|
},
|
|
32827
|
-
|
|
32828
|
-
|
|
32829
|
-
|
|
32830
|
-
|
|
32831
|
-
|
|
32924
|
+
stop() {
|
|
32925
|
+
abortController?.abort();
|
|
32926
|
+
},
|
|
32927
|
+
openThread(rootId) {
|
|
32928
|
+
openThreadRootId = rootId;
|
|
32929
|
+
emit2();
|
|
32930
|
+
},
|
|
32931
|
+
closeThread() {
|
|
32932
|
+
if (openThreadRootId === null) return;
|
|
32933
|
+
openThreadRootId = null;
|
|
32934
|
+
emit2();
|
|
32935
|
+
},
|
|
32936
|
+
setThreadingMode(mode) {
|
|
32937
|
+
if (threadingMode === mode) return;
|
|
32938
|
+
threadingMode = mode;
|
|
32939
|
+
emit2();
|
|
32940
|
+
},
|
|
32941
|
+
setTransport(next) {
|
|
32942
|
+
transport = next;
|
|
32943
|
+
}
|
|
32832
32944
|
};
|
|
32945
|
+
return api;
|
|
32833
32946
|
}
|
|
32834
|
-
|
|
32835
|
-
|
|
32836
|
-
|
|
32837
|
-
|
|
32838
|
-
|
|
32839
|
-
|
|
32840
|
-
|
|
32947
|
+
|
|
32948
|
+
// ../markdown-renderer/dist/index.js
|
|
32949
|
+
function escapeHtml(text) {
|
|
32950
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
32951
|
+
}
|
|
32952
|
+
function parseInline(text, linkResolver) {
|
|
32953
|
+
let result = escapeHtml(text);
|
|
32954
|
+
result = result.replace(/`([^`]+)`/g, "<code>$1</code>");
|
|
32955
|
+
result = result.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>");
|
|
32956
|
+
result = result.replace(/__([^_]+)__/g, "<strong>$1</strong>");
|
|
32957
|
+
result = result.replace(/\*([^*]+)\*/g, "<em>$1</em>");
|
|
32958
|
+
result = result.replace(/_([^_]+)_/g, "<em>$1</em>");
|
|
32959
|
+
result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, text2, url) => {
|
|
32960
|
+
if (/^\s*javascript\s*:/i.test(url)) {
|
|
32961
|
+
return text2;
|
|
32841
32962
|
}
|
|
32842
|
-
|
|
32843
|
-
|
|
32844
|
-
|
|
32845
|
-
|
|
32963
|
+
const resolvedUrl = linkResolver ? linkResolver(url) : url;
|
|
32964
|
+
return `<a href="${resolvedUrl}">${text2}</a>`;
|
|
32965
|
+
});
|
|
32966
|
+
return result;
|
|
32967
|
+
}
|
|
32968
|
+
function parseMarkdown(content, linkResolver) {
|
|
32969
|
+
const lines = content.split("\n");
|
|
32970
|
+
const outputLines = [];
|
|
32971
|
+
let inCodeBlock = false;
|
|
32972
|
+
let codeBlockContent = [];
|
|
32973
|
+
let codeBlockLang = "";
|
|
32974
|
+
let inList = null;
|
|
32975
|
+
let inBlockquote = false;
|
|
32976
|
+
function closeList() {
|
|
32977
|
+
if (inList) {
|
|
32978
|
+
outputLines.push(inList === "ul" ? "</ul>" : "</ol>");
|
|
32979
|
+
inList = null;
|
|
32980
|
+
}
|
|
32981
|
+
}
|
|
32982
|
+
function closeBlockquote() {
|
|
32983
|
+
if (inBlockquote) {
|
|
32984
|
+
outputLines.push("</blockquote>");
|
|
32985
|
+
inBlockquote = false;
|
|
32986
|
+
}
|
|
32987
|
+
}
|
|
32988
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
32989
|
+
const line = lines[i2];
|
|
32990
|
+
if (line.trimStart().startsWith("```")) {
|
|
32991
|
+
if (inCodeBlock) {
|
|
32992
|
+
outputLines.push(`<pre><code${codeBlockLang ? ` class="language-${escapeHtml(codeBlockLang)}"` : ""}>${escapeHtml(codeBlockContent.join("\n"))}</code></pre>`);
|
|
32993
|
+
codeBlockContent = [];
|
|
32994
|
+
codeBlockLang = "";
|
|
32995
|
+
inCodeBlock = false;
|
|
32996
|
+
} else {
|
|
32997
|
+
closeList();
|
|
32998
|
+
closeBlockquote();
|
|
32999
|
+
inCodeBlock = true;
|
|
33000
|
+
codeBlockLang = line.trimStart().slice(3).trim();
|
|
33001
|
+
}
|
|
33002
|
+
continue;
|
|
33003
|
+
}
|
|
33004
|
+
if (inCodeBlock) {
|
|
33005
|
+
codeBlockContent.push(line);
|
|
33006
|
+
continue;
|
|
33007
|
+
}
|
|
33008
|
+
if (/^(\s*[-*_]\s*){3,}$/.test(line)) {
|
|
33009
|
+
closeList();
|
|
33010
|
+
closeBlockquote();
|
|
33011
|
+
outputLines.push("<hr />");
|
|
33012
|
+
continue;
|
|
33013
|
+
}
|
|
33014
|
+
const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
33015
|
+
if (headingMatch) {
|
|
33016
|
+
closeList();
|
|
33017
|
+
closeBlockquote();
|
|
33018
|
+
const level = headingMatch[1].length;
|
|
33019
|
+
const text = parseInline(headingMatch[2], linkResolver);
|
|
33020
|
+
outputLines.push(`<h${level}>${text}</h${level}>`);
|
|
33021
|
+
continue;
|
|
33022
|
+
}
|
|
33023
|
+
const blockquoteMatch = line.match(/^>\s?(.*)$/);
|
|
33024
|
+
if (blockquoteMatch) {
|
|
33025
|
+
closeList();
|
|
33026
|
+
if (!inBlockquote) {
|
|
33027
|
+
inBlockquote = true;
|
|
33028
|
+
outputLines.push("<blockquote>");
|
|
33029
|
+
}
|
|
33030
|
+
const text = blockquoteMatch[1].trim();
|
|
33031
|
+
if (text) {
|
|
33032
|
+
outputLines.push(`<p>${parseInline(text, linkResolver)}</p>`);
|
|
33033
|
+
}
|
|
33034
|
+
continue;
|
|
33035
|
+
} else if (inBlockquote) {
|
|
33036
|
+
closeBlockquote();
|
|
33037
|
+
}
|
|
33038
|
+
const ulMatch = line.match(/^[\s]*[-*+]\s+(.+)$/);
|
|
33039
|
+
if (ulMatch) {
|
|
33040
|
+
closeBlockquote();
|
|
33041
|
+
if (inList !== "ul") {
|
|
33042
|
+
closeList();
|
|
33043
|
+
inList = "ul";
|
|
33044
|
+
outputLines.push("<ul>");
|
|
33045
|
+
}
|
|
33046
|
+
outputLines.push(`<li>${parseInline(ulMatch[1], linkResolver)}</li>`);
|
|
33047
|
+
continue;
|
|
33048
|
+
}
|
|
33049
|
+
const olMatch = line.match(/^[\s]*\d+\.\s+(.+)$/);
|
|
33050
|
+
if (olMatch) {
|
|
33051
|
+
closeBlockquote();
|
|
33052
|
+
if (inList !== "ol") {
|
|
33053
|
+
closeList();
|
|
33054
|
+
inList = "ol";
|
|
33055
|
+
outputLines.push("<ol>");
|
|
33056
|
+
}
|
|
33057
|
+
outputLines.push(`<li>${parseInline(olMatch[1], linkResolver)}</li>`);
|
|
33058
|
+
continue;
|
|
33059
|
+
}
|
|
33060
|
+
if (inList) {
|
|
33061
|
+
closeList();
|
|
33062
|
+
}
|
|
33063
|
+
if (line.trim() === "") {
|
|
33064
|
+
continue;
|
|
33065
|
+
}
|
|
33066
|
+
outputLines.push(`<p>${parseInline(line, linkResolver)}</p>`);
|
|
33067
|
+
}
|
|
33068
|
+
if (inCodeBlock) {
|
|
33069
|
+
outputLines.push(`<pre><code${codeBlockLang ? ` class="language-${escapeHtml(codeBlockLang)}"` : ""}>${escapeHtml(codeBlockContent.join("\n"))}</code></pre>`);
|
|
33070
|
+
}
|
|
33071
|
+
closeList();
|
|
33072
|
+
closeBlockquote();
|
|
33073
|
+
return outputLines.join("\n");
|
|
33074
|
+
}
|
|
33075
|
+
function extractComponents(content, components) {
|
|
33076
|
+
if (!components) return [];
|
|
33077
|
+
const extracted = [];
|
|
33078
|
+
for (const [name, def] of Object.entries(components)) {
|
|
33079
|
+
const matches = Array.from(content.matchAll(def.pattern));
|
|
33080
|
+
matches.forEach(() => {
|
|
33081
|
+
extracted.push({
|
|
33082
|
+
name,
|
|
33083
|
+
props: { ...def.props }
|
|
33084
|
+
});
|
|
33085
|
+
});
|
|
33086
|
+
}
|
|
33087
|
+
return extracted;
|
|
33088
|
+
}
|
|
33089
|
+
function createMarkdownRenderer(props) {
|
|
33090
|
+
const { content, components, linkResolver } = props;
|
|
33091
|
+
const html = parseMarkdown(content, linkResolver);
|
|
33092
|
+
const extractedComponents = extractComponents(content, components);
|
|
33093
|
+
const ariaProps = {
|
|
33094
|
+
role: "document",
|
|
33095
|
+
"aria-label": "Rendered markdown content"
|
|
33096
|
+
};
|
|
33097
|
+
return {
|
|
33098
|
+
html,
|
|
33099
|
+
components: extractedComponents,
|
|
33100
|
+
ariaProps
|
|
33101
|
+
};
|
|
33102
|
+
}
|
|
33103
|
+
var markdownRendererTokens = {
|
|
33104
|
+
name: "markdown-renderer",
|
|
33105
|
+
tokens: {
|
|
33106
|
+
bg: { variable: "--rfr-markdown-bg", fallback: "hsl(var(--background))" },
|
|
33107
|
+
fg: { variable: "--rfr-markdown-fg", fallback: "hsl(var(--foreground))" },
|
|
33108
|
+
codeBg: { variable: "--rfr-markdown-code-bg", fallback: "hsl(var(--muted))" },
|
|
33109
|
+
linkColor: { variable: "--rfr-markdown-link", fallback: "hsl(var(--primary))" },
|
|
33110
|
+
borderColor: { variable: "--rfr-markdown-border", fallback: "hsl(var(--border))" }
|
|
33111
|
+
}
|
|
33112
|
+
};
|
|
33113
|
+
var proseVariants = cva({
|
|
33114
|
+
base: "prose max-w-none text-foreground leading-relaxed",
|
|
33115
|
+
variants: {
|
|
33116
|
+
size: {
|
|
33117
|
+
sm: "prose-sm text-sm",
|
|
33118
|
+
default: "prose-base text-base",
|
|
33119
|
+
lg: "prose-lg text-lg"
|
|
33120
|
+
},
|
|
33121
|
+
theme: {
|
|
33122
|
+
light: "bg-white text-gray-900",
|
|
33123
|
+
dark: "bg-gray-900 text-gray-100"
|
|
33124
|
+
}
|
|
33125
|
+
},
|
|
33126
|
+
defaultVariants: {
|
|
33127
|
+
size: "default"
|
|
33128
|
+
}
|
|
33129
|
+
});
|
|
33130
|
+
function sanitizeHtml(html) {
|
|
33131
|
+
let sanitized = html;
|
|
33132
|
+
sanitized = sanitized.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
|
|
33133
|
+
sanitized = sanitized.replace(/<\/?script[^>]*>/gi, "");
|
|
33134
|
+
sanitized = sanitized.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "");
|
|
33135
|
+
sanitized = sanitized.replace(/(href|src)\s*=\s*["']?\s*javascript\s*:[^"'>]*/gi, '$1=""');
|
|
33136
|
+
return sanitized;
|
|
33137
|
+
}
|
|
33138
|
+
var MarkdownRenderer = React11__namespace.forwardRef(
|
|
33139
|
+
({ content, components, linkResolver, className, size }, ref) => {
|
|
33140
|
+
const coreProps = { content, components, linkResolver };
|
|
33141
|
+
const api = createMarkdownRenderer(coreProps);
|
|
33142
|
+
const classes = cn(proseVariants({ size }), className);
|
|
33143
|
+
const sanitizedHtml = sanitizeHtml(api.html);
|
|
33144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33145
|
+
"div",
|
|
33146
|
+
{
|
|
33147
|
+
ref,
|
|
33148
|
+
className: classes,
|
|
33149
|
+
...api.ariaProps,
|
|
33150
|
+
dangerouslySetInnerHTML: { __html: sanitizedHtml }
|
|
33151
|
+
}
|
|
33152
|
+
);
|
|
33153
|
+
}
|
|
33154
|
+
);
|
|
33155
|
+
MarkdownRenderer.displayName = "MarkdownRenderer";
|
|
33156
|
+
|
|
33157
|
+
// ../thread-view/dist/index.js
|
|
33158
|
+
function formatTimestamp(date) {
|
|
33159
|
+
const hours = date.getHours();
|
|
33160
|
+
const minutes = date.getMinutes();
|
|
33161
|
+
const ampm = hours >= 12 ? "PM" : "AM";
|
|
33162
|
+
const displayHours = hours % 12 || 12;
|
|
33163
|
+
const displayMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;
|
|
33164
|
+
return `${displayHours}:${displayMinutes} ${ampm}`;
|
|
33165
|
+
}
|
|
33166
|
+
function formatRelativeTime(date, now) {
|
|
33167
|
+
const reference = now ?? /* @__PURE__ */ new Date();
|
|
33168
|
+
const diffMs = reference.getTime() - date.getTime();
|
|
33169
|
+
const diffSeconds = Math.floor(diffMs / 1e3);
|
|
33170
|
+
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
33171
|
+
const diffHours = Math.floor(diffMinutes / 60);
|
|
33172
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
33173
|
+
if (diffSeconds < 60) return "just now";
|
|
33174
|
+
if (diffMinutes < 60) return `${diffMinutes} minute${diffMinutes === 1 ? "" : "s"} ago`;
|
|
33175
|
+
if (diffHours < 24) return `${diffHours} hour${diffHours === 1 ? "" : "s"} ago`;
|
|
33176
|
+
if (diffDays < 7) return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
|
|
33177
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
33178
|
+
}
|
|
33179
|
+
function createThreadView(props) {
|
|
33180
|
+
const { messages, onReply, onReact, currentUserId } = props;
|
|
33181
|
+
let replyingTo = null;
|
|
33182
|
+
const threadId = generateId("rfr-thread");
|
|
33183
|
+
const labelId = generateId("rfr-thread-label");
|
|
33184
|
+
function startReply(messageId) {
|
|
33185
|
+
replyingTo = messageId;
|
|
33186
|
+
}
|
|
33187
|
+
function cancelReply() {
|
|
33188
|
+
replyingTo = null;
|
|
33189
|
+
}
|
|
33190
|
+
function reply(messageId, content) {
|
|
33191
|
+
onReply?.(messageId, content);
|
|
33192
|
+
replyingTo = null;
|
|
33193
|
+
}
|
|
33194
|
+
function react(messageId, emoji) {
|
|
33195
|
+
onReact?.(messageId, emoji);
|
|
33196
|
+
}
|
|
33197
|
+
const ariaProps = {
|
|
33198
|
+
role: "log",
|
|
33199
|
+
"aria-label": "Message thread",
|
|
33200
|
+
"aria-live": "polite",
|
|
33201
|
+
id: threadId
|
|
33202
|
+
};
|
|
33203
|
+
function getMessageAriaProps(message) {
|
|
33204
|
+
const isOwn = currentUserId && message.author.id === currentUserId;
|
|
33205
|
+
return {
|
|
33206
|
+
role: "article",
|
|
33207
|
+
"aria-label": `Message from ${message.author.name}${isOwn ? " (you)" : ""} at ${formatTimestamp(message.timestamp)}`
|
|
33208
|
+
};
|
|
33209
|
+
}
|
|
33210
|
+
function getReplyButtonAriaProps(_messageId) {
|
|
33211
|
+
return {
|
|
33212
|
+
role: "button",
|
|
33213
|
+
"aria-label": `Reply to message`
|
|
33214
|
+
};
|
|
33215
|
+
}
|
|
33216
|
+
return {
|
|
33217
|
+
state: {
|
|
33218
|
+
messages,
|
|
33219
|
+
get replyingTo() {
|
|
33220
|
+
return replyingTo;
|
|
33221
|
+
}
|
|
33222
|
+
},
|
|
33223
|
+
startReply,
|
|
33224
|
+
cancelReply,
|
|
33225
|
+
reply,
|
|
33226
|
+
react,
|
|
33227
|
+
formatTimestamp,
|
|
33228
|
+
formatRelativeTime,
|
|
33229
|
+
ariaProps,
|
|
33230
|
+
getMessageAriaProps,
|
|
33231
|
+
getReplyButtonAriaProps,
|
|
33232
|
+
ids: {
|
|
33233
|
+
thread: threadId,
|
|
33234
|
+
label: labelId
|
|
33235
|
+
}
|
|
33236
|
+
};
|
|
33237
|
+
}
|
|
33238
|
+
var threadContainerStyles = "flex flex-col gap-1";
|
|
33239
|
+
var threadMessageStyles = "flex gap-3 px-4 py-2 hover:bg-accent/50 rounded-md transition-colors group";
|
|
33240
|
+
var threadAvatarStyles = "h-9 w-9 rounded-full bg-muted flex items-center justify-center text-sm font-medium overflow-hidden flex-shrink-0";
|
|
33241
|
+
var threadContentStyles = "flex-1 min-w-0";
|
|
33242
|
+
var threadAuthorStyles = "font-semibold text-sm";
|
|
33243
|
+
var threadTimestampStyles = "text-xs text-muted-foreground ml-2";
|
|
33244
|
+
var threadBodyStyles = "text-sm mt-0.5 whitespace-pre-wrap break-words";
|
|
33245
|
+
var threadReactionsStyles = "flex flex-wrap gap-1 mt-1";
|
|
33246
|
+
var threadReplyIndicatorStyles = "flex items-center gap-1 mt-1 text-xs text-primary cursor-pointer hover:underline";
|
|
33247
|
+
var threadActionsStyles = "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity";
|
|
33248
|
+
var threadAttachmentStyles = "flex items-center gap-2 mt-1 p-2 rounded border text-xs bg-muted/50";
|
|
33249
|
+
var threadEditedStyles = "text-xs text-muted-foreground ml-1";
|
|
33250
|
+
|
|
33251
|
+
// ../react-conversation/dist/index.js
|
|
33252
|
+
function useConversation(config) {
|
|
33253
|
+
const apiRef = React11__namespace.useRef(null);
|
|
33254
|
+
if (apiRef.current === null) {
|
|
33255
|
+
apiRef.current = createConversation(config);
|
|
33256
|
+
}
|
|
33257
|
+
const api = apiRef.current;
|
|
33258
|
+
const state = React11__namespace.useSyncExternalStore(api.subscribe, api.getState, api.getState);
|
|
33259
|
+
const transport = config?.transport;
|
|
33260
|
+
React11__namespace.useEffect(() => {
|
|
33261
|
+
if (transport) api.setTransport(transport);
|
|
33262
|
+
}, [api, transport]);
|
|
33263
|
+
return {
|
|
33264
|
+
state,
|
|
33265
|
+
api,
|
|
33266
|
+
sendMessage: api.sendMessage,
|
|
33267
|
+
newConversation: api.newConversation,
|
|
33268
|
+
selectConversation: api.selectConversation,
|
|
33269
|
+
deleteConversation: api.deleteConversation,
|
|
33270
|
+
renameConversation: api.renameConversation,
|
|
33271
|
+
editMessage: api.editMessage,
|
|
33272
|
+
deleteMessage: api.deleteMessage,
|
|
33273
|
+
react: api.react,
|
|
33274
|
+
retryLast: api.retryLast,
|
|
33275
|
+
stop: api.stop,
|
|
33276
|
+
openThread: api.openThread,
|
|
33277
|
+
closeThread: api.closeThread,
|
|
33278
|
+
setThreadingMode: api.setThreadingMode
|
|
33279
|
+
};
|
|
33280
|
+
}
|
|
33281
|
+
var h = React11__namespace.createElement;
|
|
33282
|
+
var EMOJI = {
|
|
33283
|
+
smile: "\u{1F604}",
|
|
33284
|
+
grin: "\u{1F601}",
|
|
33285
|
+
joy: "\u{1F602}",
|
|
33286
|
+
rofl: "\u{1F923}",
|
|
33287
|
+
wink: "\u{1F609}",
|
|
33288
|
+
heart_eyes: "\u{1F60D}",
|
|
33289
|
+
thinking: "\u{1F914}",
|
|
33290
|
+
neutral: "\u{1F610}",
|
|
33291
|
+
sob: "\u{1F62D}",
|
|
33292
|
+
scream: "\u{1F631}",
|
|
33293
|
+
tada: "\u{1F389}",
|
|
33294
|
+
fire: "\u{1F525}",
|
|
33295
|
+
heart: "\u2764\uFE0F",
|
|
33296
|
+
thumbsup: "\u{1F44D}",
|
|
33297
|
+
thumbsdown: "\u{1F44E}",
|
|
33298
|
+
clap: "\u{1F44F}",
|
|
33299
|
+
pray: "\u{1F64F}",
|
|
33300
|
+
eyes: "\u{1F440}",
|
|
33301
|
+
rocket: "\u{1F680}",
|
|
33302
|
+
sparkles: "\u2728",
|
|
33303
|
+
star: "\u2B50",
|
|
33304
|
+
check: "\u2705",
|
|
33305
|
+
x: "\u274C",
|
|
33306
|
+
warning: "\u26A0\uFE0F",
|
|
33307
|
+
bulb: "\u{1F4A1}",
|
|
33308
|
+
bug: "\u{1F41B}",
|
|
33309
|
+
wave: "\u{1F44B}",
|
|
33310
|
+
ok_hand: "\u{1F44C}",
|
|
33311
|
+
muscle: "\u{1F4AA}",
|
|
33312
|
+
"100": "\u{1F4AF}",
|
|
33313
|
+
poop: "\u{1F4A9}",
|
|
33314
|
+
ghost: "\u{1F47B}",
|
|
33315
|
+
robot: "\u{1F916}",
|
|
33316
|
+
cat: "\u{1F431}",
|
|
33317
|
+
dog: "\u{1F436}",
|
|
33318
|
+
coffee: "\u2615",
|
|
33319
|
+
pizza: "\u{1F355}",
|
|
33320
|
+
beer: "\u{1F37A}",
|
|
33321
|
+
sun: "\u2600\uFE0F",
|
|
33322
|
+
moon: "\u{1F319}",
|
|
33323
|
+
zap: "\u26A1"
|
|
33324
|
+
};
|
|
33325
|
+
function detectTrigger(text, caret) {
|
|
33326
|
+
const before = text.slice(0, caret);
|
|
33327
|
+
const m2 = before.match(/(?:^|\s)([/@:])([\w+-]*)$/);
|
|
33328
|
+
if (!m2) return null;
|
|
33329
|
+
const type = m2[1];
|
|
33330
|
+
const query = m2[2] ?? "";
|
|
33331
|
+
return { type, query, start: caret - query.length - 1, end: caret };
|
|
33332
|
+
}
|
|
33333
|
+
function Composer({
|
|
33334
|
+
placeholder = "Type a message\u2026 (/ commands, @ mentions, : emoji)",
|
|
33335
|
+
busy = false,
|
|
33336
|
+
slashCommands = [],
|
|
33337
|
+
mentions,
|
|
33338
|
+
toolbar = true,
|
|
33339
|
+
emoji = true,
|
|
33340
|
+
attachments = true,
|
|
33341
|
+
onSubmit,
|
|
33342
|
+
onStop,
|
|
33343
|
+
onSlashCommand,
|
|
33344
|
+
autoFocus
|
|
33345
|
+
}) {
|
|
33346
|
+
const [value, setValue2] = React11__namespace.useState("");
|
|
33347
|
+
const [pending, setPending] = React11__namespace.useState([]);
|
|
33348
|
+
const [trigger, setTrigger] = React11__namespace.useState(null);
|
|
33349
|
+
const [active, setActive] = React11__namespace.useState(0);
|
|
33350
|
+
const [mentionItems, setMentionItems] = React11__namespace.useState([]);
|
|
33351
|
+
const ref = React11__namespace.useRef(null);
|
|
33352
|
+
const fileRef = React11__namespace.useRef(null);
|
|
33353
|
+
React11__namespace.useEffect(() => {
|
|
33354
|
+
if (trigger?.type !== "@" || !mentions) {
|
|
33355
|
+
setMentionItems([]);
|
|
33356
|
+
return;
|
|
33357
|
+
}
|
|
33358
|
+
if (Array.isArray(mentions)) {
|
|
33359
|
+
const q2 = trigger.query.toLowerCase();
|
|
33360
|
+
setMentionItems(mentions.filter((m2) => m2.label.toLowerCase().includes(q2)).slice(0, 8));
|
|
33361
|
+
return;
|
|
33362
|
+
}
|
|
33363
|
+
let cancelled = false;
|
|
33364
|
+
Promise.resolve(mentions(trigger.query)).then((res) => {
|
|
33365
|
+
if (!cancelled) setMentionItems(res.slice(0, 8));
|
|
33366
|
+
});
|
|
33367
|
+
return () => {
|
|
33368
|
+
cancelled = true;
|
|
33369
|
+
};
|
|
33370
|
+
}, [trigger, mentions]);
|
|
33371
|
+
const items = React11__namespace.useMemo(() => {
|
|
33372
|
+
if (!trigger) return [];
|
|
33373
|
+
const q2 = trigger.query.toLowerCase();
|
|
33374
|
+
if (trigger.type === "/") {
|
|
33375
|
+
return slashCommands.filter((c2) => c2.label.toLowerCase().includes(q2) || c2.id.toLowerCase().includes(q2)).slice(0, 8).map((c2) => ({ key: c2.id, primary: c2.label, secondary: c2.description, icon: c2.icon, apply: c2.insertText ?? "", runCmd: c2 }));
|
|
33376
|
+
}
|
|
33377
|
+
if (trigger.type === "@") {
|
|
33378
|
+
return mentionItems.map((m2) => ({ key: m2.id, primary: m2.label, icon: m2.avatarUrl ? "" : "@", apply: `@${m2.label} ` }));
|
|
33379
|
+
}
|
|
33380
|
+
if (trigger.type === ":" && emoji) {
|
|
33381
|
+
return Object.entries(EMOJI).filter(([name]) => name.includes(q2)).slice(0, 8).map(([name, char]) => ({ key: name, primary: `${char} :${name}:`, apply: char }));
|
|
33382
|
+
}
|
|
33383
|
+
return [];
|
|
33384
|
+
}, [trigger, slashCommands, mentionItems, emoji]);
|
|
33385
|
+
const menuOpen = trigger !== null && items.length > 0;
|
|
33386
|
+
React11__namespace.useEffect(() => setActive(0), [trigger?.type, trigger?.query]);
|
|
33387
|
+
function syncFromTextarea(el) {
|
|
33388
|
+
setValue2(el.value);
|
|
33389
|
+
setTrigger(detectTrigger(el.value, el.selectionStart ?? el.value.length));
|
|
33390
|
+
}
|
|
33391
|
+
function selectItem(i2) {
|
|
33392
|
+
const item = items[i2];
|
|
33393
|
+
if (!item || !trigger) return;
|
|
33394
|
+
if (trigger.type === "/" && !item.apply && item.runCmd) {
|
|
33395
|
+
const next2 = value.slice(0, trigger.start) + value.slice(trigger.end);
|
|
33396
|
+
setValue2(next2);
|
|
33397
|
+
setTrigger(null);
|
|
33398
|
+
onSlashCommand?.(item.runCmd);
|
|
33399
|
+
queueCaret(trigger.start);
|
|
33400
|
+
return;
|
|
33401
|
+
}
|
|
33402
|
+
const next = value.slice(0, trigger.start) + item.apply + value.slice(trigger.end);
|
|
33403
|
+
setValue2(next);
|
|
33404
|
+
setTrigger(null);
|
|
33405
|
+
queueCaret(trigger.start + item.apply.length);
|
|
33406
|
+
}
|
|
33407
|
+
function queueCaret(pos) {
|
|
33408
|
+
requestAnimationFrame(() => {
|
|
33409
|
+
const el = ref.current;
|
|
33410
|
+
if (!el) return;
|
|
33411
|
+
el.focus();
|
|
33412
|
+
el.setSelectionRange(pos, pos);
|
|
33413
|
+
});
|
|
33414
|
+
}
|
|
33415
|
+
function format(kind) {
|
|
33416
|
+
const el = ref.current;
|
|
33417
|
+
if (!el) return;
|
|
33418
|
+
const start = el.selectionStart ?? 0;
|
|
33419
|
+
const end = el.selectionEnd ?? 0;
|
|
33420
|
+
const sel = value.slice(start, end);
|
|
33421
|
+
let replacement = sel;
|
|
33422
|
+
let caretOffset = 0;
|
|
33423
|
+
if (kind === "bold") replacement = `**${sel || "bold"}**`;
|
|
33424
|
+
else if (kind === "italic") replacement = `*${sel || "italic"}*`;
|
|
33425
|
+
else if (kind === "code") replacement = sel.includes("\n") ? `
|
|
33426
|
+
\`\`\`
|
|
33427
|
+
${sel}
|
|
33428
|
+
\`\`\`
|
|
33429
|
+
` : `\`${sel || "code"}\``;
|
|
33430
|
+
else if (kind === "link") {
|
|
33431
|
+
replacement = `[${sel || "text"}](url)`;
|
|
33432
|
+
caretOffset = replacement.length - 4;
|
|
33433
|
+
} else if (kind === "quote" || kind === "ul" || kind === "ol") {
|
|
33434
|
+
const prefix = kind === "quote" ? "> " : kind === "ul" ? "- " : "1. ";
|
|
33435
|
+
const block = (sel || "item").split("\n").map((l2) => prefix + l2).join("\n");
|
|
33436
|
+
replacement = (start > 0 && value[start - 1] !== "\n" ? "\n" : "") + block;
|
|
33437
|
+
}
|
|
33438
|
+
const next = value.slice(0, start) + replacement + value.slice(end);
|
|
33439
|
+
setValue2(next);
|
|
33440
|
+
const caret = caretOffset ? start + caretOffset : start + replacement.length;
|
|
33441
|
+
queueCaret(caret);
|
|
33442
|
+
}
|
|
33443
|
+
function submit() {
|
|
33444
|
+
const text = value.trim();
|
|
33445
|
+
if (!text && pending.length === 0 || busy) return;
|
|
33446
|
+
onSubmit(text, pending.length ? pending : void 0);
|
|
33447
|
+
setValue2("");
|
|
33448
|
+
setPending([]);
|
|
33449
|
+
setTrigger(null);
|
|
33450
|
+
}
|
|
33451
|
+
function onFiles(files) {
|
|
33452
|
+
if (!files) return;
|
|
33453
|
+
setPending((p2) => [
|
|
33454
|
+
...p2,
|
|
33455
|
+
...Array.from(files).map((f2) => ({
|
|
33456
|
+
id: `${f2.name}-${f2.size}-${f2.lastModified}`,
|
|
33457
|
+
name: f2.name,
|
|
33458
|
+
url: URL.createObjectURL(f2),
|
|
33459
|
+
type: f2.type || "application/octet-stream",
|
|
33460
|
+
size: f2.size
|
|
33461
|
+
}))
|
|
33462
|
+
]);
|
|
33463
|
+
}
|
|
33464
|
+
function onKeyDown(e2) {
|
|
33465
|
+
if (menuOpen) {
|
|
33466
|
+
if (e2.key === "ArrowDown") return e2.preventDefault(), setActive((a2) => (a2 + 1) % items.length);
|
|
33467
|
+
if (e2.key === "ArrowUp") return e2.preventDefault(), setActive((a2) => (a2 - 1 + items.length) % items.length);
|
|
33468
|
+
if (e2.key === "Enter" || e2.key === "Tab") return e2.preventDefault(), selectItem(active);
|
|
33469
|
+
if (e2.key === "Escape") return e2.preventDefault(), setTrigger(null);
|
|
33470
|
+
}
|
|
33471
|
+
const mod = e2.metaKey || e2.ctrlKey;
|
|
33472
|
+
if (mod && e2.key.toLowerCase() === "b") return e2.preventDefault(), format("bold");
|
|
33473
|
+
if (mod && e2.key.toLowerCase() === "i") return e2.preventDefault(), format("italic");
|
|
33474
|
+
if (mod && e2.key.toLowerCase() === "e") return e2.preventDefault(), format("code");
|
|
33475
|
+
if (mod && e2.key.toLowerCase() === "k") return e2.preventDefault(), format("link");
|
|
33476
|
+
if (e2.key === "Enter" && !e2.shiftKey) {
|
|
33477
|
+
e2.preventDefault();
|
|
33478
|
+
submit();
|
|
33479
|
+
}
|
|
33480
|
+
}
|
|
33481
|
+
const toolbarBtn = (label, title, kind) => h(
|
|
33482
|
+
"button",
|
|
33483
|
+
{
|
|
33484
|
+
key: kind,
|
|
33485
|
+
type: "button",
|
|
33486
|
+
title,
|
|
33487
|
+
className: "rounded px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
33488
|
+
onMouseDown: (e2) => e2.preventDefault(),
|
|
33489
|
+
// keep textarea selection
|
|
33490
|
+
onClick: () => format(kind)
|
|
33491
|
+
},
|
|
33492
|
+
label
|
|
33493
|
+
);
|
|
33494
|
+
return h(
|
|
33495
|
+
"div",
|
|
33496
|
+
{ className: "border-t border-border" },
|
|
33497
|
+
// attachment chips
|
|
33498
|
+
pending.length > 0 ? h(
|
|
33499
|
+
"div",
|
|
33500
|
+
{ className: "flex flex-wrap gap-2 px-3 pt-2" },
|
|
33501
|
+
...pending.map(
|
|
33502
|
+
(a2) => h(
|
|
33503
|
+
"span",
|
|
33504
|
+
{ key: a2.id, className: "inline-flex items-center gap-1 rounded bg-muted px-2 py-0.5 text-xs" },
|
|
33505
|
+
a2.name,
|
|
33506
|
+
h(
|
|
33507
|
+
"button",
|
|
33508
|
+
{
|
|
33509
|
+
type: "button",
|
|
33510
|
+
className: "text-muted-foreground hover:text-destructive",
|
|
33511
|
+
onClick: () => setPending((p2) => p2.filter((x2) => x2.id !== a2.id))
|
|
33512
|
+
},
|
|
33513
|
+
"\u2715"
|
|
33514
|
+
)
|
|
33515
|
+
)
|
|
33516
|
+
)
|
|
33517
|
+
) : null,
|
|
33518
|
+
// toolbar
|
|
33519
|
+
toolbar ? h(
|
|
33520
|
+
"div",
|
|
33521
|
+
{ className: "flex items-center gap-0.5 px-2 pt-2" },
|
|
33522
|
+
toolbarBtn("B", "Bold (\u2318B)", "bold"),
|
|
33523
|
+
toolbarBtn("\u{1D456}", "Italic (\u2318I)", "italic"),
|
|
33524
|
+
toolbarBtn("</>", "Code (\u2318E)", "code"),
|
|
33525
|
+
toolbarBtn("\u{1F517}", "Link (\u2318K)", "link"),
|
|
33526
|
+
toolbarBtn("\u275D", "Quote", "quote"),
|
|
33527
|
+
toolbarBtn("\u2022", "Bulleted list", "ul"),
|
|
33528
|
+
toolbarBtn("1.", "Numbered list", "ol")
|
|
33529
|
+
) : null,
|
|
33530
|
+
// input row (relative for the popup menu)
|
|
33531
|
+
h(
|
|
33532
|
+
"div",
|
|
33533
|
+
{ className: "relative flex items-end gap-2 p-3" },
|
|
33534
|
+
menuOpen ? h(
|
|
33535
|
+
"div",
|
|
33536
|
+
{
|
|
33537
|
+
className: "absolute bottom-full left-3 z-20 mb-1 w-72 overflow-hidden rounded-lg border border-border bg-popover shadow-lg",
|
|
33538
|
+
role: "listbox"
|
|
33539
|
+
},
|
|
33540
|
+
h(
|
|
33541
|
+
"div",
|
|
33542
|
+
{ className: "border-b border-border px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground" },
|
|
33543
|
+
trigger?.type === "/" ? "Commands" : trigger?.type === "@" ? "Mentions" : "Emoji"
|
|
33544
|
+
),
|
|
33545
|
+
...items.map(
|
|
33546
|
+
(it2, i2) => h(
|
|
33547
|
+
"button",
|
|
33548
|
+
{
|
|
33549
|
+
key: it2.key,
|
|
33550
|
+
type: "button",
|
|
33551
|
+
role: "option",
|
|
33552
|
+
"aria-selected": i2 === active,
|
|
33553
|
+
className: cn(
|
|
33554
|
+
"flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm",
|
|
33555
|
+
i2 === active ? "bg-accent" : "hover:bg-accent/50"
|
|
33556
|
+
),
|
|
33557
|
+
onMouseEnter: () => setActive(i2),
|
|
33558
|
+
onMouseDown: (e2) => e2.preventDefault(),
|
|
33559
|
+
onClick: () => selectItem(i2)
|
|
33560
|
+
},
|
|
33561
|
+
it2.icon ? h("span", { className: "w-4 text-center text-muted-foreground" }, it2.icon) : null,
|
|
33562
|
+
h("span", { className: "flex-1 truncate" }, it2.primary),
|
|
33563
|
+
it2.secondary ? h("span", { className: "truncate text-xs text-muted-foreground" }, it2.secondary) : null
|
|
33564
|
+
)
|
|
33565
|
+
)
|
|
33566
|
+
) : null,
|
|
33567
|
+
attachments ? h(
|
|
33568
|
+
React11__namespace.Fragment,
|
|
33569
|
+
null,
|
|
33570
|
+
h("input", {
|
|
33571
|
+
ref: fileRef,
|
|
33572
|
+
type: "file",
|
|
33573
|
+
accept: "image/*",
|
|
33574
|
+
multiple: true,
|
|
33575
|
+
className: "hidden",
|
|
33576
|
+
onChange: (e2) => {
|
|
33577
|
+
onFiles(e2.target.files);
|
|
33578
|
+
e2.target.value = "";
|
|
33579
|
+
}
|
|
33580
|
+
}),
|
|
33581
|
+
h(
|
|
33582
|
+
"button",
|
|
33583
|
+
{
|
|
33584
|
+
type: "button",
|
|
33585
|
+
className: "rounded-md border border-border px-2 py-2 text-sm hover:bg-accent",
|
|
33586
|
+
"aria-label": "Attach image or GIF",
|
|
33587
|
+
onClick: () => fileRef.current?.click()
|
|
33588
|
+
},
|
|
33589
|
+
"\u{1F4CE}"
|
|
33590
|
+
)
|
|
33591
|
+
) : null,
|
|
33592
|
+
h("textarea", {
|
|
33593
|
+
ref,
|
|
33594
|
+
className: "max-h-40 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
|
|
33595
|
+
rows: 1,
|
|
33596
|
+
value,
|
|
33597
|
+
placeholder,
|
|
33598
|
+
autoFocus,
|
|
33599
|
+
"aria-label": "Message",
|
|
33600
|
+
onChange: (e2) => syncFromTextarea(e2.target),
|
|
33601
|
+
onClick: (e2) => syncFromTextarea(e2.currentTarget),
|
|
33602
|
+
onKeyUp: (e2) => syncFromTextarea(e2.currentTarget),
|
|
33603
|
+
onKeyDown,
|
|
33604
|
+
onBlur: () => setTimeout(() => setTrigger(null), 120)
|
|
33605
|
+
}),
|
|
33606
|
+
busy ? h(
|
|
33607
|
+
"button",
|
|
33608
|
+
{
|
|
33609
|
+
type: "button",
|
|
33610
|
+
className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground",
|
|
33611
|
+
onClick: () => onStop?.()
|
|
33612
|
+
},
|
|
33613
|
+
"Stop"
|
|
33614
|
+
) : h(
|
|
33615
|
+
"button",
|
|
33616
|
+
{
|
|
33617
|
+
type: "button",
|
|
33618
|
+
className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
|
|
33619
|
+
disabled: !value.trim() && pending.length === 0,
|
|
33620
|
+
onClick: submit
|
|
33621
|
+
},
|
|
33622
|
+
"Send"
|
|
33623
|
+
)
|
|
33624
|
+
)
|
|
33625
|
+
);
|
|
33626
|
+
}
|
|
33627
|
+
var h2 = React11__namespace.createElement;
|
|
33628
|
+
var QUICK_EMOJIS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F389}", "\u{1F440}", "\u{1F64F}"];
|
|
33629
|
+
var chatMd = cn(
|
|
33630
|
+
"max-w-none text-sm",
|
|
33631
|
+
"[&_p]:my-1 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0",
|
|
33632
|
+
"[&_pre]:my-2 [&_pre]:rounded-md [&_pre]:text-xs [&_pre]:leading-relaxed",
|
|
33633
|
+
"[&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0.5",
|
|
33634
|
+
"[&_h1]:text-base [&_h1]:font-semibold [&_h1]:mt-2 [&_h1]:mb-1",
|
|
33635
|
+
"[&_h2]:text-sm [&_h2]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1",
|
|
33636
|
+
"[&_h3]:text-sm [&_h3]:font-semibold",
|
|
33637
|
+
"[&_blockquote]:my-1 [&_blockquote]:border-l-2 [&_blockquote]:pl-2 [&_blockquote]:not-italic [&_blockquote]:text-muted-foreground",
|
|
33638
|
+
"[&_img]:my-1 [&_img]:max-h-60 [&_img]:rounded-md",
|
|
33639
|
+
"[&_code]:text-[0.85em]"
|
|
33640
|
+
);
|
|
33641
|
+
function Avatar({ name, avatarUrl, size = 8 }) {
|
|
33642
|
+
return h2(
|
|
33643
|
+
"div",
|
|
33644
|
+
{
|
|
33645
|
+
className: cn(
|
|
33646
|
+
"flex-shrink-0 overflow-hidden rounded-full bg-muted flex items-center justify-center text-xs font-medium",
|
|
33647
|
+
size === 8 ? "h-8 w-8" : "h-7 w-7"
|
|
33648
|
+
)
|
|
33649
|
+
},
|
|
33650
|
+
avatarUrl ? h2("img", { src: avatarUrl, alt: name, className: "h-full w-full object-cover" }) : (name.charAt(0) || "?").toUpperCase()
|
|
33651
|
+
);
|
|
33652
|
+
}
|
|
33653
|
+
function TypingDots() {
|
|
33654
|
+
return h2(
|
|
33655
|
+
"div",
|
|
33656
|
+
{ className: "flex items-center gap-1 py-1.5", "aria-label": "Assistant is typing" },
|
|
33657
|
+
...[0, 150, 300].map(
|
|
33658
|
+
(delay) => h2("span", {
|
|
33659
|
+
key: delay,
|
|
33660
|
+
className: "h-1.5 w-1.5 rounded-full bg-muted-foreground/60 animate-bounce",
|
|
33661
|
+
style: { animationDelay: `${delay}ms` }
|
|
33662
|
+
})
|
|
33663
|
+
)
|
|
33664
|
+
);
|
|
33665
|
+
}
|
|
33666
|
+
function Attachments({ attachments }) {
|
|
33667
|
+
return h2(
|
|
33668
|
+
"div",
|
|
33669
|
+
{ className: "mt-2 flex flex-wrap gap-2" },
|
|
33670
|
+
...attachments.map(
|
|
33671
|
+
(a2) => a2.type.startsWith("image/") ? h2("img", { key: a2.id, src: a2.url, alt: a2.name, className: "max-h-60 rounded-md border border-border object-contain" }) : h2(
|
|
33672
|
+
"a",
|
|
33673
|
+
{
|
|
33674
|
+
key: a2.id,
|
|
33675
|
+
href: a2.url,
|
|
33676
|
+
target: "_blank",
|
|
33677
|
+
rel: "noreferrer",
|
|
33678
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border bg-background/60 px-2 py-1 text-xs"
|
|
33679
|
+
},
|
|
33680
|
+
"\u{1F4CE} ",
|
|
33681
|
+
a2.name
|
|
33682
|
+
)
|
|
33683
|
+
)
|
|
33684
|
+
);
|
|
33685
|
+
}
|
|
33686
|
+
function MessageBody({ message }) {
|
|
33687
|
+
if (message.status === "streaming" && message.content === "") return h2(TypingDots);
|
|
33688
|
+
return h2(
|
|
33689
|
+
React11__namespace.Fragment,
|
|
33690
|
+
null,
|
|
33691
|
+
message.content ? h2(MarkdownRenderer, { content: message.content, size: "sm", className: chatMd }) : null,
|
|
33692
|
+
message.attachments && message.attachments.length > 0 ? h2(Attachments, { attachments: message.attachments }) : null,
|
|
33693
|
+
message.status === "error" ? h2("div", { className: "mt-1 text-xs text-destructive", role: "alert" }, message.error ?? "Failed to send.") : null
|
|
33694
|
+
);
|
|
33695
|
+
}
|
|
33696
|
+
function Reactions({ message, onReact, align }) {
|
|
33697
|
+
if (!message.reactions || message.reactions.length === 0) return null;
|
|
33698
|
+
return h2(
|
|
33699
|
+
"div",
|
|
33700
|
+
{ className: cn("mt-1 flex flex-wrap gap-1", align === "end" && "justify-end") },
|
|
33701
|
+
...message.reactions.map(
|
|
33702
|
+
(r2) => h2(
|
|
33703
|
+
"button",
|
|
33704
|
+
{
|
|
33705
|
+
key: r2.emoji,
|
|
33706
|
+
type: "button",
|
|
33707
|
+
onClick: () => onReact(r2.emoji),
|
|
33708
|
+
className: cn(
|
|
33709
|
+
"inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs",
|
|
33710
|
+
r2.userReacted ? "border-primary bg-primary/10" : "border-border bg-background"
|
|
33711
|
+
)
|
|
33712
|
+
},
|
|
33713
|
+
`${r2.emoji} ${r2.count}`
|
|
33714
|
+
)
|
|
33715
|
+
)
|
|
33716
|
+
);
|
|
33717
|
+
}
|
|
33718
|
+
function QuotedParent({ parent, onClick }) {
|
|
33719
|
+
const snippet = parent.content.length > 80 ? `${parent.content.slice(0, 80)}\u2026` : parent.content;
|
|
33720
|
+
return h2(
|
|
33721
|
+
"button",
|
|
33722
|
+
{
|
|
33723
|
+
type: "button",
|
|
33724
|
+
onClick,
|
|
33725
|
+
className: "mb-1 flex max-w-full items-start gap-2 rounded-md border-l-2 border-primary/50 bg-muted/50 px-2 py-1 text-left text-xs text-muted-foreground hover:bg-muted"
|
|
33726
|
+
},
|
|
33727
|
+
h2("span", { className: "font-medium" }, parent.author.name),
|
|
33728
|
+
h2("span", { className: "truncate" }, snippet)
|
|
33729
|
+
);
|
|
33730
|
+
}
|
|
33731
|
+
function HoverActions({
|
|
33732
|
+
message,
|
|
33733
|
+
conversation,
|
|
33734
|
+
isOwn,
|
|
33735
|
+
onEdit,
|
|
33736
|
+
onToggleEmojis,
|
|
33737
|
+
align
|
|
33738
|
+
}) {
|
|
33739
|
+
const { state, openThread, deleteMessage } = conversation;
|
|
33740
|
+
return h2(
|
|
33741
|
+
"div",
|
|
33742
|
+
{
|
|
33743
|
+
className: cn(
|
|
33744
|
+
"mt-1 flex items-center gap-3 text-xs text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",
|
|
33745
|
+
align === "end" && "justify-end"
|
|
33746
|
+
)
|
|
33747
|
+
},
|
|
33748
|
+
h2("button", { type: "button", className: "hover:text-foreground", onClick: () => openThread(rootIdOf(state.messages, message.id)) }, "Reply"),
|
|
33749
|
+
h2("button", { type: "button", className: "hover:text-foreground", onClick: onToggleEmojis }, "React"),
|
|
33750
|
+
isOwn ? h2("button", { type: "button", className: "hover:text-foreground", onClick: onEdit }, "Edit") : null,
|
|
33751
|
+
isOwn ? h2("button", { type: "button", className: "hover:text-destructive", onClick: () => deleteMessage(message.id) }, "Delete") : null
|
|
33752
|
+
);
|
|
33753
|
+
}
|
|
33754
|
+
function EmojiRow({ onPick, align }) {
|
|
33755
|
+
return h2(
|
|
33756
|
+
"div",
|
|
33757
|
+
{ className: cn("mt-1 flex gap-1", align === "end" && "justify-end") },
|
|
33758
|
+
...QUICK_EMOJIS.map(
|
|
33759
|
+
(emoji) => h2("button", { key: emoji, type: "button", className: "rounded px-1 text-base hover:bg-accent", onClick: () => onPick(emoji) }, emoji)
|
|
33760
|
+
)
|
|
33761
|
+
);
|
|
33762
|
+
}
|
|
33763
|
+
function EditField({ message, conversation, onDone }) {
|
|
33764
|
+
const [draft, setDraft] = React11__namespace.useState(message.content);
|
|
33765
|
+
function save() {
|
|
33766
|
+
const t2 = draft.trim();
|
|
33767
|
+
if (t2 && t2 !== message.content) conversation.editMessage(message.id, t2);
|
|
33768
|
+
onDone();
|
|
33769
|
+
}
|
|
33770
|
+
return h2(
|
|
33771
|
+
"div",
|
|
33772
|
+
{ className: "mt-1" },
|
|
33773
|
+
h2("textarea", {
|
|
33774
|
+
className: "w-full resize-none rounded-md border border-border bg-background px-2 py-1 text-sm",
|
|
33775
|
+
value: draft,
|
|
33776
|
+
autoFocus: true,
|
|
33777
|
+
onChange: (e2) => setDraft(e2.target.value),
|
|
33778
|
+
onKeyDown: (e2) => {
|
|
33779
|
+
if (e2.key === "Enter" && !e2.shiftKey) {
|
|
33780
|
+
e2.preventDefault();
|
|
33781
|
+
save();
|
|
33782
|
+
}
|
|
33783
|
+
if (e2.key === "Escape") onDone();
|
|
33784
|
+
}
|
|
33785
|
+
}),
|
|
33786
|
+
h2(
|
|
33787
|
+
"div",
|
|
33788
|
+
{ className: "mt-1 flex gap-2 text-xs" },
|
|
33789
|
+
h2("button", { type: "button", className: "text-primary", onClick: save }, "Save"),
|
|
33790
|
+
h2("button", { type: "button", className: "text-muted-foreground", onClick: onDone }, "Cancel")
|
|
33791
|
+
)
|
|
33792
|
+
);
|
|
33793
|
+
}
|
|
33794
|
+
function MessageRow({
|
|
33795
|
+
message,
|
|
33796
|
+
conversation,
|
|
33797
|
+
currentUserId,
|
|
33798
|
+
showThreadAffordance,
|
|
33799
|
+
quotedParent
|
|
33800
|
+
}) {
|
|
33801
|
+
const { state, react, openThread } = conversation;
|
|
33802
|
+
const [showEmojis, setShowEmojis] = React11__namespace.useState(false);
|
|
33803
|
+
const [editing, setEditing] = React11__namespace.useState(false);
|
|
33804
|
+
const isUser = currentUserId ? message.author.id === currentUserId : message.role === "user";
|
|
33805
|
+
const replyCount = getReplyCount(state.messages, message.id);
|
|
33806
|
+
const align = isUser ? "end" : "start";
|
|
33807
|
+
const inner = h2(
|
|
33808
|
+
React11__namespace.Fragment,
|
|
33809
|
+
null,
|
|
33810
|
+
quotedParent ? h2(QuotedParent, { parent: quotedParent, onClick: () => openThread(quotedParent.id) }) : null,
|
|
33811
|
+
editing ? h2(EditField, { message, conversation, onDone: () => setEditing(false) }) : isUser ? h2("div", { className: "inline-block rounded-2xl rounded-br-sm bg-primary/10 px-3 py-2 text-left" }, h2(MessageBody, { message })) : h2(MessageBody, { message }),
|
|
33812
|
+
h2(Reactions, { message, onReact: (e2) => react(message.id, e2), align }),
|
|
33813
|
+
showThreadAffordance && replyCount > 0 ? h2(
|
|
33814
|
+
"button",
|
|
33815
|
+
{ type: "button", className: cn("mt-1 text-xs font-medium text-primary hover:underline", align === "end" && "self-end"), onClick: () => openThread(message.id) },
|
|
33816
|
+
`\u{1F4AC} ${replyCount} ${replyCount === 1 ? "reply" : "replies"}`
|
|
33817
|
+
) : null,
|
|
33818
|
+
h2(HoverActions, { message, conversation, isOwn: isUser, onEdit: () => setEditing(true), onToggleEmojis: () => setShowEmojis((v2) => !v2), align }),
|
|
33819
|
+
showEmojis ? h2(EmojiRow, {
|
|
33820
|
+
onPick: (e2) => {
|
|
33821
|
+
react(message.id, e2);
|
|
33822
|
+
setShowEmojis(false);
|
|
33823
|
+
},
|
|
33824
|
+
align
|
|
33825
|
+
}) : null
|
|
33826
|
+
);
|
|
33827
|
+
if (!isUser) {
|
|
33828
|
+
return h2(
|
|
33829
|
+
"div",
|
|
33830
|
+
{ className: "group flex gap-3 rounded-md px-3 py-2 hover:bg-accent/30", role: "article", "aria-label": `Message from ${message.author.name}`, "data-message-id": message.id },
|
|
33831
|
+
h2(Avatar, { name: message.author.name, avatarUrl: message.author.avatarUrl }),
|
|
33832
|
+
h2(
|
|
33833
|
+
"div",
|
|
33834
|
+
{ className: "min-w-0 flex-1" },
|
|
33835
|
+
h2(
|
|
33836
|
+
"div",
|
|
33837
|
+
{ className: "flex items-baseline gap-2" },
|
|
33838
|
+
h2("span", { className: "text-sm font-semibold" }, message.author.name),
|
|
33839
|
+
h2("span", { className: "text-xs text-muted-foreground", title: message.timestamp.toLocaleString() }, formatTimestamp(message.timestamp)),
|
|
33840
|
+
message.edited ? h2("span", { className: "text-xs text-muted-foreground" }, "(edited)") : null
|
|
33841
|
+
),
|
|
33842
|
+
inner
|
|
33843
|
+
)
|
|
33844
|
+
);
|
|
33845
|
+
}
|
|
33846
|
+
return h2(
|
|
33847
|
+
"div",
|
|
33848
|
+
{ className: "group flex flex-col items-end px-3 py-1.5", role: "article", "aria-label": `Message from ${message.author.name}`, "data-message-id": message.id },
|
|
33849
|
+
h2(
|
|
33850
|
+
"div",
|
|
33851
|
+
{ className: "flex items-baseline gap-2" },
|
|
33852
|
+
message.edited ? h2("span", { className: "text-xs text-muted-foreground" }, "(edited)") : null,
|
|
33853
|
+
h2("span", { className: "text-xs text-muted-foreground", title: message.timestamp.toLocaleString() }, formatTimestamp(message.timestamp)),
|
|
33854
|
+
h2("span", { className: "text-sm font-semibold" }, message.author.name)
|
|
33855
|
+
),
|
|
33856
|
+
h2("div", { className: "mt-0.5 flex max-w-[80%] flex-col items-end" }, inner)
|
|
33857
|
+
);
|
|
33858
|
+
}
|
|
33859
|
+
function ConversationSidebar({ conversation }) {
|
|
33860
|
+
const { state, newConversation, selectConversation, deleteConversation } = conversation;
|
|
33861
|
+
return h2(
|
|
33862
|
+
"aside",
|
|
33863
|
+
{ className: "flex w-56 flex-col gap-1 overflow-y-auto border-r border-border bg-muted/20 p-2", "aria-label": "Conversations" },
|
|
33864
|
+
h2(
|
|
33865
|
+
"button",
|
|
33866
|
+
{ type: "button", className: "mb-1 w-full rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:opacity-90", onClick: () => newConversation() },
|
|
33867
|
+
"+ New chat"
|
|
33868
|
+
),
|
|
33869
|
+
...state.conversations.map(
|
|
33870
|
+
(conv) => h2(
|
|
33871
|
+
"div",
|
|
33872
|
+
{
|
|
33873
|
+
key: conv.id,
|
|
33874
|
+
role: "button",
|
|
33875
|
+
"aria-current": conv.id === state.activeConversationId,
|
|
33876
|
+
onClick: () => selectConversation(conv.id),
|
|
33877
|
+
className: cn(
|
|
33878
|
+
"group flex items-center justify-between gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent/60",
|
|
33879
|
+
conv.id === state.activeConversationId && "bg-accent font-medium"
|
|
33880
|
+
)
|
|
33881
|
+
},
|
|
33882
|
+
h2(
|
|
33883
|
+
"div",
|
|
33884
|
+
{ className: "min-w-0" },
|
|
33885
|
+
h2("div", { className: "truncate" }, conv.title),
|
|
33886
|
+
h2("div", { className: "truncate text-xs text-muted-foreground" }, formatRelativeTime(conv.updatedAt))
|
|
33887
|
+
),
|
|
33888
|
+
h2(
|
|
33889
|
+
"button",
|
|
33890
|
+
{
|
|
33891
|
+
type: "button",
|
|
33892
|
+
className: "text-xs text-muted-foreground opacity-0 hover:text-destructive group-hover:opacity-100",
|
|
33893
|
+
"aria-label": `Delete ${conv.title}`,
|
|
33894
|
+
onClick: (e2) => {
|
|
33895
|
+
e2.stopPropagation();
|
|
33896
|
+
deleteConversation(conv.id);
|
|
33897
|
+
}
|
|
33898
|
+
},
|
|
33899
|
+
"\u2715"
|
|
33900
|
+
)
|
|
33901
|
+
)
|
|
33902
|
+
)
|
|
33903
|
+
);
|
|
33904
|
+
}
|
|
33905
|
+
function ThreadPanel({ conversation, currentUserId, composer }) {
|
|
33906
|
+
const { state } = conversation;
|
|
33907
|
+
const rootId = state.openThreadRootId;
|
|
33908
|
+
if (!rootId) return null;
|
|
33909
|
+
const messages = selectThreadMessages(state.messages, rootId);
|
|
33910
|
+
return h2(
|
|
33911
|
+
"aside",
|
|
33912
|
+
{ className: "flex w-80 flex-col border-l border-border", "aria-label": "Thread" },
|
|
33913
|
+
h2(
|
|
33914
|
+
"div",
|
|
33915
|
+
{ className: "flex items-center justify-between border-b border-border px-3 py-2" },
|
|
33916
|
+
h2("span", { className: "text-sm font-semibold" }, "Thread"),
|
|
33917
|
+
h2("button", { type: "button", className: "text-muted-foreground hover:text-foreground", "aria-label": "Close thread", onClick: () => conversation.closeThread() }, "\u2715")
|
|
33918
|
+
),
|
|
33919
|
+
h2(
|
|
33920
|
+
"div",
|
|
33921
|
+
{ className: "flex-1 overflow-y-auto p-1" },
|
|
33922
|
+
...messages.map((m2) => h2(MessageRow, { key: m2.id, message: m2, conversation, currentUserId, showThreadAffordance: false }))
|
|
33923
|
+
),
|
|
33924
|
+
composer
|
|
33925
|
+
);
|
|
33926
|
+
}
|
|
33927
|
+
function ModeToggle({ conversation }) {
|
|
33928
|
+
const { state, setThreadingMode } = conversation;
|
|
33929
|
+
const opt = (mode, label) => h2(
|
|
33930
|
+
"button",
|
|
33931
|
+
{
|
|
33932
|
+
type: "button",
|
|
33933
|
+
onClick: () => setThreadingMode(mode),
|
|
33934
|
+
className: cn("rounded px-2 py-0.5 text-xs", state.threadingMode === mode ? "bg-background shadow-sm" : "text-muted-foreground")
|
|
33935
|
+
},
|
|
33936
|
+
label
|
|
33937
|
+
);
|
|
33938
|
+
return h2(
|
|
33939
|
+
"div",
|
|
33940
|
+
{ className: "inline-flex rounded-md bg-muted p-0.5", role: "group", "aria-label": "Threading mode" },
|
|
33941
|
+
opt("inline", "Inline"),
|
|
33942
|
+
opt("panel", "Threads")
|
|
33943
|
+
);
|
|
33944
|
+
}
|
|
33945
|
+
function Chat({
|
|
33946
|
+
conversation,
|
|
33947
|
+
showConversationList = true,
|
|
33948
|
+
showModeToggle = true,
|
|
33949
|
+
placeholder,
|
|
33950
|
+
currentUserId,
|
|
33951
|
+
emptyState,
|
|
33952
|
+
className,
|
|
33953
|
+
slashCommands,
|
|
33954
|
+
mentions,
|
|
33955
|
+
onSlashCommand,
|
|
33956
|
+
composerToolbar = true
|
|
33957
|
+
}) {
|
|
33958
|
+
const { state, sendMessage } = conversation;
|
|
33959
|
+
const timeline = selectMainTimeline(state.messages, state.threadingMode);
|
|
33960
|
+
const activeConv = state.conversations.find((c2) => c2.id === state.activeConversationId);
|
|
33961
|
+
const busy = state.status === "sending" || state.status === "streaming";
|
|
33962
|
+
const mainComposer = h2(Composer, {
|
|
33963
|
+
placeholder,
|
|
33964
|
+
busy,
|
|
33965
|
+
slashCommands,
|
|
33966
|
+
mentions,
|
|
33967
|
+
onSlashCommand,
|
|
33968
|
+
toolbar: composerToolbar,
|
|
33969
|
+
onSubmit: (content, atts) => void sendMessage(content, { attachments: atts }),
|
|
33970
|
+
onStop: () => conversation.stop()
|
|
33971
|
+
});
|
|
33972
|
+
const threadComposer = state.openThreadRootId ? h2(Composer, {
|
|
33973
|
+
placeholder: "Reply\u2026",
|
|
33974
|
+
busy,
|
|
33975
|
+
slashCommands,
|
|
33976
|
+
mentions,
|
|
33977
|
+
onSlashCommand,
|
|
33978
|
+
toolbar: composerToolbar,
|
|
33979
|
+
onSubmit: (content, atts) => void sendMessage(content, { replyTo: state.openThreadRootId, attachments: atts }),
|
|
33980
|
+
onStop: () => conversation.stop()
|
|
33981
|
+
}) : null;
|
|
33982
|
+
const body = timeline.length === 0 ? h2("div", { className: "flex flex-1 items-center justify-center p-6 text-sm text-muted-foreground" }, emptyState ?? "No messages yet. Say hello \u{1F44B}") : h2(
|
|
33983
|
+
"div",
|
|
33984
|
+
{ className: "flex-1 space-y-0.5 overflow-y-auto p-2" },
|
|
33985
|
+
...timeline.map(
|
|
33986
|
+
(m2) => h2(MessageRow, {
|
|
33987
|
+
key: m2.id,
|
|
33988
|
+
message: m2,
|
|
33989
|
+
conversation,
|
|
33990
|
+
currentUserId,
|
|
33991
|
+
showThreadAffordance: state.threadingMode === "panel",
|
|
33992
|
+
quotedParent: state.threadingMode === "inline" && m2.parentId ? findMessage(state.messages, m2.parentId) : void 0
|
|
33993
|
+
})
|
|
33994
|
+
)
|
|
33995
|
+
);
|
|
33996
|
+
return h2(
|
|
33997
|
+
"div",
|
|
33998
|
+
{ className: cn("flex h-full min-h-0 overflow-hidden rounded-xl border border-border bg-background", className) },
|
|
33999
|
+
showConversationList ? h2(ConversationSidebar, { conversation }) : null,
|
|
34000
|
+
h2(
|
|
34001
|
+
"div",
|
|
34002
|
+
{ className: "flex min-w-0 flex-1 flex-col" },
|
|
34003
|
+
h2(
|
|
34004
|
+
"div",
|
|
34005
|
+
{ className: "flex items-center justify-between border-b border-border px-3 py-2" },
|
|
34006
|
+
h2("span", { className: "truncate text-sm font-semibold" }, activeConv?.title ?? "Chat"),
|
|
34007
|
+
showModeToggle ? h2(ModeToggle, { conversation }) : null
|
|
34008
|
+
),
|
|
34009
|
+
body,
|
|
34010
|
+
mainComposer
|
|
34011
|
+
),
|
|
34012
|
+
h2(ThreadPanel, { conversation, currentUserId, composer: threadComposer })
|
|
34013
|
+
);
|
|
34014
|
+
}
|
|
34015
|
+
|
|
34016
|
+
// ../content-protection/dist/index.js
|
|
34017
|
+
function createContentProtection(props = {}) {
|
|
34018
|
+
const {
|
|
34019
|
+
enabled = true,
|
|
34020
|
+
disableCopy = true,
|
|
34021
|
+
disableContextMenu = true,
|
|
34022
|
+
watermarkText
|
|
34023
|
+
} = props;
|
|
34024
|
+
const eventHandlers = {};
|
|
34025
|
+
if (enabled) {
|
|
34026
|
+
if (disableCopy) {
|
|
34027
|
+
const prevent = (e2) => e2.preventDefault();
|
|
34028
|
+
eventHandlers.onCopy = prevent;
|
|
34029
|
+
eventHandlers.onCut = prevent;
|
|
34030
|
+
eventHandlers.onSelectStart = prevent;
|
|
34031
|
+
}
|
|
34032
|
+
if (disableContextMenu) {
|
|
34033
|
+
eventHandlers.onContextMenu = (e2) => e2.preventDefault();
|
|
34034
|
+
}
|
|
34035
|
+
}
|
|
34036
|
+
const watermarkConfig = watermarkText ? { text: watermarkText, opacity: 0.08, angle: -45 } : null;
|
|
34037
|
+
const dataAttributes = {};
|
|
34038
|
+
if (enabled) {
|
|
34039
|
+
dataAttributes["data-protected"] = "true";
|
|
34040
|
+
}
|
|
34041
|
+
return {
|
|
34042
|
+
eventHandlers,
|
|
34043
|
+
watermarkConfig,
|
|
34044
|
+
dataAttributes
|
|
34045
|
+
};
|
|
34046
|
+
}
|
|
34047
|
+
var contentProtectionVariants = cva({
|
|
34048
|
+
base: "relative select-none"
|
|
34049
|
+
});
|
|
34050
|
+
var watermarkVariants = cva({
|
|
34051
|
+
base: "pointer-events-none absolute inset-0 z-50 overflow-hidden"
|
|
34052
|
+
});
|
|
34053
|
+
var ContentProtection = React11__namespace.forwardRef(
|
|
34054
|
+
({
|
|
34055
|
+
enabled,
|
|
34056
|
+
disableCopy,
|
|
34057
|
+
disableContextMenu,
|
|
34058
|
+
watermarkText,
|
|
34059
|
+
className,
|
|
34060
|
+
children,
|
|
34061
|
+
...props
|
|
34062
|
+
}, ref) => {
|
|
34063
|
+
const api = createContentProtection({
|
|
34064
|
+
enabled,
|
|
34065
|
+
disableCopy,
|
|
34066
|
+
disableContextMenu,
|
|
34067
|
+
watermarkText
|
|
34068
|
+
});
|
|
34069
|
+
const classes = cn(contentProtectionVariants(), className);
|
|
34070
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34071
|
+
"div",
|
|
34072
|
+
{
|
|
34073
|
+
ref,
|
|
34074
|
+
className: classes,
|
|
34075
|
+
...api.dataAttributes,
|
|
34076
|
+
onCopy: api.eventHandlers.onCopy,
|
|
34077
|
+
onCut: api.eventHandlers.onCut,
|
|
34078
|
+
onContextMenu: api.eventHandlers.onContextMenu,
|
|
34079
|
+
onSelect: api.eventHandlers.onSelectStart,
|
|
34080
|
+
...props,
|
|
34081
|
+
children: [
|
|
34082
|
+
children,
|
|
34083
|
+
api.watermarkConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
34084
|
+
"div",
|
|
34085
|
+
{
|
|
34086
|
+
className: watermarkVariants(),
|
|
34087
|
+
"aria-hidden": "true",
|
|
34088
|
+
style: {
|
|
34089
|
+
opacity: api.watermarkConfig.opacity,
|
|
34090
|
+
transform: `rotate(${api.watermarkConfig.angle}deg)`,
|
|
34091
|
+
backgroundImage: `repeating-linear-gradient(
|
|
34092
|
+
${api.watermarkConfig.angle}deg,
|
|
34093
|
+
transparent,
|
|
34094
|
+
transparent 80px,
|
|
34095
|
+
currentColor 80px,
|
|
34096
|
+
currentColor 80px
|
|
34097
|
+
)`
|
|
34098
|
+
},
|
|
34099
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "100%", height: "100%", children: [
|
|
34100
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34101
|
+
"pattern",
|
|
34102
|
+
{
|
|
34103
|
+
id: "rfr-watermark",
|
|
34104
|
+
x: "0",
|
|
34105
|
+
y: "0",
|
|
34106
|
+
width: "200",
|
|
34107
|
+
height: "200",
|
|
34108
|
+
patternUnits: "userSpaceOnUse",
|
|
34109
|
+
patternTransform: `rotate(${api.watermarkConfig.angle})`,
|
|
34110
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34111
|
+
"text",
|
|
34112
|
+
{
|
|
34113
|
+
x: "0",
|
|
34114
|
+
y: "100",
|
|
34115
|
+
fill: "currentColor",
|
|
34116
|
+
fontSize: "16",
|
|
34117
|
+
fontFamily: "sans-serif",
|
|
34118
|
+
children: api.watermarkConfig.text
|
|
34119
|
+
}
|
|
34120
|
+
)
|
|
34121
|
+
}
|
|
34122
|
+
) }),
|
|
34123
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", fill: "url(#rfr-watermark)" })
|
|
34124
|
+
] })
|
|
34125
|
+
}
|
|
34126
|
+
)
|
|
34127
|
+
]
|
|
34128
|
+
}
|
|
34129
|
+
);
|
|
34130
|
+
}
|
|
34131
|
+
);
|
|
34132
|
+
ContentProtection.displayName = "ContentProtection";
|
|
34133
|
+
|
|
34134
|
+
// ../cookie-consent/dist/index.js
|
|
34135
|
+
var DEFAULT_KEY = "rfr-cookie-consent";
|
|
34136
|
+
var DEFAULT_CATEGORIES = [
|
|
34137
|
+
{ id: "necessary", label: "Strictly necessary", description: "Required for the site to function. Always on.", required: true },
|
|
34138
|
+
{ id: "preferences", label: "Preferences", description: "Remembers your settings and choices." },
|
|
34139
|
+
{ id: "analytics", label: "Analytics", description: "Helps us understand how the site is used." },
|
|
34140
|
+
{ id: "marketing", label: "Marketing", description: "Used to personalize ads and measure campaigns." }
|
|
34141
|
+
];
|
|
34142
|
+
function baseline(categories) {
|
|
34143
|
+
const p2 = {};
|
|
34144
|
+
for (const c2 of categories) p2[c2.id] = !!c2.required;
|
|
34145
|
+
return p2;
|
|
34146
|
+
}
|
|
34147
|
+
function createCookieConsent(config = {}) {
|
|
34148
|
+
const categories = config.categories ?? DEFAULT_CATEGORIES;
|
|
34149
|
+
const storage = config.storage;
|
|
34150
|
+
const key = config.storageKey ?? DEFAULT_KEY;
|
|
34151
|
+
const version2 = config.version;
|
|
34152
|
+
let preferences = baseline(categories);
|
|
34153
|
+
let consented = false;
|
|
34154
|
+
const raw = storage?.get(key) ?? null;
|
|
34155
|
+
if (raw) {
|
|
34156
|
+
try {
|
|
34157
|
+
const parsed = JSON.parse(raw);
|
|
34158
|
+
if ((parsed.version ?? void 0) === version2) {
|
|
34159
|
+
preferences = { ...baseline(categories), ...parsed.preferences };
|
|
34160
|
+
for (const c2 of categories) if (c2.required) preferences[c2.id] = true;
|
|
34161
|
+
consented = true;
|
|
34162
|
+
}
|
|
34163
|
+
} catch {
|
|
34164
|
+
}
|
|
34165
|
+
}
|
|
34166
|
+
let open = !consented;
|
|
34167
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
34168
|
+
let snapshot = build();
|
|
34169
|
+
function build() {
|
|
34170
|
+
return { consented, preferences: { ...preferences }, open, categories };
|
|
34171
|
+
}
|
|
34172
|
+
function emit2() {
|
|
34173
|
+
snapshot = build();
|
|
34174
|
+
for (const l2 of listeners) l2();
|
|
34175
|
+
}
|
|
34176
|
+
function persist() {
|
|
34177
|
+
storage?.set(key, JSON.stringify({ version: version2, preferences }));
|
|
34178
|
+
config.onChange?.({ ...preferences });
|
|
34179
|
+
}
|
|
34180
|
+
function save(next) {
|
|
34181
|
+
const merged = { ...baseline(categories), ...next };
|
|
34182
|
+
for (const c2 of categories) if (c2.required) merged[c2.id] = true;
|
|
34183
|
+
preferences = merged;
|
|
34184
|
+
consented = true;
|
|
34185
|
+
open = false;
|
|
34186
|
+
persist();
|
|
34187
|
+
emit2();
|
|
34188
|
+
}
|
|
34189
|
+
return {
|
|
34190
|
+
getState() {
|
|
34191
|
+
return snapshot;
|
|
34192
|
+
},
|
|
34193
|
+
subscribe(listener) {
|
|
34194
|
+
listeners.add(listener);
|
|
34195
|
+
return () => listeners.delete(listener);
|
|
34196
|
+
},
|
|
34197
|
+
acceptAll() {
|
|
34198
|
+
const all = {};
|
|
34199
|
+
for (const c2 of categories) all[c2.id] = true;
|
|
34200
|
+
save(all);
|
|
34201
|
+
},
|
|
34202
|
+
rejectAll() {
|
|
34203
|
+
save(baseline(categories));
|
|
34204
|
+
},
|
|
34205
|
+
savePreferences(prefs) {
|
|
34206
|
+
save(prefs);
|
|
34207
|
+
},
|
|
34208
|
+
setPreference(id, value) {
|
|
34209
|
+
const cat = categories.find((c2) => c2.id === id);
|
|
34210
|
+
if (!cat || cat.required) return;
|
|
34211
|
+
preferences = { ...preferences, [id]: value };
|
|
34212
|
+
emit2();
|
|
34213
|
+
},
|
|
34214
|
+
reset() {
|
|
34215
|
+
storage?.remove(key);
|
|
34216
|
+
preferences = baseline(categories);
|
|
34217
|
+
consented = false;
|
|
34218
|
+
open = true;
|
|
34219
|
+
emit2();
|
|
34220
|
+
},
|
|
34221
|
+
openSettings() {
|
|
34222
|
+
if (open) return;
|
|
34223
|
+
open = true;
|
|
34224
|
+
emit2();
|
|
34225
|
+
},
|
|
34226
|
+
close() {
|
|
34227
|
+
if (!open) return;
|
|
34228
|
+
open = false;
|
|
34229
|
+
emit2();
|
|
34230
|
+
}
|
|
34231
|
+
};
|
|
34232
|
+
}
|
|
34233
|
+
|
|
34234
|
+
// ../react-cookie-consent/dist/index.js
|
|
34235
|
+
var localStorageAdapter = {
|
|
34236
|
+
get(k2) {
|
|
34237
|
+
try {
|
|
34238
|
+
return typeof localStorage !== "undefined" ? localStorage.getItem(k2) : null;
|
|
34239
|
+
} catch {
|
|
34240
|
+
return null;
|
|
34241
|
+
}
|
|
34242
|
+
},
|
|
34243
|
+
set(k2, v2) {
|
|
34244
|
+
try {
|
|
34245
|
+
localStorage?.setItem(k2, v2);
|
|
34246
|
+
} catch {
|
|
34247
|
+
}
|
|
34248
|
+
},
|
|
34249
|
+
remove(k2) {
|
|
34250
|
+
try {
|
|
34251
|
+
localStorage?.removeItem(k2);
|
|
34252
|
+
} catch {
|
|
34253
|
+
}
|
|
34254
|
+
}
|
|
34255
|
+
};
|
|
34256
|
+
function useCookieConsent(config) {
|
|
34257
|
+
const apiRef = React11__namespace.useRef(null);
|
|
34258
|
+
if (apiRef.current === null) {
|
|
34259
|
+
apiRef.current = createCookieConsent({ storage: localStorageAdapter, ...config });
|
|
34260
|
+
}
|
|
34261
|
+
const api = apiRef.current;
|
|
34262
|
+
const state = React11__namespace.useSyncExternalStore(api.subscribe, api.getState, api.getState);
|
|
34263
|
+
return {
|
|
34264
|
+
state,
|
|
34265
|
+
api,
|
|
34266
|
+
acceptAll: api.acceptAll,
|
|
34267
|
+
rejectAll: api.rejectAll,
|
|
34268
|
+
savePreferences: api.savePreferences,
|
|
34269
|
+
setPreference: api.setPreference,
|
|
34270
|
+
reset: api.reset,
|
|
34271
|
+
openSettings: api.openSettings,
|
|
34272
|
+
close: api.close
|
|
34273
|
+
};
|
|
34274
|
+
}
|
|
34275
|
+
var h3 = React11__namespace.createElement;
|
|
34276
|
+
var btnPrimary = "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:opacity-90";
|
|
34277
|
+
var btnGhost = "rounded-md border border-border px-3 py-1.5 text-sm hover:bg-accent";
|
|
34278
|
+
var btnLink = "text-sm text-muted-foreground underline hover:text-foreground";
|
|
34279
|
+
function CookieConsent({
|
|
34280
|
+
consent,
|
|
34281
|
+
position = "bottom",
|
|
34282
|
+
title = "We use cookies",
|
|
34283
|
+
description = "We use cookies to run the site, remember your preferences, and measure traffic. Choose which categories to allow.",
|
|
34284
|
+
policyUrl,
|
|
34285
|
+
policyLabel = "Cookie policy",
|
|
34286
|
+
className
|
|
34287
|
+
}) {
|
|
34288
|
+
const { state, acceptAll, rejectAll, savePreferences, setPreference } = consent;
|
|
34289
|
+
const [settings, setSettings] = React11__namespace.useState(false);
|
|
34290
|
+
if (!state.open) return null;
|
|
34291
|
+
const wrapper = cn(
|
|
34292
|
+
"fixed inset-x-0 z-50 p-4",
|
|
34293
|
+
position === "bottom" ? "bottom-0" : "top-0",
|
|
34294
|
+
className
|
|
34295
|
+
);
|
|
34296
|
+
const panel = "mx-auto max-w-3xl rounded-xl border border-border bg-background p-4 shadow-lg";
|
|
34297
|
+
const header = h3(
|
|
34298
|
+
"div",
|
|
34299
|
+
null,
|
|
34300
|
+
h3("h2", { className: "text-base font-semibold" }, title),
|
|
34301
|
+
h3("p", { className: "mt-1 text-sm text-muted-foreground" }, description),
|
|
34302
|
+
policyUrl ? h3("a", { href: policyUrl, target: "_blank", rel: "noreferrer", className: cn(btnLink, "mt-1 inline-block") }, policyLabel) : null
|
|
34303
|
+
);
|
|
34304
|
+
const promptActions = h3(
|
|
34305
|
+
"div",
|
|
34306
|
+
{ className: "mt-3 flex flex-wrap items-center gap-2" },
|
|
34307
|
+
h3("button", { type: "button", className: btnPrimary, onClick: () => acceptAll() }, "Accept all"),
|
|
34308
|
+
h3("button", { type: "button", className: btnGhost, onClick: () => rejectAll() }, "Reject all"),
|
|
34309
|
+
h3("button", { type: "button", className: cn(btnGhost, "ml-auto"), onClick: () => setSettings(true) }, "Manage preferences")
|
|
34310
|
+
);
|
|
34311
|
+
const settingsView = h3(
|
|
34312
|
+
"div",
|
|
34313
|
+
{ className: "mt-3 space-y-2" },
|
|
34314
|
+
...state.categories.map(
|
|
34315
|
+
(cat) => h3(
|
|
34316
|
+
"label",
|
|
34317
|
+
{
|
|
34318
|
+
key: cat.id,
|
|
34319
|
+
className: "flex items-start justify-between gap-3 rounded-md border border-border p-3"
|
|
34320
|
+
},
|
|
34321
|
+
h3(
|
|
34322
|
+
"span",
|
|
34323
|
+
{ className: "min-w-0" },
|
|
34324
|
+
h3("span", { className: "block text-sm font-medium" }, cat.label, cat.required ? " (required)" : ""),
|
|
34325
|
+
cat.description ? h3("span", { className: "block text-xs text-muted-foreground" }, cat.description) : null
|
|
34326
|
+
),
|
|
34327
|
+
h3("input", {
|
|
34328
|
+
type: "checkbox",
|
|
34329
|
+
className: "mt-0.5 h-4 w-4 accent-[hsl(var(--primary))]",
|
|
34330
|
+
checked: !!state.preferences[cat.id],
|
|
34331
|
+
disabled: cat.required,
|
|
34332
|
+
"aria-label": cat.label,
|
|
34333
|
+
onChange: (e2) => setPreference(cat.id, e2.target.checked)
|
|
34334
|
+
})
|
|
34335
|
+
)
|
|
34336
|
+
),
|
|
34337
|
+
h3(
|
|
34338
|
+
"div",
|
|
34339
|
+
{ className: "flex flex-wrap items-center gap-2 pt-1" },
|
|
34340
|
+
h3("button", { type: "button", className: btnPrimary, onClick: () => savePreferences(state.preferences) }, "Save preferences"),
|
|
34341
|
+
h3("button", { type: "button", className: btnGhost, onClick: () => acceptAll() }, "Accept all"),
|
|
34342
|
+
h3("button", { type: "button", className: cn(btnLink, "ml-auto"), onClick: () => setSettings(false) }, "Back")
|
|
34343
|
+
)
|
|
34344
|
+
);
|
|
34345
|
+
return h3(
|
|
34346
|
+
"div",
|
|
34347
|
+
{ className: wrapper, role: "dialog", "aria-label": "Cookie consent", "aria-modal": false },
|
|
34348
|
+
h3("div", { className: panel }, header, settings ? settingsView : promptActions)
|
|
34349
|
+
);
|
|
34350
|
+
}
|
|
34351
|
+
|
|
34352
|
+
// ../data-table/dist/index.js
|
|
34353
|
+
function createDataTable(props) {
|
|
34354
|
+
const {
|
|
34355
|
+
columns,
|
|
34356
|
+
data,
|
|
34357
|
+
sortBy: initialSortBy,
|
|
34358
|
+
sortDir: initialSortDir = "asc",
|
|
34359
|
+
onSort,
|
|
34360
|
+
filters: initialFilters
|
|
34361
|
+
} = props;
|
|
34362
|
+
let sortBy = initialSortBy ?? null;
|
|
34363
|
+
let sortDir = initialSortDir;
|
|
34364
|
+
let filters = { ...initialFilters ?? {} };
|
|
34365
|
+
function getFilteredData() {
|
|
34366
|
+
let result = [...data];
|
|
34367
|
+
for (const [columnId, filterValue] of Object.entries(filters)) {
|
|
34368
|
+
if (!filterValue) continue;
|
|
34369
|
+
const col = columns.find((c2) => c2.id === columnId);
|
|
34370
|
+
if (!col) continue;
|
|
34371
|
+
const lowerFilter = filterValue.toLowerCase();
|
|
34372
|
+
result = result.filter((row) => {
|
|
34373
|
+
const cellValue = col.accessor(row);
|
|
34374
|
+
return String(cellValue ?? "").toLowerCase().includes(lowerFilter);
|
|
34375
|
+
});
|
|
34376
|
+
}
|
|
34377
|
+
return result;
|
|
34378
|
+
}
|
|
34379
|
+
function getSortedData() {
|
|
34380
|
+
const filtered = getFilteredData();
|
|
34381
|
+
if (!sortBy) return filtered;
|
|
34382
|
+
const col = columns.find((c2) => c2.id === sortBy);
|
|
34383
|
+
if (!col) return filtered;
|
|
34384
|
+
return [...filtered].sort((a2, b2) => {
|
|
34385
|
+
const aVal = col.accessor(a2);
|
|
34386
|
+
const bVal = col.accessor(b2);
|
|
34387
|
+
const aStr = String(aVal ?? "");
|
|
34388
|
+
const bStr = String(bVal ?? "");
|
|
34389
|
+
const cmp = aStr.localeCompare(bStr, void 0, { numeric: true });
|
|
34390
|
+
return sortDir === "asc" ? cmp : -cmp;
|
|
34391
|
+
});
|
|
34392
|
+
}
|
|
34393
|
+
function sort(columnId) {
|
|
34394
|
+
const col = columns.find((c2) => c2.id === columnId);
|
|
34395
|
+
if (!col?.sortable) return;
|
|
34396
|
+
if (sortBy === columnId) {
|
|
34397
|
+
sortDir = sortDir === "asc" ? "desc" : "asc";
|
|
34398
|
+
} else {
|
|
34399
|
+
sortBy = columnId;
|
|
34400
|
+
sortDir = "asc";
|
|
34401
|
+
}
|
|
34402
|
+
onSort?.(sortBy, sortDir);
|
|
34403
|
+
}
|
|
34404
|
+
function setFilter(columnId, value) {
|
|
34405
|
+
filters = { ...filters, [columnId]: value };
|
|
34406
|
+
}
|
|
34407
|
+
function getHeaderProps(col) {
|
|
34408
|
+
const props2 = {
|
|
34409
|
+
role: "columnheader"
|
|
34410
|
+
};
|
|
34411
|
+
if (col.sortable) {
|
|
34412
|
+
if (sortBy === col.id) {
|
|
34413
|
+
props2["aria-sort"] = sortDir === "asc" ? "ascending" : "descending";
|
|
34414
|
+
} else {
|
|
34415
|
+
props2["aria-sort"] = "none";
|
|
34416
|
+
}
|
|
34417
|
+
}
|
|
34418
|
+
return props2;
|
|
34419
|
+
}
|
|
34420
|
+
function getCellProps(col, _row) {
|
|
34421
|
+
return {
|
|
34422
|
+
role: "cell",
|
|
34423
|
+
"data-column": col.id
|
|
34424
|
+
};
|
|
34425
|
+
}
|
|
34426
|
+
function getRowProps(_row, index) {
|
|
34427
|
+
return {
|
|
34428
|
+
role: "row",
|
|
34429
|
+
"data-row-index": index
|
|
34430
|
+
};
|
|
34431
|
+
}
|
|
34432
|
+
return {
|
|
34433
|
+
get state() {
|
|
34434
|
+
return {
|
|
34435
|
+
get sortedData() {
|
|
34436
|
+
return getSortedData();
|
|
34437
|
+
},
|
|
34438
|
+
get sortBy() {
|
|
34439
|
+
return sortBy;
|
|
34440
|
+
},
|
|
34441
|
+
get sortDir() {
|
|
34442
|
+
return sortDir;
|
|
34443
|
+
},
|
|
34444
|
+
get filters() {
|
|
34445
|
+
return { ...filters };
|
|
34446
|
+
}
|
|
34447
|
+
};
|
|
34448
|
+
},
|
|
34449
|
+
sort,
|
|
34450
|
+
setFilter,
|
|
34451
|
+
getHeaderProps,
|
|
34452
|
+
getCellProps,
|
|
34453
|
+
getRowProps
|
|
34454
|
+
};
|
|
34455
|
+
}
|
|
34456
|
+
var tableVariants = cva({
|
|
34457
|
+
base: "w-full caption-bottom text-sm border-collapse",
|
|
34458
|
+
variants: {
|
|
34459
|
+
size: {
|
|
34460
|
+
sm: "text-xs",
|
|
34461
|
+
md: "text-sm",
|
|
34462
|
+
lg: "text-base"
|
|
34463
|
+
}
|
|
34464
|
+
},
|
|
34465
|
+
defaultVariants: {
|
|
34466
|
+
size: "md"
|
|
34467
|
+
}
|
|
32846
34468
|
});
|
|
32847
34469
|
var headerVariants = cva({
|
|
32848
34470
|
base: "h-10 px-2 text-left align-middle font-medium text-muted-foreground border-b",
|
|
@@ -34251,460 +35873,251 @@ Input.displayName = "Input";
|
|
|
34251
35873
|
function createInputGroup(props = {}) {
|
|
34252
35874
|
const { orientation = "horizontal" } = props;
|
|
34253
35875
|
const id = props.id ?? generateId("rfr-input-group");
|
|
34254
|
-
const ariaProps = {
|
|
34255
|
-
role: "group"
|
|
34256
|
-
};
|
|
34257
|
-
if (props["aria-label"]) {
|
|
34258
|
-
ariaProps["aria-label"] = props["aria-label"];
|
|
34259
|
-
}
|
|
34260
|
-
if (props["aria-labelledby"]) {
|
|
34261
|
-
ariaProps["aria-labelledby"] = props["aria-labelledby"];
|
|
34262
|
-
}
|
|
34263
|
-
const dataAttributes = {
|
|
34264
|
-
"data-orientation": orientation,
|
|
34265
|
-
id
|
|
34266
|
-
};
|
|
34267
|
-
return {
|
|
34268
|
-
ariaProps,
|
|
34269
|
-
dataAttributes
|
|
34270
|
-
};
|
|
34271
|
-
}
|
|
34272
|
-
var inputGroupTokens = {
|
|
34273
|
-
name: "input-group",
|
|
34274
|
-
tokens: {
|
|
34275
|
-
bg: { variable: "--rfr-input-group-bg", fallback: "hsl(var(--background))" },
|
|
34276
|
-
border: { variable: "--rfr-input-group-border", fallback: "hsl(var(--border))" },
|
|
34277
|
-
radius: { variable: "--rfr-input-group-radius", fallback: "var(--radius)" }
|
|
34278
|
-
}
|
|
34279
|
-
};
|
|
34280
|
-
var inputGroupVariants = cva({
|
|
34281
|
-
base: "flex items-stretch [&>*:not(:first-child):not(:last-child)]:rounded-none",
|
|
34282
|
-
variants: {
|
|
34283
|
-
orientation: {
|
|
34284
|
-
horizontal: "flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none",
|
|
34285
|
-
vertical: "flex-col [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none"
|
|
34286
|
-
}
|
|
34287
|
-
},
|
|
34288
|
-
defaultVariants: {
|
|
34289
|
-
orientation: "horizontal"
|
|
34290
|
-
}
|
|
34291
|
-
});
|
|
34292
|
-
var inputGroupAddonVariants = cva({
|
|
34293
|
-
base: "flex items-center justify-center border bg-muted px-3 text-sm text-muted-foreground",
|
|
34294
|
-
variants: {
|
|
34295
|
-
orientation: {
|
|
34296
|
-
horizontal: "border-y border-x first:border-r-0 last:border-l-0",
|
|
34297
|
-
vertical: "border-x border-y first:border-b-0 last:border-t-0"
|
|
34298
|
-
}
|
|
34299
|
-
},
|
|
34300
|
-
defaultVariants: {
|
|
34301
|
-
orientation: "horizontal"
|
|
34302
|
-
}
|
|
34303
|
-
});
|
|
34304
|
-
var inputGroupButtonVariants = cva({
|
|
34305
|
-
base: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
34306
|
-
variants: {
|
|
34307
|
-
orientation: {
|
|
34308
|
-
horizontal: "",
|
|
34309
|
-
vertical: ""
|
|
34310
|
-
}
|
|
34311
|
-
},
|
|
34312
|
-
defaultVariants: {
|
|
34313
|
-
orientation: "horizontal"
|
|
34314
|
-
}
|
|
34315
|
-
});
|
|
34316
|
-
var InputGroup = React11__namespace.forwardRef(
|
|
34317
|
-
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
34318
|
-
const api = createInputGroup({
|
|
34319
|
-
orientation,
|
|
34320
|
-
id: props.id,
|
|
34321
|
-
"aria-label": props["aria-label"],
|
|
34322
|
-
"aria-labelledby": props["aria-labelledby"]
|
|
34323
|
-
});
|
|
34324
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34325
|
-
"div",
|
|
34326
|
-
{
|
|
34327
|
-
ref,
|
|
34328
|
-
className: cn(inputGroupVariants({ orientation }), className),
|
|
34329
|
-
...api.ariaProps,
|
|
34330
|
-
...api.dataAttributes,
|
|
34331
|
-
...props,
|
|
34332
|
-
children
|
|
34333
|
-
}
|
|
34334
|
-
);
|
|
34335
|
-
}
|
|
34336
|
-
);
|
|
34337
|
-
InputGroup.displayName = "InputGroup";
|
|
34338
|
-
var InputGroupAddon = React11__namespace.forwardRef(
|
|
34339
|
-
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
34340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34341
|
-
"div",
|
|
34342
|
-
{
|
|
34343
|
-
ref,
|
|
34344
|
-
className: cn(inputGroupAddonVariants({ orientation }), className),
|
|
34345
|
-
...props,
|
|
34346
|
-
children
|
|
34347
|
-
}
|
|
34348
|
-
);
|
|
34349
|
-
}
|
|
34350
|
-
);
|
|
34351
|
-
InputGroupAddon.displayName = "InputGroupAddon";
|
|
34352
|
-
var InputGroupText = React11__namespace.forwardRef(
|
|
34353
|
-
({ className, children, ...props }, ref) => {
|
|
34354
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34355
|
-
"span",
|
|
34356
|
-
{
|
|
34357
|
-
ref,
|
|
34358
|
-
className: cn("flex items-center px-3 text-sm text-muted-foreground", className),
|
|
34359
|
-
...props,
|
|
34360
|
-
children
|
|
34361
|
-
}
|
|
34362
|
-
);
|
|
34363
|
-
}
|
|
34364
|
-
);
|
|
34365
|
-
InputGroupText.displayName = "InputGroupText";
|
|
34366
|
-
var InputGroupButton = React11__namespace.forwardRef(
|
|
34367
|
-
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
34368
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34369
|
-
"button",
|
|
34370
|
-
{
|
|
34371
|
-
ref,
|
|
34372
|
-
type: props.type ?? "button",
|
|
34373
|
-
className: cn(inputGroupButtonVariants({ orientation }), className),
|
|
34374
|
-
...props,
|
|
34375
|
-
children
|
|
34376
|
-
}
|
|
34377
|
-
);
|
|
34378
|
-
}
|
|
34379
|
-
);
|
|
34380
|
-
InputGroupButton.displayName = "InputGroupButton";
|
|
34381
|
-
|
|
34382
|
-
// ../install-prompt/dist/index.js
|
|
34383
|
-
function createInstallPrompt(props = {}, storage) {
|
|
34384
|
-
const { storageKey = "rfr-install-dismissed" } = props;
|
|
34385
|
-
const dismissed = storage?.get(storageKey) === "true";
|
|
34386
|
-
const state = {
|
|
34387
|
-
canShow: false,
|
|
34388
|
-
isDismissed: dismissed
|
|
34389
|
-
};
|
|
34390
|
-
return {
|
|
34391
|
-
state,
|
|
34392
|
-
show() {
|
|
34393
|
-
if (!state.isDismissed) {
|
|
34394
|
-
state.canShow = true;
|
|
34395
|
-
}
|
|
34396
|
-
},
|
|
34397
|
-
dismiss() {
|
|
34398
|
-
state.canShow = false;
|
|
34399
|
-
state.isDismissed = true;
|
|
34400
|
-
storage?.set(storageKey, "true");
|
|
34401
|
-
},
|
|
34402
|
-
install(promptEvent) {
|
|
34403
|
-
promptEvent?.prompt();
|
|
34404
|
-
state.canShow = false;
|
|
34405
|
-
},
|
|
34406
|
-
ariaProps: {
|
|
34407
|
-
role: "banner",
|
|
34408
|
-
"aria-label": "Install application"
|
|
34409
|
-
}
|
|
34410
|
-
};
|
|
34411
|
-
}
|
|
34412
|
-
var installPromptVariants = cva({
|
|
34413
|
-
base: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-between gap-4 border-t bg-background px-4 py-3 shadow-lg"
|
|
34414
|
-
});
|
|
34415
|
-
function createLocalStorage() {
|
|
34416
|
-
return {
|
|
34417
|
-
get(key) {
|
|
34418
|
-
try {
|
|
34419
|
-
return localStorage.getItem(key);
|
|
34420
|
-
} catch {
|
|
34421
|
-
return null;
|
|
34422
|
-
}
|
|
34423
|
-
},
|
|
34424
|
-
set(key, value) {
|
|
34425
|
-
try {
|
|
34426
|
-
localStorage.setItem(key, value);
|
|
34427
|
-
} catch {
|
|
34428
|
-
}
|
|
34429
|
-
}
|
|
34430
|
-
};
|
|
34431
|
-
}
|
|
34432
|
-
var InstallPrompt = React11__namespace.forwardRef(
|
|
34433
|
-
({
|
|
34434
|
-
delay = 3e3,
|
|
34435
|
-
storageKey,
|
|
34436
|
-
installLabel = "Install",
|
|
34437
|
-
dismissLabel = "Dismiss",
|
|
34438
|
-
message = "Install this app for a better experience",
|
|
34439
|
-
className,
|
|
34440
|
-
...props
|
|
34441
|
-
}, ref) => {
|
|
34442
|
-
const storageRef = React11__namespace.useRef(void 0);
|
|
34443
|
-
if (typeof window !== "undefined" && !storageRef.current) {
|
|
34444
|
-
storageRef.current = createLocalStorage();
|
|
34445
|
-
}
|
|
34446
|
-
const api = createInstallPrompt({ storageKey }, storageRef.current);
|
|
34447
|
-
const [visible, setVisible] = React11__namespace.useState(false);
|
|
34448
|
-
const promptEventRef = React11__namespace.useRef(null);
|
|
34449
|
-
React11__namespace.useEffect(() => {
|
|
34450
|
-
if (api.state.isDismissed) return;
|
|
34451
|
-
const handleBeforeInstall = (e2) => {
|
|
34452
|
-
e2.preventDefault();
|
|
34453
|
-
promptEventRef.current = e2;
|
|
34454
|
-
};
|
|
34455
|
-
window.addEventListener("beforeinstallprompt", handleBeforeInstall);
|
|
34456
|
-
const timer = setTimeout(() => {
|
|
34457
|
-
if (promptEventRef.current && !api.state.isDismissed) {
|
|
34458
|
-
api.show();
|
|
34459
|
-
setVisible(true);
|
|
34460
|
-
}
|
|
34461
|
-
}, delay);
|
|
34462
|
-
return () => {
|
|
34463
|
-
window.removeEventListener("beforeinstallprompt", handleBeforeInstall);
|
|
34464
|
-
clearTimeout(timer);
|
|
34465
|
-
};
|
|
34466
|
-
}, [delay, api]);
|
|
34467
|
-
if (!visible) return null;
|
|
34468
|
-
const classes = cn(installPromptVariants(), className);
|
|
34469
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: classes, ...api.ariaProps, ...props, children: [
|
|
34470
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: message }),
|
|
34471
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
34472
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34473
|
-
"button",
|
|
34474
|
-
{
|
|
34475
|
-
type: "button",
|
|
34476
|
-
onClick: () => {
|
|
34477
|
-
api.install(promptEventRef.current ?? void 0);
|
|
34478
|
-
setVisible(false);
|
|
34479
|
-
},
|
|
34480
|
-
children: installLabel
|
|
34481
|
-
}
|
|
34482
|
-
),
|
|
34483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34484
|
-
"button",
|
|
34485
|
-
{
|
|
34486
|
-
type: "button",
|
|
34487
|
-
onClick: () => {
|
|
34488
|
-
api.dismiss();
|
|
34489
|
-
setVisible(false);
|
|
34490
|
-
},
|
|
34491
|
-
children: dismissLabel
|
|
34492
|
-
}
|
|
34493
|
-
)
|
|
34494
|
-
] })
|
|
34495
|
-
] });
|
|
35876
|
+
const ariaProps = {
|
|
35877
|
+
role: "group"
|
|
35878
|
+
};
|
|
35879
|
+
if (props["aria-label"]) {
|
|
35880
|
+
ariaProps["aria-label"] = props["aria-label"];
|
|
34496
35881
|
}
|
|
34497
|
-
)
|
|
34498
|
-
|
|
34499
|
-
|
|
34500
|
-
|
|
34501
|
-
|
|
34502
|
-
|
|
34503
|
-
}
|
|
34504
|
-
|
|
34505
|
-
|
|
34506
|
-
|
|
34507
|
-
|
|
34508
|
-
result = result.replace(/__([^_]+)__/g, "<strong>$1</strong>");
|
|
34509
|
-
result = result.replace(/\*([^*]+)\*/g, "<em>$1</em>");
|
|
34510
|
-
result = result.replace(/_([^_]+)_/g, "<em>$1</em>");
|
|
34511
|
-
result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, text2, url) => {
|
|
34512
|
-
if (/^\s*javascript\s*:/i.test(url)) {
|
|
34513
|
-
return text2;
|
|
34514
|
-
}
|
|
34515
|
-
const resolvedUrl = linkResolver ? linkResolver(url) : url;
|
|
34516
|
-
return `<a href="${resolvedUrl}">${text2}</a>`;
|
|
34517
|
-
});
|
|
34518
|
-
return result;
|
|
35882
|
+
if (props["aria-labelledby"]) {
|
|
35883
|
+
ariaProps["aria-labelledby"] = props["aria-labelledby"];
|
|
35884
|
+
}
|
|
35885
|
+
const dataAttributes = {
|
|
35886
|
+
"data-orientation": orientation,
|
|
35887
|
+
id
|
|
35888
|
+
};
|
|
35889
|
+
return {
|
|
35890
|
+
ariaProps,
|
|
35891
|
+
dataAttributes
|
|
35892
|
+
};
|
|
34519
35893
|
}
|
|
34520
|
-
|
|
34521
|
-
|
|
34522
|
-
|
|
34523
|
-
|
|
34524
|
-
|
|
34525
|
-
|
|
34526
|
-
let inList = null;
|
|
34527
|
-
let inBlockquote = false;
|
|
34528
|
-
function closeList() {
|
|
34529
|
-
if (inList) {
|
|
34530
|
-
outputLines.push(inList === "ul" ? "</ul>" : "</ol>");
|
|
34531
|
-
inList = null;
|
|
34532
|
-
}
|
|
35894
|
+
var inputGroupTokens = {
|
|
35895
|
+
name: "input-group",
|
|
35896
|
+
tokens: {
|
|
35897
|
+
bg: { variable: "--rfr-input-group-bg", fallback: "hsl(var(--background))" },
|
|
35898
|
+
border: { variable: "--rfr-input-group-border", fallback: "hsl(var(--border))" },
|
|
35899
|
+
radius: { variable: "--rfr-input-group-radius", fallback: "var(--radius)" }
|
|
34533
35900
|
}
|
|
34534
|
-
|
|
34535
|
-
|
|
34536
|
-
|
|
34537
|
-
|
|
35901
|
+
};
|
|
35902
|
+
var inputGroupVariants = cva({
|
|
35903
|
+
base: "flex items-stretch [&>*:not(:first-child):not(:last-child)]:rounded-none",
|
|
35904
|
+
variants: {
|
|
35905
|
+
orientation: {
|
|
35906
|
+
horizontal: "flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none",
|
|
35907
|
+
vertical: "flex-col [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none"
|
|
34538
35908
|
}
|
|
35909
|
+
},
|
|
35910
|
+
defaultVariants: {
|
|
35911
|
+
orientation: "horizontal"
|
|
34539
35912
|
}
|
|
34540
|
-
|
|
34541
|
-
|
|
34542
|
-
|
|
34543
|
-
|
|
34544
|
-
|
|
34545
|
-
|
|
34546
|
-
|
|
34547
|
-
inCodeBlock = false;
|
|
34548
|
-
} else {
|
|
34549
|
-
closeList();
|
|
34550
|
-
closeBlockquote();
|
|
34551
|
-
inCodeBlock = true;
|
|
34552
|
-
codeBlockLang = line.trimStart().slice(3).trim();
|
|
34553
|
-
}
|
|
34554
|
-
continue;
|
|
34555
|
-
}
|
|
34556
|
-
if (inCodeBlock) {
|
|
34557
|
-
codeBlockContent.push(line);
|
|
34558
|
-
continue;
|
|
34559
|
-
}
|
|
34560
|
-
if (/^(\s*[-*_]\s*){3,}$/.test(line)) {
|
|
34561
|
-
closeList();
|
|
34562
|
-
closeBlockquote();
|
|
34563
|
-
outputLines.push("<hr />");
|
|
34564
|
-
continue;
|
|
34565
|
-
}
|
|
34566
|
-
const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
34567
|
-
if (headingMatch) {
|
|
34568
|
-
closeList();
|
|
34569
|
-
closeBlockquote();
|
|
34570
|
-
const level = headingMatch[1].length;
|
|
34571
|
-
const text = parseInline(headingMatch[2], linkResolver);
|
|
34572
|
-
outputLines.push(`<h${level}>${text}</h${level}>`);
|
|
34573
|
-
continue;
|
|
35913
|
+
});
|
|
35914
|
+
var inputGroupAddonVariants = cva({
|
|
35915
|
+
base: "flex items-center justify-center border bg-muted px-3 text-sm text-muted-foreground",
|
|
35916
|
+
variants: {
|
|
35917
|
+
orientation: {
|
|
35918
|
+
horizontal: "border-y border-x first:border-r-0 last:border-l-0",
|
|
35919
|
+
vertical: "border-x border-y first:border-b-0 last:border-t-0"
|
|
34574
35920
|
}
|
|
34575
|
-
|
|
34576
|
-
|
|
34577
|
-
|
|
34578
|
-
|
|
34579
|
-
|
|
34580
|
-
|
|
34581
|
-
|
|
34582
|
-
|
|
34583
|
-
|
|
34584
|
-
|
|
34585
|
-
|
|
34586
|
-
continue;
|
|
34587
|
-
} else if (inBlockquote) {
|
|
34588
|
-
closeBlockquote();
|
|
35921
|
+
},
|
|
35922
|
+
defaultVariants: {
|
|
35923
|
+
orientation: "horizontal"
|
|
35924
|
+
}
|
|
35925
|
+
});
|
|
35926
|
+
var inputGroupButtonVariants = cva({
|
|
35927
|
+
base: "relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
35928
|
+
variants: {
|
|
35929
|
+
orientation: {
|
|
35930
|
+
horizontal: "",
|
|
35931
|
+
vertical: ""
|
|
34589
35932
|
}
|
|
34590
|
-
|
|
34591
|
-
|
|
34592
|
-
|
|
34593
|
-
|
|
34594
|
-
|
|
34595
|
-
|
|
34596
|
-
|
|
35933
|
+
},
|
|
35934
|
+
defaultVariants: {
|
|
35935
|
+
orientation: "horizontal"
|
|
35936
|
+
}
|
|
35937
|
+
});
|
|
35938
|
+
var InputGroup = React11__namespace.forwardRef(
|
|
35939
|
+
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
35940
|
+
const api = createInputGroup({
|
|
35941
|
+
orientation,
|
|
35942
|
+
id: props.id,
|
|
35943
|
+
"aria-label": props["aria-label"],
|
|
35944
|
+
"aria-labelledby": props["aria-labelledby"]
|
|
35945
|
+
});
|
|
35946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35947
|
+
"div",
|
|
35948
|
+
{
|
|
35949
|
+
ref,
|
|
35950
|
+
className: cn(inputGroupVariants({ orientation }), className),
|
|
35951
|
+
...api.ariaProps,
|
|
35952
|
+
...api.dataAttributes,
|
|
35953
|
+
...props,
|
|
35954
|
+
children
|
|
34597
35955
|
}
|
|
34598
|
-
|
|
34599
|
-
|
|
34600
|
-
|
|
34601
|
-
|
|
34602
|
-
|
|
34603
|
-
|
|
34604
|
-
|
|
34605
|
-
|
|
34606
|
-
|
|
34607
|
-
|
|
35956
|
+
);
|
|
35957
|
+
}
|
|
35958
|
+
);
|
|
35959
|
+
InputGroup.displayName = "InputGroup";
|
|
35960
|
+
var InputGroupAddon = React11__namespace.forwardRef(
|
|
35961
|
+
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
35962
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35963
|
+
"div",
|
|
35964
|
+
{
|
|
35965
|
+
ref,
|
|
35966
|
+
className: cn(inputGroupAddonVariants({ orientation }), className),
|
|
35967
|
+
...props,
|
|
35968
|
+
children
|
|
34608
35969
|
}
|
|
34609
|
-
|
|
34610
|
-
continue;
|
|
34611
|
-
}
|
|
34612
|
-
if (inList) {
|
|
34613
|
-
closeList();
|
|
34614
|
-
}
|
|
34615
|
-
if (line.trim() === "") {
|
|
34616
|
-
continue;
|
|
34617
|
-
}
|
|
34618
|
-
outputLines.push(`<p>${parseInline(line, linkResolver)}</p>`);
|
|
35970
|
+
);
|
|
34619
35971
|
}
|
|
34620
|
-
|
|
34621
|
-
|
|
35972
|
+
);
|
|
35973
|
+
InputGroupAddon.displayName = "InputGroupAddon";
|
|
35974
|
+
var InputGroupText = React11__namespace.forwardRef(
|
|
35975
|
+
({ className, children, ...props }, ref) => {
|
|
35976
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35977
|
+
"span",
|
|
35978
|
+
{
|
|
35979
|
+
ref,
|
|
35980
|
+
className: cn("flex items-center px-3 text-sm text-muted-foreground", className),
|
|
35981
|
+
...props,
|
|
35982
|
+
children
|
|
35983
|
+
}
|
|
35984
|
+
);
|
|
34622
35985
|
}
|
|
34623
|
-
|
|
34624
|
-
|
|
34625
|
-
|
|
34626
|
-
}
|
|
34627
|
-
|
|
34628
|
-
|
|
34629
|
-
|
|
34630
|
-
|
|
34631
|
-
|
|
34632
|
-
|
|
34633
|
-
|
|
34634
|
-
|
|
34635
|
-
|
|
34636
|
-
|
|
34637
|
-
});
|
|
35986
|
+
);
|
|
35987
|
+
InputGroupText.displayName = "InputGroupText";
|
|
35988
|
+
var InputGroupButton = React11__namespace.forwardRef(
|
|
35989
|
+
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
35990
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35991
|
+
"button",
|
|
35992
|
+
{
|
|
35993
|
+
ref,
|
|
35994
|
+
type: props.type ?? "button",
|
|
35995
|
+
className: cn(inputGroupButtonVariants({ orientation }), className),
|
|
35996
|
+
...props,
|
|
35997
|
+
children
|
|
35998
|
+
}
|
|
35999
|
+
);
|
|
34638
36000
|
}
|
|
34639
|
-
|
|
34640
|
-
|
|
34641
|
-
|
|
34642
|
-
|
|
34643
|
-
|
|
34644
|
-
const
|
|
34645
|
-
const
|
|
34646
|
-
|
|
34647
|
-
|
|
36001
|
+
);
|
|
36002
|
+
InputGroupButton.displayName = "InputGroupButton";
|
|
36003
|
+
|
|
36004
|
+
// ../install-prompt/dist/index.js
|
|
36005
|
+
function createInstallPrompt(props = {}, storage) {
|
|
36006
|
+
const { storageKey = "rfr-install-dismissed" } = props;
|
|
36007
|
+
const dismissed = storage?.get(storageKey) === "true";
|
|
36008
|
+
const state = {
|
|
36009
|
+
canShow: false,
|
|
36010
|
+
isDismissed: dismissed
|
|
34648
36011
|
};
|
|
34649
36012
|
return {
|
|
34650
|
-
|
|
34651
|
-
|
|
34652
|
-
|
|
36013
|
+
state,
|
|
36014
|
+
show() {
|
|
36015
|
+
if (!state.isDismissed) {
|
|
36016
|
+
state.canShow = true;
|
|
36017
|
+
}
|
|
36018
|
+
},
|
|
36019
|
+
dismiss() {
|
|
36020
|
+
state.canShow = false;
|
|
36021
|
+
state.isDismissed = true;
|
|
36022
|
+
storage?.set(storageKey, "true");
|
|
36023
|
+
},
|
|
36024
|
+
install(promptEvent) {
|
|
36025
|
+
promptEvent?.prompt();
|
|
36026
|
+
state.canShow = false;
|
|
36027
|
+
},
|
|
36028
|
+
ariaProps: {
|
|
36029
|
+
role: "banner",
|
|
36030
|
+
"aria-label": "Install application"
|
|
36031
|
+
}
|
|
34653
36032
|
};
|
|
34654
36033
|
}
|
|
34655
|
-
var
|
|
34656
|
-
|
|
34657
|
-
|
|
34658
|
-
|
|
34659
|
-
|
|
34660
|
-
|
|
34661
|
-
|
|
34662
|
-
|
|
34663
|
-
|
|
34664
|
-
|
|
34665
|
-
|
|
34666
|
-
base: "prose max-w-none text-foreground leading-relaxed",
|
|
34667
|
-
variants: {
|
|
34668
|
-
size: {
|
|
34669
|
-
sm: "prose-sm text-sm",
|
|
34670
|
-
default: "prose-base text-base",
|
|
34671
|
-
lg: "prose-lg text-lg"
|
|
36034
|
+
var installPromptVariants = cva({
|
|
36035
|
+
base: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-between gap-4 border-t bg-background px-4 py-3 shadow-lg"
|
|
36036
|
+
});
|
|
36037
|
+
function createLocalStorage() {
|
|
36038
|
+
return {
|
|
36039
|
+
get(key) {
|
|
36040
|
+
try {
|
|
36041
|
+
return localStorage.getItem(key);
|
|
36042
|
+
} catch {
|
|
36043
|
+
return null;
|
|
36044
|
+
}
|
|
34672
36045
|
},
|
|
34673
|
-
|
|
34674
|
-
|
|
34675
|
-
|
|
36046
|
+
set(key, value) {
|
|
36047
|
+
try {
|
|
36048
|
+
localStorage.setItem(key, value);
|
|
36049
|
+
} catch {
|
|
36050
|
+
}
|
|
34676
36051
|
}
|
|
34677
|
-
}
|
|
34678
|
-
defaultVariants: {
|
|
34679
|
-
size: "default"
|
|
34680
|
-
}
|
|
34681
|
-
});
|
|
34682
|
-
function sanitizeHtml(html) {
|
|
34683
|
-
let sanitized = html;
|
|
34684
|
-
sanitized = sanitized.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
|
|
34685
|
-
sanitized = sanitized.replace(/<\/?script[^>]*>/gi, "");
|
|
34686
|
-
sanitized = sanitized.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "");
|
|
34687
|
-
sanitized = sanitized.replace(/(href|src)\s*=\s*["']?\s*javascript\s*:[^"'>]*/gi, '$1=""');
|
|
34688
|
-
return sanitized;
|
|
36052
|
+
};
|
|
34689
36053
|
}
|
|
34690
|
-
var
|
|
34691
|
-
({
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34695
|
-
|
|
34696
|
-
|
|
34697
|
-
|
|
34698
|
-
|
|
34699
|
-
|
|
34700
|
-
|
|
34701
|
-
|
|
34702
|
-
|
|
34703
|
-
|
|
34704
|
-
);
|
|
36054
|
+
var InstallPrompt = React11__namespace.forwardRef(
|
|
36055
|
+
({
|
|
36056
|
+
delay = 3e3,
|
|
36057
|
+
storageKey,
|
|
36058
|
+
installLabel = "Install",
|
|
36059
|
+
dismissLabel = "Dismiss",
|
|
36060
|
+
message = "Install this app for a better experience",
|
|
36061
|
+
className,
|
|
36062
|
+
...props
|
|
36063
|
+
}, ref) => {
|
|
36064
|
+
const storageRef = React11__namespace.useRef(void 0);
|
|
36065
|
+
if (typeof window !== "undefined" && !storageRef.current) {
|
|
36066
|
+
storageRef.current = createLocalStorage();
|
|
36067
|
+
}
|
|
36068
|
+
const api = createInstallPrompt({ storageKey }, storageRef.current);
|
|
36069
|
+
const [visible, setVisible] = React11__namespace.useState(false);
|
|
36070
|
+
const promptEventRef = React11__namespace.useRef(null);
|
|
36071
|
+
React11__namespace.useEffect(() => {
|
|
36072
|
+
if (api.state.isDismissed) return;
|
|
36073
|
+
const handleBeforeInstall = (e2) => {
|
|
36074
|
+
e2.preventDefault();
|
|
36075
|
+
promptEventRef.current = e2;
|
|
36076
|
+
};
|
|
36077
|
+
window.addEventListener("beforeinstallprompt", handleBeforeInstall);
|
|
36078
|
+
const timer = setTimeout(() => {
|
|
36079
|
+
if (promptEventRef.current && !api.state.isDismissed) {
|
|
36080
|
+
api.show();
|
|
36081
|
+
setVisible(true);
|
|
36082
|
+
}
|
|
36083
|
+
}, delay);
|
|
36084
|
+
return () => {
|
|
36085
|
+
window.removeEventListener("beforeinstallprompt", handleBeforeInstall);
|
|
36086
|
+
clearTimeout(timer);
|
|
36087
|
+
};
|
|
36088
|
+
}, [delay, api]);
|
|
36089
|
+
if (!visible) return null;
|
|
36090
|
+
const classes = cn(installPromptVariants(), className);
|
|
36091
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: classes, ...api.ariaProps, ...props, children: [
|
|
36092
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: message }),
|
|
36093
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
36094
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36095
|
+
"button",
|
|
36096
|
+
{
|
|
36097
|
+
type: "button",
|
|
36098
|
+
onClick: () => {
|
|
36099
|
+
api.install(promptEventRef.current ?? void 0);
|
|
36100
|
+
setVisible(false);
|
|
36101
|
+
},
|
|
36102
|
+
children: installLabel
|
|
36103
|
+
}
|
|
36104
|
+
),
|
|
36105
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36106
|
+
"button",
|
|
36107
|
+
{
|
|
36108
|
+
type: "button",
|
|
36109
|
+
onClick: () => {
|
|
36110
|
+
api.dismiss();
|
|
36111
|
+
setVisible(false);
|
|
36112
|
+
},
|
|
36113
|
+
children: dismissLabel
|
|
36114
|
+
}
|
|
36115
|
+
)
|
|
36116
|
+
] })
|
|
36117
|
+
] });
|
|
34705
36118
|
}
|
|
34706
36119
|
);
|
|
34707
|
-
|
|
36120
|
+
InstallPrompt.displayName = "InstallPrompt";
|
|
34708
36121
|
|
|
34709
36122
|
// ../mobile-nav/dist/index.js
|
|
34710
36123
|
function createMobileNav(props = {}) {
|
|
@@ -39522,7 +40935,7 @@ var AvatarContext = React11__namespace.createContext({
|
|
|
39522
40935
|
setImageError: () => {
|
|
39523
40936
|
}
|
|
39524
40937
|
});
|
|
39525
|
-
var
|
|
40938
|
+
var Avatar2 = React11__namespace.forwardRef(
|
|
39526
40939
|
({ size = "md", className, children, ...props }, ref) => {
|
|
39527
40940
|
const [imageLoaded, setImageLoaded] = React11__namespace.useState(false);
|
|
39528
40941
|
const [imageError, setImageError] = React11__namespace.useState(false);
|
|
@@ -39540,7 +40953,7 @@ var Avatar = React11__namespace.forwardRef(
|
|
|
39540
40953
|
) });
|
|
39541
40954
|
}
|
|
39542
40955
|
);
|
|
39543
|
-
|
|
40956
|
+
Avatar2.displayName = "Avatar";
|
|
39544
40957
|
var AvatarImage = React11__namespace.forwardRef(
|
|
39545
40958
|
({ className, src, alt = "", onLoad, onError, ...props }, ref) => {
|
|
39546
40959
|
const { setImageLoaded, setImageError } = React11__namespace.useContext(AvatarContext);
|
|
@@ -40133,10 +41546,10 @@ function createDatePicker(props = {}) {
|
|
|
40133
41546
|
closePicker();
|
|
40134
41547
|
}
|
|
40135
41548
|
}
|
|
40136
|
-
function setHours(
|
|
40137
|
-
if (
|
|
41549
|
+
function setHours(h5) {
|
|
41550
|
+
if (h5 < 0 || h5 > 23) return;
|
|
40138
41551
|
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
40139
|
-
newDate.setHours(
|
|
41552
|
+
newDate.setHours(h5);
|
|
40140
41553
|
onChange?.(newDate);
|
|
40141
41554
|
}
|
|
40142
41555
|
function setMinutes(m2) {
|
|
@@ -40328,10 +41741,10 @@ function DatePicker({
|
|
|
40328
41741
|
}
|
|
40329
41742
|
};
|
|
40330
41743
|
const handleHoursChange = (e2) => {
|
|
40331
|
-
const
|
|
40332
|
-
if (isNaN(
|
|
41744
|
+
const h5 = parseInt(e2.target.value, 10);
|
|
41745
|
+
if (isNaN(h5) || h5 < 0 || h5 > 23) return;
|
|
40333
41746
|
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
40334
|
-
newDate.setHours(
|
|
41747
|
+
newDate.setHours(h5);
|
|
40335
41748
|
onChange?.(newDate);
|
|
40336
41749
|
};
|
|
40337
41750
|
const handleMinutesChange = (e2) => {
|
|
@@ -42505,102 +43918,6 @@ var Switch = React11__namespace.forwardRef(
|
|
|
42505
43918
|
}
|
|
42506
43919
|
);
|
|
42507
43920
|
Switch.displayName = "Switch";
|
|
42508
|
-
|
|
42509
|
-
// ../thread-view/dist/index.js
|
|
42510
|
-
function formatTimestamp(date) {
|
|
42511
|
-
const hours = date.getHours();
|
|
42512
|
-
const minutes = date.getMinutes();
|
|
42513
|
-
const ampm = hours >= 12 ? "PM" : "AM";
|
|
42514
|
-
const displayHours = hours % 12 || 12;
|
|
42515
|
-
const displayMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;
|
|
42516
|
-
return `${displayHours}:${displayMinutes} ${ampm}`;
|
|
42517
|
-
}
|
|
42518
|
-
function formatRelativeTime(date, now) {
|
|
42519
|
-
const reference = now ?? /* @__PURE__ */ new Date();
|
|
42520
|
-
const diffMs = reference.getTime() - date.getTime();
|
|
42521
|
-
const diffSeconds = Math.floor(diffMs / 1e3);
|
|
42522
|
-
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
42523
|
-
const diffHours = Math.floor(diffMinutes / 60);
|
|
42524
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
42525
|
-
if (diffSeconds < 60) return "just now";
|
|
42526
|
-
if (diffMinutes < 60) return `${diffMinutes} minute${diffMinutes === 1 ? "" : "s"} ago`;
|
|
42527
|
-
if (diffHours < 24) return `${diffHours} hour${diffHours === 1 ? "" : "s"} ago`;
|
|
42528
|
-
if (diffDays < 7) return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
|
|
42529
|
-
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
42530
|
-
}
|
|
42531
|
-
function createThreadView(props) {
|
|
42532
|
-
const { messages, onReply, onReact, currentUserId } = props;
|
|
42533
|
-
let replyingTo = null;
|
|
42534
|
-
const threadId = generateId("rfr-thread");
|
|
42535
|
-
const labelId = generateId("rfr-thread-label");
|
|
42536
|
-
function startReply(messageId) {
|
|
42537
|
-
replyingTo = messageId;
|
|
42538
|
-
}
|
|
42539
|
-
function cancelReply() {
|
|
42540
|
-
replyingTo = null;
|
|
42541
|
-
}
|
|
42542
|
-
function reply(messageId, content) {
|
|
42543
|
-
onReply?.(messageId, content);
|
|
42544
|
-
replyingTo = null;
|
|
42545
|
-
}
|
|
42546
|
-
function react(messageId, emoji) {
|
|
42547
|
-
onReact?.(messageId, emoji);
|
|
42548
|
-
}
|
|
42549
|
-
const ariaProps = {
|
|
42550
|
-
role: "log",
|
|
42551
|
-
"aria-label": "Message thread",
|
|
42552
|
-
"aria-live": "polite",
|
|
42553
|
-
id: threadId
|
|
42554
|
-
};
|
|
42555
|
-
function getMessageAriaProps(message) {
|
|
42556
|
-
const isOwn = currentUserId && message.author.id === currentUserId;
|
|
42557
|
-
return {
|
|
42558
|
-
role: "article",
|
|
42559
|
-
"aria-label": `Message from ${message.author.name}${isOwn ? " (you)" : ""} at ${formatTimestamp(message.timestamp)}`
|
|
42560
|
-
};
|
|
42561
|
-
}
|
|
42562
|
-
function getReplyButtonAriaProps(_messageId) {
|
|
42563
|
-
return {
|
|
42564
|
-
role: "button",
|
|
42565
|
-
"aria-label": `Reply to message`
|
|
42566
|
-
};
|
|
42567
|
-
}
|
|
42568
|
-
return {
|
|
42569
|
-
state: {
|
|
42570
|
-
messages,
|
|
42571
|
-
get replyingTo() {
|
|
42572
|
-
return replyingTo;
|
|
42573
|
-
}
|
|
42574
|
-
},
|
|
42575
|
-
startReply,
|
|
42576
|
-
cancelReply,
|
|
42577
|
-
reply,
|
|
42578
|
-
react,
|
|
42579
|
-
formatTimestamp,
|
|
42580
|
-
formatRelativeTime,
|
|
42581
|
-
ariaProps,
|
|
42582
|
-
getMessageAriaProps,
|
|
42583
|
-
getReplyButtonAriaProps,
|
|
42584
|
-
ids: {
|
|
42585
|
-
thread: threadId,
|
|
42586
|
-
label: labelId
|
|
42587
|
-
}
|
|
42588
|
-
};
|
|
42589
|
-
}
|
|
42590
|
-
var threadContainerStyles = "flex flex-col gap-1";
|
|
42591
|
-
var threadMessageStyles = "flex gap-3 px-4 py-2 hover:bg-accent/50 rounded-md transition-colors group";
|
|
42592
|
-
var threadAvatarStyles = "h-9 w-9 rounded-full bg-muted flex items-center justify-center text-sm font-medium overflow-hidden flex-shrink-0";
|
|
42593
|
-
var threadContentStyles = "flex-1 min-w-0";
|
|
42594
|
-
var threadAuthorStyles = "font-semibold text-sm";
|
|
42595
|
-
var threadTimestampStyles = "text-xs text-muted-foreground ml-2";
|
|
42596
|
-
var threadBodyStyles = "text-sm mt-0.5 whitespace-pre-wrap break-words";
|
|
42597
|
-
var threadReactionsStyles = "flex flex-wrap gap-1 mt-1";
|
|
42598
|
-
var threadReplyIndicatorStyles = "flex items-center gap-1 mt-1 text-xs text-primary cursor-pointer hover:underline";
|
|
42599
|
-
var threadActionsStyles = "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity";
|
|
42600
|
-
var threadAttachmentStyles = "flex items-center gap-2 mt-1 p-2 rounded border text-xs bg-muted/50";
|
|
42601
|
-
var threadEditedStyles = "text-xs text-muted-foreground ml-1";
|
|
42602
|
-
|
|
42603
|
-
// ../react-thread-view/dist/index.js
|
|
42604
43921
|
function MessageComponent({
|
|
42605
43922
|
message,
|
|
42606
43923
|
api
|
|
@@ -42712,11 +44029,11 @@ ThreadView.displayName = "ThreadView";
|
|
|
42712
44029
|
// ../table-of-contents/dist/index.js
|
|
42713
44030
|
function parseHeadings(container, selectors = "h2, h3, h4") {
|
|
42714
44031
|
const headings = Array.from(container.querySelectorAll(selectors));
|
|
42715
|
-
return headings.map((
|
|
42716
|
-
id:
|
|
42717
|
-
text:
|
|
42718
|
-
level: parseInt(
|
|
42719
|
-
})).filter((
|
|
44032
|
+
return headings.map((h5) => ({
|
|
44033
|
+
id: h5.id || h5.textContent?.toLowerCase().replace(/\s+/g, "-") || "",
|
|
44034
|
+
text: h5.textContent || "",
|
|
44035
|
+
level: parseInt(h5.tagName.charAt(1), 10)
|
|
44036
|
+
})).filter((h5) => h5.id !== "");
|
|
42720
44037
|
}
|
|
42721
44038
|
function observeHeadings(headingIds, callback, options) {
|
|
42722
44039
|
const observer = new IntersectionObserver((entries) => {
|
|
@@ -42743,7 +44060,7 @@ var TableOfContents = React11__namespace.forwardRef(
|
|
|
42743
44060
|
const parsedHeadings = parseHeadings(container, selectors);
|
|
42744
44061
|
setHeadings(parsedHeadings);
|
|
42745
44062
|
if (parsedHeadings.length === 0) return;
|
|
42746
|
-
const disconnect = observeHeadings(parsedHeadings.map((
|
|
44063
|
+
const disconnect = observeHeadings(parsedHeadings.map((h5) => h5.id), (id) => {
|
|
42747
44064
|
setActiveId(id);
|
|
42748
44065
|
onActiveIdChange?.(id);
|
|
42749
44066
|
});
|
|
@@ -43874,7 +45191,7 @@ function resolveStorage(override) {
|
|
|
43874
45191
|
return createMemoryStorage();
|
|
43875
45192
|
}
|
|
43876
45193
|
var DEFAULT_SESSION_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
43877
|
-
var
|
|
45194
|
+
var DEFAULT_KEY2 = "rfx:analytics:session";
|
|
43878
45195
|
var CAMPAIGN_PARAMS = [
|
|
43879
45196
|
"utm_source",
|
|
43880
45197
|
"utm_medium",
|
|
@@ -43905,7 +45222,7 @@ function campaignFingerprint(search) {
|
|
|
43905
45222
|
}
|
|
43906
45223
|
function createSession(config, now = () => Date.now()) {
|
|
43907
45224
|
const storage = resolveStorage(config?.storage);
|
|
43908
|
-
const key = config?.storageKey ??
|
|
45225
|
+
const key = config?.storageKey ?? DEFAULT_KEY2;
|
|
43909
45226
|
const timeoutMs = config?.timeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
|
|
43910
45227
|
const resetOnCampaign = config?.resetOnCampaign ?? true;
|
|
43911
45228
|
function read() {
|
|
@@ -43974,10 +45291,10 @@ function createSession(config, now = () => Date.now()) {
|
|
|
43974
45291
|
}
|
|
43975
45292
|
};
|
|
43976
45293
|
}
|
|
43977
|
-
var
|
|
45294
|
+
var DEFAULT_KEY22 = "rfx:analytics:anon";
|
|
43978
45295
|
function createIdentity(config) {
|
|
43979
45296
|
const storage = resolveStorage(config?.storage);
|
|
43980
|
-
const key = config?.storageKey ??
|
|
45297
|
+
const key = config?.storageKey ?? DEFAULT_KEY22;
|
|
43981
45298
|
let userId;
|
|
43982
45299
|
function loadOrMintAnon() {
|
|
43983
45300
|
const existing = storage.get(key);
|
|
@@ -45466,7 +46783,7 @@ exports.AnimatedText = AnimatedText;
|
|
|
45466
46783
|
exports.AppShell = AppShell;
|
|
45467
46784
|
exports.AuthGuard = AuthGuard;
|
|
45468
46785
|
exports.AuthProvider = AuthProvider;
|
|
45469
|
-
exports.Avatar =
|
|
46786
|
+
exports.Avatar = Avatar2;
|
|
45470
46787
|
exports.AvatarFallback = AvatarFallback;
|
|
45471
46788
|
exports.AvatarGroup = AvatarGroup;
|
|
45472
46789
|
exports.AvatarImage = AvatarImage;
|
|
@@ -45494,6 +46811,7 @@ exports.Carousel = Carousel;
|
|
|
45494
46811
|
exports.CarouselContent = CarouselContent;
|
|
45495
46812
|
exports.CarouselItem = CarouselItem;
|
|
45496
46813
|
exports.CarouselTrigger = CarouselTrigger;
|
|
46814
|
+
exports.Chat = Chat;
|
|
45497
46815
|
exports.Checkbox = Checkbox;
|
|
45498
46816
|
exports.CodeBlock = CodeBlock;
|
|
45499
46817
|
exports.CodeBlockContent = CodeBlockContent;
|
|
@@ -45516,7 +46834,10 @@ exports.CommandInput = CommandInput;
|
|
|
45516
46834
|
exports.CommandItem = CommandItem;
|
|
45517
46835
|
exports.CommandList = CommandList;
|
|
45518
46836
|
exports.CommandSeparator = CommandSeparator;
|
|
46837
|
+
exports.Composer = Composer;
|
|
45519
46838
|
exports.ContentProtection = ContentProtection;
|
|
46839
|
+
exports.CookieConsent = CookieConsent;
|
|
46840
|
+
exports.DEFAULT_CATEGORIES = DEFAULT_CATEGORIES;
|
|
45520
46841
|
exports.DEFAULT_VOICE_PILL_POSITION = DEFAULT_VOICE_PILL_POSITION;
|
|
45521
46842
|
exports.DEFAULT_VOICE_PILL_SPEAKER = DEFAULT_VOICE_PILL_SPEAKER;
|
|
45522
46843
|
exports.DEFAULT_WAVEFORM_BAR_COUNT = DEFAULT_WAVEFORM_BAR_COUNT;
|
|
@@ -45691,6 +47012,8 @@ exports.controlsVariants = controlsVariants;
|
|
|
45691
47012
|
exports.createAnalytics = createAnalytics;
|
|
45692
47013
|
exports.createAppInsightsSink = createAppInsightsSink;
|
|
45693
47014
|
exports.createConsoleSink = createConsoleSink;
|
|
47015
|
+
exports.createConversation = createConversation;
|
|
47016
|
+
exports.createCookieConsent = createCookieConsent;
|
|
45694
47017
|
exports.createFaroSink = createFaroSink;
|
|
45695
47018
|
exports.createGA4ClientSdkSink = createGA4ClientSdkSink;
|
|
45696
47019
|
exports.createGA4HttpSink = createGA4HttpSink;
|
|
@@ -45715,6 +47038,7 @@ exports.feedbackDialogVariants = feedbackDialogVariants;
|
|
|
45715
47038
|
exports.fileUploadDropZoneVariants = fileUploadDropZoneVariants;
|
|
45716
47039
|
exports.fileUploadFileItemStyles = fileUploadFileItemStyles;
|
|
45717
47040
|
exports.fileUploadFileListStyles = fileUploadFileListStyles;
|
|
47041
|
+
exports.findMessage = findMessage;
|
|
45718
47042
|
exports.footerVariants = footerVariants;
|
|
45719
47043
|
exports.formatFileSize = formatFileSize;
|
|
45720
47044
|
exports.formatRelativeTime = formatRelativeTime;
|
|
@@ -45723,6 +47047,7 @@ exports.formatTimestamp = formatTimestamp;
|
|
|
45723
47047
|
exports.getAssignableRoles = getAssignableRoles;
|
|
45724
47048
|
exports.getDefaultPortal = getDefaultPortal;
|
|
45725
47049
|
exports.getInitials = getInitials;
|
|
47050
|
+
exports.getReplyCount = getReplyCount;
|
|
45726
47051
|
exports.getVoicePillAriaLabel = getVoicePillAriaLabel;
|
|
45727
47052
|
exports.getVoicePillInitials = getVoicePillInitials;
|
|
45728
47053
|
exports.getVoicePillPosition = getVoicePillPosition;
|
|
@@ -45784,12 +47109,18 @@ exports.resizableDividerVariants = resizableDividerVariants;
|
|
|
45784
47109
|
exports.resizableLayoutTokens = resizableLayoutTokens;
|
|
45785
47110
|
exports.resizableLayoutVariants = resizableLayoutVariants;
|
|
45786
47111
|
exports.resizablePaneVariants = resizablePaneVariants;
|
|
47112
|
+
exports.rootIdOf = rootIdOf;
|
|
45787
47113
|
exports.rowVariants = rowVariants;
|
|
45788
47114
|
exports.scaleWaveformSamples = scaleWaveformSamples;
|
|
45789
47115
|
exports.searchBarVariants = searchBarVariants;
|
|
45790
47116
|
exports.searchResultVariants = searchResultVariants;
|
|
45791
47117
|
exports.selectContentVariants = selectContentVariants;
|
|
45792
47118
|
exports.selectItemVariants = selectItemVariants;
|
|
47119
|
+
exports.selectMainTimeline = selectMainTimeline;
|
|
47120
|
+
exports.selectReplies = selectReplies;
|
|
47121
|
+
exports.selectRoots = selectRoots;
|
|
47122
|
+
exports.selectThreadMessages = selectThreadMessages;
|
|
47123
|
+
exports.selectTimelineFromState = selectTimelineFromState;
|
|
45793
47124
|
exports.selectTokens = selectTokens;
|
|
45794
47125
|
exports.selectTriggerVariants = selectTriggerVariants;
|
|
45795
47126
|
exports.selectorVariants = selectorVariants;
|
|
@@ -45835,6 +47166,8 @@ exports.tooltipContentVariants = tooltipContentVariants;
|
|
|
45835
47166
|
exports.typewriterVariants = typewriterVariants;
|
|
45836
47167
|
exports.useAnalytics = useAnalytics;
|
|
45837
47168
|
exports.useAuth = useAuth;
|
|
47169
|
+
exports.useConversation = useConversation;
|
|
47170
|
+
exports.useCookieConsent = useCookieConsent;
|
|
45838
47171
|
exports.useLogger = useLogger;
|
|
45839
47172
|
exports.useShortcut = useShortcut;
|
|
45840
47173
|
exports.useSpan = useSpan;
|