@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,67 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { b as e } from "./messages-Czlp86gl.js";
|
|
2
|
+
import { t } from "./react-B0K-sClg.js";
|
|
3
|
+
import { n } from "./hls-mBncGwsE.js";
|
|
4
|
+
import { a as r, i, n as a, r as o, t as s } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
5
|
+
import { t as c } from "./defineProperty-DiFpLzd2.js";
|
|
6
|
+
import { n as l, t as u } from "./dist-BSi28_cP.js";
|
|
7
|
+
//#region ../../node_modules/.pnpm/hls-video-element@1.5.11/node_modules/hls-video-element/dist/hls-video-element.js
|
|
8
|
+
var d = /* @__PURE__ */ e(t(), 1), f = ((e) => {
|
|
9
|
+
var t, l, u, d, f;
|
|
10
|
+
return l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakSet(), f = /* @__PURE__ */ new WeakMap(), t = class extends e {
|
|
9
11
|
constructor() {
|
|
10
|
-
super(),
|
|
12
|
+
super(), r(this, d), i(this, l, null), i(this, u, null), i(this, f, () => {
|
|
11
13
|
var e, t, n;
|
|
12
14
|
(e = this.nativeEl) != null && e.webkitCurrentPlaybackTargetIsWireless ? (t = this.api) == null || t.stopLoad() : (n = this.api) == null || n.startLoad();
|
|
13
|
-
}),
|
|
15
|
+
}), o(d, this, m).call(this, "config");
|
|
14
16
|
}
|
|
15
17
|
get config() {
|
|
16
|
-
return
|
|
18
|
+
return a(u, this);
|
|
17
19
|
}
|
|
18
20
|
set config(e) {
|
|
19
|
-
|
|
21
|
+
s(u, this, e);
|
|
20
22
|
}
|
|
21
23
|
attributeChangedCallback(e, t, n) {
|
|
22
24
|
e !== "src" && super.attributeChangedCallback(e, t, n), e === "src" && t != n && this.load();
|
|
23
25
|
}
|
|
24
26
|
async load() {
|
|
25
|
-
var
|
|
26
|
-
let
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
switch (await Promise.resolve(), this.api = new
|
|
27
|
+
var e, t;
|
|
28
|
+
let r = !this.api;
|
|
29
|
+
if (o(d, this, p).call(this), this.src) {
|
|
30
|
+
if (r && !a(u, this) && s(u, this, JSON.parse(((e = this.shadowRoot.getElementById("config")) == null ? void 0 : e.textContent) || "{}")), n.isSupported()) {
|
|
31
|
+
switch (await Promise.resolve(), this.api = new n({
|
|
30
32
|
liveDurationInfinity: !0,
|
|
31
33
|
autoStartLoad: !1,
|
|
32
34
|
...this.config
|
|
33
35
|
}), this.api.loadSource(this.src), this.api.attachMedia(this.nativeEl), this.nativeEl.preload) {
|
|
34
36
|
case "none": {
|
|
35
|
-
let
|
|
36
|
-
this.nativeEl.addEventListener("play",
|
|
37
|
-
this.nativeEl.removeEventListener("play",
|
|
37
|
+
let e = () => this.api.startLoad();
|
|
38
|
+
this.nativeEl.addEventListener("play", e, { once: !0 }), this.api.on(n.Events.DESTROYING, () => {
|
|
39
|
+
this.nativeEl.removeEventListener("play", e);
|
|
38
40
|
});
|
|
39
41
|
break;
|
|
40
42
|
}
|
|
41
43
|
case "metadata": {
|
|
42
|
-
let
|
|
44
|
+
let e = this.api.config.maxBufferLength, t = this.api.config.maxBufferSize;
|
|
43
45
|
this.api.config.maxBufferLength = 1, this.api.config.maxBufferSize = 1;
|
|
44
46
|
let r = () => {
|
|
45
|
-
this.api.config.maxBufferLength =
|
|
47
|
+
this.api.config.maxBufferLength = e, this.api.config.maxBufferSize = t;
|
|
46
48
|
};
|
|
47
|
-
this.nativeEl.addEventListener("play", r, { once: !0 }), this.api.on(
|
|
49
|
+
this.nativeEl.addEventListener("play", r, { once: !0 }), this.api.on(n.Events.DESTROYING, () => {
|
|
48
50
|
this.nativeEl.removeEventListener("play", r);
|
|
49
51
|
}), this.api.startLoad();
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
54
|
default: this.api.startLoad();
|
|
53
55
|
}
|
|
54
|
-
this.nativeEl.webkitCurrentPlaybackTargetIsWireless && this.api.stopLoad(), this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",
|
|
55
|
-
let
|
|
56
|
-
this.api.on(
|
|
56
|
+
this.nativeEl.webkitCurrentPlaybackTargetIsWireless && this.api.stopLoad(), this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", a(f, this)), s(l, this, document.createElement("source")), a(l, this).setAttribute("type", "application/x-mpegURL"), a(l, this).setAttribute("src", this.src), this.nativeEl.disableRemotePlayback = !1, this.nativeEl.append(a(l, this));
|
|
57
|
+
let e = /* @__PURE__ */ new WeakMap();
|
|
58
|
+
this.api.on(n.Events.MANIFEST_PARSED, (t, n) => {
|
|
57
59
|
this.nativeEl.autoplay && this.nativeEl.paused && this.nativeEl.play().catch((e) => {
|
|
58
60
|
console.warn("Autoplay failed:", e);
|
|
59
|
-
}),
|
|
61
|
+
}), i();
|
|
60
62
|
let r = this.videoTracks.getTrackById("main");
|
|
61
63
|
r || (r = this.addVideoTrack("main"), r.id = "main", r.selected = !0);
|
|
62
|
-
for (let [
|
|
64
|
+
for (let [t, i] of n.levels.entries()) {
|
|
63
65
|
let n = r.addRendition(i.url[0], i.width, i.height, i.videoCodec, i.bitrate);
|
|
64
|
-
|
|
66
|
+
e.set(i, `${t}`), n.id = `${t}`;
|
|
65
67
|
}
|
|
66
68
|
for (let [e, t] of n.audioTracks.entries()) {
|
|
67
69
|
let n = t.default ? "main" : "alternative", r = this.addAudioTrack(n, t.name, t.lang);
|
|
@@ -71,45 +73,45 @@ var u = ((s) => {
|
|
|
71
73
|
var e;
|
|
72
74
|
let t = +((e = [...this.audioTracks].find((e) => e.enabled)) == null ? void 0 : e.id), n = this.api.audioTracks.map((e) => e.id);
|
|
73
75
|
t != this.api.audioTrack && n.includes(t) && (this.api.audioTrack = t);
|
|
74
|
-
}), this.api.on(
|
|
76
|
+
}), this.api.on(n.Events.LEVELS_UPDATED, (t, n) => {
|
|
75
77
|
var r;
|
|
76
78
|
let i = this.videoTracks[(r = this.videoTracks.selectedIndex) == null ? 0 : r];
|
|
77
79
|
if (!i) return;
|
|
78
|
-
let a = n.levels.map((
|
|
80
|
+
let a = n.levels.map((t) => e.get(t));
|
|
79
81
|
for (let e of this.videoRenditions) e.id && !a.includes(e.id) && i.removeRendition(e);
|
|
80
82
|
});
|
|
81
|
-
let
|
|
82
|
-
this.api.on(
|
|
83
|
-
|
|
84
|
-
}), this.api.on(
|
|
83
|
+
let r = null;
|
|
84
|
+
this.api.on(n.Events.ERROR, (e, t) => {
|
|
85
|
+
t.type === n.ErrorTypes.NETWORK_ERROR && t.details === n.ErrorDetails.FRAG_LOAD_ERROR && (r = t.frag.level);
|
|
86
|
+
}), this.api.on(n.Events.LEVEL_SWITCHED, (e, t) => {
|
|
85
87
|
let n = t.level;
|
|
86
|
-
|
|
87
|
-
}), (
|
|
88
|
+
r !== null && n < r && (console.warn(`\u26A0\uFE0F hls.js downgraded quality from level ${r} to ${n} due to fragment load failure.`), this.videoRenditions.selectedIndex = n, r = null);
|
|
89
|
+
}), (t = this.videoRenditions) == null || t.addEventListener("change", (e) => {
|
|
88
90
|
let t = e.target.selectedIndex;
|
|
89
91
|
t != this.api.nextLevel && (this.api.nextLevel = t);
|
|
90
92
|
});
|
|
91
|
-
let
|
|
93
|
+
let i = () => {
|
|
92
94
|
for (let e of this.videoTracks) this.removeVideoTrack(e);
|
|
93
95
|
for (let e of this.audioTracks) this.removeAudioTrack(e);
|
|
94
96
|
};
|
|
95
|
-
this.api.once(
|
|
97
|
+
this.api.once(n.Events.DESTROYING, i);
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
100
|
await Promise.resolve(), this.nativeEl.canPlayType("application/vnd.apple.mpegurl") && (this.nativeEl.src = this.src);
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
|
-
},
|
|
102
|
-
let { src:
|
|
103
|
+
}, c(t, "shadowRootOptions", { ...e.shadowRootOptions }), c(t, "getTemplateHTML", (t, n = {}) => {
|
|
104
|
+
let { src: r, ...i } = t;
|
|
103
105
|
return `
|
|
104
106
|
<script type="application/json" id="config">
|
|
105
|
-
${JSON.stringify(
|
|
107
|
+
${JSON.stringify(n.config || {})}
|
|
106
108
|
<\/script>
|
|
107
|
-
${
|
|
109
|
+
${e.getTemplateHTML(i)}
|
|
108
110
|
`;
|
|
109
|
-
}),
|
|
111
|
+
}), t;
|
|
110
112
|
function p() {
|
|
111
113
|
var e, t;
|
|
112
|
-
(e =
|
|
114
|
+
(e = a(l, this)) == null || e.remove(), (t = this.nativeEl) == null || t.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", a(f, this)), this.api && (this.api.detachMedia(), this.api.destroy(), this.api = null);
|
|
113
115
|
}
|
|
114
116
|
function m(e) {
|
|
115
117
|
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
@@ -117,9 +119,9 @@ var u = ((s) => {
|
|
|
117
119
|
delete this[e], this[e] = t;
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
})(
|
|
121
|
-
globalThis.customElements && !globalThis.customElements.get("hls-video") && globalThis.customElements.define("hls-video",
|
|
122
|
-
var
|
|
122
|
+
})(u(l));
|
|
123
|
+
globalThis.customElements && !globalThis.customElements.get("hls-video") && globalThis.customElements.define("hls-video", f);
|
|
124
|
+
var p = f, m = /* @__PURE__ */ new Set([
|
|
123
125
|
"style",
|
|
124
126
|
"children",
|
|
125
127
|
"ref",
|
|
@@ -127,56 +129,56 @@ var d = u, f = /* @__PURE__ */ new Set([
|
|
|
127
129
|
"suppressContentEditableWarning",
|
|
128
130
|
"suppressHydrationWarning",
|
|
129
131
|
"dangerouslySetInnerHTML"
|
|
130
|
-
]),
|
|
132
|
+
]), h = {
|
|
131
133
|
className: "class",
|
|
132
134
|
htmlFor: "for"
|
|
133
135
|
};
|
|
134
|
-
function
|
|
136
|
+
function g(e) {
|
|
135
137
|
return e.toLowerCase();
|
|
136
138
|
}
|
|
137
|
-
function
|
|
139
|
+
function _(e) {
|
|
138
140
|
if (typeof e == "boolean") return e ? "" : void 0;
|
|
139
141
|
if (typeof e != "function" && !(typeof e == "object" && e)) return e;
|
|
140
142
|
}
|
|
141
|
-
function
|
|
143
|
+
function v({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = g, toAttributeValue: s = _ }) {
|
|
142
144
|
let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
|
|
143
145
|
var u, d;
|
|
144
|
-
let
|
|
146
|
+
let f = e.useRef(null), p = e.useRef(/* @__PURE__ */ new Map()), g = {}, v = {}, b = {}, x = {};
|
|
145
147
|
for (let [e, t] of Object.entries(i)) {
|
|
146
148
|
var S, C;
|
|
147
|
-
if (
|
|
149
|
+
if (m.has(e)) {
|
|
148
150
|
b[e] = t;
|
|
149
151
|
continue;
|
|
150
152
|
}
|
|
151
|
-
let r = o((S =
|
|
153
|
+
let r = o((S = h[e]) == null ? e : S);
|
|
152
154
|
if (n.prototype && e in n.prototype && !(e in ((C = (u = globalThis.HTMLElement) == null ? void 0 : u.prototype) == null ? {} : C)) && !((d = n.observedAttributes) != null && d.some((e) => e === r))) {
|
|
153
155
|
x[e] = t;
|
|
154
156
|
continue;
|
|
155
157
|
}
|
|
156
158
|
if (e.startsWith("on")) {
|
|
157
|
-
|
|
159
|
+
g[e] = t;
|
|
158
160
|
continue;
|
|
159
161
|
}
|
|
160
162
|
let i = s(t);
|
|
161
|
-
r && i != null && (
|
|
163
|
+
r && i != null && (v[r] = String(i), c || (b[r] = i)), r && c && (i === _(t) ? b[r] = t : b[r] = i);
|
|
162
164
|
}
|
|
163
165
|
if (typeof window < "u") {
|
|
164
|
-
for (let t in
|
|
166
|
+
for (let t in g) {
|
|
165
167
|
var w;
|
|
166
|
-
let n =
|
|
168
|
+
let n = g[t], i = t.endsWith("Capture"), a = ((w = r == null ? void 0 : r[t]) == null ? t.slice(2).toLowerCase() : w).slice(0, i ? -7 : void 0);
|
|
167
169
|
e.useLayoutEffect(() => {
|
|
168
|
-
let e =
|
|
170
|
+
let e = f == null ? void 0 : f.current;
|
|
169
171
|
if (!(!e || typeof n != "function")) return e.addEventListener(a, n, i), () => {
|
|
170
172
|
e.removeEventListener(a, n, i);
|
|
171
173
|
};
|
|
172
|
-
}, [
|
|
174
|
+
}, [f == null ? void 0 : f.current, n]);
|
|
173
175
|
}
|
|
174
176
|
e.useLayoutEffect(() => {
|
|
175
|
-
if (
|
|
177
|
+
if (f.current === null) return;
|
|
176
178
|
let e = /* @__PURE__ */ new Map();
|
|
177
|
-
for (let t in x)
|
|
178
|
-
for (let [e, t] of
|
|
179
|
-
|
|
179
|
+
for (let t in x) y(f.current, t, x[t]), p.current.delete(t), e.set(t, x[t]);
|
|
180
|
+
for (let [e, t] of p.current) y(f.current, e, void 0);
|
|
181
|
+
p.current = e;
|
|
180
182
|
});
|
|
181
183
|
}
|
|
182
184
|
if (typeof window > "u" && n != null && n.getTemplateHTML && n != null && n.shadowRootOptions) {
|
|
@@ -184,7 +186,7 @@ function g({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
184
186
|
b.children = [e.createElement("template", {
|
|
185
187
|
shadowrootmode: t,
|
|
186
188
|
shadowrootdelegatesfocus: r,
|
|
187
|
-
dangerouslySetInnerHTML: { __html: n.getTemplateHTML(
|
|
189
|
+
dangerouslySetInnerHTML: { __html: n.getTemplateHTML(v, i) },
|
|
188
190
|
key: "ce-la-react-ssr-template-shadow-root"
|
|
189
191
|
}), b.children];
|
|
190
192
|
}
|
|
@@ -192,25 +194,25 @@ function g({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
192
194
|
...a,
|
|
193
195
|
...b,
|
|
194
196
|
ref: e.useCallback((e) => {
|
|
195
|
-
|
|
197
|
+
f.current = e, typeof l == "function" ? l(e) : l !== null && (l.current = e);
|
|
196
198
|
}, [l])
|
|
197
199
|
}, b.children);
|
|
198
200
|
});
|
|
199
201
|
return l.displayName = i == null ? n.name : i, l;
|
|
200
202
|
}
|
|
201
|
-
function
|
|
203
|
+
function y(e, t, n) {
|
|
202
204
|
var r, i;
|
|
203
205
|
e[t] = n, n == null && t in ((r = (i = globalThis.HTMLElement) == null ? void 0 : i.prototype) == null ? {} : r) && e.removeAttribute(t);
|
|
204
206
|
}
|
|
205
|
-
var
|
|
206
|
-
react:
|
|
207
|
+
var b = v({
|
|
208
|
+
react: d.default,
|
|
207
209
|
tagName: "hls-video",
|
|
208
|
-
elementClass:
|
|
210
|
+
elementClass: p,
|
|
209
211
|
toAttributeName(e) {
|
|
210
|
-
return e === "muted" ? "" : e === "defaultMuted" ? "muted" :
|
|
212
|
+
return e === "muted" ? "" : e === "defaultMuted" ? "muted" : g(e);
|
|
211
213
|
}
|
|
212
214
|
});
|
|
213
215
|
//#endregion
|
|
214
|
-
export {
|
|
216
|
+
export { b as default };
|
|
215
217
|
|
|
216
|
-
//# sourceMappingURL=react-
|
|
218
|
+
//# sourceMappingURL=react-QrtEtv1G.js.map
|