domquery-com 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domquery-com",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A modern JavaScript library that integrates all features needed for web app development. Optimized for hybrid app/WebView environments.",
5
5
  "main": "domquery.js",
6
6
  "module": "domquery.js",
@@ -1,38 +1,91 @@
1
- $.lazyLoadImages = function(g, k, p) {
1
+ $.lazyLoadImages = function(h, p, r) {
2
2
  if (!this.elements || !Array.isArray(this.elements)) throw Error("lazyLoadImages.js requires domquery.js (this.elements is required)");
3
- if ("object" === typeof g && g.simply) {
4
- const a = g.selector || "[data-src]";
5
- if (1 === this.elements.length && this.elements[0] === document) g = document.querySelectorAll(a);
3
+ if ("object" === typeof h && h.simply) {
4
+ const a = h.selector || "[data-src]";
5
+ let b;
6
+ if (1 === this.elements.length && this.elements[0] === document) b = document.querySelectorAll(a);
6
7
  else {
7
8
  const c = new Set;
8
- this.elements.forEach(b => {
9
- b.querySelectorAll(a).forEach(e => c.add(e))
9
+ this.elements.forEach(e => {
10
+ e.querySelectorAll(a).forEach(k => c.add(k))
10
11
  });
11
- g = Array.from(c)
12
+ b = Array.from(c)
13
+ }
14
+ const d = c => {
15
+ const e = c.dataset.src;
16
+ e && ("img" === c.tagName.toLowerCase() ?
17
+ (c.src = e, c.alt = c.alt || "") : c.style.backgroundImage = `url(${e})`, c.removeAttribute("data-src"))
18
+ },
19
+ f = (c, e = 50) => {
20
+ c = c.getBoundingClientRect();
21
+ return c.top >= -e && c.left >= -e && c.bottom <= (window.innerHeight || document.documentElement.clientHeight) + e && c.right <= (window.innerWidth || document.documentElement.clientWidth) + e
22
+ };
23
+ if ("undefined" !== typeof IntersectionObserver) {
24
+ const c = new IntersectionObserver((e, k) => {
25
+ e.forEach(l => {
26
+ l.isIntersecting && (d(l.target), k.unobserve(l.target))
27
+ })
28
+ }, {
29
+ threshold: .1,
30
+ rootMargin: "50px"
31
+ });
32
+ b.forEach(e =>
33
+ c.observe(e));
34
+ this.destroy = function() {
35
+ c.disconnect();
36
+ return this
37
+ }
38
+ } else {
39
+ const c = () => {
40
+ b = b.filter(m => m.dataset.src);
41
+ 0 === b.length ? (window.removeEventListener("scroll", k, l ? {
42
+ passive: !0
43
+ } : !1), window.removeEventListener("resize", k, l ? {
44
+ passive: !0
45
+ } : !1)) : b.forEach(m => {
46
+ m.dataset.src && f(m, 50) && d(m)
47
+ })
48
+ };
49
+ c();
50
+ let e;
51
+ const k = () => {
52
+ e && clearTimeout(e);
53
+ e = setTimeout(c, 100)
54
+ },
55
+ l = function() {
56
+ let m = !1;
57
+ try {
58
+ const q = Object.defineProperty({}, "passive", {
59
+ get: function() {
60
+ m = !0
61
+ }
62
+ });
63
+ window.addEventListener("test", null, q);
64
+ window.removeEventListener("test",
65
+ null, q)
66
+ } catch (q) {}
67
+ return m
68
+ }();
69
+ window.addEventListener("scroll", k, l ? {
70
+ passive: !0
71
+ } : !1);
72
+ window.addEventListener("resize", k, l ? {
73
+ passive: !0
74
+ } : !1);
75
+ this.destroy = function() {
76
+ window.removeEventListener("scroll", k, l ? {
77
+ passive: !0
78
+ } : !1);
79
+ window.removeEventListener("resize", k, l ? {
80
+ passive: !0
81
+ } : !1);
82
+ e && (clearTimeout(e), e = null);
83
+ return this
84
+ }
12
85
  }
13
- const d = new IntersectionObserver((c, b) => {
14
- c.forEach(e => {
15
- if (e.isIntersecting) {
16
- e =
17
- e.target;
18
- const l = e.dataset.src;
19
- "img" === e.tagName.toLowerCase() ? (e.src = l, e.alt = e.alt || "") : e.style.backgroundImage = `url(${l})`;
20
- e.removeAttribute("data-src");
21
- b.unobserve(e)
22
- }
23
- })
24
- }, {
25
- threshold: .1,
26
- rootMargin: "50px"
27
- });
28
- g.forEach(c => d.observe(c));
29
- this.destroy = function() {
30
- d.disconnect();
31
- return this
32
- };
33
86
  return this
34
87
  }
35
- const v = {
88
+ const w = {
36
89
  duration: 0,
37
90
  threshold: .1,
38
91
  rootMargin: "50px",
@@ -43,160 +96,215 @@ $.lazyLoadImages = function(g, k, p) {
43
96
  removeLoading: !0,
44
97
  placeholder: !1
45
98
  };
46
- let f = {
47
- ...v
99
+ let g = {
100
+ ...w
48
101
  },
49
- q = null;
50
- "function" === typeof g ? f.callback = g : "number" ===
51
- typeof g ? (f.duration = g, f.callback = k) : "string" === typeof g ? (q = g, "function" === typeof k ? f.callback = k : "number" === typeof k && (f.duration = k, f.callback = p)) : "object" === typeof g && (f = {
52
- ...v,
53
- ...g
102
+ t = null;
103
+ "function" === typeof h ?
104
+ g.callback = h : "number" === typeof h ? (g.duration = h, g.callback = p) : "string" === typeof h ? (t = h, "function" === typeof p ? g.callback = p : "number" === typeof p && (g.duration = p, g.callback = r)) : "object" === typeof h && (g = {
105
+ ...w,
106
+ ...h
54
107
  });
55
- if (1 === this.elements.length && this.elements[0] === document) g = Array.from(document.querySelectorAll(q || "[data-src]"));
108
+ let n;
109
+ if (1 === this.elements.length && this.elements[0] === document) n = Array.from(document.querySelectorAll(t || "[data-src]"));
56
110
  else {
57
111
  const a = new Set;
58
- this.elements.forEach(d => {
59
- d.querySelectorAll(q || "[data-src]").forEach(c => a.add(c))
112
+ this.elements.forEach(b => {
113
+ b.querySelectorAll(t || "[data-src]").forEach(d => a.add(d))
60
114
  });
61
- g = Array.from(a)
115
+ n = Array.from(a)
62
116
  }
63
- document.getElementById("lazy-loading-styles") || (k = document.createElement("style"),
64
- k.id = "lazy-loading-styles", k.textContent = "\n .lazy-loading-wrap {\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 9998 !important;\n pointer-events: none !important;\n overflow: visible !important;\n background-color: rgba(255, 255, 255, 0.5) !important;\n backdrop-filter: blur(3px) !important;\n transition: opacity 0.2s ease !important;\n }\n .lazy-loading-indicator {\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n width: 60px !important;\n height: 30px !important;\n z-index: 9999 !important;\n pointer-events: none !important;\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n }\n .lazy-loading-dot {\n width: 8px !important;\n height: 8px !important;\n margin: 0 3px !important;\n border-radius: 50% !important;\n background-color: rgba(0, 0, 0, 0.5) !important;\n display: inline-block !important;\n animation: lazyPulse 1.4s infinite ease-in-out !important;\n }\n .lazy-loading-dot:nth-child(1) { animation-delay: 0s !important; }\n .lazy-loading-dot:nth-child(2) { animation-delay: 0.2s !important; }\n .lazy-loading-dot:nth-child(3) { animation-delay: 0.4s !important; }\n @keyframes lazyPulse {\n 0%, 100% { transform: scale(0.6); opacity: 0.6; }\n 50% { transform: scale(1); opacity: 1; }\n }\n .lazy-loading-progress {\n position: absolute !important;\n bottom: 0 !important;\n left: 0 !important;\n height: 3px !important;\n width: 0% !important;\n background: linear-gradient(to right, #4facfe, #00f2fe) !important;\n transition: width 0.3s ease !important;\n z-index: 9999 !important;\n box-shadow: 0 0 5px rgba(79, 172, 254, 0.5) !important;\n }\n .lazy-placeholder {\n background-color: #f0f0f0 !important;\n background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;\n background-size: 200% 100% !important;\n animation: shimmer 1.5s infinite !important;\n }\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n ",
65
- document.head.appendChild(k));
66
- g.forEach(a => {
67
- "img" === a.tagName.toLowerCase() && a.dataset.src && (f.placeholder && a.classList.add("lazy-placeholder"), a.src && "" !== a.src && a.src !== window.location.href || (a.src = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E"), 0 < f.duration && (a.style.opacity = "0"))
117
+ document.getElementById("lazy-loading-styles") || (h =
118
+ document.createElement("style"), h.id = "lazy-loading-styles", h.textContent = "\n .lazy-loading-wrap {\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n width: 100% !important;\n height: 100% !important;\n z-index: 9998 !important;\n pointer-events: none !important;\n overflow: visible !important;\n background-color: rgba(255, 255, 255, 0.5) !important;\n backdrop-filter: blur(3px) !important;\n transition: opacity 0.2s ease !important;\n }\n .lazy-loading-indicator {\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n width: 60px !important;\n height: 30px !important;\n z-index: 9999 !important;\n pointer-events: none !important;\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n }\n .lazy-loading-dot {\n width: 8px !important;\n height: 8px !important;\n margin: 0 3px !important;\n border-radius: 50% !important;\n background-color: rgba(0, 0, 0, 0.5) !important;\n display: inline-block !important;\n animation: lazyPulse 1.4s infinite ease-in-out !important;\n }\n .lazy-loading-dot:nth-child(1) { animation-delay: 0s !important; }\n .lazy-loading-dot:nth-child(2) { animation-delay: 0.2s !important; }\n .lazy-loading-dot:nth-child(3) { animation-delay: 0.4s !important; }\n @keyframes lazyPulse {\n 0%, 100% { transform: scale(0.6); opacity: 0.6; }\n 50% { transform: scale(1); opacity: 1; }\n }\n .lazy-loading-progress {\n position: absolute !important;\n bottom: 0 !important;\n left: 0 !important;\n height: 3px !important;\n width: 0% !important;\n background: linear-gradient(to right, #4facfe, #00f2fe) !important;\n transition: width 0.3s ease !important;\n z-index: 9999 !important;\n box-shadow: 0 0 5px rgba(79, 172, 254, 0.5) !important;\n }\n .lazy-placeholder {\n background-color: #f0f0f0 !important;\n background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;\n background-size: 200% 100% !important;\n animation: shimmer 1.5s infinite !important;\n }\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n ",
119
+ document.head.appendChild(h));
120
+ n.forEach(a => {
121
+ "img" === a.tagName.toLowerCase() && a.dataset.src && (g.placeholder && a.classList.add("lazy-placeholder"), a.src && "" !== a.src && a.src !== window.location.href || (a.src = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E"), 0 < g.duration && (a.style.opacity = "0"))
68
122
  });
69
- const z = (a, d) => {
70
- let c;
71
- return (...b) => {
72
- clearTimeout(c);
73
- c = setTimeout(() => a(...b), d)
123
+ const A = (a, b) => {
124
+ let d;
125
+ return (...f) => {
126
+ clearTimeout(d);
127
+ d = setTimeout(() => a(...f), b)
74
128
  }
75
129
  },
76
- w = a => {
77
- var d = window.getComputedStyle(a).position,
78
- c = "img" === a.tagName.toLowerCase();
79
- const b = document.createElement("div");
80
- b.className = "lazy-loading-wrap";
81
- var e = document.createElement("div");
82
- e.className = "lazy-loading-indicator";
83
- "string" === typeof f.loading ? (e.innerHTML = f.loading, e.style.color = "rgba(0, 0, 0, 0.7)", e.style.fontSize = "14px", e.style.whiteSpace = "nowrap") : e.innerHTML = '<div class="lazy-loading-dot"></div><div class="lazy-loading-dot"></div><div class="lazy-loading-dot"></div>';
84
- const l = document.createElement("div");
85
- l.className = "lazy-loading-progress";
86
- b.appendChild(e);
87
- b.appendChild(l);
88
- let h = 0;
89
- const m = setInterval(() => {
90
- h += 5 * Math.random();
91
- 95 < h && (clearInterval(m), h = 95);
92
- l.style.width = h + "%"
130
+ x = a => {
131
+ var b = window.getComputedStyle(a).position,
132
+ d = "img" === a.tagName.toLowerCase();
133
+ const f = document.createElement("div");
134
+ f.className = "lazy-loading-wrap";
135
+ var c = document.createElement("div");
136
+ c.className = "lazy-loading-indicator";
137
+ "string" === typeof g.loading ? (c.innerHTML = g.loading, c.style.color = "rgba(0, 0, 0, 0.7)", c.style.fontSize = "14px", c.style.whiteSpace = "nowrap") : c.innerHTML = '<div class="lazy-loading-dot"></div><div class="lazy-loading-dot"></div><div class="lazy-loading-dot"></div>';
138
+ const e = document.createElement("div");
139
+ e.className = "lazy-loading-progress";
140
+ f.appendChild(c);
141
+ f.appendChild(e);
142
+ let k = 0;
143
+ const l = setInterval(() => {
144
+ k += 5 * Math.random();
145
+ 95 < k && (clearInterval(l), k = 95);
146
+ e.style.width = k + "%"
93
147
  }, 200);
94
- e = {
148
+ c = {
95
149
  element: a,
96
- wrapper: b,
97
- indicator: e,
98
- originalPosition: d,
99
- progressBar: l,
100
- progressInterval: m
150
+ wrapper: f,
151
+ indicator: c,
152
+ originalPosition: b,
153
+ progressBar: e,
154
+ progressInterval: l
101
155
  };
102
- if (c)
103
- if (d = a.parentNode, "absolute" === window.getComputedStyle(a).position) "static" === window.getComputedStyle(d).position && (d.style.position = "relative"), d.appendChild(b);
156
+ if (d)
157
+ if (b = a.parentNode, "absolute" === window.getComputedStyle(a).position) "static" === window.getComputedStyle(b).position && (b.style.position = "relative"), b.appendChild(f);
104
158
  else {
105
- c = document.createElement("div");
106
- const n = a.offsetWidth || d.offsetWidth || "100%",
107
- r = a.offsetHeight || d.offsetHeight || "auto";
108
- c.style.cssText = `position: relative; display: inline-block; width: ${"number"===
109
- typeof n?n+"px":n}; height: ${"number"===typeof r?r+"px":r}; overflow: hidden;`;
110
- d.insertBefore(c, a);
111
- c.appendChild(a);
112
- c.appendChild(b);
113
- e.container = c
159
+ d = document.createElement("div");
160
+ const m = a.offsetWidth || b.offsetWidth || "100%",
161
+ q = a.offsetHeight || b.offsetHeight || "auto";
162
+ d.style.cssText = `position: relative; display: inline-block; width: ${"number"===
163
+ typeof m?m+"px":m}; height: ${"number"===typeof q?q+"px":q}; overflow: hidden;`;
164
+ b.insertBefore(d, a);
165
+ d.appendChild(a);
166
+ d.appendChild(f);
167
+ c.container = d
114
168
  }
115
- else "static" === d && (a.style.position = "relative"), a.appendChild(b);
116
- return e
169
+ else "static" === b && (a.style.position = "relative"), a.appendChild(f);
170
+ return c
117
171
  },
118
- t = a => {
172
+ u = a => {
119
173
  a && (a.progressInterval && (clearInterval(a.progressInterval), a.progressBar && (a.progressBar.style.width = "100%")), a.wrapper?.parentNode && (a.wrapper.style.opacity = "0", setTimeout(() => {
120
174
  a.wrapper?.parentNode?.removeChild(a.wrapper)
121
175
  }, 200)), a.container?.parentNode && setTimeout(() => {
122
176
  const {
123
- element: d,
124
- container: c
177
+ element: b,
178
+ container: d
125
179
  } = a;
126
- c.parentNode.insertBefore(d, c);
127
- c.parentNode.removeChild(c)
180
+ d.parentNode.insertBefore(b, d);
181
+ d.parentNode.removeChild(d)
128
182
  }, 200), a.element && "static" === a.originalPosition && setTimeout(() => {
129
183
  a.element.style.position = "static"
130
- }, 200), a.element && f.placeholder && a.element.classList.remove("lazy-placeholder"))
184
+ }, 200), a.element && g.placeholder && a.element.classList.remove("lazy-placeholder"))
131
185
  },
132
- x = a => {
186
+ y = a => {
133
187
  if ("img" === a.tagName.toLowerCase()) {
134
- var d = a.getAttribute("width"),
135
- c = a.getAttribute("height");
136
- d && c ? a.style.aspectRatio = d / c : (d = a.offsetWidth, c = a.offsetHeight, 0 < d && 0 < c ? a.style.aspectRatio = d / c : a.style.minHeight = 0 < d ? .5625 * d + "px" : "200px");
137
- f.placeholder &&
188
+ var b = a.getAttribute("width"),
189
+ d = a.getAttribute("height");
190
+ b && d ? a.style.aspectRatio = b / d : (b = a.offsetWidth, d = a.offsetHeight, 0 < b && 0 < d ? a.style.aspectRatio = b / d : a.style.minHeight = 0 < b ? .5625 * b + "px" : "200px");
191
+ g.placeholder &&
138
192
  a.classList.add("lazy-placeholder")
139
- } else 50 > a.offsetHeight && (d = a.offsetWidth, a.style.minHeight = 0 < d ? .5625 * d + "px" : "200px"), !f.placeholder || a.style.backgroundColor && "transparent" !== a.style.backgroundColor || a.classList.add("lazy-placeholder")
193
+ } else 50 > a.offsetHeight && (b = a.offsetWidth, a.style.minHeight = 0 < b ? .5625 * b + "px" : "200px"), !g.placeholder || a.style.backgroundColor && "transparent" !== a.style.backgroundColor || a.classList.add("lazy-placeholder")
140
194
  },
141
- u = (a, d, c = 0, b = null) => {
142
- const e = new Image;
195
+ v = (a, b, d = 0, f = null) => {
196
+ const c = new Image;
143
197
  a.tagName.toLowerCase();
144
- e.onload = z(() => {
145
- 0 < f.duration ? (a.style.transition = `opacity ${f.duration}ms ease-in`, requestAnimationFrame(() => {
198
+ c.onload = A(() => {
199
+ 0 < g.duration ? (a.style.transition = `opacity ${g.duration}ms ease-in`, requestAnimationFrame(() => {
146
200
  requestAnimationFrame(() => {
147
201
  a.style.opacity = "1";
148
- b && setTimeout(() => t(b), f.duration)
202
+ f && setTimeout(() => u(f), g.duration)
149
203
  })
150
204
  })) : (a.style.opacity =
151
- "1", b && t(b));
152
- f.callback && f.callback(d, null, a)
205
+ "1", f && u(f));
206
+ g.callback && g.callback(b, null, a)
153
207
  }, 50);
154
- e.onerror = () => {
155
- c < f.maxRetries ? setTimeout(() => u(a, d, c + 1, b), f.retryDelay) : (a.style.opacity = "1", b && t(b), f.callback && f.callback(d, Error("Failed to load image after retries"), a))
208
+ c.onerror = () => {
209
+ d < g.maxRetries ? setTimeout(() => v(a, b, d + 1, f), g.retryDelay) : (a.style.opacity = "1", f && u(f), g.callback && g.callback(b, Error("Failed to load image after retries"), a))
156
210
  };
157
- e.src = d
211
+ c.src = b
158
212
  },
159
- y = new IntersectionObserver((a, d) => {
160
- a.forEach(c => {
161
- if (c.isIntersecting) {
162
- const b = c.target,
163
- e = b.dataset.src;
164
- if ("img" === b.tagName.toLowerCase()) {
165
- x(b);
166
- const l = f.loading ? w(b) : null;
167
- 0 < f.duration && (b.style.opacity = "0");
168
- const h = new Image,
169
- m = (c = b.parentElement) && 0 < parseFloat(window.getComputedStyle(c).paddingTop);
170
- c = () => {
171
- if (h.naturalWidth && h.naturalHeight) {
172
- const n = window.getComputedStyle(b);
173
- m || n.aspectRatio || b.style.aspectRatio || b.style.width || b.style.height || b.hasAttribute("width") || b.hasAttribute("height") || (b.style.aspectRatio = `${h.naturalWidth} / ${h.naturalHeight}`);
174
- m && (b.style.minHeight = "0", b.style.height = "100%", b.style.width = "100%")
175
- }
176
- b.src = e;
177
- b.alt = b.alt || "";
178
- b.removeAttribute("data-src");
179
- d.unobserve(b);
180
- u(b, e, 0, l)
181
- };
182
- h.onload = c;
183
- h.onerror = c;
184
- h.src = e
185
- } else x(b), c = f.loading ? w(b) : null, 0 < f.duration && (b.style.opacity =
186
- "0"), b.style.backgroundImage = `url(${e})`, b.removeAttribute("data-src"), d.unobserve(b), u(b, e, 0, c)
187
- }
213
+ B = (a, b = 50) => {
214
+ a = a.getBoundingClientRect();
215
+ return a.top >= -b && a.left >= -b && a.bottom <= (window.innerHeight || document.documentElement.clientHeight) + b && a.right <= (window.innerWidth || document.documentElement.clientWidth) + b
216
+ },
217
+ z = a => {
218
+ const b = a.dataset.src;
219
+ if (b)
220
+ if ("img" === a.tagName.toLowerCase()) {
221
+ y(a);
222
+ const f = g.loading ? x(a) : null;
223
+ 0 < g.duration && (a.style.opacity = "0");
224
+ const c = new Image;
225
+ var d = a.parentElement;
226
+ const e = d && 0 < parseFloat(window.getComputedStyle(d).paddingTop);
227
+ d = () => {
228
+ if (c.naturalWidth && c.naturalHeight) {
229
+ const k = window.getComputedStyle(a);
230
+ e || k.aspectRatio || a.style.aspectRatio || a.style.width || a.style.height || a.hasAttribute("width") || a.hasAttribute("height") || (a.style.aspectRatio = `${c.naturalWidth} / ${c.naturalHeight}`);
231
+ e && (a.style.minHeight = "0", a.style.height = "100%", a.style.width = "100%")
232
+ }
233
+ a.src =
234
+ b;
235
+ a.alt = a.alt || "";
236
+ a.removeAttribute("data-src");
237
+ v(a, b, 0, f)
238
+ };
239
+ c.onload = d;
240
+ c.onerror = d;
241
+ c.src = b
242
+ } else y(a), d = g.loading ? x(a) : null, 0 < g.duration && (a.style.opacity = "0"), a.style.backgroundImage = `url(${b})`, a.removeAttribute("data-src"), v(a, b, 0, d)
243
+ };
244
+ if ("undefined" !== typeof IntersectionObserver) {
245
+ const a = new IntersectionObserver((b, d) => {
246
+ b.forEach(f => {
247
+ f.isIntersecting && (z(f.target), d.unobserve(f.target))
188
248
  })
189
249
  }, {
190
- threshold: f.threshold,
191
- rootMargin: f.rootMargin
250
+ threshold: g.threshold,
251
+ rootMargin: g.rootMargin
192
252
  });
193
- g.forEach(a => y.observe(a));
194
- this.destroy = function() {
195
- y.disconnect();
196
- return this
197
- };
253
+ n.forEach(b => a.observe(b));
254
+ this.destroy = function() {
255
+ a.disconnect();
256
+ return this
257
+ }
258
+ } else {
259
+ const a = () => {
260
+ n = n.filter(c => c.dataset.src);
261
+ 0 === n.length ? (window.removeEventListener("scroll", d, f ? {
262
+ passive: !0
263
+ } : !1), window.removeEventListener("resize", d, f ? {
264
+ passive: !0
265
+ } : !1)) : n.forEach(c => {
266
+ c.dataset.src && B(c, 50) && z(c)
267
+ })
268
+ };
269
+ a();
270
+ let b;
271
+ const d = () => {
272
+ b && clearTimeout(b);
273
+ b = setTimeout(a, 100)
274
+ },
275
+ f = function() {
276
+ let c = !1;
277
+ try {
278
+ const e = Object.defineProperty({}, "passive", {
279
+ get: function() {
280
+ c = !0
281
+ }
282
+ });
283
+ window.addEventListener("test", null, e);
284
+ window.removeEventListener("test", null, e)
285
+ } catch (e) {}
286
+ return c
287
+ }();
288
+ window.addEventListener("scroll",
289
+ d, f ? {
290
+ passive: !0
291
+ } : !1);
292
+ window.addEventListener("resize", d, f ? {
293
+ passive: !0
294
+ } : !1);
295
+ this.destroy = function() {
296
+ window.removeEventListener("scroll", d, f ? {
297
+ passive: !0
298
+ } : !1);
299
+ window.removeEventListener("resize", d, f ? {
300
+ passive: !0
301
+ } : !1);
302
+ b && (clearTimeout(b), b = null);
303
+ return this
304
+ }
305
+ }
198
306
  return this
199
307
  };
200
- $.fn.lazyLoadImages = function(g, k, p) {
201
- return $.lazyLoadImages.call(this, g, k, p)
308
+ $.fn.lazyLoadImages = function(h, p, r) {
309
+ return $.lazyLoadImages.call(this, h, p, r)
202
310
  };