@netless/window-manager 1.0.0-canary.64 → 1.0.0-canary.66

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.js CHANGED
@@ -1271,6 +1271,7 @@ class CameraSynchronizer {
1271
1271
  constructor(saveCamera) {
1272
1272
  this.saveCamera = saveCamera;
1273
1273
  this.scale = 1;
1274
+ this.cameraUpdating = false;
1274
1275
  this.setRect = (rect, updateCamera = true) => {
1275
1276
  this.rect = rect;
1276
1277
  if (this.remoteCamera && this.remoteSize && updateCamera) {
@@ -2471,6 +2472,39 @@ class MainViewProxy {
2471
2472
  })
2472
2473
  );
2473
2474
  };
2475
+ this.moveCamera = (camera) => {
2476
+ this.debouncedStoreCamera();
2477
+ this.moveCameraToPromise(camera);
2478
+ };
2479
+ this.moveCameraToPromise = (camera) => {
2480
+ const promise = new Promise((resolve) => {
2481
+ const cameraListener = lodash.debounce(() => {
2482
+ this.mainView.callbacks.off("onCameraUpdated", cameraListener);
2483
+ this.cameraUpdatePromise = void 0;
2484
+ resolve(true);
2485
+ }, 50);
2486
+ this.mainView.callbacks.on("onCameraUpdated", cameraListener);
2487
+ this.mainView.moveCamera(camera);
2488
+ });
2489
+ this.cameraUpdatePromise = promise;
2490
+ return promise;
2491
+ };
2492
+ this.debouncedStoreCamera = () => {
2493
+ this.storeCurrentSize();
2494
+ const cameraListener = lodash.debounce(() => {
2495
+ this.saveToCamera$();
2496
+ this.storeCurrentCameraSize();
2497
+ this.mainView.callbacks.off("onCameraUpdated", cameraListener);
2498
+ }, 50);
2499
+ this.mainView.callbacks.on("onCameraUpdated", cameraListener);
2500
+ };
2501
+ this.storeCurrentCameraSize = lodash.debounce(() => __async$4(this, null, function* () {
2502
+ if (this.cameraUpdatePromise) {
2503
+ yield this.cameraUpdatePromise;
2504
+ }
2505
+ this.storeCurrentCamera();
2506
+ this.storeCurrentSize();
2507
+ }), 500);
2474
2508
  this.addCameraReaction = () => {
2475
2509
  this.manager.refresher.add(Fields.MainViewCamera, this.cameraReaction);
2476
2510
  this.manager.refresher.add(Fields.MainViewSize, this.sizeReaction);
@@ -2489,11 +2523,14 @@ class MainViewProxy {
2489
2523
  var _a2;
2490
2524
  const rect = (_a2 = this.manager.boxManager) == null ? void 0 : _a2.stageRect;
2491
2525
  if (rect) {
2492
- this.storeSize({
2526
+ const size = {
2493
2527
  id: this.manager.uid,
2494
2528
  width: rect.width,
2495
2529
  height: rect.height
2496
- });
2530
+ };
2531
+ if (!lodash.isEqual(size, this.mainViewSize)) {
2532
+ this.storeSize(size);
2533
+ }
2497
2534
  }
2498
2535
  };
2499
2536
  this.storeCamera = (camera) => {
@@ -2884,6 +2921,8 @@ class ScrollMode {
2884
2921
  });
2885
2922
  this.sideEffect.add(() => {
2886
2923
  const onCameraUpdated = (camera) => {
2924
+ if (!this.manager.canOperate)
2925
+ return;
2887
2926
  const halfWbHeight = size$.value.height / 2 / scale$.value;
2888
2927
  const scrollTop = camera.centerY;
2889
2928
  this.scrollStorage.setState({
@@ -9010,30 +9049,30 @@ class G$1 {
9010
9049
  if (w2.thumbnail)
9011
9050
  return w2;
9012
9051
  try {
9013
- const f = new URL(w2.src);
9014
- return f.searchParams.set("x-oss-process", "image/resize,l_50"), { ...w2, thumbnail: f.toString() };
9015
- } catch (f) {
9016
- return console.error(f), w2;
9052
+ const f2 = new URL(w2.src);
9053
+ return f2.searchParams.set("x-oss-process", "image/resize,l_50"), { ...w2, thumbnail: f2.toString() };
9054
+ } catch (f2) {
9055
+ return console.error(f2), w2;
9017
9056
  }
9018
9057
  })
9019
9058
  );
9020
9059
  const o2 = valueEnhancer.derive(s, (d) => {
9021
9060
  const w2 = Array(d.length);
9022
- for (let f = 0; f < d.length; f++)
9023
- w2[f] = f > 0 ? w2[f - 1] + d[f - 1].height : 0;
9061
+ for (let f2 = 0; f2 < d.length; f2++)
9062
+ w2[f2] = f2 > 0 ? w2[f2 - 1] + d[f2 - 1].height : 0;
9024
9063
  return w2;
9025
9064
  }), l = valueEnhancer.derive(s, (d) => {
9026
9065
  let w2 = 1 / 0;
9027
- for (let f = d.length - 1; f >= 0; f--)
9028
- d[f].height <= w2 && (w2 = d[f].height);
9066
+ for (let f2 = d.length - 1; f2 >= 0; f2--)
9067
+ d[f2].height <= w2 && (w2 = d[f2].height);
9029
9068
  return w2;
9030
9069
  }), c = valueEnhancer.combine(
9031
9070
  [e, o2, s],
9032
- ([d, w2, f]) => {
9033
- if (w2.length !== f.length)
9071
+ ([d, w2, f2]) => {
9072
+ if (w2.length !== f2.length)
9034
9073
  return c.value;
9035
9074
  for (let v = 0; v < w2.length; v++)
9036
- if (w2[v] + f[v].height - d >= 1e-3)
9075
+ if (w2[v] + f2[v].height - d >= 1e-3)
9037
9076
  return v;
9038
9077
  return w2.length - 1;
9039
9078
  }
@@ -9042,7 +9081,7 @@ class G$1 {
9042
9081
  ([d, w2]) => d.width / w2.width || 1
9043
9082
  ), a = valueEnhancer.combine(
9044
9083
  [s, t, l, h2],
9045
- ([d, w2, f, v]) => S$1(Math.ceil(w2.height / v / f / 2), 1, d.length)
9084
+ ([d, w2, f2, v]) => S$1(Math.ceil(w2.height / v / f2 / 2), 1, d.length)
9046
9085
  );
9047
9086
  valueEnhancer.withReadonlyValueEnhancer(this, {
9048
9087
  pagesScrollTop: e,
@@ -9062,9 +9101,9 @@ class G$1 {
9062
9101
  this.sideEffect.setTimeout(g2, 1e3, "turn-off-hwa"), p.setValue(true);
9063
9102
  };
9064
9103
  this.sideEffect.addDisposer(
9065
- valueEnhancer.combine([c, a, s]).subscribe(([d, w2, f]) => {
9104
+ valueEnhancer.combine([c, a, s]).subscribe(([d, w2, f2]) => {
9066
9105
  u();
9067
- const v = Math.max(d - w2, 0), C = Math.min(d + w2, f.length - 1);
9106
+ const v = Math.max(d - w2, 0), C = Math.min(d + w2, f2.length - 1);
9068
9107
  for (let $ = 0; $ < this.$pages.children.length; $++) {
9069
9108
  const x = this.$pages.children[$], k2 = Number(x.dataset.index);
9070
9109
  k2 >= v && k2 <= C || (x.remove(), $--);
@@ -9586,10 +9625,10 @@ function ee$1(n, e, t, s, r) {
9586
9625
  const h2 = n.add(() => {
9587
9626
  const a = ({ width: p, height: g2 }) => {
9588
9627
  if (s.length > 0 && t.state !== "maximized") {
9589
- const { width: u, height: d } = s[0], f = d / u * p - g2;
9590
- f !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
9628
+ const { width: u, height: d } = s[0], f2 = d / u * p - g2;
9629
+ f2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
9591
9630
  width: t.intrinsicWidth,
9592
- height: t.intrinsicHeight + f / t.rootRect.height
9631
+ height: t.intrinsicHeight + f2 / t.rootRect.height
9593
9632
  });
9594
9633
  }
9595
9634
  n.remove(h2);
@@ -9646,7 +9685,7 @@ function Ge(e) {
9646
9685
  function di() {
9647
9686
  return Ge(" ");
9648
9687
  }
9649
- function m(e, i2, t) {
9688
+ function g(e, i2, t) {
9650
9689
  t == null ? e.removeAttribute(i2) : e.getAttribute(i2) !== t && e.setAttribute(i2, t);
9651
9690
  }
9652
9691
  function pi(e) {
@@ -9764,13 +9803,13 @@ function Lt(e, i2, t, r, s, n, a, l = [-1]) {
9764
9803
  };
9765
9804
  a && a(c.root);
9766
9805
  let u = false;
9767
- if (c.ctx = t ? t(e, i2.props || {}, (y, p, ...v) => {
9806
+ if (c.ctx = t ? t(e, i2.props || {}, (m, p, ...v) => {
9768
9807
  const b = v.length ? v[0] : p;
9769
- return c.ctx && s(c.ctx[y], c.ctx[y] = b) && (!c.skip_bound && c.bound[y] && c.bound[y](b), u && xi(e, y)), p;
9808
+ return c.ctx && s(c.ctx[m], c.ctx[m] = b) && (!c.skip_bound && c.bound[m] && c.bound[m](b), u && xi(e, m)), p;
9770
9809
  }) : [], c.update(), u = true, $e(c.before_update), c.fragment = r ? r(c.ctx) : false, i2.target) {
9771
9810
  if (i2.hydrate) {
9772
- const y = pi(i2.target);
9773
- c.fragment && c.fragment.l(y), y.forEach(G);
9811
+ const m = pi(i2.target);
9812
+ c.fragment && c.fragment.l(m), m.forEach(G);
9774
9813
  } else
9775
9814
  c.fragment && c.fragment.c();
9776
9815
  i2.intro && Pt(e.$$.fragment), Mt(e, i2.target, i2.anchor, i2.customElement), Et();
@@ -9954,13 +9993,13 @@ function Ni(e) {
9954
9993
  return Array.isArray(e) ? e[0] : e;
9955
9994
  }
9956
9995
  function Li(e) {
9957
- let i2, t, r, s, n, a, l, d, c, u, y, p, v, b, T2, N2, x, f, C, L2, $, D2, V2, re, F2, ce, Ve, de, qe, pe, De, ue, Re, he, Fe, se, Be, Ue;
9996
+ let i2, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N2, x, y, C, L2, $, D2, V2, re, F2, ce, Ve, de, qe, pe, De, ue, Re, he, Fe, se, Be, Ue;
9958
9997
  return {
9959
9998
  c() {
9960
- i2 = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), y = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N2 = S("path"), x = S("symbol"), f = S("path"), C = S("symbol"), L2 = S("path"), $ = S("symbol"), D2 = S("path"), V2 = S("symbol"), re = S("path"), F2 = S("symbol"), ce = S("path"), Ve = S("path"), de = S("symbol"), qe = S("path"), pe = S("symbol"), De = S("path"), ue = S("symbol"), Re = S("path"), he = S("symbol"), Fe = S("path"), se = S("symbol"), Be = S("path"), Ue = S("path"), m(r, "d", "M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"), m(s, "d", "M4 17h10l-5-6z"), m(t, "id", "plyr-airplay"), m(t, "viewBox", "0 0 18 18"), m(a, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), m(a, "fill-rule", "evenodd"), m(a, "fill-opacity", ".5"), m(n, "id", "plyr-captions-off"), m(n, "viewBox", "0 0 18 18"), m(d, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), m(d, "fill-rule", "evenodd"), m(l, "id", "plyr-captions-on"), m(l, "viewBox", "0 0 18 18"), m(u, "d", "M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"), m(c, "id", "plyr-download"), m(c, "viewBox", "0 0 18 18"), m(p, "d", "M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"), m(y, "id", "plyr-enter-fullscreen"), m(y, "viewBox", "0 0 18 18"), m(b, "d", "M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"), m(v, "id", "plyr-exit-fullscreen"), m(v, "viewBox", "0 0 18 18"), m(N2, "d", "M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"), m(T2, "id", "plyr-fast-forward"), m(T2, "viewBox", "0 0 18 18"), m(f, "d", "M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"), m(x, "id", "plyr-logo-vimeo"), m(x, "viewBox", "0 0 18 18"), m(L2, "d", "M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"), m(C, "id", "plyr-logo-youtube"), m(C, "viewBox", "0 0 18 18"), m(D2, "d", "M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), m($, "id", "plyr-muted"), m($, "viewBox", "0 0 18 18"), m(re, "d", "M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"), m(V2, "id", "plyr-pause"), m(V2, "viewBox", "0 0 18 18"), m(ce, "d", "M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"), m(Ve, "d", "M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"), m(F2, "id", "plyr-pip"), m(F2, "viewBox", "0 0 18 18"), m(qe, "d", "M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"), m(de, "id", "plyr-play"), m(de, "viewBox", "0 0 18 18"), m(De, "d", "M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"), m(pe, "id", "plyr-restart"), m(pe, "viewBox", "0 0 18 18"), m(Re, "d", "M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"), m(ue, "id", "plyr-rewind"), m(ue, "viewBox", "0 0 18 18"), m(Fe, "d", "M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"), m(he, "id", "plyr-settings"), m(he, "viewBox", "0 0 18 18"), m(Be, "d", "M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"), m(Ue, "d", "M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), m(se, "id", "plyr-volume"), m(se, "viewBox", "0 0 18 18"), m(i2, "xmlns", "http://www.w3.org/2000/svg"), m(i2, "xmlns:xlink", "http://www.w3.org/1999/xlink");
9999
+ i2 = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N2 = S("path"), x = S("symbol"), y = S("path"), C = S("symbol"), L2 = S("path"), $ = S("symbol"), D2 = S("path"), V2 = S("symbol"), re = S("path"), F2 = S("symbol"), ce = S("path"), Ve = S("path"), de = S("symbol"), qe = S("path"), pe = S("symbol"), De = S("path"), ue = S("symbol"), Re = S("path"), he = S("symbol"), Fe = S("path"), se = S("symbol"), Be = S("path"), Ue = S("path"), g(r, "d", "M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"), g(s, "d", "M4 17h10l-5-6z"), g(t, "id", "plyr-airplay"), g(t, "viewBox", "0 0 18 18"), g(a, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(a, "fill-rule", "evenodd"), g(a, "fill-opacity", ".5"), g(n, "id", "plyr-captions-off"), g(n, "viewBox", "0 0 18 18"), g(d, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(d, "fill-rule", "evenodd"), g(l, "id", "plyr-captions-on"), g(l, "viewBox", "0 0 18 18"), g(u, "d", "M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"), g(c, "id", "plyr-download"), g(c, "viewBox", "0 0 18 18"), g(p, "d", "M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"), g(m, "id", "plyr-enter-fullscreen"), g(m, "viewBox", "0 0 18 18"), g(b, "d", "M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"), g(v, "id", "plyr-exit-fullscreen"), g(v, "viewBox", "0 0 18 18"), g(N2, "d", "M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"), g(T2, "id", "plyr-fast-forward"), g(T2, "viewBox", "0 0 18 18"), g(y, "d", "M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"), g(x, "id", "plyr-logo-vimeo"), g(x, "viewBox", "0 0 18 18"), g(L2, "d", "M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"), g(C, "id", "plyr-logo-youtube"), g(C, "viewBox", "0 0 18 18"), g(D2, "d", "M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g($, "id", "plyr-muted"), g($, "viewBox", "0 0 18 18"), g(re, "d", "M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"), g(V2, "id", "plyr-pause"), g(V2, "viewBox", "0 0 18 18"), g(ce, "d", "M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"), g(Ve, "d", "M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"), g(F2, "id", "plyr-pip"), g(F2, "viewBox", "0 0 18 18"), g(qe, "d", "M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"), g(de, "id", "plyr-play"), g(de, "viewBox", "0 0 18 18"), g(De, "d", "M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"), g(pe, "id", "plyr-restart"), g(pe, "viewBox", "0 0 18 18"), g(Re, "d", "M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"), g(ue, "id", "plyr-rewind"), g(ue, "viewBox", "0 0 18 18"), g(Fe, "d", "M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"), g(he, "id", "plyr-settings"), g(he, "viewBox", "0 0 18 18"), g(Be, "d", "M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"), g(Ue, "d", "M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g(se, "id", "plyr-volume"), g(se, "viewBox", "0 0 18 18"), g(i2, "xmlns", "http://www.w3.org/2000/svg"), g(i2, "xmlns:xlink", "http://www.w3.org/1999/xlink");
9961
10000
  },
9962
10001
  m(We, ni) {
9963
- te(We, i2, ni), k(i2, t), k(t, r), k(t, s), k(i2, n), k(n, a), k(i2, l), k(l, d), k(i2, c), k(c, u), k(i2, y), k(y, p), k(i2, v), k(v, b), k(i2, T2), k(T2, N2), k(i2, x), k(x, f), k(i2, C), k(C, L2), k(i2, $), k($, D2), k(i2, V2), k(V2, re), k(i2, F2), k(F2, ce), k(F2, Ve), k(i2, de), k(de, qe), k(i2, pe), k(pe, De), k(i2, ue), k(ue, Re), k(i2, he), k(he, Fe), k(i2, se), k(se, Be), k(se, Ue);
10002
+ te(We, i2, ni), k(i2, t), k(t, r), k(t, s), k(i2, n), k(n, a), k(i2, l), k(l, d), k(i2, c), k(c, u), k(i2, m), k(m, p), k(i2, v), k(v, b), k(i2, T2), k(T2, N2), k(i2, x), k(x, y), k(i2, C), k(C, L2), k(i2, $), k($, D2), k(i2, V2), k(V2, re), k(i2, F2), k(F2, ce), k(F2, Ve), k(i2, de), k(de, qe), k(i2, pe), k(pe, De), k(i2, ue), k(ue, Re), k(i2, he), k(he, Fe), k(i2, se), k(se, Be), k(se, Ue);
9964
10003
  },
9965
10004
  p: X,
9966
10005
  i: X,
@@ -9975,7 +10014,7 @@ class Ii extends It {
9975
10014
  super(), Lt(this, i2, null, Li, Ct, {});
9976
10015
  }
9977
10016
  }
9978
- function g(e, i2, t) {
10017
+ function f(e, i2, t) {
9979
10018
  return i2 in e ? Object.defineProperty(e, i2, { value: t, enumerable: true, configurable: true, writable: true }) : e[i2] = t, e;
9980
10019
  }
9981
10020
  function zi(e, i2) {
@@ -10436,7 +10475,7 @@ const xt = { pip: "PIP", airplay: "AirPlay", html5: "HTML5", vimeo: "Vimeo", you
10436
10475
  } };
10437
10476
  class we {
10438
10477
  constructor(i2) {
10439
- g(this, "get", (t) => {
10478
+ f(this, "get", (t) => {
10440
10479
  if (!we.supported || !this.enabled)
10441
10480
  return null;
10442
10481
  const r = window.localStorage.getItem(this.key);
@@ -10444,7 +10483,7 @@ class we {
10444
10483
  return null;
10445
10484
  const s = JSON.parse(r);
10446
10485
  return o.string(t) && t.length ? s[t] : s;
10447
- }), g(this, "set", (t) => {
10486
+ }), f(this, "set", (t) => {
10448
10487
  if (!we.supported || !this.enabled || !o.object(t))
10449
10488
  return;
10450
10489
  let r = this.get();
@@ -10824,8 +10863,8 @@ const h = { getIconUrl() {
10824
10863
  const c = _("div", B(this.config.selectors.controls.wrapper));
10825
10864
  this.elements.controls = c;
10826
10865
  const u = { class: "plyr__controls__item" };
10827
- return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((y) => {
10828
- if (y === "restart" && c.appendChild(t.call(this, "restart", u)), y === "rewind" && c.appendChild(t.call(this, "rewind", u)), y === "play" && c.appendChild(t.call(this, "play", u)), y === "fast-forward" && c.appendChild(t.call(this, "fast-forward", u)), y === "progress") {
10866
+ return rt(o.array(this.config.controls) ? this.config.controls : []).forEach((m) => {
10867
+ if (m === "restart" && c.appendChild(t.call(this, "restart", u)), m === "rewind" && c.appendChild(t.call(this, "rewind", u)), m === "play" && c.appendChild(t.call(this, "play", u)), m === "fast-forward" && c.appendChild(t.call(this, "fast-forward", u)), m === "progress") {
10829
10868
  const p = _("div", { class: `${u.class} plyr__progress__container` }), v = _("div", B(this.config.selectors.progress));
10830
10869
  if (v.appendChild(s.call(this, "seek", { id: `plyr-seek-${e.id}` })), v.appendChild(r.call(this, "buffer")), this.config.tooltips.seek) {
10831
10870
  const b = _("span", { class: this.config.classNames.tooltip }, "00:00");
@@ -10833,39 +10872,39 @@ const h = { getIconUrl() {
10833
10872
  }
10834
10873
  this.elements.progress = v, p.appendChild(this.elements.progress), c.appendChild(p);
10835
10874
  }
10836
- if (y === "current-time" && c.appendChild(n.call(this, "currentTime", u)), y === "duration" && c.appendChild(n.call(this, "duration", u)), y === "mute" || y === "volume") {
10875
+ if (m === "current-time" && c.appendChild(n.call(this, "currentTime", u)), m === "duration" && c.appendChild(n.call(this, "duration", u)), m === "mute" || m === "volume") {
10837
10876
  let { volume: p } = this.elements;
10838
- if (o.element(p) && c.contains(p) || (p = _("div", z({}, u, { class: `${u.class} plyr__volume`.trim() })), this.elements.volume = p, c.appendChild(p)), y === "mute" && p.appendChild(t.call(this, "mute")), y === "volume" && !H.isIos) {
10877
+ if (o.element(p) && c.contains(p) || (p = _("div", z({}, u, { class: `${u.class} plyr__volume`.trim() })), this.elements.volume = p, c.appendChild(p)), m === "mute" && p.appendChild(t.call(this, "mute")), m === "volume" && !H.isIos) {
10839
10878
  const v = { max: 1, step: 0.05, value: this.config.volume };
10840
10879
  p.appendChild(s.call(this, "volume", z(v, { id: `plyr-volume-${e.id}` })));
10841
10880
  }
10842
10881
  }
10843
- if (y === "captions" && c.appendChild(t.call(this, "captions", u)), y === "settings" && !o.empty(this.config.settings)) {
10882
+ if (m === "captions" && c.appendChild(t.call(this, "captions", u)), m === "settings" && !o.empty(this.config.settings)) {
10844
10883
  const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
10845
10884
  p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
10846
10885
  const v = _("div", { class: "plyr__menu__container", id: `plyr-settings-${e.id}`, hidden: "" }), b = _("div"), T2 = _("div", { id: `plyr-settings-${e.id}-home` }), N2 = _("div", { role: "menu" });
10847
10886
  T2.appendChild(N2), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
10848
- const f = _("button", z(B(this.config.selectors.buttons.settings), { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: "menuitem", "aria-haspopup": true, hidden: "" }));
10849
- i2.call(this, f, x), E.call(this, f, "click", () => {
10887
+ const y = _("button", z(B(this.config.selectors.buttons.settings), { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: "menuitem", "aria-haspopup": true, hidden: "" }));
10888
+ i2.call(this, y, x), E.call(this, y, "click", () => {
10850
10889
  d.call(this, x, false);
10851
10890
  });
10852
10891
  const C = _("span", null, j.get(x, this.config)), L2 = _("span", { class: this.config.classNames.menu.value });
10853
- L2.innerHTML = e[x], C.appendChild(L2), f.appendChild(C), N2.appendChild(f);
10892
+ L2.innerHTML = e[x], C.appendChild(L2), y.appendChild(C), N2.appendChild(y);
10854
10893
  const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
10855
10894
  D2.appendChild(_("span", { "aria-hidden": true }, j.get(x, this.config))), D2.appendChild(_("span", { class: this.config.classNames.hidden }, j.get("menuBack", this.config))), E.call(this, $, "keydown", (V2) => {
10856
10895
  V2.key === "ArrowLeft" && (V2.preventDefault(), V2.stopPropagation(), d.call(this, "home", true));
10857
10896
  }, false), E.call(this, D2, "click", () => {
10858
10897
  d.call(this, "home", false);
10859
- }), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = f, this.elements.settings.panels[x] = $;
10898
+ }), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
10860
10899
  }), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
10861
10900
  }
10862
- if (y === "pip" && I.pip && c.appendChild(t.call(this, "pip", u)), y === "airplay" && I.airplay && c.appendChild(t.call(this, "airplay", u)), y === "download") {
10901
+ if (m === "pip" && I.pip && c.appendChild(t.call(this, "pip", u)), m === "airplay" && I.airplay && c.appendChild(t.call(this, "airplay", u)), m === "download") {
10863
10902
  const p = z({}, u, { element: "a", href: this.download, target: "_blank" });
10864
10903
  this.isHTML5 && (p.download = "");
10865
10904
  const { download: v } = this.config.urls;
10866
10905
  !o.url(v) && this.isEmbed && z(p, { icon: `logo-${this.provider}`, label: this.provider }), c.appendChild(t.call(this, "download", p));
10867
10906
  }
10868
- y === "fullscreen" && c.appendChild(t.call(this, "fullscreen", u));
10907
+ m === "fullscreen" && c.appendChild(t.call(this, "fullscreen", u));
10869
10908
  }), this.isHTML5 && a.call(this, Q.getQualityOptions.call(this)), l.call(this), c;
10870
10909
  }, inject() {
10871
10910
  if (this.config.loadSprite) {
@@ -11065,14 +11104,14 @@ class _r {
11065
11104
  }
11066
11105
  class U {
11067
11106
  constructor(i2) {
11068
- g(this, "onChange", () => {
11107
+ f(this, "onChange", () => {
11069
11108
  if (!this.enabled)
11070
11109
  return;
11071
11110
  const t = this.player.elements.buttons.fullscreen;
11072
11111
  o.element(t) && (t.pressed = this.active);
11073
11112
  const r = this.target === this.player.media ? this.target : this.player.elements.container;
11074
11113
  w.call(this.player, r, this.active ? "enterfullscreen" : "exitfullscreen", true);
11075
- }), g(this, "toggleFallback", (t = false) => {
11114
+ }), f(this, "toggleFallback", (t = false) => {
11076
11115
  if (t ? this.scrollPosition = { x: window.scrollX || 0, y: window.scrollY || 0 } : window.scrollTo(this.scrollPosition.x, this.scrollPosition.y), document.body.style.overflow = t ? "hidden" : "", A(this.target, this.player.config.classNames.fullscreen.fallback, t), H.isIos) {
11077
11116
  let r = document.head.querySelector('meta[name="viewport"]');
11078
11117
  const s = "viewport-fit=cover";
@@ -11081,21 +11120,21 @@ class U {
11081
11120
  t ? (this.cleanupViewport = !n, n || (r.content += `,${s}`)) : this.cleanupViewport && (r.content = r.content.split(",").filter((a) => a.trim() !== s).join(","));
11082
11121
  }
11083
11122
  this.onChange();
11084
- }), g(this, "trapFocus", (t) => {
11123
+ }), f(this, "trapFocus", (t) => {
11085
11124
  if (H.isIos || !this.active || t.key !== "Tab")
11086
11125
  return;
11087
11126
  const r = document.activeElement, s = ne.call(this.player, "a[href], button:not(:disabled), input:not(:disabled), [tabindex]"), [n] = s, a = s[s.length - 1];
11088
11127
  r !== a || t.shiftKey ? r === n && t.shiftKey && (a.focus(), t.preventDefault()) : (n.focus(), t.preventDefault());
11089
- }), g(this, "update", () => {
11128
+ }), f(this, "update", () => {
11090
11129
  if (this.enabled) {
11091
11130
  let t;
11092
11131
  t = this.forceFallback ? "Fallback (forced)" : U.native ? "Native" : "Fallback", this.player.debug.log(`${t} fullscreen enabled`);
11093
11132
  } else
11094
11133
  this.player.debug.log("Fullscreen not supported and fallback disabled");
11095
11134
  A(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
11096
- }), g(this, "enter", () => {
11135
+ }), f(this, "enter", () => {
11097
11136
  this.enabled && (H.isIos && this.player.config.fullscreen.iosNative ? this.player.isVimeo ? this.player.embed.requestFullscreen() : this.target.webkitEnterFullscreen() : !U.native || this.forceFallback ? this.toggleFallback(true) : this.prefix ? o.empty(this.prefix) || this.target[`${this.prefix}Request${this.property}`]() : this.target.requestFullscreen({ navigationUI: "hide" }));
11098
- }), g(this, "exit", () => {
11137
+ }), f(this, "exit", () => {
11099
11138
  if (this.enabled)
11100
11139
  if (H.isIos && this.player.config.fullscreen.iosNative)
11101
11140
  this.target.webkitExitFullscreen(), W(this.player.play());
@@ -11108,7 +11147,7 @@ class U {
11108
11147
  }
11109
11148
  } else
11110
11149
  (document.cancelFullScreen || document.exitFullscreen).call(document);
11111
- }), g(this, "toggle", () => {
11150
+ }), f(this, "toggle", () => {
11112
11151
  this.active ? this.exit() : this.enter();
11113
11152
  }), this.player = i2, this.prefix = U.prefix, this.property = U.property, this.scrollPosition = { x: 0, y: 0 }, this.forceFallback = i2.config.fullscreen.fallback === "force", this.player.elements.fullscreen = i2.config.fullscreen.container && or(this.player.elements.container, i2.config.fullscreen.container), E.call(this.player, document, this.prefix === "ms" ? "MSFullscreenChange" : `${this.prefix}fullscreenchange`, () => {
11114
11153
  this.onChange();
@@ -11206,10 +11245,10 @@ const M = { addStyleHook() {
11206
11245
  } };
11207
11246
  class wr {
11208
11247
  constructor(i2) {
11209
- g(this, "firstTouch", () => {
11248
+ f(this, "firstTouch", () => {
11210
11249
  const { player: t } = this, { elements: r } = t;
11211
11250
  t.touch = true, A(r.container, t.config.classNames.isTouch, true);
11212
- }), g(this, "setTabFocus", (t) => {
11251
+ }), f(this, "setTabFocus", (t) => {
11213
11252
  const { player: r } = this, { elements: s } = r, { key: n, type: a, timeStamp: l } = t;
11214
11253
  if (clearTimeout(this.focusTimer), a === "keydown" && n !== "Tab")
11215
11254
  return;
@@ -11222,10 +11261,10 @@ class wr {
11222
11261
  const c = document.activeElement;
11223
11262
  s.container.contains(c) && A(document.activeElement, r.config.classNames.tabFocus, true);
11224
11263
  }, 10)));
11225
- }), g(this, "global", (t = true) => {
11264
+ }), f(this, "global", (t = true) => {
11226
11265
  const { player: r } = this;
11227
11266
  r.config.keyboard.global && ae.call(r, window, "keydown keyup", this.handleKey, t, false), ae.call(r, document.body, "click", this.toggleMenu, t), dt.call(r, document.body, "touchstart", this.firstTouch), ae.call(r, document.body, "keydown focus blur focusout", this.setTabFocus, t, false, true);
11228
- }), g(this, "container", () => {
11267
+ }), f(this, "container", () => {
11229
11268
  const { player: t } = this, { config: r, elements: s, timers: n } = t;
11230
11269
  !r.keyboard.global && r.keyboard.focused && E.call(t, s.container, "keydown keyup", this.handleKey, false), E.call(t, s.container, "mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen", (d) => {
11231
11270
  const { controls: c } = s;
@@ -11236,11 +11275,11 @@ class wr {
11236
11275
  const a = () => {
11237
11276
  if (!t.isVimeo || t.config.vimeo.premium)
11238
11277
  return;
11239
- const d = s.wrapper, { active: c } = t.fullscreen, [u, y] = pt.call(t), p = Kt(`aspect-ratio: ${u} / ${y}`);
11278
+ const d = s.wrapper, { active: c } = t.fullscreen, [u, m] = pt.call(t), p = Kt(`aspect-ratio: ${u} / ${m}`);
11240
11279
  if (!c)
11241
11280
  return void (p ? (d.style.width = null, d.style.height = null) : (d.style.maxWidth = null, d.style.margin = null));
11242
- const [v, b] = pr(), T2 = v / b > u / y;
11243
- p ? (d.style.width = T2 ? "auto" : "100%", d.style.height = T2 ? "100%" : "auto") : (d.style.maxWidth = T2 ? b / y * u + "px" : null, d.style.margin = T2 ? "0 auto" : null);
11281
+ const [v, b] = pr(), T2 = v / b > u / m;
11282
+ p ? (d.style.width = T2 ? "auto" : "100%", d.style.height = T2 ? "100%" : "auto") : (d.style.maxWidth = T2 ? b / m * u + "px" : null, d.style.margin = T2 ? "0 auto" : null);
11244
11283
  }, l = () => {
11245
11284
  clearTimeout(n.resized), n.resized = setTimeout(a, 50);
11246
11285
  };
@@ -11248,7 +11287,7 @@ class wr {
11248
11287
  const { target: c } = t.fullscreen;
11249
11288
  c === s.container && (!t.isEmbed && o.empty(t.config.ratio) || (a(), (d.type === "enterfullscreen" ? E : je).call(t, window, "resize", l)));
11250
11289
  });
11251
- }), g(this, "media", () => {
11290
+ }), f(this, "media", () => {
11252
11291
  const { player: t } = this, { elements: r } = t;
11253
11292
  if (E.call(t, t.media, "timeupdate seeking seeked", (n) => h.timeUpdate.call(t, n)), E.call(t, t.media, "durationchange loadeddata loadedmetadata", (n) => h.durationUpdate.call(t, n)), E.call(t, t.media, "ended", () => {
11254
11293
  t.isHTML5 && t.isVideo && t.config.resetOnEnd && (t.restart(), t.pause());
@@ -11280,14 +11319,14 @@ class wr {
11280
11319
  let { detail: a = {} } = n;
11281
11320
  n.type === "error" && (a = t.media.error), w.call(t, r.container, n.type, true, a);
11282
11321
  });
11283
- }), g(this, "proxy", (t, r, s) => {
11322
+ }), f(this, "proxy", (t, r, s) => {
11284
11323
  const { player: n } = this, a = n.config.listeners[s];
11285
11324
  let l = true;
11286
11325
  o.function(a) && (l = a.call(n, t)), l !== false && o.function(r) && r.call(n, t);
11287
- }), g(this, "bind", (t, r, s, n, a = true) => {
11326
+ }), f(this, "bind", (t, r, s, n, a = true) => {
11288
11327
  const { player: l } = this, d = l.config.listeners[n], c = o.function(d);
11289
11328
  E.call(l, t, r, (u) => this.proxy(u, s, n), a && !c);
11290
- }), g(this, "controls", () => {
11329
+ }), f(this, "controls", () => {
11291
11330
  const { player: t } = this, { elements: r } = t, s = H.isIE ? "change" : "input";
11292
11331
  if (r.buttons.play && Array.from(r.buttons.play).forEach((n) => {
11293
11332
  this.bind(n, "click", () => {
@@ -11363,7 +11402,7 @@ class wr {
11363
11402
  const l = this.touch ? 3e3 : 4e3;
11364
11403
  clearTimeout(a.controls), a.controls = setTimeout(() => M.toggleControls.call(t, false), l);
11365
11404
  }), this.bind(r.inputs.volume, "wheel", (n) => {
11366
- const a = n.webkitDirectionInvertedFromDevice, [l, d] = [n.deltaX, -n.deltaY].map((y) => a ? -y : y), c = Math.sign(Math.abs(l) > Math.abs(d) ? l : d);
11405
+ const a = n.webkitDirectionInvertedFromDevice, [l, d] = [n.deltaX, -n.deltaY].map((m) => a ? -m : m), c = Math.sign(Math.abs(l) > Math.abs(d) ? l : d);
11367
11406
  t.increaseVolume(c / 50);
11368
11407
  const { volume: u } = t.media;
11369
11408
  (c === 1 && u < 1 || c === -1 && u > 0) && n.preventDefault();
@@ -11371,7 +11410,7 @@ class wr {
11371
11410
  }), this.player = i2, this.lastKey = null, this.focusTimer = null, this.lastKeyDown = null, this.handleKey = this.handleKey.bind(this), this.toggleMenu = this.toggleMenu.bind(this), this.setTabFocus = this.setTabFocus.bind(this), this.firstTouch = this.firstTouch.bind(this);
11372
11411
  }
11373
11412
  handleKey(i2) {
11374
- const { player: t } = this, { elements: r } = t, { key: s, type: n, altKey: a, ctrlKey: l, metaKey: d, shiftKey: c } = i2, u = n === "keydown", y = u && s === this.lastKey;
11413
+ const { player: t } = this, { elements: r } = t, { key: s, type: n, altKey: a, ctrlKey: l, metaKey: d, shiftKey: c } = i2, u = n === "keydown", m = u && s === this.lastKey;
11375
11414
  if (!(a || l || d || c) && !!s) {
11376
11415
  if (u) {
11377
11416
  const v = document.activeElement;
@@ -11391,11 +11430,11 @@ class wr {
11391
11430
  case "7":
11392
11431
  case "8":
11393
11432
  case "9":
11394
- y || (p = parseInt(s, 10), t.currentTime = t.duration / 10 * p);
11433
+ m || (p = parseInt(s, 10), t.currentTime = t.duration / 10 * p);
11395
11434
  break;
11396
11435
  case "Space":
11397
11436
  case "k":
11398
- y || W(t.togglePlay());
11437
+ m || W(t.togglePlay());
11399
11438
  break;
11400
11439
  case "ArrowUp":
11401
11440
  t.increaseVolume(0.1);
@@ -11404,7 +11443,7 @@ class wr {
11404
11443
  t.decreaseVolume(0.1);
11405
11444
  break;
11406
11445
  case "m":
11407
- y || (t.muted = !t.muted);
11446
+ m || (t.muted = !t.muted);
11408
11447
  break;
11409
11448
  case "ArrowRight":
11410
11449
  t.forward();
@@ -11416,7 +11455,7 @@ class wr {
11416
11455
  t.fullscreen.toggle();
11417
11456
  break;
11418
11457
  case "c":
11419
- y || t.toggleCaptions();
11458
+ m || t.toggleCaptions();
11420
11459
  break;
11421
11460
  case "l":
11422
11461
  t.loop = !t.loop;
@@ -11440,11 +11479,11 @@ var kr = xr(function(e, i2) {
11440
11479
  }, r = {}, s = {}, n = {};
11441
11480
  function a(p, v) {
11442
11481
  p = p.push ? p : [p];
11443
- var b, T2, N2, x = [], f = p.length, C = f;
11482
+ var b, T2, N2, x = [], y = p.length, C = y;
11444
11483
  for (b = function(L2, $) {
11445
11484
  $.length && x.push(L2), --C || v(x);
11446
- }; f--; )
11447
- T2 = p[f], (N2 = s[T2]) ? b(T2, N2) : (n[T2] = n[T2] || []).push(b);
11485
+ }; y--; )
11486
+ T2 = p[y], (N2 = s[T2]) ? b(T2, N2) : (n[T2] = n[T2] || []).push(b);
11448
11487
  }
11449
11488
  function l(p, v) {
11450
11489
  if (p) {
@@ -11458,8 +11497,8 @@ var kr = xr(function(e, i2) {
11458
11497
  p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
11459
11498
  }
11460
11499
  function c(p, v, b, T2) {
11461
- var N2, x, f = document, C = b.async, L2 = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V2 = p.replace(/^(css|img)!/, "");
11462
- T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x = f.createElement("link")).rel = "stylesheet", x.href = V2, (N2 = "hideFocus" in x) && x.relList && (N2 = 0, x.rel = "preload", x.as = "style")) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(D2) ? (x = f.createElement("img")).src = V2 : ((x = f.createElement("script")).src = p, x.async = C === void 0 || C), x.onload = x.onerror = x.onbeforeload = function(re) {
11500
+ var N2, x, y = document, C = b.async, L2 = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V2 = p.replace(/^(css|img)!/, "");
11501
+ T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x = y.createElement("link")).rel = "stylesheet", x.href = V2, (N2 = "hideFocus" in x) && x.relList && (N2 = 0, x.rel = "preload", x.as = "style")) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(D2) ? (x = y.createElement("img")).src = V2 : ((x = y.createElement("script")).src = p, x.async = C === void 0 || C), x.onload = x.onerror = x.onbeforeload = function(re) {
11463
11502
  var F2 = re.type[0];
11464
11503
  if (N2)
11465
11504
  try {
@@ -11473,10 +11512,10 @@ var kr = xr(function(e, i2) {
11473
11512
  } else if (x.rel == "preload" && x.as == "style")
11474
11513
  return x.rel = "stylesheet";
11475
11514
  v(p, F2, re.defaultPrevented);
11476
- }, $(p, x) !== false && f.head.appendChild(x);
11515
+ }, $(p, x) !== false && y.head.appendChild(x);
11477
11516
  }
11478
11517
  function u(p, v, b) {
11479
- var T2, N2, x = (p = p.push ? p : [p]).length, f = x, C = [];
11518
+ var T2, N2, x = (p = p.push ? p : [p]).length, y = x, C = [];
11480
11519
  for (T2 = function(L2, $, D2) {
11481
11520
  if ($ == "e" && C.push(L2), $ == "b") {
11482
11521
  if (!D2)
@@ -11484,36 +11523,36 @@ var kr = xr(function(e, i2) {
11484
11523
  C.push(L2);
11485
11524
  }
11486
11525
  --x || v(C);
11487
- }, N2 = 0; N2 < f; N2++)
11526
+ }, N2 = 0; N2 < y; N2++)
11488
11527
  c(p[N2], T2, b);
11489
11528
  }
11490
- function y(p, v, b) {
11529
+ function m(p, v, b) {
11491
11530
  var T2, N2;
11492
11531
  if (v && v.trim && (T2 = v), N2 = (T2 ? b : v) || {}, T2) {
11493
11532
  if (T2 in r)
11494
11533
  throw "LoadJS";
11495
11534
  r[T2] = true;
11496
11535
  }
11497
- function x(f, C) {
11536
+ function x(y, C) {
11498
11537
  u(p, function(L2) {
11499
- d(N2, L2), f && d({ success: f, error: C }, L2), l(T2, L2);
11538
+ d(N2, L2), y && d({ success: y, error: C }, L2), l(T2, L2);
11500
11539
  }, N2);
11501
11540
  }
11502
11541
  if (N2.returnPromise)
11503
11542
  return new Promise(x);
11504
11543
  x();
11505
11544
  }
11506
- return y.ready = function(p, v) {
11545
+ return m.ready = function(p, v) {
11507
11546
  return a(p, function(b) {
11508
11547
  d(v, b);
11509
- }), y;
11510
- }, y.done = function(p) {
11548
+ }), m;
11549
+ }, m.done = function(p) {
11511
11550
  l(p, []);
11512
- }, y.reset = function() {
11551
+ }, m.reset = function() {
11513
11552
  r = {}, s = {}, n = {};
11514
- }, y.isDefined = function(p) {
11553
+ }, m.isDefined = function(p) {
11515
11554
  return p in r;
11516
- }, y;
11555
+ }, m;
11517
11556
  }();
11518
11557
  });
11519
11558
  function ut(e) {
@@ -11544,75 +11583,75 @@ const nt = { setup() {
11544
11583
  o.empty(n) ? (n = e.media.getAttribute(e.config.attributes.embed.id), a = e.media.getAttribute(e.config.attributes.embed.hash)) : a = Cr(n);
11545
11584
  const l = a ? { h: a } : {};
11546
11585
  t && Object.assign(s, { controls: false, sidedock: false });
11547
- const d = ti({ loop: e.config.loop.active, autoplay: e.autoplay, muted: e.muted, gesture: "media", playsinline: !this.config.fullscreen.iosNative, ...l, ...s }), c = Tr(n), u = _("iframe"), y = st(e.config.urls.vimeo.iframe, c, d);
11548
- if (u.setAttribute("src", y), u.setAttribute("allowfullscreen", ""), u.setAttribute("allow", ["autoplay", "fullscreen", "picture-in-picture", "encrypted-media", "accelerometer", "gyroscope"].join("; ")), o.empty(r) || u.setAttribute("referrerPolicy", r), t || !i2.customControls)
11586
+ const d = ti({ loop: e.config.loop.active, autoplay: e.autoplay, muted: e.muted, gesture: "media", playsinline: !this.config.fullscreen.iosNative, ...l, ...s }), c = Tr(n), u = _("iframe"), m = st(e.config.urls.vimeo.iframe, c, d);
11587
+ if (u.setAttribute("src", m), u.setAttribute("allowfullscreen", ""), u.setAttribute("allow", ["autoplay", "fullscreen", "picture-in-picture", "encrypted-media", "accelerometer", "gyroscope"].join("; ")), o.empty(r) || u.setAttribute("referrerPolicy", r), t || !i2.customControls)
11549
11588
  u.setAttribute("data-poster", e.poster), e.media = Le(u, e.media);
11550
11589
  else {
11551
- const f = _("div", { class: e.config.classNames.embedContainer, "data-poster": e.poster });
11552
- f.appendChild(u), e.media = Le(f, e.media);
11590
+ const y = _("div", { class: e.config.classNames.embedContainer, "data-poster": e.poster });
11591
+ y.appendChild(u), e.media = Le(y, e.media);
11553
11592
  }
11554
- i2.customControls || Te(st(e.config.urls.vimeo.api, y)).then((f) => {
11555
- !o.empty(f) && f.thumbnail_url && M.setPoster.call(e, f.thumbnail_url).catch(() => {
11593
+ i2.customControls || Te(st(e.config.urls.vimeo.api, m)).then((y) => {
11594
+ !o.empty(y) && y.thumbnail_url && M.setPoster.call(e, y.thumbnail_url).catch(() => {
11556
11595
  });
11557
11596
  }), e.embed = new window.Vimeo.Player(u, { autopause: e.config.autopause, muted: e.muted }), e.media.paused = true, e.media.currentTime = 0, e.supported.ui && e.embed.disableTextTrack(), e.media.play = () => (me.call(e, true), e.embed.play()), e.media.pause = () => (me.call(e, false), e.embed.pause()), e.media.stop = () => {
11558
11597
  e.pause(), e.currentTime = 0;
11559
11598
  };
11560
11599
  let { currentTime: p } = e.media;
11561
- Object.defineProperty(e.media, "currentTime", { get: () => p, set(f) {
11600
+ Object.defineProperty(e.media, "currentTime", { get: () => p, set(y) {
11562
11601
  const { embed: C, media: L2, paused: $, volume: D2 } = e, V2 = $ && !C.hasPlayed;
11563
- L2.seeking = true, w.call(e, L2, "seeking"), Promise.resolve(V2 && C.setVolume(0)).then(() => C.setCurrentTime(f)).then(() => V2 && C.pause()).then(() => V2 && C.setVolume(D2)).catch(() => {
11602
+ L2.seeking = true, w.call(e, L2, "seeking"), Promise.resolve(V2 && C.setVolume(0)).then(() => C.setCurrentTime(y)).then(() => V2 && C.pause()).then(() => V2 && C.setVolume(D2)).catch(() => {
11564
11603
  });
11565
11604
  } });
11566
11605
  let v = e.config.speed.selected;
11567
- Object.defineProperty(e.media, "playbackRate", { get: () => v, set(f) {
11568
- e.embed.setPlaybackRate(f).then(() => {
11569
- v = f, w.call(e, e.media, "ratechange");
11606
+ Object.defineProperty(e.media, "playbackRate", { get: () => v, set(y) {
11607
+ e.embed.setPlaybackRate(y).then(() => {
11608
+ v = y, w.call(e, e.media, "ratechange");
11570
11609
  }).catch(() => {
11571
11610
  e.options.speed = [1];
11572
11611
  });
11573
11612
  } });
11574
11613
  let { volume: b } = e.config;
11575
- Object.defineProperty(e.media, "volume", { get: () => b, set(f) {
11576
- e.embed.setVolume(f).then(() => {
11577
- b = f, w.call(e, e.media, "volumechange");
11614
+ Object.defineProperty(e.media, "volume", { get: () => b, set(y) {
11615
+ e.embed.setVolume(y).then(() => {
11616
+ b = y, w.call(e, e.media, "volumechange");
11578
11617
  });
11579
11618
  } });
11580
11619
  let { muted: T2 } = e.config;
11581
- Object.defineProperty(e.media, "muted", { get: () => T2, set(f) {
11582
- const C = !!o.boolean(f) && f;
11620
+ Object.defineProperty(e.media, "muted", { get: () => T2, set(y) {
11621
+ const C = !!o.boolean(y) && y;
11583
11622
  e.embed.setVolume(C ? 0 : e.config.volume).then(() => {
11584
11623
  T2 = C, w.call(e, e.media, "volumechange");
11585
11624
  });
11586
11625
  } });
11587
11626
  let N2, { loop: x } = e.config;
11588
- Object.defineProperty(e.media, "loop", { get: () => x, set(f) {
11589
- const C = o.boolean(f) ? f : e.config.loop.active;
11627
+ Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
11628
+ const C = o.boolean(y) ? y : e.config.loop.active;
11590
11629
  e.embed.setLoop(C).then(() => {
11591
11630
  x = C;
11592
11631
  });
11593
- } }), e.embed.getVideoUrl().then((f) => {
11594
- N2 = f, h.setDownloadUrl.call(e);
11595
- }).catch((f) => {
11596
- this.debug.warn(f);
11597
- }), Object.defineProperty(e.media, "currentSrc", { get: () => N2 }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration }), Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then((f) => {
11598
- const [C, L2] = f;
11632
+ } }), e.embed.getVideoUrl().then((y) => {
11633
+ N2 = y, h.setDownloadUrl.call(e);
11634
+ }).catch((y) => {
11635
+ this.debug.warn(y);
11636
+ }), Object.defineProperty(e.media, "currentSrc", { get: () => N2 }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration }), Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then((y) => {
11637
+ const [C, L2] = y;
11599
11638
  e.embed.ratio = Qt(C, L2), oe.call(this);
11600
- }), e.embed.setAutopause(e.config.autopause).then((f) => {
11601
- e.config.autopause = f;
11602
- }), e.embed.getVideoTitle().then((f) => {
11603
- e.config.title = f, M.setTitle.call(this);
11604
- }), e.embed.getCurrentTime().then((f) => {
11605
- p = f, w.call(e, e.media, "timeupdate");
11606
- }), e.embed.getDuration().then((f) => {
11607
- e.media.duration = f, w.call(e, e.media, "durationchange");
11608
- }), e.embed.getTextTracks().then((f) => {
11609
- e.media.textTracks = f, P.setup.call(e);
11610
- }), e.embed.on("cuechange", ({ cues: f = [] }) => {
11611
- const C = f.map((L2) => fr(L2.text));
11639
+ }), e.embed.setAutopause(e.config.autopause).then((y) => {
11640
+ e.config.autopause = y;
11641
+ }), e.embed.getVideoTitle().then((y) => {
11642
+ e.config.title = y, M.setTitle.call(this);
11643
+ }), e.embed.getCurrentTime().then((y) => {
11644
+ p = y, w.call(e, e.media, "timeupdate");
11645
+ }), e.embed.getDuration().then((y) => {
11646
+ e.media.duration = y, w.call(e, e.media, "durationchange");
11647
+ }), e.embed.getTextTracks().then((y) => {
11648
+ e.media.textTracks = y, P.setup.call(e);
11649
+ }), e.embed.on("cuechange", ({ cues: y = [] }) => {
11650
+ const C = y.map((L2) => fr(L2.text));
11612
11651
  P.updateCues.call(e, C);
11613
11652
  }), e.embed.on("loaded", () => {
11614
- e.embed.getPaused().then((f) => {
11615
- me.call(e, !f), f || w.call(e, e.media, "playing");
11653
+ e.embed.getPaused().then((y) => {
11654
+ me.call(e, !y), y || w.call(e, e.media, "playing");
11616
11655
  }), o.element(e.embed.element) && e.supported.ui && e.embed.element.setAttribute("tabindex", -1);
11617
11656
  }), e.embed.on("bufferstart", () => {
11618
11657
  w.call(e, e.media, "waiting");
@@ -11622,18 +11661,18 @@ const nt = { setup() {
11622
11661
  me.call(e, true), w.call(e, e.media, "playing");
11623
11662
  }), e.embed.on("pause", () => {
11624
11663
  me.call(e, false);
11625
- }), e.embed.on("timeupdate", (f) => {
11626
- e.media.seeking = false, p = f.seconds, w.call(e, e.media, "timeupdate");
11627
- }), e.embed.on("progress", (f) => {
11628
- e.media.buffered = f.percent, w.call(e, e.media, "progress"), parseInt(f.percent, 10) === 1 && w.call(e, e.media, "canplaythrough"), e.embed.getDuration().then((C) => {
11664
+ }), e.embed.on("timeupdate", (y) => {
11665
+ e.media.seeking = false, p = y.seconds, w.call(e, e.media, "timeupdate");
11666
+ }), e.embed.on("progress", (y) => {
11667
+ e.media.buffered = y.percent, w.call(e, e.media, "progress"), parseInt(y.percent, 10) === 1 && w.call(e, e.media, "canplaythrough"), e.embed.getDuration().then((C) => {
11629
11668
  C !== e.media.duration && (e.media.duration = C, w.call(e, e.media, "durationchange"));
11630
11669
  });
11631
11670
  }), e.embed.on("seeked", () => {
11632
11671
  e.media.seeking = false, w.call(e, e.media, "seeked");
11633
11672
  }), e.embed.on("ended", () => {
11634
11673
  e.media.paused = true, w.call(e, e.media, "ended");
11635
- }), e.embed.on("error", (f) => {
11636
- e.media.error = f, w.call(e, e.media, "error");
11674
+ }), e.embed.on("error", (y) => {
11675
+ e.media.error = y, w.call(e, e.media, "error");
11637
11676
  }), i2.customControls && setTimeout(() => M.build.call(e), 0);
11638
11677
  } };
11639
11678
  function Sr(e) {
@@ -11698,22 +11737,22 @@ const Ne = { setup() {
11698
11737
  ge.call(e, false), l.pauseVideo();
11699
11738
  }, e.media.stop = () => {
11700
11739
  l.stopVideo();
11701
- }, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(y) {
11702
- e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(y);
11703
- } }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(y) {
11704
- l.setPlaybackRate(y);
11740
+ }, e.media.duration = l.getDuration(), e.media.paused = true, e.media.currentTime = 0, Object.defineProperty(e.media, "currentTime", { get: () => Number(l.getCurrentTime()), set(m) {
11741
+ e.paused && !e.embed.hasPlayed && e.embed.mute(), e.media.seeking = true, w.call(e, e.media, "seeking"), l.seekTo(m);
11742
+ } }), Object.defineProperty(e.media, "playbackRate", { get: () => l.getPlaybackRate(), set(m) {
11743
+ l.setPlaybackRate(m);
11705
11744
  } });
11706
11745
  let { volume: d } = e.config;
11707
- Object.defineProperty(e.media, "volume", { get: () => d, set(y) {
11708
- d = y, l.setVolume(100 * d), w.call(e, e.media, "volumechange");
11746
+ Object.defineProperty(e.media, "volume", { get: () => d, set(m) {
11747
+ d = m, l.setVolume(100 * d), w.call(e, e.media, "volumechange");
11709
11748
  } });
11710
11749
  let { muted: c } = e.config;
11711
- Object.defineProperty(e.media, "muted", { get: () => c, set(y) {
11712
- const p = o.boolean(y) ? y : c;
11750
+ Object.defineProperty(e.media, "muted", { get: () => c, set(m) {
11751
+ const p = o.boolean(m) ? m : c;
11713
11752
  c = p, l[p ? "mute" : "unMute"](), l.setVolume(100 * d), w.call(e, e.media, "volumechange");
11714
11753
  } }), Object.defineProperty(e.media, "currentSrc", { get: () => l.getVideoUrl() }), Object.defineProperty(e.media, "ended", { get: () => e.currentTime === e.duration });
11715
11754
  const u = l.getAvailablePlaybackRates();
11716
- e.options.speed = u.filter((y) => e.config.speed.options.includes(y)), e.supported.ui && i2.customControls && e.media.setAttribute("tabindex", -1), w.call(e, e.media, "timeupdate"), w.call(e, e.media, "durationchange"), clearInterval(e.timers.buffering), e.timers.buffering = setInterval(() => {
11755
+ e.options.speed = u.filter((m) => e.config.speed.options.includes(m)), e.supported.ui && i2.customControls && e.media.setAttribute("tabindex", -1), w.call(e, e.media, "timeupdate"), w.call(e, e.media, "durationchange"), clearInterval(e.timers.buffering), e.timers.buffering = setInterval(() => {
11717
11756
  e.media.buffered = l.getVideoLoadedFraction(), (e.media.lastBuffered === null || e.media.lastBuffered < e.media.buffered) && w.call(e, e.media, "progress"), e.media.lastBuffered = e.media.buffered, e.media.buffered === 1 && (clearInterval(e.timers.buffering), w.call(e, e.media, "canplaythrough"));
11718
11757
  }, 200), i2.customControls && setTimeout(() => M.build.call(e), 50);
11719
11758
  }, onStateChange(a) {
@@ -11743,20 +11782,20 @@ const Ne = { setup() {
11743
11782
  } };
11744
11783
  class Er {
11745
11784
  constructor(i2) {
11746
- g(this, "load", () => {
11785
+ f(this, "load", () => {
11747
11786
  this.enabled && (o.object(window.google) && o.object(window.google.ima) ? this.ready() : ut(this.player.config.urls.googleIMA.sdk).then(() => {
11748
11787
  this.ready();
11749
11788
  }).catch(() => {
11750
11789
  this.trigger("error", new Error("Google IMA SDK failed to load"));
11751
11790
  }));
11752
- }), g(this, "ready", () => {
11791
+ }), f(this, "ready", () => {
11753
11792
  var t;
11754
11793
  this.enabled || ((t = this).manager && t.manager.destroy(), t.elements.displayContainer && t.elements.displayContainer.destroy(), t.elements.container.remove()), this.startSafetyTimer(12e3, "ready()"), this.managerPromise.then(() => {
11755
11794
  this.clearSafetyTimer("onAdsManagerLoaded()");
11756
11795
  }), this.listeners(), this.setupIMA();
11757
- }), g(this, "setupIMA", () => {
11796
+ }), f(this, "setupIMA", () => {
11758
11797
  this.elements.container = _("div", { class: this.player.config.classNames.ads }), this.player.elements.container.appendChild(this.elements.container), google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED), google.ima.settings.setLocale(this.player.config.ads.language), google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline), this.elements.displayContainer = new google.ima.AdDisplayContainer(this.elements.container, this.player.media), this.loader = new google.ima.AdsLoader(this.elements.displayContainer), this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, (t) => this.onAdsManagerLoaded(t), false), this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, (t) => this.onAdError(t), false), this.requestAds();
11759
- }), g(this, "requestAds", () => {
11798
+ }), f(this, "requestAds", () => {
11760
11799
  const { container: t } = this.player.elements;
11761
11800
  try {
11762
11801
  const r = new google.ima.AdsRequest();
@@ -11764,21 +11803,21 @@ class Er {
11764
11803
  } catch (r) {
11765
11804
  this.onAdError(r);
11766
11805
  }
11767
- }), g(this, "pollCountdown", (t = false) => {
11806
+ }), f(this, "pollCountdown", (t = false) => {
11768
11807
  if (!t)
11769
11808
  return clearInterval(this.countdownTimer), void this.elements.container.removeAttribute("data-badge-text");
11770
11809
  this.countdownTimer = setInterval(() => {
11771
11810
  const r = He(Math.max(this.manager.getRemainingTime(), 0)), s = `${j.get("advertisement", this.player.config)} - ${r}`;
11772
11811
  this.elements.container.setAttribute("data-badge-text", s);
11773
11812
  }, 100);
11774
- }), g(this, "onAdsManagerLoaded", (t) => {
11813
+ }), f(this, "onAdsManagerLoaded", (t) => {
11775
11814
  if (!this.enabled)
11776
11815
  return;
11777
11816
  const r = new google.ima.AdsRenderingSettings();
11778
11817
  r.restoreCustomPlaybackStateOnAdBreakComplete = true, r.enablePreloading = true, this.manager = t.getAdsManager(this.player, r), this.cuePoints = this.manager.getCuePoints(), this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, (s) => this.onAdError(s)), Object.keys(google.ima.AdEvent.Type).forEach((s) => {
11779
11818
  this.manager.addEventListener(google.ima.AdEvent.Type[s], (n) => this.onAdEvent(n));
11780
11819
  }), this.trigger("loaded");
11781
- }), g(this, "addCuePoints", () => {
11820
+ }), f(this, "addCuePoints", () => {
11782
11821
  o.empty(this.cuePoints) || this.cuePoints.forEach((t) => {
11783
11822
  if (t !== 0 && t !== -1 && t < this.player.duration) {
11784
11823
  const r = this.player.elements.progress;
@@ -11788,7 +11827,7 @@ class Er {
11788
11827
  }
11789
11828
  }
11790
11829
  });
11791
- }), g(this, "onAdEvent", (t) => {
11830
+ }), f(this, "onAdEvent", (t) => {
11792
11831
  const { container: r } = this.player.elements, s = t.getAd(), n = t.getAdData();
11793
11832
  switch (((a) => {
11794
11833
  w.call(this.player, this.player.media, `ads${a.replace(/_/g, "").toLowerCase()}`);
@@ -11811,9 +11850,9 @@ class Er {
11811
11850
  case google.ima.AdEvent.Type.LOG:
11812
11851
  n.adError && this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`);
11813
11852
  }
11814
- }), g(this, "onAdError", (t) => {
11853
+ }), f(this, "onAdError", (t) => {
11815
11854
  this.cancel(), this.player.debug.warn("Ads error", t);
11816
- }), g(this, "listeners", () => {
11855
+ }), f(this, "listeners", () => {
11817
11856
  const { container: t } = this.player.elements;
11818
11857
  let r;
11819
11858
  this.player.on("canplay", () => {
@@ -11830,7 +11869,7 @@ class Er {
11830
11869
  }), window.addEventListener("resize", () => {
11831
11870
  this.manager && this.manager.resize(t.offsetWidth, t.offsetHeight, google.ima.ViewMode.NORMAL);
11832
11871
  });
11833
- }), g(this, "play", () => {
11872
+ }), f(this, "play", () => {
11834
11873
  const { container: t } = this.player.elements;
11835
11874
  this.managerPromise || this.resumeContent(), this.managerPromise.then(() => {
11836
11875
  this.manager.setVolume(this.player.volume), this.elements.displayContainer.initialize();
@@ -11841,29 +11880,29 @@ class Er {
11841
11880
  }
11842
11881
  }).catch(() => {
11843
11882
  });
11844
- }), g(this, "resumeContent", () => {
11883
+ }), f(this, "resumeContent", () => {
11845
11884
  this.elements.container.style.zIndex = "", this.playing = false, W(this.player.media.play());
11846
- }), g(this, "pauseContent", () => {
11885
+ }), f(this, "pauseContent", () => {
11847
11886
  this.elements.container.style.zIndex = 3, this.playing = true, this.player.media.pause();
11848
- }), g(this, "cancel", () => {
11887
+ }), f(this, "cancel", () => {
11849
11888
  this.initialized && this.resumeContent(), this.trigger("error"), this.loadAds();
11850
- }), g(this, "loadAds", () => {
11889
+ }), f(this, "loadAds", () => {
11851
11890
  this.managerPromise.then(() => {
11852
11891
  this.manager && this.manager.destroy(), this.managerPromise = new Promise((t) => {
11853
11892
  this.on("loaded", t), this.player.debug.log(this.manager);
11854
11893
  }), this.initialized = false, this.requestAds();
11855
11894
  }).catch(() => {
11856
11895
  });
11857
- }), g(this, "trigger", (t, ...r) => {
11896
+ }), f(this, "trigger", (t, ...r) => {
11858
11897
  const s = this.events[t];
11859
11898
  o.array(s) && s.forEach((n) => {
11860
11899
  o.function(n) && n.apply(this, r);
11861
11900
  });
11862
- }), g(this, "on", (t, r) => (o.array(this.events[t]) || (this.events[t] = []), this.events[t].push(r), this)), g(this, "startSafetyTimer", (t, r) => {
11901
+ }), f(this, "on", (t, r) => (o.array(this.events[t]) || (this.events[t] = []), this.events[t].push(r), this)), f(this, "startSafetyTimer", (t, r) => {
11863
11902
  this.player.debug.log(`Safety timer invoked from: ${r}`), this.safetyTimer = setTimeout(() => {
11864
11903
  this.cancel(), this.clearSafetyTimer("startSafetyTimer()");
11865
11904
  }, t);
11866
- }), g(this, "clearSafetyTimer", (t) => {
11905
+ }), f(this, "clearSafetyTimer", (t) => {
11867
11906
  o.nullOrUndefined(this.safetyTimer) || (this.player.debug.log(`Safety timer cleared from: ${t}`), clearTimeout(this.safetyTimer), this.safetyTimer = null);
11868
11907
  }), this.player = i2, this.config = i2.config.ads, this.playing = false, this.initialized = false, this.elements = { container: null, displayContainer: null }, this.manager = null, this.loader = null, this.cuePoints = null, this.events = {}, this.safetyTimer = null, this.countdownTimer = null, this.managerPromise = new Promise((t, r) => {
11869
11908
  this.on("loaded", t), this.on("error", r);
@@ -11903,11 +11942,11 @@ const Pr = (e) => {
11903
11942
  };
11904
11943
  class at {
11905
11944
  constructor(i2) {
11906
- g(this, "load", () => {
11945
+ f(this, "load", () => {
11907
11946
  this.player.elements.display.seekTooltip && (this.player.elements.display.seekTooltip.hidden = this.enabled), this.enabled && this.getThumbnails().then(() => {
11908
11947
  this.enabled && (this.render(), this.determineContainerAutoSizing(), this.loaded = true);
11909
11948
  });
11910
- }), g(this, "getThumbnails", () => new Promise((t) => {
11949
+ }), f(this, "getThumbnails", () => new Promise((t) => {
11911
11950
  const { src: r } = this.player.config.previewThumbnails;
11912
11951
  if (o.empty(r))
11913
11952
  throw new Error("Missing previewThumbnails.src config attribute");
@@ -11922,7 +11961,7 @@ class at {
11922
11961
  const n = (o.string(r) ? [r] : r).map((a) => this.getThumbnail(a));
11923
11962
  Promise.all(n).then(s);
11924
11963
  }
11925
- })), g(this, "getThumbnail", (t) => new Promise((r) => {
11964
+ })), f(this, "getThumbnail", (t) => new Promise((r) => {
11926
11965
  Te(t).then((s) => {
11927
11966
  const n = { frames: Pr(s), height: null, urlPrefix: "" };
11928
11967
  n.frames[0].text.startsWith("/") || n.frames[0].text.startsWith("http://") || n.frames[0].text.startsWith("https://") || (n.urlPrefix = t.substring(0, t.lastIndexOf("/") + 1));
@@ -11931,7 +11970,7 @@ class at {
11931
11970
  n.height = a.naturalHeight, n.width = a.naturalWidth, this.thumbnails.push(n), r();
11932
11971
  }, a.src = n.urlPrefix + n.frames[0].text;
11933
11972
  });
11934
- })), g(this, "startMove", (t) => {
11973
+ })), f(this, "startMove", (t) => {
11935
11974
  if (this.loaded && o.event(t) && ["touchmove", "mousemove"].includes(t.type) && this.player.media.duration) {
11936
11975
  if (t.type === "touchmove")
11937
11976
  this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100);
@@ -11944,15 +11983,15 @@ class at {
11944
11983
  }
11945
11984
  this.showImageAtCurrentTime();
11946
11985
  }
11947
- }), g(this, "endMove", () => {
11986
+ }), f(this, "endMove", () => {
11948
11987
  this.toggleThumbContainer(false, true);
11949
- }), g(this, "startScrubbing", (t) => {
11988
+ }), f(this, "startScrubbing", (t) => {
11950
11989
  (o.nullOrUndefined(t.button) || t.button === false || t.button === 0) && (this.mouseDown = true, this.player.media.duration && (this.toggleScrubbingContainer(true), this.toggleThumbContainer(false, true), this.showImageAtCurrentTime()));
11951
- }), g(this, "endScrubbing", () => {
11990
+ }), f(this, "endScrubbing", () => {
11952
11991
  this.mouseDown = false, Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime) ? this.toggleScrubbingContainer(false) : dt.call(this.player, this.player.media, "timeupdate", () => {
11953
11992
  this.mouseDown || this.toggleScrubbingContainer(false);
11954
11993
  });
11955
- }), g(this, "listeners", () => {
11994
+ }), f(this, "listeners", () => {
11956
11995
  this.player.on("play", () => {
11957
11996
  this.toggleThumbContainer(false, true);
11958
11997
  }), this.player.on("seeked", () => {
@@ -11960,20 +11999,20 @@ class at {
11960
11999
  }), this.player.on("timeupdate", () => {
11961
12000
  this.lastTime = this.player.media.currentTime;
11962
12001
  });
11963
- }), g(this, "render", () => {
12002
+ }), f(this, "render", () => {
11964
12003
  this.elements.thumb.container = _("div", { class: this.player.config.classNames.previewThumbnails.thumbContainer }), this.elements.thumb.imageContainer = _("div", { class: this.player.config.classNames.previewThumbnails.imageContainer }), this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);
11965
12004
  const t = _("div", { class: this.player.config.classNames.previewThumbnails.timeContainer });
11966
12005
  this.elements.thumb.time = _("span", {}, "00:00"), t.appendChild(this.elements.thumb.time), this.elements.thumb.imageContainer.appendChild(t), o.element(this.player.elements.progress) && this.player.elements.progress.appendChild(this.elements.thumb.container), this.elements.scrubbing.container = _("div", { class: this.player.config.classNames.previewThumbnails.scrubbingContainer }), this.player.elements.wrapper.appendChild(this.elements.scrubbing.container);
11967
- }), g(this, "destroy", () => {
12006
+ }), f(this, "destroy", () => {
11968
12007
  this.elements.thumb.container && this.elements.thumb.container.remove(), this.elements.scrubbing.container && this.elements.scrubbing.container.remove();
11969
- }), g(this, "showImageAtCurrentTime", () => {
12008
+ }), f(this, "showImageAtCurrentTime", () => {
11970
12009
  this.mouseDown ? this.setScrubbingContainerSize() : this.setThumbContainerSizeAndPos();
11971
12010
  const t = this.thumbnails[0].frames.findIndex((n) => this.seekTime >= n.startTime && this.seekTime <= n.endTime), r = t >= 0;
11972
12011
  let s = 0;
11973
12012
  this.mouseDown || this.toggleThumbContainer(r), r && (this.thumbnails.forEach((n, a) => {
11974
12013
  this.loadedImages.includes(n.frames[t].text) && (s = a);
11975
12014
  }), t !== this.showingThumb && (this.showingThumb = t, this.loadImage(s)));
11976
- }), g(this, "loadImage", (t = 0) => {
12015
+ }), f(this, "loadImage", (t = 0) => {
11977
12016
  const r = this.showingThumb, s = this.thumbnails[t], { urlPrefix: n } = s, a = s.frames[r], l = s.frames[r].text, d = n + l;
11978
12017
  if (this.currentImageElement && this.currentImageElement.dataset.filename === l)
11979
12018
  this.showImage(this.currentImageElement, a, t, r, l, false), this.currentImageElement.dataset.index = r, this.removeOldImages(this.currentImageElement);
@@ -11982,9 +12021,9 @@ class at {
11982
12021
  const c = new Image();
11983
12022
  c.src = d, c.dataset.index = r, c.dataset.filename = l, this.showingThumbFilename = l, this.player.debug.log(`Loading image: ${d}`), c.onload = () => this.showImage(c, a, t, r, l, true), this.loadingImage = c, this.removeOldImages(c);
11984
12023
  }
11985
- }), g(this, "showImage", (t, r, s, n, a, l = true) => {
12024
+ }), f(this, "showImage", (t, r, s, n, a, l = true) => {
11986
12025
  this.player.debug.log(`Showing thumb: ${a}. num: ${n}. qual: ${s}. newimg: ${l}`), this.setImageSizeAndOffset(t, r), l && (this.currentImageContainer.appendChild(t), this.currentImageElement = t, this.loadedImages.includes(a) || this.loadedImages.push(a)), this.preloadNearby(n, true).then(this.preloadNearby(n, false)).then(this.getHigherQuality(s, t, r, a));
11987
- }), g(this, "removeOldImages", (t) => {
12026
+ }), f(this, "removeOldImages", (t) => {
11988
12027
  Array.from(this.currentImageContainer.children).forEach((r) => {
11989
12028
  if (r.tagName.toLowerCase() !== "img")
11990
12029
  return;
@@ -11997,7 +12036,7 @@ class at {
11997
12036
  }, s);
11998
12037
  }
11999
12038
  });
12000
- }), g(this, "preloadNearby", (t, r = true) => new Promise((s) => {
12039
+ }), f(this, "preloadNearby", (t, r = true) => new Promise((s) => {
12001
12040
  setTimeout(() => {
12002
12041
  const n = this.thumbnails[0].frames[t].text;
12003
12042
  if (this.showingThumbFilename === n) {
@@ -12008,30 +12047,30 @@ class at {
12008
12047
  const c = d.text;
12009
12048
  if (c !== n && !this.loadedImages.includes(c)) {
12010
12049
  l = true, this.player.debug.log(`Preloading thumb filename: ${c}`);
12011
- const { urlPrefix: u } = this.thumbnails[0], y = u + c, p = new Image();
12012
- p.src = y, p.onload = () => {
12050
+ const { urlPrefix: u } = this.thumbnails[0], m = u + c, p = new Image();
12051
+ p.src = m, p.onload = () => {
12013
12052
  this.player.debug.log(`Preloaded thumb filename: ${c}`), this.loadedImages.includes(c) || this.loadedImages.push(c), s();
12014
12053
  };
12015
12054
  }
12016
12055
  }), l || s();
12017
12056
  }
12018
12057
  }, 300);
12019
- })), g(this, "getHigherQuality", (t, r, s, n) => {
12058
+ })), f(this, "getHigherQuality", (t, r, s, n) => {
12020
12059
  if (t < this.thumbnails.length - 1) {
12021
12060
  let a = r.naturalHeight;
12022
12061
  this.usingSprites && (a = s.h), a < this.thumbContainerHeight && setTimeout(() => {
12023
12062
  this.showingThumbFilename === n && (this.player.debug.log(`Showing higher quality thumb for: ${n}`), this.loadImage(t + 1));
12024
12063
  }, 300);
12025
12064
  }
12026
- }), g(this, "toggleThumbContainer", (t = false, r = false) => {
12065
+ }), f(this, "toggleThumbContainer", (t = false, r = false) => {
12027
12066
  const s = this.player.config.classNames.previewThumbnails.thumbContainerShown;
12028
12067
  this.elements.thumb.container.classList.toggle(s, t), !t && r && (this.showingThumb = null, this.showingThumbFilename = null);
12029
- }), g(this, "toggleScrubbingContainer", (t = false) => {
12068
+ }), f(this, "toggleScrubbingContainer", (t = false) => {
12030
12069
  const r = this.player.config.classNames.previewThumbnails.scrubbingContainerShown;
12031
12070
  this.elements.scrubbing.container.classList.toggle(r, t), t || (this.showingThumb = null, this.showingThumbFilename = null);
12032
- }), g(this, "determineContainerAutoSizing", () => {
12071
+ }), f(this, "determineContainerAutoSizing", () => {
12033
12072
  (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) && (this.sizeSpecifiedInCSS = true);
12034
- }), g(this, "setThumbContainerSizeAndPos", () => {
12073
+ }), f(this, "setThumbContainerSizeAndPos", () => {
12035
12074
  const { imageContainer: t } = this.elements.thumb;
12036
12075
  if (this.sizeSpecifiedInCSS) {
12037
12076
  if (t.clientHeight > 20 && t.clientWidth < 20) {
@@ -12046,13 +12085,13 @@ class at {
12046
12085
  t.style.height = `${this.thumbContainerHeight}px`, t.style.width = `${r}px`;
12047
12086
  }
12048
12087
  this.setThumbContainerPos();
12049
- }), g(this, "setThumbContainerPos", () => {
12088
+ }), f(this, "setThumbContainerPos", () => {
12050
12089
  const t = this.player.elements.progress.getBoundingClientRect(), r = this.player.elements.container.getBoundingClientRect(), { container: s } = this.elements.thumb, n = r.left - t.left + 10, a = r.right - t.left - s.clientWidth - 10, l = this.mousePosX - t.left - s.clientWidth / 2, d = si(l, n, a);
12051
12090
  s.style.left = `${d}px`, s.style.setProperty("--preview-arrow-offset", l - d + "px");
12052
- }), g(this, "setScrubbingContainerSize", () => {
12091
+ }), f(this, "setScrubbingContainerSize", () => {
12053
12092
  const { width: t, height: r } = kt(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight });
12054
12093
  this.elements.scrubbing.container.style.width = `${t}px`, this.elements.scrubbing.container.style.height = `${r}px`;
12055
- }), g(this, "setImageSizeAndOffset", (t, r) => {
12094
+ }), f(this, "setImageSizeAndOffset", (t, r) => {
12056
12095
  if (!this.usingSprites)
12057
12096
  return;
12058
12097
  const s = this.thumbContainerHeight / r.h;
@@ -12098,38 +12137,38 @@ const ot = { insertElements(e, i2) {
12098
12137
  } };
12099
12138
  class xe {
12100
12139
  constructor(i2, t) {
12101
- if (g(this, "play", () => o.function(this.media.play) ? (this.ads && this.ads.enabled && this.ads.managerPromise.then(() => this.ads.play()).catch(() => W(this.media.play())), this.media.play()) : null), g(this, "pause", () => this.playing && o.function(this.media.pause) ? this.media.pause() : null), g(this, "togglePlay", (l) => (o.boolean(l) ? l : !this.playing) ? this.play() : this.pause()), g(this, "stop", () => {
12140
+ if (f(this, "play", () => o.function(this.media.play) ? (this.ads && this.ads.enabled && this.ads.managerPromise.then(() => this.ads.play()).catch(() => W(this.media.play())), this.media.play()) : null), f(this, "pause", () => this.playing && o.function(this.media.pause) ? this.media.pause() : null), f(this, "togglePlay", (l) => (o.boolean(l) ? l : !this.playing) ? this.play() : this.pause()), f(this, "stop", () => {
12102
12141
  this.isHTML5 ? (this.pause(), this.restart()) : o.function(this.media.stop) && this.media.stop();
12103
- }), g(this, "restart", () => {
12142
+ }), f(this, "restart", () => {
12104
12143
  this.currentTime = 0;
12105
- }), g(this, "rewind", (l) => {
12144
+ }), f(this, "rewind", (l) => {
12106
12145
  this.currentTime -= o.number(l) ? l : this.config.seekTime;
12107
- }), g(this, "forward", (l) => {
12146
+ }), f(this, "forward", (l) => {
12108
12147
  this.currentTime += o.number(l) ? l : this.config.seekTime;
12109
- }), g(this, "increaseVolume", (l) => {
12148
+ }), f(this, "increaseVolume", (l) => {
12110
12149
  const d = this.media.muted ? 0 : this.volume;
12111
12150
  this.volume = d + (o.number(l) ? l : 0);
12112
- }), g(this, "decreaseVolume", (l) => {
12151
+ }), f(this, "decreaseVolume", (l) => {
12113
12152
  this.increaseVolume(-l);
12114
- }), g(this, "airplay", () => {
12153
+ }), f(this, "airplay", () => {
12115
12154
  I.airplay && this.media.webkitShowPlaybackTargetPicker();
12116
- }), g(this, "toggleControls", (l) => {
12155
+ }), f(this, "toggleControls", (l) => {
12117
12156
  if (this.supported.ui && !this.isAudio) {
12118
12157
  const d = Ie(this.elements.container, this.config.classNames.hideControls), c = l === void 0 ? void 0 : !l, u = A(this.elements.container, this.config.classNames.hideControls, c);
12119
12158
  if (u && o.array(this.config.controls) && this.config.controls.includes("settings") && !o.empty(this.config.settings) && h.toggleMenu.call(this, false), u !== d) {
12120
- const y = u ? "controlshidden" : "controlsshown";
12121
- w.call(this, this.media, y);
12159
+ const m = u ? "controlshidden" : "controlsshown";
12160
+ w.call(this, this.media, m);
12122
12161
  }
12123
12162
  return !u;
12124
12163
  }
12125
12164
  return false;
12126
- }), g(this, "on", (l, d) => {
12165
+ }), f(this, "on", (l, d) => {
12127
12166
  E.call(this, this.elements.container, l, d);
12128
- }), g(this, "once", (l, d) => {
12167
+ }), f(this, "once", (l, d) => {
12129
12168
  dt.call(this, this.elements.container, l, d);
12130
- }), g(this, "off", (l, d) => {
12169
+ }), f(this, "off", (l, d) => {
12131
12170
  je(this.elements.container, l, d);
12132
- }), g(this, "destroy", (l, d = false) => {
12171
+ }), f(this, "destroy", (l, d = false) => {
12133
12172
  if (!this.ready)
12134
12173
  return;
12135
12174
  const c = () => {
@@ -12138,7 +12177,7 @@ class xe {
12138
12177
  }, 200));
12139
12178
  };
12140
12179
  this.stop(), clearTimeout(this.timers.loading), clearTimeout(this.timers.controls), clearTimeout(this.timers.resized), this.isHTML5 ? (M.toggleNativeControls.call(this, true), c()) : this.isYouTube ? (clearInterval(this.timers.buffering), clearInterval(this.timers.playing), this.embed !== null && o.function(this.embed.destroy) && this.embed.destroy(), c()) : this.isVimeo && (this.embed !== null && this.embed.unload().then(c), setTimeout(c, 200));
12141
- }), g(this, "supports", (l) => I.mime.call(this, l)), this.timers = {}, this.ready = false, this.loading = false, this.failed = false, this.touch = I.touch, this.media = i2, o.string(this.media) && (this.media = document.querySelectorAll(this.media)), (window.jQuery && this.media instanceof jQuery || o.nodeList(this.media) || o.array(this.media)) && (this.media = this.media[0]), this.config = z({}, ii, xe.defaults, t || {}, (() => {
12180
+ }), f(this, "supports", (l) => I.mime.call(this, l)), this.timers = {}, this.ready = false, this.loading = false, this.failed = false, this.touch = I.touch, this.media = i2, o.string(this.media) && (this.media = document.querySelectorAll(this.media)), (window.jQuery && this.media instanceof jQuery || o.nodeList(this.media) || o.array(this.media)) && (this.media = this.media[0]), this.config = z({}, ii, xe.defaults, t || {}, (() => {
12142
12181
  try {
12143
12182
  return JSON.parse(this.media.getAttribute("data-plyr-config"));
12144
12183
  } catch {
@@ -12364,7 +12403,7 @@ function Mr(e) {
12364
12403
  let i2, t, r;
12365
12404
  return {
12366
12405
  c() {
12367
- i2 = ie("video"), t = ie("source"), St(t.src, r = e[3]) || m(t, "src", r), m(t, "type", e[2]), m(i2, "data-app-kind", "Plyr"), m(i2, "crossorigin", "anonymous"), i2.playsInline = true, m(i2, "data-poster", e[4]);
12406
+ i2 = ie("video"), t = ie("source"), St(t.src, r = e[3]) || g(t, "src", r), g(t, "type", e[2]), g(i2, "data-app-kind", "Plyr"), g(i2, "crossorigin", "anonymous"), i2.playsInline = true, g(i2, "data-poster", e[4]);
12368
12407
  },
12369
12408
  m(s, n) {
12370
12409
  te(s, i2, n), k(i2, t), e[8](i2);
@@ -12379,7 +12418,7 @@ function Nr(e) {
12379
12418
  let i2, t, r;
12380
12419
  return {
12381
12420
  c() {
12382
- i2 = ie("audio"), t = ie("source"), St(t.src, r = e[3]) || m(t, "src", r), m(t, "type", e[2]), m(i2, "data-app-kind", "Plyr"), m(i2, "crossorigin", "anonymous"), m(i2, "data-poster", e[4]);
12421
+ i2 = ie("audio"), t = ie("source"), St(t.src, r = e[3]) || g(t, "src", r), g(t, "type", e[2]), g(i2, "data-app-kind", "Plyr"), g(i2, "crossorigin", "anonymous"), g(i2, "data-poster", e[4]);
12383
12422
  },
12384
12423
  m(s, n) {
12385
12424
  te(s, i2, n), k(i2, t), e[7](i2);
@@ -12398,7 +12437,7 @@ function Lr(e) {
12398
12437
  return {
12399
12438
  c() {
12400
12439
  i2 = ie("div"), t = Ge(`Invalid "src" or "type".
12401
- `), s = Ge(r), m(i2, "data-app-kind", "Plyr"), m(i2, "class", "plyr--audio");
12440
+ `), s = Ge(r), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr--audio");
12402
12441
  },
12403
12442
  m(n, a) {
12404
12443
  te(n, i2, a), k(i2, t), k(i2, s);
@@ -12418,7 +12457,7 @@ function Ir(e) {
12418
12457
  let i2;
12419
12458
  return {
12420
12459
  c() {
12421
- i2 = ie("div"), m(i2, "data-app-kind", "Plyr"), m(i2, "class", "plyr__video-embed"), m(i2, "data-plyr-provider", "youtube"), m(i2, "data-plyr-embed-id", e[3]), m(i2, "data-poster", e[4]);
12460
+ i2 = ie("div"), g(i2, "data-app-kind", "Plyr"), g(i2, "class", "plyr__video-embed"), g(i2, "data-plyr-provider", "youtube"), g(i2, "data-plyr-embed-id", e[3]), g(i2, "data-poster", e[4]);
12422
12461
  },
12423
12462
  m(t, r) {
12424
12463
  te(t, i2, r), e[6](i2);
@@ -12484,7 +12523,7 @@ function $r(e, i2, t) {
12484
12523
  console.warn("[Plyr] destroy plyr error", b);
12485
12524
  }
12486
12525
  });
12487
- function y(b) {
12526
+ function m(b) {
12488
12527
  be[b ? "unshift" : "push"](() => {
12489
12528
  c = b, t(1, c);
12490
12529
  });
@@ -12508,7 +12547,7 @@ function $r(e, i2, t) {
12508
12547
  a,
12509
12548
  l,
12510
12549
  s,
12511
- y,
12550
+ m,
12512
12551
  p,
12513
12552
  v
12514
12553
  ];
@@ -12557,7 +12596,10 @@ class jr {
12557
12596
  if (!t)
12558
12597
  return;
12559
12598
  const { currentTime: n, hostTime: a, muted: l, paused: d, volume: c, owner: u } = s.state;
12560
- i2 === "owner" && u === this.uid && r.isWritable || (d !== t.paused && !this._skip_next_play_pause && (d ? t.pause() : Si(t)), l !== t.muted && (t.muted = l), c !== t.volume && (t.volume = c), !this._buffering && (d ? Math.abs(t.currentTime - n) > 0.5 && (t.currentTime = n) : this.syncCurrentTime(a, n, t)));
12599
+ if (i2 === "owner" && u === this.uid && r.isWritable)
12600
+ return;
12601
+ let m = d;
12602
+ !m && r.isReplay && ["pause", "ended", "stop"].includes(r.displayer.phase) && (m = true), m !== t.paused && !this._skip_next_play_pause && (m ? t.pause() : Si(t)), l !== t.muted && (t.muted = l), c !== t.volume && (t.volume = c), !this._buffering && (d ? Math.abs(t.currentTime - n) > 0.5 && (t.currentTime = n) : this.syncCurrentTime(a, n, t));
12561
12603
  }
12562
12604
  watchUserInputs(i2) {
12563
12605
  const t = i2.elements.controls, r = Ni(i2.elements.buttons.play), s = t == null ? void 0 : t.querySelector('input[data-plyr="seek"]'), n = t == null ? void 0 : t.querySelector('button[data-plyr="mute"]'), a = t == null ? void 0 : t.querySelector('input[data-plyr="volume"]');
@@ -12751,39 +12793,24 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
12751
12793
  const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
12752
12794
  constructor(context) {
12753
12795
  super(context);
12754
- this.version = "1.0.0-canary.64";
12755
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.3", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12796
+ this.version = "1.0.0-canary.66";
12797
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12756
12798
  this.emitter = callbacks;
12757
12799
  this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
12758
12800
  this.playground$ = new valueEnhancer.Val(void 0);
12759
12801
  this.isReplay = whiteWebSdk.isPlayer(this.displayer);
12760
12802
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
12761
12803
  this.moveCamera = (camera) => {
12762
- var _a2;
12804
+ var _a2, _b;
12763
12805
  const pureCamera = lodash.omit(camera, ["animationMode"]);
12764
12806
  const mainViewCamera = __spreadValues({}, this.mainView.camera);
12765
12807
  if (lodash.isEqual(__spreadValues(__spreadValues({}, mainViewCamera), pureCamera), mainViewCamera))
12766
12808
  return;
12767
- this.debouncedStoreCamera();
12768
- this.mainView.moveCamera(camera);
12769
- (_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCamera, camera);
12809
+ (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.moveCamera(camera);
12810
+ (_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
12770
12811
  };
12771
- this.debouncedStoreCamera = () => {
12772
- const cameraListener = lodash.debounce(() => {
12773
- var _a2;
12774
- (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.saveToCamera$();
12775
- this.storeCamera();
12776
- this.mainView.callbacks.off("onCameraUpdated", cameraListener);
12777
- }, 50);
12778
- this.mainView.callbacks.on("onCameraUpdated", cameraListener);
12779
- };
12780
- this.storeCamera = lodash.debounce(() => {
12781
- var _a2, _b;
12782
- (_a2 = this.appManager) == null ? void 0 : _a2.mainViewProxy.storeCurrentCamera();
12783
- (_b = this.appManager) == null ? void 0 : _b.mainViewProxy.storeCurrentSize();
12784
- }, 300);
12785
12812
  _WindowManager.displayer = context.displayer;
12786
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.3", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12813
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "lodash": "^4.17.21", "p-retry": "^4.6.2", "side-effect-manager": "^1.2.1", "uuid": "^7.0.3", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^1.0.0-canary.3", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.23.2", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.6", "@types/node": "^18.0.3", "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.2", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "less": "^4.1.3", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^3.1.3", "vite-plugin-dts": "^1.5.0", "vitest": "^0.23.4", "white-web-sdk": "^2.16.35" } };
12787
12814
  }
12788
12815
  static mount(params) {
12789
12816
  return __async(this, null, function* () {
@@ -13349,7 +13376,6 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
13349
13376
  }
13350
13377
  moveCameraToContain(rectangle) {
13351
13378
  var _a2;
13352
- this.debouncedStoreCamera();
13353
13379
  this.mainView.moveCameraToContain(rectangle);
13354
13380
  (_a2 = this.appManager) == null ? void 0 : _a2.dispatchInternalEvent(Events.MoveCameraToContain, rectangle);
13355
13381
  }