@sapia-ai/chatbot-v3 1.0.0 → 1.0.1
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/{EmbeddedVideoPlayer-SaMMfDIW.js → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
- package/dist/Preview-Dmns6UWL.js +84 -0
- package/dist/api.js +1 -1
- package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
- package/dist/embed/createChatbot.d.ts +2 -0
- package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +15479 -2067
- package/dist/jsx-runtime-8QqjHL5t.js +24 -0
- package/dist/messages-Czlp86gl.js +1963 -0
- package/dist/react-B0K-sClg.js +295 -0
- package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
- package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
- package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
- package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
- package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
- package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
- package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
- package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
- package/package.json +14 -25
- package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
- package/dist/Preview-Db-hgkTh.js +0 -83
- package/dist/Preview-Db-hgkTh.js.map +0 -1
- package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
- package/dist/dist-BSi28_cP.js.map +0 -1
- package/dist/dist-DGBYKC8c.js.map +0 -1
- package/dist/dist-FvHBWiRa.js.map +0 -1
- package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
- package/dist/hls-mBncGwsE.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/max-Btet1snX.js.map +0 -1
- package/dist/messages-C4jqrtSG.js +0 -187
- package/dist/messages-C4jqrtSG.js.map +0 -1
- package/dist/react-BGJ7Szvq.js.map +0 -1
- package/dist/react-BMxM8TWJ.js.map +0 -1
- package/dist/react-BVzcquey.js.map +0 -1
- package/dist/react-BrCGR7Ca.js.map +0 -1
- package/dist/react-Bujo1aK5.js.map +0 -1
- package/dist/react-CRTg4gz8.js.map +0 -1
- package/dist/react-GXf8sbzf.js.map +0 -1
- package/dist/react-lp7yfM94.js.map +0 -1
- package/dist/sapia-chatbot.css +0 -3
- package/dist-umd/sapia-chatbot.umd.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import o from "
|
|
1
|
+
import { b as e } from "./messages-Czlp86gl.js";
|
|
2
|
+
import { t } from "./react-B0K-sClg.js";
|
|
3
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
4
|
+
import { t as s } from "./defineProperty-DiFpLzd2.js";
|
|
4
5
|
//#region ../../node_modules/.pnpm/spotify-audio-element@1.0.4/node_modules/spotify-audio-element/dist/spotify-audio-element.js
|
|
5
|
-
var
|
|
6
|
-
function
|
|
6
|
+
var c = /* @__PURE__ */ e(t(), 1), l, u = "https://open.spotify.com", d = /open\.spotify\.com\/(\w+)\/(\w+)/i, f = "https://open.spotify.com/embed-podcast/iframe-api/v1", p = "SpotifyIframeApi", m = "onSpotifyIframeApiReady";
|
|
7
|
+
function h(e, t = {}) {
|
|
7
8
|
return `
|
|
8
9
|
<style>
|
|
9
10
|
:host {
|
|
@@ -24,8 +25,8 @@ function p(e, t = {}) {
|
|
|
24
25
|
display: none !important;
|
|
25
26
|
}
|
|
26
27
|
</style>
|
|
27
|
-
<iframe${
|
|
28
|
-
src:
|
|
28
|
+
<iframe${A({
|
|
29
|
+
src: g(e, t),
|
|
29
30
|
scrolling: "no",
|
|
30
31
|
frameborder: 0,
|
|
31
32
|
width: "100%",
|
|
@@ -34,56 +35,56 @@ function p(e, t = {}) {
|
|
|
34
35
|
})}></iframe>
|
|
35
36
|
`;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function g(e, t) {
|
|
38
39
|
var n, r, i;
|
|
39
40
|
if (!e.src) return;
|
|
40
|
-
let a = e.src.match(
|
|
41
|
+
let a = e.src.match(d), o = a && a[1], s = a && a[2], c = {
|
|
41
42
|
t: (n = t.config) == null ? void 0 : n.startAt,
|
|
42
43
|
theme: ((r = t.config) == null ? void 0 : r.theme) === "dark" ? "0" : null
|
|
43
44
|
};
|
|
44
|
-
return `${
|
|
45
|
+
return `${u}/embed/${o}/${s}${(i = t.config) != null && i.preferVideo ? "/video" : ""}?${j(c)}`;
|
|
45
46
|
}
|
|
46
|
-
var
|
|
47
|
+
var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakSet(), O = class extends ((l = globalThis.HTMLElement) == null ? class {} : l) {
|
|
47
48
|
constructor() {
|
|
48
|
-
super(),
|
|
49
|
+
super(), n(this, D), s(this, "loadComplete", new I()), r(this, _, void 0), r(this, v, void 0), r(this, y, void 0), r(this, b, !1), r(this, x, !1), r(this, S, !0), r(this, C, 0), r(this, w, NaN), r(this, T, !1), r(this, E, null), a(D, this, k).call(this, "config");
|
|
49
50
|
}
|
|
50
51
|
async load() {
|
|
51
|
-
var e, t,
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
let
|
|
52
|
+
var e, t, n;
|
|
53
|
+
if (i(_, this)) return;
|
|
54
|
+
i(v, this) && (this.loadComplete = new I()), o(v, this, !0), await o(_, this, Promise.resolve()), o(_, this, null), o(b, this, !1), o(x, this, !1), o(C, this, 0), o(w, this, NaN), o(T, this, !1), this.dispatchEvent(new Event("emptied"));
|
|
55
|
+
let r = this.api;
|
|
55
56
|
if (this.api = null, !this.src) return;
|
|
56
57
|
this.dispatchEvent(new Event("loadstart"));
|
|
57
|
-
let
|
|
58
|
+
let a = {
|
|
58
59
|
t: (e = this.config) == null ? void 0 : e.startAt,
|
|
59
60
|
theme: ((t = this.config) == null ? void 0 : t.theme) === "dark" ? "0" : null,
|
|
60
|
-
preferVideo: (
|
|
61
|
+
preferVideo: (n = this.config) == null ? void 0 : n.preferVideo
|
|
61
62
|
};
|
|
62
|
-
if (
|
|
63
|
+
if (i(y, this)) this.api = r, this.api.iframeElement.src = g(N(this.attributes), this);
|
|
63
64
|
else {
|
|
64
|
-
|
|
65
|
-
let e = this.shadowRoot.querySelector("iframe"), t = await
|
|
66
|
-
this.api = await new Promise((n) => t.createController(e,
|
|
65
|
+
o(y, this, !0), this.shadowRoot || (this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = h(N(this.attributes), this));
|
|
66
|
+
let e = this.shadowRoot.querySelector("iframe"), t = await F(f, p, m);
|
|
67
|
+
this.api = await new Promise((n) => t.createController(e, a, n)), this.api.iframeElement = e, this.api.addListener("ready", () => {
|
|
67
68
|
this.dispatchEvent(new Event("loadedmetadata")), this.dispatchEvent(new Event("durationchange")), this.dispatchEvent(new Event("volumechange"));
|
|
68
69
|
}), this.api.addListener("playback_update", (e) => {
|
|
69
|
-
if (
|
|
70
|
-
|
|
70
|
+
if (i(x, this) && i(S, this) && (e.data.isBuffering || !e.data.isPaused)) {
|
|
71
|
+
o(x, this, !1), this.currentTime = 1;
|
|
71
72
|
return;
|
|
72
73
|
}
|
|
73
|
-
if (e.data.duration / 1e3 !==
|
|
74
|
-
|
|
74
|
+
if (e.data.duration / 1e3 !== i(w, this) && (o(x, this, !1), o(w, this, e.data.duration / 1e3), this.dispatchEvent(new Event("durationchange"))), e.data.position / 1e3 !== i(C, this) && (o(T, this, !1), o(x, this, !1), o(C, this, e.data.position / 1e3), this.dispatchEvent(new Event("timeupdate"))), !i(b, this) && !i(S, this) && e.data.isPaused) {
|
|
75
|
+
o(S, this, !0), this.dispatchEvent(new Event("pause"));
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
|
-
if (
|
|
78
|
-
|
|
78
|
+
if (i(S, this) && (e.data.isBuffering || !e.data.isPaused)) {
|
|
79
|
+
o(S, this, !1), this.dispatchEvent(new Event("play")), o(b, this, e.data.isBuffering), i(b, this) ? this.dispatchEvent(new Event("waiting")) : this.dispatchEvent(new Event("playing"));
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
82
|
+
if (i(b, this) && !e.data.isPaused) {
|
|
83
|
+
o(b, this, !1), this.dispatchEvent(new Event("playing"));
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
85
|
-
if (!this.paused && !this.seeking && !
|
|
86
|
-
if (
|
|
86
|
+
if (!this.paused && !this.seeking && !i(x, this) && Math.ceil(this.currentTime) >= this.duration) {
|
|
87
|
+
if (o(x, this, !0), this.loop) {
|
|
87
88
|
this.currentTime = 1;
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
@@ -103,21 +104,21 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
|
|
|
103
104
|
}
|
|
104
105
|
async play() {
|
|
105
106
|
var e;
|
|
106
|
-
return
|
|
107
|
+
return o(S, this, !1), o(b, this, !0), this.dispatchEvent(new Event("play")), await this.loadComplete, (e = this.api) == null ? void 0 : e.resume();
|
|
107
108
|
}
|
|
108
109
|
async pause() {
|
|
109
110
|
var e;
|
|
110
111
|
return await this.loadComplete, (e = this.api) == null ? void 0 : e.pause();
|
|
111
112
|
}
|
|
112
113
|
get config() {
|
|
113
|
-
return
|
|
114
|
+
return i(E, this);
|
|
114
115
|
}
|
|
115
116
|
set config(e) {
|
|
116
|
-
|
|
117
|
+
o(E, this, e);
|
|
117
118
|
}
|
|
118
119
|
get paused() {
|
|
119
120
|
var e;
|
|
120
|
-
return (e =
|
|
121
|
+
return (e = i(S, this)) == null ? !0 : e;
|
|
121
122
|
}
|
|
122
123
|
get muted() {
|
|
123
124
|
return !1;
|
|
@@ -131,7 +132,7 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
|
|
|
131
132
|
return Math.ceil(this.currentTime) >= this.duration;
|
|
132
133
|
}
|
|
133
134
|
get seeking() {
|
|
134
|
-
return
|
|
135
|
+
return i(T, this);
|
|
135
136
|
}
|
|
136
137
|
get loop() {
|
|
137
138
|
return this.hasAttribute("loop");
|
|
@@ -140,19 +141,19 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
|
|
|
140
141
|
this.loop != e && this.toggleAttribute("loop", !!e);
|
|
141
142
|
}
|
|
142
143
|
get currentTime() {
|
|
143
|
-
return
|
|
144
|
+
return i(C, this);
|
|
144
145
|
}
|
|
145
146
|
set currentTime(e) {
|
|
146
147
|
if (this.currentTime == e) return;
|
|
147
|
-
|
|
148
|
-
let t =
|
|
149
|
-
|
|
148
|
+
o(T, this, !0);
|
|
149
|
+
let t = i(C, this);
|
|
150
|
+
o(C, this, e), this.dispatchEvent(new Event("timeupdate")), o(C, this, t), this.loadComplete.then(() => {
|
|
150
151
|
var t;
|
|
151
152
|
(t = this.api) == null || t.seek(e);
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
155
|
get duration() {
|
|
155
|
-
return
|
|
156
|
+
return i(w, this);
|
|
156
157
|
}
|
|
157
158
|
get src() {
|
|
158
159
|
return this.getAttribute("src");
|
|
@@ -161,18 +162,18 @@ var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /*
|
|
|
161
162
|
this.setAttribute("src", `${e}`);
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
|
-
function
|
|
165
|
+
function k(e) {
|
|
165
166
|
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
166
167
|
let t = this[e];
|
|
167
168
|
delete this[e], this[e] = t;
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
|
|
171
|
+
s(O, "getTemplateHTML", h), s(O, "shadowRootOptions", { mode: "open" }), s(O, "observedAttributes", [
|
|
171
172
|
"controls",
|
|
172
173
|
"loop",
|
|
173
174
|
"src"
|
|
174
175
|
]);
|
|
175
|
-
function
|
|
176
|
+
function A(e) {
|
|
176
177
|
let t = "";
|
|
177
178
|
for (let n in e) {
|
|
178
179
|
let r = e[n];
|
|
@@ -180,10 +181,10 @@ function O(e) {
|
|
|
180
181
|
}
|
|
181
182
|
return t;
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
return String(new URLSearchParams(
|
|
184
|
+
function j(e) {
|
|
185
|
+
return String(new URLSearchParams(M(e)));
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function M(e) {
|
|
187
188
|
let t = {};
|
|
188
189
|
for (let n in e) {
|
|
189
190
|
let r = e[n];
|
|
@@ -191,21 +192,21 @@ function A(e) {
|
|
|
191
192
|
}
|
|
192
193
|
return t;
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function N(e) {
|
|
195
196
|
let t = {};
|
|
196
197
|
for (let n of e) t[n.name] = n.value;
|
|
197
198
|
return t;
|
|
198
199
|
}
|
|
199
|
-
var
|
|
200
|
-
async function
|
|
201
|
-
return
|
|
200
|
+
var P = {};
|
|
201
|
+
async function F(e, t, n) {
|
|
202
|
+
return P[e] ? P[e] : t && self[t] ? Promise.resolve(self[t]) : P[e] = new Promise(function(t, r) {
|
|
202
203
|
let i = document.createElement("script");
|
|
203
204
|
i.src = e;
|
|
204
205
|
let a = (e) => t(e);
|
|
205
206
|
n && (self[n] = a), i.onload = () => !n && a(), i.onerror = r, document.head.append(i);
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
|
-
var
|
|
209
|
+
var I = class extends Promise {
|
|
209
210
|
constructor(e = () => {}) {
|
|
210
211
|
let t, n;
|
|
211
212
|
super((r, i) => {
|
|
@@ -213,8 +214,8 @@ var P = class extends Promise {
|
|
|
213
214
|
}), this.resolve = t, this.reject = n;
|
|
214
215
|
}
|
|
215
216
|
};
|
|
216
|
-
globalThis.customElements && !globalThis.customElements.get("spotify-audio") && globalThis.customElements.define("spotify-audio",
|
|
217
|
-
var
|
|
217
|
+
globalThis.customElements && !globalThis.customElements.get("spotify-audio") && globalThis.customElements.define("spotify-audio", O);
|
|
218
|
+
var L = O, R = /* @__PURE__ */ new Set([
|
|
218
219
|
"style",
|
|
219
220
|
"children",
|
|
220
221
|
"ref",
|
|
@@ -222,28 +223,28 @@ var F = E, I = /* @__PURE__ */ new Set([
|
|
|
222
223
|
"suppressContentEditableWarning",
|
|
223
224
|
"suppressHydrationWarning",
|
|
224
225
|
"dangerouslySetInnerHTML"
|
|
225
|
-
]),
|
|
226
|
+
]), z = {
|
|
226
227
|
className: "class",
|
|
227
228
|
htmlFor: "for"
|
|
228
229
|
};
|
|
229
|
-
function
|
|
230
|
+
function B(e) {
|
|
230
231
|
return e.toLowerCase();
|
|
231
232
|
}
|
|
232
|
-
function
|
|
233
|
+
function V(e) {
|
|
233
234
|
if (typeof e == "boolean") return e ? "" : void 0;
|
|
234
235
|
if (typeof e != "function" && !(typeof e == "object" && e)) return e;
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function H({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = B, toAttributeValue: s = V }) {
|
|
237
238
|
let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
|
|
238
239
|
var u, d;
|
|
239
240
|
let f = e.useRef(null), p = e.useRef(/* @__PURE__ */ new Map()), m = {}, h = {}, g = {}, _ = {};
|
|
240
241
|
for (let [e, t] of Object.entries(i)) {
|
|
241
242
|
var v, y;
|
|
242
|
-
if (
|
|
243
|
+
if (R.has(e)) {
|
|
243
244
|
g[e] = t;
|
|
244
245
|
continue;
|
|
245
246
|
}
|
|
246
|
-
let r = o((v =
|
|
247
|
+
let r = o((v = z[e]) == null ? e : v);
|
|
247
248
|
if (n.prototype && e in n.prototype && !(e in ((y = (u = globalThis.HTMLElement) == null ? void 0 : u.prototype) == null ? {} : y)) && !((d = n.observedAttributes) != null && d.some((e) => e === r))) {
|
|
248
249
|
_[e] = t;
|
|
249
250
|
continue;
|
|
@@ -253,7 +254,7 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
253
254
|
continue;
|
|
254
255
|
}
|
|
255
256
|
let i = s(t);
|
|
256
|
-
r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i ===
|
|
257
|
+
r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i === V(t) ? g[r] = t : g[r] = i);
|
|
257
258
|
}
|
|
258
259
|
if (typeof window < "u") {
|
|
259
260
|
for (let t in m) {
|
|
@@ -269,8 +270,8 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
269
270
|
e.useLayoutEffect(() => {
|
|
270
271
|
if (f.current === null) return;
|
|
271
272
|
let e = /* @__PURE__ */ new Map();
|
|
272
|
-
for (let t in _)
|
|
273
|
-
for (let [e, t] of p.current)
|
|
273
|
+
for (let t in _) U(f.current, t, _[t]), p.current.delete(t), e.set(t, _[t]);
|
|
274
|
+
for (let [e, t] of p.current) U(f.current, e, void 0);
|
|
274
275
|
p.current = e;
|
|
275
276
|
});
|
|
276
277
|
}
|
|
@@ -293,19 +294,19 @@ function B({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
293
294
|
});
|
|
294
295
|
return l.displayName = i == null ? n.name : i, l;
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
+
function U(e, t, n) {
|
|
297
298
|
var r, i;
|
|
298
299
|
e[t] = n, n == null && t in ((r = (i = globalThis.HTMLElement) == null ? void 0 : i.prototype) == null ? {} : r) && e.removeAttribute(t);
|
|
299
300
|
}
|
|
300
|
-
var
|
|
301
|
-
react:
|
|
301
|
+
var W = H({
|
|
302
|
+
react: c.default,
|
|
302
303
|
tagName: "spotify-audio",
|
|
303
|
-
elementClass:
|
|
304
|
+
elementClass: L,
|
|
304
305
|
toAttributeName(e) {
|
|
305
|
-
return e === "muted" ? "" : e === "defaultMuted" ? "muted" :
|
|
306
|
+
return e === "muted" ? "" : e === "defaultMuted" ? "muted" : B(e);
|
|
306
307
|
}
|
|
307
308
|
});
|
|
308
309
|
//#endregion
|
|
309
|
-
export {
|
|
310
|
+
export { W as default };
|
|
310
311
|
|
|
311
|
-
//# sourceMappingURL=react-
|
|
312
|
+
//# sourceMappingURL=react-DJysvNxz.js.map
|