aptechka 0.39.7 → 0.39.8

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,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),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=`
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 Ee=require("../device/index.cjs"),ge=require("../source/index.cjs"),ve=require("../class-linked-status/index.cjs"),de=require("../browser-CpzFX2xg.cjs"),_=require("../events-KVanG9sR.cjs"),me=require("../string-DhgS_iFl.cjs"),re=require("../loading/index.cjs"),X=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 Le=0;var d,h,b,V,f,F,I,c,z,U,v,B,G,Q,O,Z;class D extends HTMLElement{constructor(){super();s(this,B);s(this,d,null);s(this,h,null);s(this,b,!1);s(this,V,!1);s(this,f,!1);s(this,F,"");s(this,I,"");s(this,c,new ve.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,z,null);s(this,U);s(this,v,null);s(this,Q,t=>{const i=t[0];e(this,f)&&(!e(this,V)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?_.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&T(this,B,G).call(this,void 0),_.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,b)&&re.loading.complete(e(this,I)),_.dispatchEvent(this,"sourceLoaded",{custom:!0});const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,U,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,b,!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,b)&&re.loading.error(e(this,I)),_.dispatchEvent(this,"sourceError",{custom:!0}),r(this,b,!0)});de.isBrowser&&window.IntersectionObserver&&(r(this,F,`source-consumer-${++Le}`),r(this,z,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)}get isFirstLoadHappened(){return e(this,b)}triggerLazyLoad(){e(this,d).current&&e(this,d).current!==e(this,d).previous&&T(this,B,G).call(this,e(this,d).current),r(this,V,!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,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;
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 ge.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,V))&&T(this,B,G).call(this,o.current)}),e(this,z).observe(this),e(this,d).connect()}disconnectedCallback(){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,U))}}d=new WeakMap,h=new WeakMap,b=new WeakMap,V=new WeakMap,f=new WeakMap,F=new WeakMap,I=new WeakMap,c=new WeakMap,z=new WeakMap,U=new WeakMap,v=new WeakMap,B=new WeakSet,G=function(t){if(clearTimeout(e(this,U)),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,F)}-${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,b)&&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 D{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Ee.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 we(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,M,S,L,P,k,Y,E,w;class pe extends D{constructor(t){super();s(this,p,[]);s(this,A,new X.CSSProperty(this,"--fit","contain"));s(this,M,new X.CSSProperty(this,"--autoplay",!1));s(this,S,new X.CSSProperty(this,"--offset-x",.5));s(this,L,new X.CSSProperty(this,"--offset-y",.5));s(this,P,null);s(this,k,0);s(this,Y,1);s(this,E,()=>{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,L).current)):r(this,P,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,L).current))}});s(this,w,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,M).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,E)),e(this,S).subscribe(e(this,E)),e(this,L).subscribe(e(this,E)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,w))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,w))}))}setProgress(t){e(this,p).length&&r(this,k,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,A).observe(),e(this,S).observe(),e(this,L).observe(),ue.elementResizer.subscribe(this,e(this,E))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,A).unobserve(),e(this,S).unobserve(),e(this,L).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,E)),this.consumerElement.removeEventListener("canvasRender",e(this,w))}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,w));const g=[],m=we(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,Y),"0")),K=new Image;K.src=oe,g.push(K)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((K,be)=>{l.onload=()=>{K()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,E).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,w))}catch(l){console.error(l),(R=(y=this.consumerElement).onerror)==null||R.call(y,new Event("error"))}}})}}p=new WeakMap,A=new WeakMap,M=new WeakMap,S=new WeakMap,L=new WeakMap,P=new WeakMap,k=new WeakMap,Y=new WeakMap,E=new WeakMap,w=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var x,H;class ye extends D{constructor(){super(...arguments);s(this,x,0);s(this,H,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,x)&&r(this,x,t),_.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,x)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,H))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.ticker.subscribe(e(this,H)),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,H)),r(this,x,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}x=new WeakMap,H=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ye);var u,W,C,N,$,ee,te,se,j,ae;const q=class q extends D{constructor(){super();s(this,j);s(this,u);s(this,W);s(this,C,!1);s(this,N,!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,N,!0),T(this,j,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)),q.__apiReady||(window.onYouTubeIframeAPIReady=()=>{q.__apiReady=!0,_.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,N)?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,j,ae).call(this):q.__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,N=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,j=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"))},q.__apiReady=!1;let J=q;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=D;exports.VideoElement=ye;exports.YouTubeElement=J;
@@ -6,41 +6,41 @@ var e = (a, n, t) => (se(a, n, "read from private field"), t ? t.call(a) : n.get
6
6
  var ce = (a, n, t) => new Promise((i, o) => {
7
7
  var y = (m) => {
8
8
  try {
9
- g(t.next(m));
9
+ E(t.next(m));
10
10
  } catch (l) {
11
11
  o(l);
12
12
  }
13
13
  }, R = (m) => {
14
14
  try {
15
- g(t.throw(m));
15
+ E(t.throw(m));
16
16
  } catch (l) {
17
17
  o(l);
18
18
  }
19
- }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(y, R);
20
- g((t = t.apply(a, n)).next());
19
+ }, E = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(y, R);
20
+ E((t = t.apply(a, n)).next());
21
21
  });
22
22
  import { device as me } from "../device/index.js";
23
23
  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
- import { d as X } from "../events-CsVF98U6.js";
26
+ import { d as V } from "../events-CsVF98U6.js";
27
27
  import { k as ye, g as be } from "../string-f0Dnk0L1.js";
28
28
  import { loading as ie } from "../loading/index.js";
29
- import { CSSProperty as j } from "../css-property/index.js";
29
+ import { CSSProperty as K } from "../css-property/index.js";
30
30
  import { elementResizer as ue } from "../element-resizer/vanilla/index.js";
31
31
  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
- let we = 0;
35
- var d, h, E, U, f, q, I, c, z, _, v, B, K, G, F, J;
34
+ let Le = 0;
35
+ var d, h, b, z, f, q, I, c, _, B, v, H, X, G, N, J;
36
36
  class te extends HTMLElement {
37
37
  constructor() {
38
38
  super();
39
- s(this, B);
39
+ s(this, H);
40
40
  s(this, d, null);
41
41
  s(this, h, null);
42
- s(this, E, !1);
43
- s(this, U, !1);
42
+ s(this, b, !1);
43
+ s(this, z, !1);
44
44
  s(this, f, !1);
45
45
  s(this, q, "");
46
46
  s(this, I, "");
@@ -50,24 +50,24 @@ class te extends HTMLElement {
50
50
  error: !1,
51
51
  clear: !1
52
52
  }));
53
- s(this, z, null);
54
- s(this, _);
53
+ s(this, _, null);
54
+ s(this, B);
55
55
  s(this, v, null);
56
56
  s(this, G, (t) => {
57
57
  const i = t[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 }));
58
+ e(this, f) && (!e(this, z) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? V(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && x(this, H, X).call(this, void 0), V(this, "sourceRelease", { custom: !0 }));
59
59
  });
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));
60
+ s(this, N, () => {
61
+ e(this, c).set("loaded", !0), e(this, c).set("error", !1), e(this, c).set("loading", !1), !e(this, f) && !e(this, b) && ie.complete(e(this, I)), V(this, "sourceLoaded", { custom: !0 });
62
62
  const t = getComputedStyle(this).getPropertyValue("--clear-duration");
63
- t ? r(this, _, setTimeout(() => {
63
+ t ? r(this, B, setTimeout(() => {
64
64
  e(this, c).set("clear", !0);
65
- }, parseFloat(t) * 1e3)) : e(this, c).set("clear", !0), r(this, E, !0);
65
+ }, parseFloat(t) * 1e3)) : e(this, c).set("clear", !0), r(this, b, !0);
66
66
  });
67
67
  s(this, J, (t) => {
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);
68
+ e(this, c).set("loaded", !1), e(this, c).set("error", !0), e(this, c).set("loading", !1), !e(this, f) && !e(this, b) && ie.error(e(this, I)), V(this, "sourceError", { custom: !0 }), r(this, b, !0);
69
69
  });
70
- le && window.IntersectionObserver && (r(this, q, `source-consumer-${++we}`), r(this, z, new IntersectionObserver(
70
+ le && window.IntersectionObserver && (r(this, q, `source-consumer-${++Le}`), r(this, _, new IntersectionObserver(
71
71
  e(this, G)
72
72
  )));
73
73
  }
@@ -86,8 +86,11 @@ class te extends HTMLElement {
86
86
  get currentURL() {
87
87
  return e(this, v);
88
88
  }
89
+ get isFirstLoadHappened() {
90
+ return e(this, b);
91
+ }
89
92
  triggerLazyLoad() {
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);
93
+ e(this, d).current && e(this, d).current !== e(this, d).previous && x(this, H, X).call(this, e(this, d).current), r(this, z, !0);
91
94
  }
92
95
  connectedCallback() {
93
96
  const t = this.getAttribute("srcset");
@@ -105,28 +108,28 @@ class te extends HTMLElement {
105
108
  }), this.appendChild(e(this, h)), r(this, d, new fe({
106
109
  srcset: t
107
110
  })), 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();
111
+ (!e(this, f) || e(this, f) && e(this, z)) && x(this, H, X).call(this, o.current);
112
+ }), e(this, _).observe(this), e(this, d).connect();
110
113
  }
111
114
  disconnectedCallback() {
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, _));
115
+ e(this, _).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, B));
113
116
  }
114
117
  }
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) {
118
+ d = new WeakMap(), h = new WeakMap(), b = new WeakMap(), z = new WeakMap(), f = new WeakMap(), q = new WeakMap(), I = new WeakMap(), c = new WeakMap(), _ = new WeakMap(), B = new WeakMap(), v = new WeakMap(), H = new WeakSet(), X = function(t) {
119
+ if (clearTimeout(e(this, B)), 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
120
  r(this, I, `${e(this, q)}-${t.url}`);
118
121
  const i = this.hasAttribute("keep-source-parameters");
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);
122
+ 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, b) && ie.add(e(this, I)), e(this, h).onloadeddata = () => {
123
+ e(this, N).call(this);
121
124
  }, e(this, h).onload = () => {
122
- e(this, F).call(this);
125
+ e(this, N).call(this);
123
126
  }, e(this, h).onerror = () => {
124
127
  e(this, J).call(this, e(this, v));
125
128
  };
126
129
  } else
127
130
  r(this, v, null), this.consumeSource(null);
128
- }, G = new WeakMap(), F = new WeakMap(), J = new WeakMap();
129
- class Le extends te {
131
+ }, G = new WeakMap(), N = new WeakMap(), J = new WeakMap();
132
+ class we extends te {
130
133
  createConsumer() {
131
134
  return document.createElement("img");
132
135
  }
@@ -138,7 +141,7 @@ class Le extends te {
138
141
  this.consumerElement.src = n || "";
139
142
  }
140
143
  }
141
- customElements.get("e-image") || customElements.define("e-image", Le);
144
+ customElements.get("e-image") || customElements.define("e-image", we);
142
145
  function Ce(a) {
143
146
  const n = a.match(/\{([\d-]+)\}/);
144
147
  if (n) {
@@ -150,23 +153,23 @@ function Ce(a) {
150
153
  }
151
154
  return null;
152
155
  }
153
- var p, A, M, w, L, k, P, N, b, C;
156
+ var p, A, M, L, w, k, P, O, g, C;
154
157
  class Se extends te {
155
158
  constructor(t) {
156
159
  super();
157
160
  s(this, p, []);
158
- s(this, A, new j(
161
+ s(this, A, new K(
159
162
  this,
160
163
  "--fit",
161
164
  "contain"
162
165
  ));
163
- s(this, M, new j(this, "--autoplay", !1));
164
- s(this, w, new j(this, "--offset-x", 0.5));
165
- s(this, L, new j(this, "--offset-y", 0.5));
166
+ s(this, M, new K(this, "--autoplay", !1));
167
+ s(this, L, new K(this, "--offset-x", 0.5));
168
+ s(this, w, new K(this, "--offset-y", 0.5));
166
169
  s(this, k, null);
167
170
  s(this, P, 0);
168
- s(this, N, 1);
169
- s(this, b, () => {
171
+ s(this, O, 1);
172
+ s(this, g, () => {
170
173
  if (e(this, p).length) {
171
174
  const t = e(this, p)[0];
172
175
  e(this, A).current === "cover" ? r(this, k, ge(
@@ -174,15 +177,15 @@ class Se extends te {
174
177
  t.naturalHeight,
175
178
  this.consumerElement.width,
176
179
  this.consumerElement.height,
177
- e(this, w).current,
178
- e(this, L).current
180
+ e(this, L).current,
181
+ e(this, w).current
179
182
  )) : r(this, k, Ee(
180
183
  t.naturalWidth,
181
184
  t.naturalHeight,
182
185
  this.consumerElement.width,
183
186
  this.consumerElement.height,
184
- e(this, w).current,
185
- e(this, L).current
187
+ e(this, L).current,
188
+ e(this, w).current
186
189
  ));
187
190
  }
188
191
  });
@@ -193,9 +196,9 @@ class Se extends te {
193
196
  const i = e(this, p)[e(this, P)];
194
197
  i && t.detail.context.drawImage(i, ...e(this, k)), e(this, M).current && r(this, P, (e(this, P) + 1) % e(this, p).length);
195
198
  });
196
- le && (r(this, N, parseInt(
199
+ le && (r(this, O, parseInt(
197
200
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
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) => {
201
+ )), e(this, A).subscribe(e(this, g)), e(this, L).subscribe(e(this, g)), e(this, w).subscribe(e(this, g)), this.addEventListener("sourceCapture", (i) => {
199
202
  this.consumerElement.addEventListener(
200
203
  "canvasRender",
201
204
  e(this, C)
@@ -211,10 +214,10 @@ class Se extends te {
211
214
  e(this, p).length && r(this, P, Math.floor((e(this, p).length - 1) * t));
212
215
  }
213
216
  connectedCallback() {
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));
217
+ super.connectedCallback(), e(this, M).observe(), e(this, A).observe(), e(this, L).observe(), e(this, w).observe(), ue.subscribe(this, e(this, g));
215
218
  }
216
219
  disconnectedCallback() {
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(
220
+ super.disconnectedCallback(), e(this, M).unobserve(), e(this, A).unobserve(), e(this, L).unobserve(), e(this, w).unobserve(), r(this, p, []), ue.unsubscribe(e(this, g)), this.consumerElement.removeEventListener(
218
221
  "canvasRender",
219
222
  e(this, C)
220
223
  );
@@ -230,29 +233,29 @@ class Se extends te {
230
233
  "canvasRender",
231
234
  e(this, C)
232
235
  );
233
- const g = [], m = Ce(t);
236
+ const E = [], m = Ce(t);
234
237
  if (m)
235
238
  for (let l = m.start; l <= m.end; l++) {
236
239
  const oe = t.replace(
237
240
  /\{([^}]+)\}/,
238
- l.toString().padStart(e(this, N), "0")
239
- ), D = new Image();
240
- D.src = oe, g.push(D);
241
+ l.toString().padStart(e(this, O), "0")
242
+ ), j = new Image();
243
+ j.src = oe, E.push(j);
241
244
  }
242
245
  else {
243
246
  const l = new Image();
244
- l.src = t, g.push(l);
247
+ l.src = t, E.push(l);
245
248
  }
246
249
  try {
247
250
  yield Promise.all(
248
- g.map((l, oe) => new Promise((D, de) => {
251
+ E.map((l, oe) => new Promise((j, de) => {
249
252
  l.onload = () => {
250
- D();
253
+ j();
251
254
  }, l.onerror = (Ie) => {
252
255
  de(`${l.src} Image not found`);
253
256
  };
254
257
  }))
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(
258
+ ), r(this, p, E), e(this, g).call(this), (o = (i = this.consumerElement).onload) == null || o.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
256
259
  "canvasRender",
257
260
  e(this, C)
258
261
  );
@@ -263,7 +266,7 @@ class Se extends te {
263
266
  });
264
267
  }
265
268
  }
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();
269
+ p = new WeakMap(), A = new WeakMap(), M = new WeakMap(), L = new WeakMap(), w = new WeakMap(), k = new WeakMap(), P = new WeakMap(), O = new WeakMap(), g = new WeakMap(), C = new WeakMap();
267
270
  customElements.get("e-sequence") || customElements.define("e-sequence", Se);
268
271
  var T, W;
269
272
  class Re extends te {
@@ -273,7 +276,7 @@ class Re extends te {
273
276
  s(this, W, () => {
274
277
  this.classList.add(`state-${this.consumerElement.readyState}`);
275
278
  const t = this.consumerElement.readyState / 4;
276
- t > e(this, T) && r(this, T, t), X(this, "videoReadyStateChange", {
279
+ t > e(this, T) && r(this, T, t), V(this, "videoReadyStateChange", {
277
280
  detail: {
278
281
  readyState: this.consumerElement.readyState,
279
282
  progress: e(this, T)
@@ -306,16 +309,16 @@ class Re extends te {
306
309
  }
307
310
  T = new WeakMap(), W = new WeakMap();
308
311
  customElements.get("e-video") || customElements.define("e-video", Re);
309
- var u, $, S, O, H, Q, Z, ee, Y, ae;
310
- const V = class V extends te {
312
+ var u, $, S, Y, F, Q, Z, ee, D, ae;
313
+ const U = class U extends te {
311
314
  constructor() {
312
315
  super();
313
- s(this, Y);
316
+ s(this, D);
314
317
  s(this, u);
315
318
  s(this, $);
316
319
  s(this, S, !1);
317
- s(this, O, !1);
318
- s(this, H, () => {
320
+ s(this, Y, !1);
321
+ s(this, F, () => {
319
322
  r(this, S, e(this, S) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, u, new window.YT.Player(e(this, $), {
320
323
  playerVars: {
321
324
  mute: this.hasAttribute("muted") ? 1 : 0,
@@ -329,7 +332,7 @@ const V = class V extends te {
329
332
  }));
330
333
  });
331
334
  s(this, Q, () => {
332
- r(this, O, !0), x(this, Y, ae).call(this);
335
+ r(this, Y, !0), x(this, D, ae).call(this);
333
336
  });
334
337
  s(this, Z, (t) => {
335
338
  var i, o;
@@ -337,10 +340,10 @@ const V = class V extends te {
337
340
  });
338
341
  s(this, ee, () => {
339
342
  });
340
- r(this, $, "yt-" + be(10)), V.__apiReady || (window.onYouTubeIframeAPIReady = () => {
341
- V.__apiReady = !0, X(window, "youTubeIframeAPIReady");
343
+ r(this, $, "yt-" + be(10)), U.__apiReady || (window.onYouTubeIframeAPIReady = () => {
344
+ U.__apiReady = !0, V(window, "youTubeIframeAPIReady");
342
345
  }), this.addEventListener("sourceCapture", () => {
343
- this.hasAttribute("capture-autoplay") && (e(this, O) ? e(this, u).playVideo() : r(this, S, !0));
346
+ this.hasAttribute("capture-autoplay") && (e(this, Y) ? e(this, u).playVideo() : r(this, S, !0));
344
347
  }), this.addEventListener("sourceRelease", () => {
345
348
  e(this, u) && this.hasAttribute("capture-autoplay") && (e(this, u).pauseVideo(), this.hasAttribute("replay") && e(this, u).seekTo(0));
346
349
  });
@@ -361,21 +364,21 @@ const V = class V extends te {
361
364
  const y = document.getElementsByTagName("script")[0];
362
365
  (i = y.parentNode) == null || i.insertBefore(o, y);
363
366
  }
364
- e(this, u) ? x(this, Y, ae).call(this) : V.__apiReady ? e(this, H).call(this) : addEventListener("youTubeIframeAPIReady", e(this, H));
367
+ e(this, u) ? x(this, D, ae).call(this) : U.__apiReady ? e(this, F).call(this) : addEventListener("youTubeIframeAPIReady", e(this, F));
365
368
  } else e(this, u) && e(this, u).stopVideo();
366
369
  }
367
370
  disconnectedCallback() {
368
- super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, H));
371
+ super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, F));
369
372
  }
370
373
  };
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() {
374
+ u = new WeakMap(), $ = new WeakMap(), S = new WeakMap(), Y = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), ee = new WeakMap(), D = new WeakSet(), ae = function() {
372
375
  var t, i;
373
376
  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"));
374
- }, V.__apiReady = !1;
375
- let ne = V;
377
+ }, U.__apiReady = !1;
378
+ let ne = U;
376
379
  customElements.get("e-youtube") || customElements.define("e-youtube", ne);
377
380
  export {
378
- Le as ImageElement,
381
+ we as ImageElement,
379
382
  Se as SequenceElement,
380
383
  te as SourceElement,
381
384
  Re as VideoElement,
@@ -4,6 +4,8 @@ import { ClassLinkedStatus } from '../../class-linked-status';
4
4
  export interface SourceEvents {
5
5
  sourceCapture: CustomEvent;
6
6
  sourceRelease: CustomEvent;
7
+ sourceLoaded: CustomEvent;
8
+ sourceError: CustomEvent;
7
9
  }
8
10
  export declare abstract class SourceElement<T extends HTMLElement> extends HTMLElement {
9
11
  #private;
@@ -18,6 +20,7 @@ export declare abstract class SourceElement<T extends HTMLElement> extends HTMLE
18
20
  }>;
19
21
  get isLazy(): boolean;
20
22
  get currentURL(): string | null;
23
+ get isFirstLoadHappened(): boolean;
21
24
  triggerLazyLoad(): void;
22
25
  protected abstract createConsumer(): T;
23
26
  protected abstract consumeSource(url: string | null): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.39.7",
3
+ "version": "0.39.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"