aptechka 0.39.5 → 0.39.7

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 m=Object.defineProperty,f=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var c=e=>{throw TypeError(e)};var a=(e,s,t)=>s in e?m(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,l=(e,s)=>{for(var t in s||(s={}))T.call(s,t)&&a(e,t,s[t]);if(u)for(var t of u(s))g.call(s,t)&&a(e,t,s[t]);return e},o=(e,s)=>f(e,L(s));var h=(e,s,t)=>s.has(e)||c("Cannot "+t);var n=(e,s,t)=>(h(e,s,"read from private field"),t?t.call(e):s.get(e)),d=(e,s,t)=>s.has(e)?c("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),b=(e,s,t,r)=>(h(e,s,"write to private field"),r?r.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../Store-CDb6RMce.cjs"),S=require("../string-DhgS_iFl.cjs");var i;class q extends p.Store{constructor(t,r){super(r);d(this,i);b(this,i,t)}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,r=!0){this.current=o(l({},this.current),{[t]:r}),r?n(this,i).classList.add(S.camelToKebab(t)):n(this,i).classList.remove(S.camelToKebab(t))}}i=new WeakMap;exports.ClassLinkedStatus=q;
1
+ "use strict";var S=Object.defineProperty,p=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var h=s=>{throw TypeError(s)};var o=(s,e,t)=>e in s?S(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,l=(s,e)=>{for(var t in e||(e={}))L.call(e,t)&&o(s,t,e[t]);if(c)for(var t of c(e))T.call(e,t)&&o(s,t,e[t]);return s},d=(s,e)=>p(s,E(e));var f=(s,e,t)=>e.has(s)||h("Cannot "+t);var a=(s,e,t)=>(f(s,e,"read from private field"),t?t.call(s):e.get(s)),b=(s,e,t)=>e.has(s)?h("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),u=(s,e,t,r)=>(f(s,e,"write to private field"),r?r.call(s,t):e.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../Store-CDb6RMce.cjs"),m=require("../string-DhgS_iFl.cjs");var i;class y extends g.Store{constructor(t,r){super(r);b(this,i);u(this,i,Array.isArray(t)?t:[t])}addElement(t){a(this,i).push(t)}removeElement(t){u(this,i,a(this,i).filter(r=>r!==t))}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,r=!0){this.current=d(l({},this.current),{[t]:r}),r?a(this,i).forEach(n=>n.classList.add(m.camelToKebab(t))):a(this,i).forEach(n=>n.classList.remove(m.camelToKebab(t)))}}i=new WeakMap;exports.ClassLinkedStatus=y;
@@ -4,7 +4,9 @@ export declare class ClassLinkedStatus<T extends {
4
4
  [key in string]: boolean;
5
5
  }> extends Store<T> {
6
6
  #private;
7
- constructor(element: HTMLElement, value: T);
7
+ constructor(element: HTMLElement | Array<HTMLElement>, value: T);
8
+ addElement(element: HTMLElement): void;
9
+ removeElement(element: HTMLElement): void;
8
10
  isTrue(key: keyof T): boolean;
9
11
  isFalse(key: keyof T): boolean;
10
12
  reset(): void;
@@ -1,28 +1,34 @@
1
- var d = Object.defineProperty, L = Object.defineProperties;
1
+ var E = Object.defineProperty, L = Object.defineProperties;
2
2
  var S = Object.getOwnPropertyDescriptors;
3
- var a = Object.getOwnPropertySymbols;
3
+ var c = Object.getOwnPropertySymbols;
4
4
  var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var o = (t) => {
5
+ var u = (t) => {
6
6
  throw TypeError(t);
7
7
  };
8
- var c = (t, e, s) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, u = (t, e) => {
9
- for (var s in e || (e = {}))
10
- b.call(e, s) && c(t, s, e[s]);
11
- if (a)
12
- for (var s of a(e))
13
- x.call(e, s) && c(t, s, e[s]);
8
+ var n = (t, r, s) => r in t ? E(t, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[r] = s, l = (t, r) => {
9
+ for (var s in r || (r = {}))
10
+ b.call(r, s) && n(t, s, r[s]);
11
+ if (c)
12
+ for (var s of c(r))
13
+ x.call(r, s) && n(t, s, r[s]);
14
14
  return t;
15
- }, h = (t, e) => L(t, S(e));
16
- var l = (t, e, s) => e.has(t) || o("Cannot " + s);
17
- var n = (t, e, s) => (l(t, e, "read from private field"), s ? s.call(t) : e.get(t)), m = (t, e, s) => e.has(t) ? o("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), f = (t, e, s, r) => (l(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
18
- import { S as T } from "../Store-OTdcl6SX.js";
15
+ }, f = (t, r) => L(t, S(r));
16
+ var m = (t, r, s) => r.has(t) || u("Cannot " + s);
17
+ var a = (t, r, s) => (m(t, r, "read from private field"), s ? s.call(t) : r.get(t)), d = (t, r, s) => r.has(t) ? u("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, s), o = (t, r, s, e) => (m(t, r, "write to private field"), e ? e.call(t, s) : r.set(t, s), s);
18
+ import { S as A } from "../Store-OTdcl6SX.js";
19
19
  import { c as p } from "../string-f0Dnk0L1.js";
20
20
  var i;
21
- class g extends T {
22
- constructor(s, r) {
23
- super(r);
24
- m(this, i);
25
- f(this, i, s);
21
+ class C extends A {
22
+ constructor(s, e) {
23
+ super(e);
24
+ d(this, i);
25
+ o(this, i, Array.isArray(s) ? s : [s]);
26
+ }
27
+ addElement(s) {
28
+ a(this, i).push(s);
29
+ }
30
+ removeElement(s) {
31
+ o(this, i, a(this, i).filter((e) => e !== s));
26
32
  }
27
33
  isTrue(s) {
28
34
  return this.current[s] === !0;
@@ -35,11 +41,15 @@ class g extends T {
35
41
  for (const s in this.initial)
36
42
  this.set(s, this.initial[s]);
37
43
  }
38
- set(s, r = !0) {
39
- this.current = h(u({}, this.current), { [s]: r }), r ? n(this, i).classList.add(p(s)) : n(this, i).classList.remove(p(s));
44
+ set(s, e = !0) {
45
+ this.current = f(l({}, this.current), { [s]: e }), e ? a(this, i).forEach(
46
+ (h) => h.classList.add(p(s))
47
+ ) : a(this, i).forEach(
48
+ (h) => h.classList.remove(p(s))
49
+ );
40
50
  }
41
51
  }
42
52
  i = new WeakMap();
43
53
  export {
44
- g as ClassLinkedStatus
54
+ C as ClassLinkedStatus
45
55
  };
@@ -1,5 +1,5 @@
1
- "use strict";var he=a=>{throw TypeError(a)};var ie=(a,n,t)=>n.has(a)||he("Cannot "+t);var e=(a,n,t)=>(ie(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(ie(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),x=(a,n,t)=>(ie(a,n,"access private method"),t);var ce=(a,n,t)=>new Promise((i,c)=>{var y=m=>{try{g(t.next(m))}catch(l){c(l)}},j=m=>{try{g(t.throw(m))}catch(l){c(l)}},g=m=>m.done?i(m.value):Promise.resolve(m.value).then(y,j);g((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("../device/index.cjs"),Ee=require("../source/index.cjs"),ve=require("../class-linked-status/index.cjs"),de=require("../browser-CpzFX2xg.cjs"),G=require("../events-KVanG9sR.cjs"),me=require("../string-DhgS_iFl.cjs"),re=require("../loading/index.cjs"),K=require("../css-property/index.cjs"),ue=require("../element-resizer/vanilla/index.cjs"),le=require("../canvas-CU5Xjahf.cjs"),Se=require("../canvas/index.cjs"),ne=require("../ticker/vanilla/index.cjs");let we=0;var d,o,E,_,f,$,R,h,q,V,v,z,X,Q,H,Z;class N extends HTMLElement{constructor(){super();s(this,z);s(this,d,null);s(this,o,null);s(this,E,!1);s(this,_,!1);s(this,f,!1);s(this,$,"");s(this,R,"");s(this,h,new ve.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,V);s(this,v,null);s(this,Q,t=>{const i=t[0];e(this,f)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?G.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&x(this,z,X).call(this,void 0),G.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,H,()=>{e(this,h).set("loaded",!0),e(this,h).set("error",!1),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&re.loading.complete(e(this,R));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,V,setTimeout(()=>{e(this,h).set("clear",!0)},parseFloat(t)*1e3)):e(this,h).set("clear",!0),r(this,E,!0)});s(this,Z,t=>{e(this,h).set("loaded",!1),e(this,h).set("error",!0),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&re.loading.error(e(this,R)),r(this,E,!0)});de.isBrowser&&window.IntersectionObserver&&(r(this,$,`source-consumer-${++we}`),r(this,q,new IntersectionObserver(e(this,Q))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,d)}get status(){return e(this,h)}get isLazy(){return e(this,f)}get currentURL(){return e(this,v)}triggerLazyLoad(){e(this,d).current&&e(this,d).current!==e(this,d).previous&&x(this,z,X).call(this,e(this,d).current),r(this,_,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(r(this,o,this.createConsumer()),e(this,o).style.cssText=`
1
+ "use strict";var he=a=>{throw TypeError(a)};var ie=(a,n,t)=>n.has(a)||he("Cannot "+t);var e=(a,n,t)=>(ie(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(ie(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),T=(a,n,t)=>(ie(a,n,"access private method"),t);var ce=(a,n,t)=>new Promise((i,o)=>{var y=m=>{try{g(t.next(m))}catch(l){o(l)}},R=m=>{try{g(t.throw(m))}catch(l){o(l)}},g=m=>m.done?i(m.value):Promise.resolve(m.value).then(y,R);g((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("../device/index.cjs"),Ee=require("../source/index.cjs"),ve=require("../class-linked-status/index.cjs"),de=require("../browser-CpzFX2xg.cjs"),G=require("../events-KVanG9sR.cjs"),me=require("../string-DhgS_iFl.cjs"),re=require("../loading/index.cjs"),K=require("../css-property/index.cjs"),ue=require("../element-resizer/vanilla/index.cjs"),le=require("../canvas-CU5Xjahf.cjs"),Se=require("../canvas/index.cjs"),ne=require("../ticker/vanilla/index.cjs");let we=0;var d,h,E,q,f,H,I,c,V,z,v,U,X,Q,O,Z;class j extends HTMLElement{constructor(){super();s(this,U);s(this,d,null);s(this,h,null);s(this,E,!1);s(this,q,!1);s(this,f,!1);s(this,H,"");s(this,I,"");s(this,c,new ve.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,V,null);s(this,z);s(this,v,null);s(this,Q,t=>{const i=t[0];e(this,f)&&(!e(this,q)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?G.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&T(this,U,X).call(this,void 0),G.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,O,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,f)&&!e(this,E)&&re.loading.complete(e(this,I));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,z,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,E,!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,f)&&!e(this,E)&&re.loading.error(e(this,I)),r(this,E,!0)});de.isBrowser&&window.IntersectionObserver&&(r(this,H,`source-consumer-${++we}`),r(this,V,new IntersectionObserver(e(this,Q))))}get consumerElement(){return e(this,h)}get sourceManager(){return e(this,d)}get status(){return e(this,c)}get isLazy(){return e(this,f)}get currentURL(){return e(this,v)}triggerLazyLoad(){e(this,d).current&&e(this,d).current!==e(this,d).previous&&T(this,U,X).call(this,e(this,d).current),r(this,q,!0)}connectedCallback(){const t=this.getAttribute("srcset");if(!t)return;const i=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;i&&e(this,c).addElement(i),r(this,h,this.createConsumer()),e(this,h).style.cssText=`
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const c=i.nodeValue||"",y=me.kebabToCamel(i.name);y in e(this,o)&&(e(this,o)[y]=c||!0)}}),this.appendChild(e(this,o)),r(this,d,new Ee.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(i=>{(!e(this,f)||e(this,f)&&e(this,_))&&x(this,z,X).call(this,i.current)}),e(this,q).observe(this),e(this,d).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,d).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,h).reset(),clearTimeout(e(this,V))}}d=new WeakMap,o=new WeakMap,E=new WeakMap,_=new WeakMap,f=new WeakMap,$=new WeakMap,R=new WeakMap,h=new WeakMap,q=new WeakMap,V=new WeakMap,v=new WeakMap,z=new WeakSet,X=function(t){if(clearTimeout(e(this,V)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,h).set("loaded",!1),e(this,h).set("error",!1),e(this,h).set("loading",!1),e(this,h).set("clear",!1),t){r(this,R,`${e(this,$)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,h).set("loading",!0),r(this,v,i?t.url:t.name+t.extension),this.consumeSource(e(this,v)),!e(this,f)&&!e(this,E)&&re.loading.add(e(this,R)),e(this,o).onloadeddata=()=>{e(this,H).call(this)},e(this,o).onload=()=>{e(this,H).call(this)},e(this,o).onerror=()=>{e(this,Z).call(this,e(this,v))}}else r(this,v,null),this.consumeSource(null)},Q=new WeakMap,H=new WeakMap,Z=new WeakMap;class fe extends N{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&ge.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",fe);function Le(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),c=parseInt(t[1],10);return{start:i,end:c}}}return null}var p,I,U,S,w,A,P,O,b,L;class pe extends N{constructor(t){super();s(this,p,[]);s(this,I,new K.CSSProperty(this,"--fit","contain"));s(this,U,new K.CSSProperty(this,"--autoplay",!1));s(this,S,new K.CSSProperty(this,"--offset-x",.5));s(this,w,new K.CSSProperty(this,"--offset-y",.5));s(this,A,null);s(this,P,0);s(this,O,1);s(this,b,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,I).current==="cover"?r(this,A,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current)):r(this,A,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current))}});s(this,L,t=>{if(this.status.isFalse("loaded")||!e(this,A))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,P)];i&&t.detail.context.drawImage(i,...e(this,A)),e(this,U).current&&r(this,P,(e(this,P)+1)%e(this,p).length)});de.isBrowser&&(r(this,O,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,I).subscribe(e(this,b)),e(this,S).subscribe(e(this,b)),e(this,w).subscribe(e(this,b)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,L))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,L))}))}setProgress(t){e(this,p).length&&r(this,P,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,U).observe(),e(this,I).observe(),e(this,S).observe(),e(this,w).observe(),ue.elementResizer.subscribe(this,e(this,b))}disconnectedCallback(){super.disconnectedCallback(),e(this,U).unobserve(),e(this,I).unobserve(),e(this,S).unobserve(),e(this,w).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,b)),this.consumerElement.removeEventListener("canvasRender",e(this,L))}createConsumer(){return new Se.CanvasElement}consumeSource(t){return ce(this,null,function*(){var i,c,y,j;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,L));const g=[],m=Le(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,O),"0")),D=new Image;D.src=oe,g.push(D)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((D,be)=>{l.onload=()=>{D()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,b).call(this),(c=(i=this.consumerElement).onload)==null||c.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,L))}catch(l){console.error(l),(j=(y=this.consumerElement).onerror)==null||j.call(y,new Event("error"))}}})}}p=new WeakMap,I=new WeakMap,U=new WeakMap,S=new WeakMap,w=new WeakMap,A=new WeakMap,P=new WeakMap,O=new WeakMap,b=new WeakMap,L=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var k,B;class ye extends N{constructor(){super(...arguments);s(this,k,0);s(this,B,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,k)&&r(this,k,t),G.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,k)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,B))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.ticker.subscribe(e(this,B)),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(),ne.ticker.unsubscribe(e(this,B)),r(this,k,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}k=new WeakMap,B=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ye);var u,M,C,Y,W,ee,te,se,F,ae;const T=class T extends N{constructor(){super();s(this,F);s(this,u);s(this,M);s(this,C,!1);s(this,Y,!1);s(this,W,()=>{r(this,C,e(this,C)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,M),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ee),onError:e(this,te),onStateChange:e(this,se)}}))});s(this,ee,()=>{r(this,Y,!0),x(this,F,ae).call(this)});s(this,te,t=>{var i,c;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(c=(i=this.consumerElement).onerror)==null||c.call(i,new Event("error"))});s(this,se,()=>{});r(this,M,"yt-"+me.generateId(10)),T.__apiReady||(window.onYouTubeIframeAPIReady=()=>{T.__apiReady=!0,G.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,Y)?e(this,u).playVideo():r(this,C,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,M),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const c=document.createElement("script");c.id,c.src="https://www.youtube.com/iframe_api";const y=document.getElementsByTagName("script")[0];(i=y.parentNode)==null||i.insertBefore(c,y)}e(this,u)?x(this,F,ae).call(this):T.__apiReady?e(this,W).call(this):addEventListener("youTubeIframeAPIReady",e(this,W))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,W))}};u=new WeakMap,M=new WeakMap,C=new WeakMap,Y=new WeakMap,W=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,F=new WeakSet,ae=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,C)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,C,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},T.__apiReady=!1;let J=T;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=N;exports.VideoElement=ye;exports.YouTubeElement=J;
5
+ `,e(this,h).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const y=o.nodeValue||"",R=me.kebabToCamel(o.name);R in e(this,h)&&(e(this,h)[R]=y||!0)}}),this.appendChild(e(this,h)),r(this,d,new Ee.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,q))&&T(this,U,X).call(this,o.current)}),e(this,V).observe(this),e(this,d).connect()}disconnectedCallback(){e(this,V).disconnect(),e(this,d).close(),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,e(this,h).remove(),e(this,c).reset(),clearTimeout(e(this,z))}}d=new WeakMap,h=new WeakMap,E=new WeakMap,q=new WeakMap,f=new WeakMap,H=new WeakMap,I=new WeakMap,c=new WeakMap,V=new WeakMap,z=new WeakMap,v=new WeakMap,U=new WeakSet,X=function(t){if(clearTimeout(e(this,z)),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){r(this,I,`${e(this,H)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,v,i?t.url:t.name+t.extension),this.consumeSource(e(this,v)),!e(this,f)&&!e(this,E)&&re.loading.add(e(this,I)),e(this,h).onloadeddata=()=>{e(this,O).call(this)},e(this,h).onload=()=>{e(this,O).call(this)},e(this,h).onerror=()=>{e(this,Z).call(this,e(this,v))}}else r(this,v,null),this.consumeSource(null)},Q=new WeakMap,O=new WeakMap,Z=new WeakMap;class fe extends j{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&ge.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",fe);function Le(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),o=parseInt(t[1],10);return{start:i,end:o}}}return null}var p,A,B,S,w,P,k,Y,b,L;class pe extends j{constructor(t){super();s(this,p,[]);s(this,A,new K.CSSProperty(this,"--fit","contain"));s(this,B,new K.CSSProperty(this,"--autoplay",!1));s(this,S,new K.CSSProperty(this,"--offset-x",.5));s(this,w,new K.CSSProperty(this,"--offset-y",.5));s(this,P,null);s(this,k,0);s(this,Y,1);s(this,b,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,A).current==="cover"?r(this,P,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current)):r(this,P,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current))}});s(this,L,t=>{if(this.status.isFalse("loaded")||!e(this,P))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,k)];i&&t.detail.context.drawImage(i,...e(this,P)),e(this,B).current&&r(this,k,(e(this,k)+1)%e(this,p).length)});de.isBrowser&&(r(this,Y,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,A).subscribe(e(this,b)),e(this,S).subscribe(e(this,b)),e(this,w).subscribe(e(this,b)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,L))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,L))}))}setProgress(t){e(this,p).length&&r(this,k,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,B).observe(),e(this,A).observe(),e(this,S).observe(),e(this,w).observe(),ue.elementResizer.subscribe(this,e(this,b))}disconnectedCallback(){super.disconnectedCallback(),e(this,B).unobserve(),e(this,A).unobserve(),e(this,S).unobserve(),e(this,w).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,b)),this.consumerElement.removeEventListener("canvasRender",e(this,L))}createConsumer(){return new Se.CanvasElement}consumeSource(t){return ce(this,null,function*(){var i,o,y,R;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,L));const g=[],m=Le(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,Y),"0")),D=new Image;D.src=oe,g.push(D)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((D,be)=>{l.onload=()=>{D()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,b).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,L))}catch(l){console.error(l),(R=(y=this.consumerElement).onerror)==null||R.call(y,new Event("error"))}}})}}p=new WeakMap,A=new WeakMap,B=new WeakMap,S=new WeakMap,w=new WeakMap,P=new WeakMap,k=new WeakMap,Y=new WeakMap,b=new WeakMap,L=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var x,M;class ye extends j{constructor(){super(...arguments);s(this,x,0);s(this,M,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,x)&&r(this,x,t),G.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,x)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,M))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.ticker.subscribe(e(this,M)),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(),ne.ticker.unsubscribe(e(this,M)),r(this,x,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}x=new WeakMap,M=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ye);var u,W,C,F,$,ee,te,se,N,ae;const _=class _ extends j{constructor(){super();s(this,N);s(this,u);s(this,W);s(this,C,!1);s(this,F,!1);s(this,$,()=>{r(this,C,e(this,C)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,W),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ee),onError:e(this,te),onStateChange:e(this,se)}}))});s(this,ee,()=>{r(this,F,!0),T(this,N,ae).call(this)});s(this,te,t=>{var i,o;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(o=(i=this.consumerElement).onerror)==null||o.call(i,new Event("error"))});s(this,se,()=>{});r(this,W,"yt-"+me.generateId(10)),_.__apiReady||(window.onYouTubeIframeAPIReady=()=>{_.__apiReady=!0,G.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,F)?e(this,u).playVideo():r(this,C,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,W),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const o=document.createElement("script");o.id,o.src="https://www.youtube.com/iframe_api";const y=document.getElementsByTagName("script")[0];(i=y.parentNode)==null||i.insertBefore(o,y)}e(this,u)?T(this,N,ae).call(this):_.__apiReady?e(this,$).call(this):addEventListener("youTubeIframeAPIReady",e(this,$))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,$))}};u=new WeakMap,W=new WeakMap,C=new WeakMap,F=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,N=new WeakSet,ae=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,C)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,C,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},_.__apiReady=!1;let J=_;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=j;exports.VideoElement=ye;exports.YouTubeElement=J;
@@ -2,21 +2,21 @@ var he = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
4
  var se = (a, n, t) => n.has(a) || he("Cannot " + t);
5
- var e = (a, n, t) => (se(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? he("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (se(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), T = (a, n, t) => (se(a, n, "access private method"), t);
6
- var ce = (a, n, t) => new Promise((i, c) => {
7
- var b = (m) => {
5
+ var e = (a, n, t) => (se(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? he("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (se(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), x = (a, n, t) => (se(a, n, "access private method"), t);
6
+ var ce = (a, n, t) => new Promise((i, o) => {
7
+ var y = (m) => {
8
8
  try {
9
9
  g(t.next(m));
10
10
  } catch (l) {
11
- c(l);
11
+ o(l);
12
12
  }
13
- }, Y = (m) => {
13
+ }, R = (m) => {
14
14
  try {
15
15
  g(t.throw(m));
16
16
  } catch (l) {
17
- c(l);
17
+ o(l);
18
18
  }
19
- }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(b, Y);
19
+ }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(y, R);
20
20
  g((t = t.apply(a, n)).next());
21
21
  });
22
22
  import { device as me } from "../device/index.js";
@@ -24,7 +24,7 @@ import { SourceManager as fe } from "../source/index.js";
24
24
  import { ClassLinkedStatus as pe } from "../class-linked-status/index.js";
25
25
  import { i as le } from "../browser-0zX67oeU.js";
26
26
  import { d as X } from "../events-CsVF98U6.js";
27
- import { k as be, g as ye } from "../string-f0Dnk0L1.js";
27
+ import { k as ye, g as be } from "../string-f0Dnk0L1.js";
28
28
  import { loading as ie } from "../loading/index.js";
29
29
  import { CSSProperty as j } from "../css-property/index.js";
30
30
  import { elementResizer as ue } from "../element-resizer/vanilla/index.js";
@@ -32,53 +32,53 @@ import { c as ge, a as Ee } from "../canvas-DeZ0SLUJ.js";
32
32
  import { CanvasElement as ve } from "../canvas/index.js";
33
33
  import { ticker as re } from "../ticker/vanilla/index.js";
34
34
  let we = 0;
35
- var d, o, E, V, f, H, R, h, U, z, v, _, K, G, q, J;
35
+ var d, h, E, U, f, q, I, c, z, _, v, B, K, G, F, J;
36
36
  class te extends HTMLElement {
37
37
  constructor() {
38
38
  super();
39
- s(this, _);
39
+ s(this, B);
40
40
  s(this, d, null);
41
- s(this, o, null);
41
+ s(this, h, null);
42
42
  s(this, E, !1);
43
- s(this, V, !1);
43
+ s(this, U, !1);
44
44
  s(this, f, !1);
45
- s(this, H, "");
46
- s(this, R, "");
47
- s(this, h, new pe(this, {
45
+ s(this, q, "");
46
+ s(this, I, "");
47
+ s(this, c, new pe(this, {
48
48
  loading: !1,
49
49
  loaded: !1,
50
50
  error: !1,
51
51
  clear: !1
52
52
  }));
53
- s(this, U, null);
54
- s(this, z);
53
+ s(this, z, null);
54
+ s(this, _);
55
55
  s(this, v, null);
56
56
  s(this, G, (t) => {
57
57
  const i = t[0];
58
- e(this, f) && (!e(this, V) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? X(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && T(this, _, K).call(this, void 0), X(this, "sourceRelease", { custom: !0 }));
58
+ e(this, f) && (!e(this, U) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? X(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && x(this, B, K).call(this, void 0), X(this, "sourceRelease", { custom: !0 }));
59
59
  });
60
- s(this, q, () => {
61
- e(this, h).set("loaded", !0), e(this, h).set("error", !1), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && ie.complete(e(this, R));
60
+ s(this, F, () => {
61
+ e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && ie.complete(e(this, I));
62
62
  const t = getComputedStyle(this).getPropertyValue("--clear-duration");
63
- t ? r(this, z, setTimeout(() => {
64
- e(this, h).set("clear", !0);
65
- }, parseFloat(t) * 1e3)) : e(this, h).set("clear", !0), r(this, E, !0);
63
+ t ? r(this, _, setTimeout(() => {
64
+ e(this, c).set("clear", !0);
65
+ }, parseFloat(t) * 1e3)) : e(this, c).set("clear", !0), r(this, E, !0);
66
66
  });
67
67
  s(this, J, (t) => {
68
- e(this, h).set("loaded", !1), e(this, h).set("error", !0), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && ie.error(e(this, R)), r(this, E, !0);
68
+ e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, f) && !e(this, E) && ie.error(e(this, I)), r(this, E, !0);
69
69
  });
70
- le && window.IntersectionObserver && (r(this, H, `source-consumer-${++we}`), r(this, U, new IntersectionObserver(
70
+ le && window.IntersectionObserver && (r(this, q, `source-consumer-${++we}`), r(this, z, new IntersectionObserver(
71
71
  e(this, G)
72
72
  )));
73
73
  }
74
74
  get consumerElement() {
75
- return e(this, o);
75
+ return e(this, h);
76
76
  }
77
77
  get sourceManager() {
78
78
  return e(this, d);
79
79
  }
80
80
  get status() {
81
- return e(this, h);
81
+ return e(this, c);
82
82
  }
83
83
  get isLazy() {
84
84
  return e(this, f);
@@ -87,43 +87,45 @@ class te extends HTMLElement {
87
87
  return e(this, v);
88
88
  }
89
89
  triggerLazyLoad() {
90
- e(this, d).current && e(this, d).current !== e(this, d).previous && T(this, _, K).call(this, e(this, d).current), r(this, V, !0);
90
+ e(this, d).current && e(this, d).current !== e(this, d).previous && x(this, B, K).call(this, e(this, d).current), r(this, U, !0);
91
91
  }
92
92
  connectedCallback() {
93
93
  const t = this.getAttribute("srcset");
94
- t && (r(this, o, this.createConsumer()), e(this, o).style.cssText = `
94
+ if (!t) return;
95
+ const i = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
96
+ i && e(this, c).addElement(i), r(this, h, this.createConsumer()), e(this, h).style.cssText = `
95
97
  display: block;
96
98
  width: 100%;
97
99
  height: 100%;
98
- `, e(this, o).classList.add("source-consumer"), Array.from(this.attributes).forEach((i) => {
99
- if (i.name !== "srcset") {
100
- const c = i.nodeValue || "", b = be(i.name);
101
- b in e(this, o) && (e(this, o)[b] = c || !0);
100
+ `, e(this, h).classList.add("source-consumer"), Array.from(this.attributes).forEach((o) => {
101
+ if (o.name !== "srcset") {
102
+ const y = o.nodeValue || "", R = ye(o.name);
103
+ R in e(this, h) && (e(this, h)[R] = y || !0);
102
104
  }
103
- }), this.appendChild(e(this, o)), r(this, d, new fe({
105
+ }), this.appendChild(e(this, h)), r(this, d, new fe({
104
106
  srcset: t
105
- })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((i) => {
106
- (!e(this, f) || e(this, f) && e(this, V)) && T(this, _, K).call(this, i.current);
107
- }), e(this, U).observe(this), e(this, d).connect());
107
+ })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((o) => {
108
+ (!e(this, f) || e(this, f) && e(this, U)) && x(this, B, K).call(this, o.current);
109
+ }), e(this, z).observe(this), e(this, d).connect();
108
110
  }
109
111
  disconnectedCallback() {
110
- e(this, U).disconnect(), e(this, d).close(), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove(), e(this, h).reset(), clearTimeout(e(this, z));
112
+ e(this, z).disconnect(), e(this, d).close(), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, e(this, h).remove(), e(this, c).reset(), clearTimeout(e(this, _));
111
113
  }
112
114
  }
113
- d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), V = new WeakMap(), f = new WeakMap(), H = new WeakMap(), R = new WeakMap(), h = new WeakMap(), U = new WeakMap(), z = new WeakMap(), v = new WeakMap(), _ = new WeakSet(), K = function(t) {
114
- if (clearTimeout(e(this, z)), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, h).set("loaded", !1), e(this, h).set("error", !1), e(this, h).set("loading", !1), e(this, h).set("clear", !1), t) {
115
- r(this, R, `${e(this, H)}-${t.url}`);
115
+ d = new WeakMap(), h = new WeakMap(), E = new WeakMap(), U = new WeakMap(), f = new WeakMap(), q = new WeakMap(), I = new WeakMap(), c = new WeakMap(), z = new WeakMap(), _ = new WeakMap(), v = new WeakMap(), B = new WeakSet(), K = function(t) {
116
+ if (clearTimeout(e(this, _)), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, e(this, c).set("loaded", !1), e(this, c).set("error", !1), e(this, c).set("loading", !1), e(this, c).set("clear", !1), t) {
117
+ r(this, I, `${e(this, q)}-${t.url}`);
116
118
  const i = this.hasAttribute("keep-source-parameters");
117
- e(this, h).set("loading", !0), r(this, v, i ? t.url : t.name + t.extension), this.consumeSource(e(this, v)), !e(this, f) && !e(this, E) && ie.add(e(this, R)), e(this, o).onloadeddata = () => {
118
- e(this, q).call(this);
119
- }, e(this, o).onload = () => {
120
- e(this, q).call(this);
121
- }, e(this, o).onerror = () => {
119
+ e(this, c).set("loading", !0), r(this, v, i ? t.url : t.name + t.extension), this.consumeSource(e(this, v)), !e(this, f) && !e(this, E) && ie.add(e(this, I)), e(this, h).onloadeddata = () => {
120
+ e(this, F).call(this);
121
+ }, e(this, h).onload = () => {
122
+ e(this, F).call(this);
123
+ }, e(this, h).onerror = () => {
122
124
  e(this, J).call(this, e(this, v));
123
125
  };
124
126
  } else
125
127
  r(this, v, null), this.consumeSource(null);
126
- }, G = new WeakMap(), q = new WeakMap(), J = new WeakMap();
128
+ }, G = new WeakMap(), F = new WeakMap(), J = new WeakMap();
127
129
  class Le extends te {
128
130
  createConsumer() {
129
131
  return document.createElement("img");
@@ -142,39 +144,39 @@ function Ce(a) {
142
144
  if (n) {
143
145
  const t = n[1].split("-");
144
146
  if (t.length === 2) {
145
- const i = parseInt(t[0], 10), c = parseInt(t[1], 10);
146
- return { start: i, end: c };
147
+ const i = parseInt(t[0], 10), o = parseInt(t[1], 10);
148
+ return { start: i, end: o };
147
149
  }
148
150
  }
149
151
  return null;
150
152
  }
151
- var p, I, B, w, L, A, k, F, y, C;
153
+ var p, A, M, w, L, k, P, N, b, C;
152
154
  class Se extends te {
153
155
  constructor(t) {
154
156
  super();
155
157
  s(this, p, []);
156
- s(this, I, new j(
158
+ s(this, A, new j(
157
159
  this,
158
160
  "--fit",
159
161
  "contain"
160
162
  ));
161
- s(this, B, new j(this, "--autoplay", !1));
163
+ s(this, M, new j(this, "--autoplay", !1));
162
164
  s(this, w, new j(this, "--offset-x", 0.5));
163
165
  s(this, L, new j(this, "--offset-y", 0.5));
164
- s(this, A, null);
165
- s(this, k, 0);
166
- s(this, F, 1);
167
- s(this, y, () => {
166
+ s(this, k, null);
167
+ s(this, P, 0);
168
+ s(this, N, 1);
169
+ s(this, b, () => {
168
170
  if (e(this, p).length) {
169
171
  const t = e(this, p)[0];
170
- e(this, I).current === "cover" ? r(this, A, ge(
172
+ e(this, A).current === "cover" ? r(this, k, ge(
171
173
  t.naturalWidth,
172
174
  t.naturalHeight,
173
175
  this.consumerElement.width,
174
176
  this.consumerElement.height,
175
177
  e(this, w).current,
176
178
  e(this, L).current
177
- )) : r(this, A, Ee(
179
+ )) : r(this, k, Ee(
178
180
  t.naturalWidth,
179
181
  t.naturalHeight,
180
182
  this.consumerElement.width,
@@ -185,15 +187,15 @@ class Se extends te {
185
187
  }
186
188
  });
187
189
  s(this, C, (t) => {
188
- if (this.status.isFalse("loaded") || !e(this, A))
190
+ if (this.status.isFalse("loaded") || !e(this, k))
189
191
  return;
190
192
  t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
191
- const i = e(this, p)[e(this, k)];
192
- i && t.detail.context.drawImage(i, ...e(this, A)), e(this, B).current && r(this, k, (e(this, k) + 1) % e(this, p).length);
193
+ const i = e(this, p)[e(this, P)];
194
+ i && t.detail.context.drawImage(i, ...e(this, k)), e(this, M).current && r(this, P, (e(this, P) + 1) % e(this, p).length);
193
195
  });
194
- le && (r(this, F, parseInt(
196
+ le && (r(this, N, parseInt(
195
197
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
196
- )), e(this, I).subscribe(e(this, y)), e(this, w).subscribe(e(this, y)), e(this, L).subscribe(e(this, y)), this.addEventListener("sourceCapture", (i) => {
198
+ )), e(this, A).subscribe(e(this, b)), e(this, w).subscribe(e(this, b)), e(this, L).subscribe(e(this, b)), this.addEventListener("sourceCapture", (i) => {
197
199
  this.consumerElement.addEventListener(
198
200
  "canvasRender",
199
201
  e(this, C)
@@ -206,13 +208,13 @@ class Se extends te {
206
208
  }));
207
209
  }
208
210
  setProgress(t) {
209
- e(this, p).length && r(this, k, Math.floor((e(this, p).length - 1) * t));
211
+ e(this, p).length && r(this, P, Math.floor((e(this, p).length - 1) * t));
210
212
  }
211
213
  connectedCallback() {
212
- super.connectedCallback(), e(this, B).observe(), e(this, I).observe(), e(this, w).observe(), e(this, L).observe(), ue.subscribe(this, e(this, y));
214
+ super.connectedCallback(), e(this, M).observe(), e(this, A).observe(), e(this, w).observe(), e(this, L).observe(), ue.subscribe(this, e(this, b));
213
215
  }
214
216
  disconnectedCallback() {
215
- super.disconnectedCallback(), e(this, B).unobserve(), e(this, I).unobserve(), e(this, w).unobserve(), e(this, L).unobserve(), r(this, p, []), ue.unsubscribe(e(this, y)), this.consumerElement.removeEventListener(
217
+ super.disconnectedCallback(), e(this, M).unobserve(), e(this, A).unobserve(), e(this, w).unobserve(), e(this, L).unobserve(), r(this, p, []), ue.unsubscribe(e(this, b)), this.consumerElement.removeEventListener(
216
218
  "canvasRender",
217
219
  e(this, C)
218
220
  );
@@ -222,7 +224,7 @@ class Se extends te {
222
224
  }
223
225
  consumeSource(t) {
224
226
  return ce(this, null, function* () {
225
- var i, c, b, Y;
227
+ var i, o, y, R;
226
228
  if (t) {
227
229
  this.consumerElement.removeEventListener(
228
230
  "canvasRender",
@@ -233,7 +235,7 @@ class Se extends te {
233
235
  for (let l = m.start; l <= m.end; l++) {
234
236
  const oe = t.replace(
235
237
  /\{([^}]+)\}/,
236
- l.toString().padStart(e(this, F), "0")
238
+ l.toString().padStart(e(this, N), "0")
237
239
  ), D = new Image();
238
240
  D.src = oe, g.push(D);
239
241
  }
@@ -250,38 +252,38 @@ class Se extends te {
250
252
  de(`${l.src} Image not found`);
251
253
  };
252
254
  }))
253
- ), r(this, p, g), e(this, y).call(this), (c = (i = this.consumerElement).onload) == null || c.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
255
+ ), r(this, p, g), e(this, b).call(this), (o = (i = this.consumerElement).onload) == null || o.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
254
256
  "canvasRender",
255
257
  e(this, C)
256
258
  );
257
259
  } catch (l) {
258
- console.error(l), (Y = (b = this.consumerElement).onerror) == null || Y.call(b, new Event("error"));
260
+ console.error(l), (R = (y = this.consumerElement).onerror) == null || R.call(y, new Event("error"));
259
261
  }
260
262
  }
261
263
  });
262
264
  }
263
265
  }
264
- p = new WeakMap(), I = new WeakMap(), B = new WeakMap(), w = new WeakMap(), L = new WeakMap(), A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), y = new WeakMap(), C = new WeakMap();
266
+ p = new WeakMap(), A = new WeakMap(), M = new WeakMap(), w = new WeakMap(), L = new WeakMap(), k = new WeakMap(), P = new WeakMap(), N = new WeakMap(), b = new WeakMap(), C = new WeakMap();
265
267
  customElements.get("e-sequence") || customElements.define("e-sequence", Se);
266
- var P, M;
268
+ var T, W;
267
269
  class Re extends te {
268
270
  constructor() {
269
271
  super(...arguments);
270
- s(this, P, 0);
271
- s(this, M, () => {
272
+ s(this, T, 0);
273
+ s(this, W, () => {
272
274
  this.classList.add(`state-${this.consumerElement.readyState}`);
273
275
  const t = this.consumerElement.readyState / 4;
274
- t > e(this, P) && r(this, P, t), X(this, "videoReadyStateChange", {
276
+ t > e(this, T) && r(this, T, t), X(this, "videoReadyStateChange", {
275
277
  detail: {
276
278
  readyState: this.consumerElement.readyState,
277
- progress: e(this, P)
279
+ progress: e(this, T)
278
280
  }
279
- }), this.consumerElement.readyState === 4 && re.unsubscribe(e(this, M));
281
+ }), this.consumerElement.readyState === 4 && re.unsubscribe(e(this, W));
280
282
  });
281
283
  }
282
284
  connectedCallback() {
283
285
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
284
- re.subscribe(e(this, M)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
286
+ re.subscribe(e(this, W)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
285
287
  }), this.addEventListener("sourceRelease", () => {
286
288
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
287
289
  "state-0",
@@ -293,7 +295,7 @@ class Re extends te {
293
295
  });
294
296
  }
295
297
  disconnectedCallback() {
296
- super.disconnectedCallback(), re.unsubscribe(e(this, M)), r(this, P, 0);
298
+ super.disconnectedCallback(), re.unsubscribe(e(this, W)), r(this, T, 0);
297
299
  }
298
300
  createConsumer() {
299
301
  return document.createElement("video");
@@ -302,19 +304,19 @@ class Re extends te {
302
304
  this.consumerElement.src = t || "", this.consumerElement.autoplay = !0;
303
305
  }
304
306
  }
305
- P = new WeakMap(), M = new WeakMap();
307
+ T = new WeakMap(), W = new WeakMap();
306
308
  customElements.get("e-video") || customElements.define("e-video", Re);
307
- var u, W, S, N, $, Q, Z, ee, O, ae;
308
- const x = class x extends te {
309
+ var u, $, S, O, H, Q, Z, ee, Y, ae;
310
+ const V = class V extends te {
309
311
  constructor() {
310
312
  super();
311
- s(this, O);
313
+ s(this, Y);
312
314
  s(this, u);
313
- s(this, W);
315
+ s(this, $);
314
316
  s(this, S, !1);
315
- s(this, N, !1);
316
- s(this, $, () => {
317
- r(this, S, e(this, S) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, u, new window.YT.Player(e(this, W), {
317
+ s(this, O, !1);
318
+ s(this, H, () => {
319
+ r(this, S, e(this, S) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, u, new window.YT.Player(e(this, $), {
318
320
  playerVars: {
319
321
  mute: this.hasAttribute("muted") ? 1 : 0,
320
322
  controls: this.hasAttribute("controls") ? 1 : 0
@@ -327,18 +329,18 @@ const x = class x extends te {
327
329
  }));
328
330
  });
329
331
  s(this, Q, () => {
330
- r(this, N, !0), T(this, O, ae).call(this);
332
+ r(this, O, !0), x(this, Y, ae).call(this);
331
333
  });
332
334
  s(this, Z, (t) => {
333
- var i, c;
334
- console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (c = (i = this.consumerElement).onerror) == null || c.call(i, new Event("error"));
335
+ var i, o;
336
+ console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (o = (i = this.consumerElement).onerror) == null || o.call(i, new Event("error"));
335
337
  });
336
338
  s(this, ee, () => {
337
339
  });
338
- r(this, W, "yt-" + ye(10)), x.__apiReady || (window.onYouTubeIframeAPIReady = () => {
339
- x.__apiReady = !0, X(window, "youTubeIframeAPIReady");
340
+ r(this, $, "yt-" + be(10)), V.__apiReady || (window.onYouTubeIframeAPIReady = () => {
341
+ V.__apiReady = !0, X(window, "youTubeIframeAPIReady");
340
342
  }), this.addEventListener("sourceCapture", () => {
341
- this.hasAttribute("capture-autoplay") && (e(this, N) ? e(this, u).playVideo() : r(this, S, !0));
343
+ this.hasAttribute("capture-autoplay") && (e(this, O) ? e(this, u).playVideo() : r(this, S, !0));
342
344
  }), this.addEventListener("sourceRelease", () => {
343
345
  e(this, u) && this.hasAttribute("capture-autoplay") && (e(this, u).pauseVideo(), this.hasAttribute("replay") && e(this, u).seekTo(0));
344
346
  });
@@ -348,29 +350,29 @@ const x = class x extends te {
348
350
  }
349
351
  createConsumer() {
350
352
  const t = document.createElement("div");
351
- return t.id = e(this, W), t;
353
+ return t.id = e(this, $), t;
352
354
  }
353
355
  consumeSource(t) {
354
356
  var i;
355
357
  if (t) {
356
358
  if (!document.getElementById("youtube-script")) {
357
- const c = document.createElement("script");
358
- c.id, c.src = "https://www.youtube.com/iframe_api";
359
- const b = document.getElementsByTagName("script")[0];
360
- (i = b.parentNode) == null || i.insertBefore(c, b);
359
+ const o = document.createElement("script");
360
+ o.id, o.src = "https://www.youtube.com/iframe_api";
361
+ const y = document.getElementsByTagName("script")[0];
362
+ (i = y.parentNode) == null || i.insertBefore(o, y);
361
363
  }
362
- e(this, u) ? T(this, O, ae).call(this) : x.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
364
+ e(this, u) ? x(this, Y, ae).call(this) : V.__apiReady ? e(this, H).call(this) : addEventListener("youTubeIframeAPIReady", e(this, H));
363
365
  } else e(this, u) && e(this, u).stopVideo();
364
366
  }
365
367
  disconnectedCallback() {
366
- super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
368
+ super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, H));
367
369
  }
368
370
  };
369
- u = new WeakMap(), W = new WeakMap(), S = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), ee = new WeakMap(), O = new WeakSet(), ae = function() {
371
+ u = new WeakMap(), $ = new WeakMap(), S = new WeakMap(), O = new WeakMap(), H = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), ee = new WeakMap(), Y = new WeakSet(), ae = function() {
370
372
  var t, i;
371
373
  this.currentURL && (this.currentURL.startsWith("http") ? e(this, u).loadVideoByUrl(this.currentURL) : e(this, u).loadVideoById(this.currentURL)), e(this, S) ? e(this, u).playVideo() : e(this, u).stopVideo(), r(this, S, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
372
- }, x.__apiReady = !1;
373
- let ne = x;
374
+ }, V.__apiReady = !1;
375
+ let ne = V;
374
376
  customElements.get("e-youtube") || customElements.define("e-youtube", ne);
375
377
  export {
376
378
  Le as ImageElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.39.5",
3
+ "version": "0.39.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"