@wexio/messenger-widget-react 1.0.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/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/widget-react-AgErOR36.js +325 -0
- package/dist/widget-react-AgErOR36.js.map +1 -0
- package/dist/widget-react-BAOIDvhV.js +4250 -0
- package/dist/widget-react-BAOIDvhV.js.map +1 -0
- package/dist/widget-react-BfPdgAQ-.js +5767 -0
- package/dist/widget-react-BfPdgAQ-.js.map +1 -0
- package/dist/widget-react-BxvW64LH.js +4429 -0
- package/dist/widget-react-BxvW64LH.js.map +1 -0
- package/dist/widget-react-C5COLy3m.js +23847 -0
- package/dist/widget-react-C5COLy3m.js.map +1 -0
- package/dist/widget-react-CAWxn8I0.js +247 -0
- package/dist/widget-react-CAWxn8I0.js.map +1 -0
- package/dist/widget-react-CDPzwV1i.js +11685 -0
- package/dist/widget-react-CDPzwV1i.js.map +1 -0
- package/dist/widget-react-CPYwD6FR.js +498 -0
- package/dist/widget-react-CPYwD6FR.js.map +1 -0
- package/dist/widget-react-CUBFPjaV.js +23 -0
- package/dist/widget-react-CUBFPjaV.js.map +1 -0
- package/dist/widget-react-CUuKGDZN.js +355 -0
- package/dist/widget-react-CUuKGDZN.js.map +1 -0
- package/dist/widget-react-CZs0xRrr.js +1336 -0
- package/dist/widget-react-CZs0xRrr.js.map +1 -0
- package/dist/widget-react-Cj_zbk_F.js +325 -0
- package/dist/widget-react-Cj_zbk_F.js.map +1 -0
- package/dist/widget-react-D-QrEVpv.js +125 -0
- package/dist/widget-react-D-QrEVpv.js.map +1 -0
- package/dist/widget-react-D8TPnM9r.js +26 -0
- package/dist/widget-react-D8TPnM9r.js.map +1 -0
- package/dist/widget-react-DE7AVrCo.js +5737 -0
- package/dist/widget-react-DE7AVrCo.js.map +1 -0
- package/dist/widget-react-DOX6j7_Q.js +30 -0
- package/dist/widget-react-DOX6j7_Q.js.map +1 -0
- package/dist/widget-react-DSw03RG7.js +262 -0
- package/dist/widget-react-DSw03RG7.js.map +1 -0
- package/dist/widget-react-Dew7YaLU.js +16 -0
- package/dist/widget-react-Dew7YaLU.js.map +1 -0
- package/dist/widget-react-DtOeNw5z.js +325 -0
- package/dist/widget-react-DtOeNw5z.js.map +1 -0
- package/dist/widget-react-DwL_rsx_.js +630 -0
- package/dist/widget-react-DwL_rsx_.js.map +1 -0
- package/dist/widget-react.d.ts +301 -0
- package/dist/widget-react.js +22285 -0
- package/dist/widget-react.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "react-dom/client";
|
|
5
|
+
import { i as e, n as t } from "./widget-react-BxvW64LH.js";
|
|
6
|
+
import { t as n } from "./widget-react-CUBFPjaV.js";
|
|
7
|
+
import { n as r, r as i, t as a } from "./widget-react-DOX6j7_Q.js";
|
|
8
|
+
import { t as o } from "./widget-react-CZs0xRrr.js";
|
|
9
|
+
import { memo as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
//#region node_modules/@wavesurfer/react/dist/index.js
|
|
12
|
+
function m(e, t) {
|
|
13
|
+
var n = {};
|
|
14
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
15
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") {
|
|
16
|
+
var i = 0;
|
|
17
|
+
for (r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function h(e, t) {
|
|
22
|
+
let [n, r] = d(null), i = l((() => m(t, ["plugins"])), [t]), a = l((() => Object.entries(i).flat()), [i]);
|
|
23
|
+
return c((() => {
|
|
24
|
+
if (!e?.current) return;
|
|
25
|
+
let n = o.create(Object.assign(Object.assign({}, i), {
|
|
26
|
+
plugins: t.plugins,
|
|
27
|
+
container: e.current
|
|
28
|
+
}));
|
|
29
|
+
return r(n), () => {
|
|
30
|
+
n.destroy();
|
|
31
|
+
};
|
|
32
|
+
}), [
|
|
33
|
+
e,
|
|
34
|
+
t.plugins,
|
|
35
|
+
...a
|
|
36
|
+
]), n;
|
|
37
|
+
}
|
|
38
|
+
var g = /^on([A-Z])/, _ = (e) => g.test(e);
|
|
39
|
+
function v(e, t) {
|
|
40
|
+
c((() => {
|
|
41
|
+
if (!e) return;
|
|
42
|
+
let n = Object.entries(t);
|
|
43
|
+
if (!n.length) return;
|
|
44
|
+
let r = n.map((([t, n]) => {
|
|
45
|
+
let r = t.replace(g, ((e, t) => t.toLowerCase()));
|
|
46
|
+
return e.on(r, ((...t) => n(e, ...t)));
|
|
47
|
+
}));
|
|
48
|
+
return () => {
|
|
49
|
+
r.forEach(((e) => e()));
|
|
50
|
+
};
|
|
51
|
+
}), [e, ...l((() => Object.entries(t).flat()), [t])]);
|
|
52
|
+
}
|
|
53
|
+
s(((e) => {
|
|
54
|
+
let t = u(null), [n, r] = function(e) {
|
|
55
|
+
return l((() => {
|
|
56
|
+
let t = Object.assign({}, e), n = Object.assign({}, e);
|
|
57
|
+
for (let e in t) _(e) ? delete t[e] : delete n[e];
|
|
58
|
+
return [t, n];
|
|
59
|
+
}), [e]);
|
|
60
|
+
}(e);
|
|
61
|
+
return v(h(t, n), r), f("div", { ref: t });
|
|
62
|
+
}));
|
|
63
|
+
function y(e) {
|
|
64
|
+
var { container: t } = e;
|
|
65
|
+
let n = h(t, m(e, ["container"])), r = function(e) {
|
|
66
|
+
let [t, n] = d(!1), [r, i] = d(!1), [a, o] = d(!1), [s, u] = d(0);
|
|
67
|
+
return c((() => {
|
|
68
|
+
if (!e) return;
|
|
69
|
+
let t = [
|
|
70
|
+
e.on("load", (() => {
|
|
71
|
+
n(!1), i(!1), u(0);
|
|
72
|
+
})),
|
|
73
|
+
e.on("ready", (() => {
|
|
74
|
+
n(!0), i(!1), o(!1), u(0);
|
|
75
|
+
})),
|
|
76
|
+
e.on("finish", (() => {
|
|
77
|
+
o(!0);
|
|
78
|
+
})),
|
|
79
|
+
e.on("play", (() => {
|
|
80
|
+
i(!0);
|
|
81
|
+
})),
|
|
82
|
+
e.on("pause", (() => {
|
|
83
|
+
i(!1);
|
|
84
|
+
})),
|
|
85
|
+
e.on("timeupdate", (() => {
|
|
86
|
+
u(e.getCurrentTime());
|
|
87
|
+
})),
|
|
88
|
+
e.on("destroy", (() => {
|
|
89
|
+
n(!1), i(!1);
|
|
90
|
+
}))
|
|
91
|
+
];
|
|
92
|
+
return () => {
|
|
93
|
+
t.forEach(((e) => e()));
|
|
94
|
+
};
|
|
95
|
+
}), [e]), l((() => ({
|
|
96
|
+
isReady: t,
|
|
97
|
+
isPlaying: r,
|
|
98
|
+
hasFinished: a,
|
|
99
|
+
currentTime: s
|
|
100
|
+
})), [
|
|
101
|
+
r,
|
|
102
|
+
a,
|
|
103
|
+
s,
|
|
104
|
+
t
|
|
105
|
+
]);
|
|
106
|
+
}(n);
|
|
107
|
+
return l((() => Object.assign(Object.assign({}, r), { wavesurfer: n })), [r, n]);
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region node_modules/wavesurfer.js/dist/plugins/hover.esm.js
|
|
111
|
+
var b = class {
|
|
112
|
+
constructor() {
|
|
113
|
+
this.listeners = {};
|
|
114
|
+
}
|
|
115
|
+
on(e, t, n) {
|
|
116
|
+
if (this.listeners[e] || (this.listeners[e] = /* @__PURE__ */ new Set()), n?.once) {
|
|
117
|
+
let n = (...r) => {
|
|
118
|
+
this.un(e, n), t(...r);
|
|
119
|
+
};
|
|
120
|
+
return this.listeners[e].add(n), () => this.un(e, n);
|
|
121
|
+
}
|
|
122
|
+
return this.listeners[e].add(t), () => this.un(e, t);
|
|
123
|
+
}
|
|
124
|
+
un(e, t) {
|
|
125
|
+
var n;
|
|
126
|
+
(n = this.listeners[e]) == null || n.delete(t);
|
|
127
|
+
}
|
|
128
|
+
once(e, t) {
|
|
129
|
+
return this.on(e, t, { once: !0 });
|
|
130
|
+
}
|
|
131
|
+
unAll() {
|
|
132
|
+
this.listeners = {};
|
|
133
|
+
}
|
|
134
|
+
emit(e, ...t) {
|
|
135
|
+
this.listeners[e] && this.listeners[e].forEach(((e) => e(...t)));
|
|
136
|
+
}
|
|
137
|
+
}, x = class extends b {
|
|
138
|
+
constructor(e) {
|
|
139
|
+
super(), this.subscriptions = [], this.isDestroyed = !1, this.options = e;
|
|
140
|
+
}
|
|
141
|
+
onInit() {}
|
|
142
|
+
_init(e) {
|
|
143
|
+
this.isDestroyed && (this.subscriptions = [], this.isDestroyed = !1), this.wavesurfer = e, this.onInit();
|
|
144
|
+
}
|
|
145
|
+
destroy() {
|
|
146
|
+
this.emit("destroy"), this.subscriptions.forEach(((e) => e())), this.subscriptions = [], this.isDestroyed = !0, this.wavesurfer = void 0;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function S(e, t) {
|
|
150
|
+
let n = t.xmlns ? document.createElementNS(t.xmlns, e) : document.createElement(e);
|
|
151
|
+
for (let [e, r] of Object.entries(t)) if (e === "children" && r) for (let [e, t] of Object.entries(r)) t instanceof Node ? n.appendChild(t) : typeof t == "string" ? n.appendChild(document.createTextNode(t)) : n.appendChild(S(e, t));
|
|
152
|
+
else e === "style" ? Object.assign(n.style, r) : e === "textContent" ? n.textContent = r : n.setAttribute(e, r.toString());
|
|
153
|
+
return n;
|
|
154
|
+
}
|
|
155
|
+
function C(e, t, n) {
|
|
156
|
+
let r = S(e, t || {});
|
|
157
|
+
return n?.appendChild(r), r;
|
|
158
|
+
}
|
|
159
|
+
function w(e, t) {
|
|
160
|
+
let n, r = () => {
|
|
161
|
+
n && (n(), n = void 0), n = e();
|
|
162
|
+
}, i = t.map(((e) => e.subscribe(r)));
|
|
163
|
+
return r(), () => {
|
|
164
|
+
n && (n(), n = void 0), i.forEach(((e) => e()));
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function T(e, t) {
|
|
168
|
+
let n = function(e) {
|
|
169
|
+
let t = e, n = /* @__PURE__ */ new Set();
|
|
170
|
+
return {
|
|
171
|
+
get value() {
|
|
172
|
+
return t;
|
|
173
|
+
},
|
|
174
|
+
set(e) {
|
|
175
|
+
Object.is(t, e) || (t = e, n.forEach(((e) => e(t))));
|
|
176
|
+
},
|
|
177
|
+
update(e) {
|
|
178
|
+
this.set(e(t));
|
|
179
|
+
},
|
|
180
|
+
subscribe: (e) => (n.add(e), () => n.delete(e))
|
|
181
|
+
};
|
|
182
|
+
}(null), r = (e) => {
|
|
183
|
+
n.set(e);
|
|
184
|
+
};
|
|
185
|
+
return e.addEventListener(t, r), n._cleanup = () => {
|
|
186
|
+
e.removeEventListener(t, r);
|
|
187
|
+
}, n;
|
|
188
|
+
}
|
|
189
|
+
var E = {
|
|
190
|
+
lineWidth: 1,
|
|
191
|
+
labelSize: 11,
|
|
192
|
+
labelPreferLeft: !1,
|
|
193
|
+
formatTimeCallback: (e) => `${Math.floor(e / 60)}:${`0${Math.floor(e) % 60}`.slice(-2)}`
|
|
194
|
+
}, D = class e extends x {
|
|
195
|
+
constructor(e) {
|
|
196
|
+
super(e || {}), this.lastPointerPosition = null, this.options = Object.assign({}, E, e), this.wrapper = C("div", { part: "hover" }), this.label = C("span", { part: "hover-label" }, this.wrapper);
|
|
197
|
+
}
|
|
198
|
+
static create(t) {
|
|
199
|
+
return new e(t);
|
|
200
|
+
}
|
|
201
|
+
addUnits(e) {
|
|
202
|
+
return `${e}${typeof e == "number" ? "px" : ""}`;
|
|
203
|
+
}
|
|
204
|
+
onInit() {
|
|
205
|
+
if (!this.wavesurfer) throw Error("WaveSurfer is not initialized");
|
|
206
|
+
let e = this.wavesurfer.options, t = this.options.lineColor || e.cursorColor || e.progressColor;
|
|
207
|
+
Object.assign(this.wrapper.style, {
|
|
208
|
+
position: "absolute",
|
|
209
|
+
zIndex: 10,
|
|
210
|
+
left: 0,
|
|
211
|
+
top: 0,
|
|
212
|
+
height: "100%",
|
|
213
|
+
pointerEvents: "none",
|
|
214
|
+
borderLeft: `${this.addUnits(this.options.lineWidth)} solid ${t}`,
|
|
215
|
+
opacity: "0",
|
|
216
|
+
transition: "opacity .1s ease-in"
|
|
217
|
+
}), Object.assign(this.label.style, {
|
|
218
|
+
display: "block",
|
|
219
|
+
backgroundColor: this.options.labelBackground,
|
|
220
|
+
color: this.options.labelColor,
|
|
221
|
+
fontSize: `${this.addUnits(this.options.labelSize)}`,
|
|
222
|
+
transition: "transform .1s ease-in",
|
|
223
|
+
padding: "2px 3px"
|
|
224
|
+
});
|
|
225
|
+
let n = this.wavesurfer.getWrapper();
|
|
226
|
+
n.appendChild(this.wrapper);
|
|
227
|
+
let r = this.wavesurfer.getState(), i = T(n, "pointermove"), a = T(n, "pointerleave");
|
|
228
|
+
this.subscriptions.push(w((() => {
|
|
229
|
+
let e = i.value;
|
|
230
|
+
if (!e || !this.wavesurfer) return;
|
|
231
|
+
this.lastPointerPosition = {
|
|
232
|
+
clientX: e.clientX,
|
|
233
|
+
clientY: e.clientY
|
|
234
|
+
};
|
|
235
|
+
let t = this.wavesurfer.getWrapper().getBoundingClientRect(), { width: n } = t, a = e.clientX - t.left, o = Math.min(1, Math.max(0, a / n)), s = Math.min(n - this.options.lineWidth - 1, a);
|
|
236
|
+
this.wrapper.style.transform = `translateX(${s}px)`, this.wrapper.style.opacity = "1";
|
|
237
|
+
let c = r.duration.value;
|
|
238
|
+
this.label.textContent = this.options.formatTimeCallback(c * o);
|
|
239
|
+
let l = this.label.offsetWidth, u = this.options.labelPreferLeft ? s - l > 0 : s + l > n;
|
|
240
|
+
this.label.style.transform = u ? `translateX(-${l + this.options.lineWidth}px)` : "", this.emit("hover", o);
|
|
241
|
+
}), [i, r.duration])), this.subscriptions.push(w((() => {
|
|
242
|
+
a.value && (this.wrapper.style.opacity = "0", this.lastPointerPosition = null, this.wrapper.style.transform = "");
|
|
243
|
+
}), [a]));
|
|
244
|
+
let o = () => {
|
|
245
|
+
if (this.lastPointerPosition && this.wavesurfer) {
|
|
246
|
+
let e = this.wavesurfer.getWrapper().getBoundingClientRect(), { width: t } = e, n = this.lastPointerPosition.clientX - e.left, i = Math.min(1, Math.max(0, n / t)), a = Math.min(t - this.options.lineWidth - 1, n);
|
|
247
|
+
this.wrapper.style.transform = `translateX(${a}px)`;
|
|
248
|
+
let o = r.duration.value;
|
|
249
|
+
this.label.textContent = this.options.formatTimeCallback(o * i);
|
|
250
|
+
let s = this.label.offsetWidth, c = this.options.labelPreferLeft ? a - s > 0 : a + s > t;
|
|
251
|
+
this.label.style.transform = c ? `translateX(-${s + this.options.lineWidth}px)` : "";
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
this.subscriptions.push(this.wavesurfer.on("zoom", o)), this.subscriptions.push(this.wavesurfer.on("scroll", o));
|
|
255
|
+
}
|
|
256
|
+
destroy() {
|
|
257
|
+
super.destroy(), this.wrapper.remove();
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region components/widget/tabs/messages-tab/message/audio-bubble-player.tsx
|
|
262
|
+
function O({ src: o, onDark: s = !1 }) {
|
|
263
|
+
let m = e("messages"), h = u(null), [g, _] = d(null), [v, b] = d(!1);
|
|
264
|
+
c(() => {
|
|
265
|
+
let e = h.current;
|
|
266
|
+
if (!e) return;
|
|
267
|
+
let t = getComputedStyle(e), n = t.getPropertyValue("--wx-primary").trim() || "#121314", r = t.getPropertyValue("--wx-primary-fg").trim() || "#ffffff", i = t.getPropertyValue("--wx-fg-muted").trim() || "#6b7280";
|
|
268
|
+
_(s ? {
|
|
269
|
+
wave: A(r, .35),
|
|
270
|
+
progress: r,
|
|
271
|
+
hoverLine: r
|
|
272
|
+
} : {
|
|
273
|
+
wave: i,
|
|
274
|
+
progress: n,
|
|
275
|
+
hoverLine: n
|
|
276
|
+
});
|
|
277
|
+
}, [s]);
|
|
278
|
+
let x = l(() => g ? [D.create({
|
|
279
|
+
lineColor: g.hoverLine,
|
|
280
|
+
lineWidth: 1,
|
|
281
|
+
labelBackground: g.hoverLine,
|
|
282
|
+
labelColor: s ? "#121314" : "#ffffff",
|
|
283
|
+
labelSize: "10px"
|
|
284
|
+
})] : [], [g, s]), S = l(() => ({ credentials: "omit" }), []), { wavesurfer: C, isReady: w, isPlaying: T, currentTime: E } = y({
|
|
285
|
+
container: h,
|
|
286
|
+
url: g && !v ? o : void 0,
|
|
287
|
+
waveColor: g?.wave,
|
|
288
|
+
progressColor: g?.progress,
|
|
289
|
+
cursorColor: g?.progress,
|
|
290
|
+
barWidth: 2,
|
|
291
|
+
barRadius: 2,
|
|
292
|
+
cursorWidth: 1,
|
|
293
|
+
height: 24,
|
|
294
|
+
hideScrollbar: !0,
|
|
295
|
+
plugins: x,
|
|
296
|
+
fetchParams: S
|
|
297
|
+
});
|
|
298
|
+
return c(() => {
|
|
299
|
+
if (!C) return;
|
|
300
|
+
let e = () => b(!0);
|
|
301
|
+
return C.on("error", e), () => {
|
|
302
|
+
C.un("error", e);
|
|
303
|
+
};
|
|
304
|
+
}, [C]), v ? /* @__PURE__ */ p("a", {
|
|
305
|
+
href: o,
|
|
306
|
+
target: "_blank",
|
|
307
|
+
rel: "noopener",
|
|
308
|
+
className: t("inline-flex w-60 max-w-full items-center gap-2 rounded-wx-sm px-3 py-2 text-xs font-medium", s ? "bg-wx-primary-fg/10 text-wx-primary-fg hover:bg-wx-primary-fg/20" : "bg-wx-bg/60 text-wx-fg hover:bg-wx-bg"),
|
|
309
|
+
children: [/* @__PURE__ */ f(n, {
|
|
310
|
+
size: 12,
|
|
311
|
+
className: "shrink-0"
|
|
312
|
+
}), /* @__PURE__ */ f("span", {
|
|
313
|
+
className: "truncate",
|
|
314
|
+
children: m("openAudio")
|
|
315
|
+
})]
|
|
316
|
+
}) : /* @__PURE__ */ p("div", {
|
|
317
|
+
className: "flex w-60 max-w-full min-w-0 items-center gap-3",
|
|
318
|
+
children: [
|
|
319
|
+
/* @__PURE__ */ f("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
onClick: () => {
|
|
322
|
+
C?.playPause();
|
|
323
|
+
},
|
|
324
|
+
"aria-label": m(T ? "pauseAudio" : "playAudio"),
|
|
325
|
+
className: t("flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-opacity", s ? "bg-wx-primary-fg text-wx-primary hover:opacity-90" : "bg-wx-primary text-wx-primary-fg hover:bg-wx-primary-hover"),
|
|
326
|
+
children: w ? T ? /* @__PURE__ */ f(r, { size: 12 }) : /* @__PURE__ */ f(a, {
|
|
327
|
+
size: 12,
|
|
328
|
+
className: "translate-x-[1px]"
|
|
329
|
+
}) : /* @__PURE__ */ f(i, {
|
|
330
|
+
size: 12,
|
|
331
|
+
className: "animate-spin"
|
|
332
|
+
})
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ f("div", {
|
|
335
|
+
ref: h,
|
|
336
|
+
className: "min-w-0 flex-1"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ f("span", {
|
|
339
|
+
className: t("shrink-0 font-mono text-[10px] tabular-nums", s ? "text-wx-primary-fg/70" : "text-wx-fg-subtle"),
|
|
340
|
+
children: w ? k(E) : "0:00"
|
|
341
|
+
})
|
|
342
|
+
]
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function k(e) {
|
|
346
|
+
return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
347
|
+
}
|
|
348
|
+
function A(e, t) {
|
|
349
|
+
let n = e.replace("#", "");
|
|
350
|
+
return n.length === 6 ? `rgba(${parseInt(n.substring(0, 2), 16)}, ${parseInt(n.substring(2, 4), 16)}, ${parseInt(n.substring(4, 6), 16)}, ${t})` : e;
|
|
351
|
+
}
|
|
352
|
+
//#endregion
|
|
353
|
+
export { O as AudioBubblePlayer };
|
|
354
|
+
|
|
355
|
+
//# sourceMappingURL=widget-react-CUuKGDZN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-react-CUuKGDZN.js","names":["i","r","o","s","c","a","t","e","n"],"sources":["../node_modules/@wavesurfer/react/dist/index.js","../node_modules/wavesurfer.js/dist/plugins/hover.esm.js","../components/widget/tabs/messages-tab/message/audio-bubble-player.tsx"],"sourcesContent":["import{jsx as n}from\"react/jsx-runtime\";import{memo as t,useRef as e,useState as r,useMemo as o,useEffect as s}from\"react\";import c from\"wavesurfer.js\";\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */function i(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&\"function\"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(e[r[o]]=n[r[o]])}return e}function u(n,t){const[e,u]=r(null),a=o((()=>i(t,[\"plugins\"])),[t]),f=o((()=>Object.entries(a).flat()),[a]);return s((()=>{if(!(null==n?void 0:n.current))return;const e=c.create(Object.assign(Object.assign({},a),{plugins:t.plugins,container:n.current}));return u(e),()=>{e.destroy()}}),[n,t.plugins,...f]),e}const a=/^on([A-Z])/,f=n=>a.test(n);function l(n,t){const e=o((()=>Object.entries(t).flat()),[t]);s((()=>{if(!n)return;const e=Object.entries(t);if(!e.length)return;const r=e.map((([t,e])=>{const r=t.replace(a,((n,t)=>t.toLowerCase()));return n.on(r,((...t)=>e(n,...t)))}));return()=>{r.forEach((n=>n()))}}),[n,...e])}const p=t((t=>{const r=e(null),[s,c]=function(n){return o((()=>{const t=Object.assign({},n),e=Object.assign({},n);for(const n in t)f(n)?delete t[n]:delete e[n];return[t,e]}),[n])}(t);return l(u(r,s),c),n(\"div\",{ref:r})}));function O(n){var{container:t}=n;const e=u(t,i(n,[\"container\"])),c=function(n){const[t,e]=r(!1),[c,i]=r(!1),[u,a]=r(!1),[f,l]=r(0);return s((()=>{if(!n)return;const t=[n.on(\"load\",(()=>{e(!1),i(!1),l(0)})),n.on(\"ready\",(()=>{e(!0),i(!1),a(!1),l(0)})),n.on(\"finish\",(()=>{a(!0)})),n.on(\"play\",(()=>{i(!0)})),n.on(\"pause\",(()=>{i(!1)})),n.on(\"timeupdate\",(()=>{l(n.getCurrentTime())})),n.on(\"destroy\",(()=>{e(!1),i(!1)}))];return()=>{t.forEach((n=>n()))}}),[n]),o((()=>({isReady:t,isPlaying:c,hasFinished:u,currentTime:f})),[c,u,f,t])}(e);return o((()=>Object.assign(Object.assign({},c),{wavesurfer:e})),[c,e])}export{p as default,O as useWavesurfer};\n","class t{constructor(){this.listeners={}}on(t,e,s){if(this.listeners[t]||(this.listeners[t]=new Set),null==s?void 0:s.once){const s=(...i)=>{this.un(t,s),e(...i)};return this.listeners[t].add(s),()=>this.un(t,s)}return this.listeners[t].add(e),()=>this.un(t,e)}un(t,e){var s;null===(s=this.listeners[t])||void 0===s||s.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach((t=>t(...e)))}}class e extends t{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit(\"destroy\"),this.subscriptions.forEach((t=>t())),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}function s(t,e){const i=e.xmlns?document.createElementNS(e.xmlns,t):document.createElement(t);for(const[t,n]of Object.entries(e))if(\"children\"===t&&n)for(const[t,e]of Object.entries(n))e instanceof Node?i.appendChild(e):\"string\"==typeof e?i.appendChild(document.createTextNode(e)):i.appendChild(s(t,e));else\"style\"===t?Object.assign(i.style,n):\"textContent\"===t?i.textContent=n:i.setAttribute(t,n.toString());return i}function i(t,e,i){const n=s(t,e||{});return null==i||i.appendChild(n),n}function n(t,e){let s;const i=()=>{s&&(s(),s=void 0),s=t()},n=e.map((t=>t.subscribe(i)));return i(),()=>{s&&(s(),s=void 0),n.forEach((t=>t()))}}function r(t,e){const s=function(t){let e=t;const s=new Set;return{get value(){return e},set(t){Object.is(e,t)||(e=t,s.forEach((t=>t(e))))},update(t){this.set(t(e))},subscribe:t=>(s.add(t),()=>s.delete(t))}}(null),i=t=>{s.set(t)};return t.addEventListener(e,i),s._cleanup=()=>{t.removeEventListener(e,i)},s}const o={lineWidth:1,labelSize:11,labelPreferLeft:!1,formatTimeCallback:t=>`${Math.floor(t/60)}:${`0${Math.floor(t)%60}`.slice(-2)}`};class a extends e{constructor(t){super(t||{}),this.lastPointerPosition=null,this.options=Object.assign({},o,t),this.wrapper=i(\"div\",{part:\"hover\"}),this.label=i(\"span\",{part:\"hover-label\"},this.wrapper)}static create(t){return new a(t)}addUnits(t){return`${t}${\"number\"==typeof t?\"px\":\"\"}`}onInit(){if(!this.wavesurfer)throw Error(\"WaveSurfer is not initialized\");const t=this.wavesurfer.options,e=this.options.lineColor||t.cursorColor||t.progressColor;Object.assign(this.wrapper.style,{position:\"absolute\",zIndex:10,left:0,top:0,height:\"100%\",pointerEvents:\"none\",borderLeft:`${this.addUnits(this.options.lineWidth)} solid ${e}`,opacity:\"0\",transition:\"opacity .1s ease-in\"}),Object.assign(this.label.style,{display:\"block\",backgroundColor:this.options.labelBackground,color:this.options.labelColor,fontSize:`${this.addUnits(this.options.labelSize)}`,transition:\"transform .1s ease-in\",padding:\"2px 3px\"});const s=this.wavesurfer.getWrapper();s.appendChild(this.wrapper);const i=this.wavesurfer.getState(),o=r(s,\"pointermove\"),a=r(s,\"pointerleave\");this.subscriptions.push(n((()=>{const t=o.value;if(!t||!this.wavesurfer)return;this.lastPointerPosition={clientX:t.clientX,clientY:t.clientY};const e=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:s}=e,n=t.clientX-e.left,r=Math.min(1,Math.max(0,n/s)),a=Math.min(s-this.options.lineWidth-1,n);this.wrapper.style.transform=`translateX(${a}px)`,this.wrapper.style.opacity=\"1\";const l=i.duration.value;this.label.textContent=this.options.formatTimeCallback(l*r);const h=this.label.offsetWidth,p=this.options.labelPreferLeft?a-h>0:a+h>s;this.label.style.transform=p?`translateX(-${h+this.options.lineWidth}px)`:\"\",this.emit(\"hover\",r)}),[o,i.duration])),this.subscriptions.push(n((()=>{a.value&&(this.wrapper.style.opacity=\"0\",this.lastPointerPosition=null,this.wrapper.style.transform=\"\")}),[a]));const l=()=>{if(this.lastPointerPosition&&this.wavesurfer){const t=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:e}=t,s=this.lastPointerPosition.clientX-t.left,n=Math.min(1,Math.max(0,s/e)),r=Math.min(e-this.options.lineWidth-1,s);this.wrapper.style.transform=`translateX(${r}px)`;const o=i.duration.value;this.label.textContent=this.options.formatTimeCallback(o*n);const a=this.label.offsetWidth,l=this.options.labelPreferLeft?r-a>0:r+a>e;this.label.style.transform=l?`translateX(-${a+this.options.lineWidth}px)`:\"\"}};this.subscriptions.push(this.wavesurfer.on(\"zoom\",l)),this.subscriptions.push(this.wavesurfer.on(\"scroll\",l))}destroy(){super.destroy(),this.wrapper.remove()}}export{a as default};\n","\"use client\";\n\nimport { useWavesurfer } from \"@wavesurfer/react\";\nimport { ExternalLink, Loader2, Pause, Play } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport Hover from \"wavesurfer.js/dist/plugins/hover.esm.js\";\nimport { cn } from \"@/lib/utils\";\n\ninterface AudioBubblePlayerProps {\n src: string;\n /** When `true`, the player sits inside the visitor's own bubble\n * (dark surface in light theme, light in dark theme) — the\n * internal palette inverts to match. */\n onDark?: boolean;\n}\n\n/**\n * Brand-themed voice-note player. Replaces the browser's native\n * `<audio controls>` with a wavesurfer.js waveform + a single\n * play/pause affordance — matches the FE app's `AudioPlayer` (its\n * pattern is the source of this port).\n *\n * **Theme adaptation**: wavesurfer renders to `<canvas>` which can't\n * resolve CSS variables — we read the relevant `--wx-*` tokens on\n * mount and pass real hex strings to wavesurfer. The `onDark` flag\n * flips the palette so the same component reads correctly on the\n * visitor's own dark bubble AND the operator's elevated bubble.\n *\n * **Hover plugin** gives visitors a thin vertical line + tooltip\n * showing the time position under the cursor — the standard\n * messenger UX for scrubbing through a voice note.\n */\nexport function AudioBubblePlayer({ src, onDark = false }: AudioBubblePlayerProps) {\n const t = useTranslations(\"messages\");\n const containerRef = useRef<HTMLDivElement>(null);\n const [colors, setColors] = useState<{\n wave: string;\n progress: string;\n hoverLine: string;\n } | null>(null);\n const [loadError, setLoadError] = useState(false);\n\n // Resolve theme tokens to concrete hex strings on mount — wavesurfer\n // needs RGB/hex, not CSS-var references. Re-runs whenever `onDark`\n // changes (defensive — the flag is stable in practice but the cost\n // is one extra read).\n useEffect(() => {\n // Read the tokens off the CONTAINER, not `document.documentElement`\n // — in the React-component embed the `--wx-*` vars live on the\n // Shadow DOM host, never the host page's `<html>`, so reading from\n // `documentElement` would resolve to empty and the waveform would\n // always use the hardcoded fallbacks. The container inherits the\n // vars in every embed mode.\n const el = containerRef.current;\n if (!el) return;\n const styles = getComputedStyle(el);\n const primary = styles.getPropertyValue(\"--wx-primary\").trim() || \"#121314\";\n const primaryFg = styles.getPropertyValue(\"--wx-primary-fg\").trim() || \"#ffffff\";\n const fgMuted = styles.getPropertyValue(\"--wx-fg-muted\").trim() || \"#6b7280\";\n if (onDark) {\n // Visitor's own bubble — wave on the bubble's own foreground\n // colour, dimmed for the unplayed portion.\n setColors({\n wave: hexToRgba(primaryFg, 0.35),\n progress: primaryFg,\n hoverLine: primaryFg,\n });\n } else {\n setColors({\n wave: fgMuted,\n progress: primary,\n hoverLine: primary,\n });\n }\n }, [onDark]);\n\n const plugins = useMemo(() => {\n if (!colors) return [];\n return [\n Hover.create({\n lineColor: colors.hoverLine,\n lineWidth: 1,\n labelBackground: colors.hoverLine,\n labelColor: onDark ? \"#121314\" : \"#ffffff\",\n labelSize: \"10px\",\n }),\n ];\n }, [colors, onDark]);\n\n // Match the FE app's fetch params — `credentials: \"omit\"` so the\n // browser doesn't attach cookies, which avoids the CORS preflight\n // failures cookies sometimes trigger on bare-CDN sources.\n const fetchParams = useMemo<RequestInit>(() => ({ credentials: \"omit\" }), []);\n\n // Skip the hook entirely until the palette is resolved — otherwise\n // wavesurfer mounts with default (visible) blue colours for a\n // frame before we swap them in. Also skip once we've recorded a\n // load error so wavesurfer doesn't retry forever.\n const { wavesurfer, isReady, isPlaying, currentTime } = useWavesurfer({\n container: containerRef,\n url: colors && !loadError ? src : undefined,\n waveColor: colors?.wave,\n progressColor: colors?.progress,\n cursorColor: colors?.progress,\n barWidth: 2,\n barRadius: 2,\n cursorWidth: 1,\n height: 24,\n // Voice notes are short — the visitor never needs to scroll the\n // waveform, and wavesurfer's internal scroll element would\n // otherwise paint a horizontal scrollbar under the wave on hover.\n hideScrollbar: true,\n plugins,\n fetchParams,\n });\n\n // Surface a fallback when the audio can't be loaded (CORS-blocked\n // source, 404, etc.) — keeps the bubble from sitting on a forever\n // spinner. Visitors get an \"Open\" link that opens the raw URL in\n // a new tab as the escape hatch.\n useEffect(() => {\n if (!wavesurfer) return;\n const onError = () => setLoadError(true);\n wavesurfer.on(\"error\", onError);\n return () => {\n wavesurfer.un(\"error\", onError);\n };\n }, [wavesurfer]);\n\n const handlePlayPause = () => {\n wavesurfer?.playPause();\n };\n\n if (loadError) {\n return (\n <a\n href={src}\n target=\"_blank\"\n rel=\"noopener\"\n className={cn(\n // `w-60` intrinsic, `max-w-full` so it shrinks to fit a\n // narrow mobile bubble instead of overflowing its corners.\n \"inline-flex w-60 max-w-full items-center gap-2 rounded-wx-sm px-3 py-2 text-xs font-medium\",\n onDark\n ? \"bg-wx-primary-fg/10 text-wx-primary-fg hover:bg-wx-primary-fg/20\"\n : \"bg-wx-bg/60 text-wx-fg hover:bg-wx-bg\",\n )}\n >\n <ExternalLink size={12} className=\"shrink-0\" />\n <span className=\"truncate\">{t(\"openAudio\")}</span>\n </a>\n );\n }\n\n // Single-row flex so play button + waveform + time counter share\n // one baseline — vertical centering \"just works\" without manual\n // pixel nudges. `w-60` is the intrinsic target width; `max-w-full`\n // lets it shrink to fit a narrow mobile bubble instead of\n // overflowing the rounded corners (a plain `w-full` would collapse\n // it tiny inside the shrink-wrapped bubble). `min-w-0` lets the flex\n // children shrink rather than force the row wider than its parent.\n return (\n <div className=\"flex w-60 max-w-full min-w-0 items-center gap-3\">\n <button\n type=\"button\"\n onClick={handlePlayPause}\n aria-label={isPlaying ? t(\"pauseAudio\") : t(\"playAudio\")}\n className={cn(\n \"flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-opacity\",\n onDark\n ? \"bg-wx-primary-fg text-wx-primary hover:opacity-90\"\n : \"bg-wx-primary text-wx-primary-fg hover:bg-wx-primary-hover\",\n )}\n >\n {!isReady ? (\n <Loader2 size={12} className=\"animate-spin\" />\n ) : isPlaying ? (\n <Pause size={12} />\n ) : (\n // Optical centering — the play triangle's visual mass\n // sits left of the SVG bounding box.\n <Play size={12} className=\"translate-x-[1px]\" />\n )}\n </button>\n <div ref={containerRef} className=\"min-w-0 flex-1\" />\n <span\n className={cn(\n \"shrink-0 font-mono text-[10px] tabular-nums\",\n onDark ? \"text-wx-primary-fg/70\" : \"text-wx-fg-subtle\",\n )}\n >\n {isReady ? formatTime(currentTime) : \"0:00\"}\n </span>\n </div>\n );\n}\n\nfunction formatTime(time: number): string {\n const m = Math.floor(time / 60);\n const s = Math.floor(time % 60)\n .toString()\n .padStart(2, \"0\");\n return `${m}:${s}`;\n}\n\n/**\n * Wavesurfer's canvas can't resolve CSS opacity — for the unplayed\n * waveform tint we feed a literal `rgba()` string built from the\n * resolved foreground hex.\n */\nfunction hexToRgba(hex: string, alpha: number): string {\n const clean = hex.replace(\"#\", \"\");\n if (clean.length !== 6) return hex;\n const r = parseInt(clean.substring(0, 2), 16);\n const g = parseInt(clean.substring(2, 4), 16);\n const b = parseInt(clean.substring(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;AAcgF,SAASA,EAAE,GAAE,GAAE;CAAC,IAAI,IAAE,EAAE;CAAC,KAAI,IAAI,KAAK,GAAE,OAAO,UAAU,eAAe,KAAK,GAAE,EAAE,IAAE,EAAE,QAAQ,EAAE,GAAC,MAAI,EAAE,KAAG,EAAE;CAAI,IAAS,KAAN,QAAqB,OAAO,OAAO,yBAA1B,YAAgD;EAAC,IAAI,IAAE;EAAE,KAAI,IAAE,OAAO,sBAAsB,EAAE,EAAC,IAAE,EAAE,QAAO,KAAI,EAAE,QAAQ,EAAE,GAAG,GAAC,KAAG,OAAO,UAAU,qBAAqB,KAAK,GAAE,EAAE,GAAG,KAAG,EAAE,EAAE,MAAI,EAAE,EAAE;;CAAK,OAAO;;AAAE,SAAS,EAAE,GAAE,GAAE;CAAC,IAAK,CAAC,GAAE,KAAGC,EAAE,KAAK,EAAC,IAAEC,SAAOF,EAAE,GAAE,CAAC,UAAU,CAAC,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