@react-scrollytelling/video 0.0.1 → 0.1.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/index.es.js CHANGED
@@ -1,5 +1,6 @@
1
- import we from "react";
2
- var Z = { exports: {} }, A = {};
1
+ import J, { useRef as ke, useEffect as vr, useState as pr, useCallback as ne, useImperativeHandle as yr } from "react";
2
+ import { useRafThrottle as gr } from "@react-scrollytelling/core";
3
+ var ae = { exports: {} }, V = {};
3
4
  /**
4
5
  * @license React
5
6
  * react-jsx-runtime.production.min.js
@@ -9,25 +10,25 @@ var Z = { exports: {} }, A = {};
9
10
  * This source code is licensed under the MIT license found in the
10
11
  * LICENSE file in the root directory of this source tree.
11
12
  */
12
- var Oe;
13
- function fr() {
14
- if (Oe)
15
- return A;
16
- Oe = 1;
17
- var P = we, E = Symbol.for("react.element"), j = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, $ = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, W = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function x(R, c, O) {
19
- var p, b = {}, _ = null, Y = null;
20
- O !== void 0 && (_ = "" + O), c.key !== void 0 && (_ = "" + c.key), c.ref !== void 0 && (Y = c.ref);
21
- for (p in c)
22
- h.call(c, p) && !W.hasOwnProperty(p) && (b[p] = c[p]);
23
- if (R && R.defaultProps)
24
- for (p in c = R.defaultProps, c)
25
- b[p] === void 0 && (b[p] = c[p]);
26
- return { $$typeof: E, type: R, key: _, ref: Y, props: b, _owner: $.current };
13
+ var je;
14
+ function hr() {
15
+ if (je)
16
+ return V;
17
+ je = 1;
18
+ var S = J, g = Symbol.for("react.element"), C = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, m = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function O(h, s, w) {
20
+ var c, R = {}, E = null, k = null;
21
+ w !== void 0 && (E = "" + w), s.key !== void 0 && (E = "" + s.key), s.ref !== void 0 && (k = s.ref);
22
+ for (c in s)
23
+ b.call(s, c) && !T.hasOwnProperty(c) && (R[c] = s[c]);
24
+ if (h && h.defaultProps)
25
+ for (c in s = h.defaultProps, s)
26
+ R[c] === void 0 && (R[c] = s[c]);
27
+ return { $$typeof: g, type: h, key: E, ref: k, props: R, _owner: m.current };
27
28
  }
28
- return A.Fragment = j, A.jsx = x, A.jsxs = x, A;
29
+ return V.Fragment = C, V.jsx = O, V.jsxs = O, V;
29
30
  }
30
- var I = {};
31
+ var L = {};
31
32
  /**
32
33
  * @license React
33
34
  * react-jsx-runtime.development.js
@@ -37,27 +38,27 @@ var I = {};
37
38
  * This source code is licensed under the MIT license found in the
38
39
  * LICENSE file in the root directory of this source tree.
39
40
  */
40
- var Se;
41
- function cr() {
42
- return Se || (Se = 1, process.env.NODE_ENV !== "production" && function() {
43
- var P = we, E = Symbol.for("react.element"), j = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), R = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), Q = Symbol.iterator, Ce = "@@iterator";
44
- function Pe(e) {
41
+ var xe;
42
+ function Rr() {
43
+ return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var S = J, g = Symbol.for("react.element"), C = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), h = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), M = Symbol.iterator, K = "@@iterator";
45
+ function I(e) {
45
46
  if (e === null || typeof e != "object")
46
47
  return null;
47
- var r = Q && e[Q] || e[Ce];
48
+ var r = M && e[M] || e[K];
48
49
  return typeof r == "function" ? r : null;
49
50
  }
50
- var S = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function f(e) {
51
+ var P = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function d(e) {
52
53
  {
53
54
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
54
55
  t[n - 1] = arguments[n];
55
- je("error", e, t);
56
+ De("error", e, t);
56
57
  }
57
58
  }
58
- function je(e, r, t) {
59
+ function De(e, r, t) {
59
60
  {
60
- var n = S.ReactDebugCurrentFrame, i = n.getStackAddendum();
61
+ var n = P.ReactDebugCurrentFrame, i = n.getStackAddendum();
61
62
  i !== "" && (r += "%s", t = t.concat([i]));
62
63
  var u = t.map(function(o) {
63
64
  return String(o);
@@ -65,63 +66,63 @@ function cr() {
65
66
  u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
66
67
  }
67
68
  }
68
- var xe = !1, ke = !1, De = !1, Fe = !1, Ae = !1, ee;
69
- ee = Symbol.for("react.module.reference");
70
- function Ie(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === h || e === W || Ae || e === $ || e === O || e === p || Fe || e === Y || xe || ke || De || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === b || e.$$typeof === x || e.$$typeof === R || e.$$typeof === c || // This needs to include all possible module reference object
69
+ var Fe = !1, Ae = !1, Ie = !1, $e = !1, We = !1, oe;
70
+ oe = Symbol.for("react.module.reference");
71
+ function Ye(e) {
72
+ return !!(typeof e == "string" || typeof e == "function" || e === b || e === T || We || e === m || e === w || e === c || $e || e === k || Fe || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === R || e.$$typeof === O || e.$$typeof === h || e.$$typeof === s || // This needs to include all possible module reference object
72
73
  // types supported by any Flight configuration anywhere since
73
74
  // we don't know which Flight build this will end up being used
74
75
  // with.
75
- e.$$typeof === ee || e.getModuleId !== void 0));
76
+ e.$$typeof === oe || e.getModuleId !== void 0));
76
77
  }
77
- function $e(e, r, t) {
78
+ function Ve(e, r, t) {
78
79
  var n = e.displayName;
79
80
  if (n)
80
81
  return n;
81
82
  var i = r.displayName || r.name || "";
82
83
  return i !== "" ? t + "(" + i + ")" : t;
83
84
  }
84
- function re(e) {
85
+ function ie(e) {
85
86
  return e.displayName || "Context";
86
87
  }
87
- function y(e) {
88
+ function _(e) {
88
89
  if (e == null)
89
90
  return null;
90
- if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
+ if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
92
  return e.displayName || e.name || null;
92
93
  if (typeof e == "string")
93
94
  return e;
94
95
  switch (e) {
95
- case h:
96
+ case b:
96
97
  return "Fragment";
97
- case j:
98
+ case C:
98
99
  return "Portal";
99
- case W:
100
+ case T:
100
101
  return "Profiler";
101
- case $:
102
+ case m:
102
103
  return "StrictMode";
103
- case O:
104
+ case w:
104
105
  return "Suspense";
105
- case p:
106
+ case c:
106
107
  return "SuspenseList";
107
108
  }
108
109
  if (typeof e == "object")
109
110
  switch (e.$$typeof) {
110
- case R:
111
+ case h:
111
112
  var r = e;
112
- return re(r) + ".Consumer";
113
- case x:
113
+ return ie(r) + ".Consumer";
114
+ case O:
114
115
  var t = e;
115
- return re(t._context) + ".Provider";
116
- case c:
117
- return $e(e, e.render, "ForwardRef");
118
- case b:
116
+ return ie(t._context) + ".Provider";
117
+ case s:
118
+ return Ve(e, e.render, "ForwardRef");
119
+ case R:
119
120
  var n = e.displayName || null;
120
- return n !== null ? n : y(e.type) || "Memo";
121
- case _: {
121
+ return n !== null ? n : _(e.type) || "Memo";
122
+ case E: {
122
123
  var i = e, u = i._payload, o = i._init;
123
124
  try {
124
- return y(o(u));
125
+ return _(o(u));
125
126
  } catch (a) {
126
127
  return null;
127
128
  }
@@ -129,18 +130,18 @@ function cr() {
129
130
  }
130
131
  return null;
131
132
  }
132
- var m = Object.assign, k = 0, te, ne, ae, oe, ie, ue, se;
133
- function le() {
133
+ var j = Object.assign, $ = 0, ue, se, le, fe, ce, de, ve;
134
+ function pe() {
134
135
  }
135
- le.__reactDisabledLog = !0;
136
- function We() {
136
+ pe.__reactDisabledLog = !0;
137
+ function Le() {
137
138
  {
138
- if (k === 0) {
139
- te = console.log, ne = console.info, ae = console.warn, oe = console.error, ie = console.group, ue = console.groupCollapsed, se = console.groupEnd;
139
+ if ($ === 0) {
140
+ ue = console.log, se = console.info, le = console.warn, fe = console.error, ce = console.group, de = console.groupCollapsed, ve = console.groupEnd;
140
141
  var e = {
141
142
  configurable: !0,
142
143
  enumerable: !0,
143
- value: le,
144
+ value: pe,
144
145
  writable: !0
145
146
  };
146
147
  Object.defineProperties(console, {
@@ -153,77 +154,77 @@ function cr() {
153
154
  groupEnd: e
154
155
  });
155
156
  }
156
- k++;
157
+ $++;
157
158
  }
158
159
  }
159
- function Ye() {
160
+ function Me() {
160
161
  {
161
- if (k--, k === 0) {
162
+ if ($--, $ === 0) {
162
163
  var e = {
163
164
  configurable: !0,
164
165
  enumerable: !0,
165
166
  writable: !0
166
167
  };
167
168
  Object.defineProperties(console, {
168
- log: m({}, e, {
169
- value: te
169
+ log: j({}, e, {
170
+ value: ue
170
171
  }),
171
- info: m({}, e, {
172
- value: ne
172
+ info: j({}, e, {
173
+ value: se
173
174
  }),
174
- warn: m({}, e, {
175
- value: ae
175
+ warn: j({}, e, {
176
+ value: le
176
177
  }),
177
- error: m({}, e, {
178
- value: oe
178
+ error: j({}, e, {
179
+ value: fe
179
180
  }),
180
- group: m({}, e, {
181
- value: ie
181
+ group: j({}, e, {
182
+ value: ce
182
183
  }),
183
- groupCollapsed: m({}, e, {
184
- value: ue
184
+ groupCollapsed: j({}, e, {
185
+ value: de
185
186
  }),
186
- groupEnd: m({}, e, {
187
- value: se
187
+ groupEnd: j({}, e, {
188
+ value: ve
188
189
  })
189
190
  });
190
191
  }
191
- k < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ $ < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
193
  }
193
194
  }
194
- var N = S.ReactCurrentDispatcher, B;
195
- function L(e, r, t) {
195
+ var G = P.ReactCurrentDispatcher, z;
196
+ function U(e, r, t) {
196
197
  {
197
- if (B === void 0)
198
+ if (z === void 0)
198
199
  try {
199
200
  throw Error();
200
201
  } catch (i) {
201
202
  var n = i.stack.trim().match(/\n( *(at )?)/);
202
- B = n && n[1] || "";
203
+ z = n && n[1] || "";
203
204
  }
204
205
  return `
205
- ` + B + e;
206
+ ` + z + e;
206
207
  }
207
208
  }
208
- var J = !1, V;
209
+ var H = !1, N;
209
210
  {
210
- var Le = typeof WeakMap == "function" ? WeakMap : Map;
211
- V = new Le();
211
+ var Ue = typeof WeakMap == "function" ? WeakMap : Map;
212
+ N = new Ue();
212
213
  }
213
- function fe(e, r) {
214
- if (!e || J)
214
+ function ye(e, r) {
215
+ if (!e || H)
215
216
  return "";
216
217
  {
217
- var t = V.get(e);
218
+ var t = N.get(e);
218
219
  if (t !== void 0)
219
220
  return t;
220
221
  }
221
222
  var n;
222
- J = !0;
223
+ H = !0;
223
224
  var i = Error.prepareStackTrace;
224
225
  Error.prepareStackTrace = void 0;
225
226
  var u;
226
- u = N.current, N.current = null, We();
227
+ u = G.current, G.current = null, Le();
227
228
  try {
228
229
  if (r) {
229
230
  var o = function() {
@@ -236,98 +237,98 @@ function cr() {
236
237
  }), typeof Reflect == "object" && Reflect.construct) {
237
238
  try {
238
239
  Reflect.construct(o, []);
239
- } catch (d) {
240
- n = d;
240
+ } catch (p) {
241
+ n = p;
241
242
  }
242
243
  Reflect.construct(e, [], o);
243
244
  } else {
244
245
  try {
245
246
  o.call();
246
- } catch (d) {
247
- n = d;
247
+ } catch (p) {
248
+ n = p;
248
249
  }
249
250
  e.call(o.prototype);
250
251
  }
251
252
  } else {
252
253
  try {
253
254
  throw Error();
254
- } catch (d) {
255
- n = d;
255
+ } catch (p) {
256
+ n = p;
256
257
  }
257
258
  e();
258
259
  }
259
- } catch (d) {
260
- if (d && n && typeof d.stack == "string") {
261
- for (var a = d.stack.split(`
260
+ } catch (p) {
261
+ if (p && n && typeof p.stack == "string") {
262
+ for (var a = p.stack.split(`
262
263
  `), v = n.stack.split(`
263
- `), s = a.length - 1, l = v.length - 1; s >= 1 && l >= 0 && a[s] !== v[l]; )
264
- l--;
265
- for (; s >= 1 && l >= 0; s--, l--)
266
- if (a[s] !== v[l]) {
267
- if (s !== 1 || l !== 1)
264
+ `), l = a.length - 1, f = v.length - 1; l >= 1 && f >= 0 && a[l] !== v[f]; )
265
+ f--;
266
+ for (; l >= 1 && f >= 0; l--, f--)
267
+ if (a[l] !== v[f]) {
268
+ if (l !== 1 || f !== 1)
268
269
  do
269
- if (s--, l--, l < 0 || a[s] !== v[l]) {
270
- var g = `
271
- ` + a[s].replace(" at new ", " at ");
272
- return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && V.set(e, g), g;
270
+ if (l--, f--, f < 0 || a[l] !== v[f]) {
271
+ var y = `
272
+ ` + a[l].replace(" at new ", " at ");
273
+ return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, y), y;
273
274
  }
274
- while (s >= 1 && l >= 0);
275
+ while (l >= 1 && f >= 0);
275
276
  break;
276
277
  }
277
278
  }
278
279
  } finally {
279
- J = !1, N.current = u, Ye(), Error.prepareStackTrace = i;
280
+ H = !1, G.current = u, Me(), Error.prepareStackTrace = i;
280
281
  }
281
- var C = e ? e.displayName || e.name : "", T = C ? L(C) : "";
282
- return typeof e == "function" && V.set(e, T), T;
282
+ var F = e ? e.displayName || e.name : "", x = F ? U(F) : "";
283
+ return typeof e == "function" && N.set(e, x), x;
283
284
  }
284
- function Ve(e, r, t) {
285
- return fe(e, !1);
285
+ function Ne(e, r, t) {
286
+ return ye(e, !1);
286
287
  }
287
- function Me(e) {
288
+ function qe(e) {
288
289
  var r = e.prototype;
289
290
  return !!(r && r.isReactComponent);
290
291
  }
291
- function M(e, r, t) {
292
+ function q(e, r, t) {
292
293
  if (e == null)
293
294
  return "";
294
295
  if (typeof e == "function")
295
- return fe(e, Me(e));
296
+ return ye(e, qe(e));
296
297
  if (typeof e == "string")
297
- return L(e);
298
+ return U(e);
298
299
  switch (e) {
299
- case O:
300
- return L("Suspense");
301
- case p:
302
- return L("SuspenseList");
300
+ case w:
301
+ return U("Suspense");
302
+ case c:
303
+ return U("SuspenseList");
303
304
  }
304
305
  if (typeof e == "object")
305
306
  switch (e.$$typeof) {
306
- case c:
307
- return Ve(e.render);
308
- case b:
309
- return M(e.type, r, t);
310
- case _: {
307
+ case s:
308
+ return Ne(e.render);
309
+ case R:
310
+ return q(e.type, r, t);
311
+ case E: {
311
312
  var n = e, i = n._payload, u = n._init;
312
313
  try {
313
- return M(u(i), r, t);
314
+ return q(u(i), r, t);
314
315
  } catch (o) {
315
316
  }
316
317
  }
317
318
  }
318
319
  return "";
319
320
  }
320
- var D = Object.prototype.hasOwnProperty, ce = {}, ve = S.ReactDebugCurrentFrame;
321
- function U(e) {
321
+ var W = Object.prototype.hasOwnProperty, ge = {}, he = P.ReactDebugCurrentFrame;
322
+ function B(e) {
322
323
  if (e) {
323
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
324
- ve.setExtraStackFrame(t);
324
+ var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
325
+ he.setExtraStackFrame(t);
325
326
  } else
326
- ve.setExtraStackFrame(null);
327
+ he.setExtraStackFrame(null);
327
328
  }
328
- function Ue(e, r, t, n, i) {
329
+ function Be(e, r, t, n, i) {
329
330
  {
330
- var u = Function.call.bind(D);
331
+ var u = Function.call.bind(W);
331
332
  for (var o in e)
332
333
  if (u(e, o)) {
333
334
  var a = void 0;
@@ -337,70 +338,70 @@ function cr() {
337
338
  throw v.name = "Invariant Violation", v;
338
339
  }
339
340
  a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (s) {
341
- a = s;
341
+ } catch (l) {
342
+ a = l;
342
343
  }
343
- a && !(a instanceof Error) && (U(i), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), U(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, U(i), f("Failed %s type: %s", t, a.message), U(null));
344
+ a && !(a instanceof Error) && (B(i), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), B(null)), a instanceof Error && !(a.message in ge) && (ge[a.message] = !0, B(i), d("Failed %s type: %s", t, a.message), B(null));
344
345
  }
345
346
  }
346
347
  }
347
- var Ne = Array.isArray;
348
- function q(e) {
349
- return Ne(e);
348
+ var Je = Array.isArray;
349
+ function X(e) {
350
+ return Je(e);
350
351
  }
351
- function Be(e) {
352
+ function Ke(e) {
352
353
  {
353
354
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
355
  return t;
355
356
  }
356
357
  }
357
- function Je(e) {
358
+ function Ge(e) {
358
359
  try {
359
- return de(e), !1;
360
+ return Re(e), !1;
360
361
  } catch (r) {
361
362
  return !0;
362
363
  }
363
364
  }
364
- function de(e) {
365
+ function Re(e) {
365
366
  return "" + e;
366
367
  }
367
- function pe(e) {
368
- if (Je(e))
369
- return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), de(e);
368
+ function be(e) {
369
+ if (Ge(e))
370
+ return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Re(e);
370
371
  }
371
- var F = S.ReactCurrentOwner, qe = {
372
+ var Y = P.ReactCurrentOwner, ze = {
372
373
  key: !0,
373
374
  ref: !0,
374
375
  __self: !0,
375
376
  __source: !0
376
- }, ge, ye, K;
377
- K = {};
378
- function Ke(e) {
379
- if (D.call(e, "ref")) {
377
+ }, me, Ee, Z;
378
+ Z = {};
379
+ function He(e) {
380
+ if (W.call(e, "ref")) {
380
381
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
382
  if (r && r.isReactWarning)
382
383
  return !1;
383
384
  }
384
385
  return e.ref !== void 0;
385
386
  }
386
- function Ge(e) {
387
- if (D.call(e, "key")) {
387
+ function Xe(e) {
388
+ if (W.call(e, "key")) {
388
389
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
390
  if (r && r.isReactWarning)
390
391
  return !1;
391
392
  }
392
393
  return e.key !== void 0;
393
394
  }
394
- function ze(e, r) {
395
- if (typeof e.ref == "string" && F.current && r && F.current.stateNode !== r) {
396
- var t = y(F.current.type);
397
- K[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', y(F.current.type), e.ref), K[t] = !0);
395
+ function Ze(e, r) {
396
+ if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) {
397
+ var t = _(Y.current.type);
398
+ Z[t] || (d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', _(Y.current.type), e.ref), Z[t] = !0);
398
399
  }
399
400
  }
400
- function Xe(e, r) {
401
+ function Qe(e, r) {
401
402
  {
402
403
  var t = function() {
403
- ge || (ge = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
404
+ me || (me = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
404
405
  };
405
406
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
407
  get: t,
@@ -408,10 +409,10 @@ function cr() {
408
409
  });
409
410
  }
410
411
  }
411
- function He(e, r) {
412
+ function er(e, r) {
412
413
  {
413
414
  var t = function() {
414
- ye || (ye = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
415
+ Ee || (Ee = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
415
416
  };
416
417
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
418
  get: t,
@@ -419,10 +420,10 @@ function cr() {
419
420
  });
420
421
  }
421
422
  }
422
- var Ze = function(e, r, t, n, i, u, o) {
423
+ var rr = function(e, r, t, n, i, u, o) {
423
424
  var a = {
424
425
  // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: E,
426
+ $$typeof: g,
426
427
  // Built-in properties that belong on the element
427
428
  type: e,
428
429
  key: r,
@@ -448,41 +449,41 @@ function cr() {
448
449
  value: i
449
450
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
450
451
  };
451
- function Qe(e, r, t, n, i) {
452
+ function tr(e, r, t, n, i) {
452
453
  {
453
454
  var u, o = {}, a = null, v = null;
454
- t !== void 0 && (pe(t), a = "" + t), Ge(r) && (pe(r.key), a = "" + r.key), Ke(r) && (v = r.ref, ze(r, i));
455
+ t !== void 0 && (be(t), a = "" + t), Xe(r) && (be(r.key), a = "" + r.key), He(r) && (v = r.ref, Ze(r, i));
455
456
  for (u in r)
456
- D.call(r, u) && !qe.hasOwnProperty(u) && (o[u] = r[u]);
457
+ W.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
457
458
  if (e && e.defaultProps) {
458
- var s = e.defaultProps;
459
- for (u in s)
460
- o[u] === void 0 && (o[u] = s[u]);
459
+ var l = e.defaultProps;
460
+ for (u in l)
461
+ o[u] === void 0 && (o[u] = l[u]);
461
462
  }
462
463
  if (a || v) {
463
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- a && Xe(o, l), v && He(o, l);
464
+ var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
+ a && Qe(o, f), v && er(o, f);
465
466
  }
466
- return Ze(e, a, v, i, n, F.current, o);
467
+ return rr(e, a, v, i, n, Y.current, o);
467
468
  }
468
469
  }
469
- var G = S.ReactCurrentOwner, be = S.ReactDebugCurrentFrame;
470
- function w(e) {
470
+ var Q = P.ReactCurrentOwner, _e = P.ReactDebugCurrentFrame;
471
+ function D(e) {
471
472
  if (e) {
472
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
473
- be.setExtraStackFrame(t);
473
+ var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
474
+ _e.setExtraStackFrame(t);
474
475
  } else
475
- be.setExtraStackFrame(null);
476
+ _e.setExtraStackFrame(null);
476
477
  }
477
- var z;
478
- z = !1;
479
- function X(e) {
480
- return typeof e == "object" && e !== null && e.$$typeof === E;
478
+ var ee;
479
+ ee = !1;
480
+ function re(e) {
481
+ return typeof e == "object" && e !== null && e.$$typeof === g;
481
482
  }
482
- function he() {
483
+ function Te() {
483
484
  {
484
- if (G.current) {
485
- var e = y(G.current.type);
485
+ if (Q.current) {
486
+ var e = _(Q.current.type);
486
487
  if (e)
487
488
  return `
488
489
 
@@ -491,13 +492,13 @@ Check the render method of \`` + e + "`.";
491
492
  return "";
492
493
  }
493
494
  }
494
- function er(e) {
495
+ function nr(e) {
495
496
  return "";
496
497
  }
497
- var Ee = {};
498
- function rr(e) {
498
+ var Oe = {};
499
+ function ar(e) {
499
500
  {
500
- var r = he();
501
+ var r = Te();
501
502
  if (!r) {
502
503
  var t = typeof e == "string" ? e : e.displayName || e.name;
503
504
  t && (r = `
@@ -507,39 +508,39 @@ Check the top-level render call using <` + t + ">.");
507
508
  return r;
508
509
  }
509
510
  }
510
- function Re(e, r) {
511
+ function Pe(e, r) {
511
512
  {
512
513
  if (!e._store || e._store.validated || e.key != null)
513
514
  return;
514
515
  e._store.validated = !0;
515
- var t = rr(r);
516
- if (Ee[t])
516
+ var t = ar(r);
517
+ if (Oe[t])
517
518
  return;
518
- Ee[t] = !0;
519
+ Oe[t] = !0;
519
520
  var n = "";
520
- e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + y(e._owner.type) + "."), w(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), w(null);
521
+ e && e._owner && e._owner !== Q.current && (n = " It was passed a child from " + _(e._owner.type) + "."), D(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
521
522
  }
522
523
  }
523
- function _e(e, r) {
524
+ function Se(e, r) {
524
525
  {
525
526
  if (typeof e != "object")
526
527
  return;
527
- if (q(e))
528
+ if (X(e))
528
529
  for (var t = 0; t < e.length; t++) {
529
530
  var n = e[t];
530
- X(n) && Re(n, r);
531
+ re(n) && Pe(n, r);
531
532
  }
532
- else if (X(e))
533
+ else if (re(e))
533
534
  e._store && (e._store.validated = !0);
534
535
  else if (e) {
535
- var i = Pe(e);
536
+ var i = I(e);
536
537
  if (typeof i == "function" && i !== e.entries)
537
538
  for (var u = i.call(e), o; !(o = u.next()).done; )
538
- X(o.value) && Re(o.value, r);
539
+ re(o.value) && Pe(o.value, r);
539
540
  }
540
541
  }
541
542
  }
542
- function tr(e) {
543
+ function or(e) {
543
544
  {
544
545
  var r = e.type;
545
546
  if (r == null || typeof r == "string")
@@ -547,103 +548,172 @@ Check the top-level render call using <` + t + ">.");
547
548
  var t;
548
549
  if (typeof r == "function")
549
550
  t = r.propTypes;
550
- else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
551
+ else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
551
552
  // Inner props are checked in the reconciler.
552
- r.$$typeof === b))
553
+ r.$$typeof === R))
553
554
  t = r.propTypes;
554
555
  else
555
556
  return;
556
557
  if (t) {
557
- var n = y(r);
558
- Ue(t, e.props, "prop", n, e);
559
- } else if (r.PropTypes !== void 0 && !z) {
560
- z = !0;
561
- var i = y(r);
562
- f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
558
+ var n = _(r);
559
+ Be(t, e.props, "prop", n, e);
560
+ } else if (r.PropTypes !== void 0 && !ee) {
561
+ ee = !0;
562
+ var i = _(r);
563
+ d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
563
564
  }
564
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
566
  }
566
567
  }
567
- function nr(e) {
568
+ function ir(e) {
568
569
  {
569
570
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
570
571
  var n = r[t];
571
572
  if (n !== "children" && n !== "key") {
572
- w(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), w(null);
573
+ D(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
573
574
  break;
574
575
  }
575
576
  }
576
- e.ref !== null && (w(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), w(null));
577
+ e.ref !== null && (D(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
577
578
  }
578
579
  }
579
- var me = {};
580
- function Te(e, r, t, n, i, u) {
580
+ var we = {};
581
+ function Ce(e, r, t, n, i, u) {
581
582
  {
582
- var o = Ie(e);
583
+ var o = Ye(e);
583
584
  if (!o) {
584
585
  var a = "";
585
586
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var v = er();
587
- v ? a += v : a += he();
588
- var s;
589
- e === null ? s = "null" : q(e) ? s = "array" : e !== void 0 && e.$$typeof === E ? (s = "<" + (y(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
587
+ var v = nr();
588
+ v ? a += v : a += Te();
589
+ var l;
590
+ e === null ? l = "null" : X(e) ? l = "array" : e !== void 0 && e.$$typeof === g ? (l = "<" + (_(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
590
591
  }
591
- var l = Qe(e, r, t, i, u);
592
- if (l == null)
593
- return l;
592
+ var f = tr(e, r, t, i, u);
593
+ if (f == null)
594
+ return f;
594
595
  if (o) {
595
- var g = r.children;
596
- if (g !== void 0)
596
+ var y = r.children;
597
+ if (y !== void 0)
597
598
  if (n)
598
- if (q(g)) {
599
- for (var C = 0; C < g.length; C++)
600
- _e(g[C], e);
601
- Object.freeze && Object.freeze(g);
599
+ if (X(y)) {
600
+ for (var F = 0; F < y.length; F++)
601
+ Se(y[F], e);
602
+ Object.freeze && Object.freeze(y);
602
603
  } else
603
- f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
+ d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
605
  else
605
- _e(g, e);
606
+ Se(y, e);
606
607
  }
607
- if (D.call(r, "key")) {
608
- var T = y(e), d = Object.keys(r).filter(function(lr) {
609
- return lr !== "key";
610
- }), H = d.length > 0 ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}";
611
- if (!me[T + H]) {
612
- var sr = d.length > 0 ? "{" + d.join(": ..., ") + ": ...}" : "{}";
613
- f(`A props object containing a "key" prop is being spread into JSX:
608
+ if (W.call(r, "key")) {
609
+ var x = _(e), p = Object.keys(r).filter(function(dr) {
610
+ return dr !== "key";
611
+ }), te = p.length > 0 ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}";
612
+ if (!we[x + te]) {
613
+ var cr = p.length > 0 ? "{" + p.join(": ..., ") + ": ...}" : "{}";
614
+ d(`A props object containing a "key" prop is being spread into JSX:
614
615
  let props = %s;
615
616
  <%s {...props} />
616
617
  React keys must be passed directly to JSX without using spread:
617
618
  let props = %s;
618
- <%s key={someKey} {...props} />`, H, T, sr, T), me[T + H] = !0;
619
+ <%s key={someKey} {...props} />`, te, x, cr, x), we[x + te] = !0;
619
620
  }
620
621
  }
621
- return e === h ? nr(l) : tr(l), l;
622
+ return e === b ? ir(f) : or(f), f;
622
623
  }
623
624
  }
624
- function ar(e, r, t) {
625
- return Te(e, r, t, !0);
625
+ function ur(e, r, t) {
626
+ return Ce(e, r, t, !0);
626
627
  }
627
- function or(e, r, t) {
628
- return Te(e, r, t, !1);
628
+ function sr(e, r, t) {
629
+ return Ce(e, r, t, !1);
629
630
  }
630
- var ir = or, ur = ar;
631
- I.Fragment = h, I.jsx = ir, I.jsxs = ur;
632
- }()), I;
631
+ var lr = sr, fr = ur;
632
+ L.Fragment = b, L.jsx = lr, L.jsxs = fr;
633
+ }()), L;
633
634
  }
634
- process.env.NODE_ENV === "production" ? Z.exports = fr() : Z.exports = cr();
635
- var vr = Z.exports;
636
- const pr = ({ src: P, width: E, height: j, className: h }) => /* @__PURE__ */ vr.jsx(
637
- "video",
638
- {
639
- width: E,
640
- height: j,
641
- src: P,
642
- className: `h-full w-full object-cover ${h}`,
643
- controls: !0
644
- }
635
+ process.env.NODE_ENV === "production" ? ae.exports = hr() : ae.exports = Rr();
636
+ var A = ae.exports;
637
+ const _r = ({
638
+ src: S,
639
+ srcWebm: g,
640
+ width: C,
641
+ height: b,
642
+ thumbnail: m,
643
+ ratio: T = 0,
644
+ className: O,
645
+ loadingOverlay: h
646
+ }) => {
647
+ const s = ke(null);
648
+ return vr(() => {
649
+ s.current && s.current.setRatio(T);
650
+ }, [T]), /* @__PURE__ */ A.jsx(
651
+ br,
652
+ {
653
+ ref: s,
654
+ width: C,
655
+ height: b,
656
+ src: S,
657
+ srcWebm: g,
658
+ className: O,
659
+ thumbnail: m,
660
+ loadingOverlay: h
661
+ }
662
+ );
663
+ }, br = J.memo(
664
+ J.forwardRef(
665
+ ({ src: S, srcWebm: g, width: C, height: b, thumbnail: m, className: T, loadingOverlay: O }, h) => {
666
+ const s = ke(null), [w, c] = pr(!0), R = ne((K) => {
667
+ const I = s.current;
668
+ if (!I)
669
+ return;
670
+ const P = I.duration;
671
+ isNaN(P) || requestAnimationFrame(() => {
672
+ I.currentTime = Math.round(K * P * 100) / 100;
673
+ });
674
+ }, []), E = gr(R);
675
+ yr(
676
+ h,
677
+ () => ({
678
+ setRatio: E
679
+ }),
680
+ [E]
681
+ );
682
+ const k = ne(() => {
683
+ c(!0);
684
+ }, []), M = ne(() => {
685
+ c(!1);
686
+ }, []);
687
+ return /* @__PURE__ */ A.jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
688
+ /* @__PURE__ */ A.jsxs(
689
+ "video",
690
+ {
691
+ ref: s,
692
+ width: C,
693
+ height: b,
694
+ className: T,
695
+ muted: !0,
696
+ disablePictureInPicture: !0,
697
+ disableRemotePlayback: !0,
698
+ playsInline: !0,
699
+ controls: !1,
700
+ preload: "auto",
701
+ onWaiting: k,
702
+ onCanPlay: M,
703
+ poster: m,
704
+ children: [
705
+ g && /* @__PURE__ */ A.jsx("source", { src: m ? g : `${g}#t=0.1`, type: "video/webm" }),
706
+ /* @__PURE__ */ A.jsx("source", { src: m ? S : `${S}#t=0.1`, type: "video/mp4" })
707
+ ]
708
+ }
709
+ ),
710
+ /* @__PURE__ */ A.jsx("div", { style: { position: "absolute", inset: 0 }, children: w && O })
711
+ ] });
712
+ }
713
+ )
645
714
  );
646
715
  export {
647
- pr as Video
716
+ _r as Video,
717
+ br as VideoWithImperativeHandle
648
718
  };
649
719
  //# sourceMappingURL=index.es.js.map