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