@_solaris/messenger-widget 0.5.59 → 0.5.61
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/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +1 -1
- package/dist/messenger.cjs +2 -2
- package/dist/messenger.js +81 -73
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Ve, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as E, createVNode as V, Transition as Ue, withCtx as
|
|
1
|
+
import { reactive as Ve, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as E, createVNode as V, Transition as Ue, withCtx as Fe, Fragment as L, renderList as F, withKeys as ge, withModifiers as J, createElementVNode as o, createCommentVNode as b, createBlock as P, resolveDynamicComponent as Ae, mergeProps as je, withDirectives as G, vModelText as te, createTextVNode as Se, renderSlot as Ke, vModelCheckbox as We, vModelSelect as Ge, markRaw as Re } from "vue";
|
|
2
2
|
const Ye = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -1150,7 +1150,7 @@ function xe(e) {
|
|
|
1150
1150
|
function ne(e) {
|
|
1151
1151
|
return Le[xe(e)] || Le[ue];
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function j(e) {
|
|
1154
1154
|
const t = xe(e), n = ke[t] || ke[ue], r = ke[ue];
|
|
1155
1155
|
return function(s, i) {
|
|
1156
1156
|
let l = n[s];
|
|
@@ -1168,7 +1168,7 @@ function Ie(e, t) {
|
|
|
1168
1168
|
function He(e, t, n) {
|
|
1169
1169
|
return Array.isArray(t) ? t.map((r) => Ie(e, String(r))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ie(e, String(t));
|
|
1170
1170
|
}
|
|
1171
|
-
function ht(e, t, n =
|
|
1171
|
+
function ht(e, t, n = j()) {
|
|
1172
1172
|
if (!e || !t) return "";
|
|
1173
1173
|
const r = Array.isArray(e.fields) ? e.fields : [], a = [];
|
|
1174
1174
|
for (const s of r) {
|
|
@@ -1183,7 +1183,7 @@ ${l}`);
|
|
|
1183
1183
|
|
|
1184
1184
|
`);
|
|
1185
1185
|
}
|
|
1186
|
-
function mt(e, t, n =
|
|
1186
|
+
function mt(e, t, n = j()) {
|
|
1187
1187
|
const r = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1188
1188
|
for (const s of a) {
|
|
1189
1189
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
@@ -1342,7 +1342,7 @@ function pt(e, t, n, r) {
|
|
|
1342
1342
|
return a.join(`
|
|
1343
1343
|
`);
|
|
1344
1344
|
}
|
|
1345
|
-
function vt(e, t, n =
|
|
1345
|
+
function vt(e, t, n = j(), r) {
|
|
1346
1346
|
if (!e) return;
|
|
1347
1347
|
const a = pt(e, t || [], n, ne(r)), s = new Blob([a], { type: "text/plain;charset=utf-8" });
|
|
1348
1348
|
try {
|
|
@@ -1857,7 +1857,7 @@ const ve = /* @__PURE__ */ B(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1857
1857
|
inject: {
|
|
1858
1858
|
// Translator shared by the Messenger shell; French fallback when
|
|
1859
1859
|
// the component is used standalone.
|
|
1860
|
-
t: { default: () =>
|
|
1860
|
+
t: { default: () => j() }
|
|
1861
1861
|
},
|
|
1862
1862
|
props: {
|
|
1863
1863
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -1877,7 +1877,7 @@ const ve = /* @__PURE__ */ B(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
|
|
|
1877
1877
|
return this.peeks.slice(0, xt).reverse();
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
|
-
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Nt = { class: "wm-peek__action" }, Ut = { class: "wm-peek__text" },
|
|
1880
|
+
}, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Nt = { class: "wm-peek__action" }, Ut = { class: "wm-peek__text" }, Ft = ["onClick"], jt = ["aria-label"], Ht = ["aria-label"];
|
|
1881
1881
|
function zt(e, t, n, r, a, s) {
|
|
1882
1882
|
const i = E("HumanAvatar");
|
|
1883
1883
|
return c(), d("div", {
|
|
@@ -1888,12 +1888,12 @@ function zt(e, t, n, r, a, s) {
|
|
|
1888
1888
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1889
1889
|
}, [
|
|
1890
1890
|
V(Ue, { name: "wm-peek" }, {
|
|
1891
|
-
default:
|
|
1891
|
+
default: Fe(() => [
|
|
1892
1892
|
s.visiblePeeks.length ? (c(), d("div", {
|
|
1893
1893
|
key: 0,
|
|
1894
1894
|
class: R(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
1895
1895
|
}, [
|
|
1896
|
-
(c(!0), d(L, null,
|
|
1896
|
+
(c(!0), d(L, null, F(s.visiblePeeks, (l, g) => (c(), d("div", {
|
|
1897
1897
|
key: l.convId,
|
|
1898
1898
|
class: "wm-peek",
|
|
1899
1899
|
style: z({
|
|
@@ -1954,7 +1954,7 @@ function zt(e, t, n, r, a, s) {
|
|
|
1954
1954
|
type: "button",
|
|
1955
1955
|
class: "wm-peek__open",
|
|
1956
1956
|
onClick: J((k) => e.$emit("open", l.convId), ["stop"])
|
|
1957
|
-
}, v(s.t("common.open")), 9,
|
|
1957
|
+
}, v(s.t("common.open")), 9, Ft)
|
|
1958
1958
|
], 44, Rt))), 128))
|
|
1959
1959
|
], 2)) : b("", !0)
|
|
1960
1960
|
]),
|
|
@@ -1988,7 +1988,7 @@ function zt(e, t, n, r, a, s) {
|
|
|
1988
1988
|
count: n.unreadCount
|
|
1989
1989
|
})
|
|
1990
1990
|
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ht)) : b("", !0)
|
|
1991
|
-
], 8,
|
|
1991
|
+
], 8, jt)
|
|
1992
1992
|
], 32);
|
|
1993
1993
|
}
|
|
1994
1994
|
const qt = /* @__PURE__ */ B(Ot, [["render", zt], ["__scopeId", "data-v-44ddf1a1"]]), $t = {
|
|
@@ -2117,7 +2117,7 @@ function en(e, t, n, r, a, s) {
|
|
|
2117
2117
|
class: "wm-team__stack",
|
|
2118
2118
|
style: z({ width: s.stackWidth + "px" })
|
|
2119
2119
|
}, [
|
|
2120
|
-
(c(!0), d(L, null,
|
|
2120
|
+
(c(!0), d(L, null, F(n.members.slice(0, 3), (i, l) => (c(), d("div", {
|
|
2121
2121
|
key: l,
|
|
2122
2122
|
class: "wm-team__pill",
|
|
2123
2123
|
style: z({
|
|
@@ -2142,7 +2142,7 @@ const tn = /* @__PURE__ */ B(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2142
2142
|
inject: {
|
|
2143
2143
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
2144
2144
|
// translator when the component is used standalone (no provider).
|
|
2145
|
-
t: { default: () =>
|
|
2145
|
+
t: { default: () => j() }
|
|
2146
2146
|
},
|
|
2147
2147
|
props: {
|
|
2148
2148
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -2295,7 +2295,7 @@ const _n = /* @__PURE__ */ B(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2295
2295
|
// shell. The language getter feeds `formatTs` (relative date
|
|
2296
2296
|
// labels on unread alerts) ; falls back to French when the
|
|
2297
2297
|
// component is used standalone.
|
|
2298
|
-
t: { default: () =>
|
|
2298
|
+
t: { default: () => j() },
|
|
2299
2299
|
wmLocale: { default: () => () => "fr" }
|
|
2300
2300
|
},
|
|
2301
2301
|
props: {
|
|
@@ -2415,7 +2415,7 @@ const _n = /* @__PURE__ */ B(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2415
2415
|
}, Rn = ["innerHTML"], Ln = { class: "wm-onb__alert-meta" }, In = {
|
|
2416
2416
|
key: 0,
|
|
2417
2417
|
class: "wm-onb__alert-time"
|
|
2418
|
-
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Nn = ["onClick"], Un = { class: "wm-onb__btn-icon" },
|
|
2418
|
+
}, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Nn = ["onClick"], Un = { class: "wm-onb__btn-icon" }, Fn = ["aria-label"], jn = {
|
|
2419
2419
|
key: 1,
|
|
2420
2420
|
width: "18",
|
|
2421
2421
|
height: "18",
|
|
@@ -2497,7 +2497,7 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2497
2497
|
])
|
|
2498
2498
|
]),
|
|
2499
2499
|
s.unreadThreads.length ? (c(), d("div", kn, [
|
|
2500
|
-
(c(!0), d(L, null,
|
|
2500
|
+
(c(!0), d(L, null, F(s.unreadThreads, (l) => (c(), d("button", {
|
|
2501
2501
|
key: l.id,
|
|
2502
2502
|
type: "button",
|
|
2503
2503
|
class: "wm-onb__alert",
|
|
@@ -2520,7 +2520,7 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2520
2520
|
}, [
|
|
2521
2521
|
o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
2522
2522
|
], -1)
|
|
2523
|
-
])])) : (c(), P(Ae(s.avatarComponent(l)),
|
|
2523
|
+
])])) : (c(), P(Ae(s.avatarComponent(l)), je({
|
|
2524
2524
|
key: 1,
|
|
2525
2525
|
ref_for: !0
|
|
2526
2526
|
}, s.avatarProps(l)), null, 16)),
|
|
@@ -2568,7 +2568,7 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2568
2568
|
], -1)),
|
|
2569
2569
|
o("span", Dn, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2570
2570
|
], 8, Pn),
|
|
2571
|
-
(c(!0), d(L, null,
|
|
2571
|
+
(c(!0), d(L, null, F(n.quickLinks, (l, g) => (c(), d("button", {
|
|
2572
2572
|
key: "ql-" + g,
|
|
2573
2573
|
type: "button",
|
|
2574
2574
|
class: "wm-onb__btn",
|
|
@@ -2581,7 +2581,7 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2581
2581
|
style: z(s.iconUrlStyle(l)),
|
|
2582
2582
|
role: "img",
|
|
2583
2583
|
"aria-label": l.label || ""
|
|
2584
|
-
}, null, 12,
|
|
2584
|
+
}, null, 12, Fn)) : (c(), d("svg", jn, [
|
|
2585
2585
|
o("path", {
|
|
2586
2586
|
d: s.iconPath(l.icon)
|
|
2587
2587
|
}, null, 8, Hn)
|
|
@@ -2629,7 +2629,7 @@ const Jn = /* @__PURE__ */ B(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
|
|
|
2629
2629
|
name: "WmHistory",
|
|
2630
2630
|
components: { AIAvatar: oe, HumanAvatar: ve },
|
|
2631
2631
|
inject: {
|
|
2632
|
-
t: { default: () =>
|
|
2632
|
+
t: { default: () => j() },
|
|
2633
2633
|
wmLocale: { default: () => () => "fr" }
|
|
2634
2634
|
},
|
|
2635
2635
|
props: {
|
|
@@ -2732,7 +2732,7 @@ function us(e, t, n, r, a, s) {
|
|
|
2732
2732
|
])
|
|
2733
2733
|
]),
|
|
2734
2734
|
o("div", ts, [
|
|
2735
|
-
(c(!0), d(L, null,
|
|
2735
|
+
(c(!0), d(L, null, F(s.filteredThreads, (i) => (c(), d("button", {
|
|
2736
2736
|
key: i.id,
|
|
2737
2737
|
type: "button",
|
|
2738
2738
|
class: R(["wm-hist__thread", { "wm-hist__thread--unread": i.unread }]),
|
|
@@ -2755,7 +2755,7 @@ function us(e, t, n, r, a, s) {
|
|
|
2755
2755
|
}, [
|
|
2756
2756
|
o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })
|
|
2757
2757
|
], -1)
|
|
2758
|
-
])])) : (c(), P(Ae(s.avatarComponent(i)),
|
|
2758
|
+
])])) : (c(), P(Ae(s.avatarComponent(i)), je({
|
|
2759
2759
|
key: 1,
|
|
2760
2760
|
ref_for: !0
|
|
2761
2761
|
}, s.avatarProps(i)), null, 16)),
|
|
@@ -2904,7 +2904,7 @@ const As = /* @__PURE__ */ B(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
|
|
|
2904
2904
|
inject: {
|
|
2905
2905
|
// Translator shared by the Messenger shell; French fallback when
|
|
2906
2906
|
// the component is used standalone.
|
|
2907
|
-
t: { default: () =>
|
|
2907
|
+
t: { default: () => j() }
|
|
2908
2908
|
},
|
|
2909
2909
|
props: {
|
|
2910
2910
|
data: { type: Object, required: !0 }
|
|
@@ -2938,7 +2938,7 @@ function Is(e, t, n, r, a, s) {
|
|
|
2938
2938
|
])
|
|
2939
2939
|
]),
|
|
2940
2940
|
o("div", Rs, [
|
|
2941
|
-
(c(!0), d(L, null,
|
|
2941
|
+
(c(!0), d(L, null, F(s.fields, (i, l) => (c(), d("div", {
|
|
2942
2942
|
key: l,
|
|
2943
2943
|
class: "wm-art__field"
|
|
2944
2944
|
}, [
|
|
@@ -2971,7 +2971,7 @@ const Es = /* @__PURE__ */ B(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
|
|
|
2971
2971
|
}, Ps = { class: "wm-art wm-art--infoCard" }, Ds = {
|
|
2972
2972
|
key: 0,
|
|
2973
2973
|
class: "wm-art__image"
|
|
2974
|
-
}, Ns = ["src", "alt"], Us = { class: "wm-art__head" },
|
|
2974
|
+
}, Ns = ["src", "alt"], Us = { class: "wm-art__head" }, Fs = { class: "wm-art__headMain" }, js = { class: "wm-art__title" }, Hs = {
|
|
2975
2975
|
key: 0,
|
|
2976
2976
|
class: "wm-art__subtitle"
|
|
2977
2977
|
}, zs = {
|
|
@@ -2991,8 +2991,8 @@ function Vs(e, t, n, r, a, s) {
|
|
|
2991
2991
|
}, null, 8, Ns)
|
|
2992
2992
|
])) : b("", !0),
|
|
2993
2993
|
o("div", Us, [
|
|
2994
|
-
o("div",
|
|
2995
|
-
o("div",
|
|
2994
|
+
o("div", Fs, [
|
|
2995
|
+
o("div", js, v(n.data.title), 1),
|
|
2996
2996
|
n.data.subtitle ? (c(), d("div", Hs, v(n.data.subtitle), 1)) : b("", !0)
|
|
2997
2997
|
]),
|
|
2998
2998
|
n.data.badge && n.data.badge.label ? (c(), d("span", {
|
|
@@ -3005,7 +3005,7 @@ function Vs(e, t, n, r, a, s) {
|
|
|
3005
3005
|
]),
|
|
3006
3006
|
s.hasBody ? (c(), d("div", zs, [
|
|
3007
3007
|
n.data.body ? (c(), d("div", qs, v(n.data.body), 1)) : b("", !0),
|
|
3008
|
-
s.fields.length ? (c(!0), d(L, { key: 1 },
|
|
3008
|
+
s.fields.length ? (c(!0), d(L, { key: 1 }, F(s.fields, (i, l) => (c(), d("div", {
|
|
3009
3009
|
key: l,
|
|
3010
3010
|
class: "wm-art__field"
|
|
3011
3011
|
}, [
|
|
@@ -3040,7 +3040,7 @@ const Gs = {
|
|
|
3040
3040
|
inject: {
|
|
3041
3041
|
// Translator + resolved-language getter shared by the Messenger
|
|
3042
3042
|
// shell. Fall back to French wording when used standalone.
|
|
3043
|
-
t: { default: () =>
|
|
3043
|
+
t: { default: () => j() },
|
|
3044
3044
|
wmLocale: { default: () => () => "fr" }
|
|
3045
3045
|
},
|
|
3046
3046
|
props: {
|
|
@@ -3142,7 +3142,7 @@ function ar(e, t, n, r, a, s) {
|
|
|
3142
3142
|
n.data.body ? (c(), d("div", er, v(n.data.body), 1)) : b("", !0)
|
|
3143
3143
|
]),
|
|
3144
3144
|
s.fields.length ? (c(), d("div", tr, [
|
|
3145
|
-
(c(!0), d(L, null,
|
|
3145
|
+
(c(!0), d(L, null, F(s.fields, (i, l) => (c(), d("div", {
|
|
3146
3146
|
key: l,
|
|
3147
3147
|
class: "wm-art__field"
|
|
3148
3148
|
}, [
|
|
@@ -3253,7 +3253,7 @@ const ur = /* @__PURE__ */ B(cr, [["render", dr]]), hr = {
|
|
|
3253
3253
|
signAttachmentFn: { default: null },
|
|
3254
3254
|
// Translator shared by the Messenger shell; French fallback when
|
|
3255
3255
|
// the component is used standalone.
|
|
3256
|
-
t: { default: () =>
|
|
3256
|
+
t: { default: () => j() }
|
|
3257
3257
|
},
|
|
3258
3258
|
props: {
|
|
3259
3259
|
attachment: { type: Object, required: !0 }
|
|
@@ -3437,7 +3437,7 @@ const Ir = {
|
|
|
3437
3437
|
inject: {
|
|
3438
3438
|
// Translator + resolved-language getter shared by the Messenger
|
|
3439
3439
|
// shell. Fall back to French wording when used standalone.
|
|
3440
|
-
t: { default: () =>
|
|
3440
|
+
t: { default: () => j() },
|
|
3441
3441
|
wmLocale: { default: () => () => "fr" }
|
|
3442
3442
|
},
|
|
3443
3443
|
props: {
|
|
@@ -3984,10 +3984,10 @@ const Ir = {
|
|
|
3984
3984
|
class: "wm-list__loadMore",
|
|
3985
3985
|
role: "status",
|
|
3986
3986
|
"aria-live": "polite"
|
|
3987
|
-
}, Ur = { class: "wm-list__loadMore-lbl" },
|
|
3987
|
+
}, Ur = { class: "wm-list__loadMore-lbl" }, Fr = {
|
|
3988
3988
|
key: 1,
|
|
3989
3989
|
class: "wm-list__historyEnd"
|
|
3990
|
-
},
|
|
3990
|
+
}, jr = {
|
|
3991
3991
|
key: 2,
|
|
3992
3992
|
class: "wm-list__sep"
|
|
3993
3993
|
}, Hr = { class: "wm-list__sep-label" }, zr = {
|
|
@@ -4026,13 +4026,13 @@ function ri(e, t, n, r, a, s) {
|
|
|
4026
4026
|
"aria-hidden": "true"
|
|
4027
4027
|
}, null, -1)),
|
|
4028
4028
|
o("span", Ur, v(s.t("messageList.loadingHistory")), 1)
|
|
4029
|
-
])) : s.historyExhausted ? (c(), d("div",
|
|
4030
|
-
n.dateLabel ? (c(), d("div",
|
|
4029
|
+
])) : s.historyExhausted ? (c(), d("div", Fr, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
4030
|
+
n.dateLabel ? (c(), d("div", jr, [
|
|
4031
4031
|
t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
4032
4032
|
o("span", Hr, v(n.dateLabel), 1),
|
|
4033
4033
|
t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
|
|
4034
4034
|
])) : b("", !0),
|
|
4035
|
-
(c(!0), d(L, null,
|
|
4035
|
+
(c(!0), d(L, null, F(s.groups, (A, q) => (c(), d(L, {
|
|
4036
4036
|
key: A.key
|
|
4037
4037
|
}, [
|
|
4038
4038
|
A.key === s.unreadGroupKey ? (c(), d("div", zr, [
|
|
@@ -4049,7 +4049,7 @@ function ri(e, t, n, r, a, s) {
|
|
|
4049
4049
|
o("span", Vr, v(A.systemLabel), 1),
|
|
4050
4050
|
t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
4051
4051
|
])) : (c(), d(L, { key: 1 }, [
|
|
4052
|
-
(c(!0), d(L, null,
|
|
4052
|
+
(c(!0), d(L, null, F(A.items, (M, N) => (c(), d(L, {
|
|
4053
4053
|
key: `${s.messageKey(M.message)}-${M.partKey}`
|
|
4054
4054
|
}, [
|
|
4055
4055
|
o("div", {
|
|
@@ -4114,7 +4114,7 @@ function ri(e, t, n, r, a, s) {
|
|
|
4114
4114
|
"wm-list__atts--align-end": A.role === "user"
|
|
4115
4115
|
}])
|
|
4116
4116
|
}, [
|
|
4117
|
-
(c(!0), d(L, null,
|
|
4117
|
+
(c(!0), d(L, null, F(s.attachmentsOf(
|
|
4118
4118
|
M.message
|
|
4119
4119
|
), (U, D) => (c(), P(T, {
|
|
4120
4120
|
key: `${s.messageKey(M.message)}-att-${D}`,
|
|
@@ -4156,7 +4156,7 @@ function ri(e, t, n, r, a, s) {
|
|
|
4156
4156
|
])) : b("", !0)
|
|
4157
4157
|
], 34),
|
|
4158
4158
|
V(Ue, { name: "wm-scrollDown" }, {
|
|
4159
|
-
default:
|
|
4159
|
+
default: Fe(() => [
|
|
4160
4160
|
a.showScrollDown ? (c(), d("button", {
|
|
4161
4161
|
key: 0,
|
|
4162
4162
|
type: "button",
|
|
@@ -4327,7 +4327,7 @@ const di = [
|
|
|
4327
4327
|
inject: {
|
|
4328
4328
|
// Translator shared by the Messenger shell; French fallback when
|
|
4329
4329
|
// the component is used standalone.
|
|
4330
|
-
t: { default: () =>
|
|
4330
|
+
t: { default: () => j() }
|
|
4331
4331
|
},
|
|
4332
4332
|
props: {
|
|
4333
4333
|
modelValue: { type: String, default: "" },
|
|
@@ -4525,7 +4525,7 @@ function Ci(e, t, n, r, a, s) {
|
|
|
4525
4525
|
onClick: t[2] || (t[2] = (i) => a.attachOpen = !1)
|
|
4526
4526
|
})) : b("", !0),
|
|
4527
4527
|
a.attachOpen ? (c(), d("div", fi, [
|
|
4528
|
-
(c(!0), d(L, null,
|
|
4528
|
+
(c(!0), d(L, null, F(s.attachItems, (i) => (c(), d("button", {
|
|
4529
4529
|
key: i.action,
|
|
4530
4530
|
type: "button",
|
|
4531
4531
|
class: "wm-compose__menuItem",
|
|
@@ -4629,7 +4629,7 @@ function Ti(e, t, n, r, a, s) {
|
|
|
4629
4629
|
key: s.batchKey,
|
|
4630
4630
|
class: "wm-chips"
|
|
4631
4631
|
}, [
|
|
4632
|
-
(c(!0), d(L, null,
|
|
4632
|
+
(c(!0), d(L, null, F(n.items, (i, l) => (c(), d("button", {
|
|
4633
4633
|
key: l,
|
|
4634
4634
|
type: "button",
|
|
4635
4635
|
class: "wm-chip",
|
|
@@ -4644,7 +4644,7 @@ const xi = /* @__PURE__ */ B(Si, [["render", Ti], ["__scopeId", "data-v-47ad8085
|
|
|
4644
4644
|
inject: {
|
|
4645
4645
|
// Translator shared by the Messenger shell; French fallback when
|
|
4646
4646
|
// the component is used standalone.
|
|
4647
|
-
t: { default: () =>
|
|
4647
|
+
t: { default: () => j() }
|
|
4648
4648
|
},
|
|
4649
4649
|
props: {
|
|
4650
4650
|
action: { type: String, required: !0 },
|
|
@@ -4720,7 +4720,7 @@ function Ni(e, t, n, r, a, s) {
|
|
|
4720
4720
|
}
|
|
4721
4721
|
const Ui = /* @__PURE__ */ B(Oi, [["render", Ni], ["__scopeId", "data-v-a2bed37e"]]);
|
|
4722
4722
|
let De = 0;
|
|
4723
|
-
const
|
|
4723
|
+
const Fi = /* @__PURE__ */ new Set([
|
|
4724
4724
|
"text",
|
|
4725
4725
|
"textarea",
|
|
4726
4726
|
"number",
|
|
@@ -4728,13 +4728,13 @@ const ji = /* @__PURE__ */ new Set([
|
|
|
4728
4728
|
"select",
|
|
4729
4729
|
"multiselect",
|
|
4730
4730
|
"date"
|
|
4731
|
-
]),
|
|
4731
|
+
]), ji = {
|
|
4732
4732
|
name: "WmFormCard",
|
|
4733
4733
|
components: { AIAvatar: oe },
|
|
4734
4734
|
inject: {
|
|
4735
4735
|
// Translator shared by the Messenger shell; French fallback when
|
|
4736
4736
|
// the component is used standalone.
|
|
4737
|
-
t: { default: () =>
|
|
4737
|
+
t: { default: () => j() }
|
|
4738
4738
|
},
|
|
4739
4739
|
props: {
|
|
4740
4740
|
form: { type: Object, required: !0 },
|
|
@@ -4758,7 +4758,7 @@ const ji = /* @__PURE__ */ new Set([
|
|
|
4758
4758
|
// douteux.
|
|
4759
4759
|
normalizedFields() {
|
|
4760
4760
|
var t;
|
|
4761
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
4761
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Fi.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
4762
4762
|
}
|
|
4763
4763
|
},
|
|
4764
4764
|
created() {
|
|
@@ -4858,7 +4858,7 @@ function da(e, t, n, r, a, s) {
|
|
|
4858
4858
|
class: "wm-form__body",
|
|
4859
4859
|
onSubmit: t[0] || (t[0] = J((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
|
|
4860
4860
|
}, [
|
|
4861
|
-
(c(!0), d(L, null,
|
|
4861
|
+
(c(!0), d(L, null, F(s.normalizedFields, (l) => (c(), d("div", {
|
|
4862
4862
|
key: l.key,
|
|
4863
4863
|
class: "wm-form__field"
|
|
4864
4864
|
}, [
|
|
@@ -4936,14 +4936,14 @@ function da(e, t, n, r, a, s) {
|
|
|
4936
4936
|
disabled: n.readOnly || a.busy
|
|
4937
4937
|
}, [
|
|
4938
4938
|
o("option", na, v(l.placeholder || s.t("form.choose")), 1),
|
|
4939
|
-
(c(!0), d(L, null,
|
|
4939
|
+
(c(!0), d(L, null, F(l.options, (g) => (c(), d("option", {
|
|
4940
4940
|
key: g.value,
|
|
4941
4941
|
value: g.value
|
|
4942
4942
|
}, v(g.label), 9, sa))), 128))
|
|
4943
4943
|
], 8, ta)), [
|
|
4944
4944
|
[Ge, a.values[l.key]]
|
|
4945
4945
|
]) : l.type === "multiselect" ? (c(), d("div", ra, [
|
|
4946
|
-
(c(!0), d(L, null,
|
|
4946
|
+
(c(!0), d(L, null, F(l.options, (g) => (c(), d("label", {
|
|
4947
4947
|
key: g.value,
|
|
4948
4948
|
class: "wm-form__multiItem"
|
|
4949
4949
|
}, [
|
|
@@ -4975,12 +4975,12 @@ function da(e, t, n, r, a, s) {
|
|
|
4975
4975
|
], 32)
|
|
4976
4976
|
]);
|
|
4977
4977
|
}
|
|
4978
|
-
const ua = /* @__PURE__ */ B(
|
|
4978
|
+
const ua = /* @__PURE__ */ B(ji, [["render", da], ["__scopeId", "data-v-fe65cc56"]]), ha = {
|
|
4979
4979
|
name: "WmFeedback",
|
|
4980
4980
|
inject: {
|
|
4981
4981
|
// Translator shared by the Messenger shell; French fallback when
|
|
4982
4982
|
// the component is used standalone.
|
|
4983
|
-
t: { default: () =>
|
|
4983
|
+
t: { default: () => j() }
|
|
4984
4984
|
},
|
|
4985
4985
|
props: {
|
|
4986
4986
|
busy: { type: Boolean, default: !1 },
|
|
@@ -5037,7 +5037,7 @@ function Aa(e, t, n, r, a, s) {
|
|
|
5037
5037
|
o("div", fa, v(s.t("feedback.question")), 1),
|
|
5038
5038
|
o("div", _a, v(s.t("feedback.subtitle")), 1),
|
|
5039
5039
|
o("div", ga, [
|
|
5040
|
-
(c(!0), d(L, null,
|
|
5040
|
+
(c(!0), d(L, null, F(s.options, (i) => (c(), d("button", {
|
|
5041
5041
|
key: i.v,
|
|
5042
5042
|
type: "button",
|
|
5043
5043
|
class: R(["wm-fb__opt", { "is-selected": a.sel === i.v }]),
|
|
@@ -5061,7 +5061,7 @@ const Sa = /* @__PURE__ */ B(ha, [["render", Aa], ["__scopeId", "data-v-9b630564
|
|
|
5061
5061
|
inject: {
|
|
5062
5062
|
// Translator shared by the Messenger shell; French fallback when
|
|
5063
5063
|
// the component is used standalone.
|
|
5064
|
-
t: { default: () =>
|
|
5064
|
+
t: { default: () => j() }
|
|
5065
5065
|
},
|
|
5066
5066
|
props: {
|
|
5067
5067
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -5241,12 +5241,12 @@ function Ua(e, t, n, r, a, s) {
|
|
|
5241
5241
|
])
|
|
5242
5242
|
]);
|
|
5243
5243
|
}
|
|
5244
|
-
const
|
|
5244
|
+
const Fa = /* @__PURE__ */ B(Ma, [["render", Ua], ["__scopeId", "data-v-4cf6d578"]]), ja = {
|
|
5245
5245
|
name: "WmRenameDialog",
|
|
5246
5246
|
inject: {
|
|
5247
5247
|
// Translator shared by the Messenger shell; French fallback when
|
|
5248
5248
|
// the component is used standalone.
|
|
5249
|
-
t: { default: () =>
|
|
5249
|
+
t: { default: () => j() }
|
|
5250
5250
|
},
|
|
5251
5251
|
props: {
|
|
5252
5252
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -5350,7 +5350,7 @@ function Ja(e, t, n, r, a, s) {
|
|
|
5350
5350
|
])
|
|
5351
5351
|
]);
|
|
5352
5352
|
}
|
|
5353
|
-
const Xa = /* @__PURE__ */ B(
|
|
5353
|
+
const Xa = /* @__PURE__ */ B(ja, [["render", Ja], ["__scopeId", "data-v-6d5f94a8"]]), Ne = "ww-messenger-tokens", Qa = {
|
|
5354
5354
|
name: "Messenger",
|
|
5355
5355
|
components: {
|
|
5356
5356
|
Launcher: qt,
|
|
@@ -5363,7 +5363,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
|
|
|
5363
5363
|
ApprovalCard: Ui,
|
|
5364
5364
|
FormCard: ua,
|
|
5365
5365
|
Feedback: Sa,
|
|
5366
|
-
MoreMenu:
|
|
5366
|
+
MoreMenu: Fa,
|
|
5367
5367
|
RenameDialog: Xa
|
|
5368
5368
|
},
|
|
5369
5369
|
mixins: [
|
|
@@ -5541,7 +5541,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
|
|
|
5541
5541
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
5542
5542
|
// to it so every string resolves against the current language.
|
|
5543
5543
|
translator() {
|
|
5544
|
-
return
|
|
5544
|
+
return j(this.locale);
|
|
5545
5545
|
},
|
|
5546
5546
|
error() {
|
|
5547
5547
|
var e;
|
|
@@ -6269,7 +6269,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
|
|
|
6269
6269
|
const t = await this.store.createConversation({}), n = this.welcomeRevealedAt.__draft__;
|
|
6270
6270
|
return n !== void 0 && (this.welcomeRevealedAt = {
|
|
6271
6271
|
...this.welcomeRevealedAt,
|
|
6272
|
-
[t.id]: n
|
|
6272
|
+
[t.id]: n > 0 ? n : Date.now()
|
|
6273
6273
|
}), this.draftConv = null, this.activeConvId = t.id, await this.store.openConversation(t.id), this.markConvRead(t), t;
|
|
6274
6274
|
} catch (t) {
|
|
6275
6275
|
return console.error("[ww-messenger] create conv failed", t), this.bootError = (t == null ? void 0 : t.message) || String(t), null;
|
|
@@ -6323,24 +6323,32 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
|
|
|
6323
6323
|
if (!e) return;
|
|
6324
6324
|
const t = this.widgetWelcomeMessage;
|
|
6325
6325
|
if (!t || typeof t != "string" || !t.trim() || this.welcomeRevealedAt[e] !== void 0) return;
|
|
6326
|
+
const n = this.currentConv;
|
|
6327
|
+
if (!((n == null ? void 0 : n._draft) || !(n != null && n.last_message_id))) {
|
|
6328
|
+
this.welcomeRevealedAt = {
|
|
6329
|
+
...this.welcomeRevealedAt,
|
|
6330
|
+
[e]: Date.now()
|
|
6331
|
+
};
|
|
6332
|
+
return;
|
|
6333
|
+
}
|
|
6326
6334
|
this.welcomeRevealedAt = {
|
|
6327
6335
|
...this.welcomeRevealedAt,
|
|
6328
6336
|
[e]: 0
|
|
6329
6337
|
};
|
|
6330
|
-
const
|
|
6331
|
-
|
|
6332
|
-
Math.max(
|
|
6333
|
-
),
|
|
6338
|
+
const a = this.revealPacing, s = t.trim().length, i = Math.min(
|
|
6339
|
+
a.maxTypingMs,
|
|
6340
|
+
Math.max(a.minTypingMs, s * a.msPerChar)
|
|
6341
|
+
), l = a.firstRevealDelayMs + i, g = setTimeout(() => {
|
|
6334
6342
|
this.welcomeRevealedAt = {
|
|
6335
6343
|
...this.welcomeRevealedAt,
|
|
6336
6344
|
[e]: Date.now()
|
|
6337
6345
|
};
|
|
6338
|
-
const
|
|
6339
|
-
delete
|
|
6340
|
-
},
|
|
6346
|
+
const k = { ...this.welcomeRevealTimers };
|
|
6347
|
+
delete k[e], this.welcomeRevealTimers = k;
|
|
6348
|
+
}, l);
|
|
6341
6349
|
this.welcomeRevealTimers = {
|
|
6342
6350
|
...this.welcomeRevealTimers,
|
|
6343
|
-
[e]:
|
|
6351
|
+
[e]: g
|
|
6344
6352
|
};
|
|
6345
6353
|
},
|
|
6346
6354
|
// Clear pending welcome timers (panel unmount, refresh). Doesn't
|
|
@@ -6728,7 +6736,7 @@ function ho(e, t, n, r, a, s) {
|
|
|
6728
6736
|
onSubmit: s.onRenameSubmit
|
|
6729
6737
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
|
|
6730
6738
|
a.pendingAttachments.length ? (c(), d("div", co, [
|
|
6731
|
-
(c(!0), d(L, null,
|
|
6739
|
+
(c(!0), d(L, null, F(a.pendingAttachments, (D, K) => (c(), d("div", {
|
|
6732
6740
|
key: K,
|
|
6733
6741
|
class: "wm-attached__chip"
|
|
6734
6742
|
}, [
|
|
@@ -6796,7 +6804,7 @@ function ho(e, t, n, r, a, s) {
|
|
|
6796
6804
|
], 6)) : b("", !0)
|
|
6797
6805
|
], 6);
|
|
6798
6806
|
}
|
|
6799
|
-
const _o = /* @__PURE__ */ B(Qa, [["render", ho], ["__scopeId", "data-v-
|
|
6807
|
+
const _o = /* @__PURE__ */ B(Qa, [["render", ho], ["__scopeId", "data-v-a3812812"]]), go = "0.5.61";
|
|
6800
6808
|
export {
|
|
6801
6809
|
oe as AIAvatar,
|
|
6802
6810
|
be as AVATAR_COLORS,
|
|
@@ -6819,7 +6827,7 @@ export {
|
|
|
6819
6827
|
Oe as MEDIA_RECORDER_SUPPORTED,
|
|
6820
6828
|
ii as MessageList,
|
|
6821
6829
|
_o as Messenger,
|
|
6822
|
-
|
|
6830
|
+
Fa as MoreMenu,
|
|
6823
6831
|
Jn as Onboarding,
|
|
6824
6832
|
pe as SCREEN_CAPTURE_SUPPORTED,
|
|
6825
6833
|
ut as SUPPORTED_LANGUAGES,
|
|
@@ -6832,7 +6840,7 @@ export {
|
|
|
6832
6840
|
oi as captureScreenshotFile,
|
|
6833
6841
|
H as colors,
|
|
6834
6842
|
st as createStore,
|
|
6835
|
-
|
|
6843
|
+
j as createTranslator,
|
|
6836
6844
|
Ze as createTransport,
|
|
6837
6845
|
ne as dateLocale,
|
|
6838
6846
|
_o as default,
|
package/dist/snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Messenger=function(h){"use strict";let t=null,
|
|
1
|
+
var Messenger=function(h){"use strict";let t=null,a=null,r=null,d="",f=null;function v(e){t&&m();const i=e.widgetId||"",c=e.baseUrl||"";d=e.widgetOrigin||c;const s=e.token||"";let l=null;e.variables&&typeof e.variables=="object"?l=e.variables:e.context&&typeof e.context=="object"&&(l=e.context);const o=e.displayMode||"floating",u=e.language||"",g=e.allowUnauthenticated===!0;if(!i||!d){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}!g&&!s&&console.warn("[messenger] init: allowUnauthenticated=false but no token provided. In app mode you must pass a `token` (JWT linked) at every init() call. See messenger-back /auth/jwt to generate one server-side. Without a token, /session will return 403.");const w=new URL(`${O(d)}/widget/${encodeURIComponent(i)}`);o!=="floating"&&w.searchParams.set("display_mode",o),u&&w.searchParams.set("language",u),t=document.createElement("iframe"),t.src=w.toString(),t.title="Messenger",t.setAttribute("aria-label","Messenger"),t.setAttribute("allow","clipboard-write; microphone; notifications; display-capture"),t.setAttribute("data-messenger-widget",""),E(t,o,"closed"),document.body.appendChild(t),a=document.createElement("div"),a.setAttribute("data-messenger-shadow",""),p(a,{hidden:!0}),document.body.appendChild(a),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),b(r,{hidden:!0}),document.body.appendChild(r);let x=!1;const T=()=>{x||!t||(x=!0,t.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:s||null,variables:l||null,allowUnauthenticated:g},d))};f=k=>{if(k.origin!==d)return;const n=k.data;!n||typeof n!="object"||(n.type==="READY"?T():n.type==="RESIZE"&&t&&(E(t,n.displayMode||o,n.state,{width:n.width,height:n.height}),a&&(n.state==="closed"&&n.launcherWidth&&n.launcherHeight?p(a,{width:n.launcherWidth,height:n.launcherHeight,hovered:!!n.launcherHovered}):p(a,{hidden:!0})),r&&(n.state==="closed"&&n.peek?b(r,{...n.peek,hovered:!!n.peekHovered}):b(r,{hidden:!0}))))},window.addEventListener("message",f),t.addEventListener("load",T),setTimeout(()=>{x||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function m(){f&&(window.removeEventListener("message",f),f=null),t&&(t.remove(),t=null),a&&(a.remove(),a=null),r&&(r.remove(),r=null),d=""}function y(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"UPDATE",payload:e},d)}function S(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"CONTEXT",payload:e},d)}function p(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||50,s=i.height||50,l=Math.max(20,c-6),o=Math.max(20,s-6),u=8+(c-l)/2,g=8+(s-o)/2,w=i.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${g}px`,`right:${u}px`,`width:${l}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${w}`,"transition:box-shadow 100ms ease","z-index:2147483646"].join(";")}function b(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||286,s=i.height||80,l=8+(i.rightOffset||0),o=8+(i.bottomOffset||0),u=i.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${o}px`,`right:${l}px`,`width:${c}px`,`height:${s}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${u}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function O(e){return e.endsWith("/")?e.slice(0,-1):e}function E(e,i,c,s){const l=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let o;if(i==="embedded")o=["inset:0","width:100%","height:100%"];else if(c==="closed"){const u=s&&s.width>0?s.width:80,g=s&&s.height>0?s.height:80;o=["bottom:0","right:0",`width:${u}px`,`height:${g}px`]}else i==="sheet"?o=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]:o=["bottom:0","right:0","width:460px","height:720px","max-width:100vw","max-height:100vh"];e.style.cssText=l.concat(o).join(";")}const M="0.5.61",$={init:v,destroy:m,update:y,context:S,version:M};return h.context=S,h.default=$,h.destroy=m,h.init=v,h.update=y,h.version=M,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),h}({});
|