@iframe-resizer/child 6.0.0-beta.2 → 6.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +14 -27
- package/index.cjs.js.map +1 -1
- package/index.d.ts +94 -0
- package/index.esm.js +723 -807
- package/index.esm.js.map +1 -1
- package/index.umd.js +16 -29
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/iframe-resizer.child.d.ts +0 -168
package/index.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
`, ee = "string",
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
},
|
|
1
|
+
import $n, { NORMAL as Z, HIGHLIGHT as a, FOREGROUND as v, BOLD as st, ITALIC as Tn } from "auto-console-group";
|
|
2
|
+
const K = "6.0.0-beta.3", je = "iframeResizer", pe = ":", An = "[iFrameResizerChild]Ready", In = "autoResize", Nn = "beforeUnload", Ln = "close", Cn = "inPageLink", ye = "init", $e = "message", jn = "mouseenter", Pn = "mouseleave", Ct = "pageHide", _n = "pageInfo", jt = "parentInfo", xn = "parentInfoStop", Bn = "scrollBy", Dn = "scrollTo", Pt = "scrollToOffset", Fn = "title", Y = 1, Pe = "data-iframe-size", _t = "data-iframe-overflowed", X = "data-iframe-ignore", ve = "height", xt = "width", rt = "offsetSize", _e = `
|
|
3
|
+
`, ee = "string", _ = "number", Hn = "boolean", Vn = "object", xe = "function", Wn = "undefined", Un = "false", Gn = "null", Q = "auto", Bt = "readystatechange", Dt = "bottom", Ft = "right", Te = "autoResizeEnabled", it = /* @__PURE__ */ Symbol("sizeChanged"), Be = "manualResize", De = "parentResize", Se = {
|
|
4
|
+
[Be]: 1,
|
|
5
|
+
[De]: 1
|
|
6
|
+
}, Ht = "setOffsetSize", Vt = "resizeObserver", Fe = "overflowObserver", Wt = "mutationObserver", Ut = "visibilityObserver", qn = "font-weight: bold;", He = "none", ct = "No change in content size detected", le = "[iFrameSizer]", Gt = le.length, Zn = Q, qt = 128, Zt = /* @__PURE__ */ new Set([
|
|
7
7
|
"head",
|
|
8
8
|
"body",
|
|
9
9
|
"meta",
|
|
@@ -20,18 +20,13 @@ const x = "6.0.0-beta.2", Ve = "iframeResizer", ye = ":", Ln = "[iFrameResizerCh
|
|
|
20
20
|
"track",
|
|
21
21
|
"wbr",
|
|
22
22
|
"nobr"
|
|
23
|
-
]),
|
|
24
|
-
c,
|
|
25
|
-
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
26
|
-
|
|
27
|
-
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${d}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
28
|
-
), to = (e) => typeof e === ee, Se = (e, ...t) => setTimeout(() => e(...t), 0), Kt = (e) => {
|
|
23
|
+
]), Yn = (e) => typeof e === ee, ze = (e, ...t) => setTimeout(() => e(...t), 0), Yt = (e) => {
|
|
29
24
|
let t = !1;
|
|
30
25
|
return function(...n) {
|
|
31
26
|
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
32
27
|
};
|
|
33
|
-
}, ue = (e) => e,
|
|
34
|
-
function
|
|
28
|
+
}, ue = (e) => e, at = 1e3, P = (e) => Math.round(e * at) / at, Qt = (e) => e.charAt(0).toUpperCase() + e.slice(1), N = (e) => `${e}` != "" && e !== void 0, Qn = (e) => e(), Jn = (e) => e.toLowerCase();
|
|
29
|
+
function Kn(e) {
|
|
35
30
|
switch (!0) {
|
|
36
31
|
case !N(e):
|
|
37
32
|
return "";
|
|
@@ -45,13 +40,13 @@ function ro(e) {
|
|
|
45
40
|
return e.nodeName;
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
const
|
|
43
|
+
const Xn = (e) => (
|
|
49
44
|
// eslint-disable-next-line no-underscore-dangle
|
|
50
45
|
e?.__esModule ? e.default : e
|
|
51
|
-
),
|
|
46
|
+
), k = (e, t, n) => {
|
|
52
47
|
if (typeof e !== t)
|
|
53
|
-
throw new TypeError(`${n} is not a ${
|
|
54
|
-
},
|
|
48
|
+
throw new TypeError(`${n} is not a ${Qt(t)}`);
|
|
49
|
+
}, Jt = {
|
|
55
50
|
br: `
|
|
56
51
|
`,
|
|
57
52
|
rb: "\x1B[31;1m",
|
|
@@ -66,42 +61,42 @@ const so = (e) => (
|
|
|
66
61
|
// underline
|
|
67
62
|
"/": "\x1B[m"
|
|
68
63
|
// reset
|
|
69
|
-
},
|
|
70
|
-
|
|
64
|
+
}, eo = Object.keys(Jt), to = new RegExp(`<(${eo.join("|")})>`, "gi"), no = (e, t) => Jt[t] ?? "", oo = (e) => e.replace(to, no), so = (e) => e.replaceAll("<br>", _e).replaceAll(/<\/?[^>]+>/gi, ""), ro = (e) => (t) => e(
|
|
65
|
+
Yn(t) ? window.chrome ? oo(t) : so(t) : t
|
|
71
66
|
);
|
|
72
|
-
let
|
|
73
|
-
const
|
|
74
|
-
label: `${
|
|
67
|
+
let Ve = !0, lt = je;
|
|
68
|
+
const io = Xn($n), J = io({
|
|
69
|
+
label: `${je}(child)`,
|
|
75
70
|
expand: !1
|
|
76
71
|
});
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
console.info(
|
|
83
|
-
`${_e} %ciframe-resizer ${e}`,
|
|
84
|
-
Ye || t < 1 ? Kn : Q
|
|
85
|
-
);
|
|
72
|
+
function co(e) {
|
|
73
|
+
lt = e.id || je, J.label(`${lt}`), J.expand(e.expand), Ve = e.enabled;
|
|
74
|
+
}
|
|
75
|
+
const Kt = (e) => (...t) => Ve ? J[e](...t) : !0, l = Kt("log"), u = l, de = Kt("debug");
|
|
76
|
+
function ao(e, t) {
|
|
77
|
+
console.info(`%ciframe-resizer ${e}`, Ve || t < 1 ? qn : Z);
|
|
86
78
|
}
|
|
87
79
|
const {
|
|
88
|
-
assert:
|
|
89
|
-
endAutoGroup:
|
|
90
|
-
error:
|
|
91
|
-
errorBoundary:
|
|
80
|
+
assert: lo,
|
|
81
|
+
endAutoGroup: x,
|
|
82
|
+
error: Xt,
|
|
83
|
+
errorBoundary: We,
|
|
92
84
|
event: h,
|
|
93
|
-
label:
|
|
94
|
-
purge:
|
|
95
|
-
warn:
|
|
96
|
-
} =
|
|
97
|
-
|
|
85
|
+
label: mi,
|
|
86
|
+
purge: hi,
|
|
87
|
+
warn: H
|
|
88
|
+
} = J, en = ro(ue), w = (...e) => J.warn(...e.map(en)), uo = (...e) => (
|
|
89
|
+
// eslint-disable-next-line no-console
|
|
90
|
+
console.warn(...e.map(en))
|
|
91
|
+
), Ue = [];
|
|
92
|
+
function tn(e, t) {
|
|
98
93
|
l(`${e} event listener: %c${t}`, a);
|
|
99
94
|
}
|
|
100
|
-
const
|
|
101
|
-
e.removeEventListener(t, n, o),
|
|
102
|
-
},
|
|
103
|
-
e.addEventListener(t, n, o),
|
|
104
|
-
},
|
|
95
|
+
const nn = (e, t, n, o) => {
|
|
96
|
+
e.removeEventListener(t, n, o), tn("Removed", t);
|
|
97
|
+
}, C = (e, t, n, o = !1) => {
|
|
98
|
+
e.addEventListener(t, n, o), Ue.push(() => nn(e, t, n, o)), tn("Added", t);
|
|
99
|
+
}, r = {
|
|
105
100
|
applySelectors: null,
|
|
106
101
|
firstRun: !0,
|
|
107
102
|
hasTags: !1,
|
|
@@ -124,41 +119,41 @@ const sn = (e, t, n, o) => {
|
|
|
124
119
|
onPageInfo: null,
|
|
125
120
|
onParentInfo: null
|
|
126
121
|
};
|
|
127
|
-
let
|
|
128
|
-
function
|
|
122
|
+
let ut = !1;
|
|
123
|
+
function dt(e) {
|
|
129
124
|
const t = window?.iframeResizer?.targetOrigin || "*", n = Array.isArray(t) ? t : [t];
|
|
130
125
|
for (const o of n)
|
|
131
|
-
e.postMessage(
|
|
126
|
+
e.postMessage(An, o);
|
|
132
127
|
}
|
|
133
|
-
function
|
|
134
|
-
if (document.readyState === "loading" || !
|
|
128
|
+
function ft() {
|
|
129
|
+
if (document.readyState === "loading" || !r.firstRun || ut) return;
|
|
135
130
|
const { parent: e, top: t } = window;
|
|
136
131
|
h("ready"), l(
|
|
137
132
|
"Sending%c ready%c to parent from",
|
|
138
133
|
a,
|
|
139
|
-
|
|
134
|
+
v,
|
|
140
135
|
window.location.href
|
|
141
|
-
),
|
|
136
|
+
), dt(e), e !== t && dt(t), ut = !0;
|
|
142
137
|
}
|
|
143
|
-
const
|
|
144
|
-
window.jQuery !== void 0 &&
|
|
145
|
-
function
|
|
138
|
+
const mt = "iframeResize", fo = (e) => le === `${e.data}`.slice(0, Gt), mo = () => mt in window || // @ts-ignore
|
|
139
|
+
window.jQuery !== void 0 && mt in window.jQuery.prototype, ho = (e) => e.data.split(pe)[2] in { true: 1, false: 1 }, go = () => [document.documentElement, document.body], po = ["min-height", "min-width", "max-height", "max-width"], ht = /* @__PURE__ */ new Set(), yo = (e) => !!e && e !== "0px" && e !== Q && e !== He, on = (e) => e.tagName ? e.tagName.toLowerCase() : "unknown", sn = (e, t) => window.getComputedStyle(e).getPropertyValue(t), vo = (e, t) => yo(sn(e, t));
|
|
140
|
+
function zo(e, t) {
|
|
146
141
|
const n = e.style.getPropertyValue(t);
|
|
147
142
|
return n ? { source: "an inline style attribute", value: n } : null;
|
|
148
143
|
}
|
|
149
|
-
function
|
|
144
|
+
function bo({
|
|
150
145
|
href: e
|
|
151
146
|
}) {
|
|
152
|
-
|
|
147
|
+
ht.has(e) || (l("Unable to access stylesheet:", e), ht.add(e));
|
|
153
148
|
}
|
|
154
|
-
function
|
|
149
|
+
function wo(e, t) {
|
|
155
150
|
for (const n of document.styleSheets)
|
|
156
151
|
try {
|
|
157
152
|
for (const o of n.cssRules || []) {
|
|
158
153
|
if (!("selectorText" in o)) continue;
|
|
159
|
-
const
|
|
160
|
-
if (!e.matches(
|
|
161
|
-
const d =
|
|
154
|
+
const s = o;
|
|
155
|
+
if (!e.matches(s.selectorText)) continue;
|
|
156
|
+
const d = s.style.getPropertyValue(t);
|
|
162
157
|
if (!d) continue;
|
|
163
158
|
const { ownerNode: c } = n;
|
|
164
159
|
return {
|
|
@@ -167,27 +162,27 @@ function To(e, t) {
|
|
|
167
162
|
};
|
|
168
163
|
}
|
|
169
164
|
} catch {
|
|
170
|
-
|
|
165
|
+
bo(n);
|
|
171
166
|
}
|
|
172
167
|
return {
|
|
173
168
|
source: "cross-origin stylesheet",
|
|
174
|
-
value:
|
|
169
|
+
value: sn(e, t)
|
|
175
170
|
};
|
|
176
171
|
}
|
|
177
|
-
const
|
|
178
|
-
const { source: n, value: o } =
|
|
179
|
-
|
|
180
|
-
`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${
|
|
172
|
+
const So = (e, t) => zo(e, t) || wo(e, t), Eo = (e, t) => {
|
|
173
|
+
const { source: n, value: o } = So(e, t), s = on(e);
|
|
174
|
+
w(
|
|
175
|
+
`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${s}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
|
|
181
176
|
|
|
182
177
|
If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`
|
|
183
178
|
);
|
|
184
179
|
};
|
|
185
|
-
function
|
|
186
|
-
for (const e of
|
|
187
|
-
for (const t of
|
|
188
|
-
l(`Checking <${
|
|
180
|
+
function Oo() {
|
|
181
|
+
for (const e of go())
|
|
182
|
+
for (const t of po)
|
|
183
|
+
l(`Checking <${on(e)}> for blocking CSS: ${t}`), vo(e, t) && Eo(e, t);
|
|
189
184
|
}
|
|
190
|
-
const
|
|
185
|
+
const Ro = ({
|
|
191
186
|
calculateWidth: e,
|
|
192
187
|
calculateHeight: t
|
|
193
188
|
}) => e === t, i = {
|
|
@@ -199,7 +194,7 @@ const Po = ({
|
|
|
199
194
|
bodyPadding: "",
|
|
200
195
|
calculateHeight: !0,
|
|
201
196
|
calculateWidth: !1,
|
|
202
|
-
heightCalcMode:
|
|
197
|
+
heightCalcMode: Q,
|
|
203
198
|
ignoreSelector: "",
|
|
204
199
|
inPageLinks: !1,
|
|
205
200
|
logging: !1,
|
|
@@ -212,270 +207,64 @@ const Po = ({
|
|
|
212
207
|
sizeSelector: "",
|
|
213
208
|
targetOrigin: "*",
|
|
214
209
|
tolerance: 0,
|
|
215
|
-
widthCalcMode:
|
|
210
|
+
widthCalcMode: Q,
|
|
216
211
|
onBeforeResize: void 0,
|
|
217
212
|
onMessage: () => {
|
|
218
|
-
|
|
213
|
+
H("onMessage function not defined");
|
|
219
214
|
},
|
|
220
215
|
onReady: () => {
|
|
221
216
|
}
|
|
222
|
-
}, A = [a, z, a], ae = {
|
|
223
|
-
height: 0,
|
|
224
|
-
width: 0
|
|
225
|
-
}, V = {
|
|
226
|
-
height: 0,
|
|
227
|
-
width: 0
|
|
228
|
-
};
|
|
229
|
-
function H(e, t, n) {
|
|
230
|
-
return V[e] = t, ae[e] = n, t;
|
|
231
|
-
}
|
|
232
|
-
function Co(e) {
|
|
233
|
-
const t = e.getOffset();
|
|
234
|
-
return t !== 0 && u(`Page offsetSize: %c${t}px`, a), t;
|
|
235
|
-
}
|
|
236
|
-
const Lo = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
|
|
237
|
-
function ln(e) {
|
|
238
|
-
const { hasOverflow: t, hasTags: n, triggerLocked: o } = s, r = e.label, d = r === ze, c = e.boundingClientRect(), f = Math.ceil(c), b = Math.floor(c), m = Lo(e), w = `HTML: %c${c}px %cPage: %c${m}px`;
|
|
239
|
-
let g;
|
|
240
|
-
switch (!0) {
|
|
241
|
-
case !e.enabled():
|
|
242
|
-
return Math.max(m, J);
|
|
243
|
-
case n:
|
|
244
|
-
u("Found element with data-iframe-size attribute"), g = e.taggedElement();
|
|
245
|
-
break;
|
|
246
|
-
case (!t && s.firstRun && V[r] === 0 && ae[r] === 0):
|
|
247
|
-
u(`Initial page size values: ${w}`, ...A), g = H(
|
|
248
|
-
r,
|
|
249
|
-
c,
|
|
250
|
-
m
|
|
251
|
-
);
|
|
252
|
-
break;
|
|
253
|
-
case (o && c === V[r] && m === ae[r]):
|
|
254
|
-
u(`Size unchanged: ${w}`, ...A), g = Math.max(c, m);
|
|
255
|
-
break;
|
|
256
|
-
case (c === 0 && m !== 0):
|
|
257
|
-
u(`Page is hidden: ${w}`, ...A), g = m;
|
|
258
|
-
break;
|
|
259
|
-
case (!t && c !== V[r] && m <= ae[r]):
|
|
260
|
-
u(`New <html> size: ${w} `, ...A), u(
|
|
261
|
-
`Previous <html> size: %c${V[r]}px`,
|
|
262
|
-
a
|
|
263
|
-
), g = H(
|
|
264
|
-
r,
|
|
265
|
-
c,
|
|
266
|
-
m
|
|
267
|
-
);
|
|
268
|
-
break;
|
|
269
|
-
case !d:
|
|
270
|
-
g = e.taggedElement();
|
|
271
|
-
break;
|
|
272
|
-
case (!t && c < V[r]):
|
|
273
|
-
u(`<html> size decreased: ${w}`, ...A), g = H(
|
|
274
|
-
r,
|
|
275
|
-
c,
|
|
276
|
-
m
|
|
277
|
-
);
|
|
278
|
-
break;
|
|
279
|
-
case (m === b || m === f):
|
|
280
|
-
u(`<html> size equals page size: ${w}`, ...A), g = H(
|
|
281
|
-
r,
|
|
282
|
-
c,
|
|
283
|
-
m
|
|
284
|
-
);
|
|
285
|
-
break;
|
|
286
|
-
case c > m:
|
|
287
|
-
u(`Page size < <html> size: ${w}`, ...A), g = H(
|
|
288
|
-
r,
|
|
289
|
-
c,
|
|
290
|
-
m
|
|
291
|
-
);
|
|
292
|
-
break;
|
|
293
|
-
case t:
|
|
294
|
-
u("Found elements possibly overflowing <html> "), g = e.taggedElement();
|
|
295
|
-
break;
|
|
296
|
-
default:
|
|
297
|
-
u(`Using <html> size: ${w}`, ...A), g = H(
|
|
298
|
-
r,
|
|
299
|
-
c,
|
|
300
|
-
m
|
|
301
|
-
);
|
|
302
|
-
}
|
|
303
|
-
return u(`Content ${r}: %c${g}px`, a), g += Co(e), Math.max(g, J);
|
|
304
|
-
}
|
|
305
|
-
const jo = 1e3, _o = 5 * jo, Do = 4, xo = 10, Bo = 100, Xe = "--ifr-start", me = "--ifr-end", dn = "--ifr-measure", v = [];
|
|
306
|
-
let le = {}, vt = 0, De;
|
|
307
|
-
function un() {
|
|
308
|
-
try {
|
|
309
|
-
performance.clearMarks(Xe), performance.clearMarks(me), performance.clearMeasures(dn);
|
|
310
|
-
} catch {
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
function Fo() {
|
|
314
|
-
De = setInterval(() => {
|
|
315
|
-
if (v.length < xo || le.hasTags && le.len < 25) return;
|
|
316
|
-
v.sort();
|
|
317
|
-
const e = Math.min(
|
|
318
|
-
v.reduce((n, o) => n + o, 0) / v.length,
|
|
319
|
-
v[Math.floor(v.length / 2)]
|
|
320
|
-
), t = D(e);
|
|
321
|
-
t > vt && (vt = t, h("performanceObserver"), l("Mean time:", D(v[Math.floor(v.length / 2)])), l(
|
|
322
|
-
"Median time:",
|
|
323
|
-
D(v.reduce((n, o) => n + o, 0) / v.length)
|
|
324
|
-
), l("Average time:", t), l("Max time:", D(Math.max(...v)))), un(), !(e <= Do) && (clearInterval(De), p(
|
|
325
|
-
`<rb>Performance Warning</>
|
|
326
|
-
|
|
327
|
-
Calculating the page size is taking an excessive amount of time (${D(e)}ms).
|
|
328
|
-
|
|
329
|
-
To improve performance add the <b>data-iframe-size</> attribute to the ${le.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
|
|
330
|
-
));
|
|
331
|
-
}, _o);
|
|
332
|
-
}
|
|
333
|
-
function Ho(e) {
|
|
334
|
-
e.getEntries().forEach((t) => {
|
|
335
|
-
if (t.name === me)
|
|
336
|
-
try {
|
|
337
|
-
const { duration: n } = performance.measure(
|
|
338
|
-
dn,
|
|
339
|
-
Xe,
|
|
340
|
-
me
|
|
341
|
-
);
|
|
342
|
-
le = t.detail, v.push(n), v.length > Bo && v.shift();
|
|
343
|
-
} catch {
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
function Vo() {
|
|
348
|
-
u("Attached%c PerformanceObserver%c to page", a, z);
|
|
349
|
-
const e = new PerformanceObserver(Ho);
|
|
350
|
-
return e.observe({ entryTypes: ["mark"] }), Fo(), {
|
|
351
|
-
disconnect: () => {
|
|
352
|
-
un(), clearInterval(De), e.disconnect(), u("Detached%c PerformanceObserver", a);
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
const Wo = (e) => `:not(${e})`, Uo = `* ${Array.from(Jt).map(Wo).join("")}`, et = (e) => e.querySelectorAll(Uo);
|
|
357
|
-
function Go() {
|
|
358
|
-
const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = s;
|
|
359
|
-
return t ? o : e ? Array.from(n) : et(document.documentElement);
|
|
360
|
-
}
|
|
361
|
-
function qo(e, t) {
|
|
362
|
-
const n = `margin-${t}`;
|
|
363
|
-
let o, r = document.documentElement, d = s.hasTags ? J : document.documentElement.getBoundingClientRect().bottom;
|
|
364
|
-
for (const c of e)
|
|
365
|
-
o = c.getBoundingClientRect()[t] + parseFloat(getComputedStyle(c).getPropertyValue(n)), o > d && (d = o, r = c);
|
|
366
|
-
return { maxEl: r, maxVal: d };
|
|
367
|
-
}
|
|
368
|
-
function fn(e) {
|
|
369
|
-
performance.mark(Xe);
|
|
370
|
-
const t = Xt(e), { logging: n } = i, { hasTags: o } = s, r = Go(), { maxEl: d, maxVal: c } = qo(r, e);
|
|
371
|
-
return u(`${t} position calculated from:`, d), u(`Checked %c${r.length}%c elements`, a, z), performance.mark(me, {
|
|
372
|
-
detail: {
|
|
373
|
-
hasTags: o,
|
|
374
|
-
len: r.length,
|
|
375
|
-
logging: n,
|
|
376
|
-
Side: t
|
|
377
|
-
}
|
|
378
|
-
}), c;
|
|
379
|
-
}
|
|
380
|
-
const Ee = {
|
|
381
|
-
label: ze,
|
|
382
|
-
enabled: () => i.calculateHeight,
|
|
383
|
-
getOffset: () => i.offsetHeight,
|
|
384
|
-
auto: () => ln(Ee),
|
|
385
|
-
boundingClientRect: () => Math.max(
|
|
386
|
-
document.documentElement.getBoundingClientRect().bottom,
|
|
387
|
-
document.body.getBoundingClientRect().bottom
|
|
388
|
-
),
|
|
389
|
-
documentElementScroll: () => document.documentElement.scrollHeight,
|
|
390
|
-
taggedElement: () => fn(Vt)
|
|
391
|
-
}, Oe = {
|
|
392
|
-
label: Ft,
|
|
393
|
-
enabled: () => i.calculateWidth,
|
|
394
|
-
getOffset: () => i.offsetWidth,
|
|
395
|
-
auto: () => ln(Oe),
|
|
396
|
-
boundingClientRect: () => Math.max(
|
|
397
|
-
document.documentElement.getBoundingClientRect().right,
|
|
398
|
-
document.body.getBoundingClientRect().right
|
|
399
|
-
),
|
|
400
|
-
documentElementScroll: () => document.documentElement.scrollWidth,
|
|
401
|
-
taggedElement: () => fn(Wt)
|
|
402
217
|
};
|
|
403
|
-
function
|
|
404
|
-
const { label: n } = t;
|
|
405
|
-
return e && e !== P && p(
|
|
406
|
-
`<rb>Ignored ${n}CalculationMethod (${e})</>
|
|
407
|
-
|
|
408
|
-
This version of <i>iframe-resizer</> auto detects the most suitable ${n} calculation method. The <b>${n}CalculationMethod</> option is no longer supported and has been ignored.
|
|
409
|
-
|
|
410
|
-
To remove this warning, delete the <b>${n}CalculationMethod</> option from your parent page config and/or the <i>window.iframeResizer</> config on the child page.
|
|
411
|
-
`
|
|
412
|
-
), l(`Set ${n} calculation method: %c${P}`, a), P;
|
|
413
|
-
}
|
|
414
|
-
function Zo() {
|
|
415
|
-
i.heightCalcMode = mn(i.heightCalcMode, Ee);
|
|
416
|
-
}
|
|
417
|
-
function Yo() {
|
|
418
|
-
i.widthCalcMode = mn(i.widthCalcMode, Oe);
|
|
419
|
-
}
|
|
420
|
-
function Qo() {
|
|
218
|
+
function ko() {
|
|
421
219
|
try {
|
|
422
|
-
|
|
220
|
+
r.sameOrigin = i.mode === 1 || "iframeParentListener" in window.parent;
|
|
423
221
|
} catch {
|
|
424
222
|
l("Cross domain iframe detected");
|
|
425
223
|
}
|
|
426
224
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
The <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`;
|
|
430
|
-
function Ko() {
|
|
431
|
-
let e = !1;
|
|
432
|
-
const t = (n) => document.querySelectorAll(`[${n}]`).forEach((o) => {
|
|
433
|
-
o.toggleAttribute(be, !0), o.removeAttribute(n), e = !0;
|
|
434
|
-
});
|
|
435
|
-
t("data-iframe-height"), t("data-iframe-width"), e && p(Jo);
|
|
436
|
-
}
|
|
437
|
-
let bt = 0;
|
|
438
|
-
function Xo(e) {
|
|
225
|
+
let gt = 0;
|
|
226
|
+
function Mo(e) {
|
|
439
227
|
const t = e.length === 1 ? "" : "s";
|
|
440
|
-
|
|
228
|
+
H(
|
|
441
229
|
`%c[${X}]%c found on %c${e.length}%c element${t}`,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
230
|
+
st,
|
|
231
|
+
Z,
|
|
232
|
+
st,
|
|
233
|
+
Z
|
|
446
234
|
);
|
|
447
235
|
}
|
|
448
|
-
function
|
|
236
|
+
function $o() {
|
|
449
237
|
const e = document.querySelectorAll(`*[${X}]`), t = e.length > 0;
|
|
450
|
-
return t && e.length !==
|
|
238
|
+
return t && e.length !== gt && (Mo(e), gt = e.length), t;
|
|
451
239
|
}
|
|
452
|
-
const
|
|
240
|
+
const fe = (e) => {
|
|
453
241
|
if (!e) return "";
|
|
454
242
|
let t = -559038744, n = 1103547984;
|
|
455
|
-
for (let o,
|
|
456
|
-
o = e.codePointAt(
|
|
243
|
+
for (let o, s = 0; s < e.length; s++)
|
|
244
|
+
o = e.codePointAt(s), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
|
|
457
245
|
return t ^= Math.imul(t ^ n >>> 15, 1935289751), n ^= Math.imul(n ^ t >>> 15, 3405138345), t ^= n >>> 16, n ^= t >>> 16, (2097152 * (n >>> 0) + (t >>> 11)).toString(36);
|
|
458
|
-
},
|
|
246
|
+
}, A = (e) => e.replace(
|
|
459
247
|
/[A-Za-z]/g,
|
|
460
248
|
(t) => String.fromCodePoint(
|
|
461
249
|
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
462
250
|
)
|
|
463
|
-
),
|
|
251
|
+
), To = /* @__PURE__ */ new Date(), rn = (e) => new Set(Array.from({ length: 9 }, e)), pt = " - lewpylk", F = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], Ao = [
|
|
464
252
|
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
465
253
|
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
466
|
-
"Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3
|
|
254
|
+
"Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>. Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>",
|
|
467
255
|
"<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.",
|
|
468
256
|
"<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.",
|
|
469
257
|
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
470
258
|
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.",
|
|
471
259
|
"<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.",
|
|
472
|
-
"<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz."
|
|
473
|
-
|
|
260
|
+
"<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.",
|
|
261
|
+
"<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"
|
|
262
|
+
], Io = (e) => [
|
|
474
263
|
e[0],
|
|
475
|
-
...e.slice(1).map((t) => `${t}${
|
|
476
|
-
`${e[4]}${
|
|
264
|
+
...e.slice(1).map((t) => `${t}${pt}`),
|
|
265
|
+
`${e[4]}${pt}`,
|
|
477
266
|
...e.slice(1)
|
|
478
|
-
],
|
|
267
|
+
], No = Io(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), yt = Object.fromEntries(
|
|
479
268
|
[
|
|
480
269
|
"2cgs7fdf4xb",
|
|
481
270
|
"1c9ctcccr4z",
|
|
@@ -489,155 +278,326 @@ const he = (e) => {
|
|
|
489
278
|
"oclbb4thgl",
|
|
490
279
|
"igb1wzrjqr"
|
|
491
280
|
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
492
|
-
),
|
|
493
|
-
const t = e[
|
|
281
|
+
), Lo = /* @__PURE__ */ new Set([1, 6]), cn = To[A(F[4])](), Co = rn((e, t) => fe(`${cn + t}`)), jo = rn((e, t) => fe(`${cn - ++t}`)), Po = (e) => Co.has(e) ? 9 : jo.has(e) ? 5 : -2, Ge = (e) => Lo.has(e), T = (e) => A(Ao[e]), _o = (e) => A(No[e]), vt = (e) => A(F[e]), zt = (e) => {
|
|
282
|
+
const t = e[A(F[0])] || e[A(F[1])] || e[A(F[2])] || e[A(F[3])];
|
|
494
283
|
if (!t) return -1;
|
|
495
284
|
const n = t.split("-");
|
|
496
|
-
let o = (function(
|
|
285
|
+
let o = (function(s = "", d = "") {
|
|
497
286
|
let c = -2;
|
|
498
|
-
const f =
|
|
499
|
-
return f in
|
|
287
|
+
const f = fe(A(s));
|
|
288
|
+
return f in yt && (c = yt[f]), c === 9 ? Po(d) : c;
|
|
500
289
|
})(...n);
|
|
501
|
-
return o === 0 || ((
|
|
290
|
+
return o === 0 || ((s) => s[2] === fe(s[0] + s[1]))(n) || (o = -2), o;
|
|
502
291
|
};
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
try {
|
|
506
|
-
if (sessionStorage.getItem("ifr") === x) return;
|
|
507
|
-
} catch {
|
|
508
|
-
}
|
|
509
|
-
go(`v${x} (${lr(e)})`, e), e < 2 && p(I(3));
|
|
510
|
-
try {
|
|
511
|
-
sessionStorage.setItem("ifr", x);
|
|
512
|
-
} catch {
|
|
513
|
-
}
|
|
514
|
-
}
|
|
292
|
+
function xo(e, t, n) {
|
|
293
|
+
(!N(n) || t > -1 && e > t) && (ao(`v${K} (${_o(e)})`, e), e === 0 && uo(T(3)));
|
|
515
294
|
}
|
|
516
|
-
function
|
|
295
|
+
function Bo({
|
|
517
296
|
key: e,
|
|
518
297
|
key2: t,
|
|
519
298
|
mode: n,
|
|
520
299
|
version: o
|
|
521
300
|
}) {
|
|
522
|
-
const
|
|
301
|
+
const s = n, d = N(e) ? zt({ key: e }) : -1, c = N(t) ? zt({ key: t }) : -1;
|
|
523
302
|
let f;
|
|
524
303
|
switch (n = Math.max(d, c), n) {
|
|
525
304
|
case -2:
|
|
526
305
|
case -1:
|
|
527
|
-
f = `${
|
|
306
|
+
f = `${T(Math.min(d, c) + 2)}${T(2)}`, r.firstRun = !1;
|
|
528
307
|
break;
|
|
529
308
|
case 1:
|
|
530
309
|
case 2:
|
|
531
310
|
case 3:
|
|
532
|
-
f =
|
|
311
|
+
f = T(6);
|
|
533
312
|
break;
|
|
534
313
|
case 4:
|
|
535
|
-
f =
|
|
314
|
+
f = T(7);
|
|
536
315
|
break;
|
|
537
316
|
case 5:
|
|
538
|
-
f =
|
|
317
|
+
f = T(8);
|
|
539
318
|
break;
|
|
540
319
|
}
|
|
541
|
-
if (
|
|
542
|
-
throw f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
320
|
+
if (n >= 0 && xo(n, s, o), (!N(o) || !r.firstRun) && (f && w(f), n < 0))
|
|
321
|
+
throw w(T(9)), f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
543
322
|
i.mode = n;
|
|
544
323
|
}
|
|
545
|
-
const
|
|
324
|
+
const Do = "BackCompat", Fo = `<rb>Quirks Mode Detected</>
|
|
546
325
|
|
|
547
326
|
This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
|
|
548
327
|
|
|
549
328
|
For more information see <u>https://iframe-resizer.com/quirks-mode</>.
|
|
550
329
|
`;
|
|
551
|
-
function
|
|
552
|
-
document.compatMode ===
|
|
330
|
+
function Ho() {
|
|
331
|
+
document.compatMode === Do && w(Fo);
|
|
553
332
|
}
|
|
554
|
-
const
|
|
555
|
-
let
|
|
556
|
-
function
|
|
557
|
-
document.readyState ===
|
|
333
|
+
const Vo = "complete";
|
|
334
|
+
let bt = !1;
|
|
335
|
+
function an(e) {
|
|
336
|
+
document.readyState === Vo ? ze(e) : bt || C(
|
|
558
337
|
document,
|
|
559
|
-
|
|
560
|
-
() =>
|
|
561
|
-
),
|
|
338
|
+
Bt,
|
|
339
|
+
() => an(e)
|
|
340
|
+
), bt = !0;
|
|
562
341
|
}
|
|
563
|
-
const
|
|
342
|
+
const Wo = () => {
|
|
564
343
|
u(`Set targetOrigin for parent: %c${i.targetOrigin}`, a), i.autoResize !== !0 && l("Auto Resize disabled");
|
|
565
344
|
};
|
|
566
|
-
function
|
|
567
|
-
|
|
345
|
+
function ln() {
|
|
346
|
+
r.taggedElements = document.querySelectorAll(`[${Pe}]`), r.hasTags = r.taggedElements.length > 0, l(`Tagged elements found: %c${r.hasTags}`, a);
|
|
568
347
|
}
|
|
569
|
-
const
|
|
348
|
+
const Uo = `<rb>Legacy version detected on parent page</>
|
|
570
349
|
|
|
571
350
|
Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
|
|
572
351
|
|
|
573
352
|
See <u>https://iframe-resizer.com/setup/</> for more details.
|
|
574
|
-
`,
|
|
353
|
+
`, Go = (e) => `<b>Version mismatch</>
|
|
575
354
|
|
|
576
355
|
The parent and child pages are running different versions of <i>iframe resizer</>.
|
|
577
356
|
|
|
578
|
-
Parent page: ${e} - Child page: ${
|
|
357
|
+
Parent page: ${e} - Child page: ${K}.
|
|
579
358
|
`;
|
|
580
|
-
function
|
|
581
|
-
!e || e === "" || e ===
|
|
359
|
+
function qo({ version: e }) {
|
|
360
|
+
!e || e === "" || e === Un ? w(Uo) : e !== K && w(Go(e));
|
|
582
361
|
}
|
|
583
|
-
const
|
|
584
|
-
function
|
|
585
|
-
if (!
|
|
586
|
-
const t =
|
|
362
|
+
const Zo = Yt(() => w(T(4)));
|
|
363
|
+
function Yo(e) {
|
|
364
|
+
if (!r.timerActive) return;
|
|
365
|
+
const t = P(performance.now() - r.totalTime), n = e === ye ? `Initialised iframe in %c${t}ms` : `Size calculated in %c${t}ms`;
|
|
587
366
|
l(n, a);
|
|
588
367
|
}
|
|
589
|
-
function
|
|
368
|
+
function Qo(e) {
|
|
590
369
|
return e === void 0 ? e = i.targetOrigin : l(`Message targetOrigin: %c${e}`, a), e;
|
|
591
370
|
}
|
|
592
|
-
function
|
|
593
|
-
const { mode: n } = i, { sameOrigin: o, target:
|
|
371
|
+
function Jo(e, t) {
|
|
372
|
+
const { mode: n } = i, { sameOrigin: o, target: s } = r;
|
|
594
373
|
if (o)
|
|
595
374
|
try {
|
|
596
|
-
window.parent.iframeParentListener(
|
|
375
|
+
window.parent.iframeParentListener(le + e);
|
|
597
376
|
} catch (d) {
|
|
598
|
-
if (
|
|
599
|
-
else throw d;
|
|
377
|
+
if (Ge(n)) Zo();
|
|
378
|
+
else throw new Error(d);
|
|
600
379
|
return !1;
|
|
601
380
|
}
|
|
602
381
|
else {
|
|
603
|
-
|
|
604
|
-
const d =
|
|
382
|
+
lo(s, "Internal error: postMessage target is undefined");
|
|
383
|
+
const d = Qo(t), c = Array.isArray(d) ? d : [d];
|
|
605
384
|
for (const f of c)
|
|
606
|
-
|
|
385
|
+
s.postMessage(le + e, f);
|
|
607
386
|
}
|
|
608
387
|
return !0;
|
|
609
388
|
}
|
|
610
|
-
function
|
|
611
|
-
const { parentId: d } = i, { sameOrigin: c } =
|
|
612
|
-
i.mode < -1 || !
|
|
613
|
-
`Sending message to parent page via ${c ? "sameOrigin" : "postMessage"}: %c%c${
|
|
614
|
-
|
|
389
|
+
function un(e, t, n, o, s) {
|
|
390
|
+
const { parentId: d } = i, { sameOrigin: c } = r, f = `${e}:${t}`, y = `${d}:${f}:${n}${o === void 0 ? "" : `:${o}`}`;
|
|
391
|
+
i.mode < -1 || !Jo(y, s) || (Yo(n), u(
|
|
392
|
+
`Sending message to parent page via ${c ? "sameOrigin" : "postMessage"}: %c%c${y}`,
|
|
393
|
+
Tn,
|
|
615
394
|
a
|
|
616
395
|
));
|
|
617
396
|
}
|
|
618
|
-
const
|
|
619
|
-
(e, t, n, o,
|
|
620
|
-
h(n),
|
|
397
|
+
const z = We(
|
|
398
|
+
(e, t, n, o, s) => {
|
|
399
|
+
h(n), un(e, t, n, o, s), x();
|
|
621
400
|
}
|
|
622
|
-
),
|
|
623
|
-
function
|
|
624
|
-
l(`Add event listener: %c${t}`, a),
|
|
401
|
+
), Ko = (e) => z(0, 0, e.type, `${e.screenY}:${e.screenX}`);
|
|
402
|
+
function wt(e, t) {
|
|
403
|
+
l(`Add event listener: %c${t}`, a), C(window.document, e, Ko);
|
|
625
404
|
}
|
|
626
|
-
function
|
|
405
|
+
function Xo({
|
|
627
406
|
mouseEvents: e
|
|
628
407
|
}) {
|
|
629
|
-
e === !0 && (
|
|
408
|
+
e === !0 && (wt(jn, "Mouse Enter"), wt(Pn, "Mouse Leave"));
|
|
630
409
|
}
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
e ||
|
|
410
|
+
const es = () => z(0, 0, Nn);
|
|
411
|
+
function ts({ persisted: e }) {
|
|
412
|
+
e || es(), h(Ct), u("Page persisted:", e), !e && Ue.forEach(Qn);
|
|
634
413
|
}
|
|
635
|
-
const
|
|
636
|
-
function
|
|
637
|
-
const { calculateHeight: n, calculateWidth: o } = i, { height:
|
|
638
|
-
return n &&
|
|
414
|
+
const ns = () => C(window, Jn(Ct), ts), St = (e, t) => !(Math.abs(e - t) <= i.tolerance);
|
|
415
|
+
function os(e, t) {
|
|
416
|
+
const { calculateHeight: n, calculateWidth: o } = i, { height: s, width: d } = r;
|
|
417
|
+
return n && St(s, e) || o && St(d, t);
|
|
639
418
|
}
|
|
640
|
-
|
|
419
|
+
const I = [a, v, a], ce = {
|
|
420
|
+
height: 0,
|
|
421
|
+
width: 0
|
|
422
|
+
}, D = {
|
|
423
|
+
height: 0,
|
|
424
|
+
width: 0
|
|
425
|
+
};
|
|
426
|
+
function B(e, t, n) {
|
|
427
|
+
return D[e] = t, ce[e] = n, t;
|
|
428
|
+
}
|
|
429
|
+
function ss(e) {
|
|
430
|
+
const t = e.getOffset();
|
|
431
|
+
return t !== 0 && u(`Page offsetSize: %c${t}px`, a), t;
|
|
432
|
+
}
|
|
433
|
+
const rs = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
|
|
434
|
+
function dn(e) {
|
|
435
|
+
const { hasOverflow: t, hasTags: n, triggerLocked: o } = r, s = e.label, d = s === ve, c = e.boundingClientRect(), f = Math.ceil(c), y = Math.floor(c), m = rs(e), b = `HTML: %c${c}px %cPage: %c${m}px`;
|
|
436
|
+
let g;
|
|
437
|
+
switch (!0) {
|
|
438
|
+
case !e.enabled():
|
|
439
|
+
return Math.max(m, Y);
|
|
440
|
+
case n:
|
|
441
|
+
u("Found element with data-iframe-size attribute"), g = e.taggedElement();
|
|
442
|
+
break;
|
|
443
|
+
case (!t && r.firstRun && D[s] === 0 && ce[s] === 0):
|
|
444
|
+
u(`Initial page size values: ${b}`, ...I), g = B(
|
|
445
|
+
s,
|
|
446
|
+
c,
|
|
447
|
+
m
|
|
448
|
+
);
|
|
449
|
+
break;
|
|
450
|
+
case (o && c === D[s] && m === ce[s]):
|
|
451
|
+
u(`Size unchanged: ${b}`, ...I), g = Math.max(c, m);
|
|
452
|
+
break;
|
|
453
|
+
case (c === 0 && m !== 0):
|
|
454
|
+
u(`Page is hidden: ${b}`, ...I), g = m;
|
|
455
|
+
break;
|
|
456
|
+
case (!t && c !== D[s] && m <= ce[s]):
|
|
457
|
+
u(`New <html> size: ${b} `, ...I), u(
|
|
458
|
+
`Previous <html> size: %c${D[s]}px`,
|
|
459
|
+
a
|
|
460
|
+
), g = B(
|
|
461
|
+
s,
|
|
462
|
+
c,
|
|
463
|
+
m
|
|
464
|
+
);
|
|
465
|
+
break;
|
|
466
|
+
case !d:
|
|
467
|
+
g = e.taggedElement();
|
|
468
|
+
break;
|
|
469
|
+
case (!t && c < D[s]):
|
|
470
|
+
u(`<html> size decreased: ${b}`, ...I), g = B(
|
|
471
|
+
s,
|
|
472
|
+
c,
|
|
473
|
+
m
|
|
474
|
+
);
|
|
475
|
+
break;
|
|
476
|
+
case (m === y || m === f):
|
|
477
|
+
u(`<html> size equals page size: ${b}`, ...I), g = B(
|
|
478
|
+
s,
|
|
479
|
+
c,
|
|
480
|
+
m
|
|
481
|
+
);
|
|
482
|
+
break;
|
|
483
|
+
case c > m:
|
|
484
|
+
u(`Page size < <html> size: ${b}`, ...I), g = B(
|
|
485
|
+
s,
|
|
486
|
+
c,
|
|
487
|
+
m
|
|
488
|
+
);
|
|
489
|
+
break;
|
|
490
|
+
case t:
|
|
491
|
+
u("Found elements possibly overflowing <html> "), g = e.taggedElement();
|
|
492
|
+
break;
|
|
493
|
+
default:
|
|
494
|
+
u(`Using <html> size: ${b}`, ...I), g = B(
|
|
495
|
+
s,
|
|
496
|
+
c,
|
|
497
|
+
m
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
return u(`Content ${s}: %c${g}px`, a), g += ss(e), Math.max(g, Y);
|
|
501
|
+
}
|
|
502
|
+
const is = 1e3, cs = 5 * is, as = 4, ls = 10, us = 100, qe = "--ifr-start", me = "--ifr-end", fn = "--ifr-measure", p = [];
|
|
503
|
+
let ae = {}, Et = 0, Ae;
|
|
504
|
+
function mn() {
|
|
505
|
+
try {
|
|
506
|
+
performance.clearMarks(qe), performance.clearMarks(me), performance.clearMeasures(fn);
|
|
507
|
+
} catch {
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function ds() {
|
|
511
|
+
Ae = setInterval(() => {
|
|
512
|
+
if (p.length < ls || ae.hasTags && ae.len < 25) return;
|
|
513
|
+
p.sort();
|
|
514
|
+
const e = Math.min(
|
|
515
|
+
p.reduce((n, o) => n + o, 0) / p.length,
|
|
516
|
+
p[Math.floor(p.length / 2)]
|
|
517
|
+
), t = P(e);
|
|
518
|
+
t > Et && (Et = t, h("performanceObserver"), l("Mean time:", P(p[Math.floor(p.length / 2)])), l(
|
|
519
|
+
"Median time:",
|
|
520
|
+
P(p.reduce((n, o) => n + o, 0) / p.length)
|
|
521
|
+
), l("Average time:", t), l("Max time:", P(Math.max(...p)))), mn(), !(e <= as) && (clearInterval(Ae), w(
|
|
522
|
+
`<rb>Performance Warning</>
|
|
523
|
+
|
|
524
|
+
Calculating the page size is taking an excessive amount of time (${P(e)}ms).
|
|
525
|
+
|
|
526
|
+
To improve performance add the <b>data-iframe-size</> attribute to the ${ae.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
|
|
527
|
+
));
|
|
528
|
+
}, cs);
|
|
529
|
+
}
|
|
530
|
+
function fs(e) {
|
|
531
|
+
e.getEntries().forEach((t) => {
|
|
532
|
+
if (t.name === me)
|
|
533
|
+
try {
|
|
534
|
+
const { duration: n } = performance.measure(
|
|
535
|
+
fn,
|
|
536
|
+
qe,
|
|
537
|
+
me
|
|
538
|
+
);
|
|
539
|
+
ae = t.detail, p.push(n), p.length > us && p.shift();
|
|
540
|
+
} catch {
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function ms() {
|
|
545
|
+
u("Attached%c PerformanceObserver%c to page", a, v);
|
|
546
|
+
const e = new PerformanceObserver(fs);
|
|
547
|
+
return e.observe({ entryTypes: ["mark"] }), ds(), {
|
|
548
|
+
disconnect: () => {
|
|
549
|
+
mn(), clearInterval(Ae), e.disconnect(), u("Detached%c PerformanceObserver", a);
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
const hs = (e) => `:not(${e})`, gs = `* ${Array.from(Zt).map(hs).join("")}`, Ze = (e) => e.querySelectorAll(gs);
|
|
554
|
+
function ps() {
|
|
555
|
+
const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = r;
|
|
556
|
+
return t ? o : e ? Array.from(n) : Ze(document.documentElement);
|
|
557
|
+
}
|
|
558
|
+
function ys(e, t) {
|
|
559
|
+
const n = `margin-${t}`;
|
|
560
|
+
let o, s = document.documentElement, d = r.hasTags ? Y : document.documentElement.getBoundingClientRect().bottom;
|
|
561
|
+
for (const c of e)
|
|
562
|
+
o = c.getBoundingClientRect()[t] + parseFloat(getComputedStyle(c).getPropertyValue(n)), o > d && (d = o, s = c);
|
|
563
|
+
return { maxEl: s, maxVal: d };
|
|
564
|
+
}
|
|
565
|
+
function hn(e) {
|
|
566
|
+
performance.mark(qe);
|
|
567
|
+
const t = Qt(e), { logging: n } = i, { hasTags: o } = r, s = ps(), { maxEl: d, maxVal: c } = ys(s, e);
|
|
568
|
+
return u(`${t} position calculated from:`, d), u(`Checked %c${s.length}%c elements`, a, v), performance.mark(me, {
|
|
569
|
+
detail: {
|
|
570
|
+
hasTags: o,
|
|
571
|
+
len: s.length,
|
|
572
|
+
logging: n,
|
|
573
|
+
Side: t
|
|
574
|
+
}
|
|
575
|
+
}), c;
|
|
576
|
+
}
|
|
577
|
+
const Ye = {
|
|
578
|
+
label: ve,
|
|
579
|
+
enabled: () => i.calculateHeight,
|
|
580
|
+
getOffset: () => i.offsetHeight,
|
|
581
|
+
auto: () => dn(Ye),
|
|
582
|
+
boundingClientRect: () => Math.max(
|
|
583
|
+
document.documentElement.getBoundingClientRect().bottom,
|
|
584
|
+
document.body.getBoundingClientRect().bottom
|
|
585
|
+
),
|
|
586
|
+
documentElementScroll: () => document.documentElement.scrollHeight,
|
|
587
|
+
taggedElement: () => hn(Dt)
|
|
588
|
+
}, Qe = {
|
|
589
|
+
label: xt,
|
|
590
|
+
enabled: () => i.calculateWidth,
|
|
591
|
+
getOffset: () => i.offsetWidth,
|
|
592
|
+
auto: () => dn(Qe),
|
|
593
|
+
boundingClientRect: () => Math.max(
|
|
594
|
+
document.documentElement.getBoundingClientRect().right,
|
|
595
|
+
document.body.getBoundingClientRect().right
|
|
596
|
+
),
|
|
597
|
+
documentElementScroll: () => document.documentElement.scrollWidth,
|
|
598
|
+
taggedElement: () => hn(Ft)
|
|
599
|
+
};
|
|
600
|
+
function vs(e, t, n) {
|
|
641
601
|
const o = i.onBeforeResize(e, t, n);
|
|
642
602
|
if (o === void 0)
|
|
643
603
|
throw new TypeError(
|
|
@@ -647,442 +607,401 @@ function Ar(e, t, n) {
|
|
|
647
607
|
throw new TypeError(
|
|
648
608
|
`Invalid value returned from onBeforeResize(): ${o}, expected Number`
|
|
649
609
|
);
|
|
650
|
-
if (o <
|
|
610
|
+
if (o < Y)
|
|
651
611
|
throw new RangeError(
|
|
652
|
-
`Out of range value returned from onBeforeResize(): ${o}, must be at least ${
|
|
612
|
+
`Out of range value returned from onBeforeResize(): ${o}, must be at least ${Y}`
|
|
653
613
|
);
|
|
654
614
|
return o;
|
|
655
615
|
}
|
|
656
|
-
const
|
|
657
|
-
const
|
|
658
|
-
return e.enabled() && i.onBeforeResize !== void 0 ?
|
|
659
|
-
},
|
|
660
|
-
function
|
|
616
|
+
const gn = (e, t) => (n, o) => {
|
|
617
|
+
const s = e[n]();
|
|
618
|
+
return e.enabled() && i.onBeforeResize !== void 0 ? vs(s, o, t) : s;
|
|
619
|
+
}, zs = gn(Ye, ve), bs = gn(Qe, xt);
|
|
620
|
+
function ws() {
|
|
661
621
|
(window.scrollY !== 0 || window.scrollX !== 0) && (u("Reset iframe scroll position to (0, 0)"), window.scrollTo(0, 0));
|
|
662
622
|
}
|
|
663
|
-
function
|
|
664
|
-
const { heightCalcMode:
|
|
665
|
-
|
|
666
|
-
const c = n ??
|
|
667
|
-
switch (l(`Resize event: %c${t}`, a),
|
|
668
|
-
case
|
|
669
|
-
case
|
|
670
|
-
case
|
|
671
|
-
case
|
|
672
|
-
case
|
|
673
|
-
|
|
623
|
+
function Ss(e, t, n, o) {
|
|
624
|
+
const { heightCalcMode: s, widthCalcMode: d } = i;
|
|
625
|
+
ws();
|
|
626
|
+
const c = n ?? zs(s, e), f = o ?? bs(d, e), y = os(c, f) ? it : e;
|
|
627
|
+
switch (l(`Resize event: %c${t}`, a), y) {
|
|
628
|
+
case ye:
|
|
629
|
+
case Te:
|
|
630
|
+
case it:
|
|
631
|
+
case Be:
|
|
632
|
+
case De:
|
|
633
|
+
r.height = c, r.width = f;
|
|
674
634
|
// eslint-disable-next-line no-fallthrough
|
|
675
|
-
case
|
|
676
|
-
return
|
|
635
|
+
case Ht:
|
|
636
|
+
return r;
|
|
677
637
|
// the following case needs {} to prevent a compile error on Next.js
|
|
678
|
-
case
|
|
679
|
-
case
|
|
680
|
-
case
|
|
681
|
-
case
|
|
682
|
-
l(
|
|
638
|
+
case Fe:
|
|
639
|
+
case Wt:
|
|
640
|
+
case Vt:
|
|
641
|
+
case Ut: {
|
|
642
|
+
l(ct);
|
|
683
643
|
break;
|
|
684
644
|
}
|
|
685
645
|
default:
|
|
686
|
-
u(
|
|
646
|
+
u(ct);
|
|
687
647
|
}
|
|
688
648
|
return null;
|
|
689
649
|
}
|
|
690
|
-
let
|
|
691
|
-
function
|
|
692
|
-
const { autoResize: d } = i, { isHidden: c } =
|
|
650
|
+
let se = !1, Ee = !1, U = null;
|
|
651
|
+
function Es(e, t, n, o, s) {
|
|
652
|
+
const { autoResize: d } = i, { isHidden: c } = r;
|
|
693
653
|
switch (h(e), !0) {
|
|
694
654
|
// Allow manual and parent resize requests to bypass the hidden check
|
|
695
|
-
case (c === !0 && !(e in
|
|
696
|
-
if (
|
|
697
|
-
l("Iframe hidden - Ignored resize request"),
|
|
655
|
+
case (c === !0 && !(e in Se)): {
|
|
656
|
+
if (Ee === !0) break;
|
|
657
|
+
l("Iframe hidden - Ignored resize request"), Ee = !0, se = !1, cancelAnimationFrame(U), U = null;
|
|
698
658
|
break;
|
|
699
659
|
}
|
|
700
660
|
// Ignore overflowObserver here, as more efficient than using
|
|
701
661
|
// mutationObserver to detect OVERFLOW_ATTR changes
|
|
702
662
|
// Also allow manual and parent resize requests to bypass the pending check
|
|
703
|
-
case (
|
|
663
|
+
case (se === !0 && e !== Fe && !(e in Se)): {
|
|
704
664
|
l("Resize already pending - Ignored resize request");
|
|
705
665
|
break;
|
|
706
666
|
}
|
|
707
|
-
case (!d && !(e in
|
|
667
|
+
case (!d && !(e in Se)): {
|
|
708
668
|
u("Resizing disabled");
|
|
709
669
|
break;
|
|
710
670
|
}
|
|
711
671
|
default: {
|
|
712
|
-
|
|
713
|
-
const f =
|
|
672
|
+
Ee = !1, se = !0, r.totalTime = performance.now(), r.timerActive = !0;
|
|
673
|
+
const f = Ss(
|
|
714
674
|
e,
|
|
715
675
|
t,
|
|
716
676
|
n,
|
|
717
677
|
o
|
|
718
678
|
);
|
|
719
|
-
f &&
|
|
720
|
-
|
|
721
|
-
})),
|
|
679
|
+
f && un(f.height, f.width, e, s), U || (U = requestAnimationFrame(() => {
|
|
680
|
+
se = !1, U = null, h("requestAnimationFrame"), de(`Reset sendPending: %c${e}`, a);
|
|
681
|
+
})), r.timerActive = !1;
|
|
722
682
|
}
|
|
723
683
|
}
|
|
724
|
-
|
|
684
|
+
x();
|
|
725
685
|
}
|
|
726
|
-
const M =
|
|
727
|
-
function
|
|
686
|
+
const M = We(Es);
|
|
687
|
+
function Ot({
|
|
728
688
|
eventType: e,
|
|
729
689
|
eventName: t
|
|
730
690
|
}) {
|
|
731
|
-
|
|
691
|
+
C(window, t, () => M(t, e), { passive: !0 });
|
|
732
692
|
}
|
|
733
|
-
function
|
|
734
|
-
|
|
693
|
+
function Os() {
|
|
694
|
+
Ot({
|
|
735
695
|
eventType: "After Print",
|
|
736
696
|
eventName: "afterprint"
|
|
737
|
-
}),
|
|
697
|
+
}), Ot({
|
|
738
698
|
eventType: "Before Print",
|
|
739
699
|
eventName: "beforeprint"
|
|
740
700
|
});
|
|
741
701
|
}
|
|
742
|
-
function
|
|
743
|
-
if (
|
|
702
|
+
function Rs() {
|
|
703
|
+
if (r.triggerLocked) {
|
|
744
704
|
l("TriggerLock blocked calculation");
|
|
745
705
|
return;
|
|
746
706
|
}
|
|
747
|
-
|
|
748
|
-
|
|
707
|
+
r.triggerLocked = !0, de("Trigger event lock on"), requestAnimationFrame(() => {
|
|
708
|
+
r.triggerLocked = !1, de("Trigger event lock off");
|
|
749
709
|
});
|
|
750
710
|
}
|
|
751
|
-
function
|
|
752
|
-
const { heightCalcMode: t, widthCalcMode: n } = i, o =
|
|
753
|
-
l(`Reset trigger event: %c${e}`, a),
|
|
711
|
+
function pn(e) {
|
|
712
|
+
const { heightCalcMode: t, widthCalcMode: n } = i, o = Ye[t](), s = Qe[n]();
|
|
713
|
+
l(`Reset trigger event: %c${e}`, a), z(o, s, e);
|
|
754
714
|
}
|
|
755
|
-
function
|
|
715
|
+
function ks(e) {
|
|
756
716
|
const t = i.heightCalcMode;
|
|
757
|
-
l(`Reset trigger event: %c${e}`, a), i.heightCalcMode =
|
|
717
|
+
l(`Reset trigger event: %c${e}`, a), i.heightCalcMode = Zn, Rs(), pn("reset"), i.heightCalcMode = t;
|
|
758
718
|
}
|
|
759
|
-
const
|
|
760
|
-
function
|
|
761
|
-
|
|
719
|
+
const Ms = `Auto Resize can not be changed when <b>direction</> is set to '${He}'.`;
|
|
720
|
+
function $s(e) {
|
|
721
|
+
k(e, Hn, "parentIframe.autoResize(enable) enable");
|
|
762
722
|
const {
|
|
763
723
|
autoResize: t,
|
|
764
724
|
calculateHeight: n,
|
|
765
725
|
calculateWidth: o
|
|
766
726
|
} = i;
|
|
767
|
-
return o === !1 && n === !1 ? (h(
|
|
768
|
-
}
|
|
769
|
-
function Fr(e) {
|
|
770
|
-
R(e, ee, "parentIframe.moveToAnchor(anchor) anchor"), s.inPageLinks.findTarget(e);
|
|
727
|
+
return o === !1 && n === !1 ? (h(Te), w(Ms), !1) : (e === !0 && t === !1 ? (i.autoResize = !0, queueMicrotask(() => M(Te, "Auto Resize enabled"))) : e === !1 && t === !0 && (i.autoResize = !1), z(0, 0, In, JSON.stringify(i.autoResize)), i.autoResize);
|
|
771
728
|
}
|
|
772
|
-
function
|
|
773
|
-
|
|
729
|
+
function Ts(e) {
|
|
730
|
+
k(e, ee, "parentIframe.moveToAnchor(anchor) anchor"), r.inPageLinks.findTarget(e);
|
|
774
731
|
}
|
|
775
|
-
function
|
|
776
|
-
|
|
732
|
+
function As(e) {
|
|
733
|
+
k(e, _, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, M(Ht, `parentIframe.setOffsetSize(${e})`);
|
|
777
734
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
780
|
-
|
|
735
|
+
const Is = () => r.origin;
|
|
736
|
+
function Ns(e) {
|
|
737
|
+
k(
|
|
781
738
|
e,
|
|
782
739
|
ee,
|
|
783
740
|
"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"
|
|
784
741
|
), l(`Set targetOrigin: %c${e}`, a), i.targetOrigin = e;
|
|
785
742
|
}
|
|
786
|
-
function
|
|
787
|
-
|
|
788
|
-
s.onPageInfo = e, y(0, 0, _t), vo(
|
|
789
|
-
"getPageInfo()",
|
|
790
|
-
"getParentProps()",
|
|
791
|
-
"See <u>https://iframe-resizer.com/upgrade</> for details. "
|
|
792
|
-
);
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
s.onPageInfo = null, y(0, 0, Hn);
|
|
796
|
-
}
|
|
797
|
-
function wn(e) {
|
|
798
|
-
return R(
|
|
743
|
+
function Ls(e) {
|
|
744
|
+
return k(
|
|
799
745
|
e,
|
|
800
|
-
|
|
746
|
+
xe,
|
|
801
747
|
"parentIframe.getParentProps(callback) callback"
|
|
802
|
-
),
|
|
803
|
-
|
|
748
|
+
), r.onParentInfo = e, z(0, 0, jt), () => {
|
|
749
|
+
r.onParentInfo = null, z(0, 0, xn);
|
|
804
750
|
};
|
|
805
751
|
}
|
|
806
|
-
function
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
const Zr = (e) => `<rb>Deprecated API object name</>
|
|
810
|
-
The <b>window.parentIFrame</> object has been renamed to <b>window.parentIframe</>. Please update your code as the old object will be removed in a future version.
|
|
811
|
-
|
|
812
|
-
Called property: '${String(e)}'
|
|
813
|
-
`;
|
|
814
|
-
function Yr(e) {
|
|
815
|
-
const t = /* @__PURE__ */ new Set();
|
|
816
|
-
return new Proxy(e, {
|
|
817
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
818
|
-
get(n, o, r) {
|
|
819
|
-
t.has(o) || (p(Zr(o)), t.add(o));
|
|
820
|
-
const d = Reflect.get(n, o, r), c = Object.getOwnPropertyDescriptor(n, o);
|
|
821
|
-
return c && !c.configurable && !c.writable ? d : typeof d == "function" ? d.bind(n) : d;
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
function Qr(e, t) {
|
|
826
|
-
e !== void 0 && R(
|
|
752
|
+
function Cs(e, t) {
|
|
753
|
+
e !== void 0 && k(
|
|
827
754
|
e,
|
|
828
|
-
|
|
755
|
+
_,
|
|
829
756
|
"parentIframe.resize(customHeight, customWidth) customHeight"
|
|
830
|
-
), t !== void 0 &&
|
|
757
|
+
), t !== void 0 && k(
|
|
831
758
|
t,
|
|
832
|
-
|
|
759
|
+
_,
|
|
833
760
|
"parentIframe.resize(customHeight, customWidth) customWidth"
|
|
834
761
|
);
|
|
835
|
-
const n = e === void 0 ? "" : e, o = t === void 0 ? "" : `,${t}`,
|
|
762
|
+
const n = e === void 0 ? "" : e, o = t === void 0 ? "" : `,${t}`, s = `${n}${o}`;
|
|
836
763
|
M(
|
|
837
|
-
|
|
838
|
-
`parentIframe.resize(${
|
|
764
|
+
Be,
|
|
765
|
+
`parentIframe.resize(${s})`,
|
|
839
766
|
e,
|
|
840
767
|
t
|
|
841
768
|
);
|
|
842
769
|
}
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
function
|
|
847
|
-
t &&
|
|
770
|
+
const Je = (e) => (t, n) => {
|
|
771
|
+
k(t, _, `parentIframe.${e}(x, y) x`), k(n, _, `parentIframe.${e}(x, y) y`), z(n, t, e);
|
|
772
|
+
}, js = Je(Bn), Ps = Je(Dn), _s = Je(Pt);
|
|
773
|
+
function xs(e, t) {
|
|
774
|
+
t && k(
|
|
848
775
|
t,
|
|
849
776
|
ee,
|
|
850
777
|
"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"
|
|
851
|
-
),
|
|
778
|
+
), z(0, 0, $e, JSON.stringify(e), t);
|
|
852
779
|
}
|
|
853
|
-
const
|
|
854
|
-
function
|
|
855
|
-
const { win: e } =
|
|
780
|
+
const Bs = () => z(0, 0, Ln), Ds = () => i.parentId, Fs = () => ks("parentIframe.reset");
|
|
781
|
+
function Hs() {
|
|
782
|
+
const { win: e } = r;
|
|
856
783
|
i.mode !== 1 && (e.parentIframe = Object.freeze({
|
|
857
|
-
autoResize:
|
|
858
|
-
close:
|
|
859
|
-
getId:
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
scrollTo: Kr,
|
|
873
|
-
scrollToOffset: Xr,
|
|
874
|
-
sendMessage: es,
|
|
875
|
-
setTargetOrigin: Ur,
|
|
876
|
-
resize: Qr,
|
|
877
|
-
size: rs
|
|
878
|
-
// TODO Remove in V6
|
|
879
|
-
}), e.parentIFrame = Yr(e.parentIframe));
|
|
784
|
+
autoResize: $s,
|
|
785
|
+
close: Bs,
|
|
786
|
+
getId: Ds,
|
|
787
|
+
getParentOrigin: Is,
|
|
788
|
+
getParentProps: Ls,
|
|
789
|
+
moveToAnchor: Ts,
|
|
790
|
+
reset: Fs,
|
|
791
|
+
setOffsetSize: As,
|
|
792
|
+
scrollBy: js,
|
|
793
|
+
scrollTo: Ps,
|
|
794
|
+
scrollToOffset: _s,
|
|
795
|
+
sendMessage: xs,
|
|
796
|
+
setTargetOrigin: Ns,
|
|
797
|
+
resize: Cs
|
|
798
|
+
}));
|
|
880
799
|
}
|
|
881
800
|
const te = (e = "") => (t) => (n) => {
|
|
882
|
-
n.size > 0 &&
|
|
801
|
+
n.size > 0 && de(
|
|
883
802
|
`${t}Observer ${e}:`,
|
|
884
|
-
...Array.from(n).flatMap((o) => [
|
|
803
|
+
...Array.from(n).flatMap((o) => [_e, o])
|
|
885
804
|
);
|
|
886
|
-
},
|
|
887
|
-
n.size > 0 &&
|
|
805
|
+
}, Vs = (e = "") => (t) => (n) => {
|
|
806
|
+
n.size > 0 && Xt(
|
|
888
807
|
`${t}Observer ${e}:`,
|
|
889
|
-
...Array.from(n).flatMap((o) => [
|
|
808
|
+
...Array.from(n).flatMap((o) => [_e, o])
|
|
890
809
|
);
|
|
891
|
-
},
|
|
810
|
+
}, yn = te("attached to"), vn = Vs("already attached"), Ws = te("detached from"), be = (e, t = !0) => (n) => {
|
|
892
811
|
n > 0 && u(
|
|
893
812
|
`${t ? "At" : "De"}tached %c${e}Observer%c ${t ? "to" : "from"} %c${n}%c element${n === 1 ? "" : "s"}`,
|
|
894
813
|
a,
|
|
895
|
-
|
|
814
|
+
Z,
|
|
896
815
|
a,
|
|
897
|
-
|
|
816
|
+
Z
|
|
898
817
|
);
|
|
899
|
-
},
|
|
900
|
-
const
|
|
818
|
+
}, zn = (e, t, n, o) => {
|
|
819
|
+
const s = Ws(e);
|
|
901
820
|
return (d) => {
|
|
902
821
|
const c = /* @__PURE__ */ new Set();
|
|
903
822
|
let f = 0;
|
|
904
|
-
for (const
|
|
905
|
-
n.has(
|
|
906
|
-
|
|
823
|
+
for (const y of d)
|
|
824
|
+
n.has(y) && (t.unobserve(y), n.delete(y), c.add(y), f += 1);
|
|
825
|
+
s(c), o(f), c.clear();
|
|
907
826
|
};
|
|
908
|
-
},
|
|
827
|
+
}, Rt = 16, kt = 2, Us = 200, Ke = "Mutation", O = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), Ie = /* @__PURE__ */ new Set(), he = [], Gs = {
|
|
909
828
|
attributes: !0,
|
|
910
|
-
attributeFilter: [X,
|
|
829
|
+
attributeFilter: [X, Pe],
|
|
911
830
|
attributeOldValue: !1,
|
|
912
831
|
characterData: !1,
|
|
913
832
|
characterDataOldValue: !1,
|
|
914
833
|
childList: !0,
|
|
915
834
|
subtree: !0
|
|
916
835
|
};
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
function
|
|
836
|
+
let Oe = 1, Xe, Ne = !1, Le = 0;
|
|
837
|
+
const qs = te("added")(Ke), Zs = te("removed (page)")(Ke), Ys = te("removed (added)")(Ke), bn = (e) => e.nodeType !== Node.ELEMENT_NODE || Zt.has(e.tagName.toLowerCase());
|
|
838
|
+
function Qs(e) {
|
|
920
839
|
const t = e.addedNodes;
|
|
921
840
|
for (const n of t)
|
|
922
|
-
|
|
841
|
+
bn(n) || O.add(n);
|
|
923
842
|
}
|
|
924
|
-
function
|
|
843
|
+
function Js(e) {
|
|
925
844
|
const t = e.removedNodes;
|
|
926
845
|
for (const n of t)
|
|
927
|
-
|
|
846
|
+
bn(n) || (O.has(n) ? (O.delete(n), Ie.add(n)) : L.add(n));
|
|
928
847
|
}
|
|
929
|
-
const
|
|
848
|
+
const Ks = (e) => {
|
|
930
849
|
u("Mutations:", e);
|
|
931
850
|
for (const t of e)
|
|
932
|
-
|
|
933
|
-
|
|
851
|
+
Qs(t), Js(t);
|
|
852
|
+
qs(O), Zs(L), Ys(Ie), Ie.clear();
|
|
934
853
|
};
|
|
935
|
-
function
|
|
936
|
-
|
|
937
|
-
`Detected %c${
|
|
854
|
+
function Xs() {
|
|
855
|
+
L.size > 0 && l(
|
|
856
|
+
`Detected %c${L.size} %cremoved element${L.size > 1 ? "s" : ""}`,
|
|
938
857
|
a,
|
|
939
|
-
|
|
858
|
+
v
|
|
940
859
|
), O.size > 0 && l(
|
|
941
860
|
`Found %c${O.size} %cnew element${O.size > 1 ? "s" : ""}`,
|
|
942
861
|
a,
|
|
943
|
-
|
|
862
|
+
v
|
|
944
863
|
);
|
|
945
864
|
}
|
|
946
|
-
const
|
|
947
|
-
const t = performance.now(), n = t -
|
|
948
|
-
if (n > o && n <
|
|
865
|
+
const er = (e) => () => {
|
|
866
|
+
const t = performance.now(), n = t - Le, o = Rt * Oe++ + kt;
|
|
867
|
+
if (n > o && n < Us) {
|
|
949
868
|
h("mutationThrottled"), u("Update delayed due to heavy workload on the callStack"), u(
|
|
950
|
-
`EventLoop busy time: %c${
|
|
869
|
+
`EventLoop busy time: %c${P(n)}ms %c> Max wait: %c${o - kt}ms`,
|
|
951
870
|
a,
|
|
952
|
-
|
|
871
|
+
v,
|
|
953
872
|
a
|
|
954
|
-
), setTimeout(
|
|
873
|
+
), setTimeout(Xe, Rt * Oe), Le = t;
|
|
955
874
|
return;
|
|
956
875
|
}
|
|
957
|
-
|
|
876
|
+
Oe = 1, he.forEach(Ks), he.length = 0, Ne = !1, Xs(), e({ addedNodes: O, removedNodes: L }), O.clear(), L.clear();
|
|
958
877
|
};
|
|
959
|
-
function
|
|
960
|
-
|
|
878
|
+
function tr(e) {
|
|
879
|
+
he.push(e), !Ne && (Le = performance.now(), Ne = !0, requestAnimationFrame(Xe));
|
|
961
880
|
}
|
|
962
|
-
function
|
|
963
|
-
const t = new window.MutationObserver(
|
|
964
|
-
return
|
|
881
|
+
function nr(e) {
|
|
882
|
+
const t = new window.MutationObserver(tr), n = document.body || document.documentElement;
|
|
883
|
+
return Xe = er(e), t.observe(n, Gs), u("Attached%c MutationObserver%c to body", a, v), {
|
|
965
884
|
disconnect: () => {
|
|
966
|
-
O.clear(),
|
|
885
|
+
O.clear(), L.clear(), he.length = 0, t.disconnect(), u("Detached%c MutationObserver", a);
|
|
967
886
|
}
|
|
968
887
|
};
|
|
969
888
|
}
|
|
970
|
-
const
|
|
889
|
+
const or = {
|
|
971
890
|
characterData: !0,
|
|
972
891
|
childList: !0,
|
|
973
892
|
subtree: !0
|
|
974
893
|
};
|
|
975
|
-
function
|
|
894
|
+
function sr(e) {
|
|
976
895
|
const t = document.querySelector("title") ?? document.head ?? document.documentElement, n = new MutationObserver(e);
|
|
977
|
-
return n.observe(t,
|
|
896
|
+
return n.observe(t, or), u("Attached%c TitleObserver%c to head", a, v), setTimeout(e), {
|
|
978
897
|
disconnect: () => {
|
|
979
898
|
n.disconnect(), u("Detached%c TitleObserver", a);
|
|
980
899
|
}
|
|
981
900
|
};
|
|
982
901
|
}
|
|
983
|
-
function
|
|
902
|
+
function rr(e) {
|
|
984
903
|
const t = new IntersectionObserver(
|
|
985
904
|
(o) => e(o.at(-1)?.isIntersecting ?? !1),
|
|
986
905
|
{
|
|
987
906
|
threshold: 0
|
|
988
907
|
}
|
|
989
908
|
), n = document.documentElement;
|
|
990
|
-
return t.observe(n), u("Attached%c VisibilityObserver%c to page", a,
|
|
909
|
+
return t.observe(n), u("Attached%c VisibilityObserver%c to page", a, v), {
|
|
991
910
|
disconnect: () => {
|
|
992
911
|
t.disconnect(), u("Detached%c VisibilityObserver", a);
|
|
993
912
|
}
|
|
994
913
|
};
|
|
995
914
|
}
|
|
996
|
-
let
|
|
997
|
-
function
|
|
915
|
+
let Mt = /* @__PURE__ */ new Set();
|
|
916
|
+
function ir(e) {
|
|
998
917
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
999
918
|
for (const o of e)
|
|
1000
919
|
o.closest(`[${X}]`) ? n.add(o) : t.add(o);
|
|
1001
920
|
return n.size > 0 && queueMicrotask(() => {
|
|
1002
921
|
h("overflowIgnored"), u(`Ignoring elements with [data-iframe-ignore] > *:
|
|
1003
|
-
`, n),
|
|
922
|
+
`, n), x();
|
|
1004
923
|
}), t;
|
|
1005
924
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const e = document.querySelectorAll(`[${
|
|
925
|
+
function wn() {
|
|
926
|
+
const e = document.querySelectorAll(`[${_t}]`), t = ir(e);
|
|
1008
927
|
let n = !0;
|
|
1009
|
-
return typeof Set.prototype.symmetricDifference ===
|
|
928
|
+
return typeof Set.prototype.symmetricDifference === xe && (n = t.symmetricDifference(Mt).size > 0), Mt = t, r.overflowedNodeSet = t, r.hasOverflow = t.size > 0, { hasOverflowUpdated: n, overflowedNodeSet: t };
|
|
1010
929
|
}
|
|
1011
|
-
const
|
|
930
|
+
const R = {}, Sn = (e) => {
|
|
1012
931
|
const t = /* @__PURE__ */ new Set();
|
|
1013
932
|
for (const n of e)
|
|
1014
933
|
if (n instanceof Element) {
|
|
1015
934
|
t.add(n);
|
|
1016
|
-
for (const o of
|
|
935
|
+
for (const o of Ze(n)) t.add(o);
|
|
1017
936
|
}
|
|
1018
937
|
return u(`Inspecting:
|
|
1019
938
|
`, t), t;
|
|
1020
|
-
},
|
|
939
|
+
}, cr = (e) => {
|
|
1021
940
|
if (e.size === 0) return;
|
|
1022
941
|
h("addObservers");
|
|
1023
|
-
const t =
|
|
1024
|
-
|
|
1025
|
-
},
|
|
942
|
+
const t = Sn(e);
|
|
943
|
+
R.overflow.attachObservers(t), R.resize.attachObserverToNonStaticElements(t), x();
|
|
944
|
+
}, ar = (e) => {
|
|
1026
945
|
if (e.size === 0) return;
|
|
1027
946
|
h("removeObservers");
|
|
1028
|
-
const t =
|
|
1029
|
-
|
|
947
|
+
const t = Sn(e);
|
|
948
|
+
R.overflow.detachObservers(t), R.resize.detachObservers(t), x();
|
|
1030
949
|
};
|
|
1031
|
-
function
|
|
950
|
+
function lr({
|
|
1032
951
|
addedNodes: e,
|
|
1033
952
|
removedNodes: t
|
|
1034
953
|
}) {
|
|
1035
|
-
h("contentMutated"),
|
|
954
|
+
h("contentMutated"), r.applySelectors(), ln(), wn(), x(), ar(t), cr(e);
|
|
1036
955
|
}
|
|
1037
|
-
function
|
|
1038
|
-
|
|
956
|
+
function ur(e) {
|
|
957
|
+
lr(e), M(Wt, "Mutation Observed");
|
|
1039
958
|
}
|
|
1040
|
-
const ne = "Overflow",
|
|
959
|
+
const ne = "Overflow", dr = be(ne), fr = be(ne, !1), mr = yn(ne), hr = vn(ne), gr = (e) => e instanceof HTMLElement && (!!e.hidden || e.offsetParent === null || e.style.display === He), pr = (e, t) => {
|
|
1041
960
|
const n = t.side, o = {
|
|
1042
961
|
root: t.root,
|
|
1043
962
|
rootMargin: "0px",
|
|
1044
963
|
threshold: 1
|
|
1045
|
-
},
|
|
1046
|
-
S.toggleAttribute(
|
|
964
|
+
}, s = window?.requestAnimationFrame || ue, d = (S = !1) => e(S), c = (S, $) => S === 0 || S > $[n], f = (S, $) => {
|
|
965
|
+
S.toggleAttribute(_t, $);
|
|
1047
966
|
};
|
|
1048
|
-
function
|
|
1049
|
-
for (const
|
|
1050
|
-
const { boundingClientRect:
|
|
1051
|
-
if (!
|
|
1052
|
-
const
|
|
1053
|
-
f(E,
|
|
967
|
+
function y(S) {
|
|
968
|
+
for (const $ of S) {
|
|
969
|
+
const { boundingClientRect: V, rootBounds: W, target: E } = $;
|
|
970
|
+
if (!W) continue;
|
|
971
|
+
const kn = V[n], Mn = c(kn, W) && !(E instanceof HTMLElement && gr(E));
|
|
972
|
+
f(E, Mn);
|
|
1054
973
|
}
|
|
1055
|
-
|
|
974
|
+
s(d);
|
|
1056
975
|
}
|
|
1057
|
-
const m = new IntersectionObserver(
|
|
976
|
+
const m = new IntersectionObserver(y, o), b = /* @__PURE__ */ new WeakSet();
|
|
1058
977
|
function g(S) {
|
|
1059
|
-
const
|
|
1060
|
-
let
|
|
978
|
+
const $ = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Set();
|
|
979
|
+
let W = 0;
|
|
1061
980
|
for (const E of S)
|
|
1062
981
|
if (E instanceof Element) {
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
982
|
+
if (b.has(E)) {
|
|
983
|
+
$.add(E);
|
|
1065
984
|
continue;
|
|
1066
985
|
}
|
|
1067
|
-
m.observe(E),
|
|
986
|
+
m.observe(E), b.add(E), V.add(E), W += 1;
|
|
1068
987
|
}
|
|
1069
|
-
|
|
988
|
+
hr($), mr(V), dr(W), V.clear(), $.clear();
|
|
1070
989
|
}
|
|
1071
990
|
return {
|
|
1072
991
|
attachObservers: g,
|
|
1073
|
-
detachObservers:
|
|
992
|
+
detachObservers: zn(
|
|
1074
993
|
ne,
|
|
1075
994
|
m,
|
|
1076
|
-
|
|
1077
|
-
|
|
995
|
+
b,
|
|
996
|
+
fr
|
|
1078
997
|
),
|
|
1079
998
|
disconnect: () => {
|
|
1080
999
|
m.disconnect(), u("Detached%c OverflowObserver", a);
|
|
1081
1000
|
}
|
|
1082
1001
|
};
|
|
1083
1002
|
};
|
|
1084
|
-
function
|
|
1085
|
-
const { hasOverflow: e } =
|
|
1003
|
+
function yr() {
|
|
1004
|
+
const { hasOverflow: e } = r, { hasOverflowUpdated: t, overflowedNodeSet: n } = wn();
|
|
1086
1005
|
switch (!0) {
|
|
1087
1006
|
case !t:
|
|
1088
1007
|
return;
|
|
@@ -1094,374 +1013,371 @@ function Cs() {
|
|
|
1094
1013
|
default:
|
|
1095
1014
|
u("No overflow detected");
|
|
1096
1015
|
}
|
|
1097
|
-
M(
|
|
1016
|
+
M(Fe, "Overflow updated");
|
|
1098
1017
|
}
|
|
1099
|
-
function
|
|
1018
|
+
function vr(e) {
|
|
1100
1019
|
const t = {
|
|
1101
1020
|
root: document.documentElement,
|
|
1102
|
-
side: i.calculateHeight ?
|
|
1021
|
+
side: i.calculateHeight ? Dt : Ft
|
|
1103
1022
|
};
|
|
1104
|
-
return
|
|
1023
|
+
return R.overflow = pr(yr, t), R.overflow.attachObservers(e), R.overflow;
|
|
1105
1024
|
}
|
|
1106
|
-
const oe = "Resize",
|
|
1107
|
-
let
|
|
1108
|
-
function
|
|
1025
|
+
const oe = "Resize", zr = be(oe), br = be(oe, !1), wr = yn(oe), Sr = vn(oe), ge = /* @__PURE__ */ new WeakSet(), Re = /* @__PURE__ */ new Set(), ke = /* @__PURE__ */ new Set();
|
|
1026
|
+
let q;
|
|
1027
|
+
function Er(e) {
|
|
1109
1028
|
let t = 0;
|
|
1110
1029
|
for (const n of e) {
|
|
1111
1030
|
if (!(n instanceof Element)) continue;
|
|
1112
1031
|
const o = getComputedStyle(n)?.position;
|
|
1113
1032
|
if (!(o === "" || o === "static")) {
|
|
1114
|
-
if (
|
|
1115
|
-
|
|
1033
|
+
if (ge.has(n)) {
|
|
1034
|
+
Re.add(n);
|
|
1116
1035
|
continue;
|
|
1117
1036
|
}
|
|
1118
|
-
|
|
1037
|
+
q.observe(n), ge.add(n), ke.add(n), t += 1;
|
|
1119
1038
|
}
|
|
1120
1039
|
}
|
|
1121
|
-
|
|
1040
|
+
Sr(Re), wr(ke), zr(t), ke.clear(), Re.clear();
|
|
1122
1041
|
}
|
|
1123
|
-
const
|
|
1124
|
-
attachObserverToNonStaticElements:
|
|
1125
|
-
detachObservers:
|
|
1042
|
+
const Or = (e) => (q = new ResizeObserver(e), q.observe(document.body), ge.add(document.body), u("Attached%c ResizeObserver%c to body", a, v), {
|
|
1043
|
+
attachObserverToNonStaticElements: Er,
|
|
1044
|
+
detachObservers: zn(
|
|
1126
1045
|
oe,
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1046
|
+
q,
|
|
1047
|
+
ge,
|
|
1048
|
+
br
|
|
1130
1049
|
),
|
|
1131
1050
|
disconnect: () => {
|
|
1132
|
-
|
|
1051
|
+
q.disconnect(), u("Detached%c ResizeObserver", a);
|
|
1133
1052
|
}
|
|
1134
1053
|
});
|
|
1135
|
-
function
|
|
1054
|
+
function Rr(e) {
|
|
1136
1055
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
1137
1056
|
const t = e[0].target;
|
|
1138
|
-
M(
|
|
1057
|
+
M(Vt, `Element resized <${Kn(t)}>`);
|
|
1139
1058
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return
|
|
1059
|
+
function kr(e) {
|
|
1060
|
+
return R.resize = Or(Rr), R.resize.attachObserverToNonStaticElements(e), R.resize;
|
|
1142
1061
|
}
|
|
1143
|
-
let
|
|
1144
|
-
function
|
|
1062
|
+
let $t;
|
|
1063
|
+
function Mr() {
|
|
1145
1064
|
const e = document.title;
|
|
1146
|
-
e !==
|
|
1065
|
+
e !== $t && ($t = e, l(`Title: %c${e}`, a), e && z(0, 0, Fn, e));
|
|
1147
1066
|
}
|
|
1148
|
-
function
|
|
1149
|
-
l(`Visible: %c${e}`, a),
|
|
1067
|
+
function $r(e) {
|
|
1068
|
+
l(`Visible: %c${e}`, a), r.isHidden = !e, M(Ut, "Visibility changed");
|
|
1150
1069
|
}
|
|
1151
|
-
function
|
|
1152
|
-
|
|
1070
|
+
function Tr(e) {
|
|
1071
|
+
Ue.push(...e.map((t) => t.disconnect));
|
|
1153
1072
|
}
|
|
1154
|
-
function
|
|
1073
|
+
function Ar() {
|
|
1155
1074
|
h("attachObservers");
|
|
1156
|
-
const e =
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1075
|
+
const e = Ze(document.documentElement), t = [
|
|
1076
|
+
nr(ur),
|
|
1077
|
+
vr(e),
|
|
1078
|
+
ms(),
|
|
1079
|
+
kr(e),
|
|
1080
|
+
sr(Mr),
|
|
1081
|
+
rr($r)
|
|
1163
1082
|
];
|
|
1164
|
-
|
|
1083
|
+
Tr(t);
|
|
1165
1084
|
}
|
|
1166
|
-
const
|
|
1085
|
+
const Tt = (e, t, n) => {
|
|
1167
1086
|
if (n !== "") {
|
|
1168
1087
|
l(`${e}: %c${n}`, a);
|
|
1169
1088
|
for (const o of document.querySelectorAll(n))
|
|
1170
1089
|
l(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
|
|
1171
1090
|
}
|
|
1172
1091
|
};
|
|
1173
|
-
function
|
|
1092
|
+
function Ir({
|
|
1174
1093
|
sizeSelector: e,
|
|
1175
1094
|
ignoreSelector: t
|
|
1176
1095
|
}) {
|
|
1177
1096
|
return () => {
|
|
1178
|
-
|
|
1097
|
+
Tt("sizeSelector", Pe, e), Tt("ignoreSelector", X, t);
|
|
1179
1098
|
};
|
|
1180
1099
|
}
|
|
1181
|
-
function
|
|
1100
|
+
function Nr() {
|
|
1182
1101
|
const e = document.createElement("div");
|
|
1183
1102
|
e.style.clear = "both", e.style.display = "block", e.style.height = "0", document.body.append(e);
|
|
1184
1103
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return t.includes("-") && (
|
|
1104
|
+
function Lr(e, t) {
|
|
1105
|
+
return t.includes("-") && (H(`Negative CSS value ignored for ${e}`), t = ""), t;
|
|
1187
1106
|
}
|
|
1188
|
-
function
|
|
1189
|
-
t === void 0 || t === "" || t ===
|
|
1107
|
+
function Ce(e, t) {
|
|
1108
|
+
t === void 0 || t === "" || t === Gn || (document.body.style.setProperty(e, t), u(`Set body ${e}: %c${t}`, a));
|
|
1190
1109
|
}
|
|
1191
|
-
function
|
|
1110
|
+
function Cr({
|
|
1192
1111
|
bodyMarginStr: e,
|
|
1193
1112
|
bodyMargin: t
|
|
1194
1113
|
}) {
|
|
1195
|
-
e === void 0 && (e = `${t}px`),
|
|
1114
|
+
e === void 0 && (e = `${t}px`), Ce("margin", Lr("margin", e));
|
|
1196
1115
|
}
|
|
1197
|
-
const
|
|
1116
|
+
const jr = () => ({
|
|
1198
1117
|
x: document.documentElement.scrollLeft,
|
|
1199
1118
|
y: document.documentElement.scrollTop
|
|
1200
1119
|
});
|
|
1201
|
-
function
|
|
1202
|
-
const t = e.getBoundingClientRect(), n =
|
|
1120
|
+
function Pr(e) {
|
|
1121
|
+
const t = e.getBoundingClientRect(), n = jr();
|
|
1203
1122
|
return {
|
|
1204
1123
|
x: Math.round(t.left + n.x),
|
|
1205
1124
|
y: Math.round(t.top + n.y)
|
|
1206
1125
|
};
|
|
1207
1126
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const n =
|
|
1127
|
+
function _r(e, t) {
|
|
1128
|
+
const n = Pr(t);
|
|
1210
1129
|
l(
|
|
1211
1130
|
`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,
|
|
1212
1131
|
a,
|
|
1213
|
-
|
|
1132
|
+
v,
|
|
1214
1133
|
a,
|
|
1215
|
-
|
|
1134
|
+
v,
|
|
1216
1135
|
a
|
|
1217
|
-
),
|
|
1136
|
+
), z(n.y, n.x, Pt);
|
|
1218
1137
|
}
|
|
1219
|
-
function
|
|
1138
|
+
function et(e) {
|
|
1220
1139
|
const t = e.split("#")[1] || e, n = decodeURIComponent(t), o = document.getElementById(n) || document.getElementsByName(n)[0];
|
|
1221
1140
|
if (o !== void 0) {
|
|
1222
|
-
|
|
1141
|
+
_r(t, o);
|
|
1223
1142
|
return;
|
|
1224
1143
|
}
|
|
1225
|
-
l(`In page link (#${t}) not found in iframe, so sending to parent`),
|
|
1144
|
+
l(`In page link (#${t}) not found in iframe, so sending to parent`), z(0, 0, Cn, `#${t}`);
|
|
1226
1145
|
}
|
|
1227
|
-
function
|
|
1146
|
+
function En() {
|
|
1228
1147
|
const { hash: e, href: t } = window.location;
|
|
1229
|
-
e !== "" && e !== "#" &&
|
|
1148
|
+
e !== "" && e !== "#" && et(t);
|
|
1230
1149
|
}
|
|
1231
|
-
function
|
|
1150
|
+
function xr() {
|
|
1232
1151
|
for (const e of document.querySelectorAll('a[href^="#"]'))
|
|
1233
|
-
e.getAttribute("href") !== "#" &&
|
|
1234
|
-
t.preventDefault(),
|
|
1152
|
+
e.getAttribute("href") !== "#" && C(e, "click", (t) => {
|
|
1153
|
+
t.preventDefault(), et(e.getAttribute("href"));
|
|
1235
1154
|
});
|
|
1236
1155
|
}
|
|
1237
|
-
function
|
|
1238
|
-
|
|
1156
|
+
function Br() {
|
|
1157
|
+
C(window, "hashchange", En);
|
|
1239
1158
|
}
|
|
1240
|
-
function
|
|
1241
|
-
setTimeout(
|
|
1159
|
+
function Dr() {
|
|
1160
|
+
setTimeout(En, qt);
|
|
1242
1161
|
}
|
|
1243
|
-
function
|
|
1244
|
-
l("Setting up location.hash handlers"),
|
|
1245
|
-
findTarget:
|
|
1162
|
+
function Fr() {
|
|
1163
|
+
l("Setting up location.hash handlers"), xr(), Br(), Dr(), r.inPageLinks = {
|
|
1164
|
+
findTarget: et
|
|
1246
1165
|
};
|
|
1247
1166
|
}
|
|
1248
|
-
function
|
|
1167
|
+
function Hr(e) {
|
|
1249
1168
|
const { mode: t } = i;
|
|
1250
|
-
e ?
|
|
1169
|
+
e ? Ge(t) ? w(T(5)) : Fr() : l("In page linking not enabled");
|
|
1251
1170
|
}
|
|
1252
|
-
const
|
|
1253
|
-
function
|
|
1254
|
-
const e = (t) => t.style.setProperty(
|
|
1171
|
+
const Vr = "important";
|
|
1172
|
+
function Wr() {
|
|
1173
|
+
const e = (t) => t.style.setProperty(ve, Q, Vr);
|
|
1255
1174
|
e(document.documentElement), e(document.body), l("Set HTML & body height: %cauto !important", a);
|
|
1256
1175
|
}
|
|
1257
|
-
const
|
|
1176
|
+
const tt = (e) => (t, n) => {
|
|
1258
1177
|
if (n in t) {
|
|
1259
1178
|
if (typeof t[n] === e) return t[n];
|
|
1260
1179
|
throw new TypeError(`${n} is not a ${e}.`);
|
|
1261
1180
|
}
|
|
1262
|
-
},
|
|
1263
|
-
function
|
|
1181
|
+
}, Me = tt(xe), At = tt(_), re = tt(ee), Ur = (e) => e !== null && typeof e === Vn && !Array.isArray(e);
|
|
1182
|
+
function Gr(e) {
|
|
1264
1183
|
const { calculateHeight: t, calculateWidth: n } = i;
|
|
1265
|
-
let o,
|
|
1266
|
-
return typeof e?.
|
|
1184
|
+
let o, s;
|
|
1185
|
+
return typeof e?.offsetSize === _ && (t && (o = At(e, rt)), n && (s = At(e, rt))), { offsetHeight: o, offsetWidth: s };
|
|
1267
1186
|
}
|
|
1268
|
-
function
|
|
1187
|
+
function qr(e) {
|
|
1269
1188
|
l("Reading data from page:", Object.keys(e));
|
|
1270
|
-
const { offsetHeight: t, offsetWidth: n } =
|
|
1189
|
+
const { offsetHeight: t, offsetWidth: n } = Gr(e);
|
|
1271
1190
|
return {
|
|
1272
1191
|
offsetHeight: t,
|
|
1273
1192
|
offsetWidth: n,
|
|
1274
|
-
ignoreSelector:
|
|
1275
|
-
[
|
|
1276
|
-
sizeSelector:
|
|
1277
|
-
targetOrigin:
|
|
1278
|
-
onBeforeResize:
|
|
1279
|
-
onMessage:
|
|
1280
|
-
onReady:
|
|
1193
|
+
ignoreSelector: re(e, "ignoreSelector"),
|
|
1194
|
+
[vt(3)]: re(e, vt(0)),
|
|
1195
|
+
sizeSelector: re(e, "sizeSelector"),
|
|
1196
|
+
targetOrigin: re(e, "targetOrigin"),
|
|
1197
|
+
onBeforeResize: Me(e, "onBeforeResize"),
|
|
1198
|
+
onMessage: Me(e, "onMessage"),
|
|
1199
|
+
onReady: Me(e, "onReady")
|
|
1281
1200
|
};
|
|
1282
1201
|
}
|
|
1283
|
-
function
|
|
1202
|
+
function Zr() {
|
|
1284
1203
|
const { mode: e } = i;
|
|
1285
|
-
if (
|
|
1204
|
+
if (Ge(e)) return {};
|
|
1286
1205
|
const t = window.iframeResizer || window.iFrameResizer;
|
|
1287
|
-
return
|
|
1206
|
+
return Ur(t) ? qr(t) : {};
|
|
1288
1207
|
}
|
|
1289
|
-
const
|
|
1208
|
+
const Yr = (e) => e === "true", On = (e) => (t) => t === void 0 ? void 0 : e(t), j = On(Yr), G = On(Number), Qr = (e) => ({
|
|
1290
1209
|
parentId: e[0],
|
|
1291
|
-
bodyMargin:
|
|
1292
|
-
calculateWidth:
|
|
1293
|
-
logging:
|
|
1210
|
+
bodyMargin: G(e[1]),
|
|
1211
|
+
calculateWidth: j(e[2]),
|
|
1212
|
+
logging: j(e[3]),
|
|
1294
1213
|
// data[4] no longer used (was intervalTimer)
|
|
1295
|
-
autoResize:
|
|
1214
|
+
autoResize: j(e[6]),
|
|
1296
1215
|
bodyMarginStr: e[7],
|
|
1297
|
-
|
|
1216
|
+
// data[8] no longer used (was heightCalcMode)
|
|
1298
1217
|
bodyBackground: e[9],
|
|
1299
1218
|
bodyPadding: e[10],
|
|
1300
|
-
tolerance:
|
|
1301
|
-
inPageLinks:
|
|
1219
|
+
tolerance: G(e[11]),
|
|
1220
|
+
inPageLinks: j(e[12]),
|
|
1302
1221
|
// data[13] no longer used (was resizeFrom)
|
|
1303
|
-
|
|
1304
|
-
mouseEvents:
|
|
1305
|
-
offsetHeight:
|
|
1306
|
-
offsetWidth:
|
|
1307
|
-
calculateHeight:
|
|
1222
|
+
// data[14] no longer used (was widthCalcMode)
|
|
1223
|
+
mouseEvents: j(e[15]),
|
|
1224
|
+
offsetHeight: G(e[16]),
|
|
1225
|
+
offsetWidth: G(e[17]),
|
|
1226
|
+
calculateHeight: j(e[18]),
|
|
1308
1227
|
key: e[19],
|
|
1309
1228
|
version: e[20],
|
|
1310
|
-
mode:
|
|
1229
|
+
mode: G(e[21]),
|
|
1311
1230
|
// sizeSelector: data[22] // Now only available via page settings
|
|
1312
|
-
logExpand:
|
|
1231
|
+
logExpand: j(e[23])
|
|
1313
1232
|
});
|
|
1314
|
-
function
|
|
1233
|
+
function Jr(e) {
|
|
1315
1234
|
const { mode: t } = i;
|
|
1316
1235
|
e.forEach((n) => {
|
|
1317
1236
|
try {
|
|
1318
1237
|
n();
|
|
1319
1238
|
} catch (o) {
|
|
1320
1239
|
if (t < 0) throw o;
|
|
1321
|
-
|
|
1240
|
+
w(
|
|
1322
1241
|
`<rb>Error in setup function</>
|
|
1323
1242
|
<i>iframe-resizer</> detected an error during setup.
|
|
1324
1243
|
|
|
1325
1244
|
Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`
|
|
1326
|
-
),
|
|
1245
|
+
), Xt(o);
|
|
1327
1246
|
}
|
|
1328
1247
|
});
|
|
1329
1248
|
}
|
|
1330
|
-
function
|
|
1249
|
+
function It(e) {
|
|
1331
1250
|
for (const [t, n] of Object.entries(e))
|
|
1332
1251
|
n !== void 0 && (i[t] = n);
|
|
1333
1252
|
}
|
|
1334
|
-
function
|
|
1253
|
+
function Kr({
|
|
1335
1254
|
logExpand: e,
|
|
1336
1255
|
logging: t,
|
|
1337
1256
|
parentId: n = ""
|
|
1338
1257
|
}) {
|
|
1339
|
-
|
|
1258
|
+
co({ id: n, enabled: t, expand: e }), h("initReceived"), l(`Initialising iframe v${K} ${window.location.href}`);
|
|
1340
1259
|
}
|
|
1341
|
-
function
|
|
1342
|
-
h("ready"),
|
|
1260
|
+
function Xr(e) {
|
|
1261
|
+
h("ready"), an(Yt(e)), l("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
|
|
1343
1262
|
}
|
|
1344
|
-
function
|
|
1263
|
+
function ei({
|
|
1345
1264
|
bodyBackground: e,
|
|
1346
1265
|
bodyPadding: t,
|
|
1347
1266
|
inPageLinks: n,
|
|
1348
1267
|
onReady: o
|
|
1349
1268
|
}) {
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
() => $r(i),
|
|
1369
|
-
kr,
|
|
1370
|
-
() => ss(),
|
|
1269
|
+
const s = Ro(i), d = [
|
|
1270
|
+
$o,
|
|
1271
|
+
ko,
|
|
1272
|
+
Ho,
|
|
1273
|
+
ln,
|
|
1274
|
+
Wo,
|
|
1275
|
+
s ? ue : Oo,
|
|
1276
|
+
() => Cr(i),
|
|
1277
|
+
() => Ce("background", e),
|
|
1278
|
+
() => Ce("padding", t),
|
|
1279
|
+
s ? ue : Wr,
|
|
1280
|
+
Nr,
|
|
1281
|
+
r.applySelectors,
|
|
1282
|
+
() => Hr(n),
|
|
1283
|
+
Os,
|
|
1284
|
+
() => Xo(i),
|
|
1285
|
+
ns,
|
|
1286
|
+
() => Hs(),
|
|
1371
1287
|
() => M(
|
|
1372
|
-
|
|
1288
|
+
ye,
|
|
1373
1289
|
"Init message from host page",
|
|
1374
1290
|
void 0,
|
|
1375
1291
|
void 0,
|
|
1376
|
-
`${
|
|
1292
|
+
`${K}:${i.mode}`
|
|
1377
1293
|
),
|
|
1378
|
-
|
|
1379
|
-
|
|
1294
|
+
Ar,
|
|
1295
|
+
x
|
|
1380
1296
|
];
|
|
1381
|
-
|
|
1297
|
+
qo(i), Bo(i), Jr(d), Xr(o);
|
|
1382
1298
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1299
|
+
function ti(e) {
|
|
1300
|
+
r.firstRun && (It(Qr(e)), Kr(i), It(Zr()), r.applySelectors = Ir(i), ei(i));
|
|
1385
1301
|
}
|
|
1386
|
-
function
|
|
1302
|
+
function ni(e) {
|
|
1387
1303
|
if (document.readyState === "loading") {
|
|
1388
1304
|
l("Page not ready, ignoring init message");
|
|
1389
1305
|
return;
|
|
1390
1306
|
}
|
|
1391
|
-
const t = e.data.slice(
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
},
|
|
1395
|
-
}
|
|
1396
|
-
const { freeze:
|
|
1397
|
-
function
|
|
1398
|
-
const t =
|
|
1399
|
-
l("onMessage called from parent:%c", a,
|
|
1400
|
-
}
|
|
1401
|
-
function
|
|
1402
|
-
const { onPageInfo: t } =
|
|
1403
|
-
l("PageInfo received from parent:",
|
|
1404
|
-
}
|
|
1405
|
-
function
|
|
1406
|
-
const { onParentInfo: t } =
|
|
1407
|
-
l("ParentInfo received from parent:", n), t ?
|
|
1408
|
-
}
|
|
1409
|
-
function
|
|
1410
|
-
if (
|
|
1307
|
+
const t = e.data.slice(Gt).split(pe);
|
|
1308
|
+
r.target = e.source, r.origin = e.origin, ti(t), r.firstRun = !1, setTimeout(() => {
|
|
1309
|
+
r.initLock = !1;
|
|
1310
|
+
}, qt);
|
|
1311
|
+
}
|
|
1312
|
+
const { freeze: oi } = Object, { parse: nt } = JSON, ot = (e) => oi(nt(e)), Rn = (e) => z(0, 0, `${e}Stop`), we = (e) => e.data.slice(e.data.indexOf(pe) + 1), si = (e) => ho(e) ? ye : e.data.split("]")[1].split(pe)[0];
|
|
1313
|
+
function ri(e) {
|
|
1314
|
+
const t = we(e);
|
|
1315
|
+
l("onMessage called from parent:%c", a, ot(t)), ze(i.onMessage, nt(t));
|
|
1316
|
+
}
|
|
1317
|
+
function ii(e) {
|
|
1318
|
+
const { onPageInfo: t } = r, n = we(e);
|
|
1319
|
+
l("PageInfo received from parent:", ot(n)), t ? ze(t, nt(n)) : Rn(_n);
|
|
1320
|
+
}
|
|
1321
|
+
function ci(e) {
|
|
1322
|
+
const { onParentInfo: t } = r, n = ot(we(e));
|
|
1323
|
+
l("ParentInfo received from parent:", n), t ? ze(t, n) : Rn(jt);
|
|
1324
|
+
}
|
|
1325
|
+
function ai() {
|
|
1326
|
+
if (r.initLock) {
|
|
1411
1327
|
l("Page reset ignored by init");
|
|
1412
1328
|
return;
|
|
1413
1329
|
}
|
|
1414
|
-
l("Page size reset by host page"),
|
|
1330
|
+
l("Page size reset by host page"), pn("resetPage");
|
|
1415
1331
|
}
|
|
1416
|
-
function
|
|
1417
|
-
l("Resize requested by host page"), M(
|
|
1332
|
+
function li() {
|
|
1333
|
+
l("Resize requested by host page"), M(De, "Parent window requested size check");
|
|
1418
1334
|
}
|
|
1419
|
-
const
|
|
1420
|
-
init:
|
|
1421
|
-
reset:
|
|
1422
|
-
resize:
|
|
1423
|
-
moveToAnchor:
|
|
1424
|
-
inPageLink:
|
|
1335
|
+
const Nt = (e) => r.inPageLinks.findTarget(we(e)), Lt = {
|
|
1336
|
+
init: ni,
|
|
1337
|
+
reset: ai,
|
|
1338
|
+
resize: li,
|
|
1339
|
+
moveToAnchor: Nt,
|
|
1340
|
+
inPageLink: Nt,
|
|
1425
1341
|
// Backward compatibility
|
|
1426
|
-
pageInfo:
|
|
1427
|
-
parentInfo:
|
|
1428
|
-
message:
|
|
1342
|
+
pageInfo: ii,
|
|
1343
|
+
parentInfo: ci,
|
|
1344
|
+
message: ri
|
|
1429
1345
|
};
|
|
1430
|
-
function
|
|
1431
|
-
const { firstRun: t } =
|
|
1346
|
+
function ui(e) {
|
|
1347
|
+
const { firstRun: t } = r, n = si(e);
|
|
1432
1348
|
switch (h(n), !0) {
|
|
1433
1349
|
case n in Lt:
|
|
1434
1350
|
Lt[n](e);
|
|
1435
1351
|
break;
|
|
1436
|
-
case (t &&
|
|
1437
|
-
|
|
1352
|
+
case (t && mo()):
|
|
1353
|
+
H(
|
|
1438
1354
|
`Ignored message of type "${n}". Received before initialization.`
|
|
1439
1355
|
);
|
|
1440
1356
|
break;
|
|
1441
1357
|
default:
|
|
1442
|
-
|
|
1358
|
+
H(
|
|
1443
1359
|
`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`
|
|
1444
1360
|
);
|
|
1445
1361
|
}
|
|
1446
1362
|
}
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1363
|
+
const ie = We((e) => {
|
|
1364
|
+
fo(e) && ui(e);
|
|
1449
1365
|
});
|
|
1450
|
-
function
|
|
1366
|
+
function di() {
|
|
1451
1367
|
if ("iframeChildListener" in window) {
|
|
1452
|
-
|
|
1368
|
+
H("Already setup");
|
|
1453
1369
|
return;
|
|
1454
1370
|
}
|
|
1455
|
-
window.iframeChildListener = ((t) =>
|
|
1456
|
-
() =>
|
|
1457
|
-
)
|
|
1371
|
+
window.iframeChildListener = ((t) => {
|
|
1372
|
+
setTimeout(() => ie({ data: t, sameOrigin: !0 }));
|
|
1373
|
+
}), h("listen"), C(window, $e, ie), C(document, Bt, ft), ft();
|
|
1458
1374
|
function e(t) {
|
|
1459
|
-
return
|
|
1375
|
+
return ie(t), r.win;
|
|
1460
1376
|
}
|
|
1461
1377
|
try {
|
|
1462
|
-
top?.document?.getElementById("banner") && (
|
|
1378
|
+
top?.document?.getElementById("banner") && (r.win = {}, window.mockMsgListener = e, nn(window, $e, ie), typeof window.define == "function" && window.define([], () => e));
|
|
1463
1379
|
} catch {
|
|
1464
1380
|
}
|
|
1465
1381
|
}
|
|
1466
|
-
typeof window !==
|
|
1382
|
+
typeof window !== Wn && di();
|
|
1467
1383
|
//# sourceMappingURL=index.esm.js.map
|