aptechka 0.29.2 → 0.29.3

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 +1 @@
1
- "use strict";var g=e=>{throw TypeError(e)};var p=(e,t,s)=>t.has(e)||g("Cannot "+s);var i=(e,t,s)=>(p(e,t,"read from private field"),s?s.call(e):t.get(e)),n=(e,t,s)=>t.has(e)?g("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),c=(e,t,s,d)=>(p(e,t,"write to private field"),d?d.call(e,s):t.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../events-KVanG9sR.cjs"),u=require("../function-MthRj-GJ.cjs");var o,a,r,l,h;class v{constructor(){n(this,o,new Map);n(this,a,!1);n(this,r,u.debounce(()=>{i(this,a)||(c(this,a,!0),f.dispatchEvent(window,"loadingStart",{detail:{}}),i(this,l).call(this))},0));n(this,l,()=>{if(!i(this,a))return;const t=i(this,o).size,s=Array.from(i(this,o)).filter(w=>w[1]).length,d=s/t;f.dispatchEvent(window,"loadingProgress",{detail:{total:t,loaded:s,progress:d}}),d===1&&i(this,h).call(this)});n(this,h,u.debounce(()=>{c(this,a,!1),f.dispatchEvent(window,"loadingComplete",{detail:{total:i(this,o).size}}),i(this,o).clear()},0))}add(t){i(this,o).set(t,!1),i(this,r).call(this)}complete(t){i(this,o).set(t,!0),i(this,l).call(this)}error(t){i(this,o).has(t)&&(console.error(`Failed to load ${t}`),i(this,o).delete(t)),i(this,l).call(this)}}o=new WeakMap,a=new WeakMap,r=new WeakMap,l=new WeakMap,h=new WeakMap;const b=new v;exports.loading=b;
1
+ "use strict";var p=i=>{throw TypeError(i)};var f=(i,t,s)=>t.has(i)||p("Cannot "+s);var e=(i,t,s)=>(f(i,t,"read from private field"),s?s.call(i):t.get(i)),a=(i,t,s)=>t.has(i)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),g=(i,t,s,l)=>(f(i,t,"write to private field"),l?l.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../events-KVanG9sR.cjs"),w=require("../function-MthRj-GJ.cjs");var o,n,h,d,c;class v{constructor(){a(this,o,new Map);a(this,n,!1);a(this,h,w.debounce(()=>{e(this,n)||(g(this,n,!0),r.dispatchEvent(window,"loadingStart"),e(this,d).call(this))},0));a(this,d,()=>{if(!e(this,n))return;const t=e(this,o).size,s=Array.from(e(this,o)).filter(u=>u[1]).length,l=s/t;r.dispatchEvent(window,"loadingProgress",{detail:{total:t,loaded:s,progress:l}}),l===1&&e(this,c).call(this)});a(this,c,w.debounce(()=>{g(this,n,!1),r.dispatchEvent(window,"loadingComplete",{detail:{total:e(this,o).size}}),e(this,o).clear()},0))}get map(){return e(this,o)}add(t){e(this,o).set(t,!1),e(this,h).call(this)}complete(t){e(this,o).set(t,!0),e(this,d).call(this)}error(t){e(this,o).has(t)&&(console.error(`Failed to load ${t}`),e(this,o).delete(t),r.dispatchEvent(window,"loadingError",{detail:{name:t}})),e(this,d).call(this)}}o=new WeakMap,n=new WeakMap,h=new WeakMap,d=new WeakMap,c=new WeakMap;const m=new v;exports.loading=m;
@@ -8,9 +8,13 @@ export interface LoadingEvents {
8
8
  loadingComplete: CustomEvent<{
9
9
  total: number;
10
10
  }>;
11
+ loadingError: CustomEvent<{
12
+ name: string;
13
+ }>;
11
14
  }
12
15
  declare class Loading {
13
16
  #private;
17
+ get map(): Map<string, boolean>;
14
18
  add(resourceName: string): void;
15
19
  complete(resourceName: string): void;
16
20
  error(resourceName: string): void;
@@ -1,52 +1,57 @@
1
- var p = (i) => {
2
- throw TypeError(i);
1
+ var c = (s) => {
2
+ throw TypeError(s);
3
3
  };
4
- var g = (i, t, e) => t.has(i) || p("Cannot " + e);
5
- var s = (i, t, e) => (g(i, t, "read from private field"), e ? e.call(i) : t.get(i)), l = (i, t, e) => t.has(i) ? p("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), c = (i, t, e, r) => (g(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
6
- import { d as f } from "../events-CsVF98U6.js";
4
+ var g = (s, t, e) => t.has(s) || c("Cannot " + e);
5
+ var i = (s, t, e) => (g(s, t, "read from private field"), e ? e.call(s) : t.get(s)), r = (s, t, e) => t.has(s) ? c("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), p = (s, t, e, l) => (g(s, t, "write to private field"), l ? l.call(s, e) : t.set(s, e), e);
6
+ import { d as n } from "../events-CsVF98U6.js";
7
7
  import { d as w } from "../function-C10DGppn.js";
8
- var o, a, h, d, n;
8
+ var o, a, h, d, f;
9
9
  class u {
10
10
  constructor() {
11
- l(this, o, /* @__PURE__ */ new Map());
12
- l(this, a, !1);
13
- l(this, h, w(() => {
14
- s(this, a) || (c(this, a, !0), f(window, "loadingStart", {
15
- detail: {}
16
- }), s(this, d).call(this));
11
+ r(this, o, /* @__PURE__ */ new Map());
12
+ r(this, a, !1);
13
+ r(this, h, w(() => {
14
+ i(this, a) || (p(this, a, !0), n(window, "loadingStart"), i(this, d).call(this));
17
15
  }, 0));
18
- l(this, d, () => {
19
- if (!s(this, a))
16
+ r(this, d, () => {
17
+ if (!i(this, a))
20
18
  return;
21
- const t = s(this, o).size, e = Array.from(s(this, o)).filter((m) => m[1]).length, r = e / t;
22
- f(window, "loadingProgress", {
19
+ const t = i(this, o).size, e = Array.from(i(this, o)).filter((m) => m[1]).length, l = e / t;
20
+ n(window, "loadingProgress", {
23
21
  detail: {
24
22
  total: t,
25
23
  loaded: e,
26
- progress: r
24
+ progress: l
27
25
  }
28
- }), r === 1 && s(this, n).call(this);
26
+ }), l === 1 && i(this, f).call(this);
29
27
  });
30
- l(this, n, w(() => {
31
- c(this, a, !1), f(window, "loadingComplete", {
28
+ r(this, f, w(() => {
29
+ p(this, a, !1), n(window, "loadingComplete", {
32
30
  detail: {
33
- total: s(this, o).size
31
+ total: i(this, o).size
34
32
  }
35
- }), s(this, o).clear();
33
+ }), i(this, o).clear();
36
34
  }, 0));
37
35
  }
36
+ get map() {
37
+ return i(this, o);
38
+ }
38
39
  add(t) {
39
- s(this, o).set(t, !1), s(this, h).call(this);
40
+ i(this, o).set(t, !1), i(this, h).call(this);
40
41
  }
41
42
  complete(t) {
42
- s(this, o).set(t, !0), s(this, d).call(this);
43
+ i(this, o).set(t, !0), i(this, d).call(this);
43
44
  }
44
45
  error(t) {
45
- s(this, o).has(t) && (console.error(`Failed to load ${t}`), s(this, o).delete(t)), s(this, d).call(this);
46
+ i(this, o).has(t) && (console.error(`Failed to load ${t}`), i(this, o).delete(t), n(window, "loadingError", {
47
+ detail: {
48
+ name: t
49
+ }
50
+ })), i(this, d).call(this);
46
51
  }
47
52
  }
48
- o = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakMap(), n = new WeakMap();
49
- const k = new u();
53
+ o = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakMap(), f = new WeakMap();
54
+ const b = new u();
50
55
  export {
51
- k as loading
56
+ b as loading
52
57
  };
@@ -1,5 +1,5 @@
1
- "use strict";var oe=n=>{throw TypeError(n)};var te=(n,r,t)=>r.has(n)||oe("Cannot "+t);var e=(n,r,t)=>(te(n,r,"read from private field"),t?t.call(n):r.get(n)),s=(n,r,t)=>r.has(n)?oe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,t),h=(n,r,t,i)=>(te(n,r,"write to private field"),i?i.call(n,t):r.set(n,t),t),b=(n,r,t)=>(te(n,r,"access private method"),t);var ce=(n,r,t)=>new Promise((i,l)=>{var R=m=>{try{E(t.next(m))}catch(o){l(o)}},Y=m=>{try{E(t.throw(m))}catch(o){l(o)}},E=m=>m.done?i(m.value):Promise.resolve(m.value).then(R,Y);E((t=t.apply(n,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ve=require("../source/index.cjs"),Ee=require("../class-linked-status/index.cjs"),he=require("../browser-CpzFX2xg.cjs"),ie=require("../events-KVanG9sR.cjs"),Se=require("../string-DhgS_iFl.cjs"),se=require("../loading/index.cjs"),j=require("../css-property/index.cjs"),Q=require("../element-resizer/vanilla/index.cjs"),le=require("../canvas-CU5Xjahf.cjs"),B=require("../ticker/vanilla/index.cjs"),ye=require("../jss-GJLvaNfT.cjs"),we=require("../math-GDWEqu7y.cjs");let Ce=0;var u,a,S,_,p,k,c,M,F,J,U,W,Z;class ee extends HTMLElement{constructor(){super();s(this,F);s(this,u,null);s(this,a,null);s(this,S,!1);s(this,_,!1);s(this,p,!1);s(this,k,"");s(this,c,new Ee.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));s(this,M,null);s(this,U,t=>{const i=t[0];e(this,p)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&(e(this,u).current&&e(this,u).current!==e(this,u).previous&&b(this,F,J).call(this,e(this,u).current),h(this,_,!0)),i.isIntersecting?ie.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&b(this,F,J).call(this,void 0),ie.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,W,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,p)&&!e(this,S)&&se.loading.complete(e(this,k)),h(this,S,!0)});s(this,Z,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,p)&&!e(this,S)&&se.loading.error(e(this,k)),h(this,S,!0)});he.isBrowser&&window.IntersectionObserver&&(h(this,k,`source-consumer-${++Ce}`),h(this,M,new IntersectionObserver(e(this,U))))}get consumerElement(){return e(this,a)}get sourceManager(){return e(this,u)}get status(){return e(this,c)}get isLazy(){return e(this,p)}connectedCallback(){const t=this.getAttribute("srcset");t&&(h(this,a,this.createConsumer()),e(this,a).style.cssText=`
1
+ "use strict";var ce=n=>{throw TypeError(n)};var se=(n,h,t)=>h.has(n)||ce("Cannot "+t);var e=(n,h,t)=>(se(n,h,"read from private field"),t?t.call(n):h.get(n)),s=(n,h,t)=>h.has(n)?ce("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(n):h.set(n,t),r=(n,h,t,i)=>(se(n,h,"write to private field"),i?i.call(n,t):h.set(n,t),t),b=(n,h,t)=>(se(n,h,"access private method"),t);var le=(n,h,t)=>new Promise((i,l)=>{var R=m=>{try{E(t.next(m))}catch(o){l(o)}},Y=m=>{try{E(t.throw(m))}catch(o){l(o)}},E=m=>m.done?i(m.value):Promise.resolve(m.value).then(R,Y);E((t=t.apply(n,h)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("../source/index.cjs"),Se=require("../class-linked-status/index.cjs"),ae=require("../browser-CpzFX2xg.cjs"),ne=require("../events-KVanG9sR.cjs"),ye=require("../string-DhgS_iFl.cjs"),ie=require("../loading/index.cjs"),W=require("../css-property/index.cjs"),Q=require("../element-resizer/vanilla/index.cjs"),ue=require("../canvas-CU5Xjahf.cjs"),B=require("../ticker/vanilla/index.cjs"),we=require("../jss-GJLvaNfT.cjs"),Ce=require("../math-GDWEqu7y.cjs");let xe=0;var u,a,S,_,p,j,k,c,M,F,J,Z,D,ee;class te extends HTMLElement{constructor(){super();s(this,F);s(this,u,null);s(this,a,null);s(this,S,!1);s(this,_,!1);s(this,p,!1);s(this,j,"");s(this,k,"");s(this,c,new Se.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1}));s(this,M,null);s(this,Z,t=>{const i=t[0];e(this,p)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&(e(this,u).current&&e(this,u).current!==e(this,u).previous&&b(this,F,J).call(this,e(this,u).current),r(this,_,!0)),i.isIntersecting?ne.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&b(this,F,J).call(this,void 0),ne.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,D,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,p)&&!e(this,S)&&ie.loading.complete(e(this,k)),r(this,S,!0)});s(this,ee,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,p)&&!e(this,S)&&ie.loading.error(e(this,k)),r(this,S,!0)});ae.isBrowser&&window.IntersectionObserver&&(r(this,j,`source-consumer-${++xe}`),r(this,M,new IntersectionObserver(e(this,Z))))}get consumerElement(){return e(this,a)}get sourceManager(){return e(this,u)}get status(){return e(this,c)}get isLazy(){return e(this,p)}connectedCallback(){const t=this.getAttribute("srcset");t&&(r(this,a,this.createConsumer()),e(this,a).style.cssText=`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const l=i.nodeValue||"",R=Se.kebabToCamel(i.name);R in e(this,a)&&(e(this,a)[R]=l||!0)}}),this.appendChild(e(this,a)),h(this,u,new ve.SourceManager({srcset:t})),h(this,p,this.hasAttribute("lazy")),e(this,u).subscribe(i=>{(!e(this,p)||e(this,p)&&e(this,_))&&b(this,F,J).call(this,i.current)}),e(this,M).observe(this),e(this,u).connect())}disconnectedCallback(){e(this,M).disconnect(),e(this,u).close(),e(this,a).onloadeddata=null,e(this,a).onload=null,e(this,a).onerror=null,e(this,a).remove(),e(this,c).reset()}}u=new WeakMap,a=new WeakMap,S=new WeakMap,_=new WeakMap,p=new WeakMap,k=new WeakMap,c=new WeakMap,M=new WeakMap,F=new WeakSet,J=function(t){if(e(this,a).onloadeddata=null,e(this,a).onload=null,e(this,a).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),t){const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0);const l=i?t.url:t.name+t.extension;this.consumeSource(l),!e(this,p)&&!e(this,S)&&se.loading.add(e(this,k)),e(this,a).onloadeddata=()=>{e(this,W).call(this)},e(this,a).onload=()=>{e(this,W).call(this)},e(this,a).onerror=()=>{e(this,Z).call(this,l)}}else this.consumeSource(null)},U=new WeakMap,W=new WeakMap,Z=new WeakMap;class ue extends ee{createConsumer(){return document.createElement("img")}consumeSource(r){this.consumerElement.src=r||""}}customElements.get("e-image")||customElements.define("e-image",ue);var y,g,H,L,P,T,D,K,d,ne,me,N,O,re,pe;class de extends HTMLElement{constructor(){super();s(this,d);s(this,y,new j.CSSProperty(this,"--fps",0));s(this,g,null);s(this,H,null);s(this,L,0);s(this,P,0);s(this,T,1);s(this,D,0);s(this,K,1);s(this,N,t=>{h(this,T,we.clamp(devicePixelRatio,1,2)),h(this,L,t.contentRect.width),h(this,P,t.contentRect.height),e(this,g).width=e(this,L)*this.pixelRatio,e(this,g).height=e(this,P)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),b(this,d,pe).call(this),b(this,d,re).call(this)});s(this,O,t=>{h(this,D,t.timestamp),h(this,K,t.timeBetweenFrames),b(this,d,re).call(this)});if(he.isBrowser){const t=this.attachShadow({mode:"open"});t.adoptedStyleSheets.push(ye.createStylesheet({" :host, canvas":{display:"block",width:"100%",height:"100%"}})),h(this,g,document.createElement("canvas")),h(this,H,e(this,g).getContext("2d")),t.appendChild(e(this,g)),e(this,y).subscribe(i=>{typeof i.previous!="undefined"&&i.current!==i.previous&&b(this,d,ne).call(this)})}}get fpsCSSProperty(){return e(this,y)}get canvasElement(){return e(this,g)}get context(){return e(this,H)}get pixelRatio(){return e(this,T)}get width(){return e(this,L)}get height(){return e(this,P)}get detail(){return{width:e(this,L),height:e(this,P),element:this,canvasElement:e(this,g),pixelRatio:e(this,T),context:e(this,H),timestamp:e(this,D),timeBetweenFrames:e(this,K)}}connectedCallback(){e(this,y).observe(),Q.elementResizer.subscribe(this,e(this,N)),b(this,d,ne).call(this)}disconnectedCallback(){e(this,y).unobserve(),Q.elementResizer.unsubscribe(e(this,N)),b(this,d,me).call(this)}}y=new WeakMap,g=new WeakMap,H=new WeakMap,L=new WeakMap,P=new WeakMap,T=new WeakMap,D=new WeakMap,K=new WeakMap,d=new WeakSet,ne=function(){B.ticker.unsubscribe(e(this,O)),this.hasAttribute("static")||B.ticker.subscribe(e(this,O),{culling:this,maxFPS:e(this,y).current})},me=function(){B.ticker.unsubscribe(e(this,O))},N=new WeakMap,O=new WeakMap,re=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))},pe=function(){this.dispatchEvent(new CustomEvent("canvasResize",{composed:!0,detail:this.detail}))};customElements.get("e-canvas")||customElements.define("e-canvas",de);function xe(n){const r=n.match(/\{([\d-]+)\}/);if(r){const t=r[1].split("-");if(t.length===2){const i=parseInt(t[0],10),l=parseInt(t[1],10);return{start:i,end:l}}}return null}var f,q,V,w,C,I,z,X,v,x;class fe extends ee{constructor(t){super();s(this,f,[]);s(this,q,new j.CSSProperty(this,"--fit","contain"));s(this,V,new j.CSSProperty(this,"--autoplay",!1));s(this,w,new j.CSSProperty(this,"--offset-x",.5));s(this,C,new j.CSSProperty(this,"--offset-y",.5));s(this,I,null);s(this,z,0);s(this,X,1);s(this,v,()=>{if(e(this,f).length){const t=e(this,f)[0];e(this,q).current==="cover"?h(this,I,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):h(this,I,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,x,t=>{if(this.status.isFalse("loaded")||!e(this,I))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,f)[e(this,z)];i&&t.detail.context.drawImage(i,...e(this,I)),e(this,V).current&&h(this,z,(e(this,z)+1)%e(this,f).length)});he.isBrowser&&(h(this,X,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,q).subscribe(e(this,v)),e(this,w).subscribe(e(this,v)),e(this,C).subscribe(e(this,v)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,x))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,x))}))}setProgress(t){e(this,f).length&&h(this,z,Math.floor((e(this,f).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,V).observe(),e(this,q).observe(),e(this,w).observe(),e(this,C).observe(),Q.elementResizer.subscribe(this,e(this,v))}disconnectedCallback(){super.disconnectedCallback(),e(this,V).unobserve(),e(this,q).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),h(this,f,[]),Q.elementResizer.unsubscribe(e(this,v)),this.consumerElement.removeEventListener("canvasRender",e(this,x))}createConsumer(){return new de}consumeSource(t){return ce(this,null,function*(){var i,l,R,Y;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,x));const E=[],m=xe(t);if(m)for(let o=m.start;o<=m.end;o++){const ae=t.replace(/\{([^}]+)\}/,o.toString().padStart(e(this,X),"0")),G=new Image;G.src=ae,E.push(G)}else{const o=new Image;o.src=t,E.push(o)}try{yield Promise.all(E.map((o,ae)=>new Promise((G,ge)=>{o.onload=()=>{G()},o.onerror=Re=>{ge(`${o.src} Image not found`)}}))),h(this,f,E),e(this,v).call(this),(l=(i=this.consumerElement).onload)==null||l.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,x))}catch(o){console.error(o),(Y=(R=this.consumerElement).onerror)==null||Y.call(R,new Event("error"))}}})}}f=new WeakMap,q=new WeakMap,V=new WeakMap,w=new WeakMap,C=new WeakMap,I=new WeakMap,z=new WeakMap,X=new WeakMap,v=new WeakMap,x=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",fe);var A,$;class be extends ee{constructor(){super(...arguments);s(this,A,0);s(this,$,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,A)&&h(this,A,t),ie.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,A)}}),this.consumerElement.readyState===4&&B.ticker.unsubscribe(e(this,$))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{B.ticker.subscribe(e(this,$)),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(),B.ticker.unsubscribe(e(this,$)),h(this,A,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||""}}A=new WeakMap,$=new WeakMap;customElements.get("e-video")||customElements.define("e-video",be);exports.ImageElement=ue;exports.SequenceElement=fe;exports.SourceElement=ee;exports.VideoElement=be;
5
+ `,e(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const l=i.nodeValue||"",R=ye.kebabToCamel(i.name);R in e(this,a)&&(e(this,a)[R]=l||!0)}}),this.appendChild(e(this,a)),r(this,u,new Ee.SourceManager({srcset:t})),r(this,p,this.hasAttribute("lazy")),e(this,u).subscribe(i=>{(!e(this,p)||e(this,p)&&e(this,_))&&b(this,F,J).call(this,i.current)}),e(this,M).observe(this),e(this,u).connect())}disconnectedCallback(){e(this,M).disconnect(),e(this,u).close(),e(this,a).onloadeddata=null,e(this,a).onload=null,e(this,a).onerror=null,e(this,a).remove(),e(this,c).reset()}}u=new WeakMap,a=new WeakMap,S=new WeakMap,_=new WeakMap,p=new WeakMap,j=new WeakMap,k=new WeakMap,c=new WeakMap,M=new WeakMap,F=new WeakSet,J=function(t){if(e(this,a).onloadeddata=null,e(this,a).onload=null,e(this,a).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),t){r(this,k,`${e(this,j)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0);const l=i?t.url:t.name+t.extension;this.consumeSource(l),!e(this,p)&&!e(this,S)&&ie.loading.add(e(this,k)),e(this,a).onloadeddata=()=>{e(this,D).call(this)},e(this,a).onload=()=>{e(this,D).call(this)},e(this,a).onerror=()=>{e(this,ee).call(this,l)}}else this.consumeSource(null)},Z=new WeakMap,D=new WeakMap,ee=new WeakMap;class de extends te{createConsumer(){return document.createElement("img")}consumeSource(h){this.consumerElement.src=h||""}}customElements.get("e-image")||customElements.define("e-image",de);var y,g,H,L,P,T,K,N,d,re,pe,U,$,he,fe;class me extends HTMLElement{constructor(){super();s(this,d);s(this,y,new W.CSSProperty(this,"--fps",0));s(this,g,null);s(this,H,null);s(this,L,0);s(this,P,0);s(this,T,1);s(this,K,0);s(this,N,1);s(this,U,t=>{r(this,T,Ce.clamp(devicePixelRatio,1,2)),r(this,L,t.contentRect.width),r(this,P,t.contentRect.height),e(this,g).width=e(this,L)*this.pixelRatio,e(this,g).height=e(this,P)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),b(this,d,fe).call(this),b(this,d,he).call(this)});s(this,$,t=>{r(this,K,t.timestamp),r(this,N,t.timeBetweenFrames),b(this,d,he).call(this)});if(ae.isBrowser){const t=this.attachShadow({mode:"open"});t.adoptedStyleSheets.push(we.createStylesheet({" :host, canvas":{display:"block",width:"100%",height:"100%"}})),r(this,g,document.createElement("canvas")),r(this,H,e(this,g).getContext("2d")),t.appendChild(e(this,g)),e(this,y).subscribe(i=>{typeof i.previous!="undefined"&&i.current!==i.previous&&b(this,d,re).call(this)})}}get fpsCSSProperty(){return e(this,y)}get canvasElement(){return e(this,g)}get context(){return e(this,H)}get pixelRatio(){return e(this,T)}get width(){return e(this,L)}get height(){return e(this,P)}get detail(){return{width:e(this,L),height:e(this,P),element:this,canvasElement:e(this,g),pixelRatio:e(this,T),context:e(this,H),timestamp:e(this,K),timeBetweenFrames:e(this,N)}}connectedCallback(){e(this,y).observe(),Q.elementResizer.subscribe(this,e(this,U)),b(this,d,re).call(this)}disconnectedCallback(){e(this,y).unobserve(),Q.elementResizer.unsubscribe(e(this,U)),b(this,d,pe).call(this)}}y=new WeakMap,g=new WeakMap,H=new WeakMap,L=new WeakMap,P=new WeakMap,T=new WeakMap,K=new WeakMap,N=new WeakMap,d=new WeakSet,re=function(){B.ticker.unsubscribe(e(this,$)),this.hasAttribute("static")||B.ticker.subscribe(e(this,$),{culling:this,maxFPS:e(this,y).current})},pe=function(){B.ticker.unsubscribe(e(this,$))},U=new WeakMap,$=new WeakMap,he=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))},fe=function(){this.dispatchEvent(new CustomEvent("canvasResize",{composed:!0,detail:this.detail}))};customElements.get("e-canvas")||customElements.define("e-canvas",me);function Re(n){const h=n.match(/\{([\d-]+)\}/);if(h){const t=h[1].split("-");if(t.length===2){const i=parseInt(t[0],10),l=parseInt(t[1],10);return{start:i,end:l}}}return null}var f,q,O,w,C,I,z,X,v,x;class be extends te{constructor(t){super();s(this,f,[]);s(this,q,new W.CSSProperty(this,"--fit","contain"));s(this,O,new W.CSSProperty(this,"--autoplay",!1));s(this,w,new W.CSSProperty(this,"--offset-x",.5));s(this,C,new W.CSSProperty(this,"--offset-y",.5));s(this,I,null);s(this,z,0);s(this,X,1);s(this,v,()=>{if(e(this,f).length){const t=e(this,f)[0];e(this,q).current==="cover"?r(this,I,ue.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):r(this,I,ue.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,x,t=>{if(this.status.isFalse("loaded")||!e(this,I))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,f)[e(this,z)];i&&t.detail.context.drawImage(i,...e(this,I)),e(this,O).current&&r(this,z,(e(this,z)+1)%e(this,f).length)});ae.isBrowser&&(r(this,X,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,q).subscribe(e(this,v)),e(this,w).subscribe(e(this,v)),e(this,C).subscribe(e(this,v)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,x))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,x))}))}setProgress(t){e(this,f).length&&r(this,z,Math.floor((e(this,f).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,O).observe(),e(this,q).observe(),e(this,w).observe(),e(this,C).observe(),Q.elementResizer.subscribe(this,e(this,v))}disconnectedCallback(){super.disconnectedCallback(),e(this,O).unobserve(),e(this,q).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),r(this,f,[]),Q.elementResizer.unsubscribe(e(this,v)),this.consumerElement.removeEventListener("canvasRender",e(this,x))}createConsumer(){return new me}consumeSource(t){return le(this,null,function*(){var i,l,R,Y;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,x));const E=[],m=Re(t);if(m)for(let o=m.start;o<=m.end;o++){const oe=t.replace(/\{([^}]+)\}/,o.toString().padStart(e(this,X),"0")),G=new Image;G.src=oe,E.push(G)}else{const o=new Image;o.src=t,E.push(o)}try{yield Promise.all(E.map((o,oe)=>new Promise((G,ve)=>{o.onload=()=>{G()},o.onerror=ke=>{ve(`${o.src} Image not found`)}}))),r(this,f,E),e(this,v).call(this),(l=(i=this.consumerElement).onload)==null||l.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,x))}catch(o){console.error(o),(Y=(R=this.consumerElement).onerror)==null||Y.call(R,new Event("error"))}}})}}f=new WeakMap,q=new WeakMap,O=new WeakMap,w=new WeakMap,C=new WeakMap,I=new WeakMap,z=new WeakMap,X=new WeakMap,v=new WeakMap,x=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",be);var A,V;class ge extends te{constructor(){super(...arguments);s(this,A,0);s(this,V,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,A)&&r(this,A,t),ne.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,A)}}),this.consumerElement.readyState===4&&B.ticker.unsubscribe(e(this,V))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{B.ticker.subscribe(e(this,V)),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(),B.ticker.unsubscribe(e(this,V)),r(this,A,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||""}}A=new WeakMap,V=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ge);exports.ImageElement=de;exports.SequenceElement=be;exports.SourceElement=te;exports.VideoElement=ge;
@@ -1,9 +1,9 @@
1
- var oe = (r) => {
1
+ var ce = (r) => {
2
2
  throw TypeError(r);
3
3
  };
4
- var ee = (r, n, t) => n.has(r) || oe("Cannot " + t);
5
- var e = (r, n, t) => (ee(r, n, "read from private field"), t ? t.call(r) : n.get(r)), s = (r, n, t) => n.has(r) ? oe("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, t), h = (r, n, t, i) => (ee(r, n, "write to private field"), i ? i.call(r, t) : n.set(r, t), t), b = (r, n, t) => (ee(r, n, "access private method"), t);
6
- var ce = (r, n, t) => new Promise((i, l) => {
4
+ var te = (r, h, t) => h.has(r) || ce("Cannot " + t);
5
+ var e = (r, h, t) => (te(r, h, "read from private field"), t ? t.call(r) : h.get(r)), s = (r, h, t) => h.has(r) ? ce("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(r) : h.set(r, t), n = (r, h, t, i) => (te(r, h, "write to private field"), i ? i.call(r, t) : h.set(r, t), t), b = (r, h, t) => (te(r, h, "access private method"), t);
6
+ var le = (r, h, t) => new Promise((i, l) => {
7
7
  var L = (m) => {
8
8
  try {
9
9
  E(t.next(m));
@@ -17,23 +17,23 @@ var ce = (r, n, t) => new Promise((i, l) => {
17
17
  l(o);
18
18
  }
19
19
  }, E = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(L, G);
20
- E((t = t.apply(r, n)).next());
20
+ E((t = t.apply(r, h)).next());
21
21
  });
22
- import { SourceManager as pe } from "../source/index.js";
23
- import { ClassLinkedStatus as fe } from "../class-linked-status/index.js";
24
- import { i as ne } from "../browser-0zX67oeU.js";
25
- import { d as se } from "../events-CsVF98U6.js";
26
- import { k as be } from "../string-f0Dnk0L1.js";
27
- import { loading as te } from "../loading/index.js";
22
+ import { SourceManager as fe } from "../source/index.js";
23
+ import { ClassLinkedStatus as be } from "../class-linked-status/index.js";
24
+ import { i as he } from "../browser-0zX67oeU.js";
25
+ import { d as ie } from "../events-CsVF98U6.js";
26
+ import { k as ge } from "../string-f0Dnk0L1.js";
27
+ import { loading as se } from "../loading/index.js";
28
28
  import { CSSProperty as D } from "../css-property/index.js";
29
- import { elementResizer as U } from "../element-resizer/vanilla/index.js";
30
- import { c as ge, a as ve } from "../canvas-DeZ0SLUJ.js";
29
+ import { elementResizer as Z } from "../element-resizer/vanilla/index.js";
30
+ import { c as ve, a as Ee } from "../canvas-DeZ0SLUJ.js";
31
31
  import { ticker as F } from "../ticker/vanilla/index.js";
32
- import { c as Ee } from "../jss-CjccJC-K.js";
33
- import { c as we } from "../math-BOBiC4TN.js";
34
- let Se = 0;
35
- var u, a, w, H, p, R, c, M, T, Q, Z, K, _;
36
- class he extends HTMLElement {
32
+ import { c as we } from "../jss-CjccJC-K.js";
33
+ import { c as Se } from "../math-BOBiC4TN.js";
34
+ let Ce = 0;
35
+ var u, a, w, H, p, K, R, c, M, T, Q, _, N, ee;
36
+ class ae extends HTMLElement {
37
37
  constructor() {
38
38
  super();
39
39
  s(this, T);
@@ -42,25 +42,26 @@ class he extends HTMLElement {
42
42
  s(this, w, !1);
43
43
  s(this, H, !1);
44
44
  s(this, p, !1);
45
+ s(this, K, "");
45
46
  s(this, R, "");
46
- s(this, c, new fe(this, {
47
+ s(this, c, new be(this, {
47
48
  loading: !1,
48
49
  loaded: !1,
49
50
  error: !1
50
51
  }));
51
52
  s(this, M, null);
52
- s(this, Z, (t) => {
53
+ s(this, _, (t) => {
53
54
  const i = t[0];
54
- e(this, p) && (!e(this, H) || this.hasAttribute("reload-source")) && i.isIntersecting && (e(this, u).current && e(this, u).current !== e(this, u).previous && b(this, T, Q).call(this, e(this, u).current), h(this, H, !0)), i.isIntersecting ? se(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && b(this, T, Q).call(this, void 0), se(this, "sourceRelease", { custom: !0 }));
55
+ e(this, p) && (!e(this, H) || this.hasAttribute("reload-source")) && i.isIntersecting && (e(this, u).current && e(this, u).current !== e(this, u).previous && b(this, T, Q).call(this, e(this, u).current), n(this, H, !0)), i.isIntersecting ? ie(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && b(this, T, Q).call(this, void 0), ie(this, "sourceRelease", { custom: !0 }));
55
56
  });
56
- s(this, K, () => {
57
- e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, p) && !e(this, w) && te.complete(e(this, R)), h(this, w, !0);
57
+ s(this, N, () => {
58
+ e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, p) && !e(this, w) && se.complete(e(this, R)), n(this, w, !0);
58
59
  });
59
- s(this, _, (t) => {
60
- e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, p) && !e(this, w) && te.error(e(this, R)), h(this, w, !0);
60
+ s(this, ee, (t) => {
61
+ e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, p) && !e(this, w) && se.error(e(this, R)), n(this, w, !0);
61
62
  });
62
- ne && window.IntersectionObserver && (h(this, R, `source-consumer-${++Se}`), h(this, M, new IntersectionObserver(
63
- e(this, Z)
63
+ he && window.IntersectionObserver && (n(this, K, `source-consumer-${++Ce}`), n(this, M, new IntersectionObserver(
64
+ e(this, _)
64
65
  )));
65
66
  }
66
67
  get consumerElement() {
@@ -77,18 +78,18 @@ class he extends HTMLElement {
77
78
  }
78
79
  connectedCallback() {
79
80
  const t = this.getAttribute("srcset");
80
- t && (h(this, a, this.createConsumer()), e(this, a).style.cssText = `
81
+ t && (n(this, a, this.createConsumer()), e(this, a).style.cssText = `
81
82
  display: block;
82
83
  width: 100%;
83
84
  height: 100%;
84
85
  `, e(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((i) => {
85
86
  if (i.name !== "srcset") {
86
- const l = i.nodeValue || "", L = be(i.name);
87
+ const l = i.nodeValue || "", L = ge(i.name);
87
88
  L in e(this, a) && (e(this, a)[L] = l || !0);
88
89
  }
89
- }), this.appendChild(e(this, a)), h(this, u, new pe({
90
+ }), this.appendChild(e(this, a)), n(this, u, new fe({
90
91
  srcset: t
91
- })), h(this, p, this.hasAttribute("lazy")), e(this, u).subscribe((i) => {
92
+ })), n(this, p, this.hasAttribute("lazy")), e(this, u).subscribe((i) => {
92
93
  (!e(this, p) || e(this, p) && e(this, H)) && b(this, T, Q).call(this, i.current);
93
94
  }), e(this, M).observe(this), e(this, u).connect());
94
95
  }
@@ -96,61 +97,62 @@ class he extends HTMLElement {
96
97
  e(this, M).disconnect(), e(this, u).close(), e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, a).remove(), e(this, c).reset();
97
98
  }
98
99
  }
99
- u = new WeakMap(), a = new WeakMap(), w = new WeakMap(), H = new WeakMap(), p = new WeakMap(), R = new WeakMap(), c = new WeakMap(), M = new WeakMap(), T = new WeakSet(), Q = function(t) {
100
+ u = new WeakMap(), a = new WeakMap(), w = new WeakMap(), H = new WeakMap(), p = new WeakMap(), K = new WeakMap(), R = new WeakMap(), c = new WeakMap(), M = new WeakMap(), T = new WeakSet(), Q = function(t) {
100
101
  if (e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, c).set("loaded", !1), e(this, c).set("error", !1), e(this, c).set("loading", !1), t) {
102
+ n(this, R, `${e(this, K)}-${t.url}`);
101
103
  const i = this.hasAttribute("keep-source-parameters");
102
104
  e(this, c).set("loading", !0);
103
105
  const l = i ? t.url : t.name + t.extension;
104
- this.consumeSource(l), !e(this, p) && !e(this, w) && te.add(e(this, R)), e(this, a).onloadeddata = () => {
105
- e(this, K).call(this);
106
+ this.consumeSource(l), !e(this, p) && !e(this, w) && se.add(e(this, R)), e(this, a).onloadeddata = () => {
107
+ e(this, N).call(this);
106
108
  }, e(this, a).onload = () => {
107
- e(this, K).call(this);
109
+ e(this, N).call(this);
108
110
  }, e(this, a).onerror = () => {
109
- e(this, _).call(this, l);
111
+ e(this, ee).call(this, l);
110
112
  };
111
113
  } else
112
114
  this.consumeSource(null);
113
- }, Z = new WeakMap(), K = new WeakMap(), _ = new WeakMap();
114
- class Ce extends he {
115
+ }, _ = new WeakMap(), N = new WeakMap(), ee = new WeakMap();
116
+ class ye extends ae {
115
117
  createConsumer() {
116
118
  return document.createElement("img");
117
119
  }
118
- consumeSource(n) {
119
- this.consumerElement.src = n || "";
120
+ consumeSource(h) {
121
+ this.consumerElement.src = h || "";
120
122
  }
121
123
  }
122
- customElements.get("e-image") || customElements.define("e-image", Ce);
123
- var S, g, q, k, I, O, N, X, d, ie, ue, Y, $, re, de;
124
- class le extends HTMLElement {
124
+ customElements.get("e-image") || customElements.define("e-image", ye);
125
+ var S, g, $, k, I, q, U, X, d, re, de, Y, O, ne, me;
126
+ class ue extends HTMLElement {
125
127
  constructor() {
126
128
  super();
127
129
  s(this, d);
128
130
  s(this, S, new D(this, "--fps", 0));
129
131
  s(this, g, null);
130
- s(this, q, null);
132
+ s(this, $, null);
131
133
  s(this, k, 0);
132
134
  s(this, I, 0);
133
- s(this, O, 1);
134
- s(this, N, 0);
135
+ s(this, q, 1);
136
+ s(this, U, 0);
135
137
  s(this, X, 1);
136
138
  s(this, Y, (t) => {
137
- h(this, O, we(devicePixelRatio, 1, 2)), h(this, k, t.contentRect.width), h(this, I, t.contentRect.height), e(this, g).width = e(this, k) * this.pixelRatio, e(this, g).height = e(this, I) * this.pixelRatio, this.context.scale(this.pixelRatio, this.pixelRatio), b(this, d, de).call(this), b(this, d, re).call(this);
139
+ n(this, q, Se(devicePixelRatio, 1, 2)), n(this, k, t.contentRect.width), n(this, I, t.contentRect.height), e(this, g).width = e(this, k) * this.pixelRatio, e(this, g).height = e(this, I) * this.pixelRatio, this.context.scale(this.pixelRatio, this.pixelRatio), b(this, d, me).call(this), b(this, d, ne).call(this);
138
140
  });
139
- s(this, $, (t) => {
140
- h(this, N, t.timestamp), h(this, X, t.timeBetweenFrames), b(this, d, re).call(this);
141
+ s(this, O, (t) => {
142
+ n(this, U, t.timestamp), n(this, X, t.timeBetweenFrames), b(this, d, ne).call(this);
141
143
  });
142
- if (ne) {
144
+ if (he) {
143
145
  const t = this.attachShadow({ mode: "open" });
144
146
  t.adoptedStyleSheets.push(
145
- Ee({
147
+ we({
146
148
  " :host, canvas": {
147
149
  display: "block",
148
150
  width: "100%",
149
151
  height: "100%"
150
152
  }
151
153
  })
152
- ), h(this, g, document.createElement("canvas")), h(this, q, e(this, g).getContext("2d")), t.appendChild(e(this, g)), e(this, S).subscribe((i) => {
153
- typeof i.previous != "undefined" && i.current !== i.previous && b(this, d, ie).call(this);
154
+ ), n(this, g, document.createElement("canvas")), n(this, $, e(this, g).getContext("2d")), t.appendChild(e(this, g)), e(this, S).subscribe((i) => {
155
+ typeof i.previous != "undefined" && i.current !== i.previous && b(this, d, re).call(this);
154
156
  });
155
157
  }
156
158
  }
@@ -161,10 +163,10 @@ class le extends HTMLElement {
161
163
  return e(this, g);
162
164
  }
163
165
  get context() {
164
- return e(this, q);
166
+ return e(this, $);
165
167
  }
166
168
  get pixelRatio() {
167
- return e(this, O);
169
+ return e(this, q);
168
170
  }
169
171
  get width() {
170
172
  return e(this, k);
@@ -178,34 +180,34 @@ class le extends HTMLElement {
178
180
  height: e(this, I),
179
181
  element: this,
180
182
  canvasElement: e(this, g),
181
- pixelRatio: e(this, O),
182
- context: e(this, q),
183
- timestamp: e(this, N),
183
+ pixelRatio: e(this, q),
184
+ context: e(this, $),
185
+ timestamp: e(this, U),
184
186
  timeBetweenFrames: e(this, X)
185
187
  };
186
188
  }
187
189
  connectedCallback() {
188
- e(this, S).observe(), U.subscribe(this, e(this, Y)), b(this, d, ie).call(this);
190
+ e(this, S).observe(), Z.subscribe(this, e(this, Y)), b(this, d, re).call(this);
189
191
  }
190
192
  disconnectedCallback() {
191
- e(this, S).unobserve(), U.unsubscribe(e(this, Y)), b(this, d, ue).call(this);
193
+ e(this, S).unobserve(), Z.unsubscribe(e(this, Y)), b(this, d, de).call(this);
192
194
  }
193
195
  }
194
- S = new WeakMap(), g = new WeakMap(), q = new WeakMap(), k = new WeakMap(), I = new WeakMap(), O = new WeakMap(), N = new WeakMap(), X = new WeakMap(), d = new WeakSet(), ie = function() {
195
- F.unsubscribe(e(this, $)), this.hasAttribute("static") || F.subscribe(e(this, $), {
196
+ S = new WeakMap(), g = new WeakMap(), $ = new WeakMap(), k = new WeakMap(), I = new WeakMap(), q = new WeakMap(), U = new WeakMap(), X = new WeakMap(), d = new WeakSet(), re = function() {
197
+ F.unsubscribe(e(this, O)), this.hasAttribute("static") || F.subscribe(e(this, O), {
196
198
  culling: this,
197
199
  maxFPS: e(this, S).current
198
200
  });
199
- }, ue = function() {
200
- F.unsubscribe(e(this, $));
201
- }, Y = new WeakMap(), $ = new WeakMap(), re = function() {
201
+ }, de = function() {
202
+ F.unsubscribe(e(this, O));
203
+ }, Y = new WeakMap(), O = new WeakMap(), ne = function() {
202
204
  this.dispatchEvent(
203
205
  new CustomEvent("canvasRender", {
204
206
  composed: !0,
205
207
  detail: this.detail
206
208
  })
207
209
  );
208
- }, de = function() {
210
+ }, me = function() {
209
211
  this.dispatchEvent(
210
212
  new CustomEvent("canvasResize", {
211
213
  composed: !0,
@@ -213,11 +215,11 @@ S = new WeakMap(), g = new WeakMap(), q = new WeakMap(), k = new WeakMap(), I =
213
215
  })
214
216
  );
215
217
  };
216
- customElements.get("e-canvas") || customElements.define("e-canvas", le);
217
- function ye(r) {
218
- const n = r.match(/\{([\d-]+)\}/);
219
- if (n) {
220
- const t = n[1].split("-");
218
+ customElements.get("e-canvas") || customElements.define("e-canvas", ue);
219
+ function xe(r) {
220
+ const h = r.match(/\{([\d-]+)\}/);
221
+ if (h) {
222
+ const t = h[1].split("-");
221
223
  if (t.length === 2) {
222
224
  const i = parseInt(t[0], 10), l = parseInt(t[1], 10);
223
225
  return { start: i, end: l };
@@ -225,8 +227,8 @@ function ye(r) {
225
227
  }
226
228
  return null;
227
229
  }
228
- var f, P, V, C, y, A, z, j, v, x;
229
- class xe extends he {
230
+ var f, P, W, C, y, A, z, j, v, x;
231
+ class Le extends ae {
230
232
  constructor(t) {
231
233
  super();
232
234
  s(this, f, []);
@@ -235,7 +237,7 @@ class xe extends he {
235
237
  "--fit",
236
238
  "contain"
237
239
  ));
238
- s(this, V, new D(this, "--autoplay", !1));
240
+ s(this, W, new D(this, "--autoplay", !1));
239
241
  s(this, C, new D(this, "--offset-x", 0.5));
240
242
  s(this, y, new D(this, "--offset-y", 0.5));
241
243
  s(this, A, null);
@@ -244,14 +246,14 @@ class xe extends he {
244
246
  s(this, v, () => {
245
247
  if (e(this, f).length) {
246
248
  const t = e(this, f)[0];
247
- e(this, P).current === "cover" ? h(this, A, ge(
249
+ e(this, P).current === "cover" ? n(this, A, ve(
248
250
  t.naturalWidth,
249
251
  t.naturalHeight,
250
252
  this.consumerElement.width,
251
253
  this.consumerElement.height,
252
254
  e(this, C).current,
253
255
  e(this, y).current
254
- )) : h(this, A, ve(
256
+ )) : n(this, A, Ee(
255
257
  t.naturalWidth,
256
258
  t.naturalHeight,
257
259
  this.consumerElement.width,
@@ -266,9 +268,9 @@ class xe extends he {
266
268
  return;
267
269
  t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
268
270
  const i = e(this, f)[e(this, z)];
269
- i && t.detail.context.drawImage(i, ...e(this, A)), e(this, V).current && h(this, z, (e(this, z) + 1) % e(this, f).length);
271
+ i && t.detail.context.drawImage(i, ...e(this, A)), e(this, W).current && n(this, z, (e(this, z) + 1) % e(this, f).length);
270
272
  });
271
- ne && (h(this, j, parseInt(
273
+ he && (n(this, j, parseInt(
272
274
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
273
275
  )), e(this, P).subscribe(e(this, v)), e(this, C).subscribe(e(this, v)), e(this, y).subscribe(e(this, v)), this.addEventListener("sourceCapture", (i) => {
274
276
  this.consumerElement.addEventListener(
@@ -283,36 +285,36 @@ class xe extends he {
283
285
  }));
284
286
  }
285
287
  setProgress(t) {
286
- e(this, f).length && h(this, z, Math.floor((e(this, f).length - 1) * t));
288
+ e(this, f).length && n(this, z, Math.floor((e(this, f).length - 1) * t));
287
289
  }
288
290
  connectedCallback() {
289
- super.connectedCallback(), e(this, V).observe(), e(this, P).observe(), e(this, C).observe(), e(this, y).observe(), U.subscribe(this, e(this, v));
291
+ super.connectedCallback(), e(this, W).observe(), e(this, P).observe(), e(this, C).observe(), e(this, y).observe(), Z.subscribe(this, e(this, v));
290
292
  }
291
293
  disconnectedCallback() {
292
- super.disconnectedCallback(), e(this, V).unobserve(), e(this, P).unobserve(), e(this, C).unobserve(), e(this, y).unobserve(), h(this, f, []), U.unsubscribe(e(this, v)), this.consumerElement.removeEventListener(
294
+ super.disconnectedCallback(), e(this, W).unobserve(), e(this, P).unobserve(), e(this, C).unobserve(), e(this, y).unobserve(), n(this, f, []), Z.unsubscribe(e(this, v)), this.consumerElement.removeEventListener(
293
295
  "canvasRender",
294
296
  e(this, x)
295
297
  );
296
298
  }
297
299
  createConsumer() {
298
- return new le();
300
+ return new ue();
299
301
  }
300
302
  consumeSource(t) {
301
- return ce(this, null, function* () {
303
+ return le(this, null, function* () {
302
304
  var i, l, L, G;
303
305
  if (t) {
304
306
  this.consumerElement.removeEventListener(
305
307
  "canvasRender",
306
308
  e(this, x)
307
309
  );
308
- const E = [], m = ye(t);
310
+ const E = [], m = xe(t);
309
311
  if (m)
310
312
  for (let o = m.start; o <= m.end; o++) {
311
- const ae = t.replace(
313
+ const oe = t.replace(
312
314
  /\{([^}]+)\}/,
313
315
  o.toString().padStart(e(this, j), "0")
314
316
  ), J = new Image();
315
- J.src = ae, E.push(J);
317
+ J.src = oe, E.push(J);
316
318
  }
317
319
  else {
318
320
  const o = new Image();
@@ -320,14 +322,14 @@ class xe extends he {
320
322
  }
321
323
  try {
322
324
  yield Promise.all(
323
- E.map((o, ae) => new Promise((J, me) => {
325
+ E.map((o, oe) => new Promise((J, pe) => {
324
326
  o.onload = () => {
325
327
  J();
326
- }, o.onerror = (Re) => {
327
- me(`${o.src} Image not found`);
328
+ }, o.onerror = (ke) => {
329
+ pe(`${o.src} Image not found`);
328
330
  };
329
331
  }))
330
- ), h(this, f, E), e(this, v).call(this), (l = (i = this.consumerElement).onload) == null || l.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
332
+ ), n(this, f, E), e(this, v).call(this), (l = (i = this.consumerElement).onload) == null || l.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
331
333
  "canvasRender",
332
334
  e(this, x)
333
335
  );
@@ -338,27 +340,27 @@ class xe extends he {
338
340
  });
339
341
  }
340
342
  }
341
- f = new WeakMap(), P = new WeakMap(), V = new WeakMap(), C = new WeakMap(), y = new WeakMap(), A = new WeakMap(), z = new WeakMap(), j = new WeakMap(), v = new WeakMap(), x = new WeakMap();
342
- customElements.get("e-sequence") || customElements.define("e-sequence", xe);
343
- var B, W;
344
- class Le extends he {
343
+ f = new WeakMap(), P = new WeakMap(), W = new WeakMap(), C = new WeakMap(), y = new WeakMap(), A = new WeakMap(), z = new WeakMap(), j = new WeakMap(), v = new WeakMap(), x = new WeakMap();
344
+ customElements.get("e-sequence") || customElements.define("e-sequence", Le);
345
+ var B, V;
346
+ class Re extends ae {
345
347
  constructor() {
346
348
  super(...arguments);
347
349
  s(this, B, 0);
348
- s(this, W, () => {
350
+ s(this, V, () => {
349
351
  this.classList.add(`state-${this.consumerElement.readyState}`);
350
352
  const t = this.consumerElement.readyState / 4;
351
- t > e(this, B) && h(this, B, t), se(this, "videoReadyStateChange", {
353
+ t > e(this, B) && n(this, B, t), ie(this, "videoReadyStateChange", {
352
354
  detail: {
353
355
  readyState: this.consumerElement.readyState,
354
356
  progress: e(this, B)
355
357
  }
356
- }), this.consumerElement.readyState === 4 && F.unsubscribe(e(this, W));
358
+ }), this.consumerElement.readyState === 4 && F.unsubscribe(e(this, V));
357
359
  });
358
360
  }
359
361
  connectedCallback() {
360
362
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
361
- F.subscribe(e(this, W)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
363
+ F.subscribe(e(this, V)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
362
364
  }), this.addEventListener("sourceRelease", () => {
363
365
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
364
366
  "state-0",
@@ -370,7 +372,7 @@ class Le extends he {
370
372
  });
371
373
  }
372
374
  disconnectedCallback() {
373
- super.disconnectedCallback(), F.unsubscribe(e(this, W)), h(this, B, 0);
375
+ super.disconnectedCallback(), F.unsubscribe(e(this, V)), n(this, B, 0);
374
376
  }
375
377
  createConsumer() {
376
378
  return document.createElement("video");
@@ -379,11 +381,11 @@ class Le extends he {
379
381
  this.consumerElement.src = t || "";
380
382
  }
381
383
  }
382
- B = new WeakMap(), W = new WeakMap();
383
- customElements.get("e-video") || customElements.define("e-video", Le);
384
+ B = new WeakMap(), V = new WeakMap();
385
+ customElements.get("e-video") || customElements.define("e-video", Re);
384
386
  export {
385
- Ce as ImageElement,
386
- xe as SequenceElement,
387
- he as SourceElement,
388
- Le as VideoElement
387
+ ye as ImageElement,
388
+ Le as SequenceElement,
389
+ ae as SourceElement,
390
+ Re as VideoElement
389
391
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.29.2",
3
+ "version": "0.29.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"