aptechka 0.5.37 → 0.5.39

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.
@@ -1,10 +1,12 @@
1
1
  import { ClassLinkedStatus } from '../class-linked-status';
2
+ import { SourceManager } from './SourceManager';
2
3
  import { CustomElement } from '../custom-element';
3
4
 
4
5
  export declare abstract class SourceElement<T extends HTMLElement> extends CustomElement {
5
6
  #private;
6
7
  constructor();
7
8
  get consumerElement(): T;
9
+ get sourceManager(): SourceManager;
8
10
  get status(): ClassLinkedStatus<{
9
11
  loading: false;
10
12
  loaded: false;
@@ -1,5 +1,5 @@
1
- "use strict";var L=(i,r,t)=>{if(!r.has(i))throw TypeError("Cannot "+t)};var e=(i,r,t)=>(L(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(i,r,t)=>{if(r.has(i))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(i):r.set(i,t)},u=(i,r,t,n)=>(L(i,r,"write to private field"),n?n.call(i,t):r.set(i,t),t);var y=(i,r,t)=>(L(i,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../SourceManager-vSlsMKUE.cjs"),k=require("../custom-element/index.cjs"),C=require("../loading/index.cjs"),x=require("../class-linked-status/index.cjs"),M=require("../browser-CpzFX2xg.cjs");let q=0;var h,s,c,f,l,d,o,m,S,w,b,p,E;class A extends k.CustomElement{constructor(){super();a(this,S);a(this,h,null);a(this,s,null);a(this,c,!1);a(this,f,!1);a(this,l,!1);a(this,d,"");a(this,o,new x.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));a(this,m,null);a(this,b,t=>{const n=t[0];e(this,l)&&!e(this,f)&&n.isIntersecting&&(e(this,h).current&&e(this,h).current!==e(this,h).previous&&y(this,S,w).call(this,e(this,h).current),u(this,f,!0)),n.isIntersecting?this.dispatchEvent(new CustomEvent("sourceCapture")):this.dispatchEvent(new CustomEvent("sourceRelease"))});a(this,p,()=>{e(this,o).set("loaded",!0),e(this,o).set("error",!1),e(this,o).set("loading",!1),!e(this,l)&&!e(this,c)&&C.loading.setLoaded(e(this,d),1),u(this,c,!0)});a(this,E,t=>{e(this,o).set("loaded",!1),e(this,o).set("error",!0),e(this,o).set("loading",!1),!e(this,l)&&!e(this,c)&&C.loading.setError(e(this,d),t),u(this,c,!0)});M.isBrowser&&(u(this,d,`source-consumer-${++q}`),u(this,m,new IntersectionObserver(e(this,b))))}get consumerElement(){return e(this,s)}get status(){return e(this,o)}get isLazy(){return e(this,l)}connectedCallback(){const t=this.getAttribute("srcset");t&&(u(this,s,this.createConsumer()),e(this,s).style.cssText=`
1
+ "use strict";var C=(i,r,t)=>{if(!r.has(i))throw TypeError("Cannot "+t)};var e=(i,r,t)=>(C(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(i,r,t)=>{if(r.has(i))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(i):r.set(i,t)},u=(i,r,t,o)=>(C(i,r,"write to private field"),o?o.call(i,t):r.set(i,t),t);var p=(i,r,t)=>(C(i,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../SourceManager-vSlsMKUE.cjs"),M=require("../custom-element/index.cjs"),w=require("../loading/index.cjs"),k=require("../class-linked-status/index.cjs"),x=require("../browser-CpzFX2xg.cjs");let A=0;var h,s,c,f,l,d,n,m,g,v,E,b,L;class q extends M.CustomElement{constructor(){super();a(this,g);a(this,h,null);a(this,s,null);a(this,c,!1);a(this,f,!1);a(this,l,!1);a(this,d,"");a(this,n,new k.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));a(this,m,null);a(this,E,t=>{const o=t[0];e(this,l)&&(!e(this,f)||this.hasAttribute("reload-source"))&&o.isIntersecting&&(e(this,h).current&&e(this,h).current!==e(this,h).previous&&p(this,g,v).call(this,e(this,h).current),u(this,f,!0)),o.isIntersecting?this.dispatchEvent(new CustomEvent("sourceCapture")):(this.hasAttribute("reload-source")&&p(this,g,v).call(this,void 0),this.dispatchEvent(new CustomEvent("sourceRelease")))});a(this,b,()=>{e(this,n).set("loaded",!0),e(this,n).set("error",!1),e(this,n).set("loading",!1),!e(this,l)&&!e(this,c)&&w.loading.setLoaded(e(this,d),1),u(this,c,!0)});a(this,L,t=>{e(this,n).set("loaded",!1),e(this,n).set("error",!0),e(this,n).set("loading",!1),!e(this,l)&&!e(this,c)&&w.loading.setError(e(this,d),t),u(this,c,!0)});x.isBrowser&&(u(this,d,`source-consumer-${++A}`),u(this,m,new IntersectionObserver(e(this,E))))}get consumerElement(){return e(this,s)}get sourceManager(){return e(this,h)}get status(){return e(this,n)}get isLazy(){return e(this,l)}connectedCallback(){const t=this.getAttribute("srcset");t&&(u(this,s,this.createConsumer()),e(this,s).style.cssText=`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const g=n.nodeValue||"";n.name in e(this,s)&&(e(this,s)[n.name]=g||!0)}}),this.appendChild(e(this,s)),u(this,h,new v.SourceManager({srcset:t})),u(this,l,this.hasAttribute("lazy")),e(this,h).subscribe(n=>{(!e(this,l)||e(this,l)&&e(this,f))&&y(this,S,w).call(this,n.current)}),e(this,m).observe(this),e(this,h).connect())}disconnectedCallback(){e(this,m).disconnect(),e(this,h).close(),e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,s).remove(),e(this,o).reset()}}h=new WeakMap,s=new WeakMap,c=new WeakMap,f=new WeakMap,l=new WeakMap,d=new WeakMap,o=new WeakMap,m=new WeakMap,S=new WeakSet,w=function(t){if(e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,t){const n=this.hasAttribute("keep-source-parameters");e(this,o).set("loaded",!1),e(this,o).set("error",!1),e(this,o).set("loading",!0);const g=n?t.url:t.name+t.extension;this.consumeSource(g),!e(this,l)&&!e(this,c)&&C.loading.setTotal(e(this,d),1),e(this,s).onloadeddata=()=>{e(this,p).call(this)},e(this,s).onload=()=>{e(this,p).call(this)},e(this,s).onerror=()=>{e(this,E).call(this,g)}}else this.consumeSource(null)},b=new WeakMap,p=new WeakMap,E=new WeakMap;exports.Source=v.Source;exports.SourceManager=v.SourceManager;exports.SourceSet=v.SourceSet;exports.SourceElement=A;
5
+ `,e(this,s).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const S=o.nodeValue||"";o.name in e(this,s)&&(e(this,s)[o.name]=S||!0)}}),this.appendChild(e(this,s)),u(this,h,new y.SourceManager({srcset:t})),u(this,l,this.hasAttribute("lazy")),e(this,h).subscribe(o=>{(!e(this,l)||e(this,l)&&e(this,f))&&p(this,g,v).call(this,o.current)}),e(this,m).observe(this),e(this,h).connect())}disconnectedCallback(){e(this,m).disconnect(),e(this,h).close(),e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,s).remove(),e(this,n).reset()}}h=new WeakMap,s=new WeakMap,c=new WeakMap,f=new WeakMap,l=new WeakMap,d=new WeakMap,n=new WeakMap,m=new WeakMap,g=new WeakSet,v=function(t){if(e(this,s).onloadeddata=null,e(this,s).onload=null,e(this,s).onerror=null,e(this,n).set("loaded",!1),e(this,n).set("error",!1),e(this,n).set("loading",!1),t){const o=this.hasAttribute("keep-source-parameters");e(this,n).set("loading",!0);const S=o?t.url:t.name+t.extension;this.consumeSource(S),!e(this,l)&&!e(this,c)&&w.loading.setTotal(e(this,d),1),e(this,s).onloadeddata=()=>{e(this,b).call(this)},e(this,s).onload=()=>{e(this,b).call(this)},e(this,s).onerror=()=>{e(this,L).call(this,S)}}else this.consumeSource(null)},E=new WeakMap,b=new WeakMap,L=new WeakMap;exports.Source=y.Source;exports.SourceManager=y.SourceManager;exports.SourceSet=y.SourceSet;exports.SourceElement=q;
@@ -1,54 +1,57 @@
1
- var E = (i, r, s) => {
1
+ var L = (i, r, s) => {
2
2
  if (!r.has(i))
3
3
  throw TypeError("Cannot " + s);
4
4
  };
5
- var t = (i, r, s) => (E(i, r, "read from private field"), s ? s.call(i) : r.get(i)), h = (i, r, s) => {
5
+ var t = (i, r, s) => (L(i, r, "read from private field"), s ? s.call(i) : r.get(i)), h = (i, r, s) => {
6
6
  if (r.has(i))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  r instanceof WeakSet ? r.add(i) : r.set(i, s);
9
- }, u = (i, r, s, n) => (E(i, r, "write to private field"), n ? n.call(i, s) : r.set(i, s), s);
10
- var C = (i, r, s) => (E(i, r, "access private method"), s);
9
+ }, u = (i, r, s, n) => (L(i, r, "write to private field"), n ? n.call(i, s) : r.set(i, s), s);
10
+ var v = (i, r, s) => (L(i, r, "access private method"), s);
11
11
  import { S as y } from "../SourceManager-Q-PB-Rkh.js";
12
12
  import { a as R, b as V } from "../SourceManager-Q-PB-Rkh.js";
13
- import { CustomElement as k } from "../custom-element/index.js";
14
- import { loading as L } from "../loading/index.js";
15
- import { ClassLinkedStatus as x } from "../class-linked-status/index.js";
16
- import { i as A } from "../browser-0zX67oeU.js";
13
+ import { CustomElement as A } from "../custom-element/index.js";
14
+ import { loading as w } from "../loading/index.js";
15
+ import { ClassLinkedStatus as k } from "../class-linked-status/index.js";
16
+ import { i as x } from "../browser-0zX67oeU.js";
17
17
  let z = 0;
18
- var a, e, c, f, l, d, o, m, g, w, S, b, v;
19
- class F extends k {
18
+ var a, e, c, f, l, d, o, m, p, S, E, b, C;
19
+ class F extends A {
20
20
  constructor() {
21
21
  super();
22
- h(this, g);
22
+ h(this, p);
23
23
  h(this, a, null);
24
24
  h(this, e, null);
25
25
  h(this, c, !1);
26
26
  h(this, f, !1);
27
27
  h(this, l, !1);
28
28
  h(this, d, "");
29
- h(this, o, new x(this, {
29
+ h(this, o, new k(this, {
30
30
  loading: !1,
31
31
  loaded: !1,
32
32
  error: !1
33
33
  }));
34
34
  h(this, m, null);
35
- h(this, S, (s) => {
35
+ h(this, E, (s) => {
36
36
  const n = s[0];
37
- t(this, l) && !t(this, f) && n.isIntersecting && (t(this, a).current && t(this, a).current !== t(this, a).previous && C(this, g, w).call(this, t(this, a).current), u(this, f, !0)), n.isIntersecting ? this.dispatchEvent(new CustomEvent("sourceCapture")) : this.dispatchEvent(new CustomEvent("sourceRelease"));
37
+ t(this, l) && (!t(this, f) || this.hasAttribute("reload-source")) && n.isIntersecting && (t(this, a).current && t(this, a).current !== t(this, a).previous && v(this, p, S).call(this, t(this, a).current), u(this, f, !0)), n.isIntersecting ? this.dispatchEvent(new CustomEvent("sourceCapture")) : (this.hasAttribute("reload-source") && v(this, p, S).call(this, void 0), this.dispatchEvent(new CustomEvent("sourceRelease")));
38
38
  });
39
39
  h(this, b, () => {
40
- t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && L.setLoaded(t(this, d), 1), u(this, c, !0);
40
+ t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && w.setLoaded(t(this, d), 1), u(this, c, !0);
41
41
  });
42
- h(this, v, (s) => {
43
- t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && L.setError(t(this, d), s), u(this, c, !0);
42
+ h(this, C, (s) => {
43
+ t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, l) && !t(this, c) && w.setError(t(this, d), s), u(this, c, !0);
44
44
  });
45
- A && (u(this, d, `source-consumer-${++z}`), u(this, m, new IntersectionObserver(
46
- t(this, S)
45
+ x && (u(this, d, `source-consumer-${++z}`), u(this, m, new IntersectionObserver(
46
+ t(this, E)
47
47
  )));
48
48
  }
49
49
  get consumerElement() {
50
50
  return t(this, e);
51
51
  }
52
+ get sourceManager() {
53
+ return t(this, a);
54
+ }
52
55
  get status() {
53
56
  return t(this, o);
54
57
  }
@@ -63,34 +66,34 @@ class F extends k {
63
66
  height: 100%;
64
67
  `, t(this, e).classList.add("source-consumer"), Array.from(this.attributes).forEach((n) => {
65
68
  if (n.name !== "srcset") {
66
- const p = n.nodeValue || "";
67
- n.name in t(this, e) && (t(this, e)[n.name] = p || !0);
69
+ const g = n.nodeValue || "";
70
+ n.name in t(this, e) && (t(this, e)[n.name] = g || !0);
68
71
  }
69
72
  }), this.appendChild(t(this, e)), u(this, a, new y({
70
73
  srcset: s
71
74
  })), u(this, l, this.hasAttribute("lazy")), t(this, a).subscribe((n) => {
72
- (!t(this, l) || t(this, l) && t(this, f)) && C(this, g, w).call(this, n.current);
75
+ (!t(this, l) || t(this, l) && t(this, f)) && v(this, p, S).call(this, n.current);
73
76
  }), t(this, m).observe(this), t(this, a).connect());
74
77
  }
75
78
  disconnectedCallback() {
76
79
  t(this, m).disconnect(), t(this, a).close(), t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, t(this, e).remove(), t(this, o).reset();
77
80
  }
78
81
  }
79
- a = new WeakMap(), e = new WeakMap(), c = new WeakMap(), f = new WeakMap(), l = new WeakMap(), d = new WeakMap(), o = new WeakMap(), m = new WeakMap(), g = new WeakSet(), w = function(s) {
80
- if (t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, s) {
82
+ a = new WeakMap(), e = new WeakMap(), c = new WeakMap(), f = new WeakMap(), l = new WeakMap(), d = new WeakMap(), o = new WeakMap(), m = new WeakMap(), p = new WeakSet(), S = function(s) {
83
+ if (t(this, e).onloadeddata = null, t(this, e).onload = null, t(this, e).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), s) {
81
84
  const n = this.hasAttribute("keep-source-parameters");
82
- t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !0);
83
- const p = n ? s.url : s.name + s.extension;
84
- this.consumeSource(p), !t(this, l) && !t(this, c) && L.setTotal(t(this, d), 1), t(this, e).onloadeddata = () => {
85
+ t(this, o).set("loading", !0);
86
+ const g = n ? s.url : s.name + s.extension;
87
+ this.consumeSource(g), !t(this, l) && !t(this, c) && w.setTotal(t(this, d), 1), t(this, e).onloadeddata = () => {
85
88
  t(this, b).call(this);
86
89
  }, t(this, e).onload = () => {
87
90
  t(this, b).call(this);
88
91
  }, t(this, e).onerror = () => {
89
- t(this, v).call(this, p);
92
+ t(this, C).call(this, g);
90
93
  };
91
94
  } else
92
95
  this.consumeSource(null);
93
- }, S = new WeakMap(), b = new WeakMap(), v = new WeakMap();
96
+ }, E = new WeakMap(), b = new WeakMap(), C = new WeakMap();
94
97
  export {
95
98
  R as Source,
96
99
  F as SourceElement,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const d=require("../ticker/index.cjs"),h=require("../Damped-3daHRLIW.cjs"),m=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");const p=require("../source/index.cjs");var v=Object.defineProperty,E=Object.getOwnPropertyDescriptor,_=(t,e,r,c)=>{for(var s=c>1?void 0:c?E(e,r):e,u=t.length-1,o;u>=0;u--)(o=t[u])&&(s=(c?o(e,r,s):o(s))||s);return c&&s&&v(e,r,s),s},f=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},a=(t,e,r)=>(f(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},i,n;exports.VideoElement=class extends p.SourceElement{constructor(){super(...arguments),l(this,i,new h.Damped(0,{damping:15})),l(this,n,()=>{this.classList.add(`state-${this.consumerElement.readyState}`),a(this,i).set(this.consumerElement.readyState/4),this.consumerElement.readyState===4&&d.ticker.unsubscribe(a(this,n))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{d.ticker.subscribe(a(this,n)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0))})}get loading(){return a(this,i)}disconnectedCallback(){super.disconnectedCallback(),d.ticker.unsubscribe(a(this,n)),a(this,i).close()}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}};i=new WeakMap;n=new WeakMap;exports.VideoElement=_([m.define("e-video")],exports.VideoElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");require("../Store-C-1ruEIm.cjs");const v=require("../source/index.cjs"),d=require("../ticker/index.cjs");var E=Object.defineProperty,f=Object.getOwnPropertyDescriptor,_=(t,e,r,s)=>{for(var a=s>1?void 0:s?f(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(s?u(e,r,a):u(a))||a);return s&&a&&E(e,r,a),a},p=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},n=(t,e,r)=>(p(t,e,"read from private field"),r?r.call(t):e.get(t)),l=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},h=(t,e,r,s)=>(p(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),i,c;exports.VideoElement=class extends v.SourceElement{constructor(){super(...arguments),l(this,i,0),l(this,c,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e>n(this,i)&&h(this,i,e),this.dispatchEvent(new CustomEvent("readyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:n(this,i)}})),this.consumerElement.readyState===4&&d.ticker.unsubscribe(n(this,c))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{d.ticker.subscribe(n(this,c)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),d.ticker.unsubscribe(n(this,c)),h(this,i,0)}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}};i=new WeakMap;c=new WeakMap;exports.VideoElement=_([m.define("e-video")],exports.VideoElement);
@@ -1,10 +1,13 @@
1
1
  import { SourceElement } from '../source';
2
- import { Damped } from '../animation';
3
2
 
3
+ export interface ReadyStateChangeEventDetail {
4
+ readyState: number;
5
+ progress: number;
6
+ }
7
+ export type ReadyStateChangeEvent = CustomEvent<ReadyStateChangeEventDetail>;
4
8
  export declare class VideoElement extends SourceElement<HTMLVideoElement> {
5
9
  #private;
6
10
  protected connectedCallback(): void;
7
- get loading(): Damped;
8
11
  protected disconnectedCallback(): void;
9
12
  protected createConsumer(): HTMLVideoElement;
10
13
  protected consumeSource(url: string | null): void;
@@ -13,4 +16,7 @@ declare global {
13
16
  interface HTMLElementTagNameMap {
14
17
  'e-video': VideoElement;
15
18
  }
19
+ interface HTMLElementEventMap {
20
+ readyStateChange: ReadyStateChangeEvent;
21
+ }
16
22
  }
@@ -1,41 +1,50 @@
1
- import "../Store-BQXXikps.js";
2
- import { ticker as l } from "../ticker/index.js";
3
- import { D as d } from "../Damped-CH96byE8.js";
4
- import { define as m } from "../custom-element/index.js";
1
+ import { define as v } from "../custom-element/index.js";
5
2
  import "../window-resizer/index.js";
3
+ import "../Store-BQXXikps.js";
6
4
  import { SourceElement as f } from "../source/index.js";
7
- var v = Object.defineProperty, E = Object.getOwnPropertyDescriptor, _ = (e, t, r, c) => {
8
- for (var s = c > 1 ? void 0 : c ? E(t, r) : t, o = e.length - 1, u; o >= 0; o--)
9
- (u = e[o]) && (s = (c ? u(t, r, s) : u(s)) || s);
10
- return c && s && v(t, r, s), s;
11
- }, y = (e, t, r) => {
5
+ import { ticker as u } from "../ticker/index.js";
6
+ var E = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, y = (e, t, s, r) => {
7
+ for (var a = r > 1 ? void 0 : r ? _(t, s) : t, o = e.length - 1, h; o >= 0; o--)
8
+ (h = e[o]) && (a = (r ? h(t, s, a) : h(a)) || a);
9
+ return r && a && E(t, s, a), a;
10
+ }, m = (e, t, s) => {
12
11
  if (!t.has(e))
13
- throw TypeError("Cannot " + r);
14
- }, a = (e, t, r) => (y(e, t, "read from private field"), r ? r.call(e) : t.get(e)), h = (e, t, r) => {
12
+ throw TypeError("Cannot " + s);
13
+ }, n = (e, t, s) => (m(e, t, "read from private field"), s ? s.call(e) : t.get(e)), l = (e, t, s) => {
15
14
  if (t.has(e))
16
15
  throw TypeError("Cannot add the same private member more than once");
17
- t instanceof WeakSet ? t.add(e) : t.set(e, r);
18
- }, i, n;
16
+ t instanceof WeakSet ? t.add(e) : t.set(e, s);
17
+ }, d = (e, t, s, r) => (m(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), i, c;
19
18
  let p = class extends f {
20
19
  constructor() {
21
- super(...arguments), h(this, i, new d(0, {
22
- damping: 15
23
- })), h(this, n, () => {
24
- this.classList.add(`state-${this.consumerElement.readyState}`), a(this, i).set(this.consumerElement.readyState / 4), this.consumerElement.readyState === 4 && l.unsubscribe(a(this, n));
20
+ super(...arguments), l(this, i, 0), l(this, c, () => {
21
+ this.classList.add(`state-${this.consumerElement.readyState}`);
22
+ const e = this.consumerElement.readyState / 4;
23
+ e > n(this, i) && d(this, i, e), this.dispatchEvent(
24
+ new CustomEvent("readyStateChange", {
25
+ detail: {
26
+ readyState: this.consumerElement.readyState,
27
+ progress: n(this, i)
28
+ }
29
+ })
30
+ ), this.consumerElement.readyState === 4 && u.unsubscribe(n(this, c));
25
31
  });
26
32
  }
27
33
  connectedCallback() {
28
34
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
29
- l.subscribe(a(this, n)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
35
+ u.subscribe(n(this, c)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
30
36
  }), this.addEventListener("sourceRelease", () => {
31
- this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0));
37
+ this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
38
+ "state-0",
39
+ "state-1",
40
+ "state-2",
41
+ "state-3",
42
+ "state-4"
43
+ );
32
44
  });
33
45
  }
34
- get loading() {
35
- return a(this, i);
36
- }
37
46
  disconnectedCallback() {
38
- super.disconnectedCallback(), l.unsubscribe(a(this, n)), a(this, i).close();
47
+ super.disconnectedCallback(), u.unsubscribe(n(this, c)), d(this, i, 0);
39
48
  }
40
49
  createConsumer() {
41
50
  return document.createElement("video");
@@ -45,9 +54,9 @@ let p = class extends f {
45
54
  }
46
55
  };
47
56
  i = /* @__PURE__ */ new WeakMap();
48
- n = /* @__PURE__ */ new WeakMap();
49
- p = _([
50
- m("e-video")
57
+ c = /* @__PURE__ */ new WeakMap();
58
+ p = y([
59
+ v("e-video")
51
60
  ], p);
52
61
  export {
53
62
  p as VideoElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.5.37",
3
+ "version": "0.5.39",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"