@sapia-ai/chatbot-v3 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EmbeddedVideoPlayer-COUZHpPa.js → EmbeddedVideoPlayer-DTzRqNcQ.js} +176 -186
- package/dist/{Preview-wPnYtccF.js → Preview-Dd7KyhMk.js} +3 -3
- package/dist/api/client.d.ts +10 -6
- package/dist/api/places.d.ts +33 -0
- package/dist/api/types/messages.d.ts +35 -4
- package/dist/api/types/responses.d.ts +20 -17
- package/dist/api.js +2 -2
- package/dist/core/bubbles/cards.d.ts +14 -0
- package/dist/core/bubbles/convert.d.ts +24 -2
- package/dist/core/bubbles/counters.d.ts +10 -0
- package/dist/core/bubbles/types.d.ts +21 -1
- package/dist/core/constants.d.ts +31 -0
- package/dist/core/events.d.ts +7 -0
- package/dist/core/internalUser.d.ts +13 -0
- package/dist/core/interview.d.ts +26 -9
- package/dist/core/persistence.d.ts +3 -0
- package/dist/core/redirect.d.ts +2 -0
- package/dist/core/store.d.ts +22 -9
- package/dist/core/validation/wordCount.d.ts +1 -0
- package/dist/{dist-Bwlks_W8.js → dist-waE-4cub.js} +3 -3
- package/dist/embed/compat.d.ts +1 -1
- package/dist/embed/createChatbot.d.ts +6 -0
- package/dist/{fix-webm-duration-QAy9T6AR.js → fix-webm-duration-IniZA6tF.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6218 -5384
- package/dist/{jsx-runtime-24G8w2Bf.js → jsx-runtime-DN_m6Qdv.js} +2 -2
- package/dist/{messages-DCvBcspv.js → messages-C00e82NS.js} +44 -37
- package/dist/places-CT6PNW7B.js +52 -0
- package/dist/react/AnswerInput.d.ts +16 -5
- package/dist/react/SapiaChatbot.d.ts +7 -1
- package/dist/react/bubbleViewModel.d.ts +38 -11
- package/dist/react/strings.d.ts +46 -10
- package/dist/react/usePlacesSuggestions.d.ts +16 -0
- package/dist/{react-Bw5AugJc.js → react-A0_ZwPyM.js} +3 -3
- package/dist/{react-DEF8h8hc.js → react-BDGt_WsZ.js} +3 -3
- package/dist/{react-DDjfkpOE.js → react-B_YNH2g9.js} +3 -3
- package/dist/{react-D8hV9uow.js → react-ByP48xLV.js} +3 -3
- package/dist/{react-DPFikgTM.js → react-C9oBRlX8.js} +3 -3
- package/dist/{react-qa12DkXH.js → react-D5yWOfXN.js} +3 -3
- package/dist/{react-DOgLiyZi.js → react-DkQKleWD.js} +2 -2
- package/dist/{react-y4vaW3OH.js → react-d-THpGrV.js} +3 -3
- package/dist/{react-BjO903pN.js → react-euSb4sIX.js} +3 -3
- package/dist/ui/chat/ActionDock/ActionDock.d.ts +15 -0
- package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +10 -3
- package/dist/ui/chat/ChatLog/ChatLog.d.ts +9 -4
- package/dist/ui/chat/EditBanner/EditBanner.d.ts +9 -3
- package/dist/ui/chat/HintDisclosure/HintDisclosure.d.ts +20 -0
- package/dist/ui/chat/SummaryCard/SummaryCard.d.ts +18 -23
- package/dist/ui/chat/types.d.ts +18 -2
- package/dist/ui/constants.d.ts +5 -0
- package/dist/ui/hooks/usePreventPaste.d.ts +17 -0
- package/dist/ui/inputs/LocationAnswerInput/LocationAnswerInput.d.ts +34 -0
- package/dist/ui/inputs/PhoneAnswerInput/PhoneAnswerInput.d.ts +5 -2
- package/dist/ui/inputs/SliderInput/SliderInput.d.ts +1 -2
- package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +38 -11
- package/dist/ui/media/EmbeddedVideo/EmbeddedVideoPlayer.d.ts +1 -1
- package/dist/ui/primitives/MarkdownText/MarkdownText.d.ts +24 -0
- package/dist/ui/shell/CohortClosedScreen/CohortClosedScreen.d.ts +9 -0
- package/dist/ui/shell/CopyLinkButton/CopyLinkButton.d.ts +10 -3
- package/dist/ui/shell/DoneScreen/DoneScreen.d.ts +4 -1
- package/dist/ui/shell/Header/AutoScrollTitle.d.ts +15 -0
- package/dist/ui/shell/Header/Header.d.ts +12 -0
- package/dist/ui/shell/Header/useAutoScrollTitle.d.ts +16 -0
- package/dist/ui/shell/TerminalMessageScreen/TerminalMessageScreen.d.ts +10 -0
- package/dist/ui/shell/WidgetRoot/themeVariables.d.ts +8 -0
- package/dist-umd/sapia-chatbot.umd.js +309 -309
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
3
|
-
import { t as n } from "./jsx-runtime-
|
|
1
|
+
import { T as e } from "./messages-C00e82NS.js";
|
|
2
|
+
import { t } from "./react-DkQKleWD.js";
|
|
3
|
+
import { t as n } from "./jsx-runtime-DN_m6Qdv.js";
|
|
4
4
|
import { t as r } from "./defineProperty-DiFpLzd2.js";
|
|
5
5
|
//#region ../../node_modules/.pnpm/react-player@3.4.0_@svta+cml-cta@1.0.6_@svta+cml-structured-field-values@1.1.3_@svta+cm_a4f64f295cc2a316f39ce360b0a6e480/node_modules/react-player/dist/patterns.js
|
|
6
6
|
var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, o = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, s = /\.(m3u8)($|\?)/i, c = /\.(mpd)($|\?)/i, l = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, u = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, d = /vimeo\.com\/(?!progressive_redirect).+/, f = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, p = /open\.spotify\.com\/(\w+)\/(\w+)/i, m = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/, h = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, g = (e, t) => {
|
|
@@ -34,7 +34,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
34
34
|
canEnablePIP: () => !0,
|
|
35
35
|
player: (0, i.lazy)(() => import(
|
|
36
36
|
/* webpackChunkName: 'reactPlayerHls' */
|
|
37
|
-
"./react-
|
|
37
|
+
"./react-A0_ZwPyM.js"
|
|
38
38
|
))
|
|
39
39
|
},
|
|
40
40
|
{
|
|
@@ -44,7 +44,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
44
44
|
canEnablePIP: () => !0,
|
|
45
45
|
player: (0, i.lazy)(() => import(
|
|
46
46
|
/* webpackChunkName: 'reactPlayerDash' */
|
|
47
|
-
"./react-
|
|
47
|
+
"./react-ByP48xLV.js"
|
|
48
48
|
))
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -54,7 +54,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
54
54
|
canEnablePIP: () => !0,
|
|
55
55
|
player: (0, i.lazy)(() => import(
|
|
56
56
|
/* webpackChunkName: 'reactPlayerMux' */
|
|
57
|
-
"./dist-
|
|
57
|
+
"./dist-waE-4cub.js"
|
|
58
58
|
))
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -63,7 +63,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
63
63
|
canPlay: _.youtube,
|
|
64
64
|
player: (0, i.lazy)(() => import(
|
|
65
65
|
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
66
|
-
"./react-
|
|
66
|
+
"./react-BDGt_WsZ.js"
|
|
67
67
|
))
|
|
68
68
|
},
|
|
69
69
|
{
|
|
@@ -72,7 +72,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
72
72
|
canPlay: _.vimeo,
|
|
73
73
|
player: (0, i.lazy)(() => import(
|
|
74
74
|
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
75
|
-
"./react-
|
|
75
|
+
"./react-C9oBRlX8.js"
|
|
76
76
|
))
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -82,7 +82,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
82
82
|
canEnablePIP: () => !0,
|
|
83
83
|
player: (0, i.lazy)(() => import(
|
|
84
84
|
/* webpackChunkName: 'reactPlayerWistia' */
|
|
85
|
-
"./react-
|
|
85
|
+
"./react-B_YNH2g9.js"
|
|
86
86
|
))
|
|
87
87
|
},
|
|
88
88
|
{
|
|
@@ -92,7 +92,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
92
92
|
canEnablePIP: () => !1,
|
|
93
93
|
player: (0, i.lazy)(() => import(
|
|
94
94
|
/* webpackChunkName: 'reactPlayerSpotify' */
|
|
95
|
-
"./react-
|
|
95
|
+
"./react-euSb4sIX.js"
|
|
96
96
|
))
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -102,7 +102,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
102
102
|
canEnablePIP: () => !1,
|
|
103
103
|
player: (0, i.lazy)(() => import(
|
|
104
104
|
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
105
|
-
"./react-
|
|
105
|
+
"./react-d-THpGrV.js"
|
|
106
106
|
))
|
|
107
107
|
},
|
|
108
108
|
{
|
|
@@ -112,7 +112,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
112
112
|
canEnablePIP: () => !1,
|
|
113
113
|
player: (0, i.lazy)(() => import(
|
|
114
114
|
/* webpackChunkName: 'reactPlayerTiktok' */
|
|
115
|
-
"./react-
|
|
115
|
+
"./react-D5yWOfXN.js"
|
|
116
116
|
))
|
|
117
117
|
},
|
|
118
118
|
{
|
|
@@ -122,7 +122,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
122
122
|
canEnablePIP: () => !0,
|
|
123
123
|
player: v
|
|
124
124
|
}
|
|
125
|
-
],
|
|
125
|
+
], b = {
|
|
126
126
|
width: "320px",
|
|
127
127
|
height: "180px",
|
|
128
128
|
volume: 1,
|
|
@@ -130,7 +130,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
130
130
|
previewTabIndex: 0,
|
|
131
131
|
previewAriaLabel: "",
|
|
132
132
|
oEmbedUrl: "https://noembed.com/embed?url={url}"
|
|
133
|
-
},
|
|
133
|
+
}, x = i.forwardRef((e, t) => {
|
|
134
134
|
let { playing: n, pip: r } = e, a = e.activePlayer, o = (0, i.useRef)(null), s = (0, i.useRef)(!0);
|
|
135
135
|
(0, i.useEffect)(() => {
|
|
136
136
|
var t, r;
|
|
@@ -178,17 +178,17 @@ var i = /* @__PURE__ */ e(t(), 1), a = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3
|
|
|
178
178
|
onPlay: l
|
|
179
179
|
}, e.children);
|
|
180
180
|
});
|
|
181
|
-
|
|
182
|
-
var
|
|
181
|
+
x.displayName = "Player";
|
|
182
|
+
var ee = x, S = (0, i.lazy)(() => import(
|
|
183
183
|
/* webpackChunkName: 'reactPlayerPreview' */
|
|
184
|
-
"./Preview-
|
|
185
|
-
)),
|
|
184
|
+
"./Preview-Dd7KyhMk.js"
|
|
185
|
+
)), C = [], w = (e, t) => {
|
|
186
186
|
let n = (n) => {
|
|
187
|
-
for (let t of [...
|
|
187
|
+
for (let t of [...C, ...e]) if (n && t.canPlay(n)) return t;
|
|
188
188
|
return t || null;
|
|
189
189
|
}, r = i.forwardRef((e, t) => {
|
|
190
190
|
let r = {
|
|
191
|
-
...
|
|
191
|
+
...b,
|
|
192
192
|
...e
|
|
193
193
|
}, { src: a, slot: o, className: s, style: c, width: l, height: u, fallback: d, wrapper: f } = r, [p, m] = (0, i.useState)(!!r.light);
|
|
194
194
|
(0, i.useEffect)(() => {
|
|
@@ -200,7 +200,7 @@ var te = b, ne = (0, i.lazy)(() => import(
|
|
|
200
200
|
}, g = (e) => {
|
|
201
201
|
if (!e) return null;
|
|
202
202
|
let { light: t, playIcon: n, previewTabIndex: a, oEmbedUrl: o, previewAriaLabel: s } = r;
|
|
203
|
-
return /* @__PURE__ */ i.createElement(
|
|
203
|
+
return /* @__PURE__ */ i.createElement(S, {
|
|
204
204
|
src: e,
|
|
205
205
|
light: t,
|
|
206
206
|
playIcon: n,
|
|
@@ -214,7 +214,7 @@ var te = b, ne = (0, i.lazy)(() => import(
|
|
|
214
214
|
let l = n(e);
|
|
215
215
|
if (!l) return null;
|
|
216
216
|
let { style: u, width: d, height: f, wrapper: p } = r, m = (a = r.config) == null ? void 0 : a[l.key];
|
|
217
|
-
return /* @__PURE__ */ i.createElement(
|
|
217
|
+
return /* @__PURE__ */ i.createElement(ee, {
|
|
218
218
|
...r,
|
|
219
219
|
ref: t,
|
|
220
220
|
activePlayer: (c = l.player) == null ? l : c,
|
|
@@ -232,7 +232,7 @@ var te = b, ne = (0, i.lazy)(() => import(
|
|
|
232
232
|
},
|
|
233
233
|
config: m
|
|
234
234
|
});
|
|
235
|
-
}, v = f == null ?
|
|
235
|
+
}, v = f == null ? T : f, y = d === !1 ? T : i.Suspense;
|
|
236
236
|
return /* @__PURE__ */ i.createElement(v, {
|
|
237
237
|
slot: o,
|
|
238
238
|
className: s,
|
|
@@ -244,38 +244,38 @@ var te = b, ne = (0, i.lazy)(() => import(
|
|
|
244
244
|
}, /* @__PURE__ */ i.createElement(y, { fallback: d }, p ? g(a) : _(a)));
|
|
245
245
|
});
|
|
246
246
|
return r.displayName = "ReactPlayer", r.addCustomPlayer = (e) => {
|
|
247
|
-
|
|
247
|
+
C.push(e);
|
|
248
248
|
}, r.removeCustomPlayers = () => {
|
|
249
|
-
|
|
249
|
+
C.length = 0;
|
|
250
250
|
}, r.canPlay = (t) => {
|
|
251
251
|
if (t) {
|
|
252
|
-
for (let n of [...
|
|
252
|
+
for (let n of [...C, ...e]) if (n.canPlay(t)) return !0;
|
|
253
253
|
}
|
|
254
254
|
return !1;
|
|
255
255
|
}, r.canEnablePIP = (t) => {
|
|
256
256
|
var n;
|
|
257
257
|
if (t) {
|
|
258
|
-
for (let r of [...
|
|
258
|
+
for (let r of [...C, ...e]) if (r.canPlay(t) && (n = r.canEnablePIP) != null && n.call(r)) return !0;
|
|
259
259
|
}
|
|
260
260
|
return !1;
|
|
261
261
|
}, r;
|
|
262
|
-
},
|
|
263
|
-
function
|
|
262
|
+
}, T = ({ children: e }) => e, te = y[y.length - 1], E = w(y, te), D, ne = typeof global < "u" && {}.toString.call(global) === "[object global]", re = typeof Bun < "u", ie = typeof Deno < "u", O = typeof WebSocketPair == "function" && ((D = caches) == null ? void 0 : D.default) !== void 0, k = ne || re || ie || O;
|
|
263
|
+
function A(e, t) {
|
|
264
264
|
return e.indexOf(t.toLowerCase()) === 0 ? e : `${t.toLowerCase()}${e.substr(0, 1).toUpperCase()}${e.substr(1)}`;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function ae(e) {
|
|
267
267
|
return !!(e && e.nodeType === 1 && "nodeName" in e && e.ownerDocument && e.ownerDocument.defaultView);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function j(e) {
|
|
270
270
|
return !isNaN(parseFloat(e)) && isFinite(e) && Math.floor(e) == e;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function M(e) {
|
|
273
273
|
return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function N(e) {
|
|
276
276
|
return /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function oe(e) {
|
|
279
279
|
let t = (e || "").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/), n = (t && t[1] || "").replace("player.", "");
|
|
280
280
|
for (let e of [
|
|
281
281
|
".videoji.hk",
|
|
@@ -284,30 +284,30 @@ function M(e) {
|
|
|
284
284
|
]) if (n.endsWith(e)) return n;
|
|
285
285
|
return "vimeo.com";
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function P() {
|
|
288
288
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.id, n = e.url, r = t || n;
|
|
289
289
|
if (!r) throw Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");
|
|
290
|
-
if (
|
|
291
|
-
if (
|
|
290
|
+
if (j(r)) return `https://vimeo.com/${r}`;
|
|
291
|
+
if (M(r)) return r.replace("http:", "https:");
|
|
292
292
|
throw TypeError(t ? `“${t}” is not a valid video id.` : `“${r}” is not a vimeo.com url.`);
|
|
293
293
|
}
|
|
294
|
-
var
|
|
294
|
+
var F = function(e, t, n) {
|
|
295
295
|
let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "addEventListener", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "removeEventListener", a = typeof t == "string" ? [t] : t;
|
|
296
296
|
return a.forEach((t) => {
|
|
297
297
|
e[r](t, n);
|
|
298
298
|
}), { cancel: () => a.forEach((t) => e[i](t, n)) };
|
|
299
299
|
};
|
|
300
|
-
function
|
|
300
|
+
function I(e) {
|
|
301
301
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
|
|
302
302
|
if (!e || !t || typeof t.querySelectorAll != "function") return null;
|
|
303
303
|
let n = t.querySelectorAll("iframe");
|
|
304
304
|
for (let t = 0; t < n.length; t++) if (n[t] && n[t].contentWindow === e) return n[t];
|
|
305
305
|
return null;
|
|
306
306
|
}
|
|
307
|
-
var
|
|
308
|
-
if (!
|
|
309
|
-
var
|
|
310
|
-
function
|
|
307
|
+
var se = Array.prototype.indexOf !== void 0, ce = typeof window < "u" && window.postMessage !== void 0;
|
|
308
|
+
if (!k && (!se || !ce)) throw Error("Sorry, the Vimeo Player API is not available in this browser.");
|
|
309
|
+
var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
310
|
+
function le(e, t) {
|
|
311
311
|
return t = { exports: {} }, e(t, t.exports), t.exports;
|
|
312
312
|
}
|
|
313
313
|
(function(e) {
|
|
@@ -360,11 +360,11 @@ function ue(e, t) {
|
|
|
360
360
|
function i(e) {
|
|
361
361
|
return Object(e) === e;
|
|
362
362
|
}
|
|
363
|
-
})(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window :
|
|
364
|
-
var
|
|
363
|
+
})(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : L);
|
|
364
|
+
var R = le(function(e) {
|
|
365
365
|
(function(t, n, r) {
|
|
366
366
|
n[t] = n[t] || r(), e.exports && (e.exports = n[t]);
|
|
367
|
-
})("Promise",
|
|
367
|
+
})("Promise", L, function() {
|
|
368
368
|
var e, t, n, r = Object.prototype.toString, i = typeof setImmediate < "u" ? function(e) {
|
|
369
369
|
return setImmediate(e);
|
|
370
370
|
} : setTimeout;
|
|
@@ -512,32 +512,32 @@ var L = ue(function(e) {
|
|
|
512
512
|
}) : t.reject(TypeError("Not an array"));
|
|
513
513
|
}), m;
|
|
514
514
|
});
|
|
515
|
-
}),
|
|
516
|
-
function
|
|
517
|
-
let r =
|
|
518
|
-
t in r || (r[t] = []), r[t].push(n),
|
|
515
|
+
}), z = /* @__PURE__ */ new WeakMap();
|
|
516
|
+
function B(e, t, n) {
|
|
517
|
+
let r = z.get(e.element) || {};
|
|
518
|
+
t in r || (r[t] = []), r[t].push(n), z.set(e.element, r);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
return (
|
|
520
|
+
function V(e, t) {
|
|
521
|
+
return (z.get(e.element) || {})[t] || [];
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
let r =
|
|
523
|
+
function H(e, t, n) {
|
|
524
|
+
let r = z.get(e.element) || {};
|
|
525
525
|
if (!r[t]) return !0;
|
|
526
|
-
if (!n) return r[t] = [],
|
|
526
|
+
if (!n) return r[t] = [], z.set(e.element, r), !0;
|
|
527
527
|
let i = r[t].indexOf(n);
|
|
528
|
-
return i !== -1 && r[t].splice(i, 1),
|
|
528
|
+
return i !== -1 && r[t].splice(i, 1), z.set(e.element, r), r[t] && r[t].length === 0;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
let n =
|
|
530
|
+
function U(e, t) {
|
|
531
|
+
let n = V(e, t);
|
|
532
532
|
if (n.length < 1) return !1;
|
|
533
533
|
let r = n.shift();
|
|
534
|
-
return
|
|
534
|
+
return H(e, t, r), r;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
let n =
|
|
538
|
-
|
|
536
|
+
function ue(e, t) {
|
|
537
|
+
let n = z.get(e);
|
|
538
|
+
z.set(t, n), z.delete(e);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function W(e) {
|
|
541
541
|
if (typeof e == "string") try {
|
|
542
542
|
e = JSON.parse(e);
|
|
543
543
|
} catch (e) {
|
|
@@ -545,22 +545,22 @@ function U(e) {
|
|
|
545
545
|
}
|
|
546
546
|
return e;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function G(e, t, n) {
|
|
549
549
|
if (!e.element.contentWindow || !e.element.contentWindow.postMessage) return;
|
|
550
550
|
let r = { method: t };
|
|
551
551
|
n !== void 0 && (r.value = n);
|
|
552
552
|
let i = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, "$1"));
|
|
553
553
|
i >= 8 && i < 10 && (r = JSON.stringify(r)), e.element.contentWindow.postMessage(r, e.origin);
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
t =
|
|
555
|
+
function de(e, t) {
|
|
556
|
+
t = W(t);
|
|
557
557
|
let n = [], r;
|
|
558
|
-
if (t.event) t.event === "error" &&
|
|
558
|
+
if (t.event) t.event === "error" && V(e, t.data.method).forEach((n) => {
|
|
559
559
|
let r = Error(t.data.message);
|
|
560
|
-
r.name = t.data.name, n.reject(r),
|
|
561
|
-
}), n =
|
|
560
|
+
r.name = t.data.name, n.reject(r), H(e, t.data.method, n);
|
|
561
|
+
}), n = V(e, `event:${t.event}`), r = t.data;
|
|
562
562
|
else if (t.method) {
|
|
563
|
-
let i =
|
|
563
|
+
let i = U(e, t.method);
|
|
564
564
|
i && (n.push(i), r = t.value);
|
|
565
565
|
}
|
|
566
566
|
n.forEach((t) => {
|
|
@@ -573,26 +573,26 @@ function fe(e, t) {
|
|
|
573
573
|
} catch {}
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
function
|
|
576
|
+
var fe = /* @__PURE__ */ "airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width".split(".");
|
|
577
|
+
function K(e) {
|
|
578
578
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
579
|
-
return
|
|
579
|
+
return fe.reduce((t, n) => {
|
|
580
580
|
let r = e.getAttribute(`data-vimeo-${n}`);
|
|
581
581
|
return (r || r === "") && (t[n] = r === "" ? 1 : r), t;
|
|
582
582
|
}, t);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function q(e, t) {
|
|
585
585
|
let { html: n } = e;
|
|
586
586
|
if (!t) throw TypeError("An element must be provided");
|
|
587
587
|
if (t.getAttribute("data-vimeo-initialized") !== null) return t.querySelector("iframe");
|
|
588
588
|
let r = document.createElement("div");
|
|
589
589
|
return r.innerHTML = n, t.appendChild(r.firstChild), t.setAttribute("data-vimeo-initialized", "true"), t.querySelector("iframe");
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function J(e) {
|
|
592
592
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
|
|
593
593
|
return new Promise((r, i) => {
|
|
594
|
-
if (!
|
|
595
|
-
let a = `https://${
|
|
594
|
+
if (!M(e)) throw TypeError(`“${e}” is not a vimeo.com url.`);
|
|
595
|
+
let a = `https://${oe(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;
|
|
596
596
|
for (let e in t) t.hasOwnProperty(e) && (a += `&${e}=${encodeURIComponent(t[e])}`);
|
|
597
597
|
let o = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
|
|
598
598
|
o.open("GET", a, !0), o.onload = function() {
|
|
@@ -607,7 +607,7 @@ function q(e) {
|
|
|
607
607
|
try {
|
|
608
608
|
let t = JSON.parse(o.responseText);
|
|
609
609
|
if (t.domain_status_code === 403) {
|
|
610
|
-
|
|
610
|
+
q(t, n), i(/* @__PURE__ */ Error(`“${e}” is not embeddable.`));
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
613
|
r(t);
|
|
@@ -620,42 +620,42 @@ function q(e) {
|
|
|
620
620
|
}, o.send();
|
|
621
621
|
});
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function pe() {
|
|
624
624
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document, t = [].slice.call(e.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")), n = (e) => {
|
|
625
625
|
"console" in window && console.error && console.error(`There was an error creating an embed: ${e}`);
|
|
626
626
|
};
|
|
627
627
|
t.forEach((e) => {
|
|
628
628
|
try {
|
|
629
629
|
if (e.getAttribute("data-vimeo-defer") !== null) return;
|
|
630
|
-
let t =
|
|
631
|
-
|
|
630
|
+
let t = K(e);
|
|
631
|
+
J(P(t), t, e).then((t) => q(t, e)).catch(n);
|
|
632
632
|
} catch (e) {
|
|
633
633
|
n(e);
|
|
634
634
|
}
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function me() {
|
|
638
638
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
639
639
|
window.VimeoPlayerResizeEmbeds_ || (window.VimeoPlayerResizeEmbeds_ = !0, window.addEventListener("message", (t) => {
|
|
640
|
-
if (!
|
|
641
|
-
let n = t.source ?
|
|
640
|
+
if (!M(t.origin) || !t.data || t.data.event !== "spacechange") return;
|
|
641
|
+
let n = t.source ? I(t.source, e) : null;
|
|
642
642
|
if (n) {
|
|
643
643
|
let e = n.parentElement;
|
|
644
644
|
e.style.paddingBottom = `${t.data.data[0].bottom}px`;
|
|
645
645
|
}
|
|
646
646
|
}));
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function he() {
|
|
649
649
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
650
650
|
window.VimeoSeoMetadataAppended || (window.VimeoSeoMetadataAppended = !0, window.addEventListener("message", (t) => {
|
|
651
|
-
if (!
|
|
652
|
-
let n =
|
|
651
|
+
if (!M(t.origin)) return;
|
|
652
|
+
let n = W(t.data);
|
|
653
653
|
if (!n || n.event !== "ready") return;
|
|
654
|
-
let r = t.source ?
|
|
655
|
-
r &&
|
|
654
|
+
let r = t.source ? I(t.source, e) : null;
|
|
655
|
+
r && N(r.src) && new Q(r).callMethod("appendVideoMetadata", window.location.href);
|
|
656
656
|
}));
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function ge() {
|
|
659
659
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
660
660
|
if (window.VimeoCheckedUrlTimeParam) return;
|
|
661
661
|
window.VimeoCheckedUrlTimeParam = !0;
|
|
@@ -663,12 +663,12 @@ function _e() {
|
|
|
663
663
|
"console" in window && console.error && console.error(`There was an error getting video Id: ${e}`);
|
|
664
664
|
};
|
|
665
665
|
window.addEventListener("message", (n) => {
|
|
666
|
-
if (!
|
|
667
|
-
let r =
|
|
666
|
+
if (!M(n.origin)) return;
|
|
667
|
+
let r = W(n.data);
|
|
668
668
|
if (!r || r.event !== "ready") return;
|
|
669
|
-
let i = n.source ?
|
|
670
|
-
if (i &&
|
|
671
|
-
let e = new
|
|
669
|
+
let i = n.source ? I(n.source, e) : null;
|
|
670
|
+
if (i && N(i.src)) {
|
|
671
|
+
let e = new Q(i);
|
|
672
672
|
e.getVideoId().then((t) => {
|
|
673
673
|
let n = RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);
|
|
674
674
|
if (n && n[1]) {
|
|
@@ -679,12 +679,12 @@ function _e() {
|
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function _e() {
|
|
683
683
|
window.VimeoDRMEmbedsUpdated || (window.VimeoDRMEmbedsUpdated = !0, window.addEventListener("message", (e) => {
|
|
684
|
-
if (!
|
|
685
|
-
let t =
|
|
684
|
+
if (!M(e.origin)) return;
|
|
685
|
+
let t = W(e.data);
|
|
686
686
|
if (!t || t.event !== "drminitfailed") return;
|
|
687
|
-
let n = e.source ?
|
|
687
|
+
let n = e.source ? I(e.source) : null;
|
|
688
688
|
if (!n) return;
|
|
689
689
|
let r = n.getAttribute("allow") || "";
|
|
690
690
|
if (!r.includes("encrypted-media")) {
|
|
@@ -695,7 +695,7 @@ function ve() {
|
|
|
695
695
|
}
|
|
696
696
|
}));
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function ve() {
|
|
699
699
|
let e = function() {
|
|
700
700
|
let e, t = [
|
|
701
701
|
[
|
|
@@ -799,7 +799,7 @@ function ye() {
|
|
|
799
799
|
}
|
|
800
800
|
}), n;
|
|
801
801
|
}
|
|
802
|
-
var
|
|
802
|
+
var ye = {
|
|
803
803
|
role: "viewer",
|
|
804
804
|
autoPlayMuted: !0,
|
|
805
805
|
allowedDrift: .3,
|
|
@@ -807,7 +807,7 @@ var be = {
|
|
|
807
807
|
minCheckInterval: .1,
|
|
808
808
|
maxRateAdjustment: .2,
|
|
809
809
|
maxTimeToCatchUp: 1
|
|
810
|
-
},
|
|
810
|
+
}, be = class extends EventTarget {
|
|
811
811
|
constructor(e, t) {
|
|
812
812
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
|
|
813
813
|
super(), r(this, "logger", void 0), r(this, "speedAdjustment", 0), r(this, "adjustSpeed", async (e, t) => {
|
|
@@ -815,7 +815,7 @@ var be = {
|
|
|
815
815
|
let n = await e.getPlaybackRate() - this.speedAdjustment + t;
|
|
816
816
|
this.log(`New playbackRate: ${n}`), await e.setPlaybackRate(n), this.speedAdjustment = t;
|
|
817
817
|
}), this.logger = i, this.init(t, e, {
|
|
818
|
-
...
|
|
818
|
+
...ye,
|
|
819
819
|
...n
|
|
820
820
|
});
|
|
821
821
|
}
|
|
@@ -825,13 +825,13 @@ var be = {
|
|
|
825
825
|
async init(e, t, n) {
|
|
826
826
|
if (await this.waitForTOReadyState(e, "open"), n.role === "viewer") {
|
|
827
827
|
await this.updatePlayer(e, t, n);
|
|
828
|
-
let r =
|
|
828
|
+
let r = F(e, "change", () => this.updatePlayer(e, t, n)), i = this.maintainPlaybackPosition(e, t, n);
|
|
829
829
|
this.addEventListener("disconnect", () => {
|
|
830
830
|
i.cancel(), r.cancel();
|
|
831
831
|
});
|
|
832
832
|
} else {
|
|
833
833
|
await this.updateTimingObject(e, t);
|
|
834
|
-
let n =
|
|
834
|
+
let n = F(t, [
|
|
835
835
|
"seeked",
|
|
836
836
|
"play",
|
|
837
837
|
"pause",
|
|
@@ -881,22 +881,22 @@ var be = {
|
|
|
881
881
|
r();
|
|
882
882
|
});
|
|
883
883
|
}
|
|
884
|
-
},
|
|
884
|
+
}, Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = {}, Q = class {
|
|
885
885
|
constructor(e) {
|
|
886
886
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
887
|
-
if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !
|
|
887
|
+
if (window.jQuery && e instanceof jQuery && (e.length > 1 && window.console && console.warn && console.warn("A jQuery object with multiple elements was passed, using the first element."), e = e[0]), typeof document < "u" && typeof e == "string" && (e = document.getElementById(e)), !ae(e)) throw TypeError("You must pass either a valid element or a valid id.");
|
|
888
888
|
if (e.nodeName !== "IFRAME") {
|
|
889
889
|
let t = e.querySelector("iframe");
|
|
890
890
|
t && (e = t);
|
|
891
891
|
}
|
|
892
|
-
if (e.nodeName === "IFRAME" && !
|
|
893
|
-
if (
|
|
892
|
+
if (e.nodeName === "IFRAME" && !M(e.getAttribute("src") || "")) throw Error("The player element passed isn’t a Vimeo embed.");
|
|
893
|
+
if (Y.has(e)) return Y.get(e);
|
|
894
894
|
this._window = e.ownerDocument.defaultView, this.element = e, this.origin = "*";
|
|
895
|
-
let n = new
|
|
895
|
+
let n = new R((n, r) => {
|
|
896
896
|
if (this._onMessage = (e) => {
|
|
897
|
-
if (!
|
|
897
|
+
if (!M(e.origin) || this.element.contentWindow !== e.source) return;
|
|
898
898
|
this.origin === "*" && (this.origin = e.origin);
|
|
899
|
-
let t =
|
|
899
|
+
let t = W(e.data);
|
|
900
900
|
if (t && t.event === "error" && t.data && t.data.method === "ready") {
|
|
901
901
|
let e = Error(t.data.message);
|
|
902
902
|
e.name = t.data.name, r(e);
|
|
@@ -907,54 +907,54 @@ var be = {
|
|
|
907
907
|
this.element.setAttribute("data-ready", "true"), n();
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
|
-
|
|
910
|
+
de(this, t);
|
|
911
911
|
}, this._window.addEventListener("message", this._onMessage), this.element.nodeName !== "IFRAME") {
|
|
912
|
-
let n =
|
|
913
|
-
|
|
914
|
-
let n =
|
|
915
|
-
return this.element = n, this._originalElement = e,
|
|
912
|
+
let n = K(e, t);
|
|
913
|
+
J(P(n), n, e).then((t) => {
|
|
914
|
+
let n = q(t, e);
|
|
915
|
+
return this.element = n, this._originalElement = e, ue(e, n), Y.set(this.element, this), t;
|
|
916
916
|
}).catch(r);
|
|
917
917
|
}
|
|
918
918
|
});
|
|
919
|
-
if (
|
|
920
|
-
let e = () =>
|
|
919
|
+
if (X.set(this, n), Y.set(this.element, this), this.element.nodeName === "IFRAME" && G(this, "ping"), Z.isEnabled) {
|
|
920
|
+
let e = () => Z.exit();
|
|
921
921
|
this.fullscreenchangeHandler = () => {
|
|
922
|
-
|
|
923
|
-
|
|
922
|
+
Z.isFullscreen ? B(this, "event:exitFullscreen", e) : H(this, "event:exitFullscreen", e), this.ready().then(() => {
|
|
923
|
+
G(this, "fullscreenchange", Z.isFullscreen);
|
|
924
924
|
});
|
|
925
|
-
},
|
|
925
|
+
}, Z.on("fullscreenchange", this.fullscreenchangeHandler);
|
|
926
926
|
}
|
|
927
927
|
return this;
|
|
928
928
|
}
|
|
929
929
|
static isVimeoUrl(e) {
|
|
930
|
-
return
|
|
930
|
+
return M(e);
|
|
931
931
|
}
|
|
932
932
|
callMethod(e) {
|
|
933
933
|
var t = [...arguments].slice(1);
|
|
934
934
|
if (e == null) throw TypeError("You must pass a method name.");
|
|
935
|
-
return new
|
|
936
|
-
|
|
935
|
+
return new R((n, r) => this.ready().then(() => {
|
|
936
|
+
B(this, e, {
|
|
937
937
|
resolve: n,
|
|
938
938
|
reject: r
|
|
939
|
-
}), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]),
|
|
939
|
+
}), t.length === 0 ? t = {} : t.length === 1 && (t = t[0]), G(this, e, t);
|
|
940
940
|
}).catch(r));
|
|
941
941
|
}
|
|
942
942
|
get(e) {
|
|
943
|
-
return new
|
|
944
|
-
|
|
943
|
+
return new R((t, n) => (e = A(e, "get"), this.ready().then(() => {
|
|
944
|
+
B(this, e, {
|
|
945
945
|
resolve: t,
|
|
946
946
|
reject: n
|
|
947
|
-
}),
|
|
947
|
+
}), G(this, e);
|
|
948
948
|
}).catch(n)));
|
|
949
949
|
}
|
|
950
950
|
set(e, t) {
|
|
951
|
-
return new
|
|
952
|
-
if (e =
|
|
951
|
+
return new R((n, r) => {
|
|
952
|
+
if (e = A(e, "set"), t == null) throw TypeError("There must be a value to set.");
|
|
953
953
|
return this.ready().then(() => {
|
|
954
|
-
|
|
954
|
+
B(this, e, {
|
|
955
955
|
resolve: n,
|
|
956
956
|
reject: r
|
|
957
|
-
}),
|
|
957
|
+
}), G(this, e, t);
|
|
958
958
|
}).catch(r);
|
|
959
959
|
});
|
|
960
960
|
}
|
|
@@ -962,21 +962,21 @@ var be = {
|
|
|
962
962
|
if (!e) throw TypeError("You must pass an event name.");
|
|
963
963
|
if (!t) throw TypeError("You must pass a callback function.");
|
|
964
964
|
if (typeof t != "function") throw TypeError("The callback must be a function.");
|
|
965
|
-
|
|
965
|
+
V(this, `event:${e}`).length === 0 && this.callMethod("addEventListener", e).catch(() => {}), B(this, `event:${e}`, t);
|
|
966
966
|
}
|
|
967
967
|
off(e, t) {
|
|
968
968
|
if (!e) throw TypeError("You must pass an event name.");
|
|
969
969
|
if (t && typeof t != "function") throw TypeError("The callback must be a function.");
|
|
970
|
-
|
|
970
|
+
H(this, `event:${e}`, t) && this.callMethod("removeEventListener", e).catch((e) => {});
|
|
971
971
|
}
|
|
972
972
|
loadVideo(e) {
|
|
973
973
|
return this.callMethod("loadVideo", e);
|
|
974
974
|
}
|
|
975
975
|
ready() {
|
|
976
|
-
let e =
|
|
976
|
+
let e = X.get(this) || new R((e, t) => {
|
|
977
977
|
t(/* @__PURE__ */ Error("Unknown player. Probably unloaded."));
|
|
978
978
|
});
|
|
979
|
-
return
|
|
979
|
+
return R.resolve(e);
|
|
980
980
|
}
|
|
981
981
|
addCuePoint(e) {
|
|
982
982
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -1017,13 +1017,13 @@ var be = {
|
|
|
1017
1017
|
return this.callMethod("play");
|
|
1018
1018
|
}
|
|
1019
1019
|
requestFullscreen() {
|
|
1020
|
-
return
|
|
1020
|
+
return Z.isEnabled ? Z.request(this.element) : this.callMethod("requestFullscreen");
|
|
1021
1021
|
}
|
|
1022
1022
|
exitFullscreen() {
|
|
1023
|
-
return
|
|
1023
|
+
return Z.isEnabled ? Z.exit() : this.callMethod("exitFullscreen");
|
|
1024
1024
|
}
|
|
1025
1025
|
getFullscreen() {
|
|
1026
|
-
return
|
|
1026
|
+
return Z.isEnabled ? R.resolve(Z.isFullscreen) : this.get("fullscreen");
|
|
1027
1027
|
}
|
|
1028
1028
|
requestPictureInPicture() {
|
|
1029
1029
|
return this.callMethod("requestPictureInPicture");
|
|
@@ -1041,13 +1041,13 @@ var be = {
|
|
|
1041
1041
|
return this.callMethod("unload");
|
|
1042
1042
|
}
|
|
1043
1043
|
destroy() {
|
|
1044
|
-
return new
|
|
1045
|
-
if (
|
|
1044
|
+
return new R((e) => {
|
|
1045
|
+
if (X.delete(this), Y.delete(this.element), this._originalElement && (Y.delete(this._originalElement), this._originalElement.removeAttribute("data-vimeo-initialized")), this.element && this.element.nodeName === "IFRAME" && this.element.parentNode && (this.element.parentNode.parentNode && this._originalElement && this._originalElement !== this.element.parentNode ? this.element.parentNode.parentNode.removeChild(this.element.parentNode) : this.element.parentNode.removeChild(this.element)), this.element && this.element.nodeName === "DIV" && this.element.parentNode) {
|
|
1046
1046
|
this.element.removeAttribute("data-vimeo-initialized");
|
|
1047
1047
|
let e = this.element.querySelector("iframe");
|
|
1048
1048
|
e && e.parentNode && (e.parentNode.parentNode && this._originalElement && this._originalElement !== e.parentNode ? e.parentNode.parentNode.removeChild(e.parentNode) : e.parentNode.removeChild(e));
|
|
1049
1049
|
}
|
|
1050
|
-
this._window.removeEventListener("message", this._onMessage),
|
|
1050
|
+
this._window.removeEventListener("message", this._onMessage), Z.isEnabled && Z.off("fullscreenchange", this.fullscreenchangeHandler), e();
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
1053
|
getAutopause() {
|
|
@@ -1075,7 +1075,7 @@ var be = {
|
|
|
1075
1075
|
return this.get("color");
|
|
1076
1076
|
}
|
|
1077
1077
|
getColors() {
|
|
1078
|
-
return
|
|
1078
|
+
return R.all([
|
|
1079
1079
|
this.get("colorOne"),
|
|
1080
1080
|
this.get("colorTwo"),
|
|
1081
1081
|
this.get("colorThree"),
|
|
@@ -1086,14 +1086,14 @@ var be = {
|
|
|
1086
1086
|
return this.set("color", e);
|
|
1087
1087
|
}
|
|
1088
1088
|
setColors(e) {
|
|
1089
|
-
if (!Array.isArray(e)) return new
|
|
1090
|
-
let t = new
|
|
1089
|
+
if (!Array.isArray(e)) return new R((e, t) => t(/* @__PURE__ */ TypeError("Argument must be an array.")));
|
|
1090
|
+
let t = new R((e) => e(null)), n = [
|
|
1091
1091
|
e[0] ? this.set("colorOne", e[0]) : t,
|
|
1092
1092
|
e[1] ? this.set("colorTwo", e[1]) : t,
|
|
1093
1093
|
e[2] ? this.set("colorThree", e[2]) : t,
|
|
1094
1094
|
e[3] ? this.set("colorFour", e[3]) : t
|
|
1095
1095
|
];
|
|
1096
|
-
return
|
|
1096
|
+
return R.all(n);
|
|
1097
1097
|
}
|
|
1098
1098
|
getCuePoints() {
|
|
1099
1099
|
return this.get("cuePoints");
|
|
@@ -1194,14 +1194,14 @@ var be = {
|
|
|
1194
1194
|
async setTimingSrc(e, t) {
|
|
1195
1195
|
if (!e) throw TypeError("A Timing Object must be provided.");
|
|
1196
1196
|
await this.ready();
|
|
1197
|
-
let n = new
|
|
1198
|
-
return
|
|
1197
|
+
let n = new be(this, e, t);
|
|
1198
|
+
return G(this, "notifyTimingObjectConnect"), n.addEventListener("disconnect", () => G(this, "notifyTimingObjectDisconnect")), n;
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
|
-
|
|
1201
|
+
k || (Z = ve(), pe(), me(), he(), ge(), _e());
|
|
1202
1202
|
//#endregion
|
|
1203
1203
|
//#region src/ui/media/EmbeddedVideo/VimeoPlayer.tsx
|
|
1204
|
-
var
|
|
1204
|
+
var $ = n(), xe = (e) => {
|
|
1205
1205
|
let t = e.match(/vimeo\.com\/(video\/|event\/)?(\d+)(?:\/([a-zA-Z0-9]+))?/);
|
|
1206
1206
|
if (!t) {
|
|
1207
1207
|
let t = e.match(/player\.vimeo\.com\/video\/(\d+)/);
|
|
@@ -1215,25 +1215,25 @@ var Q = n(), Se = (e) => {
|
|
|
1215
1215
|
videoId: n,
|
|
1216
1216
|
privacyHash: r || void 0
|
|
1217
1217
|
};
|
|
1218
|
-
},
|
|
1218
|
+
}, Se = (e, t) => {
|
|
1219
1219
|
let n = new URLSearchParams();
|
|
1220
1220
|
return t && n.append("h", t), n.append("dnt", "1"), n.append("fullscreen", "1"), `https://player.vimeo.com/video/${e}?${n.toString()}`;
|
|
1221
|
-
},
|
|
1221
|
+
}, Ce = ({ src: e, title: t, width: n = "100%", height: r = "100%", onPlay: a, onPause: o, onEnded: s, onError: c }) => {
|
|
1222
1222
|
let l = (0, i.useRef)(null), u = (0, i.useRef)(null);
|
|
1223
1223
|
return (0, i.useEffect)(() => {
|
|
1224
1224
|
if (!l.current) return;
|
|
1225
|
-
let i =
|
|
1225
|
+
let i = xe(e);
|
|
1226
1226
|
if (!i) {
|
|
1227
1227
|
c == null || c(/* @__PURE__ */ Error("Invalid Vimeo URL"));
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
1230
1230
|
let d = document.createElement("iframe");
|
|
1231
|
-
d.src =
|
|
1232
|
-
let f = new
|
|
1231
|
+
d.src = Se(i.videoId, i.privacyHash), d.title = t, d.width = n, d.height = r, d.frameBorder = "0", d.referrerPolicy = "origin", d.allow = "autoplay; fullscreen; picture-in-picture", d.allowFullscreen = !0, d.style.width = "100%", d.style.height = "100%", d.style.border = "none", l.current.innerHTML = "", l.current.appendChild(d);
|
|
1232
|
+
let f = new Q(d);
|
|
1233
1233
|
return u.current = f, f.on("play", () => a == null ? void 0 : a()), f.on("pause", () => o == null ? void 0 : o()), f.on("ended", () => s == null ? void 0 : s()), f.on("error", (e) => c == null ? void 0 : c(Error(e.message))), () => {
|
|
1234
1234
|
f.destroy(), u.current = null;
|
|
1235
1235
|
};
|
|
1236
|
-
}, [e]), /* @__PURE__ */ (0,
|
|
1236
|
+
}, [e]), /* @__PURE__ */ (0, $.jsx)("div", {
|
|
1237
1237
|
ref: l,
|
|
1238
1238
|
style: {
|
|
1239
1239
|
width: n,
|
|
@@ -1242,37 +1242,27 @@ var Q = n(), Se = (e) => {
|
|
|
1242
1242
|
maxHeight: "100%"
|
|
1243
1243
|
}
|
|
1244
1244
|
});
|
|
1245
|
-
},
|
|
1246
|
-
width: "100%",
|
|
1247
|
-
aspectRatio: "16 / 9"
|
|
1248
|
-
}, Ee = ({ url: e, label: t }) => {
|
|
1245
|
+
}, we = (e) => /vimeo\.com/.test(e), Te = ({ url: e, label: t }) => {
|
|
1249
1246
|
let [n, r] = (0, i.useState)(!1);
|
|
1250
|
-
return
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
height: "100%",
|
|
1267
|
-
playing: n,
|
|
1268
|
-
onPlay: () => r(!0),
|
|
1269
|
-
onPause: () => r(!1),
|
|
1270
|
-
config: { youtube: { referrerpolicy: "strict-origin-when-cross-origin" } },
|
|
1271
|
-
style: { maxWidth: "100%" }
|
|
1272
|
-
})
|
|
1247
|
+
return we(e) ? /* @__PURE__ */ (0, $.jsx)(Ce, {
|
|
1248
|
+
src: e,
|
|
1249
|
+
title: t,
|
|
1250
|
+
width: "100%",
|
|
1251
|
+
height: "100%",
|
|
1252
|
+
onPlay: () => r(!0),
|
|
1253
|
+
onPause: () => r(!1)
|
|
1254
|
+
}) : /* @__PURE__ */ (0, $.jsx)(E, {
|
|
1255
|
+
src: e,
|
|
1256
|
+
controls: !0,
|
|
1257
|
+
width: "100%",
|
|
1258
|
+
height: "100%",
|
|
1259
|
+
playing: n,
|
|
1260
|
+
onPlay: () => r(!0),
|
|
1261
|
+
onPause: () => r(!1),
|
|
1262
|
+
config: { youtube: { referrerpolicy: "strict-origin-when-cross-origin" } }
|
|
1273
1263
|
});
|
|
1274
1264
|
};
|
|
1275
1265
|
//#endregion
|
|
1276
|
-
export {
|
|
1266
|
+
export { Te as EmbeddedVideoPlayer };
|
|
1277
1267
|
|
|
1278
|
-
//# sourceMappingURL=EmbeddedVideoPlayer-
|
|
1268
|
+
//# sourceMappingURL=EmbeddedVideoPlayer-DTzRqNcQ.js.map
|