@iframe-resizer/core 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 +13 -19
- package/index.cjs.js.map +1 -1
- package/index.d.ts +165 -3
- package/index.esm.js +392 -410
- package/index.esm.js.map +1 -1
- package/index.umd.js +11 -17
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/types.d.ts +0 -130
package/index.esm.js
CHANGED
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
const _ = "6.0.0-beta.
|
|
3
|
-
`,
|
|
1
|
+
import et, { NORMAL as tt, HIGHLIGHT as c, FOREGROUND as z } from "auto-console-group";
|
|
2
|
+
const _ = "6.0.0-beta.3", he = "iframeResizer", A = ":", nt = "[iFrameResizerChild]Ready", ge = "autoResize", ot = "beforeUnload", it = "close", st = "inPageLink", $ = "init", de = "iframeReady", rt = "lazy", G = "load", L = "message", lt = "mouseenter", at = "mouseleave", ye = "onload", me = "pageInfo", be = "parentInfo", ct = "pageInfoStop", ut = "parentInfoStop", V = "reset", ve = "resize", ft = "scrollBy", pt = "scrollTo", ht = "scrollToOffset", gt = "title", Q = 1, dt = "height", yt = "width", mt = "offset", bt = "offsetSize", ee = "scroll", C = `
|
|
3
|
+
`, vt = "hidden", zt = "child", U = "parent", Y = "string", wt = "number", ze = "object", Et = "function", q = "auto", Ot = "font-weight: bold;", we = "none", Ee = "both", W = "vertical", Oe = "horizontal", kt = "omit", Tt = L.length, B = "[iFrameSizer]", Z = B.length, jt = Object.freeze({
|
|
4
4
|
max: 1,
|
|
5
5
|
scroll: 1,
|
|
6
6
|
bodyScroll: 1,
|
|
7
7
|
documentElementScroll: 1
|
|
8
|
-
}),
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
}),
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
}),
|
|
8
|
+
}), te = Object.freeze({
|
|
9
|
+
[ye]: 1,
|
|
10
|
+
[$]: 1,
|
|
11
|
+
[de]: 1
|
|
12
|
+
}), I = "expanded", M = "collapsed", ke = 0, Te = 1, je = 2, It = Object.freeze({
|
|
13
|
+
[I]: 1,
|
|
14
|
+
[M]: 1
|
|
15
|
+
}), Mt = "Use of the old name will be removed in a future version of <i>iframe-resizer</>.", Ie = (e) => typeof e === ze && e !== null, X = (e) => typeof e === Y;
|
|
16
16
|
function St(e) {
|
|
17
|
-
if (!
|
|
17
|
+
if (!Ie(e)) return !1;
|
|
18
18
|
try {
|
|
19
19
|
return e.tagName === "IFRAME" || e instanceof HTMLIFrameElement;
|
|
20
20
|
} catch {
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const $t = (e, ...t) => setTimeout(() => e(...t), 0), Rt = (e) => {
|
|
25
25
|
let t = !1;
|
|
26
26
|
return function(...n) {
|
|
27
27
|
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
28
28
|
};
|
|
29
|
-
},
|
|
29
|
+
}, At = (e, t) => Object.prototype.hasOwnProperty.call(e, t), P = (e, t) => Object.hasOwn ? Object.hasOwn(e, t) : At(e, t), Lt = (e) => e, Pt = (e) => e.charAt(0).toUpperCase() + e.slice(1), Nt = (e) => (
|
|
30
30
|
// eslint-disable-next-line no-underscore-dangle
|
|
31
31
|
e?.__esModule ? e.default : e
|
|
32
|
-
),
|
|
32
|
+
), Ct = (e, t, n) => {
|
|
33
33
|
if (typeof e !== t)
|
|
34
34
|
throw new TypeError(`${n} is not a ${Pt(t)}`);
|
|
35
|
-
},
|
|
36
|
-
r,
|
|
37
|
-
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
38
|
-
|
|
39
|
-
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
40
|
-
), je = {
|
|
35
|
+
}, Me = {
|
|
41
36
|
br: `
|
|
42
37
|
`,
|
|
43
38
|
rb: "\x1B[31;1m",
|
|
@@ -52,56 +47,53 @@ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${a}Use of the old $
|
|
|
52
47
|
// underline
|
|
53
48
|
"/": "\x1B[m"
|
|
54
49
|
// reset
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
), i = {},
|
|
58
|
-
let
|
|
59
|
-
const
|
|
50
|
+
}, xt = Object.keys(Me), _t = new RegExp(`<(${xt.join("|")})>`, "gi"), Bt = (e, t) => Me[t] ?? "", Ft = (e) => e.replace(_t, Bt), Ht = (e) => e.replaceAll("<br>", C).replaceAll(/<\/?[^>]+>/gi, ""), Se = (e) => (t) => e(
|
|
51
|
+
X(t) ? window.chrome ? Ft(t) : Ht(t) : t
|
|
52
|
+
), i = {}, $e = Nt(et);
|
|
53
|
+
let K = !0;
|
|
54
|
+
const Wt = $e({
|
|
60
55
|
expand: !1,
|
|
61
|
-
label:
|
|
62
|
-
}),
|
|
56
|
+
label: U
|
|
57
|
+
}), Dt = (e) => window.top === window.self ? `parent(${e})` : `nested parent(${e})`, Gt = (e) => i[e] ? i[e].log : K;
|
|
63
58
|
function Vt({
|
|
64
59
|
enabled: e,
|
|
65
60
|
expand: t,
|
|
66
61
|
iframeId: n
|
|
67
62
|
}) {
|
|
68
|
-
const o =
|
|
63
|
+
const o = $e({
|
|
69
64
|
expand: t,
|
|
70
|
-
label:
|
|
65
|
+
label: Dt(n)
|
|
71
66
|
});
|
|
72
|
-
|
|
67
|
+
K = e, i[n] || (i[n] = {
|
|
73
68
|
console: o
|
|
74
69
|
});
|
|
75
70
|
}
|
|
76
|
-
const
|
|
77
|
-
function
|
|
71
|
+
const T = (e) => (t, ...n) => i[t] ? i[t].console[e](...n) : Wt[e](...n), Re = (e) => (t, ...n) => Gt(t) === !0 ? T(e)(t, ...n) : null, u = Re("log"), y = u, Ut = Re("debug"), w = T("warn"), qt = T("error"), b = T("event"), Zt = T("purge"), Jt = T("endAutoGroup"), Ae = T("errorBoundary");
|
|
72
|
+
function Yt(e, t) {
|
|
78
73
|
queueMicrotask(
|
|
79
74
|
() => (
|
|
80
75
|
// eslint-disable-next-line no-console
|
|
81
76
|
console.info(
|
|
82
77
|
`%ciframe-resizer ${e}`,
|
|
83
|
-
|
|
78
|
+
K || t < 1 ? Ot : tt
|
|
84
79
|
)
|
|
85
80
|
)
|
|
86
81
|
);
|
|
87
82
|
}
|
|
88
|
-
const
|
|
89
|
-
const n =
|
|
83
|
+
const Xt = (e) => (...t) => [`${he}(${e})`, ...t].join(" "), Kt = Se(Lt), m = (e, ...t) => i[e] ? i[e].console.warn(...t.map(Kt)) : queueMicrotask(() => {
|
|
84
|
+
const n = Se(Xt(e));
|
|
90
85
|
console?.warn(...t.map(n));
|
|
91
|
-
}),
|
|
92
|
-
typeof i[e.id].onInit === we && (tn("init()", "onReady()", "", e.id), i[e.id].onInit(e));
|
|
93
|
-
}, B = Object.freeze({
|
|
86
|
+
}), F = Object.freeze({
|
|
94
87
|
autoResize: !0,
|
|
95
88
|
bodyBackground: null,
|
|
96
89
|
bodyMargin: null,
|
|
97
90
|
bodyPadding: null,
|
|
98
91
|
checkOrigin: !0,
|
|
99
|
-
direction:
|
|
92
|
+
direction: W,
|
|
100
93
|
firstRun: !0,
|
|
101
94
|
inPageLinks: !1,
|
|
102
95
|
heightCalculationMethod: q,
|
|
103
|
-
id: "
|
|
104
|
-
// TODO: v6 change to 'iframeResizer'
|
|
96
|
+
id: "iframeResizer",
|
|
105
97
|
log: !1,
|
|
106
98
|
logExpand: !1,
|
|
107
99
|
license: void 0,
|
|
@@ -121,29 +113,29 @@ const Kt = (e) => (...t) => [`${de}(${e})`, ...t].join(" "), Qt = Re(At), y = (e
|
|
|
121
113
|
onBeforeClose: () => !0,
|
|
122
114
|
onAfterClose() {
|
|
123
115
|
},
|
|
124
|
-
onInit: !1,
|
|
125
116
|
onMessage: null,
|
|
126
117
|
onMouseEnter() {
|
|
127
118
|
},
|
|
128
119
|
onMouseLeave() {
|
|
129
120
|
},
|
|
130
|
-
onReady
|
|
121
|
+
onReady() {
|
|
122
|
+
},
|
|
131
123
|
onResized() {
|
|
132
124
|
},
|
|
133
125
|
onScroll: () => !0
|
|
134
126
|
});
|
|
135
|
-
let
|
|
136
|
-
function
|
|
137
|
-
const t = e?.id ||
|
|
138
|
-
return document.getElementById(t) === null ? t : `${t}${
|
|
127
|
+
let ne = 0;
|
|
128
|
+
function Qt(e) {
|
|
129
|
+
const t = e?.id || F.id + ne++;
|
|
130
|
+
return document.getElementById(t) === null ? t : `${t}${ne++}`;
|
|
139
131
|
}
|
|
140
|
-
function
|
|
132
|
+
function en(e, t) {
|
|
141
133
|
let { id: n } = e;
|
|
142
|
-
if (n && !
|
|
143
|
-
throw new TypeError("Invalid id for
|
|
144
|
-
return (!n || n === "") && (n =
|
|
134
|
+
if (n && !X(n))
|
|
135
|
+
throw new TypeError("Invalid id for iframe. Expected String");
|
|
136
|
+
return (!n || n === "") && (n = Qt(t), e.id = n, b(n, "assignId"), u(n, `Added missing iframe ID: ${n} (${e.src})`)), n;
|
|
145
137
|
}
|
|
146
|
-
function
|
|
138
|
+
function tn(e) {
|
|
147
139
|
const { search: t } = window.location;
|
|
148
140
|
if (t.includes("ifrlog"))
|
|
149
141
|
switch (new URLSearchParams(t).get("ifrlog")) {
|
|
@@ -151,63 +143,63 @@ function rn(e) {
|
|
|
151
143
|
e.log = !1;
|
|
152
144
|
break;
|
|
153
145
|
}
|
|
154
|
-
case
|
|
155
|
-
case String(
|
|
156
|
-
e.log =
|
|
146
|
+
case I:
|
|
147
|
+
case String(je): {
|
|
148
|
+
e.log = I;
|
|
157
149
|
break;
|
|
158
150
|
}
|
|
159
|
-
case
|
|
160
|
-
case String(
|
|
161
|
-
e.log =
|
|
151
|
+
case M:
|
|
152
|
+
case String(Te): {
|
|
153
|
+
e.log = M;
|
|
162
154
|
break;
|
|
163
155
|
}
|
|
164
156
|
default:
|
|
165
|
-
e.log =
|
|
157
|
+
e.log = M;
|
|
166
158
|
}
|
|
167
159
|
}
|
|
168
|
-
const
|
|
169
|
-
function
|
|
160
|
+
const N = (e, t, n, o) => e.addEventListener(t, n, o || !1), oe = (e, t, n) => e.removeEventListener(t, n, !1), nn = (e) => e.split(A).filter((t, n) => n !== 19).join(A);
|
|
161
|
+
function on(e, t, n) {
|
|
170
162
|
function o(f) {
|
|
171
|
-
const p = e in
|
|
172
|
-
|
|
163
|
+
const p = e in te ? nn(t) : t;
|
|
164
|
+
y(n, f, c, z, c), y(n, `Message data: %c${p}`, c);
|
|
173
165
|
}
|
|
174
|
-
const { iframe: s, postMessageTarget: a, sameOrigin: r, targetOrigin:
|
|
166
|
+
const { iframe: s, postMessageTarget: a, sameOrigin: r, targetOrigin: l } = i[n];
|
|
175
167
|
if (r)
|
|
176
168
|
try {
|
|
177
|
-
s.contentWindow.iframeChildListener(
|
|
169
|
+
s.contentWindow.iframeChildListener(B + t), o(`Sending message to iframe %c${n}%c via same origin%c`);
|
|
178
170
|
return;
|
|
179
171
|
} catch {
|
|
180
|
-
e in
|
|
172
|
+
e in te ? (i[n].sameOrigin = !1, u(n, "New iframe does not support same origin")) : w(n, "Same origin messaging failed, falling back to postMessage");
|
|
181
173
|
}
|
|
182
174
|
o(
|
|
183
|
-
`Sending message to iframe: %c${n}%c targetOrigin: %c${
|
|
175
|
+
`Sending message to iframe: %c${n}%c targetOrigin: %c${l.join(", ")}`
|
|
184
176
|
);
|
|
185
|
-
for (const f of
|
|
186
|
-
a.postMessage(
|
|
177
|
+
for (const f of l)
|
|
178
|
+
a.postMessage(B + t, f);
|
|
187
179
|
}
|
|
188
|
-
function
|
|
180
|
+
function S(e, t, n) {
|
|
189
181
|
if (b(n, e), !i[n]?.postMessageTarget) {
|
|
190
182
|
w(n, "Iframe not found");
|
|
191
183
|
return;
|
|
192
184
|
}
|
|
193
|
-
|
|
185
|
+
on(e, t, n);
|
|
194
186
|
}
|
|
195
|
-
const
|
|
196
|
-
function
|
|
197
|
-
document.hidden !== !0 &&
|
|
187
|
+
const sn = (e, t) => Object.values(i).filter(({ autoResize: n, firstRun: o }) => n && !o).forEach(({ iframe: n }) => S(e, t, n.id));
|
|
188
|
+
function rn() {
|
|
189
|
+
document.hidden !== !0 && sn("tabVisible", ve);
|
|
198
190
|
}
|
|
199
|
-
function
|
|
191
|
+
function ln(e) {
|
|
200
192
|
if (e.boxSizing !== "border-box") return 0;
|
|
201
193
|
const t = e.paddingTop ? parseInt(e.paddingTop, 10) : 0, n = e.paddingBottom ? parseInt(e.paddingBottom, 10) : 0;
|
|
202
194
|
return t + n;
|
|
203
195
|
}
|
|
204
|
-
function
|
|
196
|
+
function an(e) {
|
|
205
197
|
if (e.boxSizing !== "border-box") return 0;
|
|
206
198
|
const t = e.borderTopWidth ? parseInt(e.borderTopWidth, 10) : 0, n = e.borderBottomWidth ? parseInt(e.borderBottomWidth, 10) : 0;
|
|
207
199
|
return t + n;
|
|
208
200
|
}
|
|
209
|
-
function
|
|
210
|
-
const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = o ? getComputedStyle(o) : null, a = s ?
|
|
201
|
+
function cn(e) {
|
|
202
|
+
const t = e.slice(Z).split(":"), n = t[1] ? Number(t[1]) : 0, o = i[t[0]]?.iframe, s = o ? getComputedStyle(o) : null, a = s ? ln(s) + an(s) : 0, r = {
|
|
211
203
|
iframe: o,
|
|
212
204
|
id: t[0],
|
|
213
205
|
height: n + a,
|
|
@@ -218,21 +210,21 @@ function hn(e) {
|
|
|
218
210
|
};
|
|
219
211
|
return t[5] && (r.mode = t[5]), r;
|
|
220
212
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
213
|
+
const un = { true: 1, false: 1, undefined: 1 };
|
|
214
|
+
function fn(e) {
|
|
223
215
|
const { id: t, msg: n, iframe: o } = e, s = St(o);
|
|
224
|
-
return s || (u(t, `Received: %c${n}`,
|
|
216
|
+
return s || (u(t, `Received: %c${n}`, c), w(t, "The target iframe was not found.")), s;
|
|
225
217
|
}
|
|
226
|
-
function
|
|
218
|
+
function pn(e, t) {
|
|
227
219
|
const { id: n } = e, { data: o, origin: s } = t;
|
|
228
220
|
if ("sameOrigin" in t && t.sameOrigin) return !0;
|
|
229
221
|
const r = i[n]?.checkOrigin;
|
|
230
|
-
function
|
|
222
|
+
function l() {
|
|
231
223
|
function f() {
|
|
232
224
|
u(
|
|
233
225
|
n,
|
|
234
226
|
`Checking connection is from allowed list of origins: %c${r}`,
|
|
235
|
-
|
|
227
|
+
c
|
|
236
228
|
);
|
|
237
229
|
for (const h of r)
|
|
238
230
|
if (h === s)
|
|
@@ -241,33 +233,33 @@ function yn(e, t) {
|
|
|
241
233
|
}
|
|
242
234
|
function p() {
|
|
243
235
|
const h = i[n]?.remoteHost;
|
|
244
|
-
return u(n, `Checking connection is from: %c${h}`,
|
|
236
|
+
return u(n, `Checking connection is from: %c${h}`, c), s === h;
|
|
245
237
|
}
|
|
246
238
|
return r.constructor === Array ? f() : p();
|
|
247
239
|
}
|
|
248
|
-
if (r && `${s}` != "null" && !
|
|
240
|
+
if (r && `${s}` != "null" && !l())
|
|
249
241
|
throw new Error(
|
|
250
242
|
`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`
|
|
251
243
|
);
|
|
252
244
|
return !0;
|
|
253
245
|
}
|
|
254
|
-
const
|
|
255
|
-
function
|
|
256
|
-
const { id: t, type: n } = e, o = n in
|
|
246
|
+
const hn = (e) => B === `${e}`.slice(0, Z) && e.slice(Z).split(":")[0] in i;
|
|
247
|
+
function gn(e) {
|
|
248
|
+
const { id: t, type: n } = e, o = n in un;
|
|
257
249
|
return o && u(t, "Ignoring init message from meta parent page"), o;
|
|
258
250
|
}
|
|
259
|
-
function
|
|
251
|
+
function dn(e) {
|
|
260
252
|
try {
|
|
261
253
|
i[e].sameOrigin = !!i[e]?.iframe?.contentWindow?.iframeChildListener;
|
|
262
254
|
} catch {
|
|
263
255
|
i[e].sameOrigin = !1;
|
|
264
256
|
}
|
|
265
|
-
u(e, `sameOrigin: %c${i[e].sameOrigin}`,
|
|
257
|
+
u(e, `sameOrigin: %c${i[e].sameOrigin}`, c);
|
|
266
258
|
}
|
|
267
|
-
function
|
|
259
|
+
function yn(e, t) {
|
|
268
260
|
if (t !== _) {
|
|
269
261
|
if (t === void 0) {
|
|
270
|
-
|
|
262
|
+
m(
|
|
271
263
|
e,
|
|
272
264
|
`<rb>Legacy version detected in iframe</>
|
|
273
265
|
|
|
@@ -281,33 +273,33 @@ See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
|
281
273
|
u(
|
|
282
274
|
e,
|
|
283
275
|
`Version mismatch (Child: %c${t}%c !== Parent: %c${_})`,
|
|
284
|
-
|
|
276
|
+
c,
|
|
285
277
|
z,
|
|
286
|
-
|
|
278
|
+
c
|
|
287
279
|
);
|
|
288
280
|
}
|
|
289
281
|
}
|
|
290
282
|
function k(e, t, n) {
|
|
291
283
|
if (!i[e]) return null;
|
|
292
284
|
const o = i[e][t];
|
|
293
|
-
if (typeof o !==
|
|
285
|
+
if (typeof o !== Et)
|
|
294
286
|
throw new TypeError(`${t} on iframe[${e}] is not a function`);
|
|
295
287
|
if (t !== "onBeforeClose" && t !== "onScroll")
|
|
296
|
-
return
|
|
288
|
+
return $t(o, n);
|
|
297
289
|
try {
|
|
298
290
|
return o(n);
|
|
299
291
|
} catch (s) {
|
|
300
292
|
return console.error(s), w(e, `Error in ${t} callback`), null;
|
|
301
293
|
}
|
|
302
294
|
}
|
|
303
|
-
function
|
|
295
|
+
function mn(e, t) {
|
|
304
296
|
const { id: n, iframe: o } = e;
|
|
305
297
|
u(
|
|
306
298
|
n,
|
|
307
299
|
`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,
|
|
308
|
-
|
|
300
|
+
c,
|
|
309
301
|
z,
|
|
310
|
-
|
|
302
|
+
c,
|
|
311
303
|
z
|
|
312
304
|
), k(n, "onMessage", {
|
|
313
305
|
iframe: o,
|
|
@@ -317,100 +309,100 @@ function wn(e, t) {
|
|
|
317
309
|
function x(e, t) {
|
|
318
310
|
const { lastMessage: n } = i[e];
|
|
319
311
|
return n.slice(
|
|
320
|
-
n.indexOf(
|
|
312
|
+
n.indexOf(A) + Tt + t
|
|
321
313
|
);
|
|
322
314
|
}
|
|
323
|
-
function
|
|
315
|
+
function ie(e, t) {
|
|
324
316
|
const { id: n, iframe: o, height: s, type: a, width: r } = t;
|
|
325
|
-
let
|
|
317
|
+
let l = { x: 0, y: 0 };
|
|
326
318
|
if (r === 0 && s === 0) {
|
|
327
|
-
const f = x(n, 9).split(
|
|
328
|
-
|
|
319
|
+
const f = x(n, 9).split(A);
|
|
320
|
+
l = {
|
|
329
321
|
x: f[1],
|
|
330
322
|
y: f[0]
|
|
331
323
|
};
|
|
332
324
|
} else
|
|
333
|
-
|
|
325
|
+
l = {
|
|
334
326
|
x: r,
|
|
335
327
|
y: s
|
|
336
328
|
};
|
|
337
329
|
k(n, e, {
|
|
338
330
|
iframe: o,
|
|
339
|
-
screenX: Number(
|
|
340
|
-
screenY: Number(
|
|
331
|
+
screenX: Number(l.x),
|
|
332
|
+
screenY: Number(l.y),
|
|
341
333
|
type: a
|
|
342
334
|
});
|
|
343
335
|
}
|
|
344
|
-
const
|
|
336
|
+
const g = {
|
|
345
337
|
position: null,
|
|
346
338
|
version: _
|
|
347
339
|
};
|
|
348
|
-
function
|
|
349
|
-
|
|
340
|
+
function Le() {
|
|
341
|
+
g.position = null;
|
|
350
342
|
}
|
|
351
|
-
const
|
|
352
|
-
function
|
|
353
|
-
|
|
343
|
+
const bn = () => g.position;
|
|
344
|
+
function vn(e) {
|
|
345
|
+
g.position = e;
|
|
354
346
|
}
|
|
355
|
-
function
|
|
356
|
-
return
|
|
347
|
+
function Pe(e) {
|
|
348
|
+
return g.position === null && (g.position = {
|
|
357
349
|
x: window.scrollX,
|
|
358
350
|
y: window.scrollY
|
|
359
351
|
}), u(
|
|
360
352
|
e,
|
|
361
|
-
`Get page position: %c${
|
|
362
|
-
|
|
353
|
+
`Get page position: %c${g.position.x}%c, %c${g.position.y}`,
|
|
354
|
+
c,
|
|
363
355
|
z,
|
|
364
|
-
|
|
365
|
-
),
|
|
356
|
+
c
|
|
357
|
+
), g.position;
|
|
366
358
|
}
|
|
367
|
-
function
|
|
368
|
-
|
|
359
|
+
function Ne(e) {
|
|
360
|
+
g.position !== null && (window.scrollTo(g.position.x, g.position.y), y(
|
|
369
361
|
e,
|
|
370
|
-
`Set page position: %c${
|
|
371
|
-
|
|
362
|
+
`Set page position: %c${g.position.x}%c, %c${g.position.y}`,
|
|
363
|
+
c,
|
|
372
364
|
z,
|
|
373
|
-
|
|
374
|
-
),
|
|
365
|
+
c
|
|
366
|
+
), Le());
|
|
375
367
|
}
|
|
376
|
-
function
|
|
368
|
+
function se(e, t) {
|
|
377
369
|
const { id: n } = t, o = `${t[e]}px`;
|
|
378
|
-
i[n].iframe.style[e] = o,
|
|
370
|
+
i[n].iframe.style[e] = o, y(n, `Set ${e}: %c${o}`, c);
|
|
379
371
|
}
|
|
380
|
-
function
|
|
372
|
+
function Ce(e) {
|
|
381
373
|
const { id: t } = e, { sizeHeight: n, sizeWidth: o } = i[t];
|
|
382
|
-
n &&
|
|
374
|
+
n && se(dt, e), o && se(yt, e);
|
|
383
375
|
}
|
|
384
|
-
function
|
|
376
|
+
function re(e) {
|
|
385
377
|
const { id: t } = e;
|
|
386
|
-
|
|
378
|
+
Ce(e), Ne(t), k(t, "onResized", e);
|
|
387
379
|
}
|
|
388
|
-
function
|
|
380
|
+
function xe(e) {
|
|
389
381
|
const { id: t } = e;
|
|
390
382
|
u(t, "Disconnected from iframe"), delete i[t], delete e.iframeResizer;
|
|
391
383
|
}
|
|
392
|
-
function
|
|
384
|
+
function _e(e) {
|
|
393
385
|
const { id: t } = e;
|
|
394
386
|
if (k(t, "onBeforeClose", t) === !1) {
|
|
395
387
|
u(t, "Close iframe cancelled by onBeforeClose");
|
|
396
388
|
return;
|
|
397
389
|
}
|
|
398
|
-
u(t, `Removing
|
|
390
|
+
u(t, `Removing iframe: %c${t}`, c);
|
|
399
391
|
try {
|
|
400
392
|
e.parentNode && e.remove();
|
|
401
393
|
} catch (n) {
|
|
402
394
|
w(t, n);
|
|
403
395
|
}
|
|
404
|
-
k(t, "onAfterClose", t),
|
|
396
|
+
k(t, "onAfterClose", t), xe(e);
|
|
405
397
|
}
|
|
406
|
-
function
|
|
398
|
+
function Be(e) {
|
|
407
399
|
const { id: t, type: n } = e;
|
|
408
400
|
u(
|
|
409
401
|
t,
|
|
410
|
-
`Size reset requested by ${n ===
|
|
411
|
-
),
|
|
402
|
+
`Size reset requested by ${n === $ ? "parent page" : "child page"}`
|
|
403
|
+
), Pe(t), Ce(e), S(V, V, t);
|
|
412
404
|
}
|
|
413
|
-
const
|
|
405
|
+
const Fe = (e, t) => {
|
|
414
406
|
const n = {};
|
|
415
407
|
return (o, s) => {
|
|
416
408
|
const { iframe: a } = i[s];
|
|
@@ -419,61 +411,61 @@ const De = (e, t) => {
|
|
|
419
411
|
n[p] = null;
|
|
420
412
|
}));
|
|
421
413
|
}
|
|
422
|
-
function
|
|
423
|
-
|
|
414
|
+
function l() {
|
|
415
|
+
S(`${o} (${e})`, `${e}:${t(a)}`, s);
|
|
424
416
|
}
|
|
425
|
-
r(
|
|
417
|
+
r(l, s);
|
|
426
418
|
};
|
|
427
419
|
}, He = (e) => (t) => {
|
|
428
420
|
e in i[t] && (i[t][e](), delete i[t][e]);
|
|
429
|
-
},
|
|
421
|
+
}, We = (
|
|
430
422
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
431
423
|
((e, t) => (n) => {
|
|
432
424
|
let o = !1;
|
|
433
|
-
const s = (
|
|
434
|
-
i[n] ? (!o || o ===
|
|
425
|
+
const s = (d) => () => {
|
|
426
|
+
i[n] ? (!o || o === d) && (e(d, n), o = d, requestAnimationFrame(() => {
|
|
435
427
|
o = !1;
|
|
436
428
|
})) : h();
|
|
437
|
-
}, a = s(
|
|
438
|
-
function p(
|
|
439
|
-
u(n, `${
|
|
429
|
+
}, a = s(ee), r = s("resize window"), l = new ResizeObserver(s("pageObserver")), f = new ResizeObserver(s("iframeObserver"));
|
|
430
|
+
function p(d, E) {
|
|
431
|
+
u(n, `${d}listeners for send${t}`), E(window, ee, a), E(window, ve, r);
|
|
440
432
|
}
|
|
441
433
|
function h() {
|
|
442
|
-
b(n, `stop${t}`), p("Remove ",
|
|
434
|
+
b(n, `stop${t}`), p("Remove ", oe), l.disconnect(), f.disconnect(), i[n] && oe(i[n].iframe, G, h);
|
|
443
435
|
}
|
|
444
|
-
function
|
|
445
|
-
p("Add ",
|
|
436
|
+
function j() {
|
|
437
|
+
p("Add ", N), l.observe(document.body), f.observe(i[n].iframe);
|
|
446
438
|
}
|
|
447
|
-
i[n] && (i[n][`stop${t}`] = h,
|
|
439
|
+
i[n] && (i[n][`stop${t}`] = h, N(i[n].iframe, G, h), j());
|
|
448
440
|
})
|
|
449
441
|
);
|
|
450
|
-
function
|
|
451
|
-
const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight: a, innerWidth: r } = window, { clientHeight:
|
|
442
|
+
function zn(e) {
|
|
443
|
+
const t = document.body.getBoundingClientRect(), n = e.getBoundingClientRect(), { scrollY: o, scrollX: s, innerHeight: a, innerWidth: r } = window, { clientHeight: l, clientWidth: f } = document.documentElement;
|
|
452
444
|
return JSON.stringify({
|
|
453
445
|
iframeHeight: n.height,
|
|
454
446
|
iframeWidth: n.width,
|
|
455
|
-
clientHeight: Math.max(
|
|
447
|
+
clientHeight: Math.max(l, a || 0),
|
|
456
448
|
clientWidth: Math.max(f, r || 0),
|
|
457
449
|
offsetTop: Math.trunc(n.top - t.top),
|
|
458
450
|
offsetLeft: Math.trunc(n.left - t.left),
|
|
459
451
|
scrollTop: o,
|
|
460
452
|
scrollLeft: s,
|
|
461
|
-
documentHeight:
|
|
453
|
+
documentHeight: l,
|
|
462
454
|
documentWidth: f,
|
|
463
455
|
windowHeight: a,
|
|
464
456
|
windowWidth: r
|
|
465
457
|
});
|
|
466
458
|
}
|
|
467
|
-
const
|
|
468
|
-
|
|
459
|
+
const wn = Fe(me, zn), En = We(
|
|
460
|
+
wn,
|
|
469
461
|
"PageInfo"
|
|
470
|
-
),
|
|
471
|
-
function
|
|
462
|
+
), On = He("stopPageInfo");
|
|
463
|
+
function kn(e) {
|
|
472
464
|
const { scrollWidth: t, scrollHeight: n } = document.documentElement, o = typeof window < "u" && window.visualViewport ? window.visualViewport : {}, {
|
|
473
465
|
width: s = 0,
|
|
474
466
|
height: a = 0,
|
|
475
467
|
offsetLeft: r = 0,
|
|
476
|
-
offsetTop:
|
|
468
|
+
offsetTop: l = 0,
|
|
477
469
|
pageLeft: f = 0,
|
|
478
470
|
pageTop: p = 0,
|
|
479
471
|
scale: h = 1
|
|
@@ -488,70 +480,70 @@ function Mn(e) {
|
|
|
488
480
|
width: s,
|
|
489
481
|
height: a,
|
|
490
482
|
offsetLeft: r,
|
|
491
|
-
offsetTop:
|
|
483
|
+
offsetTop: l,
|
|
492
484
|
pageLeft: f,
|
|
493
485
|
pageTop: p,
|
|
494
486
|
scale: h
|
|
495
487
|
}
|
|
496
488
|
});
|
|
497
489
|
}
|
|
498
|
-
const
|
|
499
|
-
|
|
490
|
+
const Tn = Fe(be, kn), jn = We(
|
|
491
|
+
Tn,
|
|
500
492
|
"ParentInfo"
|
|
501
|
-
),
|
|
502
|
-
function
|
|
503
|
-
const t = e.getBoundingClientRect(), n =
|
|
493
|
+
), In = He("stopParentInfo");
|
|
494
|
+
function De(e) {
|
|
495
|
+
const t = e.getBoundingClientRect(), n = Pe(e.id);
|
|
504
496
|
return {
|
|
505
497
|
x: Number(t.left) + Number(n.x),
|
|
506
498
|
y: Number(t.top) + Number(n.y)
|
|
507
499
|
};
|
|
508
500
|
}
|
|
509
|
-
function
|
|
510
|
-
const { x: t, y: n } =
|
|
501
|
+
function Ge(e) {
|
|
502
|
+
const { x: t, y: n } = bn(), o = i[e]?.iframe;
|
|
511
503
|
if (k(e, "onScroll", { iframe: o, top: n, left: t, x: t, y: n }) === !1) {
|
|
512
|
-
|
|
504
|
+
Le();
|
|
513
505
|
return;
|
|
514
506
|
}
|
|
515
|
-
|
|
507
|
+
Ne(e);
|
|
516
508
|
}
|
|
517
|
-
function
|
|
509
|
+
function Mn(e) {
|
|
518
510
|
const { id: t, height: n, width: o } = e, s = window.parentIframe || window.parentIFrame || window;
|
|
519
|
-
|
|
511
|
+
y(
|
|
520
512
|
t,
|
|
521
513
|
`scrollBy: x: %c${o}%c y: %c${n}`,
|
|
522
|
-
|
|
514
|
+
c,
|
|
523
515
|
z,
|
|
524
|
-
|
|
516
|
+
c
|
|
525
517
|
), s.scrollBy(o, n);
|
|
526
518
|
}
|
|
527
|
-
const
|
|
519
|
+
const Ve = (e) => (t) => {
|
|
528
520
|
const { id: n, iframe: o, height: s, width: a } = t;
|
|
529
|
-
function r(
|
|
530
|
-
|
|
521
|
+
function r(d) {
|
|
522
|
+
vn(d), Ge(n);
|
|
531
523
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
524
|
+
function l(d, E) {
|
|
525
|
+
d[`scrollTo${e ? "Offset" : ""}`](
|
|
534
526
|
E.x,
|
|
535
527
|
E.y
|
|
536
528
|
);
|
|
537
529
|
}
|
|
538
|
-
const f = (
|
|
539
|
-
x: a +
|
|
540
|
-
y: s +
|
|
541
|
-
}), p = e ?
|
|
542
|
-
|
|
530
|
+
const f = (d) => ({
|
|
531
|
+
x: a + d.x,
|
|
532
|
+
y: s + d.y
|
|
533
|
+
}), p = e ? De(o) : { x: 0, y: 0 }, h = f(p), j = window.parentIframe || window.parentIFrame;
|
|
534
|
+
y(
|
|
543
535
|
n,
|
|
544
536
|
`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,
|
|
545
|
-
|
|
537
|
+
c,
|
|
546
538
|
z,
|
|
547
|
-
|
|
548
|
-
),
|
|
549
|
-
},
|
|
550
|
-
function
|
|
551
|
-
const { x: o, y: s } =
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
function
|
|
539
|
+
c
|
|
540
|
+
), j ? l(j, h) : r(h);
|
|
541
|
+
}, Sn = Ve(!1), $n = Ve(!0);
|
|
542
|
+
function Rn(e, t, n) {
|
|
543
|
+
const { x: o, y: s } = De(n);
|
|
544
|
+
y(e, `Moving to in page link: %c#${t}`, c), g.position = { x: o, y: s }, Ge(e), window.location.hash = t;
|
|
545
|
+
}
|
|
546
|
+
function An(e, t) {
|
|
555
547
|
const n = window.parentIframe || window.parentIFrame;
|
|
556
548
|
if (!n) {
|
|
557
549
|
u(e, `In page link #${t} not found`);
|
|
@@ -559,26 +551,26 @@ function Nn(e, t) {
|
|
|
559
551
|
}
|
|
560
552
|
n.moveToAnchor(t);
|
|
561
553
|
}
|
|
562
|
-
function
|
|
554
|
+
function Ln(e, t) {
|
|
563
555
|
const n = t.split("#")[1] || "", o = decodeURIComponent(n), s = document.getElementById(o) || document.getElementsByName(o)[0];
|
|
564
556
|
if (s) {
|
|
565
|
-
|
|
557
|
+
Rn(e, n, s);
|
|
566
558
|
return;
|
|
567
559
|
}
|
|
568
560
|
if (window.top === window.self) {
|
|
569
561
|
u(e, `In page link #${n} not found`);
|
|
570
562
|
return;
|
|
571
563
|
}
|
|
572
|
-
|
|
564
|
+
An(e, n);
|
|
573
565
|
}
|
|
574
|
-
function
|
|
566
|
+
function Pn(e) {
|
|
575
567
|
const t = i[e]?.iframe?.title;
|
|
576
568
|
return t === "" || t === void 0;
|
|
577
569
|
}
|
|
578
|
-
function
|
|
579
|
-
i[e]?.syncTitle && (i[e].iframe.title = t,
|
|
570
|
+
function Nn(e, t) {
|
|
571
|
+
i[e]?.syncTitle && (i[e].iframe.title = t, y(e, `Set iframe title attribute: %c${t}`, c));
|
|
580
572
|
}
|
|
581
|
-
const
|
|
573
|
+
const H = (e) => {
|
|
582
574
|
if (!e) return "";
|
|
583
575
|
let t = -559038744, n = 1103547984;
|
|
584
576
|
for (let o, s = 0; s < e.length; s++)
|
|
@@ -589,22 +581,23 @@ const W = (e) => {
|
|
|
589
581
|
(t) => String.fromCodePoint(
|
|
590
582
|
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
591
583
|
)
|
|
592
|
-
),
|
|
584
|
+
), Cn = /* @__PURE__ */ new Date(), Ue = (e) => new Set(Array.from({ length: 9 }, e)), le = " - lewpylk", R = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], xn = [
|
|
593
585
|
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
594
586
|
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
595
|
-
"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
|
|
587
|
+
"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</>",
|
|
596
588
|
"<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</>.",
|
|
597
589
|
"<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.",
|
|
598
590
|
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
599
591
|
"<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.",
|
|
600
592
|
"<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.",
|
|
601
|
-
"<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."
|
|
602
|
-
|
|
593
|
+
"<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.",
|
|
594
|
+
"<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"
|
|
595
|
+
], _n = (e) => [
|
|
603
596
|
e[0],
|
|
604
|
-
...e.slice(1).map((t) => `${t}${
|
|
605
|
-
`${e[4]}${
|
|
597
|
+
...e.slice(1).map((t) => `${t}${le}`),
|
|
598
|
+
`${e[4]}${le}`,
|
|
606
599
|
...e.slice(1)
|
|
607
|
-
],
|
|
600
|
+
], Bn = _n(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), ae = Object.fromEntries(
|
|
608
601
|
[
|
|
609
602
|
"2cgs7fdf4xb",
|
|
610
603
|
"1c9ctcccr4z",
|
|
@@ -618,114 +611,114 @@ const W = (e) => {
|
|
|
618
611
|
"oclbb4thgl",
|
|
619
612
|
"igb1wzrjqr"
|
|
620
613
|
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
621
|
-
),
|
|
614
|
+
), qe = Cn[v(R[4])](), Fn = Ue((e, t) => H(`${qe + t}`)), Hn = Ue((e, t) => H(`${qe - ++t}`)), Wn = (e) => Fn.has(e) ? 9 : Hn.has(e) ? 5 : -2, O = (e) => v(xn[e]), Dn = (e) => v(Bn[e]), Gn = (e) => {
|
|
622
615
|
const t = e[v(R[0])] || e[v(R[1])] || e[v(R[2])] || e[v(R[3])];
|
|
623
616
|
if (!t) return -1;
|
|
624
617
|
const n = t.split("-");
|
|
625
618
|
let o = (function(s = "", a = "") {
|
|
626
619
|
let r = -2;
|
|
627
|
-
const
|
|
628
|
-
return
|
|
620
|
+
const l = H(v(s));
|
|
621
|
+
return l in ae && (r = ae[l]), r === 9 ? Wn(a) : r;
|
|
629
622
|
})(...n);
|
|
630
|
-
return o === 0 || ((s) => s[2] ===
|
|
623
|
+
return o === 0 || ((s) => s[2] === H(s[0] + s[1]))(n) || (o = -2), o;
|
|
631
624
|
};
|
|
632
|
-
let J = !1,
|
|
633
|
-
function
|
|
625
|
+
let J = !1, Ze = !1;
|
|
626
|
+
function Je(e, t = -3) {
|
|
634
627
|
if (J) return;
|
|
635
628
|
const n = Math.max(i[e].mode, t);
|
|
636
629
|
if (n > i[e].mode && (i[e].mode = n), n < 0)
|
|
637
|
-
throw
|
|
638
|
-
switch (n > 5 &&
|
|
630
|
+
throw Zt(e), i[e].vAdvised || m(e || "Parent", `${O(n + 2)}${O(2)}`), i[e].vAdvised = !0, O(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
631
|
+
switch (n > 5 && Ze || Yt(`v${_} (${Dn(n)})`, n), n) {
|
|
639
632
|
case 1:
|
|
640
633
|
case 2:
|
|
641
634
|
case 3:
|
|
642
|
-
|
|
635
|
+
m("Parent", O(6));
|
|
643
636
|
break;
|
|
644
637
|
case 4:
|
|
645
|
-
|
|
638
|
+
m("Parent", O(7));
|
|
646
639
|
break;
|
|
647
640
|
case 5:
|
|
648
|
-
|
|
641
|
+
m("Parent", O(8));
|
|
649
642
|
break;
|
|
650
643
|
default:
|
|
651
|
-
n < 1 &&
|
|
644
|
+
n < 1 && m("Parent", O(3));
|
|
652
645
|
}
|
|
653
646
|
J = !0;
|
|
654
647
|
}
|
|
655
|
-
function
|
|
648
|
+
function Vn(e) {
|
|
656
649
|
if (J) return;
|
|
657
650
|
const { mode: t } = i[e];
|
|
658
|
-
t > 5 &&
|
|
651
|
+
t > 5 && Je(e, t);
|
|
659
652
|
}
|
|
660
|
-
function
|
|
661
|
-
e?.log === -1 && (e.log = !1,
|
|
653
|
+
function Un(e) {
|
|
654
|
+
e?.log === -1 && (e.log = !1, Ze = !0);
|
|
662
655
|
}
|
|
663
|
-
function
|
|
664
|
-
i[e] && (u(e, `First run for ${e}`),
|
|
656
|
+
function qn(e, t) {
|
|
657
|
+
i[e] && (u(e, `First run for ${e}`), Je(e, t === void 0 ? void 0 : Number(t)), i[e].firstRun = !1);
|
|
665
658
|
}
|
|
666
|
-
function
|
|
667
|
-
const { height: t, id: n, iframe: o, mode: s, message: a, type: r, width:
|
|
668
|
-
switch (i[n]?.firstRun &&
|
|
659
|
+
function Zn(e) {
|
|
660
|
+
const { height: t, id: n, iframe: o, mode: s, message: a, type: r, width: l } = e, { lastMessage: f } = i[n];
|
|
661
|
+
switch (i[n]?.firstRun && qn(n, s), u(n, `Received: %c${f}`, c), r) {
|
|
669
662
|
case ge:
|
|
670
663
|
i[n].autoResize = JSON.parse(x(n, 9));
|
|
671
664
|
break;
|
|
672
|
-
case
|
|
673
|
-
|
|
665
|
+
case ot:
|
|
666
|
+
y(n, "Ready state reset"), i[n].initialised = !1;
|
|
674
667
|
break;
|
|
675
|
-
case
|
|
676
|
-
|
|
668
|
+
case it:
|
|
669
|
+
_e(o);
|
|
677
670
|
break;
|
|
678
|
-
case
|
|
679
|
-
|
|
671
|
+
case st:
|
|
672
|
+
Ln(n, x(n, 9));
|
|
680
673
|
break;
|
|
681
|
-
case
|
|
682
|
-
|
|
674
|
+
case $:
|
|
675
|
+
re(e), dn(n), yn(n, a), i[n].initialised = !0, k(n, "onReady", o);
|
|
683
676
|
break;
|
|
684
|
-
case
|
|
685
|
-
|
|
677
|
+
case L:
|
|
678
|
+
mn(e, x(n, 6));
|
|
686
679
|
break;
|
|
687
680
|
case lt:
|
|
688
|
-
|
|
681
|
+
ie("onMouseEnter", e);
|
|
689
682
|
break;
|
|
690
|
-
case
|
|
691
|
-
|
|
683
|
+
case at:
|
|
684
|
+
ie("onMouseLeave", e);
|
|
685
|
+
break;
|
|
686
|
+
case me:
|
|
687
|
+
En(n);
|
|
692
688
|
break;
|
|
693
689
|
case be:
|
|
690
|
+
jn(n);
|
|
691
|
+
break;
|
|
692
|
+
case ct:
|
|
693
|
+
On(n);
|
|
694
|
+
break;
|
|
695
|
+
case ut:
|
|
694
696
|
In(n);
|
|
695
697
|
break;
|
|
696
|
-
case
|
|
697
|
-
|
|
698
|
+
case V:
|
|
699
|
+
Be(e);
|
|
698
700
|
break;
|
|
699
701
|
case ft:
|
|
700
|
-
|
|
702
|
+
Mn(e);
|
|
701
703
|
break;
|
|
702
704
|
case pt:
|
|
703
|
-
|
|
704
|
-
break;
|
|
705
|
-
case U:
|
|
706
|
-
We(e);
|
|
705
|
+
Sn(e);
|
|
707
706
|
break;
|
|
708
707
|
case ht:
|
|
709
|
-
|
|
710
|
-
break;
|
|
711
|
-
case dt:
|
|
712
|
-
An(e);
|
|
708
|
+
$n(e);
|
|
713
709
|
break;
|
|
714
710
|
case gt:
|
|
715
|
-
|
|
716
|
-
break;
|
|
717
|
-
case yt:
|
|
718
|
-
Fn(n, a);
|
|
711
|
+
Nn(n, a);
|
|
719
712
|
break;
|
|
720
713
|
default:
|
|
721
|
-
if (
|
|
714
|
+
if (l === 0 && t === 0) {
|
|
722
715
|
w(
|
|
723
716
|
n,
|
|
724
717
|
`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`
|
|
725
718
|
);
|
|
726
719
|
return;
|
|
727
720
|
}
|
|
728
|
-
if (
|
|
721
|
+
if (l === 0 || t === 0) {
|
|
729
722
|
u(n, "Ignoring message with 0 height or width");
|
|
730
723
|
return;
|
|
731
724
|
}
|
|
@@ -733,52 +726,52 @@ function Kn(e) {
|
|
|
733
726
|
u(n, "Page hidden - ignored resize request");
|
|
734
727
|
return;
|
|
735
728
|
}
|
|
736
|
-
|
|
729
|
+
re(e);
|
|
737
730
|
}
|
|
738
731
|
}
|
|
739
|
-
const
|
|
732
|
+
const Jn = (e) => ({
|
|
740
733
|
initChild: t,
|
|
741
734
|
postMessageTarget: n
|
|
742
735
|
}) => {
|
|
743
736
|
e === n && t();
|
|
744
|
-
},
|
|
745
|
-
function
|
|
737
|
+
}, Yn = (e) => Object.values(i).forEach(Jn(e));
|
|
738
|
+
function ce(e) {
|
|
746
739
|
const t = e.data;
|
|
747
|
-
if (t ===
|
|
748
|
-
|
|
740
|
+
if (t === nt) {
|
|
741
|
+
Yn(e.source);
|
|
749
742
|
return;
|
|
750
743
|
}
|
|
751
|
-
if (!
|
|
752
|
-
if (typeof t !==
|
|
753
|
-
b(
|
|
744
|
+
if (!hn(t)) {
|
|
745
|
+
if (typeof t !== Y) return;
|
|
746
|
+
b(U, "ignoredMessage"), Ut(U, t);
|
|
754
747
|
return;
|
|
755
748
|
}
|
|
756
|
-
const n =
|
|
749
|
+
const n = cn(t), { id: o, type: s } = n;
|
|
757
750
|
switch (b(o, s), !0) {
|
|
758
751
|
case !i[o]:
|
|
759
752
|
throw new Error(`${s} No settings for ${o}. Message was: ${t}`);
|
|
760
|
-
case !
|
|
761
|
-
case
|
|
762
|
-
case !
|
|
753
|
+
case !fn(n):
|
|
754
|
+
case gn(n):
|
|
755
|
+
case !pn(n, e):
|
|
763
756
|
return;
|
|
764
757
|
default:
|
|
765
|
-
i[o].lastMessage = e.data,
|
|
758
|
+
i[o].lastMessage = e.data, Ae(o, Zn)(n);
|
|
766
759
|
}
|
|
767
760
|
}
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
}),
|
|
771
|
-
function
|
|
772
|
-
if (
|
|
761
|
+
const Xn = Rt(() => {
|
|
762
|
+
N(window, L, ce), N(document, "visibilitychange", rn), window.iframeParentListener = (e) => setTimeout(() => ce({ data: e, sameOrigin: !0 }));
|
|
763
|
+
}), ue = {};
|
|
764
|
+
function Kn(e) {
|
|
765
|
+
if (ue[e] === !0) return !1;
|
|
773
766
|
const t = document.querySelectorAll(`iframe#${CSS.escape(e)}`);
|
|
774
767
|
if (t.length <= 1) return !0;
|
|
775
|
-
|
|
768
|
+
ue[e] = !0;
|
|
776
769
|
const n = Array.from(t).flatMap((o) => [
|
|
777
|
-
|
|
770
|
+
C,
|
|
778
771
|
o,
|
|
779
|
-
|
|
772
|
+
C
|
|
780
773
|
]);
|
|
781
|
-
return
|
|
774
|
+
return m(
|
|
782
775
|
e,
|
|
783
776
|
`<rb>Duplicate ID attributes detected</>
|
|
784
777
|
|
|
@@ -786,37 +779,26 @@ The <b>${e}</> ID is not unique. Having multiple iframes on the same page with t
|
|
|
786
779
|
|
|
787
780
|
Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,
|
|
788
781
|
...n,
|
|
789
|
-
|
|
782
|
+
C
|
|
790
783
|
), !1;
|
|
791
784
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${Me}`, io = `<rb>Deprecated Method</>
|
|
795
|
-
|
|
796
|
-
Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code.`;
|
|
797
|
-
function so(e) {
|
|
785
|
+
function Qn(e) {
|
|
798
786
|
if (i[e]) {
|
|
799
|
-
const { iframe: t } = i[e]
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
removeListeners() {
|
|
806
|
-
y(e, oo), this.disconnect();
|
|
807
|
-
},
|
|
808
|
-
resize() {
|
|
809
|
-
y(e, io), T("Window resize", Y, e);
|
|
787
|
+
const { iframe: t } = i[e];
|
|
788
|
+
t.iframeResizer = {
|
|
789
|
+
close: _e.bind(null, t),
|
|
790
|
+
disconnect: xe.bind(null, t),
|
|
791
|
+
moveToAnchor(n) {
|
|
792
|
+
Ct(n, Y, "moveToAnchor(anchor) anchor"), S("Move to anchor", `moveToAnchor:${n}`, e);
|
|
810
793
|
},
|
|
811
|
-
sendMessage(
|
|
812
|
-
|
|
794
|
+
sendMessage(n) {
|
|
795
|
+
n = JSON.stringify(n), S(L, `${L}:${n}`, e);
|
|
813
796
|
}
|
|
814
797
|
};
|
|
815
|
-
t.iframeResizer = n, t.iFrameResizer = n;
|
|
816
798
|
}
|
|
817
799
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
800
|
+
const eo = "8", to = "32", no = zt, oo = !0;
|
|
801
|
+
function io(e) {
|
|
820
802
|
const {
|
|
821
803
|
autoResize: t,
|
|
822
804
|
bodyBackground: n,
|
|
@@ -824,83 +806,83 @@ function uo(e) {
|
|
|
824
806
|
bodyPadding: s,
|
|
825
807
|
heightCalculationMethod: a,
|
|
826
808
|
inPageLinks: r,
|
|
827
|
-
license:
|
|
809
|
+
license: l,
|
|
828
810
|
log: f,
|
|
829
811
|
logExpand: p,
|
|
830
812
|
mouseEvents: h,
|
|
831
|
-
offsetHeight:
|
|
832
|
-
offsetWidth:
|
|
813
|
+
offsetHeight: j,
|
|
814
|
+
offsetWidth: d,
|
|
833
815
|
mode: E,
|
|
834
|
-
sizeHeight:
|
|
816
|
+
sizeHeight: Ye,
|
|
835
817
|
// sizeSelector,
|
|
836
|
-
sizeWidth:
|
|
837
|
-
tolerance:
|
|
838
|
-
widthCalculationMethod:
|
|
818
|
+
sizeWidth: Xe,
|
|
819
|
+
tolerance: Ke,
|
|
820
|
+
widthCalculationMethod: Qe
|
|
839
821
|
} = i[e];
|
|
840
822
|
return [
|
|
841
823
|
e,
|
|
842
|
-
|
|
843
|
-
|
|
824
|
+
eo,
|
|
825
|
+
Xe,
|
|
844
826
|
f,
|
|
845
|
-
|
|
846
|
-
|
|
827
|
+
to,
|
|
828
|
+
oo,
|
|
847
829
|
t,
|
|
848
830
|
o,
|
|
849
831
|
a,
|
|
850
832
|
n,
|
|
851
833
|
s,
|
|
852
|
-
|
|
834
|
+
Ke,
|
|
853
835
|
r,
|
|
854
|
-
|
|
855
|
-
|
|
836
|
+
no,
|
|
837
|
+
Qe,
|
|
856
838
|
h,
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
839
|
+
j,
|
|
840
|
+
d,
|
|
841
|
+
Ye,
|
|
842
|
+
l,
|
|
843
|
+
g.version,
|
|
862
844
|
E,
|
|
863
845
|
"",
|
|
864
846
|
// sizeSelector,
|
|
865
847
|
p
|
|
866
|
-
].join(
|
|
848
|
+
].join(A);
|
|
867
849
|
}
|
|
868
|
-
const
|
|
869
|
-
function
|
|
850
|
+
const so = "0";
|
|
851
|
+
function ro(e) {
|
|
870
852
|
const { bodyMargin: t } = i[e];
|
|
871
|
-
(typeof t ===
|
|
853
|
+
(typeof t === wt || t === so) && (i[e].bodyMargin = `${t}px`);
|
|
872
854
|
}
|
|
873
|
-
const
|
|
855
|
+
const lo = (e) => {
|
|
874
856
|
try {
|
|
875
857
|
return new URL(e).origin;
|
|
876
858
|
} catch {
|
|
877
859
|
return null;
|
|
878
860
|
}
|
|
879
|
-
},
|
|
880
|
-
function
|
|
861
|
+
}, ao = (e) => typeof e === ze && e.length > 0 && !(e.contains("allow-scripts") && e.contains("allow-same-origin"));
|
|
862
|
+
function co(e, t) {
|
|
881
863
|
const {
|
|
882
864
|
checkOrigin: n,
|
|
883
865
|
iframe: { src: o, sandbox: s },
|
|
884
866
|
initialisedFirstPage: a,
|
|
885
867
|
waitForLoad: r
|
|
886
|
-
} = t[e],
|
|
887
|
-
b(e, "noResponse"),
|
|
868
|
+
} = t[e], l = lo(o);
|
|
869
|
+
b(e, "noResponse"), m(
|
|
888
870
|
e,
|
|
889
871
|
`<rb>No response from iframe</>
|
|
890
872
|
|
|
891
873
|
The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout / 1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
|
|
892
|
-
${n &&
|
|
893
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${
|
|
874
|
+
${n && l ? `
|
|
875
|
+
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${l}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.
|
|
894
876
|
` : ""}${r && !a ? `
|
|
895
877
|
The <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.
|
|
896
|
-
` : ""}${
|
|
878
|
+
` : ""}${ao(s) ? `
|
|
897
879
|
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
898
880
|
` : ""}
|
|
899
881
|
This message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.
|
|
900
882
|
`
|
|
901
883
|
);
|
|
902
884
|
}
|
|
903
|
-
function
|
|
885
|
+
function uo(e, t) {
|
|
904
886
|
function n() {
|
|
905
887
|
if (t[e] === void 0) return;
|
|
906
888
|
const { initialised: a, loadErrorShown: r } = t[e];
|
|
@@ -908,169 +890,169 @@ function mo(e, t) {
|
|
|
908
890
|
t[e].initialisedFirstPage = !0;
|
|
909
891
|
return;
|
|
910
892
|
}
|
|
911
|
-
r || (t[e].loadErrorShown = !0,
|
|
893
|
+
r || (t[e].loadErrorShown = !0, co(e, t));
|
|
912
894
|
}
|
|
913
895
|
const { msgTimeout: o, warningTimeout: s } = t[e];
|
|
914
896
|
s && (o && clearTimeout(o), t[e].msgTimeout = setTimeout(n, s));
|
|
915
897
|
}
|
|
916
|
-
const
|
|
917
|
-
function
|
|
918
|
-
i[e]?.heightCalculationMethod in
|
|
898
|
+
const fo = 1, po = (e) => e.loading === rt, ho = (e) => e === $;
|
|
899
|
+
function go(e) {
|
|
900
|
+
i[e]?.heightCalculationMethod in jt && Be({
|
|
919
901
|
id: e,
|
|
920
902
|
iframe: i[e].iframe,
|
|
921
|
-
height:
|
|
922
|
-
width:
|
|
923
|
-
type:
|
|
903
|
+
height: Q,
|
|
904
|
+
width: Q,
|
|
905
|
+
type: $
|
|
924
906
|
});
|
|
925
907
|
}
|
|
926
|
-
function
|
|
927
|
-
|
|
908
|
+
function yo(e, t) {
|
|
909
|
+
N(e, G, () => setTimeout(t, fo));
|
|
928
910
|
}
|
|
929
|
-
const
|
|
911
|
+
const mo = (e) => {
|
|
930
912
|
const { src: t, srcdoc: n } = e;
|
|
931
913
|
return !n && (t == null || t === "" || t === "about:blank");
|
|
932
914
|
};
|
|
933
|
-
function
|
|
915
|
+
function bo(e, t) {
|
|
934
916
|
const { iframe: n, waitForLoad: o } = i[e];
|
|
935
917
|
if (o !== !0) {
|
|
936
|
-
if (
|
|
918
|
+
if (mo(n)) {
|
|
937
919
|
setTimeout(() => {
|
|
938
|
-
b(e, "noContent"),
|
|
920
|
+
b(e, "noContent"), y(e, "No content detected in the iframe, delaying initialisation");
|
|
939
921
|
});
|
|
940
922
|
return;
|
|
941
923
|
}
|
|
942
924
|
setTimeout(t);
|
|
943
925
|
}
|
|
944
926
|
}
|
|
945
|
-
function
|
|
927
|
+
function vo(e, t) {
|
|
946
928
|
const n = (s) => () => {
|
|
947
929
|
if (!i[e]) return;
|
|
948
930
|
const { firstRun: a, iframe: r } = i[e];
|
|
949
|
-
|
|
931
|
+
S(s, t, e), ho(s) && po(r) || uo(e, i), a || go(e);
|
|
950
932
|
}, { iframe: o } = i[e];
|
|
951
|
-
i[e].initChild = n(
|
|
933
|
+
i[e].initChild = n(de), yo(o, n(ye)), bo(e, n($));
|
|
952
934
|
}
|
|
953
|
-
function
|
|
954
|
-
return t ? (("sizeWidth" in t || "sizeHeight" in t || ge in t) &&
|
|
935
|
+
function zo(e, t) {
|
|
936
|
+
return t ? (("sizeWidth" in t || "sizeHeight" in t || ge in t) && m(
|
|
955
937
|
e,
|
|
956
938
|
`<rb>Deprecated Option</>
|
|
957
939
|
|
|
958
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${
|
|
940
|
+
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${W}</>, <bb>${Oe}</>, <bb>${Ee}</> or <bb>${we}</>.
|
|
959
941
|
`
|
|
960
942
|
), t) : {};
|
|
961
943
|
}
|
|
962
|
-
function
|
|
963
|
-
i[e].warningTimeout ||
|
|
944
|
+
function wo(e) {
|
|
945
|
+
i[e].warningTimeout || y(e, "warningTimeout:%c disabled", c);
|
|
964
946
|
}
|
|
965
|
-
function
|
|
947
|
+
function Eo(e, { offset: t, offsetSize: n }) {
|
|
966
948
|
const o = n || t;
|
|
967
|
-
o && (i[e].direction ===
|
|
949
|
+
o && (i[e].direction === W ? (i[e].offsetHeight = o, u(e, `Offset height: %c${o}`, c)) : (i[e].offsetWidth = o, u(e, `Offset width: %c${o}`, c)));
|
|
968
950
|
}
|
|
969
|
-
function
|
|
951
|
+
function Oo(e) {
|
|
970
952
|
const { direction: t } = i[e];
|
|
971
953
|
switch (t) {
|
|
972
|
-
case
|
|
954
|
+
case W:
|
|
973
955
|
break;
|
|
974
|
-
case
|
|
956
|
+
case Oe:
|
|
975
957
|
i[e].sizeHeight = !1;
|
|
976
958
|
// eslint-disable-next-line no-fallthrough
|
|
977
|
-
case
|
|
959
|
+
case Ee:
|
|
978
960
|
i[e].sizeWidth = !0;
|
|
979
961
|
break;
|
|
980
|
-
case
|
|
962
|
+
case we:
|
|
981
963
|
i[e].sizeWidth = !1, i[e].sizeHeight = !1, i[e].autoResize = !1;
|
|
982
964
|
break;
|
|
983
965
|
default:
|
|
984
966
|
throw new TypeError(`Direction value of "${t}" is not valid`);
|
|
985
967
|
}
|
|
986
|
-
u(e, `direction: %c${t}`,
|
|
968
|
+
u(e, `direction: %c${t}`, c);
|
|
987
969
|
}
|
|
988
|
-
const
|
|
989
|
-
function
|
|
970
|
+
const fe = (e) => e === "" || e.match(/^(about:blank|javascript:|file:\/\/)/) !== null ? "*" : e;
|
|
971
|
+
function ko(e) {
|
|
990
972
|
const { checkOrigin: t, remoteHost: n } = i[e];
|
|
991
973
|
Array.isArray(t) && t.length === 0 && w(
|
|
992
974
|
e,
|
|
993
975
|
"checkOrigin is an empty array — no messages will be sent to the iframe"
|
|
994
|
-
), i[e].targetOrigin = Array.isArray(t) ? t.map(
|
|
976
|
+
), i[e].targetOrigin = Array.isArray(t) ? t.map(fe) : [t === !1 ? "*" : fe(n)];
|
|
995
977
|
}
|
|
996
|
-
function
|
|
978
|
+
function To(e) {
|
|
997
979
|
const { id: t } = e;
|
|
998
980
|
i[t].postMessageTarget === null && (i[t].postMessageTarget = e.contentWindow);
|
|
999
981
|
}
|
|
1000
|
-
function
|
|
1001
|
-
P(i[e], t) && (
|
|
982
|
+
function D(e, t, n) {
|
|
983
|
+
P(i[e], t) && (m(
|
|
1002
984
|
e,
|
|
1003
985
|
`<rb>Deprecated option</>
|
|
1004
986
|
|
|
1005
|
-
The <b>${t}</> option has been renamed to <b>${n}</>. ${
|
|
987
|
+
The <b>${t}</> option has been renamed to <b>${n}</>. ${Mt}`
|
|
1006
988
|
), i[e][n] = i[e][t], delete i[e][t]);
|
|
1007
989
|
}
|
|
1008
|
-
function
|
|
1009
|
-
|
|
990
|
+
function jo(e) {
|
|
991
|
+
D(e, mt, bt), D(e, "onClose", "onBeforeClose"), D(e, "onClosed", "onAfterClose");
|
|
1010
992
|
}
|
|
1011
|
-
const
|
|
1012
|
-
function
|
|
993
|
+
const Io = (e) => P(e, "onMouseEnter") || P(e, "onMouseLeave");
|
|
994
|
+
function Mo(e, t) {
|
|
1013
995
|
const { id: n } = e;
|
|
1014
996
|
i[n] = {
|
|
1015
997
|
...i[n],
|
|
1016
998
|
iframe: e,
|
|
1017
999
|
remoteHost: e?.src.split("/").slice(0, 3).join("/"),
|
|
1018
|
-
...
|
|
1019
|
-
...
|
|
1020
|
-
mouseEvents:
|
|
1021
|
-
mode:
|
|
1022
|
-
syncTitle:
|
|
1023
|
-
},
|
|
1024
|
-
}
|
|
1025
|
-
const
|
|
1026
|
-
function
|
|
1000
|
+
...F,
|
|
1001
|
+
...zo(n, t),
|
|
1002
|
+
mouseEvents: Io(t),
|
|
1003
|
+
mode: Gn(t),
|
|
1004
|
+
syncTitle: Pn(n)
|
|
1005
|
+
}, jo(n), Oo(n), Eo(n, t), wo(n), To(e), ko(n);
|
|
1006
|
+
}
|
|
1007
|
+
const So = "yes", pe = "no";
|
|
1008
|
+
function $o(e) {
|
|
1027
1009
|
const { id: t } = e;
|
|
1028
1010
|
switch (u(
|
|
1029
1011
|
t,
|
|
1030
1012
|
`Iframe scrolling ${i[t]?.scrolling ? "enabled" : "disabled"} for ${t}`
|
|
1031
|
-
), e.style.overflow = i[t]?.scrolling === !1 ?
|
|
1013
|
+
), e.style.overflow = i[t]?.scrolling === !1 ? vt : q, i[t]?.scrolling) {
|
|
1032
1014
|
case kt:
|
|
1033
1015
|
break;
|
|
1034
1016
|
case !0:
|
|
1035
|
-
e.scrolling =
|
|
1017
|
+
e.scrolling = So;
|
|
1036
1018
|
break;
|
|
1037
1019
|
case !1:
|
|
1038
|
-
e.scrolling =
|
|
1020
|
+
e.scrolling = pe;
|
|
1039
1021
|
break;
|
|
1040
1022
|
default:
|
|
1041
|
-
e.scrolling = i[t]?.scrolling ||
|
|
1023
|
+
e.scrolling = i[t]?.scrolling || pe;
|
|
1042
1024
|
}
|
|
1043
1025
|
}
|
|
1044
|
-
function
|
|
1045
|
-
|
|
1026
|
+
function Ro(e, t, n) {
|
|
1027
|
+
Mo(t, n), u(e, `src: %c${t.srcdoc || t.src}`, c), Vn(e), $o(t), ro(e), vo(e, io(e)), Qn(e), u(e, "Setup complete");
|
|
1046
1028
|
}
|
|
1047
|
-
function
|
|
1029
|
+
function Ao(e, t) {
|
|
1048
1030
|
const { id: n } = e;
|
|
1049
|
-
b(n, "setup"),
|
|
1031
|
+
b(n, "setup"), Kn(n) && Ro(n, e, t), Jt(n);
|
|
1050
1032
|
}
|
|
1051
|
-
function
|
|
1052
|
-
t.log === ke ? t.log = !1 : t.log ===
|
|
1053
|
-
const n = P(t, "log"), o =
|
|
1054
|
-
P(t, "logExpand") || (t.logExpand = n && o ? t.log ===
|
|
1033
|
+
function Lo(e, t) {
|
|
1034
|
+
t.log === ke ? t.log = !1 : t.log === Te ? t.log = M : t.log === je && (t.log = I);
|
|
1035
|
+
const n = P(t, "log"), o = X(t.log), s = n ? o ? !0 : t.log : F.log;
|
|
1036
|
+
P(t, "logExpand") || (t.logExpand = n && o ? t.log === I : F.logExpand), Un(t), Vt({
|
|
1055
1037
|
enabled: s,
|
|
1056
1038
|
expand: t.logExpand,
|
|
1057
1039
|
iframeId: e
|
|
1058
|
-
}), o && !(t.log in
|
|
1040
|
+
}), o && !(t.log in It) && qt(
|
|
1059
1041
|
e,
|
|
1060
|
-
`Invalid value for options.log: Accepted values are "${
|
|
1042
|
+
`Invalid value for options.log: Accepted values are "${I}" and "${M}"`
|
|
1061
1043
|
), t.log = s;
|
|
1062
1044
|
}
|
|
1063
|
-
function
|
|
1064
|
-
if (!
|
|
1065
|
-
return
|
|
1066
|
-
const n =
|
|
1067
|
-
return
|
|
1045
|
+
function No(e) {
|
|
1046
|
+
if (!Ie(e)) throw new TypeError("Options is not an object");
|
|
1047
|
+
return Xn(), tn(e), (t) => {
|
|
1048
|
+
const n = en(t, e);
|
|
1049
|
+
return he in t ? (b(n, "alreadySetup"), w(n, `Ignored iframe (${n}), already setup.`)) : (Lo(n, e), Ae(n, Ao)(t, e)), t?.iframeResizer;
|
|
1068
1050
|
};
|
|
1069
1051
|
}
|
|
1070
1052
|
export {
|
|
1071
|
-
|
|
1053
|
+
Te as LOG_COLLAPSED,
|
|
1072
1054
|
ke as LOG_DISABLED,
|
|
1073
|
-
|
|
1074
|
-
|
|
1055
|
+
je as LOG_EXPANDED,
|
|
1056
|
+
No as default
|
|
1075
1057
|
};
|
|
1076
1058
|
//# sourceMappingURL=index.esm.js.map
|