@iframe-resizer/child 5.1.3 → 5.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/iframe-resizer.child.d.ts +111 -114
- package/index.cjs.js +3 -2
- package/index.cjs.js.map +1 -0
- package/index.esm.js +3 -2
- package/index.esm.js.map +1 -0
- package/index.umd.js +3 -2
- package/index.umd.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,129 +9,126 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
declare module '@iframe-resizer/child' {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
export interface IFramePageOptions {
|
|
14
|
+
/**
|
|
15
|
+
* This option allows you to restrict the domain of the parent page,
|
|
16
|
+
* to prevent other sites mimicking your parent page.
|
|
17
|
+
*/
|
|
18
|
+
targetOrigin?: string | undefined
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Receive message posted from the parent page with the iframe.iFrameResizer.sendMessage() method.
|
|
22
|
+
*/
|
|
23
|
+
onMessage?(message: any): void
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page.
|
|
27
|
+
*/
|
|
28
|
+
onReady?(): void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
+
export interface IFramePage {
|
|
33
|
+
/**
|
|
34
|
+
* Turn autoResizing of the iFrame on and off. Returns bool of current state.
|
|
35
|
+
*/
|
|
36
|
+
autoResize(resize?: boolean): boolean
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Remove the iFrame from the parent page.
|
|
40
|
+
*/
|
|
41
|
+
close(): void
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the ID of the iFrame that the page is contained in.
|
|
45
|
+
*/
|
|
46
|
+
getId(): string
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Ask the containing page for its positioning coordinates.
|
|
50
|
+
*
|
|
51
|
+
* Your callback function will be recalled when the parent page is scrolled or resized.
|
|
52
|
+
*
|
|
53
|
+
* Pass false to disable the callback.
|
|
54
|
+
*/
|
|
55
|
+
getParentProps(callback: (data: ParentProps) => void): void
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Scroll the parent page by x and y
|
|
59
|
+
*/
|
|
60
|
+
scrollBy(x: number, y: number): void
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Scroll the parent page to the coordinates x and y
|
|
64
|
+
*/
|
|
65
|
+
scrollTo(x: number, y: number): void
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Scroll the parent page to the coordinates x and y relative to the position of the iFrame.
|
|
69
|
+
*/
|
|
70
|
+
scrollToOffset(x: number, y: number): void
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Send data to the containing page, message can be any data type that can be serialized into JSON. The `targetOrigin`
|
|
74
|
+
* option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page.
|
|
75
|
+
* See the MDN documentation on postMessage for more details.
|
|
76
|
+
*/
|
|
77
|
+
sendMessage(message: any, targetOrigin?: string): void
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Set default target origin.
|
|
81
|
+
*/
|
|
82
|
+
setTargetOrigin(targetOrigin: string): void
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Manually force iFrame to resize. To use passed arguments you need first to disable the `autoResize` option to
|
|
86
|
+
* prevent auto resizing and enable the `sizeWidth` option if you wish to set the width.
|
|
87
|
+
*/
|
|
88
|
+
size(customHeight?: string, customWidth?: string): void
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ParentProps {
|
|
92
|
+
/**
|
|
93
|
+
* The values returned by iframe.getBoundingClientRect()
|
|
94
|
+
*/
|
|
95
|
+
iframe: {
|
|
96
|
+
x: number
|
|
97
|
+
y: number
|
|
98
|
+
width: number
|
|
99
|
+
height: number
|
|
100
|
+
top: number
|
|
101
|
+
right: number
|
|
102
|
+
bottom: number
|
|
103
|
+
left: number
|
|
30
104
|
}
|
|
31
105
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Remove the iFrame from the parent page.
|
|
41
|
-
*/
|
|
42
|
-
close(): void
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Returns the ID of the iFrame that the page is contained in.
|
|
46
|
-
*/
|
|
47
|
-
getId(): string
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Ask the containing page for its positioning coordinates.
|
|
51
|
-
*
|
|
52
|
-
* Your callback function will be recalled when the parent page is scrolled or resized.
|
|
53
|
-
*
|
|
54
|
-
* Pass false to disable the callback.
|
|
55
|
-
*/
|
|
56
|
-
getParentProps(callback: (data: ParentProps) => void): void
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Scroll the parent page by x and y
|
|
60
|
-
*/
|
|
61
|
-
scrollBy(x: number, y: number): void
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Scroll the parent page to the coordinates x and y
|
|
65
|
-
*/
|
|
66
|
-
scrollTo(x: number, y: number): void
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Scroll the parent page to the coordinates x and y relative to the position of the iFrame.
|
|
70
|
-
*/
|
|
71
|
-
scrollToOffset(x: number, y: number): void
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Send data to the containing page, message can be any data type that can be serialized into JSON. The `targetOrigin`
|
|
75
|
-
* option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page.
|
|
76
|
-
* See the MDN documentation on postMessage for more details.
|
|
77
|
-
*/
|
|
78
|
-
sendMessage(message: any, targetOrigin?: string): void
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Set default target origin.
|
|
82
|
-
*/
|
|
83
|
-
setTargetOrigin(targetOrigin: string): void
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Manually force iFrame to resize. To use passed arguments you need first to disable the `autoResize` option to
|
|
87
|
-
* prevent auto resizing and enable the `sizeWidth` option if you wish to set the width.
|
|
88
|
-
*/
|
|
89
|
-
size(customHeight?: string, customWidth?: string): void
|
|
106
|
+
/**
|
|
107
|
+
* The values returned by document.documentElement.scrollWidth and document.documentElement.scrollHeight
|
|
108
|
+
*/
|
|
109
|
+
document: {
|
|
110
|
+
scrollWidth: number
|
|
111
|
+
scrollHeight: number
|
|
90
112
|
}
|
|
91
113
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
bottom: number
|
|
104
|
-
left: number
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The values returned by document.documentElement.scrollWidth and document.documentElement.scrollHeight
|
|
109
|
-
*/
|
|
110
|
-
document: {
|
|
111
|
-
scrollWidth: number
|
|
112
|
-
scrollHeight: number
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The values returned by window.visualViewport
|
|
117
|
-
*/
|
|
118
|
-
viewport: {
|
|
119
|
-
width: number
|
|
120
|
-
height: number
|
|
121
|
-
offsetLeft: number
|
|
122
|
-
offsetTop: number
|
|
123
|
-
pageLeft: number
|
|
124
|
-
pageTop: number
|
|
125
|
-
scale: number
|
|
126
|
-
}
|
|
114
|
+
/**
|
|
115
|
+
* The values returned by window.visualViewport
|
|
116
|
+
*/
|
|
117
|
+
viewport: {
|
|
118
|
+
width: number
|
|
119
|
+
height: number
|
|
120
|
+
offsetLeft: number
|
|
121
|
+
offsetTop: number
|
|
122
|
+
pageLeft: number
|
|
123
|
+
pageTop: number
|
|
124
|
+
scale: number
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
|
|
130
128
|
global {
|
|
131
129
|
interface Window {
|
|
132
|
-
iFrameResizer:
|
|
133
|
-
parentIFrame:
|
|
130
|
+
iFrameResizer: IFramePageOptions
|
|
131
|
+
parentIFrame: IFramePage
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
|
-
|
|
137
134
|
}
|
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.1
|
|
4
|
+
* @module iframe-resizer/child 5.2.0-beta.1 (cjs) - 2024-07-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e="5.1.3",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(se("Custom height calculation function not defined"),De.auto()),width:()=>(se("Custom width calculation function not defined"),He.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{se("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e;function re(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ae(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const le=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ce=(...e)=>console?.info(le(...e)),se=(...e)=>console?.warn(le(...e)),ue=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(le)(...e)),de=e=>ue(e);function me(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);fe("margin",function(e,t){t.includes("-")&&(se(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),fe("background",S),fe("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),pe(),L<0?de(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&de(a(3)),function(){if(!Y||""===Y||"false"===Y)return void ue("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");Y!==e&&ue(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),be(),we(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&ue("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),ge(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,ze()):!1===e&&!0===z&&(z=!1,ye("remove"),U?.disconnect(),E?.disconnect()),Ze(0,0,"autoResize",JSON.stringify(z)),z),close(){Ze(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Ze(0,0,"pageInfo"),void ue("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Ze(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Ze(0,0,"parentInfo"),()=>{oe=null,Ze(0,0,"parentInfoStop")}},getParentProperties(e){ue("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Je()},scrollBy(e,t){Ze(t,e,"scrollBy")},scrollTo(e,t){Ze(t,e,"scrollTo")},scrollToOffset(e,t){Ze(t,e,"scrollToOffset")},sendMessage(e,t){Ze(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,be()},setWidthCalculationMethod(e){K=e,we()},setTargetOrigin(e){Z=e},resize(e,t){Ue("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){ue("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Ze(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),ze(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Ze(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Ze(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?ue("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),Ue("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Ze(0,0,"title",document.title),te(),B=!1}function fe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function pe(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function he(e){({add(t){function n(){Ue(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ye(e){he({method:e,eventType:"After Print",eventName:"afterprint"}),he({method:e,eventType:"Before Print",eventName:"beforeprint"}),he({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function ge(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:xe(document)()}function ve(e,t,n,o){return t!==e&&(e in n||(se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&ue(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function be(){k=ve(k,f,De,"height")}function we(){K=ve(K,v,He,"width")}function ze(){!0===z&&(ye("add"),E=function(){function e(e){e.forEach(Me),pe(),ge()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver($e),Oe(window.document))}let Se;function $e(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Se=()=>Ue("resizeObserver",`Resize Observed: ${re(t)}`),setTimeout((()=>{Se&&Se(),Se=void 0}),0)}const je=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ee=()=>[...xe(document)()].filter(je);function Pe(e){e&&U.observe(e)}function Oe(e){[...Ee(),...g.flatMap((t=>e.querySelector(t)))].forEach(Pe)}function Me(e){"childList"===e.type&&Oe(e.target)}const Ae=new WeakSet;Ae.add(document.documentElement),Ae.add(document.body);let Ce=4,Te=4;function Ie(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,Ae.has(s)||(Ae.add(s),ce(`\nHeight calculated from: ${re(s)} (${ae(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${re(r)} (${ae(r,100)})`;return c<4||i<99||T||B||Ce<c&&Ce<Te&&(Ce=1.2*c,ue(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Te=c,a}const ke=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Ne=!1;function Re({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Ne)return Ne=!0,n.taggedElement();const r=o?"bottom":"right";return ue(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const Be={height:0,width:0},qe={height:0,width:0};function Le(e,t){function n(){return qe[i]=r,Be[i]=c,r}const o=e===De,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===qe[i]&&0===Be[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===qe[i]&&c===Be[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==qe[i]&&c<=Be[i]:return n();case!o:return t?e.taggedElement():Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<qe[i]:case c===l||c===a:case r>c:return n();case!t:return Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const De={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>Le(De,!1),autoOverflow:()=>Le(De,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...ke(De)),min:()=>Math.min(...ke(De)),grow:()=>De.max(),lowestElement:()=>Ie("bottom"),taggedElement:()=>Ie("bottom")},He={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>Le(He,!1),autoOverflow:()=>Le(He,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...ke(He)),min:()=>Math.min(...ke(He)),rightMostElement:()=>Ie("right"),scroll:()=>Math.max(He.bodyScroll(),He.documentElementScroll()),taggedElement:()=>Ie("right")};function We(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?De[k]():n,a=void 0===o?He[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Je():(Fe(),I=r,G=a,Ze(I,G,e,i))}function Ue(e,t,n,o,i){document.hidden||We(e,0,n,o,i)}function Fe(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ve(e){I=De[k](),G=He[K](),Ze(I,G,e)}function Je(e){const t=k;k=f,Fe(),Ve("reset"),k=t}function Ze(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Qe(e){const t={init:function(){N=e.data,J=e.source,me(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ve("resetPage")},resize(){Ue("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Ze(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Ze(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||se(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Qe({data:e,sameDomain:!0}),o(window,"message",Qe),o(window,"readystatechange",Xe),Xe());
|
|
20
|
+
"use strict";const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut());
|
|
21
|
+
//# sourceMappingURL=index.cjs.js.map
|
package/index.cjs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../packages/common/consts.js","../../packages/common/listeners.js","../../packages/common/mode.js","../../packages/common/utils.js","../../packages/child/overflow.js","../../packages/child/index.js","../../packages/common/format-advise.js"],"sourcesContent":["export const VERSION = '[VI]{version}[/VI]'\n\nexport const BASE = 10\nexport const SINGLE = 1\n\nexport const SIZE_ATTR = 'data-iframe-size'\nexport const OVERFLOW_ATTR = 'data-iframe-overflow'\n\nexport const HEIGHT_EDGE = 'bottom'\nexport const WIDTH_EDGE = 'right'\n\nexport const msgHeader = 'message'\nexport const msgHeaderLen = msgHeader.length\nexport const msgId = '[iFrameSizer]' // Must match iframe msg ID\nexport const msgIdLen = msgId.length\nexport const resetRequiredMethods = Object.freeze({\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n})\n","export const addEventListener = (el, evt, func, options) =>\n el.addEventListener(evt, func, options || false)\n\nexport const removeEventListener = (el, evt, func) =>\n el.removeEventListener(evt, func, false)\n","const l = (l) => {\n if (!l) return ''\n let p = -559038744,\n y = 1103547984\n for (let z, t = 0; t < l.length; t++)\n (z = l.codePointAt(t)),\n (p = Math.imul(p ^ z, 2246822519)),\n (y = Math.imul(y ^ z, 3266489917))\n return (\n (p ^= Math.imul(p ^ (y >>> 15), 1935289751)),\n (y ^= Math.imul(y ^ (p >>> 15), 3405138345)),\n (p ^= y >>> 16),\n (y ^= p >>> 16),\n (2097152 * (y >>> 0) + (p >>> 11)).toString(36)\n )\n },\n p = (l) =>\n l.replaceAll(/[A-Za-z]/g, (l) =>\n String.fromCodePoint(\n (l <= 'Z' ? 90 : 122) >= (l = l.codePointAt(0) + 19) ? l : l - 26,\n ),\n ),\n y = [\n '<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>',\n '<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>',\n '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</>',\n '<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</>.',\n ],\n z = ['NWSc3', 'zvsv', 'wyv', 'ibzpulzz', 'vlt'],\n t = Object.fromEntries(\n [\n '2cgs7fdf4xb',\n '1c9ctcccr4z',\n '1q2pc4eebgb',\n 'ueokt0969w',\n 'w2zxchhgqz',\n '1umuxblj2e5',\n ].map((l, p) => [l, Math.max(0, p - 1)]),\n )\nexport const getModeData = (l) => p(y[l])\nexport const getModeLabel = (l) => p(z[l])\nexport default (y) => {\n const z = y[p('spjluzl')]\n if (!z) return -1\n const u = z.split('-')\n let v = (function (y = '') {\n let z = -2\n const u = l(p(y))\n return u in t && (z = t[u]), z\n })(u[0])\n return 0 === v || ((p) => p[2] === l(p[0] + p[1]))(u) || (v = -2), v\n}\n","export const isNumber = (value) => !Number.isNaN(value)\n\nexport const once = (fn) => {\n let done = false\n\n return function () {\n return done\n ? undefined\n : ((done = true), Reflect.apply(fn, this, arguments))\n }\n}\n\nexport const id = (x) => x\n","import { HEIGHT_EDGE, OVERFLOW_ATTR } from '../common/consts'\nimport { id } from '../common/utils'\n\nlet side = HEIGHT_EDGE\n\nlet onChange = id\n\nconst options = {\n root: document.documentElement,\n rootMargin: '0px',\n threshold: 1,\n}\n\nlet overflowedElements = []\nconst observedElements = new WeakSet()\n\nconst isTarget = (entry) =>\n entry.boundingClientRect[side] === 0 ||\n entry.boundingClientRect[side] > entry.rootBounds[side]\n\nconst callback = (entries) => {\n entries.forEach((entry) => {\n entry.target.toggleAttribute(OVERFLOW_ATTR, isTarget(entry))\n })\n\n overflowedElements = document.querySelectorAll(`[${OVERFLOW_ATTR}]`)\n onChange()\n}\n\nconst observer = new IntersectionObserver(callback, options)\n\nexport const overflowObserver = (options) => {\n side = options.side\n onChange = options.onChange\n\n return (nodeList) =>\n nodeList.forEach((el) => {\n if (observedElements.has(el)) return\n observer.observe(el)\n observedElements.add(el)\n })\n}\n\nexport const isOverflowed = () => overflowedElements.length > 0\n\nexport const getOverflowedElements = () => overflowedElements\n","import {\n BASE,\n HEIGHT_EDGE,\n SINGLE,\n SIZE_ATTR,\n VERSION,\n WIDTH_EDGE,\n} from '../common/consts'\nimport formatAdvise from '../common/format-advise'\nimport { addEventListener, removeEventListener } from '../common/listeners'\nimport { getModeData } from '../common/mode'\nimport { id, once } from '../common/utils'\nimport {\n getOverflowedElements,\n isOverflowed,\n overflowObserver,\n} from './overflow'\n\nconst PERF_TIME_LIMIT = 4\nconst PERF_MIN_ELEMENTS = 99\n\nconst checkVisibilityOptions = {\n contentVisibilityAuto: true,\n opacityProperty: true,\n visibilityProperty: true,\n}\nconst customCalcMethods = {\n height: () => {\n warn('Custom height calculation function not defined')\n return getHeight.auto()\n },\n width: () => {\n warn('Custom width calculation function not defined')\n return getWidth.auto()\n },\n}\nconst deprecatedResizeMethods = {\n bodyOffset: 1,\n bodyScroll: 1,\n offset: 1,\n documentElementOffset: 1,\n documentElementScroll: 1,\n documentElementBoundingClientRect: 1,\n max: 1,\n min: 1,\n grow: 1,\n lowestElement: 1,\n}\nconst eventCancelTimer = 128\nconst eventHandlersByName = {}\nconst hasCheckVisibility = 'checkVisibility' in window\nconst heightCalcModeDefault = 'auto'\n// const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\nconst nonLoggableTriggerEvents = { reset: 1, resetPage: 1, init: 1 }\nconst msgID = '[iFrameSizer]' // Must match host page msg ID\nconst msgIdLen = msgID.length\nconst resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n}\nconst resizeObserveTargets = ['body']\nconst widthCalcModeDefault = 'scroll'\n\nlet autoResize = true\nlet bodyBackground = ''\nlet bodyMargin = 0\nlet bodyMarginStr = ''\nlet bodyObserver = null\nlet bodyPadding = ''\nlet calculateHeight = true\nlet calculateWidth = false\nlet calcElements = null\nlet firstRun = true\nlet hasTags = false\nlet height = 1\nlet heightCalcMode = heightCalcModeDefault // only applys if not provided by host page (V1 compatibility)\nlet initLock = true\nlet initMsg = ''\nlet inPageLinks = {}\nlet isInit = true\nlet logging = false\nlet licenseKey = '' // eslint-disable-line no-unused-vars\nlet mode = 0\nlet mouseEvents = false\nlet myID = ''\nlet offsetHeight\nlet offsetWidth\nlet observeOverflow = id\nlet resizeFrom = 'child'\nlet resizeObserver = null\nlet sameDomain = false\nlet sizeSelector = ''\nlet target = window.parent\nlet targetOriginDefault = '*'\nlet tolerance = 0\nlet triggerLocked = false\nlet version = ''\nlet width = 1\nlet widthCalcMode = widthCalcModeDefault\nlet win = window\n\nlet onMessage = () => {\n warn('onMessage function not defined')\n}\nlet onReady = () => {}\nlet onPageInfo = null\nlet onParentInfo = null\n\nconst capitalizeFirstLetter = (string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nconst isDef = (value) => `${value}` !== '' && value !== undefined\n\nconst usedTags = new WeakSet()\nconst addUsedTag = (el) => typeof el === 'object' && usedTags.add(el)\n\nfunction getElementName(el) {\n switch (true) {\n case !isDef(el):\n return ''\n\n case isDef(el.id):\n return `${el.nodeName.toUpperCase()}#${el.id}`\n\n case isDef(el.name):\n return `${el.nodeName.toUpperCase()} (${el.name})`\n\n default:\n return (\n el.nodeName.toUpperCase() +\n (isDef(el.className) ? `.${el.className}` : '')\n )\n }\n}\n\nfunction elementSnippet(el, maxChars = 30) {\n const outer = el?.outerHTML?.toString()\n\n if (!outer) return el\n\n return outer.length < maxChars\n ? outer\n : `${outer.slice(0, maxChars).replaceAll('\\n', ' ')}...`\n}\n\n// TODO: remove .join(' '), requires major test updates\nconst formatLogMsg = (...msg) => [`[iframe-resizer][${myID}]`, ...msg].join(' ')\n\nconst log = (...msg) =>\n // eslint-disable-next-line no-console\n logging && console?.log(formatLogMsg(...msg))\n\nconst info = (...msg) =>\n // eslint-disable-next-line no-console\n console?.info(`[iframe-resizer][${myID}]`, ...msg)\n\nconst warn = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatLogMsg(...msg))\n\nconst advise = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatAdvise(formatLogMsg)(...msg))\n\nconst adviser = (msg) => advise(msg)\n\nfunction init() {\n readDataFromParent()\n readDataFromPage()\n\n log(`Initialising iFrame v${VERSION} (${window.location.href})`)\n\n checkCrossDomain()\n checkMode()\n checkVersion()\n checkHeightMode()\n checkWidthMode()\n checkDeprecatedAttrs()\n\n setupObserveOverflow()\n setupCalcElements()\n setupPublicMethods()\n setupMouseEvents()\n inPageLinks = setupInPageLinks()\n\n addUsedTag(document.documentElement)\n addUsedTag(document.body)\n\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n\n injectClearFixIntoBodyElement()\n stopInfiniteResizingOfIFrame()\n applySizeSelector()\n}\n\n// Continue init after intersection observer has been setup\nconst initContinue = () => {\n sendSize('init', 'Init message from host page', undefined, undefined, VERSION)\n sendTitle()\n initEventListeners()\n onReady()\n isInit = false\n log('Initialization complete')\n log('---')\n}\n\nfunction setupObserveOverflow() {\n if (calculateHeight === calculateWidth) return\n observeOverflow = overflowObserver({\n onChange: once(initContinue),\n side: calculateHeight ? HEIGHT_EDGE : WIDTH_EDGE,\n })\n}\n\nfunction setupCalcElements() {\n const taggedElements = document.querySelectorAll(`[${SIZE_ATTR}]`)\n hasTags = taggedElements.length > 0\n log(`Tagged elements found: ${hasTags}`)\n calcElements = hasTags ? taggedElements : getAllElements(document)()\n if (hasTags) setTimeout(initContinue)\n else observeOverflow(calcElements)\n}\n\nfunction sendTitle() {\n if (document.title && document.title !== '') {\n sendMsg(0, 0, 'title', document.title)\n }\n}\n\nfunction checkVersion() {\n if (!version || version === '' || version === 'false') {\n advise(\n `<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n`,\n )\n return\n }\n\n if (version !== VERSION) {\n advise(\n `<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${version} - Child page: ${VERSION}.\n`,\n )\n }\n}\n\nfunction checkCrossDomain() {\n try {\n sameDomain = 'iframeParentListener' in window.parent\n } catch (error) {\n log('Cross domain iframe detected.')\n }\n}\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nfunction readDataFromParent() {\n const strBool = (str) => str === 'true'\n const data = initMsg.slice(msgIdLen).split(':')\n\n myID = data[0] // eslint-disable-line prefer-destructuring\n bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility\n calculateWidth = undefined === data[2] ? calculateWidth : strBool(data[2])\n logging = undefined === data[3] ? logging : strBool(data[3])\n // data[4] no longer used (was intervalTimer)\n autoResize = undefined === data[6] ? autoResize : strBool(data[6])\n bodyMarginStr = data[7] // eslint-disable-line prefer-destructuring\n heightCalcMode = undefined === data[8] ? heightCalcMode : data[8]\n bodyBackground = data[9] // eslint-disable-line prefer-destructuring\n bodyPadding = data[10] // eslint-disable-line prefer-destructuring\n tolerance = undefined === data[11] ? tolerance : Number(data[11])\n inPageLinks.enable = undefined === data[12] ? false : strBool(data[12])\n resizeFrom = undefined === data[13] ? resizeFrom : data[13]\n widthCalcMode = undefined === data[14] ? widthCalcMode : data[14]\n mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15])\n offsetHeight = undefined === data[16] ? offsetHeight : Number(data[16])\n offsetWidth = undefined === data[17] ? offsetWidth : Number(data[17])\n calculateHeight = undefined === data[18] ? calculateHeight : strBool(data[18])\n licenseKey = data[19] // eslint-disable-line prefer-destructuring\n version = data[20] || version\n mode = undefined === data[21] ? mode : Number(data[21])\n // sizeSelector = data[22] || sizeSelector\n}\n\nfunction readDataFromPage() {\n function readData() {\n const data = window.iframeResizer || window.iFrameResizer\n\n log(`Reading data from page: ${JSON.stringify(data)}`)\n\n onMessage = data?.onMessage || onMessage\n onReady = data?.onReady || onReady\n\n if (typeof data?.offset === 'number') {\n if (calculateHeight) offsetHeight = data?.offset\n if (calculateWidth) offsetWidth = data?.offset\n }\n\n if (Object.prototype.hasOwnProperty.call(data, 'sizeSelector')) {\n sizeSelector = data.sizeSelector\n }\n\n targetOriginDefault = data?.targetOrigin || targetOriginDefault\n heightCalcMode = data?.heightCalculationMethod || heightCalcMode\n widthCalcMode = data?.widthCalculationMethod || widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if (typeof calcMode === 'function') {\n log(`Setup custom ${calcFunc}CalcMethod`)\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (mode === 1) return\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log(`TargetOrigin for parent set to: ${targetOriginDefault}`)\n}\n\nfunction chkCSS(attr, value) {\n if (value.includes('-')) {\n warn(`Negative CSS value ignored for ${attr}`)\n value = ''\n }\n\n return value\n}\n\nfunction setBodyStyle(attr, value) {\n if (undefined !== value && value !== '' && value !== 'null') {\n document.body.style.setProperty(attr, value)\n log(`Body ${attr} set to \"${value}\"`)\n }\n}\n\nfunction applySizeSelector() {\n if (sizeSelector === '') return\n\n log(`Applying sizeSelector: ${sizeSelector}`)\n\n document.querySelectorAll(sizeSelector).forEach((el) => {\n log(`Applying data-iframe-size to: ${getElementName(el)}`)\n el.dataset.iframeSize = true\n })\n}\n\nfunction setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = `${bodyMargin}px`\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n}\n\nfunction stopInfiniteResizingOfIFrame() {\n const setAutoHeight = (el) =>\n el.style.setProperty('height', 'auto', 'important')\n\n setAutoHeight(document.documentElement)\n setAutoHeight(document.body)\n\n log('HTML & body height set to \"auto !important\"')\n}\n\nfunction manageTriggerEvent(options) {\n const listener = {\n add(eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove(eventName) {\n const handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n },\n }\n\n listener[options.method](options.eventName)\n\n log(\n `${capitalizeFirstLetter(options.method)} event listener: ${\n options.eventType\n }`,\n )\n}\n\nfunction manageEventListeners(method) {\n manageTriggerEvent({\n method,\n eventType: 'After Print',\n eventName: 'afterprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Before Print',\n eventName: 'beforeprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange',\n })\n\n // manageTriggerEvent({\n // method: method,\n // eventType: 'Orientation Change',\n // eventName: 'orientationchange'\n // })\n}\n\nfunction checkDeprecatedAttrs() {\n let found = false\n\n const checkAttrs = (attr) =>\n document.querySelectorAll(`[${attr}]`).forEach((el) => {\n found = true\n el.removeAttribute(attr)\n el.toggleAttribute(SIZE_ATTR, true)\n })\n\n checkAttrs('data-iframe-height')\n checkAttrs('data-iframe-width')\n\n if (found) {\n advise(\n `<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`,\n )\n }\n}\n\nfunction checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(`${calcMode} is not a valid option for ${type}CalculationMethod.`)\n calcMode = calcModeDefault\n }\n if (calcMode in deprecatedResizeMethods) {\n advise(\n `<rb>Deprecated ${type}CalculationMethod (${calcMode})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${type} calculation method. It is recommended that you remove this option.`,\n )\n }\n log(`${type} calculation method set to \"${calcMode}\"`)\n }\n\n return calcMode\n}\n\nfunction checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height',\n )\n}\n\nfunction checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width',\n )\n}\n\nfunction checkMode() {\n if (mode < 0) return adviser(`${getModeData(mode + 2)}${getModeData(2)}`)\n if (version.codePointAt(0) > 4) return mode\n if (mode < 2) return adviser(getModeData(3))\n return mode\n}\n\nfunction initEventListeners() {\n if (autoResize !== true) {\n log('Auto Resize disabled')\n return\n }\n\n manageEventListeners('add')\n setupMutationObserver()\n setupResizeObserver()\n}\n\nfunction stopEventListeners() {\n manageEventListeners('remove')\n resizeObserver?.disconnect()\n bodyObserver?.disconnect()\n}\n\nfunction injectClearFixIntoBodyElement() {\n const clearFix = document.createElement('div')\n\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.append(clearFix)\n}\n\nfunction setupInPageLinks() {\n const getPagePosition = () => ({\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop,\n })\n\n function getElementPosition(el) {\n const elPosition = el.getBoundingClientRect()\n const pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, BASE) + parseInt(pagePosition.x, BASE),\n y: parseInt(elPosition.top, BASE) + parseInt(pagePosition.y, BASE),\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n const jumpPosition = getElementPosition(target)\n\n log(\n `Moving to in page link (#${hash}) at x: ${jumpPosition.x}y: ${jumpPosition.y}`,\n )\n\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n const hash = location.split('#')[1] || location // Remove # if present\n const hashData = decodeURIComponent(hash)\n const target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target !== undefined) {\n jumpToTarget(target)\n return\n }\n\n log(`In page link (#${hash}) not found in iFrame, so sending to parent`)\n sendMsg(0, 0, 'inPageLink', `#${hash}`)\n }\n\n function checkLocationHash() {\n const { hash, href } = window.location\n\n if (hash !== '' && hash !== '#') {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n findTarget(this.getAttribute('href'))\n }\n\n if (el.getAttribute('href') !== '#') {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n document.querySelectorAll('a[href^=\"#\"]').forEach(setupLink)\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n }\n\n if (inPageLinks.enable) {\n if (mode === 1) {\n advise(\n `In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details.`,\n )\n } else {\n enableInPageLinks()\n }\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget,\n }\n}\n\nfunction setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, `${e.screenY}:${e.screenX}`)\n }\n\n function addMouseListener(evt, name) {\n log(`Add event listener: ${name}`)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n}\n\nfunction setupPublicMethods() {\n if (mode === 1) return\n\n win.parentIframe = Object.freeze({\n autoResize: (resize) => {\n if (resize === true && autoResize === false) {\n autoResize = true\n initEventListeners()\n } else if (resize === false && autoResize === true) {\n autoResize = false\n stopEventListeners()\n }\n\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n\n return autoResize\n },\n\n close() {\n sendMsg(0, 0, 'close')\n },\n\n getId: () => myID,\n\n getPageInfo(callback) {\n if (typeof callback === 'function') {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n return\n }\n\n onPageInfo = null\n sendMsg(0, 0, 'pageInfoStop')\n },\n\n getParentProps(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(\n 'parentIFrame.getParentProps(callback) callback not a function',\n )\n }\n\n onParentInfo = callback\n sendMsg(0, 0, 'parentInfo')\n\n return () => {\n onParentInfo = null\n sendMsg(0, 0, 'parentInfoStop')\n }\n },\n\n getParentProperties(callback) {\n advise(\n `<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.getParentProps(callback)\n },\n\n moveToAnchor(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollBy(x, y) {\n sendMsg(y, x, 'scrollBy') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollTo(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod(heightCalculationMethod) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod(widthCalculationMethod) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin(targetOrigin) {\n log(`Set targetOrigin: ${targetOrigin}`)\n targetOriginDefault = targetOrigin\n },\n\n resize(customHeight, customWidth) {\n const valString = `${customHeight || ''}${customWidth ? `,${customWidth}` : ''}`\n\n sendSize(\n 'size',\n `parentIFrame.size(${valString})`,\n customHeight,\n customWidth,\n )\n },\n\n size(customHeight, customWidth) {\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.resize(customHeight, customWidth)\n },\n })\n\n win.parentIFrame = win.parentIframe\n}\n\nlet dispatchResized\n\nfunction resizeObserved(entries) {\n if (!Array.isArray(entries) || entries.length === 0) return\n\n const el = entries[0].target\n\n dispatchResized = () =>\n sendSize('resizeObserver', `Resize Observed: ${getElementName(el)}`)\n\n // Throttle event to once per current call stack (Safari issue)\n setTimeout(() => {\n if (dispatchResized) dispatchResized()\n dispatchResized = undefined\n }, 0)\n}\n\nconst checkPositionType = (element) => {\n const style = getComputedStyle(element)\n return style?.position !== '' && style?.position !== 'static'\n}\n\nconst getAllNonStaticElements = () =>\n [...getAllElements(document)()].filter(checkPositionType)\n\nconst resizeSet = new WeakSet()\n\nfunction setupResizeObservers(el) {\n if (!el) return\n if (resizeSet.has(el)) return\n resizeObserver.observe(el)\n resizeSet.add(el)\n log(`Attached resizeObserver: ${getElementName(el)}`)\n}\n\nfunction createResizeObservers(el) {\n ;[\n ...getAllNonStaticElements(),\n ...resizeObserveTargets.flatMap((target) => el.querySelector(target)),\n ].forEach(setupResizeObservers)\n}\n\nfunction addResizeObservers(mutation) {\n if (mutation.type === 'childList') {\n createResizeObservers(mutation.target)\n }\n}\n\nfunction setupResizeObserver() {\n resizeObserver = new ResizeObserver(resizeObserved)\n createResizeObservers(window.document)\n}\n\nfunction setupBodyMutationObserver() {\n function mutationObserved(mutations) {\n // Look for injected elements that need ResizeObservers\n mutations.forEach(addResizeObservers)\n\n // apply sizeSelector to new elements\n applySizeSelector()\n\n // Rebuild elements list for size calculation\n setupCalcElements()\n }\n\n function createMutationObserver() {\n const observer = new window.MutationObserver(mutationObserved)\n const target = document.querySelector('body')\n const config = {\n // attributes: true,\n attributes: false,\n attributeOldValue: false,\n // characterData: true,\n characterData: false,\n characterDataOldValue: false,\n childList: true,\n subtree: true,\n }\n\n log('Create <body/> MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n const observer = createMutationObserver()\n\n return {\n disconnect() {\n log('Disconnect MutationObserver')\n observer.disconnect()\n },\n }\n}\n\nfunction setupMutationObserver() {\n bodyObserver = setupBodyMutationObserver()\n}\n\nlet lastEl = null\n\nfunction usedEl(el, Side, time, len) {\n if (usedTags.has(el) || lastEl === el || (hasTags && len <= 1)) return\n // addUsedTag(el)\n lastEl = el\n\n info(\n `\\n${Side} position calculated from:\\n`,\n el,\n `\\nParsed ${len} ${hasTags ? 'tagged' : 'potentially overflowing'} elements in ${time}ms`, // ${getElementName(el)} (${elementSnippet(el)})\n )\n}\n\nlet perfWarned = PERF_TIME_LIMIT\nlet lastTimer = PERF_TIME_LIMIT\n\nfunction getMaxElement(side) {\n const Side = capitalizeFirstLetter(side)\n\n let elVal = 0\n let maxEl = document.documentElement\n let maxVal = hasTags\n ? 0\n : document.documentElement.getBoundingClientRect().bottom\n let timer = performance.now()\n\n const targetElements =\n !hasTags && isOverflowed() ? getOverflowedElements() : calcElements\n\n let len = targetElements.length\n\n targetElements.forEach((element) => {\n if (\n !hasTags &&\n hasCheckVisibility && // Safari missing checkVisibility\n !element.checkVisibility(checkVisibilityOptions)\n ) {\n len -= 1\n return\n }\n\n elVal =\n element.getBoundingClientRect()[side] +\n parseFloat(getComputedStyle(element).getPropertyValue(`margin-${side}`))\n\n if (elVal > maxVal) {\n maxVal = elVal\n maxEl = element\n }\n })\n\n timer = (performance.now() - timer).toPrecision(1)\n\n usedEl(maxEl, Side, timer, len)\n\n const logMsg = `\nParsed ${len} element${len === SINGLE ? '' : 's'} in ${timer}ms\n${Side} ${hasTags ? 'tagged ' : ''}element found at: ${maxVal}px\nPosition calculated from HTML element: ${getElementName(maxEl)} (${elementSnippet(maxEl, 100)})`\n\n if (timer < PERF_TIME_LIMIT || len < PERF_MIN_ELEMENTS || hasTags || isInit) {\n log(logMsg)\n } else if (perfWarned < timer && perfWarned < lastTimer) {\n perfWarned = timer * 1.2\n advise(\n `<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${side} most element on the page.\n${logMsg}`,\n )\n }\n\n lastTimer = timer\n return maxVal\n}\n\nconst getAllMeasurements = (dimension) => [\n dimension.bodyOffset(),\n dimension.bodyScroll(),\n dimension.documentElementOffset(),\n dimension.documentElementScroll(),\n dimension.documentElementBoundingClientRect(),\n]\n\nconst getAllElements = (element) => () =>\n element.querySelectorAll(\n '* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)',\n )\n\nconst prevScrollSize = {\n height: 0,\n width: 0,\n}\n\nconst prevBoundingSize = {\n height: 0,\n width: 0,\n}\n\nconst getAdjustedScroll = (getDimension) =>\n getDimension.documentElementScroll() + Math.max(0, getDimension.getOffset())\n\nfunction getAutoSize(getDimension) {\n function returnBoundingClientRect() {\n prevBoundingSize[dimension] = boundingSize\n prevScrollSize[dimension] = scrollSize\n return boundingSize\n }\n\n const hasOverflow = isOverflowed()\n const isHeight = getDimension === getHeight\n const dimension = isHeight ? 'height' : 'width'\n const boundingSize = getDimension.documentElementBoundingClientRect()\n const ceilBoundingSize = Math.ceil(boundingSize)\n const floorBoundingSize = Math.floor(boundingSize)\n const scrollSize = getAdjustedScroll(getDimension)\n const sizes = `HTML: ${boundingSize} Page: ${scrollSize}`\n\n switch (true) {\n case !getDimension.enabled():\n return scrollSize\n\n case hasTags:\n return getDimension.taggedElement()\n\n case !hasOverflow &&\n prevBoundingSize[dimension] === 0 &&\n prevScrollSize[dimension] === 0:\n log(`Initial page size values: ${sizes}`)\n return returnBoundingClientRect()\n\n case triggerLocked &&\n boundingSize === prevBoundingSize[dimension] &&\n scrollSize === prevScrollSize[dimension]:\n log(`Size unchanged: ${sizes}`)\n return Math.max(boundingSize, scrollSize)\n\n case boundingSize === 0:\n log(`Page is hidden: ${sizes}`)\n return scrollSize\n\n case !hasOverflow &&\n boundingSize !== prevBoundingSize[dimension] &&\n scrollSize <= prevScrollSize[dimension]:\n log(\n `New HTML bounding size: ${sizes}`,\n 'Previous bounding size:',\n prevBoundingSize[dimension],\n )\n return returnBoundingClientRect()\n\n case !isHeight:\n return getDimension.taggedElement()\n\n case !hasOverflow && boundingSize < prevBoundingSize[dimension]:\n log('HTML bounding size decreased:', sizes)\n return returnBoundingClientRect()\n\n case scrollSize === floorBoundingSize || scrollSize === ceilBoundingSize:\n log('HTML bounding size equals page size:', sizes)\n return returnBoundingClientRect()\n\n case boundingSize > scrollSize:\n log(`Page size < HTML bounding size: ${sizes}`)\n return returnBoundingClientRect()\n\n default:\n log(`Content overflowing HTML element: ${sizes}`)\n }\n\n return Math.max(getDimension.taggedElement(), returnBoundingClientRect())\n}\n\nconst getBodyOffset = () => {\n const { body } = document\n const style = getComputedStyle(body)\n\n return (\n body.offsetHeight +\n parseInt(style.marginTop, BASE) +\n parseInt(style.marginBottom, BASE)\n )\n}\n\nconst getHeight = {\n enabled: () => calculateHeight,\n getOffset: () => offsetHeight,\n auto: () => getAutoSize(getHeight),\n bodyOffset: getBodyOffset,\n bodyScroll: () => document.body.scrollHeight,\n offset: () => getHeight.bodyOffset(), // Backwards compatibility\n custom: () => customCalcMethods.height(),\n documentElementOffset: () => document.documentElement.offsetHeight,\n documentElementScroll: () => document.documentElement.scrollHeight,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().bottom,\n max: () => Math.max(...getAllMeasurements(getHeight)),\n min: () => Math.min(...getAllMeasurements(getHeight)),\n grow: () => getHeight.max(),\n lowestElement: () => getMaxElement(HEIGHT_EDGE),\n taggedElement: () => getMaxElement(HEIGHT_EDGE),\n}\n\nconst getWidth = {\n enabled: () => calculateWidth,\n getOffset: () => offsetWidth,\n auto: () => getAutoSize(getWidth),\n bodyScroll: () => document.body.scrollWidth,\n bodyOffset: () => document.body.offsetWidth,\n custom: () => customCalcMethods.width(),\n documentElementScroll: () => document.documentElement.scrollWidth,\n documentElementOffset: () => document.documentElement.offsetWidth,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().right,\n max: () => Math.max(...getAllMeasurements(getWidth)),\n min: () => Math.min(...getAllMeasurements(getWidth)),\n rightMostElement: () => getMaxElement(WIDTH_EDGE),\n scroll: () =>\n Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll()),\n taggedElement: () => getMaxElement(WIDTH_EDGE),\n}\n\nfunction sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n sendMsg(height, width, triggerEvent, msg)\n }\n\n function isSizeChangeDetected() {\n const checkTolerance = (a, b) => !(Math.abs(a - b) <= tolerance)\n\n // currentHeight = Math.ceil(\n // undefined === customHeight ? getHeight[heightCalcMode]() : customHeight,\n // )\n\n // currentWidth = Math.ceil(\n // undefined === customWidth ? getWidth[widthCalcMode]() : customWidth,\n // )\n\n currentHeight =\n undefined === customHeight ? getHeight[heightCalcMode]() : customHeight\n currentWidth =\n undefined === customWidth ? getWidth[widthCalcMode]() : customWidth\n\n return (\n (calculateHeight && checkTolerance(height, currentHeight)) ||\n (calculateWidth && checkTolerance(width, currentWidth))\n )\n }\n\n const isForceResizableEvent = () => !(triggerEvent in { init: 1, size: 1 })\n\n const isForceResizableCalcMode = () =>\n (calculateHeight && heightCalcMode in resetRequiredMethods) ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n }\n }\n\n let currentHeight\n let currentWidth\n\n if (isSizeChangeDetected() || triggerEvent === 'init') {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n}\n\nfunction sendSize(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n if (document.hidden) {\n // Currently only correctly supported in firefox\n // This is checked again on the parent page\n log('Page hidden - Ignored resize request')\n return\n }\n\n if (!(triggerEvent in nonLoggableTriggerEvents)) {\n log(`Trigger event: ${triggerEventDesc}`)\n }\n\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth, msg)\n}\n\nfunction lockTrigger() {\n if (triggerLocked) return\n\n triggerLocked = true\n log('Trigger event lock on')\n\n requestAnimationFrame(() => {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n })\n}\n\nfunction triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n}\n\nfunction resetIFrame(triggerEventDesc) {\n const hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log(`Reset trigger event: ${triggerEventDesc}`)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n}\n\nfunction sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n if (mode < -1) return\n\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n return\n }\n\n log(`Message targetOrigin: ${targetOrigin}`)\n }\n\n function sendToParent() {\n const size = `${height + (offsetHeight || 0)}:${width + (offsetWidth || 0)}`\n const message = `${myID}:${size}:${triggerEvent}${undefined === msg ? '' : `:${msg}`}`\n\n log(\n `Sending message to host page (${message}) via ${sameDomain ? 'sameDomain' : 'postMessage'}`,\n )\n\n if (sameDomain) {\n window.parent.iframeParentListener(msgID + message)\n return\n }\n\n target.postMessage(msgID + message, targetOrigin)\n }\n\n setTargetOrigin()\n sendToParent()\n}\n\nfunction receiver(event) {\n const processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(() => {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset() {\n if (initLock) {\n log('Page reset ignored by init')\n return\n }\n log('Page size reset by host page')\n triggerReset('resetPage')\n },\n\n resize() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor() {\n inPageLinks.findTarget(getData())\n },\n\n inPageLink() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo() {\n const msgBody = getData()\n log(`PageInfo received from parent: ${msgBody}`)\n if (onPageInfo) {\n onPageInfo(JSON.parse(msgBody))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'pageInfoStop')\n }\n log(' --')\n },\n\n parentInfo() {\n const msgBody = getData()\n log(`ParentInfo received from parent: ${msgBody}`)\n if (onParentInfo) {\n onParentInfo(Object.freeze(JSON.parse(msgBody)))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'parentInfoStop')\n }\n log(' --')\n },\n\n message() {\n const msgBody = getData()\n log(`onMessage called from parent: ${msgBody}`)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n },\n }\n\n const isMessageForUs = () => msgID === `${event.data}`.slice(0, msgIdLen)\n\n const getMessageType = () => event.data.split(']')[1].split(':')[0]\n\n const getData = () => event.data.slice(event.data.indexOf(':') + 1)\n\n const isMiddleTier = () =>\n 'iframeResize' in window ||\n (window.jQuery !== undefined && '' in window.jQuery.prototype)\n\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n const isInitMsg = () => event.data.split(':')[2] in { true: 1, false: 1 }\n\n function callFromParent() {\n const messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n return\n }\n\n if (!isMiddleTier() && !isInitMsg()) {\n warn(`Unexpected message (${event.data})`)\n }\n }\n\n function processMessage() {\n if (firstRun === false) {\n callFromParent()\n return\n }\n\n if (isInitMsg()) {\n processRequestFromParent.init()\n return\n }\n\n log(\n `Ignored message of type \"${getMessageType()}\". Received before initialization.`,\n )\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n}\n\n// Normally the parent kicks things off when it detects the iFrame has loaded.\n// If this script is async-loaded, then tell parent page to retry init.\nfunction chkLateLoaded() {\n if (document.readyState !== 'loading') {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n}\n\n// Don't run for server side render\nif (typeof window !== 'undefined') {\n window.iframeChildListener = (data) => receiver({ data, sameDomain: true })\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n}\n\n/* TEST CODE START */\nfunction mockMsgListener(msgObject) {\n receiver(msgObject)\n return win\n}\n\ntry {\n // eslint-disable-next-line no-restricted-globals\n if (top?.document?.getElementById('banner')) {\n win = {}\n\n // Create test hooks\n window.mockMsgListener = mockMsgListener\n\n removeEventListener(window, 'message', receiver)\n\n define([], () => mockMsgListener)\n }\n} catch (error) {\n // do nothing\n}\n\n/* TEST CODE END */\n","const encode = (s) =>\n s\n .replaceAll('<br>', '\\n')\n .replaceAll('<rb>', '\\u001B[31;1m')\n .replaceAll('</>', '\\u001B[m')\n .replaceAll('<b>', '\\u001B[1m')\n .replaceAll('<i>', '\\u001B[3m')\n .replaceAll('<u>', '\\u001B[4m')\n\nconst remove = (s) => s.replaceAll('<br>', '\\n').replaceAll(/<[/a-z]+>/gi, '')\n\nexport default (formatLogMsg) => (msg) =>\n window.chrome // Only show formatting in Chrome as not supported in other browsers\n ? formatLogMsg(encode(msg))\n : formatLogMsg(remove(msg))\n"],"names":["VERSION","BASE","SIZE_ATTR","OVERFLOW_ATTR","HEIGHT_EDGE","WIDTH_EDGE","addEventListener","el","evt","func","options","removeEventListener","y","Object","fromEntries","map","l","p","Math","max","getModeData","replaceAll","String","fromCodePoint","codePointAt","once","fn","done","undefined","Reflect","apply","this","arguments","id","x","side","onChange","root","document","documentElement","rootMargin","threshold","overflowedElements","observedElements","WeakSet","observer","IntersectionObserver","entries","forEach","entry","target","toggleAttribute","boundingClientRect","rootBounds","isTarget","querySelectorAll","overflowObserver","nodeList","has","observe","add","isOverflowed","length","checkVisibilityOptions","contentVisibilityAuto","opacityProperty","visibilityProperty","customCalcMethods","height","warn","getHeight","auto","width","getWidth","deprecatedResizeMethods","bodyOffset","bodyScroll","offset","documentElementOffset","documentElementScroll","documentElementBoundingClientRect","min","grow","lowestElement","eventCancelTimer","eventHandlersByName","hasCheckVisibility","window","heightCalcModeDefault","msgID","msgIdLen","resetRequiredMethods","resizeObserveTargets","widthCalcModeDefault","offsetHeight","offsetWidth","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateHeight","calculateWidth","calcElements","firstRun","hasTags","heightCalcMode","initLock","initMsg","inPageLinks","isInit","logging","mode","mouseEvents","myID","observeOverflow","resizeFrom","resizeObserver","sameDomain","sizeSelector","parent","targetOriginDefault","tolerance","triggerLocked","version","widthCalcMode","win","onMessage","onReady","onPageInfo","onParentInfo","isDef","value","usedTags","addUsedTag","getElementName","nodeName","toUpperCase","name","className","formatLogMsg","msg","join","info","console","advise","chrome","formatAdvise","adviser","init","strBool","str","data","slice","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","JSON","stringify","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollBy","scrollTo","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","customHeight","customWidth","sendSize","size","parentIFrame","setupPublicMethods","sendMouse","e","type","screenY","screenX","addMouseListener","setupMouseEvents","getPagePosition","scrollLeft","scrollTop","getElementPosition","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","location","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","href","bindAnchors","setupLink","linkClicked","preventDefault","getAttribute","bindLocationHash","initCheck","setTimeout","enableInPageLinks","setupInPageLinks","body","setBodyStyle","includes","chkCSS","setMargin","clearFix","createElement","style","clear","display","append","injectClearFixIntoBodyElement","setAutoHeight","setProperty","stopInfiniteResizingOfIFrame","applySizeSelector","title","taggedElements","getAllElements","dataset","iframeSize","manageTriggerEvent","eventName","handleEvent","eventType","passive","remove","method","checkCalcMode","calcModeDefault","modes","mutationObserved","mutations","addResizeObservers","createMutationObserver","MutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","setupBodyMutationObserver","ResizeObserver","resizeObserved","createResizeObservers","dispatchResized","Array","isArray","checkPositionType","element","getComputedStyle","position","getAllNonStaticElements","filter","resizeSet","setupResizeObservers","flatMap","mutation","lastEl","perfWarned","lastTimer","getMaxElement","Side","string","charAt","elVal","maxEl","maxVal","bottom","timer","performance","now","targetElements","len","checkVisibility","parseFloat","getPropertyValue","toPrecision","time","usedEl","logMsg","maxChars","outer","outerHTML","toString","elementSnippet","getAllMeasurements","dimension","prevScrollSize","prevBoundingSize","getAutoSize","getDimension","returnBoundingClientRect","boundingSize","scrollSize","hasOverflow","isHeight","ceilBoundingSize","ceil","floorBoundingSize","floor","getOffset","getAdjustedScroll","enabled","taggedElement","marginTop","marginBottom","scrollHeight","custom","scrollWidth","right","rightMostElement","scroll","sizeIFrame","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolerance","a","b","abs","isSizeChangeDetected","lockTrigger","hidden","requestAnimationFrame","triggerReset","hcm","message","iframeParentListener","postMessage","sendToParent","receiver","event","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","parentInfo","getMessageType","indexOf","isMiddleTier","jQuery","isInitMsg","true","false","messageType","callFromParent","chkLateLoaded","readyState","iframeChildListener"],"mappings":";;;;;;;;;;;;;;;;;;;aAAO,MAAMA,EAAU,eAEVC,EAAO,GAGPC,EAAY,mBACZC,EAAgB,uBAEhBC,EAAc,SACdC,EAAa,QCTbC,EAAmB,CAACC,EAAIC,EAAKC,EAAMC,IAC9CH,EAAGD,iBAAiBE,EAAKC,EAAMC,IAAW,GAE/BC,EAAsB,CAACJ,EAAIC,EAAKC,IAC3CF,EAAGI,oBAAoBH,EAAKC,GAAM,GCkBlCG,EAAI,CACF,yCACA,yCACA,qnBACA,0jBAGEC,OAAOC,YACT,CACE,cACA,cACA,cACA,aACA,aACA,eACAC,KAAI,CAACC,EAAGC,IAAM,CAACD,EAAGE,KAAKC,IAAI,EAAGF,EAAI,OAEjC,MAAMG,EAAeJ,GAvBtB,CAACA,GACHA,EAAEK,WAAW,aAAcL,GACzBM,OAAOC,eACJP,GAAK,IAAM,GAAK,OAASA,EAAIA,EAAEQ,YAAY,GAAK,IAAMR,EAAIA,EAAI,MAoBrCC,CAAEL,EAAEI,ICrCzBS,EAAQC,IACnB,IAAIC,GAAO,EAEX,OAAO,WACL,OAAOA,OACHC,GACED,GAAO,EAAOE,QAAQC,MAAMJ,EAAIK,KAAMC,WAC7C,GAGUC,EAAMC,GAAMA,ECTzB,IAAIC,EAAO/B,EAEPgC,EAAWH,EAEf,MAAMvB,EAAU,CACd2B,KAAMC,SAASC,gBACfC,WAAY,MACZC,UAAW,GAGb,IAAIC,EAAqB,GACzB,MAAMC,EAAmB,IAAIC,QAevBC,EAAW,IAAIC,sBATHC,IAChB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K8M,MAAMD,GAEtB,GAKGG,EAAiB,IAAMT,EAAM/O,KAAKE,MAAM,KAAK,GAAGA,MAAM,KAAK,GAE3DgP,EAAU,IAAMH,EAAM/O,KAAKC,MAAM8O,EAAM/O,KAAKyP,QAAQ,KAAO,GAE3DC,EAAe,IACnB,iBAAkB5T,aACC3D,IAAlB2D,OAAO6T,QAAwB,KAAM7T,OAAO6T,OAAOlP,UAIhDmP,EAAY,IAAMb,EAAM/O,KAAKE,MAAM,KAAK,IAAM,CAAE2P,KAAM,EAAGC,MAAO,GAZzC9T,IAAU,GAAG+S,EAAM/O,OAAOC,MAAM,EAAGhE,MA4B7C,IAAbe,EAKA4S,KACFZ,EAAyBnP,OApB7B,WACE,MAAMkQ,EAAcP,IAEhBO,KAAef,EACjBA,EAAyBe,KAItBL,KAAmBE,KACtBhV,GAAK,uBAAuBmU,EAAM/O,QAErC,CAIGgQ,GAiBN,CAIA,SAASC,KACqB,YAAxBpX,SAASqX,YACXpU,OAAOkC,OAAO4Q,YAAY,4BAA6B,IAE3D,CAGsB,oBAAX9S,SACTA,OAAOqU,oBAAuBnQ,GAAS8O,GAAS,CAAE9O,OAAMlC,YAAY,IACpEjH,EAAiBiF,OAAQ,UAAWgT,IACpCjY,EAAiBiF,OAAQ,mBAAoBmU,IAC7CA"}
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.1
|
|
4
|
+
* @module iframe-resizer/child 5.2.0-beta.1 (esm) - 2024-07-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
const e="5.1.3",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(se("Custom height calculation function not defined"),De.auto()),width:()=>(se("Custom width calculation function not defined"),He.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{se("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e;function re(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ae(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const le=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ce=(...e)=>console?.info(le(...e)),se=(...e)=>console?.warn(le(...e)),ue=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(le)(...e)),de=e=>ue(e);function me(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);fe("margin",function(e,t){t.includes("-")&&(se(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),fe("background",S),fe("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),pe(),L<0?de(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&de(a(3)),function(){if(!Y||""===Y||"false"===Y)return void ue("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");Y!==e&&ue(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),be(),we(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&ue("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),ge(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,ze()):!1===e&&!0===z&&(z=!1,ye("remove"),U?.disconnect(),E?.disconnect()),Ze(0,0,"autoResize",JSON.stringify(z)),z),close(){Ze(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Ze(0,0,"pageInfo"),void ue("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Ze(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Ze(0,0,"parentInfo"),()=>{oe=null,Ze(0,0,"parentInfoStop")}},getParentProperties(e){ue("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Je()},scrollBy(e,t){Ze(t,e,"scrollBy")},scrollTo(e,t){Ze(t,e,"scrollTo")},scrollToOffset(e,t){Ze(t,e,"scrollToOffset")},sendMessage(e,t){Ze(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,be()},setWidthCalculationMethod(e){K=e,we()},setTargetOrigin(e){Z=e},resize(e,t){Ue("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){ue("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Ze(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),ze(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Ze(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Ze(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?ue("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),Ue("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Ze(0,0,"title",document.title),te(),B=!1}function fe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function pe(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function he(e){({add(t){function n(){Ue(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ye(e){he({method:e,eventType:"After Print",eventName:"afterprint"}),he({method:e,eventType:"Before Print",eventName:"beforeprint"}),he({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function ge(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:xe(document)()}function ve(e,t,n,o){return t!==e&&(e in n||(se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&ue(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function be(){k=ve(k,f,De,"height")}function we(){K=ve(K,v,He,"width")}function ze(){!0===z&&(ye("add"),E=function(){function e(e){e.forEach(Me),pe(),ge()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver($e),Oe(window.document))}let Se;function $e(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Se=()=>Ue("resizeObserver",`Resize Observed: ${re(t)}`),setTimeout((()=>{Se&&Se(),Se=void 0}),0)}const je=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ee=()=>[...xe(document)()].filter(je);function Pe(e){e&&U.observe(e)}function Oe(e){[...Ee(),...g.flatMap((t=>e.querySelector(t)))].forEach(Pe)}function Me(e){"childList"===e.type&&Oe(e.target)}const Ae=new WeakSet;Ae.add(document.documentElement),Ae.add(document.body);let Ce=4,Te=4;function Ie(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,Ae.has(s)||(Ae.add(s),ce(`\nHeight calculated from: ${re(s)} (${ae(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${re(r)} (${ae(r,100)})`;return c<4||i<99||T||B||Ce<c&&Ce<Te&&(Ce=1.2*c,ue(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Te=c,a}const ke=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Ne=!1;function Re({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Ne)return Ne=!0,n.taggedElement();const r=o?"bottom":"right";return ue(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const Be={height:0,width:0},qe={height:0,width:0};function Le(e,t){function n(){return qe[i]=r,Be[i]=c,r}const o=e===De,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===qe[i]&&0===Be[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===qe[i]&&c===Be[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==qe[i]&&c<=Be[i]:return n();case!o:return t?e.taggedElement():Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<qe[i]:case c===l||c===a:case r>c:return n();case!t:return Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const De={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>Le(De,!1),autoOverflow:()=>Le(De,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...ke(De)),min:()=>Math.min(...ke(De)),grow:()=>De.max(),lowestElement:()=>Ie("bottom"),taggedElement:()=>Ie("bottom")},He={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>Le(He,!1),autoOverflow:()=>Le(He,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...ke(He)),min:()=>Math.min(...ke(He)),rightMostElement:()=>Ie("right"),scroll:()=>Math.max(He.bodyScroll(),He.documentElementScroll()),taggedElement:()=>Ie("right")};function We(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?De[k]():n,a=void 0===o?He[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Je():(Fe(),I=r,G=a,Ze(I,G,e,i))}function Ue(e,t,n,o,i){document.hidden||We(e,0,n,o,i)}function Fe(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ve(e){I=De[k](),G=He[K](),Ze(I,G,e)}function Je(e){const t=k;k=f,Fe(),Ve("reset"),k=t}function Ze(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Qe(e){const t={init:function(){N=e.data,J=e.source,me(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ve("resetPage")},resize(){Ue("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Ze(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Ze(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||se(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Qe({data:e,sameDomain:!0}),o(window,"message",Qe),o(window,"readystatechange",Xe),Xe());
|
|
20
|
+
const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut());
|
|
21
|
+
//# sourceMappingURL=index.esm.js.map
|
package/index.esm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../packages/common/consts.js","../../packages/common/listeners.js","../../packages/common/mode.js","../../packages/common/utils.js","../../packages/child/overflow.js","../../packages/child/index.js","../../packages/common/format-advise.js"],"sourcesContent":["export const VERSION = '[VI]{version}[/VI]'\n\nexport const BASE = 10\nexport const SINGLE = 1\n\nexport const SIZE_ATTR = 'data-iframe-size'\nexport const OVERFLOW_ATTR = 'data-iframe-overflow'\n\nexport const HEIGHT_EDGE = 'bottom'\nexport const WIDTH_EDGE = 'right'\n\nexport const msgHeader = 'message'\nexport const msgHeaderLen = msgHeader.length\nexport const msgId = '[iFrameSizer]' // Must match iframe msg ID\nexport const msgIdLen = msgId.length\nexport const resetRequiredMethods = Object.freeze({\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n})\n","export const addEventListener = (el, evt, func, options) =>\n el.addEventListener(evt, func, options || false)\n\nexport const removeEventListener = (el, evt, func) =>\n el.removeEventListener(evt, func, false)\n","const l = (l) => {\n if (!l) return ''\n let p = -559038744,\n y = 1103547984\n for (let z, t = 0; t < l.length; t++)\n (z = l.codePointAt(t)),\n (p = Math.imul(p ^ z, 2246822519)),\n (y = Math.imul(y ^ z, 3266489917))\n return (\n (p ^= Math.imul(p ^ (y >>> 15), 1935289751)),\n (y ^= Math.imul(y ^ (p >>> 15), 3405138345)),\n (p ^= y >>> 16),\n (y ^= p >>> 16),\n (2097152 * (y >>> 0) + (p >>> 11)).toString(36)\n )\n },\n p = (l) =>\n l.replaceAll(/[A-Za-z]/g, (l) =>\n String.fromCodePoint(\n (l <= 'Z' ? 90 : 122) >= (l = l.codePointAt(0) + 19) ? l : l - 26,\n ),\n ),\n y = [\n '<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>',\n '<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>',\n '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</>',\n '<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</>.',\n ],\n z = ['NWSc3', 'zvsv', 'wyv', 'ibzpulzz', 'vlt'],\n t = Object.fromEntries(\n [\n '2cgs7fdf4xb',\n '1c9ctcccr4z',\n '1q2pc4eebgb',\n 'ueokt0969w',\n 'w2zxchhgqz',\n '1umuxblj2e5',\n ].map((l, p) => [l, Math.max(0, p - 1)]),\n )\nexport const getModeData = (l) => p(y[l])\nexport const getModeLabel = (l) => p(z[l])\nexport default (y) => {\n const z = y[p('spjluzl')]\n if (!z) return -1\n const u = z.split('-')\n let v = (function (y = '') {\n let z = -2\n const u = l(p(y))\n return u in t && (z = t[u]), z\n })(u[0])\n return 0 === v || ((p) => p[2] === l(p[0] + p[1]))(u) || (v = -2), v\n}\n","export const isNumber = (value) => !Number.isNaN(value)\n\nexport const once = (fn) => {\n let done = false\n\n return function () {\n return done\n ? undefined\n : ((done = true), Reflect.apply(fn, this, arguments))\n }\n}\n\nexport const id = (x) => x\n","import { HEIGHT_EDGE, OVERFLOW_ATTR } from '../common/consts'\nimport { id } from '../common/utils'\n\nlet side = HEIGHT_EDGE\n\nlet onChange = id\n\nconst options = {\n root: document.documentElement,\n rootMargin: '0px',\n threshold: 1,\n}\n\nlet overflowedElements = []\nconst observedElements = new WeakSet()\n\nconst isTarget = (entry) =>\n entry.boundingClientRect[side] === 0 ||\n entry.boundingClientRect[side] > entry.rootBounds[side]\n\nconst callback = (entries) => {\n entries.forEach((entry) => {\n entry.target.toggleAttribute(OVERFLOW_ATTR, isTarget(entry))\n })\n\n overflowedElements = document.querySelectorAll(`[${OVERFLOW_ATTR}]`)\n onChange()\n}\n\nconst observer = new IntersectionObserver(callback, options)\n\nexport const overflowObserver = (options) => {\n side = options.side\n onChange = options.onChange\n\n return (nodeList) =>\n nodeList.forEach((el) => {\n if (observedElements.has(el)) return\n observer.observe(el)\n observedElements.add(el)\n })\n}\n\nexport const isOverflowed = () => overflowedElements.length > 0\n\nexport const getOverflowedElements = () => overflowedElements\n","import {\n BASE,\n HEIGHT_EDGE,\n SINGLE,\n SIZE_ATTR,\n VERSION,\n WIDTH_EDGE,\n} from '../common/consts'\nimport formatAdvise from '../common/format-advise'\nimport { addEventListener, removeEventListener } from '../common/listeners'\nimport { getModeData } from '../common/mode'\nimport { id, once } from '../common/utils'\nimport {\n getOverflowedElements,\n isOverflowed,\n overflowObserver,\n} from './overflow'\n\nconst PERF_TIME_LIMIT = 4\nconst PERF_MIN_ELEMENTS = 99\n\nconst checkVisibilityOptions = {\n contentVisibilityAuto: true,\n opacityProperty: true,\n visibilityProperty: true,\n}\nconst customCalcMethods = {\n height: () => {\n warn('Custom height calculation function not defined')\n return getHeight.auto()\n },\n width: () => {\n warn('Custom width calculation function not defined')\n return getWidth.auto()\n },\n}\nconst deprecatedResizeMethods = {\n bodyOffset: 1,\n bodyScroll: 1,\n offset: 1,\n documentElementOffset: 1,\n documentElementScroll: 1,\n documentElementBoundingClientRect: 1,\n max: 1,\n min: 1,\n grow: 1,\n lowestElement: 1,\n}\nconst eventCancelTimer = 128\nconst eventHandlersByName = {}\nconst hasCheckVisibility = 'checkVisibility' in window\nconst heightCalcModeDefault = 'auto'\n// const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\nconst nonLoggableTriggerEvents = { reset: 1, resetPage: 1, init: 1 }\nconst msgID = '[iFrameSizer]' // Must match host page msg ID\nconst msgIdLen = msgID.length\nconst resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n}\nconst resizeObserveTargets = ['body']\nconst widthCalcModeDefault = 'scroll'\n\nlet autoResize = true\nlet bodyBackground = ''\nlet bodyMargin = 0\nlet bodyMarginStr = ''\nlet bodyObserver = null\nlet bodyPadding = ''\nlet calculateHeight = true\nlet calculateWidth = false\nlet calcElements = null\nlet firstRun = true\nlet hasTags = false\nlet height = 1\nlet heightCalcMode = heightCalcModeDefault // only applys if not provided by host page (V1 compatibility)\nlet initLock = true\nlet initMsg = ''\nlet inPageLinks = {}\nlet isInit = true\nlet logging = false\nlet licenseKey = '' // eslint-disable-line no-unused-vars\nlet mode = 0\nlet mouseEvents = false\nlet myID = ''\nlet offsetHeight\nlet offsetWidth\nlet observeOverflow = id\nlet resizeFrom = 'child'\nlet resizeObserver = null\nlet sameDomain = false\nlet sizeSelector = ''\nlet target = window.parent\nlet targetOriginDefault = '*'\nlet tolerance = 0\nlet triggerLocked = false\nlet version = ''\nlet width = 1\nlet widthCalcMode = widthCalcModeDefault\nlet win = window\n\nlet onMessage = () => {\n warn('onMessage function not defined')\n}\nlet onReady = () => {}\nlet onPageInfo = null\nlet onParentInfo = null\n\nconst capitalizeFirstLetter = (string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nconst isDef = (value) => `${value}` !== '' && value !== undefined\n\nconst usedTags = new WeakSet()\nconst addUsedTag = (el) => typeof el === 'object' && usedTags.add(el)\n\nfunction getElementName(el) {\n switch (true) {\n case !isDef(el):\n return ''\n\n case isDef(el.id):\n return `${el.nodeName.toUpperCase()}#${el.id}`\n\n case isDef(el.name):\n return `${el.nodeName.toUpperCase()} (${el.name})`\n\n default:\n return (\n el.nodeName.toUpperCase() +\n (isDef(el.className) ? `.${el.className}` : '')\n )\n }\n}\n\nfunction elementSnippet(el, maxChars = 30) {\n const outer = el?.outerHTML?.toString()\n\n if (!outer) return el\n\n return outer.length < maxChars\n ? outer\n : `${outer.slice(0, maxChars).replaceAll('\\n', ' ')}...`\n}\n\n// TODO: remove .join(' '), requires major test updates\nconst formatLogMsg = (...msg) => [`[iframe-resizer][${myID}]`, ...msg].join(' ')\n\nconst log = (...msg) =>\n // eslint-disable-next-line no-console\n logging && console?.log(formatLogMsg(...msg))\n\nconst info = (...msg) =>\n // eslint-disable-next-line no-console\n console?.info(`[iframe-resizer][${myID}]`, ...msg)\n\nconst warn = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatLogMsg(...msg))\n\nconst advise = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatAdvise(formatLogMsg)(...msg))\n\nconst adviser = (msg) => advise(msg)\n\nfunction init() {\n readDataFromParent()\n readDataFromPage()\n\n log(`Initialising iFrame v${VERSION} (${window.location.href})`)\n\n checkCrossDomain()\n checkMode()\n checkVersion()\n checkHeightMode()\n checkWidthMode()\n checkDeprecatedAttrs()\n\n setupObserveOverflow()\n setupCalcElements()\n setupPublicMethods()\n setupMouseEvents()\n inPageLinks = setupInPageLinks()\n\n addUsedTag(document.documentElement)\n addUsedTag(document.body)\n\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n\n injectClearFixIntoBodyElement()\n stopInfiniteResizingOfIFrame()\n applySizeSelector()\n}\n\n// Continue init after intersection observer has been setup\nconst initContinue = () => {\n sendSize('init', 'Init message from host page', undefined, undefined, VERSION)\n sendTitle()\n initEventListeners()\n onReady()\n isInit = false\n log('Initialization complete')\n log('---')\n}\n\nfunction setupObserveOverflow() {\n if (calculateHeight === calculateWidth) return\n observeOverflow = overflowObserver({\n onChange: once(initContinue),\n side: calculateHeight ? HEIGHT_EDGE : WIDTH_EDGE,\n })\n}\n\nfunction setupCalcElements() {\n const taggedElements = document.querySelectorAll(`[${SIZE_ATTR}]`)\n hasTags = taggedElements.length > 0\n log(`Tagged elements found: ${hasTags}`)\n calcElements = hasTags ? taggedElements : getAllElements(document)()\n if (hasTags) setTimeout(initContinue)\n else observeOverflow(calcElements)\n}\n\nfunction sendTitle() {\n if (document.title && document.title !== '') {\n sendMsg(0, 0, 'title', document.title)\n }\n}\n\nfunction checkVersion() {\n if (!version || version === '' || version === 'false') {\n advise(\n `<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n`,\n )\n return\n }\n\n if (version !== VERSION) {\n advise(\n `<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${version} - Child page: ${VERSION}.\n`,\n )\n }\n}\n\nfunction checkCrossDomain() {\n try {\n sameDomain = 'iframeParentListener' in window.parent\n } catch (error) {\n log('Cross domain iframe detected.')\n }\n}\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nfunction readDataFromParent() {\n const strBool = (str) => str === 'true'\n const data = initMsg.slice(msgIdLen).split(':')\n\n myID = data[0] // eslint-disable-line prefer-destructuring\n bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility\n calculateWidth = undefined === data[2] ? calculateWidth : strBool(data[2])\n logging = undefined === data[3] ? logging : strBool(data[3])\n // data[4] no longer used (was intervalTimer)\n autoResize = undefined === data[6] ? autoResize : strBool(data[6])\n bodyMarginStr = data[7] // eslint-disable-line prefer-destructuring\n heightCalcMode = undefined === data[8] ? heightCalcMode : data[8]\n bodyBackground = data[9] // eslint-disable-line prefer-destructuring\n bodyPadding = data[10] // eslint-disable-line prefer-destructuring\n tolerance = undefined === data[11] ? tolerance : Number(data[11])\n inPageLinks.enable = undefined === data[12] ? false : strBool(data[12])\n resizeFrom = undefined === data[13] ? resizeFrom : data[13]\n widthCalcMode = undefined === data[14] ? widthCalcMode : data[14]\n mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15])\n offsetHeight = undefined === data[16] ? offsetHeight : Number(data[16])\n offsetWidth = undefined === data[17] ? offsetWidth : Number(data[17])\n calculateHeight = undefined === data[18] ? calculateHeight : strBool(data[18])\n licenseKey = data[19] // eslint-disable-line prefer-destructuring\n version = data[20] || version\n mode = undefined === data[21] ? mode : Number(data[21])\n // sizeSelector = data[22] || sizeSelector\n}\n\nfunction readDataFromPage() {\n function readData() {\n const data = window.iframeResizer || window.iFrameResizer\n\n log(`Reading data from page: ${JSON.stringify(data)}`)\n\n onMessage = data?.onMessage || onMessage\n onReady = data?.onReady || onReady\n\n if (typeof data?.offset === 'number') {\n if (calculateHeight) offsetHeight = data?.offset\n if (calculateWidth) offsetWidth = data?.offset\n }\n\n if (Object.prototype.hasOwnProperty.call(data, 'sizeSelector')) {\n sizeSelector = data.sizeSelector\n }\n\n targetOriginDefault = data?.targetOrigin || targetOriginDefault\n heightCalcMode = data?.heightCalculationMethod || heightCalcMode\n widthCalcMode = data?.widthCalculationMethod || widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if (typeof calcMode === 'function') {\n log(`Setup custom ${calcFunc}CalcMethod`)\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (mode === 1) return\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log(`TargetOrigin for parent set to: ${targetOriginDefault}`)\n}\n\nfunction chkCSS(attr, value) {\n if (value.includes('-')) {\n warn(`Negative CSS value ignored for ${attr}`)\n value = ''\n }\n\n return value\n}\n\nfunction setBodyStyle(attr, value) {\n if (undefined !== value && value !== '' && value !== 'null') {\n document.body.style.setProperty(attr, value)\n log(`Body ${attr} set to \"${value}\"`)\n }\n}\n\nfunction applySizeSelector() {\n if (sizeSelector === '') return\n\n log(`Applying sizeSelector: ${sizeSelector}`)\n\n document.querySelectorAll(sizeSelector).forEach((el) => {\n log(`Applying data-iframe-size to: ${getElementName(el)}`)\n el.dataset.iframeSize = true\n })\n}\n\nfunction setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = `${bodyMargin}px`\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n}\n\nfunction stopInfiniteResizingOfIFrame() {\n const setAutoHeight = (el) =>\n el.style.setProperty('height', 'auto', 'important')\n\n setAutoHeight(document.documentElement)\n setAutoHeight(document.body)\n\n log('HTML & body height set to \"auto !important\"')\n}\n\nfunction manageTriggerEvent(options) {\n const listener = {\n add(eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove(eventName) {\n const handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n },\n }\n\n listener[options.method](options.eventName)\n\n log(\n `${capitalizeFirstLetter(options.method)} event listener: ${\n options.eventType\n }`,\n )\n}\n\nfunction manageEventListeners(method) {\n manageTriggerEvent({\n method,\n eventType: 'After Print',\n eventName: 'afterprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Before Print',\n eventName: 'beforeprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange',\n })\n\n // manageTriggerEvent({\n // method: method,\n // eventType: 'Orientation Change',\n // eventName: 'orientationchange'\n // })\n}\n\nfunction checkDeprecatedAttrs() {\n let found = false\n\n const checkAttrs = (attr) =>\n document.querySelectorAll(`[${attr}]`).forEach((el) => {\n found = true\n el.removeAttribute(attr)\n el.toggleAttribute(SIZE_ATTR, true)\n })\n\n checkAttrs('data-iframe-height')\n checkAttrs('data-iframe-width')\n\n if (found) {\n advise(\n `<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`,\n )\n }\n}\n\nfunction checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(`${calcMode} is not a valid option for ${type}CalculationMethod.`)\n calcMode = calcModeDefault\n }\n if (calcMode in deprecatedResizeMethods) {\n advise(\n `<rb>Deprecated ${type}CalculationMethod (${calcMode})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${type} calculation method. It is recommended that you remove this option.`,\n )\n }\n log(`${type} calculation method set to \"${calcMode}\"`)\n }\n\n return calcMode\n}\n\nfunction checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height',\n )\n}\n\nfunction checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width',\n )\n}\n\nfunction checkMode() {\n if (mode < 0) return adviser(`${getModeData(mode + 2)}${getModeData(2)}`)\n if (version.codePointAt(0) > 4) return mode\n if (mode < 2) return adviser(getModeData(3))\n return mode\n}\n\nfunction initEventListeners() {\n if (autoResize !== true) {\n log('Auto Resize disabled')\n return\n }\n\n manageEventListeners('add')\n setupMutationObserver()\n setupResizeObserver()\n}\n\nfunction stopEventListeners() {\n manageEventListeners('remove')\n resizeObserver?.disconnect()\n bodyObserver?.disconnect()\n}\n\nfunction injectClearFixIntoBodyElement() {\n const clearFix = document.createElement('div')\n\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.append(clearFix)\n}\n\nfunction setupInPageLinks() {\n const getPagePosition = () => ({\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop,\n })\n\n function getElementPosition(el) {\n const elPosition = el.getBoundingClientRect()\n const pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, BASE) + parseInt(pagePosition.x, BASE),\n y: parseInt(elPosition.top, BASE) + parseInt(pagePosition.y, BASE),\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n const jumpPosition = getElementPosition(target)\n\n log(\n `Moving to in page link (#${hash}) at x: ${jumpPosition.x}y: ${jumpPosition.y}`,\n )\n\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n const hash = location.split('#')[1] || location // Remove # if present\n const hashData = decodeURIComponent(hash)\n const target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target !== undefined) {\n jumpToTarget(target)\n return\n }\n\n log(`In page link (#${hash}) not found in iFrame, so sending to parent`)\n sendMsg(0, 0, 'inPageLink', `#${hash}`)\n }\n\n function checkLocationHash() {\n const { hash, href } = window.location\n\n if (hash !== '' && hash !== '#') {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n findTarget(this.getAttribute('href'))\n }\n\n if (el.getAttribute('href') !== '#') {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n document.querySelectorAll('a[href^=\"#\"]').forEach(setupLink)\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n }\n\n if (inPageLinks.enable) {\n if (mode === 1) {\n advise(\n `In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details.`,\n )\n } else {\n enableInPageLinks()\n }\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget,\n }\n}\n\nfunction setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, `${e.screenY}:${e.screenX}`)\n }\n\n function addMouseListener(evt, name) {\n log(`Add event listener: ${name}`)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n}\n\nfunction setupPublicMethods() {\n if (mode === 1) return\n\n win.parentIframe = Object.freeze({\n autoResize: (resize) => {\n if (resize === true && autoResize === false) {\n autoResize = true\n initEventListeners()\n } else if (resize === false && autoResize === true) {\n autoResize = false\n stopEventListeners()\n }\n\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n\n return autoResize\n },\n\n close() {\n sendMsg(0, 0, 'close')\n },\n\n getId: () => myID,\n\n getPageInfo(callback) {\n if (typeof callback === 'function') {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n return\n }\n\n onPageInfo = null\n sendMsg(0, 0, 'pageInfoStop')\n },\n\n getParentProps(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(\n 'parentIFrame.getParentProps(callback) callback not a function',\n )\n }\n\n onParentInfo = callback\n sendMsg(0, 0, 'parentInfo')\n\n return () => {\n onParentInfo = null\n sendMsg(0, 0, 'parentInfoStop')\n }\n },\n\n getParentProperties(callback) {\n advise(\n `<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.getParentProps(callback)\n },\n\n moveToAnchor(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollBy(x, y) {\n sendMsg(y, x, 'scrollBy') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollTo(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod(heightCalculationMethod) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod(widthCalculationMethod) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin(targetOrigin) {\n log(`Set targetOrigin: ${targetOrigin}`)\n targetOriginDefault = targetOrigin\n },\n\n resize(customHeight, customWidth) {\n const valString = `${customHeight || ''}${customWidth ? `,${customWidth}` : ''}`\n\n sendSize(\n 'size',\n `parentIFrame.size(${valString})`,\n customHeight,\n customWidth,\n )\n },\n\n size(customHeight, customWidth) {\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.resize(customHeight, customWidth)\n },\n })\n\n win.parentIFrame = win.parentIframe\n}\n\nlet dispatchResized\n\nfunction resizeObserved(entries) {\n if (!Array.isArray(entries) || entries.length === 0) return\n\n const el = entries[0].target\n\n dispatchResized = () =>\n sendSize('resizeObserver', `Resize Observed: ${getElementName(el)}`)\n\n // Throttle event to once per current call stack (Safari issue)\n setTimeout(() => {\n if (dispatchResized) dispatchResized()\n dispatchResized = undefined\n }, 0)\n}\n\nconst checkPositionType = (element) => {\n const style = getComputedStyle(element)\n return style?.position !== '' && style?.position !== 'static'\n}\n\nconst getAllNonStaticElements = () =>\n [...getAllElements(document)()].filter(checkPositionType)\n\nconst resizeSet = new WeakSet()\n\nfunction setupResizeObservers(el) {\n if (!el) return\n if (resizeSet.has(el)) return\n resizeObserver.observe(el)\n resizeSet.add(el)\n log(`Attached resizeObserver: ${getElementName(el)}`)\n}\n\nfunction createResizeObservers(el) {\n ;[\n ...getAllNonStaticElements(),\n ...resizeObserveTargets.flatMap((target) => el.querySelector(target)),\n ].forEach(setupResizeObservers)\n}\n\nfunction addResizeObservers(mutation) {\n if (mutation.type === 'childList') {\n createResizeObservers(mutation.target)\n }\n}\n\nfunction setupResizeObserver() {\n resizeObserver = new ResizeObserver(resizeObserved)\n createResizeObservers(window.document)\n}\n\nfunction setupBodyMutationObserver() {\n function mutationObserved(mutations) {\n // Look for injected elements that need ResizeObservers\n mutations.forEach(addResizeObservers)\n\n // apply sizeSelector to new elements\n applySizeSelector()\n\n // Rebuild elements list for size calculation\n setupCalcElements()\n }\n\n function createMutationObserver() {\n const observer = new window.MutationObserver(mutationObserved)\n const target = document.querySelector('body')\n const config = {\n // attributes: true,\n attributes: false,\n attributeOldValue: false,\n // characterData: true,\n characterData: false,\n characterDataOldValue: false,\n childList: true,\n subtree: true,\n }\n\n log('Create <body/> MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n const observer = createMutationObserver()\n\n return {\n disconnect() {\n log('Disconnect MutationObserver')\n observer.disconnect()\n },\n }\n}\n\nfunction setupMutationObserver() {\n bodyObserver = setupBodyMutationObserver()\n}\n\nlet lastEl = null\n\nfunction usedEl(el, Side, time, len) {\n if (usedTags.has(el) || lastEl === el || (hasTags && len <= 1)) return\n // addUsedTag(el)\n lastEl = el\n\n info(\n `\\n${Side} position calculated from:\\n`,\n el,\n `\\nParsed ${len} ${hasTags ? 'tagged' : 'potentially overflowing'} elements in ${time}ms`, // ${getElementName(el)} (${elementSnippet(el)})\n )\n}\n\nlet perfWarned = PERF_TIME_LIMIT\nlet lastTimer = PERF_TIME_LIMIT\n\nfunction getMaxElement(side) {\n const Side = capitalizeFirstLetter(side)\n\n let elVal = 0\n let maxEl = document.documentElement\n let maxVal = hasTags\n ? 0\n : document.documentElement.getBoundingClientRect().bottom\n let timer = performance.now()\n\n const targetElements =\n !hasTags && isOverflowed() ? getOverflowedElements() : calcElements\n\n let len = targetElements.length\n\n targetElements.forEach((element) => {\n if (\n !hasTags &&\n hasCheckVisibility && // Safari missing checkVisibility\n !element.checkVisibility(checkVisibilityOptions)\n ) {\n len -= 1\n return\n }\n\n elVal =\n element.getBoundingClientRect()[side] +\n parseFloat(getComputedStyle(element).getPropertyValue(`margin-${side}`))\n\n if (elVal > maxVal) {\n maxVal = elVal\n maxEl = element\n }\n })\n\n timer = (performance.now() - timer).toPrecision(1)\n\n usedEl(maxEl, Side, timer, len)\n\n const logMsg = `\nParsed ${len} element${len === SINGLE ? '' : 's'} in ${timer}ms\n${Side} ${hasTags ? 'tagged ' : ''}element found at: ${maxVal}px\nPosition calculated from HTML element: ${getElementName(maxEl)} (${elementSnippet(maxEl, 100)})`\n\n if (timer < PERF_TIME_LIMIT || len < PERF_MIN_ELEMENTS || hasTags || isInit) {\n log(logMsg)\n } else if (perfWarned < timer && perfWarned < lastTimer) {\n perfWarned = timer * 1.2\n advise(\n `<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${side} most element on the page.\n${logMsg}`,\n )\n }\n\n lastTimer = timer\n return maxVal\n}\n\nconst getAllMeasurements = (dimension) => [\n dimension.bodyOffset(),\n dimension.bodyScroll(),\n dimension.documentElementOffset(),\n dimension.documentElementScroll(),\n dimension.documentElementBoundingClientRect(),\n]\n\nconst getAllElements = (element) => () =>\n element.querySelectorAll(\n '* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)',\n )\n\nconst prevScrollSize = {\n height: 0,\n width: 0,\n}\n\nconst prevBoundingSize = {\n height: 0,\n width: 0,\n}\n\nconst getAdjustedScroll = (getDimension) =>\n getDimension.documentElementScroll() + Math.max(0, getDimension.getOffset())\n\nfunction getAutoSize(getDimension) {\n function returnBoundingClientRect() {\n prevBoundingSize[dimension] = boundingSize\n prevScrollSize[dimension] = scrollSize\n return boundingSize\n }\n\n const hasOverflow = isOverflowed()\n const isHeight = getDimension === getHeight\n const dimension = isHeight ? 'height' : 'width'\n const boundingSize = getDimension.documentElementBoundingClientRect()\n const ceilBoundingSize = Math.ceil(boundingSize)\n const floorBoundingSize = Math.floor(boundingSize)\n const scrollSize = getAdjustedScroll(getDimension)\n const sizes = `HTML: ${boundingSize} Page: ${scrollSize}`\n\n switch (true) {\n case !getDimension.enabled():\n return scrollSize\n\n case hasTags:\n return getDimension.taggedElement()\n\n case !hasOverflow &&\n prevBoundingSize[dimension] === 0 &&\n prevScrollSize[dimension] === 0:\n log(`Initial page size values: ${sizes}`)\n return returnBoundingClientRect()\n\n case triggerLocked &&\n boundingSize === prevBoundingSize[dimension] &&\n scrollSize === prevScrollSize[dimension]:\n log(`Size unchanged: ${sizes}`)\n return Math.max(boundingSize, scrollSize)\n\n case boundingSize === 0:\n log(`Page is hidden: ${sizes}`)\n return scrollSize\n\n case !hasOverflow &&\n boundingSize !== prevBoundingSize[dimension] &&\n scrollSize <= prevScrollSize[dimension]:\n log(\n `New HTML bounding size: ${sizes}`,\n 'Previous bounding size:',\n prevBoundingSize[dimension],\n )\n return returnBoundingClientRect()\n\n case !isHeight:\n return getDimension.taggedElement()\n\n case !hasOverflow && boundingSize < prevBoundingSize[dimension]:\n log('HTML bounding size decreased:', sizes)\n return returnBoundingClientRect()\n\n case scrollSize === floorBoundingSize || scrollSize === ceilBoundingSize:\n log('HTML bounding size equals page size:', sizes)\n return returnBoundingClientRect()\n\n case boundingSize > scrollSize:\n log(`Page size < HTML bounding size: ${sizes}`)\n return returnBoundingClientRect()\n\n default:\n log(`Content overflowing HTML element: ${sizes}`)\n }\n\n return Math.max(getDimension.taggedElement(), returnBoundingClientRect())\n}\n\nconst getBodyOffset = () => {\n const { body } = document\n const style = getComputedStyle(body)\n\n return (\n body.offsetHeight +\n parseInt(style.marginTop, BASE) +\n parseInt(style.marginBottom, BASE)\n )\n}\n\nconst getHeight = {\n enabled: () => calculateHeight,\n getOffset: () => offsetHeight,\n auto: () => getAutoSize(getHeight),\n bodyOffset: getBodyOffset,\n bodyScroll: () => document.body.scrollHeight,\n offset: () => getHeight.bodyOffset(), // Backwards compatibility\n custom: () => customCalcMethods.height(),\n documentElementOffset: () => document.documentElement.offsetHeight,\n documentElementScroll: () => document.documentElement.scrollHeight,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().bottom,\n max: () => Math.max(...getAllMeasurements(getHeight)),\n min: () => Math.min(...getAllMeasurements(getHeight)),\n grow: () => getHeight.max(),\n lowestElement: () => getMaxElement(HEIGHT_EDGE),\n taggedElement: () => getMaxElement(HEIGHT_EDGE),\n}\n\nconst getWidth = {\n enabled: () => calculateWidth,\n getOffset: () => offsetWidth,\n auto: () => getAutoSize(getWidth),\n bodyScroll: () => document.body.scrollWidth,\n bodyOffset: () => document.body.offsetWidth,\n custom: () => customCalcMethods.width(),\n documentElementScroll: () => document.documentElement.scrollWidth,\n documentElementOffset: () => document.documentElement.offsetWidth,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().right,\n max: () => Math.max(...getAllMeasurements(getWidth)),\n min: () => Math.min(...getAllMeasurements(getWidth)),\n rightMostElement: () => getMaxElement(WIDTH_EDGE),\n scroll: () =>\n Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll()),\n taggedElement: () => getMaxElement(WIDTH_EDGE),\n}\n\nfunction sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n sendMsg(height, width, triggerEvent, msg)\n }\n\n function isSizeChangeDetected() {\n const checkTolerance = (a, b) => !(Math.abs(a - b) <= tolerance)\n\n // currentHeight = Math.ceil(\n // undefined === customHeight ? getHeight[heightCalcMode]() : customHeight,\n // )\n\n // currentWidth = Math.ceil(\n // undefined === customWidth ? getWidth[widthCalcMode]() : customWidth,\n // )\n\n currentHeight =\n undefined === customHeight ? getHeight[heightCalcMode]() : customHeight\n currentWidth =\n undefined === customWidth ? getWidth[widthCalcMode]() : customWidth\n\n return (\n (calculateHeight && checkTolerance(height, currentHeight)) ||\n (calculateWidth && checkTolerance(width, currentWidth))\n )\n }\n\n const isForceResizableEvent = () => !(triggerEvent in { init: 1, size: 1 })\n\n const isForceResizableCalcMode = () =>\n (calculateHeight && heightCalcMode in resetRequiredMethods) ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n }\n }\n\n let currentHeight\n let currentWidth\n\n if (isSizeChangeDetected() || triggerEvent === 'init') {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n}\n\nfunction sendSize(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n if (document.hidden) {\n // Currently only correctly supported in firefox\n // This is checked again on the parent page\n log('Page hidden - Ignored resize request')\n return\n }\n\n if (!(triggerEvent in nonLoggableTriggerEvents)) {\n log(`Trigger event: ${triggerEventDesc}`)\n }\n\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth, msg)\n}\n\nfunction lockTrigger() {\n if (triggerLocked) return\n\n triggerLocked = true\n log('Trigger event lock on')\n\n requestAnimationFrame(() => {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n })\n}\n\nfunction triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n}\n\nfunction resetIFrame(triggerEventDesc) {\n const hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log(`Reset trigger event: ${triggerEventDesc}`)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n}\n\nfunction sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n if (mode < -1) return\n\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n return\n }\n\n log(`Message targetOrigin: ${targetOrigin}`)\n }\n\n function sendToParent() {\n const size = `${height + (offsetHeight || 0)}:${width + (offsetWidth || 0)}`\n const message = `${myID}:${size}:${triggerEvent}${undefined === msg ? '' : `:${msg}`}`\n\n log(\n `Sending message to host page (${message}) via ${sameDomain ? 'sameDomain' : 'postMessage'}`,\n )\n\n if (sameDomain) {\n window.parent.iframeParentListener(msgID + message)\n return\n }\n\n target.postMessage(msgID + message, targetOrigin)\n }\n\n setTargetOrigin()\n sendToParent()\n}\n\nfunction receiver(event) {\n const processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(() => {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset() {\n if (initLock) {\n log('Page reset ignored by init')\n return\n }\n log('Page size reset by host page')\n triggerReset('resetPage')\n },\n\n resize() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor() {\n inPageLinks.findTarget(getData())\n },\n\n inPageLink() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo() {\n const msgBody = getData()\n log(`PageInfo received from parent: ${msgBody}`)\n if (onPageInfo) {\n onPageInfo(JSON.parse(msgBody))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'pageInfoStop')\n }\n log(' --')\n },\n\n parentInfo() {\n const msgBody = getData()\n log(`ParentInfo received from parent: ${msgBody}`)\n if (onParentInfo) {\n onParentInfo(Object.freeze(JSON.parse(msgBody)))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'parentInfoStop')\n }\n log(' --')\n },\n\n message() {\n const msgBody = getData()\n log(`onMessage called from parent: ${msgBody}`)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n },\n }\n\n const isMessageForUs = () => msgID === `${event.data}`.slice(0, msgIdLen)\n\n const getMessageType = () => event.data.split(']')[1].split(':')[0]\n\n const getData = () => event.data.slice(event.data.indexOf(':') + 1)\n\n const isMiddleTier = () =>\n 'iframeResize' in window ||\n (window.jQuery !== undefined && '' in window.jQuery.prototype)\n\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n const isInitMsg = () => event.data.split(':')[2] in { true: 1, false: 1 }\n\n function callFromParent() {\n const messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n return\n }\n\n if (!isMiddleTier() && !isInitMsg()) {\n warn(`Unexpected message (${event.data})`)\n }\n }\n\n function processMessage() {\n if (firstRun === false) {\n callFromParent()\n return\n }\n\n if (isInitMsg()) {\n processRequestFromParent.init()\n return\n }\n\n log(\n `Ignored message of type \"${getMessageType()}\". Received before initialization.`,\n )\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n}\n\n// Normally the parent kicks things off when it detects the iFrame has loaded.\n// If this script is async-loaded, then tell parent page to retry init.\nfunction chkLateLoaded() {\n if (document.readyState !== 'loading') {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n}\n\n// Don't run for server side render\nif (typeof window !== 'undefined') {\n window.iframeChildListener = (data) => receiver({ data, sameDomain: true })\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n}\n\n/* TEST CODE START */\nfunction mockMsgListener(msgObject) {\n receiver(msgObject)\n return win\n}\n\ntry {\n // eslint-disable-next-line no-restricted-globals\n if (top?.document?.getElementById('banner')) {\n win = {}\n\n // Create test hooks\n window.mockMsgListener = mockMsgListener\n\n removeEventListener(window, 'message', receiver)\n\n define([], () => mockMsgListener)\n }\n} catch (error) {\n // do nothing\n}\n\n/* TEST CODE END */\n","const encode = (s) =>\n s\n .replaceAll('<br>', '\\n')\n .replaceAll('<rb>', '\\u001B[31;1m')\n .replaceAll('</>', '\\u001B[m')\n .replaceAll('<b>', '\\u001B[1m')\n .replaceAll('<i>', '\\u001B[3m')\n .replaceAll('<u>', '\\u001B[4m')\n\nconst remove = (s) => s.replaceAll('<br>', '\\n').replaceAll(/<[/a-z]+>/gi, '')\n\nexport default (formatLogMsg) => (msg) =>\n window.chrome // Only show formatting in Chrome as not supported in other browsers\n ? formatLogMsg(encode(msg))\n : formatLogMsg(remove(msg))\n"],"names":["VERSION","BASE","SIZE_ATTR","OVERFLOW_ATTR","HEIGHT_EDGE","WIDTH_EDGE","addEventListener","el","evt","func","options","removeEventListener","y","Object","fromEntries","map","l","p","Math","max","getModeData","replaceAll","String","fromCodePoint","codePointAt","once","fn","done","undefined","Reflect","apply","this","arguments","id","x","side","onChange","root","document","documentElement","rootMargin","threshold","overflowedElements","observedElements","WeakSet","observer","IntersectionObserver","entries","forEach","entry","target","toggleAttribute","boundingClientRect","rootBounds","isTarget","querySelectorAll","overflowObserver","nodeList","has","observe","add","isOverflowed","length","checkVisibilityOptions","contentVisibilityAuto","opacityProperty","visibilityProperty","customCalcMethods","height","warn","getHeight","auto","width","getWidth","deprecatedResizeMethods","bodyOffset","bodyScroll","offset","documentElementOffset","documentElementScroll","documentElementBoundingClientRect","min","grow","lowestElement","eventCancelTimer","eventHandlersByName","hasCheckVisibility","window","heightCalcModeDefault","msgID","msgIdLen","resetRequiredMethods","resizeObserveTargets","widthCalcModeDefault","offsetHeight","offsetWidth","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateHeight","calculateWidth","calcElements","firstRun","hasTags","heightCalcMode","initLock","initMsg","inPageLinks","isInit","logging","mode","mouseEvents","myID","observeOverflow","resizeFrom","resizeObserver","sameDomain","sizeSelector","parent","targetOriginDefault","tolerance","triggerLocked","version","widthCalcMode","win","onMessage","onReady","onPageInfo","onParentInfo","isDef","value","usedTags","addUsedTag","getElementName","nodeName","toUpperCase","name","className","formatLogMsg","msg","join","info","console","advise","chrome","formatAdvise","adviser","init","strBool","str","data","slice","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","JSON","stringify","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollBy","scrollTo","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","customHeight","customWidth","sendSize","size","parentIFrame","setupPublicMethods","sendMouse","e","type","screenY","screenX","addMouseListener","setupMouseEvents","getPagePosition","scrollLeft","scrollTop","getElementPosition","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","location","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","href","bindAnchors","setupLink","linkClicked","preventDefault","getAttribute","bindLocationHash","initCheck","setTimeout","enableInPageLinks","setupInPageLinks","body","setBodyStyle","includes","chkCSS","setMargin","clearFix","createElement","style","clear","display","append","injectClearFixIntoBodyElement","setAutoHeight","setProperty","stopInfiniteResizingOfIFrame","applySizeSelector","title","taggedElements","getAllElements","dataset","iframeSize","manageTriggerEvent","eventName","handleEvent","eventType","passive","remove","method","checkCalcMode","calcModeDefault","modes","mutationObserved","mutations","addResizeObservers","createMutationObserver","MutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","setupBodyMutationObserver","ResizeObserver","resizeObserved","createResizeObservers","dispatchResized","Array","isArray","checkPositionType","element","getComputedStyle","position","getAllNonStaticElements","filter","resizeSet","setupResizeObservers","flatMap","mutation","lastEl","perfWarned","lastTimer","getMaxElement","Side","string","charAt","elVal","maxEl","maxVal","bottom","timer","performance","now","targetElements","len","checkVisibility","parseFloat","getPropertyValue","toPrecision","time","usedEl","logMsg","maxChars","outer","outerHTML","toString","elementSnippet","getAllMeasurements","dimension","prevScrollSize","prevBoundingSize","getAutoSize","getDimension","returnBoundingClientRect","boundingSize","scrollSize","hasOverflow","isHeight","ceilBoundingSize","ceil","floorBoundingSize","floor","getOffset","getAdjustedScroll","enabled","taggedElement","marginTop","marginBottom","scrollHeight","custom","scrollWidth","right","rightMostElement","scroll","sizeIFrame","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolerance","a","b","abs","isSizeChangeDetected","lockTrigger","hidden","requestAnimationFrame","triggerReset","hcm","message","iframeParentListener","postMessage","sendToParent","receiver","event","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","parentInfo","getMessageType","indexOf","isMiddleTier","jQuery","isInitMsg","true","false","messageType","callFromParent","chkLateLoaded","readyState","iframeChildListener"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAMA,EAAU,eAEVC,EAAO,GAGPC,EAAY,mBACZC,EAAgB,uBAEhBC,EAAc,SACdC,EAAa,QCTbC,EAAmB,CAACC,EAAIC,EAAKC,EAAMC,IAC9CH,EAAGD,iBAAiBE,EAAKC,EAAMC,IAAW,GAE/BC,EAAsB,CAACJ,EAAIC,EAAKC,IAC3CF,EAAGI,oBAAoBH,EAAKC,GAAM,GCkBlCG,EAAI,CACF,yCACA,yCACA,qnBACA,0jBAGEC,OAAOC,YACT,CACE,cACA,cACA,cACA,aACA,aACA,eACAC,KAAI,CAACC,EAAGC,IAAM,CAACD,EAAGE,KAAKC,IAAI,EAAGF,EAAI,OAEjC,MAAMG,EAAeJ,GAvBtB,CAACA,GACHA,EAAEK,WAAW,aAAcL,GACzBM,OAAOC,eACJP,GAAK,IAAM,GAAK,OAASA,EAAIA,EAAEQ,YAAY,GAAK,IAAMR,EAAIA,EAAI,MAoBrCC,CAAEL,E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|
*
|
|
4
|
-
* @module iframe-resizer/child 5.1
|
|
4
|
+
* @module iframe-resizer/child 5.2.0-beta.1 (umd) - 2024-07-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.1.3",t=10,n="data-iframe-size",o=(e,t,n,o)=>e.addEventListener(t,n,o||!1),i=(e,t,n)=>e.removeEventListener(t,n,!1),r=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const a=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(r[e]),l={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},c={height:()=>(se("Custom height calculation function not defined"),De.auto()),width:()=>(se("Custom width calculation function not defined"),He.auto())},s={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},u=128,d={},m="checkVisibility"in window,f="auto",p="[iFrameSizer]",h=p.length,y={max:1,min:1,bodyScroll:1,documentElementScroll:1},g=["body"],v="scroll";let b,w,z=!0,S="",$=0,j="",E=null,P="",O=!0,M=!1,A=null,C=!0,T=!1,I=1,k=f,x=!0,N="",R={},B=!0,q=!1,L=0,D=!1,H="",W="child",U=null,F=!1,V="",J=window.parent,Z="*",Q=0,X=!1,Y="",G=1,K=v,_=window,ee=()=>{se("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e;function re(e){switch(!0){case!ie(e):return"";case ie(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ie(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ie(e.className)?`.${e.className}`:"")}}function ae(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const le=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ce=(...e)=>console?.info(le(...e)),se=(...e)=>console?.warn(le(...e)),ue=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(le)(...e)),de=e=>ue(e);function me(){!function(){try{F="iframeParentListener"in window.parent}catch(e){}}(),function(){const e=e=>"true"===e,t=N.slice(h).split(":");H=t[0],$=void 0===t[1]?$:Number(t[1]),M=void 0===t[2]?M:e(t[2]),q=void 0===t[3]?q:e(t[3]),z=void 0===t[6]?z:e(t[6]),j=t[7],k=void 0===t[8]?k:t[8],S=t[9],P=t[10],Q=void 0===t[11]?Q:Number(t[11]),R.enable=void 0!==t[12]&&e(t[12]),W=void 0===t[13]?W:t[13],K=void 0===t[14]?K:t[14],D=void 0===t[15]?D:e(t[15]),b=void 0===t[16]?b:Number(t[16]),w=void 0===t[17]?w:Number(t[17]),O=void 0===t[18]?O:e(t[18]),t[19],Y=t[20]||Y,L=void 0===t[21]?L:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;ee=e?.onMessage||ee,te=e?.onReady||te,"number"==typeof e?.offset&&(O&&(b=e?.offset),M&&(w=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(V=e.sizeSelector),Z=e?.targetOrigin||Z,k=e?.heightCalculationMethod||k,K=e?.widthCalculationMethod||K}function t(e,t){return"function"==typeof e&&(c[t]=e,e="custom"),e}if(1===L)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),k=t(k,"height"),K=t(K,"width"))}(),function(){void 0===j&&(j=`${$}px`);fe("margin",function(e,t){t.includes("-")&&(se(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),fe("background",S),fe("padding",P),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),pe(),L<0?de(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&de(a(3)),function(){if(!Y||""===Y||"false"===Y)return void ue("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");Y!==e&&ue(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Y} - Child page: ${e}.\n`)}(),be(),we(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.setAttribute(n,null)}));t("data-iframe-height"),t("data-iframe-width"),e&&ue("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),document.querySelectorAll(`[${n}]`).length>0&&("auto"===k&&(k="autoOverflow"),"auto"===K&&(K="autoOverflow")),ge(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,ze()):!1===e&&!0===z&&(z=!1,ye("remove"),U?.disconnect(),E?.disconnect()),Ze(0,0,"autoResize",JSON.stringify(z)),z),close(){Ze(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Ze(0,0,"pageInfo"),void ue("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ne=null,Ze(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Ze(0,0,"parentInfo"),()=>{oe=null,Ze(0,0,"parentInfoStop")}},getParentProperties(e){ue("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){R.findTarget(e)},reset(){Je()},scrollBy(e,t){Ze(t,e,"scrollBy")},scrollTo(e,t){Ze(t,e,"scrollTo")},scrollToOffset(e,t){Ze(t,e,"scrollToOffset")},sendMessage(e,t){Ze(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,be()},setWidthCalculationMethod(e){K=e,we()},setTargetOrigin(e){Z=e},resize(e,t){Ue("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){ue("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),_.parentIFrame=_.parentIframe}(),function(){if(!0!==D)return;function e(e){Ze(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),ze(),R=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function i(e){function t(e){const t=n(e);Ze(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Ze(0,0,"inPageLink",`#${o}`):t(r)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&i(t)}function a(){function e(e){function t(e){e.preventDefault(),i(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&o(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){o(window,"hashchange",r)}function c(){setTimeout(r,u)}function s(){a(),l(),c()}R.enable&&(1===L?ue("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),Ue("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Ze(0,0,"title",document.title),te(),B=!1}function fe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function pe(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function he(e){({add(t){function n(){Ue(e.eventName,e.eventType)}d[t]=n,o(window,t,n,{passive:!0})},remove(e){const t=d[e];delete d[e],i(window,e,t)}})[e.method](e.eventName)}function ye(e){he({method:e,eventType:"After Print",eventName:"afterprint"}),he({method:e,eventType:"Before Print",eventName:"beforeprint"}),he({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function ge(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:xe(document)()}function ve(e,t,n,o){return t!==e&&(e in n||(se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&ue(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function be(){k=ve(k,f,De,"height")}function we(){K=ve(K,v,He,"width")}function ze(){!0===z&&(ye("add"),E=function(){function e(e){e.forEach(Me),pe(),ge()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),U=new ResizeObserver($e),Oe(window.document))}let Se;function $e(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Se=()=>Ue("resizeObserver",`Resize Observed: ${re(t)}`),setTimeout((()=>{Se&&Se(),Se=void 0}),0)}const je=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ee=()=>[...xe(document)()].filter(je);function Pe(e){e&&U.observe(e)}function Oe(e){[...Ee(),...g.flatMap((t=>e.querySelector(t)))].forEach(Pe)}function Me(e){"childList"===e.type&&Oe(e.target)}const Ae=new WeakSet;Ae.add(document.documentElement),Ae.add(document.body);let Ce=4,Te=4;function Ie(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=A.length,r=document.documentElement,a=T?0:document.documentElement.getBoundingClientRect().bottom,c=performance.now();var s;A.forEach((t=>{T||!m||t.checkVisibility(l)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>a&&(a=o,r=t)):i-=1})),c=performance.now()-c,i>1&&(s=r,Ae.has(s)||(Ae.add(s),ce(`\nHeight calculated from: ${re(s)} (${ae(s)})`)));const u=`\nParsed ${i} element${1===i?"":"s"} in ${c.toPrecision(3)}ms\n${t} ${T?"tagged ":""}element found at: ${a}px\nPosition calculated from HTML element: ${re(r)} (${ae(r,100)})`;return c<4||i<99||T||B||Ce<c&&Ce<Te&&(Ce=1.2*c,ue(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${u}`)),Te=c,a}const ke=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],xe=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)");let Ne=!1;function Re({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Ne)return Ne=!0,n.taggedElement();const r=o?"bottom":"right";return ue(`<rb>Detected content overflowing html element</>\n \nThis causes <i>iframe-resizer</> to fall back to checking the position of every element on the page in order to calculate the correct dimensions of the iframe. Inspecting the size, ${r} margin, and position of every visible HTML element will have a performance impact on more complex pages. \n\nTo fix this issue, and remove this warning, you can either ensure the content of the page does not overflow the <b><HTML></> element or alternatively you can add the attribute <b>data-iframe-size</> to the elements on the page that you want <i>iframe-resizer</> to use when calculating the dimensions of the iframe. \n \nWhen present the ${r} margin of the ${o?"lowest":"right most"} element with a <b>data-iframe-size</> attribute will be used to set the ${t} of the iframe.\n\nMore info: https://iframe-resizer.com/performance.\n\n(Page size: ${i} > document size: ${e})`),o?k="autoOverflow":K="autoOverflow",n.taggedElement()}const Be={height:0,width:0},qe={height:0,width:0};function Le(e,t){function n(){return qe[i]=r,Be[i]=c,r}const o=e===De,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case!t&&0===qe[i]&&0===Be[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===qe[i]&&c===Be[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==qe[i]&&c<=Be[i]:return n();case!o:return t?e.taggedElement():Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<qe[i]:case c===l||c===a:case r>c:return n();case!t:return Re({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const De={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>Le(De,!1),autoOverflow:()=>Le(De,!0),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>De.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...ke(De)),min:()=>Math.min(...ke(De)),grow:()=>De.max(),lowestElement:()=>Ie("bottom"),taggedElement:()=>Ie("bottom")},He={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>Le(He,!1),autoOverflow:()=>Le(He,!0),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>c.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...ke(He)),min:()=>Math.min(...ke(He)),rightMostElement:()=>Ie("right"),scroll:()=>Math.max(He.bodyScroll(),He.documentElementScroll()),taggedElement:()=>Ie("right")};function We(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?De[k]():n,a=void 0===o?He[K]():o,O&&e(I,r)||M&&e(G,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(O&&k in y||M&&K in y)&&Je():(Fe(),I=r,G=a,Ze(I,G,e,i))}function Ue(e,t,n,o,i){document.hidden||We(e,0,n,o,i)}function Fe(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Ve(e){I=De[k](),G=He[K](),Ze(I,G,e)}function Je(e){const t=k;k=f,Fe(),Ve("reset"),k=t}function Ze(e,t,n,o,i){L<-1||(void 0!==i||(i=Z),function(){const r=`${H}:${`${e+(b||0)}:${t+(w||0)}`}:${n}${void 0===o?"":`:${o}`}`;F?window.parent.iframeParentListener(p+r):J.postMessage(p+r,i)}())}function Qe(e){const t={init:function(){N=e.data,J=e.source,me(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Ve("resetPage")},resize(){Ue("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Ze(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Ze(0,0,"parentInfoStop")},message(){const e=o();ee(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};p===`${e.data}`.slice(0,h)&&(!1!==C?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||se(`Unexpected message (${e.data})`)}())}function Xe(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Qe({data:e,sameDomain:!0}),o(window,"message",Qe),o(window,"readystatechange",Xe),Xe())}));
|
|
20
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.2.0-beta.1",t=10,n="data-iframe-size",o="data-iframe-overflow",i="bottom",r="right",a=(e,t,n,o)=>e.addEventListener(t,n,o||!1),l=(e,t,n)=>e.removeEventListener(t,n,!1),c=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","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</>","<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const s=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(c[e]),u=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},d=e=>e;let m=i,f=d;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const y=new WeakSet,g=new IntersectionObserver((e=>{e.forEach((e=>{e.target.toggleAttribute(o,(e=>0===e.boundingClientRect[m]||e.boundingClientRect[m]>e.rootBounds[m])(e))})),h=document.querySelectorAll(`[${o}]`),f()}),p),v=e=>(m=e.side,f=e.onChange,e=>e.forEach((e=>{y.has(e)||(g.observe(e),y.add(e))}))),b=()=>h.length>0,w={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},z={height:()=>($e("Custom height calculation function not defined"),tt.auto()),width:()=>($e("Custom width calculation function not defined"),nt.auto())},S={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},j=128,$={},E="checkVisibility"in window,P="auto",C="[iFrameSizer]",A=C.length,M={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],T="scroll";let R,I,N=!0,k="",x=0,B="",q=null,W="",L=!0,U=!1,F=null,V=!0,D=!1,H=1,J=P,Z=!0,Q="",X={},Y=!0,G=!1,K=0,_=!1,ee="",te=d,ne="child",oe=null,ie=!1,re="",ae=window.parent,le="*",ce=0,se=!1,ue="",de=1,me=T,fe=window,pe=()=>{$e("onMessage function not defined")},he=()=>{},ye=null,ge=null;const ve=e=>""!=`${e}`&&void 0!==e,be=new WeakSet,we=e=>"object"==typeof e&&be.add(e);function ze(e){switch(!0){case!ve(e):return"";case ve(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ve(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ve(e.className)?`.${e.className}`:"")}}const Se=(...e)=>[`[iframe-resizer][${ee}]`,...e].join(" "),je=(...e)=>console?.info(`[iframe-resizer][${ee}]`,...e),$e=(...e)=>console?.warn(Se(...e)),Ee=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(Se)(...e)),Pe=e=>Ee(e);function Ce(){!function(){const e=e=>"true"===e,t=Q.slice(A).split(":");ee=t[0],x=void 0===t[1]?x:Number(t[1]),U=void 0===t[2]?U:e(t[2]),G=void 0===t[3]?G:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],J=void 0===t[8]?J:t[8],k=t[9],W=t[10],ce=void 0===t[11]?ce:Number(t[11]),X.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],me=void 0===t[14]?me:t[14],_=void 0===t[15]?_:e(t[15]),R=void 0===t[16]?R:Number(t[16]),I=void 0===t[17]?I:Number(t[17]),L=void 0===t[18]?L:e(t[18]),t[19],ue=t[20]||ue,K=void 0===t[21]?K:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(L&&(R=e?.offset),U&&(I=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(z[t]=e,e="custom"),e}if(1===K)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),J=t(J,"height"),me=t(me,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),K<0?Pe(`${s(K+2)}${s(2)}`):ue.codePointAt(0)>4||K<2&&Pe(s(3)),function(){if(!ue||""===ue||"false"===ue)return void Ee("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n");ue!==e&&Ee(`<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`)}(),ke(),xe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Ee("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),function(){if(L===U)return;te=v({onChange:u(Ae),side:L?i:r})}(),Me(),function(){if(1===K)return;fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,Be()):!1===e&&!0===N&&(N=!1,Ie("remove"),oe?.disconnect(),q?.disconnect()),ct(0,0,"autoResize",JSON.stringify(N)),N),close(){ct(0,0,"close")},getId:()=>ee,getPageInfo(e){if("function"==typeof e)return ye=e,ct(0,0,"pageInfo"),void Ee("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,ct(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ge=e,ct(0,0,"parentInfo"),()=>{ge=null,ct(0,0,"parentInfoStop")}},getParentProperties(e){Ee("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){X.findTarget(e)},reset(){lt()},scrollBy(e,t){ct(t,e,"scrollBy")},scrollTo(e,t){ct(t,e,"scrollTo")},scrollToOffset(e,t){ct(t,e,"scrollToOffset")},sendMessage(e,t){ct(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,ke()},setWidthCalculationMethod(e){me=e,xe()},setTargetOrigin(e){le=e},resize(e,t){it("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Ee("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe}(),function(){if(!0!==_)return;function e(e){ct(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){a(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),X=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);ct(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ct(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){function e(e){function t(e){e.preventDefault(),o(this.getAttribute("href"))}"#"!==e.getAttribute("href")&&a(e,"click",t)}document.querySelectorAll('a[href^="#"]').forEach(e)}function l(){a(window,"hashchange",i)}function c(){setTimeout(i,j)}function s(){r(),l(),c()}X.enable&&(1===K?Ee("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:o}}(),we(document.documentElement),we(document.body),function(){void 0===B&&(B=`${x}px`);Oe("margin",function(e,t){t.includes("-")&&($e(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Oe("background",k),Oe("padding",W),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Te()}const Ae=()=>{it("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ct(0,0,"title",document.title),Be(),he(),Y=!1};function Me(){const e=document.querySelectorAll(`[${n}]`);D=e.length>0,F=D?e:Ge(document)(),D?setTimeout(Ae):te(F)}function Oe(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Te(){""!==re&&document.querySelectorAll(re).forEach((e=>{e.dataset.iframeSize=!0}))}function Re(e){({add(t){function n(){it(e.eventName,e.eventType)}$[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=$[e];delete $[e],l(window,e,t)}})[e.method](e.eventName)}function Ie(e){Re({method:e,eventType:"After Print",eventName:"afterprint"}),Re({method:e,eventType:"Before Print",eventName:"beforeprint"}),Re({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Ne(e,t,n,o){return t!==e&&(e in n||($e(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in S&&Ee(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function ke(){J=Ne(J,P,tt,"height")}function xe(){me=Ne(me,T,nt,"width")}function Be(){!0===N&&(Ie("add"),q=function(){function e(e){e.forEach(He),Te(),Me()}function t(){const t=new window.MutationObserver(e),n=document.querySelector("body"),o={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return t.observe(n,o),t}const n=t();return{disconnect(){n.disconnect()}}}(),oe=new ResizeObserver(We),De(window.document))}let qe;function We(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;qe=()=>it("resizeObserver",`Resize Observed: ${ze(t)}`),setTimeout((()=>{qe&&qe(),qe=void 0}),0)}const Le=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...Ge(document)()].filter(Le),Fe=new WeakSet;function Ve(e){e&&(Fe.has(e)||(oe.observe(e),Fe.add(e)))}function De(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Ve)}function He(e){"childList"===e.type&&De(e.target)}let Je=null;let Ze=4,Qe=4;function Xe(e){const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=D?0:document.documentElement.getBoundingClientRect().bottom,a=performance.now();const l=!D&&b()?h:F;let c=l.length;l.forEach((t=>{D||!E||t.checkVisibility(w)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):c-=1})),a=(performance.now()-a).toPrecision(1),function(e,t,n,o){be.has(e)||Je===e||D&&o<=1||(Je=e,je(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${D?"tagged":"potentially overflowing"} elements in ${n}ms`))}(i,t,a,c);const s=`\nParsed ${c} element${1===c?"":"s"} in ${a}ms\n${t} ${D?"tagged ":""}element found at: ${r}px\nPosition calculated from HTML element: ${ze(i)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(i,100)})`;return a<4||c<99||D||Y||Ze<a&&Ze<Qe&&(Ze=1.2*a,Ee(`<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${e} most element on the page.\n${s}`)),Qe=a,r}const Ye=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ge=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Ke={height:0,width:0},_e={height:0,width:0};function et(e){function t(){return _e[i]=r,Ke[i]=c,r}const n=b(),o=e===tt,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return c;case D:return e.taggedElement();case!n&&0===_e[i]&&0===Ke[i]:return t();case se&&r===_e[i]&&c===Ke[i]:return Math.max(r,c);case 0===r:return c;case!n&&r!==_e[i]&&c<=Ke[i]:return t();case!o:return e.taggedElement();case!n&&r<_e[i]:case c===l||c===a:case r>c:return t()}return Math.max(e.taggedElement(),t())}const tt={enabled:()=>L,getOffset:()=>R,auto:()=>et(tt),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>tt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...Ye(tt)),min:()=>Math.min(...Ye(tt)),grow:()=>tt.max(),lowestElement:()=>Xe(i),taggedElement:()=>Xe(i)},nt={enabled:()=>U,getOffset:()=>I,auto:()=>et(nt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(...Ye(nt)),min:()=>Math.min(...Ye(nt)),rightMostElement:()=>Xe(r),scroll:()=>Math.max(nt.bodyScroll(),nt.documentElementScroll()),taggedElement:()=>Xe(r)};function ot(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?tt[J]():n,a=void 0===o?nt[me]():o,L&&e(H,r)||U&&e(de,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(L&&J in M||U&&me in M)&<():(rt(),H=r,de=a,ct(H,de,e,i))}function it(e,t,n,o,i){document.hidden||ot(e,0,n,o,i)}function rt(){se||(se=!0,requestAnimationFrame((()=>{se=!1})))}function at(e){H=tt[J](),de=nt[me](),ct(H,de,e)}function lt(e){const t=J;J=P,rt(),at("reset"),J=t}function ct(e,t,n,o,i){K<-1||(void 0!==i||(i=le),function(){const r=`${ee}:${`${e+(R||0)}:${t+(I||0)}`}:${n}${void 0===o?"":`:${o}`}`;ie?window.parent.iframeParentListener(C+r):ae.postMessage(C+r,i)}())}function st(e){const t={init:function(){Q=e.data,ae=e.source,Ce(),V=!1,setTimeout((()=>{Z=!1}),j)},reset(){Z||at("resetPage")},resize(){it("resizeParent")},moveToAnchor(){X.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?ye(JSON.parse(e)):ct(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?ge(Object.freeze(JSON.parse(e))):ct(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};C===`${e.data}`.slice(0,A)&&(!1!==V?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||$e(`Unexpected message (${e.data})`)}())}function ut(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>st({data:e,sameDomain:!0}),a(window,"message",st),a(window,"readystatechange",ut),ut())}));
|
|
21
|
+
//# sourceMappingURL=index.umd.js.map
|
package/index.umd.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../packages/common/consts.js","../../packages/common/listeners.js","../../packages/common/mode.js","../../packages/common/utils.js","../../packages/child/overflow.js","../../packages/child/index.js","../../packages/common/format-advise.js"],"sourcesContent":["export const VERSION = '[VI]{version}[/VI]'\n\nexport const BASE = 10\nexport const SINGLE = 1\n\nexport const SIZE_ATTR = 'data-iframe-size'\nexport const OVERFLOW_ATTR = 'data-iframe-overflow'\n\nexport const HEIGHT_EDGE = 'bottom'\nexport const WIDTH_EDGE = 'right'\n\nexport const msgHeader = 'message'\nexport const msgHeaderLen = msgHeader.length\nexport const msgId = '[iFrameSizer]' // Must match iframe msg ID\nexport const msgIdLen = msgId.length\nexport const resetRequiredMethods = Object.freeze({\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n})\n","export const addEventListener = (el, evt, func, options) =>\n el.addEventListener(evt, func, options || false)\n\nexport const removeEventListener = (el, evt, func) =>\n el.removeEventListener(evt, func, false)\n","const l = (l) => {\n if (!l) return ''\n let p = -559038744,\n y = 1103547984\n for (let z, t = 0; t < l.length; t++)\n (z = l.codePointAt(t)),\n (p = Math.imul(p ^ z, 2246822519)),\n (y = Math.imul(y ^ z, 3266489917))\n return (\n (p ^= Math.imul(p ^ (y >>> 15), 1935289751)),\n (y ^= Math.imul(y ^ (p >>> 15), 3405138345)),\n (p ^= y >>> 16),\n (y ^= p >>> 16),\n (2097152 * (y >>> 0) + (p >>> 11)).toString(36)\n )\n },\n p = (l) =>\n l.replaceAll(/[A-Za-z]/g, (l) =>\n String.fromCodePoint(\n (l <= 'Z' ? 90 : 122) >= (l = l.codePointAt(0) + 19) ? l : l - 26,\n ),\n ),\n y = [\n '<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>',\n '<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>',\n '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</>',\n '<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</>.',\n ],\n z = ['NWSc3', 'zvsv', 'wyv', 'ibzpulzz', 'vlt'],\n t = Object.fromEntries(\n [\n '2cgs7fdf4xb',\n '1c9ctcccr4z',\n '1q2pc4eebgb',\n 'ueokt0969w',\n 'w2zxchhgqz',\n '1umuxblj2e5',\n ].map((l, p) => [l, Math.max(0, p - 1)]),\n )\nexport const getModeData = (l) => p(y[l])\nexport const getModeLabel = (l) => p(z[l])\nexport default (y) => {\n const z = y[p('spjluzl')]\n if (!z) return -1\n const u = z.split('-')\n let v = (function (y = '') {\n let z = -2\n const u = l(p(y))\n return u in t && (z = t[u]), z\n })(u[0])\n return 0 === v || ((p) => p[2] === l(p[0] + p[1]))(u) || (v = -2), v\n}\n","export const isNumber = (value) => !Number.isNaN(value)\n\nexport const once = (fn) => {\n let done = false\n\n return function () {\n return done\n ? undefined\n : ((done = true), Reflect.apply(fn, this, arguments))\n }\n}\n\nexport const id = (x) => x\n","import { HEIGHT_EDGE, OVERFLOW_ATTR } from '../common/consts'\nimport { id } from '../common/utils'\n\nlet side = HEIGHT_EDGE\n\nlet onChange = id\n\nconst options = {\n root: document.documentElement,\n rootMargin: '0px',\n threshold: 1,\n}\n\nlet overflowedElements = []\nconst observedElements = new WeakSet()\n\nconst isTarget = (entry) =>\n entry.boundingClientRect[side] === 0 ||\n entry.boundingClientRect[side] > entry.rootBounds[side]\n\nconst callback = (entries) => {\n entries.forEach((entry) => {\n entry.target.toggleAttribute(OVERFLOW_ATTR, isTarget(entry))\n })\n\n overflowedElements = document.querySelectorAll(`[${OVERFLOW_ATTR}]`)\n onChange()\n}\n\nconst observer = new IntersectionObserver(callback, options)\n\nexport const overflowObserver = (options) => {\n side = options.side\n onChange = options.onChange\n\n return (nodeList) =>\n nodeList.forEach((el) => {\n if (observedElements.has(el)) return\n observer.observe(el)\n observedElements.add(el)\n })\n}\n\nexport const isOverflowed = () => overflowedElements.length > 0\n\nexport const getOverflowedElements = () => overflowedElements\n","import {\n BASE,\n HEIGHT_EDGE,\n SINGLE,\n SIZE_ATTR,\n VERSION,\n WIDTH_EDGE,\n} from '../common/consts'\nimport formatAdvise from '../common/format-advise'\nimport { addEventListener, removeEventListener } from '../common/listeners'\nimport { getModeData } from '../common/mode'\nimport { id, once } from '../common/utils'\nimport {\n getOverflowedElements,\n isOverflowed,\n overflowObserver,\n} from './overflow'\n\nconst PERF_TIME_LIMIT = 4\nconst PERF_MIN_ELEMENTS = 99\n\nconst checkVisibilityOptions = {\n contentVisibilityAuto: true,\n opacityProperty: true,\n visibilityProperty: true,\n}\nconst customCalcMethods = {\n height: () => {\n warn('Custom height calculation function not defined')\n return getHeight.auto()\n },\n width: () => {\n warn('Custom width calculation function not defined')\n return getWidth.auto()\n },\n}\nconst deprecatedResizeMethods = {\n bodyOffset: 1,\n bodyScroll: 1,\n offset: 1,\n documentElementOffset: 1,\n documentElementScroll: 1,\n documentElementBoundingClientRect: 1,\n max: 1,\n min: 1,\n grow: 1,\n lowestElement: 1,\n}\nconst eventCancelTimer = 128\nconst eventHandlersByName = {}\nconst hasCheckVisibility = 'checkVisibility' in window\nconst heightCalcModeDefault = 'auto'\n// const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\nconst nonLoggableTriggerEvents = { reset: 1, resetPage: 1, init: 1 }\nconst msgID = '[iFrameSizer]' // Must match host page msg ID\nconst msgIdLen = msgID.length\nconst resetRequiredMethods = {\n max: 1,\n min: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n}\nconst resizeObserveTargets = ['body']\nconst widthCalcModeDefault = 'scroll'\n\nlet autoResize = true\nlet bodyBackground = ''\nlet bodyMargin = 0\nlet bodyMarginStr = ''\nlet bodyObserver = null\nlet bodyPadding = ''\nlet calculateHeight = true\nlet calculateWidth = false\nlet calcElements = null\nlet firstRun = true\nlet hasTags = false\nlet height = 1\nlet heightCalcMode = heightCalcModeDefault // only applys if not provided by host page (V1 compatibility)\nlet initLock = true\nlet initMsg = ''\nlet inPageLinks = {}\nlet isInit = true\nlet logging = false\nlet licenseKey = '' // eslint-disable-line no-unused-vars\nlet mode = 0\nlet mouseEvents = false\nlet myID = ''\nlet offsetHeight\nlet offsetWidth\nlet observeOverflow = id\nlet resizeFrom = 'child'\nlet resizeObserver = null\nlet sameDomain = false\nlet sizeSelector = ''\nlet target = window.parent\nlet targetOriginDefault = '*'\nlet tolerance = 0\nlet triggerLocked = false\nlet version = ''\nlet width = 1\nlet widthCalcMode = widthCalcModeDefault\nlet win = window\n\nlet onMessage = () => {\n warn('onMessage function not defined')\n}\nlet onReady = () => {}\nlet onPageInfo = null\nlet onParentInfo = null\n\nconst capitalizeFirstLetter = (string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nconst isDef = (value) => `${value}` !== '' && value !== undefined\n\nconst usedTags = new WeakSet()\nconst addUsedTag = (el) => typeof el === 'object' && usedTags.add(el)\n\nfunction getElementName(el) {\n switch (true) {\n case !isDef(el):\n return ''\n\n case isDef(el.id):\n return `${el.nodeName.toUpperCase()}#${el.id}`\n\n case isDef(el.name):\n return `${el.nodeName.toUpperCase()} (${el.name})`\n\n default:\n return (\n el.nodeName.toUpperCase() +\n (isDef(el.className) ? `.${el.className}` : '')\n )\n }\n}\n\nfunction elementSnippet(el, maxChars = 30) {\n const outer = el?.outerHTML?.toString()\n\n if (!outer) return el\n\n return outer.length < maxChars\n ? outer\n : `${outer.slice(0, maxChars).replaceAll('\\n', ' ')}...`\n}\n\n// TODO: remove .join(' '), requires major test updates\nconst formatLogMsg = (...msg) => [`[iframe-resizer][${myID}]`, ...msg].join(' ')\n\nconst log = (...msg) =>\n // eslint-disable-next-line no-console\n logging && console?.log(formatLogMsg(...msg))\n\nconst info = (...msg) =>\n // eslint-disable-next-line no-console\n console?.info(`[iframe-resizer][${myID}]`, ...msg)\n\nconst warn = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatLogMsg(...msg))\n\nconst advise = (...msg) =>\n // eslint-disable-next-line no-console\n console?.warn(formatAdvise(formatLogMsg)(...msg))\n\nconst adviser = (msg) => advise(msg)\n\nfunction init() {\n readDataFromParent()\n readDataFromPage()\n\n log(`Initialising iFrame v${VERSION} (${window.location.href})`)\n\n checkCrossDomain()\n checkMode()\n checkVersion()\n checkHeightMode()\n checkWidthMode()\n checkDeprecatedAttrs()\n\n setupObserveOverflow()\n setupCalcElements()\n setupPublicMethods()\n setupMouseEvents()\n inPageLinks = setupInPageLinks()\n\n addUsedTag(document.documentElement)\n addUsedTag(document.body)\n\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n\n injectClearFixIntoBodyElement()\n stopInfiniteResizingOfIFrame()\n applySizeSelector()\n}\n\n// Continue init after intersection observer has been setup\nconst initContinue = () => {\n sendSize('init', 'Init message from host page', undefined, undefined, VERSION)\n sendTitle()\n initEventListeners()\n onReady()\n isInit = false\n log('Initialization complete')\n log('---')\n}\n\nfunction setupObserveOverflow() {\n if (calculateHeight === calculateWidth) return\n observeOverflow = overflowObserver({\n onChange: once(initContinue),\n side: calculateHeight ? HEIGHT_EDGE : WIDTH_EDGE,\n })\n}\n\nfunction setupCalcElements() {\n const taggedElements = document.querySelectorAll(`[${SIZE_ATTR}]`)\n hasTags = taggedElements.length > 0\n log(`Tagged elements found: ${hasTags}`)\n calcElements = hasTags ? taggedElements : getAllElements(document)()\n if (hasTags) setTimeout(initContinue)\n else observeOverflow(calcElements)\n}\n\nfunction sendTitle() {\n if (document.title && document.title !== '') {\n sendMsg(0, 0, 'title', document.title)\n }\n}\n\nfunction checkVersion() {\n if (!version || version === '' || version === 'false') {\n advise(\n `<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/<u> for more details.\n`,\n )\n return\n }\n\n if (version !== VERSION) {\n advise(\n `<rb>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${version} - Child page: ${VERSION}.\n`,\n )\n }\n}\n\nfunction checkCrossDomain() {\n try {\n sameDomain = 'iframeParentListener' in window.parent\n } catch (error) {\n log('Cross domain iframe detected.')\n }\n}\n\n// eslint-disable-next-line sonarjs/cognitive-complexity\nfunction readDataFromParent() {\n const strBool = (str) => str === 'true'\n const data = initMsg.slice(msgIdLen).split(':')\n\n myID = data[0] // eslint-disable-line prefer-destructuring\n bodyMargin = undefined === data[1] ? bodyMargin : Number(data[1]) // For V1 compatibility\n calculateWidth = undefined === data[2] ? calculateWidth : strBool(data[2])\n logging = undefined === data[3] ? logging : strBool(data[3])\n // data[4] no longer used (was intervalTimer)\n autoResize = undefined === data[6] ? autoResize : strBool(data[6])\n bodyMarginStr = data[7] // eslint-disable-line prefer-destructuring\n heightCalcMode = undefined === data[8] ? heightCalcMode : data[8]\n bodyBackground = data[9] // eslint-disable-line prefer-destructuring\n bodyPadding = data[10] // eslint-disable-line prefer-destructuring\n tolerance = undefined === data[11] ? tolerance : Number(data[11])\n inPageLinks.enable = undefined === data[12] ? false : strBool(data[12])\n resizeFrom = undefined === data[13] ? resizeFrom : data[13]\n widthCalcMode = undefined === data[14] ? widthCalcMode : data[14]\n mouseEvents = undefined === data[15] ? mouseEvents : strBool(data[15])\n offsetHeight = undefined === data[16] ? offsetHeight : Number(data[16])\n offsetWidth = undefined === data[17] ? offsetWidth : Number(data[17])\n calculateHeight = undefined === data[18] ? calculateHeight : strBool(data[18])\n licenseKey = data[19] // eslint-disable-line prefer-destructuring\n version = data[20] || version\n mode = undefined === data[21] ? mode : Number(data[21])\n // sizeSelector = data[22] || sizeSelector\n}\n\nfunction readDataFromPage() {\n function readData() {\n const data = window.iframeResizer || window.iFrameResizer\n\n log(`Reading data from page: ${JSON.stringify(data)}`)\n\n onMessage = data?.onMessage || onMessage\n onReady = data?.onReady || onReady\n\n if (typeof data?.offset === 'number') {\n if (calculateHeight) offsetHeight = data?.offset\n if (calculateWidth) offsetWidth = data?.offset\n }\n\n if (Object.prototype.hasOwnProperty.call(data, 'sizeSelector')) {\n sizeSelector = data.sizeSelector\n }\n\n targetOriginDefault = data?.targetOrigin || targetOriginDefault\n heightCalcMode = data?.heightCalculationMethod || heightCalcMode\n widthCalcMode = data?.widthCalculationMethod || widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if (typeof calcMode === 'function') {\n log(`Setup custom ${calcFunc}CalcMethod`)\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (mode === 1) return\n\n if (\n 'iFrameResizer' in window &&\n Object === window.iFrameResizer.constructor\n ) {\n readData()\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n }\n\n log(`TargetOrigin for parent set to: ${targetOriginDefault}`)\n}\n\nfunction chkCSS(attr, value) {\n if (value.includes('-')) {\n warn(`Negative CSS value ignored for ${attr}`)\n value = ''\n }\n\n return value\n}\n\nfunction setBodyStyle(attr, value) {\n if (undefined !== value && value !== '' && value !== 'null') {\n document.body.style.setProperty(attr, value)\n log(`Body ${attr} set to \"${value}\"`)\n }\n}\n\nfunction applySizeSelector() {\n if (sizeSelector === '') return\n\n log(`Applying sizeSelector: ${sizeSelector}`)\n\n document.querySelectorAll(sizeSelector).forEach((el) => {\n log(`Applying data-iframe-size to: ${getElementName(el)}`)\n el.dataset.iframeSize = true\n })\n}\n\nfunction setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = `${bodyMargin}px`\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n}\n\nfunction stopInfiniteResizingOfIFrame() {\n const setAutoHeight = (el) =>\n el.style.setProperty('height', 'auto', 'important')\n\n setAutoHeight(document.documentElement)\n setAutoHeight(document.body)\n\n log('HTML & body height set to \"auto !important\"')\n}\n\nfunction manageTriggerEvent(options) {\n const listener = {\n add(eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove(eventName) {\n const handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n },\n }\n\n listener[options.method](options.eventName)\n\n log(\n `${capitalizeFirstLetter(options.method)} event listener: ${\n options.eventType\n }`,\n )\n}\n\nfunction manageEventListeners(method) {\n manageTriggerEvent({\n method,\n eventType: 'After Print',\n eventName: 'afterprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Before Print',\n eventName: 'beforeprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange',\n })\n\n // manageTriggerEvent({\n // method: method,\n // eventType: 'Orientation Change',\n // eventName: 'orientationchange'\n // })\n}\n\nfunction checkDeprecatedAttrs() {\n let found = false\n\n const checkAttrs = (attr) =>\n document.querySelectorAll(`[${attr}]`).forEach((el) => {\n found = true\n el.removeAttribute(attr)\n el.toggleAttribute(SIZE_ATTR, true)\n })\n\n checkAttrs('data-iframe-height')\n checkAttrs('data-iframe-width')\n\n if (found) {\n advise(\n `<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`,\n )\n }\n}\n\nfunction checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(`${calcMode} is not a valid option for ${type}CalculationMethod.`)\n calcMode = calcModeDefault\n }\n if (calcMode in deprecatedResizeMethods) {\n advise(\n `<rb>Deprecated ${type}CalculationMethod (${calcMode})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${type} calculation method. It is recommended that you remove this option.`,\n )\n }\n log(`${type} calculation method set to \"${calcMode}\"`)\n }\n\n return calcMode\n}\n\nfunction checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height',\n )\n}\n\nfunction checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width',\n )\n}\n\nfunction checkMode() {\n if (mode < 0) return adviser(`${getModeData(mode + 2)}${getModeData(2)}`)\n if (version.codePointAt(0) > 4) return mode\n if (mode < 2) return adviser(getModeData(3))\n return mode\n}\n\nfunction initEventListeners() {\n if (autoResize !== true) {\n log('Auto Resize disabled')\n return\n }\n\n manageEventListeners('add')\n setupMutationObserver()\n setupResizeObserver()\n}\n\nfunction stopEventListeners() {\n manageEventListeners('remove')\n resizeObserver?.disconnect()\n bodyObserver?.disconnect()\n}\n\nfunction injectClearFixIntoBodyElement() {\n const clearFix = document.createElement('div')\n\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n document.body.append(clearFix)\n}\n\nfunction setupInPageLinks() {\n const getPagePosition = () => ({\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop,\n })\n\n function getElementPosition(el) {\n const elPosition = el.getBoundingClientRect()\n const pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, BASE) + parseInt(pagePosition.x, BASE),\n y: parseInt(elPosition.top, BASE) + parseInt(pagePosition.y, BASE),\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n const jumpPosition = getElementPosition(target)\n\n log(\n `Moving to in page link (#${hash}) at x: ${jumpPosition.x}y: ${jumpPosition.y}`,\n )\n\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n const hash = location.split('#')[1] || location // Remove # if present\n const hashData = decodeURIComponent(hash)\n const target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target !== undefined) {\n jumpToTarget(target)\n return\n }\n\n log(`In page link (#${hash}) not found in iFrame, so sending to parent`)\n sendMsg(0, 0, 'inPageLink', `#${hash}`)\n }\n\n function checkLocationHash() {\n const { hash, href } = window.location\n\n if (hash !== '' && hash !== '#') {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n function setupLink(el) {\n function linkClicked(e) {\n e.preventDefault()\n\n findTarget(this.getAttribute('href'))\n }\n\n if (el.getAttribute('href') !== '#') {\n addEventListener(el, 'click', linkClicked)\n }\n }\n\n document.querySelectorAll('a[href^=\"#\"]').forEach(setupLink)\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n }\n\n if (inPageLinks.enable) {\n if (mode === 1) {\n advise(\n `In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details.`,\n )\n } else {\n enableInPageLinks()\n }\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget,\n }\n}\n\nfunction setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, `${e.screenY}:${e.screenX}`)\n }\n\n function addMouseListener(evt, name) {\n log(`Add event listener: ${name}`)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n}\n\nfunction setupPublicMethods() {\n if (mode === 1) return\n\n win.parentIframe = Object.freeze({\n autoResize: (resize) => {\n if (resize === true && autoResize === false) {\n autoResize = true\n initEventListeners()\n } else if (resize === false && autoResize === true) {\n autoResize = false\n stopEventListeners()\n }\n\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n\n return autoResize\n },\n\n close() {\n sendMsg(0, 0, 'close')\n },\n\n getId: () => myID,\n\n getPageInfo(callback) {\n if (typeof callback === 'function') {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n return\n }\n\n onPageInfo = null\n sendMsg(0, 0, 'pageInfoStop')\n },\n\n getParentProps(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(\n 'parentIFrame.getParentProps(callback) callback not a function',\n )\n }\n\n onParentInfo = callback\n sendMsg(0, 0, 'parentInfo')\n\n return () => {\n onParentInfo = null\n sendMsg(0, 0, 'parentInfoStop')\n }\n },\n\n getParentProperties(callback) {\n advise(\n `<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.getParentProps(callback)\n },\n\n moveToAnchor(hash) {\n inPageLinks.findTarget(hash)\n },\n\n reset() {\n resetIFrame('parentIFrame.reset')\n },\n\n scrollBy(x, y) {\n sendMsg(y, x, 'scrollBy') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollTo(x, y) {\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset(x, y) {\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage(msg, targetOrigin) {\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod(heightCalculationMethod) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod(widthCalculationMethod) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin(targetOrigin) {\n log(`Set targetOrigin: ${targetOrigin}`)\n targetOriginDefault = targetOrigin\n },\n\n resize(customHeight, customWidth) {\n const valString = `${customHeight || ''}${customWidth ? `,${customWidth}` : ''}`\n\n sendSize(\n 'size',\n `parentIFrame.size(${valString})`,\n customHeight,\n customWidth,\n )\n },\n\n size(customHeight, customWidth) {\n advise(\n `<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n`,\n )\n this.resize(customHeight, customWidth)\n },\n })\n\n win.parentIFrame = win.parentIframe\n}\n\nlet dispatchResized\n\nfunction resizeObserved(entries) {\n if (!Array.isArray(entries) || entries.length === 0) return\n\n const el = entries[0].target\n\n dispatchResized = () =>\n sendSize('resizeObserver', `Resize Observed: ${getElementName(el)}`)\n\n // Throttle event to once per current call stack (Safari issue)\n setTimeout(() => {\n if (dispatchResized) dispatchResized()\n dispatchResized = undefined\n }, 0)\n}\n\nconst checkPositionType = (element) => {\n const style = getComputedStyle(element)\n return style?.position !== '' && style?.position !== 'static'\n}\n\nconst getAllNonStaticElements = () =>\n [...getAllElements(document)()].filter(checkPositionType)\n\nconst resizeSet = new WeakSet()\n\nfunction setupResizeObservers(el) {\n if (!el) return\n if (resizeSet.has(el)) return\n resizeObserver.observe(el)\n resizeSet.add(el)\n log(`Attached resizeObserver: ${getElementName(el)}`)\n}\n\nfunction createResizeObservers(el) {\n ;[\n ...getAllNonStaticElements(),\n ...resizeObserveTargets.flatMap((target) => el.querySelector(target)),\n ].forEach(setupResizeObservers)\n}\n\nfunction addResizeObservers(mutation) {\n if (mutation.type === 'childList') {\n createResizeObservers(mutation.target)\n }\n}\n\nfunction setupResizeObserver() {\n resizeObserver = new ResizeObserver(resizeObserved)\n createResizeObservers(window.document)\n}\n\nfunction setupBodyMutationObserver() {\n function mutationObserved(mutations) {\n // Look for injected elements that need ResizeObservers\n mutations.forEach(addResizeObservers)\n\n // apply sizeSelector to new elements\n applySizeSelector()\n\n // Rebuild elements list for size calculation\n setupCalcElements()\n }\n\n function createMutationObserver() {\n const observer = new window.MutationObserver(mutationObserved)\n const target = document.querySelector('body')\n const config = {\n // attributes: true,\n attributes: false,\n attributeOldValue: false,\n // characterData: true,\n characterData: false,\n characterDataOldValue: false,\n childList: true,\n subtree: true,\n }\n\n log('Create <body/> MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n const observer = createMutationObserver()\n\n return {\n disconnect() {\n log('Disconnect MutationObserver')\n observer.disconnect()\n },\n }\n}\n\nfunction setupMutationObserver() {\n bodyObserver = setupBodyMutationObserver()\n}\n\nlet lastEl = null\n\nfunction usedEl(el, Side, time, len) {\n if (usedTags.has(el) || lastEl === el || (hasTags && len <= 1)) return\n // addUsedTag(el)\n lastEl = el\n\n info(\n `\\n${Side} position calculated from:\\n`,\n el,\n `\\nParsed ${len} ${hasTags ? 'tagged' : 'potentially overflowing'} elements in ${time}ms`, // ${getElementName(el)} (${elementSnippet(el)})\n )\n}\n\nlet perfWarned = PERF_TIME_LIMIT\nlet lastTimer = PERF_TIME_LIMIT\n\nfunction getMaxElement(side) {\n const Side = capitalizeFirstLetter(side)\n\n let elVal = 0\n let maxEl = document.documentElement\n let maxVal = hasTags\n ? 0\n : document.documentElement.getBoundingClientRect().bottom\n let timer = performance.now()\n\n const targetElements =\n !hasTags && isOverflowed() ? getOverflowedElements() : calcElements\n\n let len = targetElements.length\n\n targetElements.forEach((element) => {\n if (\n !hasTags &&\n hasCheckVisibility && // Safari missing checkVisibility\n !element.checkVisibility(checkVisibilityOptions)\n ) {\n len -= 1\n return\n }\n\n elVal =\n element.getBoundingClientRect()[side] +\n parseFloat(getComputedStyle(element).getPropertyValue(`margin-${side}`))\n\n if (elVal > maxVal) {\n maxVal = elVal\n maxEl = element\n }\n })\n\n timer = (performance.now() - timer).toPrecision(1)\n\n usedEl(maxEl, Side, timer, len)\n\n const logMsg = `\nParsed ${len} element${len === SINGLE ? '' : 's'} in ${timer}ms\n${Side} ${hasTags ? 'tagged ' : ''}element found at: ${maxVal}px\nPosition calculated from HTML element: ${getElementName(maxEl)} (${elementSnippet(maxEl, 100)})`\n\n if (timer < PERF_TIME_LIMIT || len < PERF_MIN_ELEMENTS || hasTags || isInit) {\n log(logMsg)\n } else if (perfWarned < timer && perfWarned < lastTimer) {\n perfWarned = timer * 1.2\n advise(\n `<rb>Performance Warning</>\n\nCalculating the page size took an excessive amount of time. To improve performance add the <b>data-iframe-size</> attribute to the ${side} most element on the page.\n${logMsg}`,\n )\n }\n\n lastTimer = timer\n return maxVal\n}\n\nconst getAllMeasurements = (dimension) => [\n dimension.bodyOffset(),\n dimension.bodyScroll(),\n dimension.documentElementOffset(),\n dimension.documentElementScroll(),\n dimension.documentElementBoundingClientRect(),\n]\n\nconst getAllElements = (element) => () =>\n element.querySelectorAll(\n '* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)',\n )\n\nconst prevScrollSize = {\n height: 0,\n width: 0,\n}\n\nconst prevBoundingSize = {\n height: 0,\n width: 0,\n}\n\nconst getAdjustedScroll = (getDimension) =>\n getDimension.documentElementScroll() + Math.max(0, getDimension.getOffset())\n\nfunction getAutoSize(getDimension) {\n function returnBoundingClientRect() {\n prevBoundingSize[dimension] = boundingSize\n prevScrollSize[dimension] = scrollSize\n return boundingSize\n }\n\n const hasOverflow = isOverflowed()\n const isHeight = getDimension === getHeight\n const dimension = isHeight ? 'height' : 'width'\n const boundingSize = getDimension.documentElementBoundingClientRect()\n const ceilBoundingSize = Math.ceil(boundingSize)\n const floorBoundingSize = Math.floor(boundingSize)\n const scrollSize = getAdjustedScroll(getDimension)\n const sizes = `HTML: ${boundingSize} Page: ${scrollSize}`\n\n switch (true) {\n case !getDimension.enabled():\n return scrollSize\n\n case hasTags:\n return getDimension.taggedElement()\n\n case !hasOverflow &&\n prevBoundingSize[dimension] === 0 &&\n prevScrollSize[dimension] === 0:\n log(`Initial page size values: ${sizes}`)\n return returnBoundingClientRect()\n\n case triggerLocked &&\n boundingSize === prevBoundingSize[dimension] &&\n scrollSize === prevScrollSize[dimension]:\n log(`Size unchanged: ${sizes}`)\n return Math.max(boundingSize, scrollSize)\n\n case boundingSize === 0:\n log(`Page is hidden: ${sizes}`)\n return scrollSize\n\n case !hasOverflow &&\n boundingSize !== prevBoundingSize[dimension] &&\n scrollSize <= prevScrollSize[dimension]:\n log(\n `New HTML bounding size: ${sizes}`,\n 'Previous bounding size:',\n prevBoundingSize[dimension],\n )\n return returnBoundingClientRect()\n\n case !isHeight:\n return getDimension.taggedElement()\n\n case !hasOverflow && boundingSize < prevBoundingSize[dimension]:\n log('HTML bounding size decreased:', sizes)\n return returnBoundingClientRect()\n\n case scrollSize === floorBoundingSize || scrollSize === ceilBoundingSize:\n log('HTML bounding size equals page size:', sizes)\n return returnBoundingClientRect()\n\n case boundingSize > scrollSize:\n log(`Page size < HTML bounding size: ${sizes}`)\n return returnBoundingClientRect()\n\n default:\n log(`Content overflowing HTML element: ${sizes}`)\n }\n\n return Math.max(getDimension.taggedElement(), returnBoundingClientRect())\n}\n\nconst getBodyOffset = () => {\n const { body } = document\n const style = getComputedStyle(body)\n\n return (\n body.offsetHeight +\n parseInt(style.marginTop, BASE) +\n parseInt(style.marginBottom, BASE)\n )\n}\n\nconst getHeight = {\n enabled: () => calculateHeight,\n getOffset: () => offsetHeight,\n auto: () => getAutoSize(getHeight),\n bodyOffset: getBodyOffset,\n bodyScroll: () => document.body.scrollHeight,\n offset: () => getHeight.bodyOffset(), // Backwards compatibility\n custom: () => customCalcMethods.height(),\n documentElementOffset: () => document.documentElement.offsetHeight,\n documentElementScroll: () => document.documentElement.scrollHeight,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().bottom,\n max: () => Math.max(...getAllMeasurements(getHeight)),\n min: () => Math.min(...getAllMeasurements(getHeight)),\n grow: () => getHeight.max(),\n lowestElement: () => getMaxElement(HEIGHT_EDGE),\n taggedElement: () => getMaxElement(HEIGHT_EDGE),\n}\n\nconst getWidth = {\n enabled: () => calculateWidth,\n getOffset: () => offsetWidth,\n auto: () => getAutoSize(getWidth),\n bodyScroll: () => document.body.scrollWidth,\n bodyOffset: () => document.body.offsetWidth,\n custom: () => customCalcMethods.width(),\n documentElementScroll: () => document.documentElement.scrollWidth,\n documentElementOffset: () => document.documentElement.offsetWidth,\n documentElementBoundingClientRect: () =>\n document.documentElement.getBoundingClientRect().right,\n max: () => Math.max(...getAllMeasurements(getWidth)),\n min: () => Math.min(...getAllMeasurements(getWidth)),\n rightMostElement: () => getMaxElement(WIDTH_EDGE),\n scroll: () =>\n Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll()),\n taggedElement: () => getMaxElement(WIDTH_EDGE),\n}\n\nfunction sizeIFrame(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n function resizeIFrame() {\n height = currentHeight\n width = currentWidth\n sendMsg(height, width, triggerEvent, msg)\n }\n\n function isSizeChangeDetected() {\n const checkTolerance = (a, b) => !(Math.abs(a - b) <= tolerance)\n\n // currentHeight = Math.ceil(\n // undefined === customHeight ? getHeight[heightCalcMode]() : customHeight,\n // )\n\n // currentWidth = Math.ceil(\n // undefined === customWidth ? getWidth[widthCalcMode]() : customWidth,\n // )\n\n currentHeight =\n undefined === customHeight ? getHeight[heightCalcMode]() : customHeight\n currentWidth =\n undefined === customWidth ? getWidth[widthCalcMode]() : customWidth\n\n return (\n (calculateHeight && checkTolerance(height, currentHeight)) ||\n (calculateWidth && checkTolerance(width, currentWidth))\n )\n }\n\n const isForceResizableEvent = () => !(triggerEvent in { init: 1, size: 1 })\n\n const isForceResizableCalcMode = () =>\n (calculateHeight && heightCalcMode in resetRequiredMethods) ||\n (calculateWidth && widthCalcMode in resetRequiredMethods)\n\n function checkDownSizing() {\n if (isForceResizableEvent() && isForceResizableCalcMode()) {\n resetIFrame(triggerEventDesc)\n }\n }\n\n let currentHeight\n let currentWidth\n\n if (isSizeChangeDetected() || triggerEvent === 'init') {\n lockTrigger()\n resizeIFrame()\n } else {\n checkDownSizing()\n }\n}\n\nfunction sendSize(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n) {\n if (document.hidden) {\n // Currently only correctly supported in firefox\n // This is checked again on the parent page\n log('Page hidden - Ignored resize request')\n return\n }\n\n if (!(triggerEvent in nonLoggableTriggerEvents)) {\n log(`Trigger event: ${triggerEventDesc}`)\n }\n\n sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth, msg)\n}\n\nfunction lockTrigger() {\n if (triggerLocked) return\n\n triggerLocked = true\n log('Trigger event lock on')\n\n requestAnimationFrame(() => {\n triggerLocked = false\n log('Trigger event lock off')\n log('--')\n })\n}\n\nfunction triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n}\n\nfunction resetIFrame(triggerEventDesc) {\n const hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log(`Reset trigger event: ${triggerEventDesc}`)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n}\n\nfunction sendMsg(height, width, triggerEvent, msg, targetOrigin) {\n if (mode < -1) return\n\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n return\n }\n\n log(`Message targetOrigin: ${targetOrigin}`)\n }\n\n function sendToParent() {\n const size = `${height + (offsetHeight || 0)}:${width + (offsetWidth || 0)}`\n const message = `${myID}:${size}:${triggerEvent}${undefined === msg ? '' : `:${msg}`}`\n\n log(\n `Sending message to host page (${message}) via ${sameDomain ? 'sameDomain' : 'postMessage'}`,\n )\n\n if (sameDomain) {\n window.parent.iframeParentListener(msgID + message)\n return\n }\n\n target.postMessage(msgID + message, targetOrigin)\n }\n\n setTargetOrigin()\n sendToParent()\n}\n\nfunction receiver(event) {\n const processRequestFromParent = {\n init: function initFromParent() {\n initMsg = event.data\n target = event.source\n\n init()\n firstRun = false\n setTimeout(() => {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset() {\n if (initLock) {\n log('Page reset ignored by init')\n return\n }\n log('Page size reset by host page')\n triggerReset('resetPage')\n },\n\n resize() {\n sendSize('resizeParent', 'Parent window requested size check')\n },\n\n moveToAnchor() {\n inPageLinks.findTarget(getData())\n },\n\n inPageLink() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo() {\n const msgBody = getData()\n log(`PageInfo received from parent: ${msgBody}`)\n if (onPageInfo) {\n onPageInfo(JSON.parse(msgBody))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'pageInfoStop')\n }\n log(' --')\n },\n\n parentInfo() {\n const msgBody = getData()\n log(`ParentInfo received from parent: ${msgBody}`)\n if (onParentInfo) {\n onParentInfo(Object.freeze(JSON.parse(msgBody)))\n } else {\n // not expected, so cancel more messages\n sendMsg(0, 0, 'parentInfoStop')\n }\n log(' --')\n },\n\n message() {\n const msgBody = getData()\n log(`onMessage called from parent: ${msgBody}`)\n // eslint-disable-next-line sonarjs/no-extra-arguments\n onMessage(JSON.parse(msgBody))\n log(' --')\n },\n }\n\n const isMessageForUs = () => msgID === `${event.data}`.slice(0, msgIdLen)\n\n const getMessageType = () => event.data.split(']')[1].split(':')[0]\n\n const getData = () => event.data.slice(event.data.indexOf(':') + 1)\n\n const isMiddleTier = () =>\n 'iframeResize' in window ||\n (window.jQuery !== undefined && '' in window.jQuery.prototype)\n\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n const isInitMsg = () => event.data.split(':')[2] in { true: 1, false: 1 }\n\n function callFromParent() {\n const messageType = getMessageType()\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n return\n }\n\n if (!isMiddleTier() && !isInitMsg()) {\n warn(`Unexpected message (${event.data})`)\n }\n }\n\n function processMessage() {\n if (firstRun === false) {\n callFromParent()\n return\n }\n\n if (isInitMsg()) {\n processRequestFromParent.init()\n return\n }\n\n log(\n `Ignored message of type \"${getMessageType()}\". Received before initialization.`,\n )\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n}\n\n// Normally the parent kicks things off when it detects the iFrame has loaded.\n// If this script is async-loaded, then tell parent page to retry init.\nfunction chkLateLoaded() {\n if (document.readyState !== 'loading') {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n}\n\n// Don't run for server side render\nif (typeof window !== 'undefined') {\n window.iframeChildListener = (data) => receiver({ data, sameDomain: true })\n addEventListener(window, 'message', receiver)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n chkLateLoaded()\n}\n\n/* TEST CODE START */\nfunction mockMsgListener(msgObject) {\n receiver(msgObject)\n return win\n}\n\ntry {\n // eslint-disable-next-line no-restricted-globals\n if (top?.document?.getElementById('banner')) {\n win = {}\n\n // Create test hooks\n window.mockMsgListener = mockMsgListener\n\n removeEventListener(window, 'message', receiver)\n\n define([], () => mockMsgListener)\n }\n} catch (error) {\n // do nothing\n}\n\n/* TEST CODE END */\n","const encode = (s) =>\n s\n .replaceAll('<br>', '\\n')\n .replaceAll('<rb>', '\\u001B[31;1m')\n .replaceAll('</>', '\\u001B[m')\n .replaceAll('<b>', '\\u001B[1m')\n .replaceAll('<i>', '\\u001B[3m')\n .replaceAll('<u>', '\\u001B[4m')\n\nconst remove = (s) => s.replaceAll('<br>', '\\n').replaceAll(/<[/a-z]+>/gi, '')\n\nexport default (formatLogMsg) => (msg) =>\n window.chrome // Only show formatting in Chrome as not supported in other browsers\n ? formatLogMsg(encode(msg))\n : formatLogMsg(remove(msg))\n"],"names":["VERSION","BASE","SIZE_ATTR","OVERFLOW_ATTR","HEIGHT_EDGE","WIDTH_EDGE","addEventListener","el","evt","func","options","removeEventListener","y","Object","fromEntries","map","l","p","Math","max","getModeData","replaceAll","String","fromCodePoint","codePointAt","once","fn","done","undefined","Reflect","apply","this","arguments","id","x","side","onChange","root","document","documentElement","rootMargin","threshold","overflowedElements","observedElements","WeakSet","observer","IntersectionObserver","entries","forEach","entry","target","toggleAttribute","boundingClientRect","rootBounds","isTarget","querySelectorAll","overflowObserver","nodeList","has","observe","add","isOverflowed","length","checkVisibilityOptions","contentVisibilityAuto","opacityProperty","visibilityProperty","customCalcMethods","height","warn","getHeight","auto","width","getWidth","deprecatedResizeMethods","bodyOffset","bodyScroll","offset","documentElementOffset","documentElementScroll","documentElementBoundingClientRect","min","grow","lowestElement","eventCancelTimer","eventHandlersByName","hasCheckVisibility","window","heightCalcModeDefault","msgID","msgIdLen","resetRequiredMethods","resizeObserveTargets","widthCalcModeDefault","offsetHeight","offsetWidth","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyObserver","bodyPadding","calculateHeight","calculateWidth","calcElements","firstRun","hasTags","heightCalcMode","initLock","initMsg","inPageLinks","isInit","logging","mode","mouseEvents","myID","observeOverflow","resizeFrom","resizeObserver","sameDomain","sizeSelector","parent","targetOriginDefault","tolerance","triggerLocked","version","widthCalcMode","win","onMessage","onReady","onPageInfo","onParentInfo","isDef","value","usedTags","addUsedTag","getElementName","nodeName","toUpperCase","name","className","formatLogMsg","msg","join","info","console","advise","chrome","formatAdvise","adviser","init","strBool","str","data","slice","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","JSON","stringify","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","reset","resetIFrame","scrollBy","scrollTo","scrollToOffset","sendMessage","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","customHeight","customWidth","sendSize","size","parentIFrame","setupPublicMethods","sendMouse","e","type","screenY","screenX","addMouseListener","setupMouseEvents","getPagePosition","scrollLeft","scrollTop","getElementPosition","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","location","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","href","bindAnchors","setupLink","linkClicked","preventDefault","getAttribute","bindLocationHash","initCheck","setTimeout","enableInPageLinks","setupInPageLinks","body","setBodyStyle","includes","chkCSS","setMargin","clearFix","createElement","style","clear","display","append","injectClearFixIntoBodyElement","setAutoHeight","setProperty","stopInfiniteResizingOfIFrame","applySizeSelector","title","taggedElements","getAllElements","dataset","iframeSize","manageTriggerEvent","eventName","handleEvent","eventType","passive","remove","method","checkCalcMode","calcModeDefault","modes","mutationObserved","mutations","addResizeObservers","createMutationObserver","MutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","setupBodyMutationObserver","ResizeObserver","resizeObserved","createResizeObservers","dispatchResized","Array","isArray","checkPositionType","element","getComputedStyle","position","getAllNonStaticElements","filter","resizeSet","setupResizeObservers","flatMap","mutation","lastEl","perfWarned","lastTimer","getMaxElement","Side","string","charAt","elVal","maxEl","maxVal","bottom","timer","performance","now","targetElements","len","checkVisibility","parseFloat","getPropertyValue","toPrecision","time","usedEl","logMsg","maxChars","outer","outerHTML","toString","elementSnippet","getAllMeasurements","dimension","prevScrollSize","prevBoundingSize","getAutoSize","getDimension","returnBoundingClientRect","boundingSize","scrollSize","hasOverflow","isHeight","ceilBoundingSize","ceil","floorBoundingSize","floor","getOffset","getAdjustedScroll","enabled","taggedElement","marginTop","marginBottom","scrollHeight","custom","scrollWidth","right","rightMostElement","scroll","sizeIFrame","triggerEvent","triggerEventDesc","currentHeight","currentWidth","checkTolerance","a","b","abs","isSizeChangeDetected","lockTrigger","hidden","requestAnimationFrame","triggerReset","hcm","message","iframeParentListener","postMessage","sendToParent","receiver","event","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parse","parentInfo","getMessageType","indexOf","isMiddleTier","jQuery","isInitMsg","true","false","messageType","callFromParent","chkLateLoaded","readyState","iframeChildListener"],"mappings":";;;;;;;;;;;;;;;;;;;2FAAO,MAAMA,EAAU,eAEVC,EAAO,GAGPC,EAAY,mBACZC,EAAgB,uBAEhBC,EAAc,SACdC,EAAa,QCTbC,EAAmB,CAACC,EAAIC,EAAKC,EAAMC,IAC9CH,EAAGD,iBAAiBE,EAAK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