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