aptechka 0.71.8 → 0.71.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/SourceElement-8nqiFLJ2.cjs +5 -0
- package/lib/SourceElement-DrZ3QNm-.js +257 -0
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +1 -1
- package/lib/SourceElement-D3xzMW9v.cjs +0 -5
- package/lib/SourceElement-DdvZ3tM_.js +0 -255
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var X=c=>{throw TypeError(c)};var W=(c,n,e)=>n.has(c)||X("Cannot "+e);var t=(c,n,e)=>(W(c,n,"read from private field"),e?e.call(c):n.get(c)),i=(c,n,e)=>n.has(c)?X("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,e),s=(c,n,e,a)=>(W(c,n,"write to private field"),a?a.call(c,e):n.set(c,e),e),F=(c,n,e)=>(W(c,n,"access private method"),e);const st=require("./element-linked-store/index.cjs"),it=require("./index-DekP7OZe.cjs"),M=require("./events-KVanG9sR.cjs"),rt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const Z=require("./loading/index.cjs"),nt=require("./order/index.cjs"),Y=require("./window-resizer/index.cjs"),at=require("./Store-Cd1GlEmZ.cjs");var V,b,C,L,d,p,$;class tt{constructor(n){i(this,V);i(this,b);i(this,C);i(this,L);i(this,d);i(this,p);i(this,$);s(this,V,n);let e=n.split(".");const a=/\b\d{1,2}x\b/g,l=e.find(y=>y.match(a)&&parseInt(y));s(this,C,l?parseInt(l):1),l&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const h=/\d+max/g,m=/\d+min/g,w=/\d+mar/g,U=/\d+mir/g,K=e.find(y=>y.match(h)),u=e.find(y=>y.match(m)),x=e.find(y=>y.match(w)),Q=e.find(y=>y.match(U));x?(s(this,d,parseInt(x)),s(this,p,"max"),s(this,L,`(max-aspect-ratio: ${t(this,d)})`)):Q?(s(this,d,parseInt(Q)),s(this,p,"max"),s(this,L,`(min-aspect-ratio: ${t(this,d)})`)):K?(s(this,d,parseInt(K)),s(this,p,"max"),s(this,L,`(max-width: ${t(this,d)}px)`)):u?(s(this,d,parseInt(u)),s(this,L,`(min-width: ${t(this,d)}px)`),s(this,p,"min")):(s(this,d,0),s(this,L,`(min-width: ${t(this,d)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,d)}${t(this,p)}`,"")),s(this,$,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,$,t(this,$).replace(`.${t(this,d)}${t(this,p)}`,""))}get url(){return t(this,V)}get name(){return t(this,b)}get density(){return t(this,C)}get query(){return t(this,L)}get extension(){return t(this,$)}get queryType(){return t(this,p)}get queryValue(){return t(this,d)}}V=new WeakMap,b=new WeakMap,C=new WeakMap,L=new WeakMap,d=new WeakMap,p=new WeakMap,$=new WeakMap;var q;class J{constructor(n,e){i(this,q);s(this,q,new Map);const a=(e==null?void 0:e.mediaBuckets)!==!1,l=typeof n=="string"?a?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,h=[];l.forEach(u=>{const x=new tt(u);h.push([x.query,x])});const m=h.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),w=h.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=h.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...m,...w]:[...m,...w]).forEach(u=>{t(this,q).has(u[0])||t(this,q).set(u[0],[]),t(this,q).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,q)}}q=new WeakMap;var R,A;class et extends at.Store{constructor(e){super(void 0);i(this,R);i(this,A,()=>{let e;t(this,R).mediaBuckets.forEach((h,m)=>{matchMedia(m).matches&&(e=h)});let a,l=0;e==null||e.forEach(h=>{h.density>l&&h.density<=Math.max(devicePixelRatio,1)&&(l=h.density,a=h)}),e!=null&&e.length&&!a&&(a=e[0]),this.current=a});s(this,R,new J(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,R,new J(e.srcset,e.sourceSetOptions)),t(this,A).call(this)}close(){super.close(),this.disconnect()}connect(){Y.windowResizer.subscribe(t(this,A),nt.RESIZE_ORDER.SOURCE_MANAGER),t(this,A).call(this)}disconnect(){Y.windowResizer.unsubscribe(t(this,A))}}R=new WeakMap,A=new WeakMap;function ht(c){if(isNaN(c))return"0:00";const n=Math.floor(Math.max(0,c)),e=Math.floor(n/3600),a=Math.floor(n%3600/60),h=(n%60).toString().padStart(2,"0");if(e>0){const m=a.toString().padStart(2,"0");return`${e}:${m}:${h}`}else return`${a}:${h}`}let ot=0;var f,r,E,S,g,B,I,o,k,O,v,P,T,H,j,_,G,D,N,z;class ct extends HTMLElement{constructor(e){super();i(this,T);i(this,f,null);i(this,r,null);i(this,E,!1);i(this,S,!1);i(this,g,!1);i(this,B,"");i(this,I,"");i(this,o,new st.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,k,null);i(this,O);i(this,v,null);i(this,P);i(this,j,e=>{const a=e[0];t(this,g)&&(!t(this,S)||this.hasAttribute("reload-source"))&&a.isIntersecting&&this.triggerLazyLoad(),a.isIntersecting?M.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,T,H).call(this,void 0),s(this,S,!1)),M.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,_,()=>{t(this,o).set("loaded",!0),t(this,o).set("error",!1),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&Z.loading.complete(t(this,I)),M.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,O,setTimeout(()=>{t(this,o).set("clear",!0)},parseFloat(e)*1e3)):t(this,o).set("clear",!0),s(this,E,!0)});i(this,G,e=>{t(this,o).set("loaded",!1),t(this,o).set("error",!0),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&Z.loading.error(t(this,I)),M.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,o).set("playing",!0),M.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,N,()=>{t(this,o).set("playing",!1),M.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,z,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,o).set("metadata",!0),M.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(a=>{a.textContent=ht(e.duration)}))});s(this,P,e==null?void 0:e.sourceSetOptions),it.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,j))),t(this,o).subscribe(a=>{var h;const l=(h=this.getAttribute("data-global-play-class"))==null?void 0:h.split(",");l!=null&&l.length&&(a.current.playing?l.forEach(m=>{document.documentElement.classList.add(m.trim())}):l.forEach(m=>{document.documentElement.classList.remove(m.trim())}))})}get consumerElement(){return t(this,r)}get sourceManager(){return t(this,f)}get status(){return t(this,o)}get isLazy(){return t(this,g)}get currentURL(){return t(this,v)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,S)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,S,!0),F(this,T,H).call(this,t(this,f).current))}connectedCallback(){var l;s(this,B,`source-consumer-${++ot}`);const e=this.getAttribute("srcset")||"",a=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;a&&t(this,o).addElement(a),(l=this.querySelector(".source-consumer"))==null||l.remove(),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,N)),t(this,r).addEventListener("loadedmetadata",t(this,z)),t(this,z).call(this),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const m=h.nodeValue||"",w=rt.kebabToCamel(h.name);w in t(this,r)&&(t(this,r)[w]=m||!0)}}),this.appendChild(t(this,r)),s(this,f,new et({srcset:e,sourceSetOptions:t(this,P)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(h=>{(!t(this,g)||t(this,g)&&t(this,S))&&F(this,T,H).call(this,h.current)}),t(this,f).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,O)),t(this,k).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,N)),t(this,r).removeEventListener("loadedmetadata",t(this,z)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,S,!1),t(this,o).reset()}}f=new WeakMap,r=new WeakMap,E=new WeakMap,S=new WeakMap,g=new WeakMap,B=new WeakMap,I=new WeakMap,o=new WeakMap,k=new WeakMap,O=new WeakMap,v=new WeakMap,P=new WeakMap,T=new WeakSet,H=function(e){if(clearTimeout(t(this,O)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,o).set("loaded",!1),t(this,o).set("error",!1),t(this,o).set("loading",!1),t(this,o).set("clear",!1),t(this,o).set("playing",!1),t(this,o).set("metadata",!1),e){s(this,I,`${t(this,B)}-${e.url}`);const a=this.hasAttribute("keep-source-parameters");t(this,o).set("loading",!0),s(this,v,a?e.url:e.name+e.extension),this.consumeSource(t(this,v)),!t(this,g)&&!t(this,E)&&Z.loading.add(t(this,I)),t(this,r).onloadeddata=()=>{t(this,_).call(this)},t(this,r).onload=()=>{t(this,_).call(this)},t(this,r).onerror=()=>{t(this,G).call(this,t(this,v))}}else s(this,v,null),this.consumeSource(null)},j=new WeakMap,_=new WeakMap,G=new WeakMap,D=new WeakMap,N=new WeakMap,z=new WeakMap;exports.Source=tt;exports.SourceElement=ct;exports.SourceManager=et;exports.SourceSet=J;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
var Q = (c) => {
|
|
2
|
+
throw TypeError(c);
|
|
3
|
+
};
|
|
4
|
+
var W = (c, a, e) => a.has(c) || Q("Cannot " + e);
|
|
5
|
+
var t = (c, a, e) => (W(c, a, "read from private field"), e ? e.call(c) : a.get(c)), i = (c, a, e) => a.has(c) ? Q("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(c) : a.set(c, e), s = (c, a, e, n) => (W(c, a, "write to private field"), n ? n.call(c, e) : a.set(c, e), e), H = (c, a, e) => (W(c, a, "access private method"), e);
|
|
6
|
+
import { ElementLinkedStore as tt } from "./element-linked-store/index.js";
|
|
7
|
+
import { i as et } from "./index-Bv9zgfdb.js";
|
|
8
|
+
import { d as $ } from "./events-CsVF98U6.js";
|
|
9
|
+
import { k as st } from "./string-BlMQbe8b.js";
|
|
10
|
+
import "construct-style-sheets-polyfill";
|
|
11
|
+
import { loading as Z } from "./loading/index.js";
|
|
12
|
+
import { RESIZE_ORDER as it } from "./order/index.js";
|
|
13
|
+
import { windowResizer as X } from "./window-resizer/index.js";
|
|
14
|
+
import { S as rt } from "./Store-0BVty6AZ.js";
|
|
15
|
+
var C, S, z, L, d, p, q;
|
|
16
|
+
class at {
|
|
17
|
+
constructor(a) {
|
|
18
|
+
i(this, C);
|
|
19
|
+
i(this, S);
|
|
20
|
+
i(this, z);
|
|
21
|
+
i(this, L);
|
|
22
|
+
i(this, d);
|
|
23
|
+
i(this, p);
|
|
24
|
+
i(this, q);
|
|
25
|
+
s(this, C, a);
|
|
26
|
+
let e = a.split(".");
|
|
27
|
+
const n = /\b\d{1,2}x\b/g, u = e.find((y) => y.match(n) && parseInt(y));
|
|
28
|
+
s(this, z, u ? parseInt(u) : 1), u && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
+
const h = /\d+max/g, m = /\d+min/g, w = /\d+mar/g, F = /\d+mir/g, K = e.find((y) => y.match(h)), l = e.find((y) => y.match(m)), x = e.find((y) => y.match(w)), J = e.find((y) => y.match(F));
|
|
30
|
+
x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : J ? (s(this, d, parseInt(J)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : K ? (s(this, d, parseInt(K)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : l ? (s(this, d, parseInt(l)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
|
|
31
|
+
`.${t(this, d)}${t(this, p)}`,
|
|
32
|
+
""
|
|
33
|
+
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
|
+
`.${t(this, d)}${t(this, p)}`,
|
|
35
|
+
""
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
get url() {
|
|
39
|
+
return t(this, C);
|
|
40
|
+
}
|
|
41
|
+
get name() {
|
|
42
|
+
return t(this, S);
|
|
43
|
+
}
|
|
44
|
+
get density() {
|
|
45
|
+
return t(this, z);
|
|
46
|
+
}
|
|
47
|
+
get query() {
|
|
48
|
+
return t(this, L);
|
|
49
|
+
}
|
|
50
|
+
get extension() {
|
|
51
|
+
return t(this, q);
|
|
52
|
+
}
|
|
53
|
+
get queryType() {
|
|
54
|
+
return t(this, p);
|
|
55
|
+
}
|
|
56
|
+
get queryValue() {
|
|
57
|
+
return t(this, d);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
|
+
var M;
|
|
62
|
+
class Y {
|
|
63
|
+
constructor(a, e) {
|
|
64
|
+
i(this, M);
|
|
65
|
+
s(this, M, /* @__PURE__ */ new Map());
|
|
66
|
+
const n = (e == null ? void 0 : e.mediaBuckets) !== !1, u = typeof a == "string" ? n ? a.trim().split(",").map((l) => l.trim()).filter((l) => !!l) : [a] : a, h = [];
|
|
67
|
+
u.forEach((l) => {
|
|
68
|
+
const x = new at(l);
|
|
69
|
+
h.push([x.query, x]);
|
|
70
|
+
});
|
|
71
|
+
const m = h.filter((l) => l[1].queryType.includes("max")).sort((l, x) => x[1].queryValue - l[1].queryValue), w = h.filter((l) => l[1].queryType.includes("min") && l[1].queryValue !== 0).sort((l, x) => l[1].queryValue - x[1].queryValue), F = h.filter((l) => l[0] === "(min-width: 0px)");
|
|
72
|
+
(F ? [...F, ...m, ...w] : [...m, ...w]).forEach((l) => {
|
|
73
|
+
t(this, M).has(l[0]) || t(this, M).set(l[0], []), t(this, M).get(l[0]).push(l[1]);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
get mediaBuckets() {
|
|
77
|
+
return t(this, M);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
M = new WeakMap();
|
|
81
|
+
var k, A;
|
|
82
|
+
class nt extends rt {
|
|
83
|
+
constructor(e) {
|
|
84
|
+
super(void 0);
|
|
85
|
+
i(this, k);
|
|
86
|
+
i(this, A, () => {
|
|
87
|
+
let e;
|
|
88
|
+
t(this, k).mediaBuckets.forEach((h, m) => {
|
|
89
|
+
matchMedia(m).matches && (e = h);
|
|
90
|
+
});
|
|
91
|
+
let n, u = 0;
|
|
92
|
+
e == null || e.forEach((h) => {
|
|
93
|
+
h.density > u && h.density <= Math.max(devicePixelRatio, 1) && (u = h.density, n = h);
|
|
94
|
+
}), e != null && e.length && !n && (n = e[0]), this.current = n;
|
|
95
|
+
});
|
|
96
|
+
s(this, k, new Y(e.srcset, e.sourceSetOptions));
|
|
97
|
+
}
|
|
98
|
+
updateSource(e) {
|
|
99
|
+
s(this, k, new Y(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
super.close(), this.disconnect();
|
|
103
|
+
}
|
|
104
|
+
connect() {
|
|
105
|
+
X.subscribe(t(this, A), it.SOURCE_MANAGER), t(this, A).call(this);
|
|
106
|
+
}
|
|
107
|
+
disconnect() {
|
|
108
|
+
X.unsubscribe(t(this, A));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
k = new WeakMap(), A = new WeakMap();
|
|
112
|
+
function ht(c) {
|
|
113
|
+
if (isNaN(c)) return "0:00";
|
|
114
|
+
const a = Math.floor(Math.max(0, c)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), h = (a % 60).toString().padStart(2, "0");
|
|
115
|
+
if (e > 0) {
|
|
116
|
+
const m = n.toString().padStart(2, "0");
|
|
117
|
+
return `${e}:${m}:${h}`;
|
|
118
|
+
} else
|
|
119
|
+
return `${n}:${h}`;
|
|
120
|
+
}
|
|
121
|
+
let ot = 0;
|
|
122
|
+
var f, r, E, b, g, B, I, o, O, R, v, P, T, j, _, D, G, N, U, V;
|
|
123
|
+
class xt extends HTMLElement {
|
|
124
|
+
constructor(e) {
|
|
125
|
+
super();
|
|
126
|
+
i(this, T);
|
|
127
|
+
i(this, f, null);
|
|
128
|
+
i(this, r, null);
|
|
129
|
+
i(this, E, !1);
|
|
130
|
+
i(this, b, !1);
|
|
131
|
+
i(this, g, !1);
|
|
132
|
+
i(this, B, "");
|
|
133
|
+
i(this, I, "");
|
|
134
|
+
i(this, o, new tt(this, {
|
|
135
|
+
loading: !1,
|
|
136
|
+
loaded: !1,
|
|
137
|
+
error: !1,
|
|
138
|
+
clear: !1,
|
|
139
|
+
playing: !1,
|
|
140
|
+
metadata: !1
|
|
141
|
+
}));
|
|
142
|
+
i(this, O, null);
|
|
143
|
+
i(this, R);
|
|
144
|
+
i(this, v, null);
|
|
145
|
+
i(this, P);
|
|
146
|
+
i(this, _, (e) => {
|
|
147
|
+
const n = e[0];
|
|
148
|
+
t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? $(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (H(this, T, j).call(this, void 0), s(this, b, !1)), $(this, "sourceRelease", { custom: !0 }));
|
|
149
|
+
});
|
|
150
|
+
i(this, D, () => {
|
|
151
|
+
t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && Z.complete(t(this, I)), $(this, "sourceLoaded", { custom: !0 });
|
|
152
|
+
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
153
|
+
e ? s(this, R, setTimeout(() => {
|
|
154
|
+
t(this, o).set("clear", !0);
|
|
155
|
+
}, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, E, !0);
|
|
156
|
+
});
|
|
157
|
+
i(this, G, (e) => {
|
|
158
|
+
t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && Z.error(t(this, I)), $(this, "sourceError", { custom: !0 }), s(this, E, !0);
|
|
159
|
+
});
|
|
160
|
+
i(this, N, () => {
|
|
161
|
+
t(this, o).set("playing", !0), $(this, "sourcePlay", { custom: !0 });
|
|
162
|
+
});
|
|
163
|
+
i(this, U, () => {
|
|
164
|
+
t(this, o).set("playing", !1), $(this, "sourcePause", { custom: !0 });
|
|
165
|
+
});
|
|
166
|
+
i(this, V, () => {
|
|
167
|
+
const e = t(this, r);
|
|
168
|
+
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), $(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
|
|
169
|
+
n.textContent = ht(e.duration);
|
|
170
|
+
}));
|
|
171
|
+
});
|
|
172
|
+
s(this, P, e == null ? void 0 : e.sourceSetOptions), et && window.IntersectionObserver && s(this, O, new IntersectionObserver(
|
|
173
|
+
t(this, _)
|
|
174
|
+
)), t(this, o).subscribe((n) => {
|
|
175
|
+
var h;
|
|
176
|
+
const u = (h = this.getAttribute("data-global-play-class")) == null ? void 0 : h.split(
|
|
177
|
+
","
|
|
178
|
+
);
|
|
179
|
+
u != null && u.length && (n.current.playing ? u.forEach((m) => {
|
|
180
|
+
document.documentElement.classList.add(m.trim());
|
|
181
|
+
}) : u.forEach((m) => {
|
|
182
|
+
document.documentElement.classList.remove(m.trim());
|
|
183
|
+
}));
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
get consumerElement() {
|
|
187
|
+
return t(this, r);
|
|
188
|
+
}
|
|
189
|
+
get sourceManager() {
|
|
190
|
+
return t(this, f);
|
|
191
|
+
}
|
|
192
|
+
get status() {
|
|
193
|
+
return t(this, o);
|
|
194
|
+
}
|
|
195
|
+
get isLazy() {
|
|
196
|
+
return t(this, g);
|
|
197
|
+
}
|
|
198
|
+
get currentURL() {
|
|
199
|
+
return t(this, v);
|
|
200
|
+
}
|
|
201
|
+
get isFirstLoadHappened() {
|
|
202
|
+
return t(this, E);
|
|
203
|
+
}
|
|
204
|
+
triggerLazyLoad() {
|
|
205
|
+
!t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), H(this, T, j).call(this, t(this, f).current));
|
|
206
|
+
}
|
|
207
|
+
connectedCallback() {
|
|
208
|
+
var u;
|
|
209
|
+
s(this, B, `source-consumer-${++ot}`);
|
|
210
|
+
const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
211
|
+
n && t(this, o).addElement(n), (u = this.querySelector(".source-consumer")) == null || u.remove(), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
212
|
+
display: block;
|
|
213
|
+
width: 100%;
|
|
214
|
+
height: 100%;
|
|
215
|
+
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, N)), t(this, r).addEventListener("pause", t(this, U)), t(this, r).addEventListener(
|
|
216
|
+
"loadedmetadata",
|
|
217
|
+
t(this, V)
|
|
218
|
+
), t(this, V).call(this), Array.from(this.attributes).forEach((h) => {
|
|
219
|
+
if (h.name !== "srcset") {
|
|
220
|
+
const m = h.nodeValue || "", w = st(h.name);
|
|
221
|
+
w in t(this, r) && (t(this, r)[w] = m || !0);
|
|
222
|
+
}
|
|
223
|
+
}), this.appendChild(t(this, r)), s(this, f, new nt({
|
|
224
|
+
srcset: e,
|
|
225
|
+
sourceSetOptions: t(this, P)
|
|
226
|
+
})), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((h) => {
|
|
227
|
+
(!t(this, g) || t(this, g) && t(this, b)) && H(this, T, j).call(this, h.current);
|
|
228
|
+
}), t(this, f).connect(), t(this, O).observe(this);
|
|
229
|
+
}
|
|
230
|
+
disconnectedCallback() {
|
|
231
|
+
var e;
|
|
232
|
+
clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, N)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).removeEventListener(
|
|
233
|
+
"loadedmetadata",
|
|
234
|
+
t(this, V)
|
|
235
|
+
), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, o).reset();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
f = new WeakMap(), r = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), I = new WeakMap(), o = new WeakMap(), O = new WeakMap(), R = new WeakMap(), v = new WeakMap(), P = new WeakMap(), T = new WeakSet(), j = function(e) {
|
|
239
|
+
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
|
|
240
|
+
s(this, I, `${t(this, B)}-${e.url}`);
|
|
241
|
+
const n = this.hasAttribute("keep-source-parameters");
|
|
242
|
+
t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && Z.add(t(this, I)), t(this, r).onloadeddata = () => {
|
|
243
|
+
t(this, D).call(this);
|
|
244
|
+
}, t(this, r).onload = () => {
|
|
245
|
+
t(this, D).call(this);
|
|
246
|
+
}, t(this, r).onerror = () => {
|
|
247
|
+
t(this, G).call(this, t(this, v));
|
|
248
|
+
};
|
|
249
|
+
} else
|
|
250
|
+
s(this, v, null), this.consumeSource(null);
|
|
251
|
+
}, _ = new WeakMap(), D = new WeakMap(), G = new WeakMap(), N = new WeakMap(), U = new WeakMap(), V = new WeakMap();
|
|
252
|
+
export {
|
|
253
|
+
at as S,
|
|
254
|
+
xt as a,
|
|
255
|
+
Y as b,
|
|
256
|
+
nt as c
|
|
257
|
+
};
|
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-
|
|
1
|
+
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
|
package/lib/iframe/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var a = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var u = (r, t, e) => t.has(r) || a("Cannot " + e);
|
|
5
5
|
var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
6
|
-
import { a as E } from "../SourceElement-
|
|
6
|
+
import { a as E } from "../SourceElement-DrZ3QNm-.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as f } from "../index-Bv9zgfdb.js";
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
|
package/lib/image/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
-
import { a as s } from "../SourceElement-
|
|
2
|
+
import { a as s } from "../SourceElement-DrZ3QNm-.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/sequence/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-
|
|
1
|
+
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const M=require("../canvas/index.cjs");function W(s){const n=s.match(/\{([\d-]+)\}/);if(n){const e=n[1].split("-");if(e.length===2){const i=parseInt(e[0],10),f=parseInt(e[1],10);return{start:i,end:f}}}return null}var h,E,S,m,d,b,g,p,a,v;class B extends H.SourceElement{constructor(e){super();c(this,h,[]);c(this,E,new q.CSSProperty(this,"--fit","contain"));c(this,S,new q.CSSProperty(this,"--autoplay",!1));c(this,m,new q.CSSProperty(this,"--offset-x",.5));c(this,d,new q.CSSProperty(this,"--offset-y",.5));c(this,b,null);c(this,g,0);c(this,p,1);c(this,a,()=>{if(t(this,h).length){const e=t(this,h)[0];t(this,E).current==="cover"?l(this,b,z.cover(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current)):l(this,b,z.contain(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current))}});c(this,v,e=>{if(this.status.isFalse("loaded")||!t(this,b))return;e.detail.context.clearRect(0,0,e.detail.width,e.detail.height);const i=t(this,h)[t(this,g)];i&&e.detail.context.drawImage(i,...t(this,b)),t(this,S).current&&l(this,g,(t(this,g)+1)%t(this,h).length)});k.isBrowser&&(l(this,p,parseInt(((e==null?void 0:e.pad)||this.getAttribute("pad")||"1").toString())),t(this,E).subscribe(t(this,a)),t(this,m).subscribe(t(this,a)),t(this,d).subscribe(t(this,a)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",t(this,v))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",t(this,v))}))}setProgress(e){t(this,h).length&&l(this,g,Math.floor((t(this,h).length-1)*e))}connectedCallback(){super.connectedCallback(),t(this,S).observe(),t(this,E).observe(),t(this,m).observe(),t(this,d).observe(),R.elementResizer.subscribe(this,t(this,a))}disconnectedCallback(){super.disconnectedCallback(),t(this,S).unobserve(),t(this,E).unobserve(),t(this,m).unobserve(),t(this,d).unobserve(),l(this,h,[]),R.elementResizer.unsubscribe(t(this,a)),this.consumerElement.removeEventListener("canvasRender",t(this,v))}createConsumer(){return new M.CanvasElement}consumeSource(e){return L(this,null,function*(){var i,f,w,y;if(e){this.consumerElement.removeEventListener("canvasRender",t(this,v));const u=[],o=W(e);if(o)for(let r=o.start;r<=o.end;r++){const P=e.replace(/\{([^}]+)\}/,r.toString().padStart(t(this,p),"0")),C=new Image;C.src=P,u.push(C)}else{const r=new Image;r.src=e,u.push(r)}try{yield Promise.all(u.map((r,P)=>new Promise((C,_)=>{r.onload=()=>{C()},r.onerror=j=>{_(`${r.src} Image not found`)}}))),l(this,h,u),t(this,a).call(this),(f=(i=this.consumerElement).onload)==null||f.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",t(this,v))}catch(r){console.error(r),(y=(w=this.consumerElement).onerror)==null||y.call(w,new Event("error"))}}})}}h=new WeakMap,E=new WeakMap,S=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,g=new WeakMap,p=new WeakMap,a=new WeakMap,v=new WeakMap;k.isBrowser&&!customElements.get("e-sequence")&&customElements.define("e-sequence",B);exports.SequenceElement=B;
|
package/lib/sequence/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { elementResizer as k } from "../element-resizer/index.js";
|
|
|
24
24
|
import { i as q } from "../index-Bv9zgfdb.js";
|
|
25
25
|
import { c as B, a as H } from "../canvas-DeZ0SLUJ.js";
|
|
26
26
|
import "construct-style-sheets-polyfill";
|
|
27
|
-
import { a as W } from "../SourceElement-
|
|
27
|
+
import { a as W } from "../SourceElement-DrZ3QNm-.js";
|
|
28
28
|
import "../window-resizer/index.js";
|
|
29
29
|
import "../Store-0BVty6AZ.js";
|
|
30
30
|
import { CanvasElement as A } from "../canvas/index.js";
|
package/lib/source/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-8nqiFLJ2.cjs");exports.Source=e.Source;exports.SourceElement=e.SourceElement;exports.SourceManager=e.SourceManager;exports.SourceSet=e.SourceSet;
|
package/lib/source/index.js
CHANGED
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||h("Cannot "+e);var i=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),u=(t,s,e)=>s.has(t)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),c=(t,s,e,l)=>(m(t,s,"write to private field"),l?l.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-
|
|
1
|
+
"use strict";var h=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||h("Cannot "+e);var i=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),u=(t,s,e)=>s.has(t)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),c=(t,s,e,l)=>(m(t,s,"write to private field"),l?l.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const p=require("../index-DekP7OZe.cjs"),b=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var r,n,a;class d extends E.SourceElement{constructor(){super(...arguments);u(this,r,0);u(this,n,!1);u(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e!==i(this,r)&&b.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}}),e>i(this,r)&&c(this,r,e),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(i(this,a)),i(this,n)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,n,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,n,!0)),o.ticker.subscribe(i(this,a))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&this.consumerElement.pause(),this.hasAttribute("release-pause")&&this.consumerElement.pause(),this.hasAttribute("release-stop")&&(this.consumerElement.pause(),this.consumerElement.currentTime=0),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")}),this.addEventListener("click",()=>{this.hasAttribute("click-controls")&&(this.consumerElement.paused?this.consumerElement.play():this.consumerElement.pause())})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||"",e&&this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}r=new WeakMap,n=new WeakMap,a=new WeakMap;p.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
package/lib/video/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var h = (t) => {
|
|
|
3
3
|
};
|
|
4
4
|
var l = (t, s, e) => s.has(t) || h("Cannot " + e);
|
|
5
5
|
var i = (t, s, e) => (l(t, s, "read from private field"), e ? e.call(t) : s.get(t)), c = (t, s, e) => s.has(t) ? h("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), o = (t, s, e, m) => (l(t, s, "write to private field"), m ? m.call(t, e) : s.set(t, e), e);
|
|
6
|
-
import { a as d } from "../SourceElement-
|
|
6
|
+
import { a as d } from "../SourceElement-DrZ3QNm-.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as p } from "../index-Bv9zgfdb.js";
|
package/lib/youtube/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-
|
|
1
|
+
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-8nqiFLJ2.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const L=require("../index-DekP7OZe.cjs"),T=require("../events-KVanG9sR.cjs"),_=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");var i,c,n,y,l,f,b,R,p,I;const d=class d extends A.SourceElement{constructor(){super();o(this,p);o(this,i);o(this,c);o(this,n,!1);o(this,y,!1);o(this,l,()=>{u(this,n,e(this,n)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),u(this,i,new window.YT.Player(e(this,c),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,f),onError:e(this,b),onStateChange:e(this,R)}}))});o(this,f,()=>{u(this,y,!0),w(this,p,I).call(this)});o(this,b,t=>{var a,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(a=this.consumerElement).onerror)==null||h.call(a,new Event("error"))});o(this,R,()=>{});u(this,c,"yt-"+_.generateId(10)),d.__apiReady||(window.onYouTubeIframeAPIReady=()=>{d.__apiReady=!0,T.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,y)?e(this,i).playVideo():u(this,n,!0))}),this.addEventListener("sourceRelease",()=>{e(this,i)&&this.hasAttribute("capture-autoplay")&&(e(this,i).pauseVideo(),this.hasAttribute("replay")&&e(this,i).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,c),t}consumeSource(t){var a;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const g=document.getElementsByTagName("script")[0];(a=g.parentNode)==null||a.insertBefore(h,g)}e(this,i)?w(this,p,I).call(this):d.__apiReady?e(this,l).call(this):addEventListener("youTubeIframeAPIReady",e(this,l))}else e(this,i)&&e(this,i).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,i)&&e(this,i).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,l))}};i=new WeakMap,c=new WeakMap,n=new WeakMap,y=new WeakMap,l=new WeakMap,f=new WeakMap,b=new WeakMap,R=new WeakMap,p=new WeakSet,I=function(){var t,a;this.currentURL&&(this.currentURL.startsWith("http")?e(this,i).loadVideoByUrl(this.currentURL):e(this,i).loadVideoById(this.currentURL)),e(this,n)?e(this,i).playVideo():e(this,i).stopVideo(),u(this,n,!1),(a=(t=this.consumerElement).onload)==null||a.call(t,new Event("load"))},d.__apiReady=!1;let m=d;L.isBrowser&&!customElements.get("e-youtube")&&customElements.define("e-youtube",m);exports.YouTubeElement=m;
|
package/lib/youtube/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var L = (s) => {
|
|
|
3
3
|
};
|
|
4
4
|
var b = (s, r, t) => r.has(s) || L("Cannot " + t);
|
|
5
5
|
var e = (s, r, t) => (b(s, r, "read from private field"), t ? t.call(s) : r.get(s)), o = (s, r, t) => r.has(s) ? L("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), u = (s, r, t, a) => (b(s, r, "write to private field"), a ? a.call(s, t) : r.set(s, t), t), E = (s, r, t) => (b(s, r, "access private method"), t);
|
|
6
|
-
import { a as g } from "../SourceElement-
|
|
6
|
+
import { a as g } from "../SourceElement-DrZ3QNm-.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as v } from "../index-Bv9zgfdb.js";
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var X=h=>{throw TypeError(h)};var W=(h,a,e)=>a.has(h)||X("Cannot "+e);var t=(h,a,e)=>(W(h,a,"read from private field"),e?e.call(h):a.get(h)),i=(h,a,e)=>a.has(h)?X("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(h):a.set(h,e),s=(h,a,e,n)=>(W(h,a,"write to private field"),n?n.call(h,e):a.set(h,e),e),F=(h,a,e)=>(W(h,a,"access private method"),e);const st=require("./element-linked-store/index.cjs"),it=require("./index-DekP7OZe.cjs"),M=require("./events-KVanG9sR.cjs"),rt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const Z=require("./loading/index.cjs"),at=require("./order/index.cjs"),Y=require("./window-resizer/index.cjs"),nt=require("./Store-Cd1GlEmZ.cjs");var z,b,V,L,u,p,$;class tt{constructor(a){i(this,z);i(this,b);i(this,V);i(this,L);i(this,u);i(this,p);i(this,$);s(this,z,a);let e=a.split(".");const n=/\b\d{1,2}x\b/g,d=e.find(y=>y.match(n)&&parseInt(y));s(this,V,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,f=/\d+min/g,w=/\d+mar/g,U=/\d+mir/g,K=e.find(y=>y.match(l)),o=e.find(y=>y.match(f)),x=e.find(y=>y.match(w)),Q=e.find(y=>y.match(U));x?(s(this,u,parseInt(x)),s(this,p,"max"),s(this,L,`(max-aspect-ratio: ${t(this,u)})`)):Q?(s(this,u,parseInt(Q)),s(this,p,"max"),s(this,L,`(min-aspect-ratio: ${t(this,u)})`)):K?(s(this,u,parseInt(K)),s(this,p,"max"),s(this,L,`(max-width: ${t(this,u)}px)`)):o?(s(this,u,parseInt(o)),s(this,L,`(min-width: ${t(this,u)}px)`),s(this,p,"min")):(s(this,u,0),s(this,L,`(min-width: ${t(this,u)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,u)}${t(this,p)}`,"")),s(this,$,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,$,t(this,$).replace(`.${t(this,u)}${t(this,p)}`,""))}get url(){return t(this,z)}get name(){return t(this,b)}get density(){return t(this,V)}get query(){return t(this,L)}get extension(){return t(this,$)}get queryType(){return t(this,p)}get queryValue(){return t(this,u)}}z=new WeakMap,b=new WeakMap,V=new WeakMap,L=new WeakMap,u=new WeakMap,p=new WeakMap,$=new WeakMap;var q;class J{constructor(a,e){i(this,q);s(this,q,new Map);const n=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof a=="string"?n?a.trim().split(",").map(o=>o.trim()).filter(o=>!!o):[a]:a,l=[];d.forEach(o=>{const x=new tt(o);l.push([x.query,x])});const f=l.filter(o=>o[1].queryType.includes("max")).sort((o,x)=>x[1].queryValue-o[1].queryValue),w=l.filter(o=>o[1].queryType.includes("min")&&o[1].queryValue!==0).sort((o,x)=>o[1].queryValue-x[1].queryValue),U=l.filter(o=>o[0]==="(min-width: 0px)");(U?[...U,...f,...w]:[...f,...w]).forEach(o=>{t(this,q).has(o[0])||t(this,q).set(o[0],[]),t(this,q).get(o[0]).push(o[1])})}get mediaBuckets(){return t(this,q)}}q=new WeakMap;var R,A;class et extends nt.Store{constructor(e){super(void 0);i(this,R);i(this,A,()=>{let e;t(this,R).mediaBuckets.forEach((l,f)=>{matchMedia(f).matches&&(e=l)});let n,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,n=l)}),e!=null&&e.length&&!n&&(n=e[0]),this.current=n});s(this,R,new J(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,R,new J(e.srcset,e.sourceSetOptions)),t(this,A).call(this)}close(){super.close(),this.disconnect()}connect(){Y.windowResizer.subscribe(t(this,A),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,A).call(this)}disconnect(){Y.windowResizer.unsubscribe(t(this,A))}}R=new WeakMap,A=new WeakMap;function ht(h){if(isNaN(h))return"0:00";const a=Math.floor(Math.max(0,h)),e=Math.floor(a/3600),n=Math.floor(a%3600/60),l=(a%60).toString().padStart(2,"0");if(e>0){const f=n.toString().padStart(2,"0");return`${e}:${f}:${l}`}else return`${n}:${l}`}let ot=0;var m,r,E,S,g,B,I,c,k,C,v,P,O,H,j,_,G,D,N,T;class ct extends HTMLElement{constructor(e){super();i(this,O);i(this,m,null);i(this,r,null);i(this,E,!1);i(this,S,!1);i(this,g,!1);i(this,B,"");i(this,I,"");i(this,c,new st.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,k,null);i(this,C);i(this,v,null);i(this,P);i(this,j,e=>{const n=e[0];t(this,g)&&(!t(this,S)||this.hasAttribute("reload-source"))&&n.isIntersecting&&this.triggerLazyLoad(),n.isIntersecting?M.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,O,H).call(this,void 0),s(this,S,!1)),M.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,_,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&Z.loading.complete(t(this,I)),M.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,C,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,E,!0)});i(this,G,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,E)&&Z.loading.error(t(this,I)),M.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,c).set("playing",!0);const e=this.getAttribute("data-global-play-class");e&&e.split(",").forEach(n=>{document.documentElement.classList.add(n.trim())}),M.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,N,()=>{t(this,c).set("playing",!1);const e=this.getAttribute("data-global-play-class");e&&e.split(",").forEach(n=>{document.documentElement.classList.remove(n.trim())}),M.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,T,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,c).set("metadata",!0),M.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(n=>{n.textContent=ht(e.duration)}))});s(this,P,e==null?void 0:e.sourceSetOptions),it.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,j)))}get consumerElement(){return t(this,r)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,v)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,S)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,S,!0),F(this,O,H).call(this,t(this,m).current))}connectedCallback(){var d;s(this,B,`source-consumer-${++ot}`);const e=this.getAttribute("srcset")||"",n=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;n&&t(this,c).addElement(n),(d=this.querySelector(".source-consumer"))==null||d.remove(),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,N)),t(this,r).addEventListener("loadedmetadata",t(this,T)),t(this,T).call(this),Array.from(this.attributes).forEach(l=>{if(l.name!=="srcset"){const f=l.nodeValue||"",w=rt.kebabToCamel(l.name);w in t(this,r)&&(t(this,r)[w]=f||!0)}}),this.appendChild(t(this,r)),s(this,m,new et({srcset:e,sourceSetOptions:t(this,P)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(l=>{(!t(this,g)||t(this,g)&&t(this,S))&&F(this,O,H).call(this,l.current)}),t(this,m).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,C)),t(this,k).disconnect(),(e=t(this,m))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,N)),t(this,r).removeEventListener("loadedmetadata",t(this,T)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,S,!1),t(this,c).reset()}}m=new WeakMap,r=new WeakMap,E=new WeakMap,S=new WeakMap,g=new WeakMap,B=new WeakMap,I=new WeakMap,c=new WeakMap,k=new WeakMap,C=new WeakMap,v=new WeakMap,P=new WeakMap,O=new WeakSet,H=function(e){if(clearTimeout(t(this,C)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),t(this,c).set("playing",!1),t(this,c).set("metadata",!1),e){s(this,I,`${t(this,B)}-${e.url}`);const n=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,v,n?e.url:e.name+e.extension),this.consumeSource(t(this,v)),!t(this,g)&&!t(this,E)&&Z.loading.add(t(this,I)),t(this,r).onloadeddata=()=>{t(this,_).call(this)},t(this,r).onload=()=>{t(this,_).call(this)},t(this,r).onerror=()=>{t(this,G).call(this,t(this,v))}}else s(this,v,null),this.consumeSource(null)},j=new WeakMap,_=new WeakMap,G=new WeakMap,D=new WeakMap,N=new WeakMap,T=new WeakMap;exports.Source=tt;exports.SourceElement=ct;exports.SourceManager=et;exports.SourceSet=J;
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
var Q = (h) => {
|
|
2
|
-
throw TypeError(h);
|
|
3
|
-
};
|
|
4
|
-
var W = (h, a, e) => a.has(h) || Q("Cannot " + e);
|
|
5
|
-
var t = (h, a, e) => (W(h, a, "read from private field"), e ? e.call(h) : a.get(h)), i = (h, a, e) => a.has(h) ? Q("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(h) : a.set(h, e), s = (h, a, e, n) => (W(h, a, "write to private field"), n ? n.call(h, e) : a.set(h, e), e), H = (h, a, e) => (W(h, a, "access private method"), e);
|
|
6
|
-
import { ElementLinkedStore as tt } from "./element-linked-store/index.js";
|
|
7
|
-
import { i as et } from "./index-Bv9zgfdb.js";
|
|
8
|
-
import { d as $ } from "./events-CsVF98U6.js";
|
|
9
|
-
import { k as st } from "./string-BlMQbe8b.js";
|
|
10
|
-
import "construct-style-sheets-polyfill";
|
|
11
|
-
import { loading as Z } from "./loading/index.js";
|
|
12
|
-
import { RESIZE_ORDER as it } from "./order/index.js";
|
|
13
|
-
import { windowResizer as X } from "./window-resizer/index.js";
|
|
14
|
-
import { S as rt } from "./Store-0BVty6AZ.js";
|
|
15
|
-
var V, S, z, x, u, p, q;
|
|
16
|
-
class at {
|
|
17
|
-
constructor(a) {
|
|
18
|
-
i(this, V);
|
|
19
|
-
i(this, S);
|
|
20
|
-
i(this, z);
|
|
21
|
-
i(this, x);
|
|
22
|
-
i(this, u);
|
|
23
|
-
i(this, p);
|
|
24
|
-
i(this, q);
|
|
25
|
-
s(this, V, a);
|
|
26
|
-
let e = a.split(".");
|
|
27
|
-
const n = /\b\d{1,2}x\b/g, d = e.find((y) => y.match(n) && parseInt(y));
|
|
28
|
-
s(this, z, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
-
const c = /\d+max/g, f = /\d+min/g, w = /\d+mar/g, F = /\d+mir/g, K = e.find((y) => y.match(c)), o = e.find((y) => y.match(f)), E = e.find((y) => y.match(w)), J = e.find((y) => y.match(F));
|
|
30
|
-
E ? (s(this, u, parseInt(E)), s(this, p, "max"), s(this, x, `(max-aspect-ratio: ${t(this, u)})`)) : J ? (s(this, u, parseInt(J)), s(this, p, "max"), s(this, x, `(min-aspect-ratio: ${t(this, u)})`)) : K ? (s(this, u, parseInt(K)), s(this, p, "max"), s(this, x, `(max-width: ${t(this, u)}px)`)) : o ? (s(this, u, parseInt(o)), s(this, x, `(min-width: ${t(this, u)}px)`), s(this, p, "min")) : (s(this, u, 0), s(this, x, `(min-width: ${t(this, u)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
|
|
31
|
-
`.${t(this, u)}${t(this, p)}`,
|
|
32
|
-
""
|
|
33
|
-
)), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
|
|
34
|
-
`.${t(this, u)}${t(this, p)}`,
|
|
35
|
-
""
|
|
36
|
-
));
|
|
37
|
-
}
|
|
38
|
-
get url() {
|
|
39
|
-
return t(this, V);
|
|
40
|
-
}
|
|
41
|
-
get name() {
|
|
42
|
-
return t(this, S);
|
|
43
|
-
}
|
|
44
|
-
get density() {
|
|
45
|
-
return t(this, z);
|
|
46
|
-
}
|
|
47
|
-
get query() {
|
|
48
|
-
return t(this, x);
|
|
49
|
-
}
|
|
50
|
-
get extension() {
|
|
51
|
-
return t(this, q);
|
|
52
|
-
}
|
|
53
|
-
get queryType() {
|
|
54
|
-
return t(this, p);
|
|
55
|
-
}
|
|
56
|
-
get queryValue() {
|
|
57
|
-
return t(this, u);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
V = new WeakMap(), S = new WeakMap(), z = new WeakMap(), x = new WeakMap(), u = new WeakMap(), p = new WeakMap(), q = new WeakMap();
|
|
61
|
-
var M;
|
|
62
|
-
class Y {
|
|
63
|
-
constructor(a, e) {
|
|
64
|
-
i(this, M);
|
|
65
|
-
s(this, M, /* @__PURE__ */ new Map());
|
|
66
|
-
const n = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof a == "string" ? n ? a.trim().split(",").map((o) => o.trim()).filter((o) => !!o) : [a] : a, c = [];
|
|
67
|
-
d.forEach((o) => {
|
|
68
|
-
const E = new at(o);
|
|
69
|
-
c.push([E.query, E]);
|
|
70
|
-
});
|
|
71
|
-
const f = c.filter((o) => o[1].queryType.includes("max")).sort((o, E) => E[1].queryValue - o[1].queryValue), w = c.filter((o) => o[1].queryType.includes("min") && o[1].queryValue !== 0).sort((o, E) => o[1].queryValue - E[1].queryValue), F = c.filter((o) => o[0] === "(min-width: 0px)");
|
|
72
|
-
(F ? [...F, ...f, ...w] : [...f, ...w]).forEach((o) => {
|
|
73
|
-
t(this, M).has(o[0]) || t(this, M).set(o[0], []), t(this, M).get(o[0]).push(o[1]);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
get mediaBuckets() {
|
|
77
|
-
return t(this, M);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
M = new WeakMap();
|
|
81
|
-
var k, A;
|
|
82
|
-
class nt extends rt {
|
|
83
|
-
constructor(e) {
|
|
84
|
-
super(void 0);
|
|
85
|
-
i(this, k);
|
|
86
|
-
i(this, A, () => {
|
|
87
|
-
let e;
|
|
88
|
-
t(this, k).mediaBuckets.forEach((c, f) => {
|
|
89
|
-
matchMedia(f).matches && (e = c);
|
|
90
|
-
});
|
|
91
|
-
let n, d = 0;
|
|
92
|
-
e == null || e.forEach((c) => {
|
|
93
|
-
c.density > d && c.density <= Math.max(devicePixelRatio, 1) && (d = c.density, n = c);
|
|
94
|
-
}), e != null && e.length && !n && (n = e[0]), this.current = n;
|
|
95
|
-
});
|
|
96
|
-
s(this, k, new Y(e.srcset, e.sourceSetOptions));
|
|
97
|
-
}
|
|
98
|
-
updateSource(e) {
|
|
99
|
-
s(this, k, new Y(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
|
|
100
|
-
}
|
|
101
|
-
close() {
|
|
102
|
-
super.close(), this.disconnect();
|
|
103
|
-
}
|
|
104
|
-
connect() {
|
|
105
|
-
X.subscribe(t(this, A), it.SOURCE_MANAGER), t(this, A).call(this);
|
|
106
|
-
}
|
|
107
|
-
disconnect() {
|
|
108
|
-
X.unsubscribe(t(this, A));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
k = new WeakMap(), A = new WeakMap();
|
|
112
|
-
function ht(h) {
|
|
113
|
-
if (isNaN(h)) return "0:00";
|
|
114
|
-
const a = Math.floor(Math.max(0, h)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), c = (a % 60).toString().padStart(2, "0");
|
|
115
|
-
if (e > 0) {
|
|
116
|
-
const f = n.toString().padStart(2, "0");
|
|
117
|
-
return `${e}:${f}:${c}`;
|
|
118
|
-
} else
|
|
119
|
-
return `${n}:${c}`;
|
|
120
|
-
}
|
|
121
|
-
let ot = 0;
|
|
122
|
-
var m, r, b, L, g, B, I, l, C, O, v, P, R, j, _, D, G, N, U, T;
|
|
123
|
-
class Et extends HTMLElement {
|
|
124
|
-
constructor(e) {
|
|
125
|
-
super();
|
|
126
|
-
i(this, R);
|
|
127
|
-
i(this, m, null);
|
|
128
|
-
i(this, r, null);
|
|
129
|
-
i(this, b, !1);
|
|
130
|
-
i(this, L, !1);
|
|
131
|
-
i(this, g, !1);
|
|
132
|
-
i(this, B, "");
|
|
133
|
-
i(this, I, "");
|
|
134
|
-
i(this, l, new tt(this, {
|
|
135
|
-
loading: !1,
|
|
136
|
-
loaded: !1,
|
|
137
|
-
error: !1,
|
|
138
|
-
clear: !1,
|
|
139
|
-
playing: !1,
|
|
140
|
-
metadata: !1
|
|
141
|
-
}));
|
|
142
|
-
i(this, C, null);
|
|
143
|
-
i(this, O);
|
|
144
|
-
i(this, v, null);
|
|
145
|
-
i(this, P);
|
|
146
|
-
i(this, _, (e) => {
|
|
147
|
-
const n = e[0];
|
|
148
|
-
t(this, g) && (!t(this, L) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? $(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (H(this, R, j).call(this, void 0), s(this, L, !1)), $(this, "sourceRelease", { custom: !0 }));
|
|
149
|
-
});
|
|
150
|
-
i(this, D, () => {
|
|
151
|
-
t(this, l).set("loaded", !0), t(this, l).set("error", !1), t(this, l).set("loading", !1), !t(this, g) && !t(this, b) && Z.complete(t(this, I)), $(this, "sourceLoaded", { custom: !0 });
|
|
152
|
-
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
153
|
-
e ? s(this, O, setTimeout(() => {
|
|
154
|
-
t(this, l).set("clear", !0);
|
|
155
|
-
}, parseFloat(e) * 1e3)) : t(this, l).set("clear", !0), s(this, b, !0);
|
|
156
|
-
});
|
|
157
|
-
i(this, G, (e) => {
|
|
158
|
-
t(this, l).set("loaded", !1), t(this, l).set("error", !0), t(this, l).set("loading", !1), !t(this, g) && !t(this, b) && Z.error(t(this, I)), $(this, "sourceError", { custom: !0 }), s(this, b, !0);
|
|
159
|
-
});
|
|
160
|
-
i(this, N, () => {
|
|
161
|
-
t(this, l).set("playing", !0);
|
|
162
|
-
const e = this.getAttribute("data-global-play-class");
|
|
163
|
-
e && e.split(",").forEach((n) => {
|
|
164
|
-
document.documentElement.classList.add(n.trim());
|
|
165
|
-
}), $(this, "sourcePlay", { custom: !0 });
|
|
166
|
-
});
|
|
167
|
-
i(this, U, () => {
|
|
168
|
-
t(this, l).set("playing", !1);
|
|
169
|
-
const e = this.getAttribute("data-global-play-class");
|
|
170
|
-
e && e.split(",").forEach((n) => {
|
|
171
|
-
document.documentElement.classList.remove(n.trim());
|
|
172
|
-
}), $(this, "sourcePause", { custom: !0 });
|
|
173
|
-
});
|
|
174
|
-
i(this, T, () => {
|
|
175
|
-
const e = t(this, r);
|
|
176
|
-
(e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, l).set("metadata", !0), $(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
|
|
177
|
-
n.textContent = ht(e.duration);
|
|
178
|
-
}));
|
|
179
|
-
});
|
|
180
|
-
s(this, P, e == null ? void 0 : e.sourceSetOptions), et && window.IntersectionObserver && s(this, C, new IntersectionObserver(
|
|
181
|
-
t(this, _)
|
|
182
|
-
));
|
|
183
|
-
}
|
|
184
|
-
get consumerElement() {
|
|
185
|
-
return t(this, r);
|
|
186
|
-
}
|
|
187
|
-
get sourceManager() {
|
|
188
|
-
return t(this, m);
|
|
189
|
-
}
|
|
190
|
-
get status() {
|
|
191
|
-
return t(this, l);
|
|
192
|
-
}
|
|
193
|
-
get isLazy() {
|
|
194
|
-
return t(this, g);
|
|
195
|
-
}
|
|
196
|
-
get currentURL() {
|
|
197
|
-
return t(this, v);
|
|
198
|
-
}
|
|
199
|
-
get isFirstLoadHappened() {
|
|
200
|
-
return t(this, b);
|
|
201
|
-
}
|
|
202
|
-
triggerLazyLoad() {
|
|
203
|
-
!t(this, L) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, L, !0), H(this, R, j).call(this, t(this, m).current));
|
|
204
|
-
}
|
|
205
|
-
connectedCallback() {
|
|
206
|
-
var d;
|
|
207
|
-
s(this, B, `source-consumer-${++ot}`);
|
|
208
|
-
const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
209
|
-
n && t(this, l).addElement(n), (d = this.querySelector(".source-consumer")) == null || d.remove(), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
210
|
-
display: block;
|
|
211
|
-
width: 100%;
|
|
212
|
-
height: 100%;
|
|
213
|
-
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, N)), t(this, r).addEventListener("pause", t(this, U)), t(this, r).addEventListener(
|
|
214
|
-
"loadedmetadata",
|
|
215
|
-
t(this, T)
|
|
216
|
-
), t(this, T).call(this), Array.from(this.attributes).forEach((c) => {
|
|
217
|
-
if (c.name !== "srcset") {
|
|
218
|
-
const f = c.nodeValue || "", w = st(c.name);
|
|
219
|
-
w in t(this, r) && (t(this, r)[w] = f || !0);
|
|
220
|
-
}
|
|
221
|
-
}), this.appendChild(t(this, r)), s(this, m, new nt({
|
|
222
|
-
srcset: e,
|
|
223
|
-
sourceSetOptions: t(this, P)
|
|
224
|
-
})), s(this, g, this.hasAttribute("lazy")), t(this, m).subscribe((c) => {
|
|
225
|
-
(!t(this, g) || t(this, g) && t(this, L)) && H(this, R, j).call(this, c.current);
|
|
226
|
-
}), t(this, m).connect(), t(this, C).observe(this);
|
|
227
|
-
}
|
|
228
|
-
disconnectedCallback() {
|
|
229
|
-
var e;
|
|
230
|
-
clearTimeout(t(this, O)), t(this, C).disconnect(), (e = t(this, m)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, N)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).removeEventListener(
|
|
231
|
-
"loadedmetadata",
|
|
232
|
-
t(this, T)
|
|
233
|
-
), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, b, !1), s(this, L, !1), t(this, l).reset();
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
m = new WeakMap(), r = new WeakMap(), b = new WeakMap(), L = new WeakMap(), g = new WeakMap(), B = new WeakMap(), I = new WeakMap(), l = new WeakMap(), C = new WeakMap(), O = new WeakMap(), v = new WeakMap(), P = new WeakMap(), R = new WeakSet(), j = function(e) {
|
|
237
|
-
if (clearTimeout(t(this, O)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, l).set("loaded", !1), t(this, l).set("error", !1), t(this, l).set("loading", !1), t(this, l).set("clear", !1), t(this, l).set("playing", !1), t(this, l).set("metadata", !1), e) {
|
|
238
|
-
s(this, I, `${t(this, B)}-${e.url}`);
|
|
239
|
-
const n = this.hasAttribute("keep-source-parameters");
|
|
240
|
-
t(this, l).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, b) && Z.add(t(this, I)), t(this, r).onloadeddata = () => {
|
|
241
|
-
t(this, D).call(this);
|
|
242
|
-
}, t(this, r).onload = () => {
|
|
243
|
-
t(this, D).call(this);
|
|
244
|
-
}, t(this, r).onerror = () => {
|
|
245
|
-
t(this, G).call(this, t(this, v));
|
|
246
|
-
};
|
|
247
|
-
} else
|
|
248
|
-
s(this, v, null), this.consumeSource(null);
|
|
249
|
-
}, _ = new WeakMap(), D = new WeakMap(), G = new WeakMap(), N = new WeakMap(), U = new WeakMap(), T = new WeakMap();
|
|
250
|
-
export {
|
|
251
|
-
at as S,
|
|
252
|
-
Et as a,
|
|
253
|
-
Y as b,
|
|
254
|
-
nt as c
|
|
255
|
-
};
|