@iframe-resizer/child 5.1.4 → 5.2.0-beta.2

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 CHANGED
@@ -22,4 +22,4 @@ yarn add @iframe-resizer/child
22
22
 
23
23
  ---
24
24
 
25
- _iframe-resizer version 5.1.4 2024-06-25 - 09:35:49.581Z_
25
+ _iframe-resizer version 5.2.0-beta.2 2024-07-02 - 16:09:34.888Z_
@@ -9,129 +9,126 @@
9
9
  */
10
10
 
11
11
  declare module '@iframe-resizer/child' {
12
- namespace iframeResizer {
13
- // eslint-disable-next-line @typescript-eslint/naming-convention
14
- interface IFramePageOptions {
15
- /**
16
- * This option allows you to restrict the domain of the parent page,
17
- * to prevent other sites mimicking your parent page.
18
- */
19
- targetOrigin?: string | undefined
20
-
21
- /**
22
- * Receive message posted from the parent page with the iframe.iFrameResizer.sendMessage() method.
23
- */
24
- onMessage?(message: any): void
25
-
26
- /**
27
- * This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page.
28
- */
29
- onReady?(): void
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
- // eslint-disable-next-line @typescript-eslint/naming-convention
33
- interface IFramePage {
34
- /**
35
- * Turn autoResizing of the iFrame on and off. Returns bool of current state.
36
- */
37
- autoResize(resize?: boolean): boolean
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
- interface ParentProps {
93
- /**
94
- * The values returned by iframe.getBoundingClientRect()
95
- */
96
- iframe: {
97
- x: number
98
- y: number
99
- width: number
100
- height: number
101
- top: number
102
- right: number
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: iframeResizer.IFramePageOptions
133
- parentIFrame: iframeResizer.IFramePage
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 (cjs) - 2024-06-25
4
+ * @module iframe-resizer/child 5.2.0-beta.2 (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.4",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:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.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=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(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 ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!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`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("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)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<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&&me(`<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`)}(),ze(),Se(),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&&me("<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")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<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,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<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(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<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){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),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);Qe(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?Qe(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?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(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 ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<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 ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}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(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(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,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(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: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<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}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=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 Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<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 qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,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===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!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:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!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(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[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)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(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 Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(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()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye());
20
+ "use strict";const e="5.2.0-beta.2",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),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e;let m=i,f=u;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const g=new WeakSet,y=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=>{g.has(e)||(y.observe(e),g.add(e))}))),b=()=>h.length>0,z={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},w={height:()=>(Me("Custom height calculation function not defined"),it.auto()),width:()=>(Me("Custom width calculation function not defined"),rt.auto())},$={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},S=128,j={},P="checkVisibility"in window,E="auto",M={reset:1,resetPage:1,init:1},T="[iFrameSizer]",C=T.length,A={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],I="scroll";let R,k,N=!0,x="",L=0,B="",q=null,H="",W=!0,F=!1,D=null,U=!0,V=!1,J=1,Z=E,Q=!0,X="",Y={},G=!0,K=!1,_=0,ee=!1,te="",ne=u,oe="child",ie=null,re=!1,ae="",le=window.parent,se="*",ce=0,de=!1,ue="",me=1,fe=I,pe=window,he=()=>{Me("onMessage function not defined")},ge=()=>{},ye=null,ve=null;const be=e=>e.charAt(0).toUpperCase()+e.slice(1),ze=e=>""!=`${e}`&&void 0!==e,we=new WeakSet,$e=e=>"object"==typeof e&&we.add(e);function Se(e){switch(!0){case!ze(e):return"";case ze(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ze(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ze(e.className)?`.${e.className}`:"")}}const je=(...e)=>[`[iframe-resizer][${te}]`,...e].join(" "),Pe=(...e)=>K&&console?.log(je(...e)),Ee=(...e)=>console?.info(`[iframe-resizer][${te}]`,...e),Me=(...e)=>console?.warn(je(...e)),Te=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(je)(...e)),Ce=e=>Te(e);function Ae(){!function(){const e=e=>"true"===e,t=X.slice(C).split(":");te=t[0],L=void 0===t[1]?L:Number(t[1]),F=void 0===t[2]?F:e(t[2]),K=void 0===t[3]?K:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],Z=void 0===t[8]?Z:t[8],x=t[9],H=t[10],ce=void 0===t[11]?ce:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),oe=void 0===t[13]?oe:t[13],fe=void 0===t[14]?fe:t[14],ee=void 0===t[15]?ee:e(t[15]),R=void 0===t[16]?R:Number(t[16]),k=void 0===t[17]?k:Number(t[17]),W=void 0===t[18]?W:e(t[18]),t[19],ue=t[20]||ue,_=void 0===t[21]?_:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;Pe(`Reading data from page: ${JSON.stringify(e)}`),he=e?.onMessage||he,ge=e?.onReady||ge,"number"==typeof e?.offset&&(W&&(R=e?.offset),F&&(k=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(ae=e.sizeSelector),se=e?.targetOrigin||se,Z=e?.heightCalculationMethod||Z,fe=e?.widthCalculationMethod||fe}function t(e,t){return"function"==typeof e&&(Pe(`Setup custom ${t}CalcMethod`),w[t]=e,e="custom"),e}if(1===_)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),Z=t(Z,"height"),fe=t(fe,"width"));Pe(`TargetOrigin for parent set to: ${se}`)}(),Pe(`Initialising iFrame v${e} (${window.location.href})`),function(){try{re="iframeParentListener"in window.parent}catch(e){Pe("Cross domain iframe detected.")}}(),_<0?Ce(`${c(_+2)}${c(2)}`):ue.codePointAt(0)>4||_<2&&Ce(c(3)),function(){if(!ue||""===ue||"false"===ue)return void Te("<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&&Te(`<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`)}(),Be(),qe(),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&&Te("<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(W===F)return;ne=v({onChange:d(Oe),side:W?i:r})}(),Ie(),function(){if(1===_)return;pe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,He()):!1===e&&!0===N&&(N=!1,xe("remove"),ie?.disconnect(),q?.disconnect()),ut(0,0,"autoResize",JSON.stringify(N)),N),close(){ut(0,0,"close")},getId:()=>te,getPageInfo(e){if("function"==typeof e)return ye=e,ut(0,0,"pageInfo"),void Te("<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,ut(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ve=e,ut(0,0,"parentInfo"),()=>{ve=null,ut(0,0,"parentInfoStop")}},getParentProperties(e){Te("<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){Y.findTarget(e)},reset(){dt("parentIFrame.reset")},scrollBy(e,t){ut(t,e,"scrollBy")},scrollTo(e,t){ut(t,e,"scrollTo")},scrollToOffset(e,t){ut(t,e,"scrollToOffset")},sendMessage(e,t){ut(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Z=e,Be()},setWidthCalculationMethod(e){fe=e,qe()},setTargetOrigin(e){Pe(`Set targetOrigin: ${e}`),se=e},resize(e,t){lt("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Te("<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)}}),pe.parentIFrame=pe.parentIframe}(),function(){if(!0!==ee)return;function e(e){ut(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Pe(`Add event listener: ${n}`),a(window.document,t,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}(),Y=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);Pe(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),ut(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?(Pe(`In page link (#${o}) not found in iFrame, so sending to parent`),ut(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 s(){setTimeout(i,S)}function c(){Pe("Setting up location.hash handlers"),r(),l(),s()}Y.enable?1===_?Te("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c():Pe("In page linking not enabled");return{findTarget:o}}(),$e(document.documentElement),$e(document.body),function(){void 0===B&&(B=`${L}px`);Re("margin",function(e,t){t.includes("-")&&(Me(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Re("background",x),Re("padding",H),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('HTML & body height set to "auto !important"')}(),ke()}const Oe=()=>{lt("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ut(0,0,"title",document.title),He(),ge(),G=!1,Pe("Initialization complete"),Pe("---")};function Ie(){const e=document.querySelectorAll(`[${n}]`);V=e.length>0,Pe(`Tagged elements found: ${V}`),D=V?e:et(document)(),V?setTimeout(Oe):ne(D)}function Re(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Pe(`Body ${e} set to "${t}"`))}function ke(){""!==ae&&(Pe(`Applying sizeSelector: ${ae}`),document.querySelectorAll(ae).forEach((e=>{Pe(`Applying data-iframe-size to: ${Se(e)}`),e.dataset.iframeSize=!0})))}function Ne(e){({add(t){function n(){lt(e.eventName,e.eventType)}j[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=j[e];delete j[e],l(window,e,t)}})[e.method](e.eventName),Pe(`${be(e.method)} event listener: ${e.eventType}`)}function xe(e){Ne({method:e,eventType:"After Print",eventName:"afterprint"}),Ne({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ne({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Le(e,t,n,o){return t!==e&&(e in n||(Me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in $&&Te(`<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.`),Pe(`${o} calculation method set to "${e}"`)),e}function Be(){Z=Le(Z,E,it,"height")}function qe(){fe=Le(fe,I,rt,"width")}function He(){!0===N?(xe("add"),q=function(){function e(e){e.forEach(Qe),ke(),Ie()}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 Pe("Create <body/> MutationObserver"),t.observe(n,o),t}const n=t();return{disconnect(){Pe("Disconnect MutationObserver"),n.disconnect()}}}(),ie=new ResizeObserver(Fe),Ze(window.document)):Pe("Auto Resize disabled")}let We;function Fe(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;We=()=>lt("resizeObserver",`Resize Observed: ${Se(t)}`),setTimeout((()=>{We&&We(),We=void 0}),0)}const De=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...et(document)()].filter(De),Ve=new WeakSet;function Je(e){e&&(Ve.has(e)||(ie.observe(e),Ve.add(e),Pe(`Attached resizeObserver: ${Se(e)}`)))}function Ze(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Je)}function Qe(e){"childList"===e.type&&Ze(e.target)}let Xe=null;let Ye=4,Ge=4;function Ke(e){const t=be(e);let n=0,o=document.documentElement,i=V?0:document.documentElement.getBoundingClientRect().bottom,r=performance.now();const a=!V&&b()?h:D;let l=a.length;a.forEach((t=>{V||!P||t.checkVisibility(z)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,o=t)):l-=1})),r=(performance.now()-r).toPrecision(1),function(e,t,n,o){we.has(e)||Xe===e||V&&o<=1||(Xe=e,Ee(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${V?"tagged":"potentially overflowing"} elements in ${n}ms`))}(o,t,r,l);const s=`\nParsed ${l} element${1===l?"":"s"} in ${r}ms\n${t} ${V?"tagged ":""}element found at: ${i}px\nPosition calculated from HTML element: ${Se(o)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(o,100)})`;return r<4||l<99||V||G?Pe(s):Ye<r&&Ye<Ge&&(Ye=1.2*r,Te(`<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}`)),Ge=r,i}const _e=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],et=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)"),tt={height:0,width:0},nt={height:0,width:0};function ot(e){function t(){return nt[i]=r,tt[i]=s,r}const n=b(),o=e===it,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: ${r} Page: ${s}`;switch(!0){case!e.enabled():return s;case V:return e.taggedElement();case!n&&0===nt[i]&&0===tt[i]:return Pe(`Initial page size values: ${c}`),t();case de&&r===nt[i]&&s===tt[i]:return Pe(`Size unchanged: ${c}`),Math.max(r,s);case 0===r:return Pe(`Page is hidden: ${c}`),s;case!n&&r!==nt[i]&&s<=tt[i]:return Pe(`New HTML bounding size: ${c}`,"Previous bounding size:",nt[i]),t();case!o:return e.taggedElement();case!n&&r<nt[i]:return Pe("HTML bounding size decreased:",c),t();case s===l||s===a:return Pe("HTML bounding size equals page size:",c),t();case r>s:return Pe(`Page size < HTML bounding size: ${c}`),t();default:Pe(`Content overflowing HTML element: ${c}`)}return Math.max(e.taggedElement(),t())}const it={enabled:()=>W,getOffset:()=>R,auto:()=>ot(it),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>it.bodyOffset(),custom:()=>w.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(..._e(it)),min:()=>Math.min(..._e(it)),grow:()=>it.max(),lowestElement:()=>Ke(i),taggedElement:()=>Ke(i)},rt={enabled:()=>F,getOffset:()=>k,auto:()=>ot(rt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>w.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(..._e(rt)),min:()=>Math.min(..._e(rt)),rightMostElement:()=>Ke(r),scroll:()=>Math.max(rt.bodyScroll(),rt.documentElementScroll()),taggedElement:()=>Ke(r)};function at(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?it[Z]():n,a=void 0===o?rt[fe]():o,W&&e(J,r)||F&&e(me,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(W&&Z in A||F&&fe in A)&&dt(t):(st(),J=r,me=a,ut(J,me,e,i))}function lt(e,t,n,o,i){document.hidden?Pe("Page hidden - Ignored resize request"):(e in M||Pe(`Trigger event: ${t}`),at(e,t,n,o,i))}function st(){de||(de=!0,Pe("Trigger event lock on"),requestAnimationFrame((()=>{de=!1,Pe("Trigger event lock off"),Pe("--")})))}function ct(e){J=it[Z](),me=rt[fe](),ut(J,me,e)}function dt(e){const t=Z;Z=E,Pe(`Reset trigger event: ${e}`),st(),ct("reset"),Z=t}function ut(e,t,n,o,i){_<-1||(void 0!==i?Pe(`Message targetOrigin: ${i}`):i=se,function(){const r=`${te}:${`${e+(R||0)}:${t+(k||0)}`}:${n}${void 0===o?"":`:${o}`}`;Pe(`Sending message to host page (${r}) via ${re?"sameDomain":"postMessage"}`),re?window.parent.iframeParentListener(T+r):le.postMessage(T+r,i)}())}function mt(e){const t={init:function(){X=e.data,le=e.source,Ae(),U=!1,setTimeout((()=>{Q=!1}),S)},reset(){Q?Pe("Page reset ignored by init"):(Pe("Page size reset by host page"),ct("resetPage"))},resize(){lt("resizeParent","Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();Pe(`PageInfo received from parent: ${e}`),ye?ye(JSON.parse(e)):ut(0,0,"pageInfoStop"),Pe(" --")},parentInfo(){const e=o();Pe(`ParentInfo received from parent: ${e}`),ve?ve(Object.freeze(JSON.parse(e))):ut(0,0,"parentInfoStop"),Pe(" --")},message(){const e=o();Pe(`onMessage called from parent: ${e}`),he(JSON.parse(e)),Pe(" --")}},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};T===`${e.data}`.slice(0,C)&&(!1!==U?r()?t.init():Pe(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||Me(`Unexpected message (${e.data})`)}())}function ft(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>mt({data:e,sameDomain:!0}),a(window,"message",mt),a(window,"readystatechange",ft),ft());
21
+ //# sourceMappingURL=index.cjs.js.map
@@ -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","nonLoggableTriggerEvents","reset","resetPage","init","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","capitalizeFirstLetter","string","charAt","toUpperCase","slice","isDef","value","usedTags","addUsedTag","getElementName","nodeName","name","className","formatLogMsg","msg","join","log","console","info","advise","chrome","formatAdvise","adviser","strBool","str","data","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","JSON","stringify","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","location","href","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","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","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","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","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","sizes","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,IAChBA,EAAQC,SAASC,IACfA,EAAMC,OAAOC,gBAAgBhD,EANhB,CAAC8C,GACmB,IAAnCA,EAAMG,mBAAmBjB,IACzBc,EAAMG,mBAAmBjB,GAAQc,EAAMI,WAAWlB,GAIJmB,CAASL,GAAO,IAG9DP,EAAqBJ,SAASiB,iBAAiB,IAAIpD,MACnDiC,GAAU,GAGwC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AAM,KAAK,GAAGA,MAAM,KAAK,GAE3D8O,EAAU,IAAMH,EAAM5O,KAAKrB,MAAMiQ,EAAM5O,KAAKsP,QAAQ,KAAO,GAE3DC,EAAe,IACnB,iBAAkBjU,aACC3D,IAAlB2D,OAAOkU,QAAwB,KAAMlU,OAAOkU,OAAO9O,UAIhD+O,EAAY,IAAMb,EAAM5O,KAAKC,MAAM,KAAK,IAAM,CAAEyP,KAAM,EAAGC,MAAO,GAZzC/T,IAAU,GAAGgT,EAAM5O,OAAOrB,MAAM,EAAG9C,MA4B7C,IAAbe,EAKA6S,IACFZ,EAAyBlT,OAI3B4D,GACE,4BAA4B8P,yCAzBhC,WACE,MAAMO,EAAcP,IAEhBO,KAAef,EACjBA,EAAyBe,KAItBL,KAAmBE,KACtBrV,GAAK,uBAAuBwU,EAAM5O,QAErC,CAIG6P,GAiBN,CAIA,SAASC,KACqB,YAAxBzX,SAAS0X,YACXzU,OAAOsC,OAAO6Q,YAAY,4BAA6B,IAE3D,CAGsB,oBAAXnT,SACTA,OAAO0U,oBAAuBhQ,GAAS2O,GAAS,CAAE3O,OAAMtC,YAAY,IACpErH,EAAiBiF,OAAQ,UAAWqT,IACpCtY,EAAiBiF,OAAQ,mBAAoBwU,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 (esm) - 2024-06-25
4
+ * @module iframe-resizer/child 5.2.0-beta.2 (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.4",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:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.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=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(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 ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!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`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("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)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<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&&me(`<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`)}(),ze(),Se(),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&&me("<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")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<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,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<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(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<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){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),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);Qe(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?Qe(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?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(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 ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<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 ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}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(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(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,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(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: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<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}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=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 Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<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 qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,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===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!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:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!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(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[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)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(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 Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(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()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye());
20
+ const e="5.2.0-beta.2",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),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e;let m=i,f=u;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const g=new WeakSet,y=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=>{g.has(e)||(y.observe(e),g.add(e))}))),b=()=>h.length>0,z={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},w={height:()=>(Me("Custom height calculation function not defined"),it.auto()),width:()=>(Me("Custom width calculation function not defined"),rt.auto())},$={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},S=128,j={},P="checkVisibility"in window,E="auto",M={reset:1,resetPage:1,init:1},T="[iFrameSizer]",C=T.length,A={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],I="scroll";let R,k,N=!0,x="",L=0,B="",q=null,H="",W=!0,F=!1,D=null,U=!0,V=!1,J=1,Z=E,Q=!0,X="",Y={},G=!0,K=!1,_=0,ee=!1,te="",ne=u,oe="child",ie=null,re=!1,ae="",le=window.parent,se="*",ce=0,de=!1,ue="",me=1,fe=I,pe=window,he=()=>{Me("onMessage function not defined")},ge=()=>{},ye=null,ve=null;const be=e=>e.charAt(0).toUpperCase()+e.slice(1),ze=e=>""!=`${e}`&&void 0!==e,we=new WeakSet,$e=e=>"object"==typeof e&&we.add(e);function Se(e){switch(!0){case!ze(e):return"";case ze(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ze(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ze(e.className)?`.${e.className}`:"")}}const je=(...e)=>[`[iframe-resizer][${te}]`,...e].join(" "),Pe=(...e)=>K&&console?.log(je(...e)),Ee=(...e)=>console?.info(`[iframe-resizer][${te}]`,...e),Me=(...e)=>console?.warn(je(...e)),Te=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(je)(...e)),Ce=e=>Te(e);function Ae(){!function(){const e=e=>"true"===e,t=X.slice(C).split(":");te=t[0],L=void 0===t[1]?L:Number(t[1]),F=void 0===t[2]?F:e(t[2]),K=void 0===t[3]?K:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],Z=void 0===t[8]?Z:t[8],x=t[9],H=t[10],ce=void 0===t[11]?ce:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),oe=void 0===t[13]?oe:t[13],fe=void 0===t[14]?fe:t[14],ee=void 0===t[15]?ee:e(t[15]),R=void 0===t[16]?R:Number(t[16]),k=void 0===t[17]?k:Number(t[17]),W=void 0===t[18]?W:e(t[18]),t[19],ue=t[20]||ue,_=void 0===t[21]?_:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;Pe(`Reading data from page: ${JSON.stringify(e)}`),he=e?.onMessage||he,ge=e?.onReady||ge,"number"==typeof e?.offset&&(W&&(R=e?.offset),F&&(k=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(ae=e.sizeSelector),se=e?.targetOrigin||se,Z=e?.heightCalculationMethod||Z,fe=e?.widthCalculationMethod||fe}function t(e,t){return"function"==typeof e&&(Pe(`Setup custom ${t}CalcMethod`),w[t]=e,e="custom"),e}if(1===_)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),Z=t(Z,"height"),fe=t(fe,"width"));Pe(`TargetOrigin for parent set to: ${se}`)}(),Pe(`Initialising iFrame v${e} (${window.location.href})`),function(){try{re="iframeParentListener"in window.parent}catch(e){Pe("Cross domain iframe detected.")}}(),_<0?Ce(`${c(_+2)}${c(2)}`):ue.codePointAt(0)>4||_<2&&Ce(c(3)),function(){if(!ue||""===ue||"false"===ue)return void Te("<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&&Te(`<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`)}(),Be(),qe(),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&&Te("<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(W===F)return;ne=v({onChange:d(Oe),side:W?i:r})}(),Ie(),function(){if(1===_)return;pe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,He()):!1===e&&!0===N&&(N=!1,xe("remove"),ie?.disconnect(),q?.disconnect()),ut(0,0,"autoResize",JSON.stringify(N)),N),close(){ut(0,0,"close")},getId:()=>te,getPageInfo(e){if("function"==typeof e)return ye=e,ut(0,0,"pageInfo"),void Te("<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,ut(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ve=e,ut(0,0,"parentInfo"),()=>{ve=null,ut(0,0,"parentInfoStop")}},getParentProperties(e){Te("<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){Y.findTarget(e)},reset(){dt("parentIFrame.reset")},scrollBy(e,t){ut(t,e,"scrollBy")},scrollTo(e,t){ut(t,e,"scrollTo")},scrollToOffset(e,t){ut(t,e,"scrollToOffset")},sendMessage(e,t){ut(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Z=e,Be()},setWidthCalculationMethod(e){fe=e,qe()},setTargetOrigin(e){Pe(`Set targetOrigin: ${e}`),se=e},resize(e,t){lt("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Te("<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)}}),pe.parentIFrame=pe.parentIframe}(),function(){if(!0!==ee)return;function e(e){ut(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Pe(`Add event listener: ${n}`),a(window.document,t,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}(),Y=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);Pe(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),ut(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?(Pe(`In page link (#${o}) not found in iFrame, so sending to parent`),ut(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 s(){setTimeout(i,S)}function c(){Pe("Setting up location.hash handlers"),r(),l(),s()}Y.enable?1===_?Te("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c():Pe("In page linking not enabled");return{findTarget:o}}(),$e(document.documentElement),$e(document.body),function(){void 0===B&&(B=`${L}px`);Re("margin",function(e,t){t.includes("-")&&(Me(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Re("background",x),Re("padding",H),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('HTML & body height set to "auto !important"')}(),ke()}const Oe=()=>{lt("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ut(0,0,"title",document.title),He(),ge(),G=!1,Pe("Initialization complete"),Pe("---")};function Ie(){const e=document.querySelectorAll(`[${n}]`);V=e.length>0,Pe(`Tagged elements found: ${V}`),D=V?e:et(document)(),V?setTimeout(Oe):ne(D)}function Re(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Pe(`Body ${e} set to "${t}"`))}function ke(){""!==ae&&(Pe(`Applying sizeSelector: ${ae}`),document.querySelectorAll(ae).forEach((e=>{Pe(`Applying data-iframe-size to: ${Se(e)}`),e.dataset.iframeSize=!0})))}function Ne(e){({add(t){function n(){lt(e.eventName,e.eventType)}j[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=j[e];delete j[e],l(window,e,t)}})[e.method](e.eventName),Pe(`${be(e.method)} event listener: ${e.eventType}`)}function xe(e){Ne({method:e,eventType:"After Print",eventName:"afterprint"}),Ne({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ne({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Le(e,t,n,o){return t!==e&&(e in n||(Me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in $&&Te(`<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.`),Pe(`${o} calculation method set to "${e}"`)),e}function Be(){Z=Le(Z,E,it,"height")}function qe(){fe=Le(fe,I,rt,"width")}function He(){!0===N?(xe("add"),q=function(){function e(e){e.forEach(Qe),ke(),Ie()}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 Pe("Create <body/> MutationObserver"),t.observe(n,o),t}const n=t();return{disconnect(){Pe("Disconnect MutationObserver"),n.disconnect()}}}(),ie=new ResizeObserver(Fe),Ze(window.document)):Pe("Auto Resize disabled")}let We;function Fe(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;We=()=>lt("resizeObserver",`Resize Observed: ${Se(t)}`),setTimeout((()=>{We&&We(),We=void 0}),0)}const De=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...et(document)()].filter(De),Ve=new WeakSet;function Je(e){e&&(Ve.has(e)||(ie.observe(e),Ve.add(e),Pe(`Attached resizeObserver: ${Se(e)}`)))}function Ze(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Je)}function Qe(e){"childList"===e.type&&Ze(e.target)}let Xe=null;let Ye=4,Ge=4;function Ke(e){const t=be(e);let n=0,o=document.documentElement,i=V?0:document.documentElement.getBoundingClientRect().bottom,r=performance.now();const a=!V&&b()?h:D;let l=a.length;a.forEach((t=>{V||!P||t.checkVisibility(z)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,o=t)):l-=1})),r=(performance.now()-r).toPrecision(1),function(e,t,n,o){we.has(e)||Xe===e||V&&o<=1||(Xe=e,Ee(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${V?"tagged":"potentially overflowing"} elements in ${n}ms`))}(o,t,r,l);const s=`\nParsed ${l} element${1===l?"":"s"} in ${r}ms\n${t} ${V?"tagged ":""}element found at: ${i}px\nPosition calculated from HTML element: ${Se(o)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(o,100)})`;return r<4||l<99||V||G?Pe(s):Ye<r&&Ye<Ge&&(Ye=1.2*r,Te(`<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}`)),Ge=r,i}const _e=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],et=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)"),tt={height:0,width:0},nt={height:0,width:0};function ot(e){function t(){return nt[i]=r,tt[i]=s,r}const n=b(),o=e===it,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: ${r} Page: ${s}`;switch(!0){case!e.enabled():return s;case V:return e.taggedElement();case!n&&0===nt[i]&&0===tt[i]:return Pe(`Initial page size values: ${c}`),t();case de&&r===nt[i]&&s===tt[i]:return Pe(`Size unchanged: ${c}`),Math.max(r,s);case 0===r:return Pe(`Page is hidden: ${c}`),s;case!n&&r!==nt[i]&&s<=tt[i]:return Pe(`New HTML bounding size: ${c}`,"Previous bounding size:",nt[i]),t();case!o:return e.taggedElement();case!n&&r<nt[i]:return Pe("HTML bounding size decreased:",c),t();case s===l||s===a:return Pe("HTML bounding size equals page size:",c),t();case r>s:return Pe(`Page size < HTML bounding size: ${c}`),t();default:Pe(`Content overflowing HTML element: ${c}`)}return Math.max(e.taggedElement(),t())}const it={enabled:()=>W,getOffset:()=>R,auto:()=>ot(it),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>it.bodyOffset(),custom:()=>w.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(..._e(it)),min:()=>Math.min(..._e(it)),grow:()=>it.max(),lowestElement:()=>Ke(i),taggedElement:()=>Ke(i)},rt={enabled:()=>F,getOffset:()=>k,auto:()=>ot(rt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>w.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(..._e(rt)),min:()=>Math.min(..._e(rt)),rightMostElement:()=>Ke(r),scroll:()=>Math.max(rt.bodyScroll(),rt.documentElementScroll()),taggedElement:()=>Ke(r)};function at(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?it[Z]():n,a=void 0===o?rt[fe]():o,W&&e(J,r)||F&&e(me,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(W&&Z in A||F&&fe in A)&&dt(t):(st(),J=r,me=a,ut(J,me,e,i))}function lt(e,t,n,o,i){document.hidden?Pe("Page hidden - Ignored resize request"):(e in M||Pe(`Trigger event: ${t}`),at(e,t,n,o,i))}function st(){de||(de=!0,Pe("Trigger event lock on"),requestAnimationFrame((()=>{de=!1,Pe("Trigger event lock off"),Pe("--")})))}function ct(e){J=it[Z](),me=rt[fe](),ut(J,me,e)}function dt(e){const t=Z;Z=E,Pe(`Reset trigger event: ${e}`),st(),ct("reset"),Z=t}function ut(e,t,n,o,i){_<-1||(void 0!==i?Pe(`Message targetOrigin: ${i}`):i=se,function(){const r=`${te}:${`${e+(R||0)}:${t+(k||0)}`}:${n}${void 0===o?"":`:${o}`}`;Pe(`Sending message to host page (${r}) via ${re?"sameDomain":"postMessage"}`),re?window.parent.iframeParentListener(T+r):le.postMessage(T+r,i)}())}function mt(e){const t={init:function(){X=e.data,le=e.source,Ae(),U=!1,setTimeout((()=>{Q=!1}),S)},reset(){Q?Pe("Page reset ignored by init"):(Pe("Page size reset by host page"),ct("resetPage"))},resize(){lt("resizeParent","Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();Pe(`PageInfo received from parent: ${e}`),ye?ye(JSON.parse(e)):ut(0,0,"pageInfoStop"),Pe(" --")},parentInfo(){const e=o();Pe(`ParentInfo received from parent: ${e}`),ve?ve(Object.freeze(JSON.parse(e))):ut(0,0,"parentInfoStop"),Pe(" --")},message(){const e=o();Pe(`onMessage called from parent: ${e}`),he(JSON.parse(e)),Pe(" --")}},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};T===`${e.data}`.slice(0,C)&&(!1!==U?r()?t.init():Pe(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||Me(`Unexpected message (${e.data})`)}())}function ft(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>mt({data:e,sameDomain:!0}),a(window,"message",mt),a(window,"readystatechange",ft),ft());
21
+ //# sourceMappingURL=index.esm.js.map
@@ -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","nonLoggableTriggerEvents","reset","resetPage","init","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","capitalizeFirstLetter","string","charAt","toUpperCase","slice","isDef","value","usedTags","addUsedTag","getElementName","nodeName","name","className","formatLogMsg","msg","join","log","console","info","advise","chrome","formatAdvise","adviser","strBool","str","data","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","JSON","stringify","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","location","href","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","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","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","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","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","sizes","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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,EAAiBiF,OAAQ,mBAAoBwU,IAC7CA"}
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.1.4 (umd) - 2024-06-25
4
+ * @module iframe-resizer/child 5.2.0-beta.2 (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.4",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:()=>(de("Custom height calculation function not defined"),He.auto()),width:()=>(de("Custom width calculation function not defined"),We.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=()=>{de("onMessage function not defined")},te=()=>{},ne=null,oe=null;const ie=e=>""!=`${e}`&&void 0!==e,re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);function le(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 ce(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}const se=(...e)=>[`[iframe-resizer][${H}]`,...e].join(" "),ue=(...e)=>console?.info(se(...e)),de=(...e)=>console?.warn(se(...e)),me=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(se)(...e)),fe=e=>me(e);function pe(){!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`);he("margin",function(e,t){t.includes("-")&&(de(`Negative CSS value ignored for ${e}`),t="");return t}("margin",j))}(),he("background",S),he("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)}(),ye(),L<0?fe(`${a(L+2)}${a(2)}`):Y.codePointAt(0)>4||L<2&&fe(a(3)),function(){if(!Y||""===Y||"false"===Y)return void me("<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&&me(`<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`)}(),ze(),Se(),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&&me("<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")),be(),function(){if(1===L)return;_.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===z?(z=!0,$e()):!1===e&&!0===z&&(z=!1,ve("remove"),U?.disconnect(),E?.disconnect()),Qe(0,0,"autoResize",JSON.stringify(z)),z),close(){Qe(0,0,"close")},getId:()=>H,getPageInfo(e){if("function"==typeof e)return ne=e,Qe(0,0,"pageInfo"),void me("<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,Qe(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return oe=e,Qe(0,0,"parentInfo"),()=>{oe=null,Qe(0,0,"parentInfoStop")}},getParentProperties(e){me("<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(){Ze()},scrollBy(e,t){Qe(t,e,"scrollBy")},scrollTo(e,t){Qe(t,e,"scrollTo")},scrollToOffset(e,t){Qe(t,e,"scrollToOffset")},sendMessage(e,t){Qe(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){k=e,ze()},setWidthCalculationMethod(e){K=e,Se()},setTargetOrigin(e){Z=e},resize(e,t){Fe("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){me("<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){Qe(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){o(window.document,t,e)}t("mouseenter"),t("mouseleave")}(),$e(),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);Qe(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?Qe(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?me("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):s());return{findTarget:i}}(),ae(document.documentElement),ae(document.body),Fe("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Qe(0,0,"title",document.title),te(),B=!1}function he(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function ye(){""!==V&&document.querySelectorAll(V).forEach((e=>{e.dataset.iframeSize=!0}))}function ge(e){({add(t){function n(){Fe(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 ve(e){ge({method:e,eventType:"After Print",eventName:"afterprint"}),ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function be(){const e=document.querySelectorAll(`[${n}]`);T=e.length>0,A=T?e:Ne(document)()}function we(e,t,n,o){return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in s&&me(`<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 ze(){k=we(k,f,He,"height")}function Se(){K=we(K,v,We,"width")}function $e(){!0===z&&(ve("add"),E=function(){function e(e){e.forEach(Ce),ye(),be()}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(Ee),Ae(window.document))}let je;function Ee(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;je=()=>Fe("resizeObserver",`Resize Observed: ${le(t)}`),setTimeout((()=>{je&&je(),je=void 0}),0)}const Pe=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Oe=()=>[...Ne(document)()].filter(Pe);function Me(e){e&&U.observe(e)}function Ae(e){[...Oe(),...g.flatMap((t=>e.querySelector(t)))].forEach(Me)}function Ce(e){"childList"===e.type&&Ae(e.target)}let Te=4,Ie=4;function ke(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,re.has(s)||(ae(s),ue(`\nHeight calculated from: ${le(s)} (${ce(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: ${le(r)} (${ce(r,100)})`;return c<4||i<99||T||B||Te<c&&Te<Ie&&(Te=1.2*c,me(`<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}`)),Ie=c,a}const xe=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],Ne=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 Re=!1;function Be({ceilBoundingSize:e,dimension:t,getDimension:n,isHeight:o,scrollSize:i}){if(!Re)return Re=!0,n.taggedElement();const r=o?"bottom":"right";return me(`<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 qe={height:0,width:0},Le={height:0,width:0};function De(e,t){function n(){return Le[i]=r,qe[i]=c,r}const o=e===He,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===Le[i]&&0===qe[i]:if(e.taggedElement(!0)<=a)return n();break;case X&&r===Le[i]&&c===qe[i]:return Math.max(r,c);case 0===r:return c;case!t&&r!==Le[i]&&c<=qe[i]:return n();case!o:return t?e.taggedElement():Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c});case!t&&r<Le[i]:case c===l||c===a:case r>c:return n();case!t:return Be({ceilBoundingSize:a,dimension:i,getDimension:e,isHeight:o,scrollSize:c})}return Math.max(e.taggedElement(),n())}const He={enabled:()=>O,getOffset:()=>b,type:"height",auto:()=>De(He,!1),autoOverflow:()=>De(He,!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:()=>He.bodyOffset(),custom:()=>c.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(...xe(He)),min:()=>Math.min(...xe(He)),grow:()=>He.max(),lowestElement:()=>ke("bottom"),taggedElement:()=>ke("bottom")},We={enabled:()=>M,getOffset:()=>w,type:"width",auto:()=>De(We,!1),autoOverflow:()=>De(We,!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(...xe(We)),min:()=>Math.min(...xe(We)),rightMostElement:()=>ke("right"),scroll:()=>Math.max(We.bodyScroll(),We.documentElementScroll()),taggedElement:()=>ke("right")};function Ue(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=Q);return r=void 0===n?He[k]():n,a=void 0===o?We[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)&&Ze():(Ve(),I=r,G=a,Qe(I,G,e,i))}function Fe(e,t,n,o,i){document.hidden||Ue(e,0,n,o,i)}function Ve(){X||(X=!0,requestAnimationFrame((()=>{X=!1})))}function Je(e){I=He[k](),G=We[K](),Qe(I,G,e)}function Ze(e){const t=k;k=f,Ve(),Je("reset"),k=t}function Qe(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 Xe(e){const t={init:function(){N=e.data,J=e.source,pe(),C=!1,setTimeout((()=>{x=!1}),u)},reset(){x||Je("resetPage")},resize(){Fe("resizeParent")},moveToAnchor(){R.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ne?ne(JSON.parse(e)):Qe(0,0,"pageInfoStop")},parentInfo(){const e=o();oe?oe(Object.freeze(JSON.parse(e))):Qe(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()||de(`Unexpected message (${e.data})`)}())}function Ye(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>Xe({data:e,sameDomain:!0}),o(window,"message",Xe),o(window,"readystatechange",Ye),Ye())}));
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="5.2.0-beta.2",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),s=["<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 c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},u=e=>e;let m=i,f=u;const p={root:document.documentElement,rootMargin:"0px",threshold:1};let h=[];const g=new WeakSet,y=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=>{g.has(e)||(y.observe(e),g.add(e))}))),b=()=>h.length>0,z={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},w={height:()=>(Me("Custom height calculation function not defined"),it.auto()),width:()=>(Me("Custom width calculation function not defined"),rt.auto())},$={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,documentElementBoundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},S=128,j={},P="checkVisibility"in window,E="auto",M={reset:1,resetPage:1,init:1},T="[iFrameSizer]",C=T.length,A={max:1,min:1,bodyScroll:1,documentElementScroll:1},O=["body"],I="scroll";let R,k,N=!0,x="",L=0,B="",q=null,H="",W=!0,F=!1,D=null,U=!0,V=!1,J=1,Z=E,Q=!0,X="",Y={},G=!0,K=!1,_=0,ee=!1,te="",ne=u,oe="child",ie=null,re=!1,ae="",le=window.parent,se="*",ce=0,de=!1,ue="",me=1,fe=I,pe=window,he=()=>{Me("onMessage function not defined")},ge=()=>{},ye=null,ve=null;const be=e=>e.charAt(0).toUpperCase()+e.slice(1),ze=e=>""!=`${e}`&&void 0!==e,we=new WeakSet,$e=e=>"object"==typeof e&&we.add(e);function Se(e){switch(!0){case!ze(e):return"";case ze(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case ze(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(ze(e.className)?`.${e.className}`:"")}}const je=(...e)=>[`[iframe-resizer][${te}]`,...e].join(" "),Pe=(...e)=>K&&console?.log(je(...e)),Ee=(...e)=>console?.info(`[iframe-resizer][${te}]`,...e),Me=(...e)=>console?.warn(je(...e)),Te=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(je)(...e)),Ce=e=>Te(e);function Ae(){!function(){const e=e=>"true"===e,t=X.slice(C).split(":");te=t[0],L=void 0===t[1]?L:Number(t[1]),F=void 0===t[2]?F:e(t[2]),K=void 0===t[3]?K:e(t[3]),N=void 0===t[6]?N:e(t[6]),B=t[7],Z=void 0===t[8]?Z:t[8],x=t[9],H=t[10],ce=void 0===t[11]?ce:Number(t[11]),Y.enable=void 0!==t[12]&&e(t[12]),oe=void 0===t[13]?oe:t[13],fe=void 0===t[14]?fe:t[14],ee=void 0===t[15]?ee:e(t[15]),R=void 0===t[16]?R:Number(t[16]),k=void 0===t[17]?k:Number(t[17]),W=void 0===t[18]?W:e(t[18]),t[19],ue=t[20]||ue,_=void 0===t[21]?_:Number(t[21])}(),function(){function e(){const e=window.iframeResizer||window.iFrameResizer;Pe(`Reading data from page: ${JSON.stringify(e)}`),he=e?.onMessage||he,ge=e?.onReady||ge,"number"==typeof e?.offset&&(W&&(R=e?.offset),F&&(k=e?.offset)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(ae=e.sizeSelector),se=e?.targetOrigin||se,Z=e?.heightCalculationMethod||Z,fe=e?.widthCalculationMethod||fe}function t(e,t){return"function"==typeof e&&(Pe(`Setup custom ${t}CalcMethod`),w[t]=e,e="custom"),e}if(1===_)return;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),Z=t(Z,"height"),fe=t(fe,"width"));Pe(`TargetOrigin for parent set to: ${se}`)}(),Pe(`Initialising iFrame v${e} (${window.location.href})`),function(){try{re="iframeParentListener"in window.parent}catch(e){Pe("Cross domain iframe detected.")}}(),_<0?Ce(`${c(_+2)}${c(2)}`):ue.codePointAt(0)>4||_<2&&Ce(c(3)),function(){if(!ue||""===ue||"false"===ue)return void Te("<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&&Te(`<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`)}(),Be(),qe(),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&&Te("<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(W===F)return;ne=v({onChange:d(Oe),side:W?i:r})}(),Ie(),function(){if(1===_)return;pe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===N?(N=!0,He()):!1===e&&!0===N&&(N=!1,xe("remove"),ie?.disconnect(),q?.disconnect()),ut(0,0,"autoResize",JSON.stringify(N)),N),close(){ut(0,0,"close")},getId:()=>te,getPageInfo(e){if("function"==typeof e)return ye=e,ut(0,0,"pageInfo"),void Te("<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,ut(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIFrame.getParentProps(callback) callback not a function");return ve=e,ut(0,0,"parentInfo"),()=>{ve=null,ut(0,0,"parentInfoStop")}},getParentProperties(e){Te("<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){Y.findTarget(e)},reset(){dt("parentIFrame.reset")},scrollBy(e,t){ut(t,e,"scrollBy")},scrollTo(e,t){ut(t,e,"scrollTo")},scrollToOffset(e,t){ut(t,e,"scrollToOffset")},sendMessage(e,t){ut(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Z=e,Be()},setWidthCalculationMethod(e){fe=e,qe()},setTargetOrigin(e){Pe(`Set targetOrigin: ${e}`),se=e},resize(e,t){lt("size",`parentIFrame.size(${`${e||""}${t?`,${t}`:""}`})`,e,t)},size(e,t){Te("<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)}}),pe.parentIFrame=pe.parentIframe}(),function(){if(!0!==ee)return;function e(e){ut(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Pe(`Add event listener: ${n}`),a(window.document,t,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}(),Y=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);Pe(`Moving to in page link (#${o}) at x: ${t.x}y: ${t.y}`),ut(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?(Pe(`In page link (#${o}) not found in iFrame, so sending to parent`),ut(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 s(){setTimeout(i,S)}function c(){Pe("Setting up location.hash handlers"),r(),l(),s()}Y.enable?1===_?Te("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c():Pe("In page linking not enabled");return{findTarget:o}}(),$e(document.documentElement),$e(document.body),function(){void 0===B&&(B=`${L}px`);Re("margin",function(e,t){t.includes("-")&&(Me(`Negative CSS value ignored for ${e}`),t="");return t}("margin",B))}(),Re("background",x),Re("padding",H),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('HTML & body height set to "auto !important"')}(),ke()}const Oe=()=>{lt("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&ut(0,0,"title",document.title),He(),ge(),G=!1,Pe("Initialization complete"),Pe("---")};function Ie(){const e=document.querySelectorAll(`[${n}]`);V=e.length>0,Pe(`Tagged elements found: ${V}`),D=V?e:et(document)(),V?setTimeout(Oe):ne(D)}function Re(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Pe(`Body ${e} set to "${t}"`))}function ke(){""!==ae&&(Pe(`Applying sizeSelector: ${ae}`),document.querySelectorAll(ae).forEach((e=>{Pe(`Applying data-iframe-size to: ${Se(e)}`),e.dataset.iframeSize=!0})))}function Ne(e){({add(t){function n(){lt(e.eventName,e.eventType)}j[t]=n,a(window,t,n,{passive:!0})},remove(e){const t=j[e];delete j[e],l(window,e,t)}})[e.method](e.eventName),Pe(`${be(e.method)} event listener: ${e.eventType}`)}function xe(e){Ne({method:e,eventType:"After Print",eventName:"afterprint"}),Ne({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ne({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Le(e,t,n,o){return t!==e&&(e in n||(Me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in $&&Te(`<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.`),Pe(`${o} calculation method set to "${e}"`)),e}function Be(){Z=Le(Z,E,it,"height")}function qe(){fe=Le(fe,I,rt,"width")}function He(){!0===N?(xe("add"),q=function(){function e(e){e.forEach(Qe),ke(),Ie()}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 Pe("Create <body/> MutationObserver"),t.observe(n,o),t}const n=t();return{disconnect(){Pe("Disconnect MutationObserver"),n.disconnect()}}}(),ie=new ResizeObserver(Fe),Ze(window.document)):Pe("Auto Resize disabled")}let We;function Fe(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;We=()=>lt("resizeObserver",`Resize Observed: ${Se(t)}`),setTimeout((()=>{We&&We(),We=void 0}),0)}const De=e=>{const t=getComputedStyle(e);return""!==t?.position&&"static"!==t?.position},Ue=()=>[...et(document)()].filter(De),Ve=new WeakSet;function Je(e){e&&(Ve.has(e)||(ie.observe(e),Ve.add(e),Pe(`Attached resizeObserver: ${Se(e)}`)))}function Ze(e){[...Ue(),...O.flatMap((t=>e.querySelector(t)))].forEach(Je)}function Qe(e){"childList"===e.type&&Ze(e.target)}let Xe=null;let Ye=4,Ge=4;function Ke(e){const t=be(e);let n=0,o=document.documentElement,i=V?0:document.documentElement.getBoundingClientRect().bottom,r=performance.now();const a=!V&&b()?h:D;let l=a.length;a.forEach((t=>{V||!P||t.checkVisibility(z)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,o=t)):l-=1})),r=(performance.now()-r).toPrecision(1),function(e,t,n,o){we.has(e)||Xe===e||V&&o<=1||(Xe=e,Ee(`\n${t} position calculated from:\n`,e,`\nParsed ${o} ${V?"tagged":"potentially overflowing"} elements in ${n}ms`))}(o,t,r,l);const s=`\nParsed ${l} element${1===l?"":"s"} in ${r}ms\n${t} ${V?"tagged ":""}element found at: ${i}px\nPosition calculated from HTML element: ${Se(o)} (${function(e,t=30){const n=e?.outerHTML?.toString();return n?n.length<t?n:`${n.slice(0,t).replaceAll("\n"," ")}...`:e}(o,100)})`;return r<4||l<99||V||G?Pe(s):Ye<r&&Ye<Ge&&(Ye=1.2*r,Te(`<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}`)),Ge=r,i}const _e=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.documentElementBoundingClientRect()],et=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)"),tt={height:0,width:0},nt={height:0,width:0};function ot(e){function t(){return nt[i]=r,tt[i]=s,r}const n=b(),o=e===it,i=o?"height":"width",r=e.documentElementBoundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: ${r} Page: ${s}`;switch(!0){case!e.enabled():return s;case V:return e.taggedElement();case!n&&0===nt[i]&&0===tt[i]:return Pe(`Initial page size values: ${c}`),t();case de&&r===nt[i]&&s===tt[i]:return Pe(`Size unchanged: ${c}`),Math.max(r,s);case 0===r:return Pe(`Page is hidden: ${c}`),s;case!n&&r!==nt[i]&&s<=tt[i]:return Pe(`New HTML bounding size: ${c}`,"Previous bounding size:",nt[i]),t();case!o:return e.taggedElement();case!n&&r<nt[i]:return Pe("HTML bounding size decreased:",c),t();case s===l||s===a:return Pe("HTML bounding size equals page size:",c),t();case r>s:return Pe(`Page size < HTML bounding size: ${c}`),t();default:Pe(`Content overflowing HTML element: ${c}`)}return Math.max(e.taggedElement(),t())}const it={enabled:()=>W,getOffset:()=>R,auto:()=>ot(it),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>it.bodyOffset(),custom:()=>w.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().bottom,max:()=>Math.max(..._e(it)),min:()=>Math.min(..._e(it)),grow:()=>it.max(),lowestElement:()=>Ke(i),taggedElement:()=>Ke(i)},rt={enabled:()=>F,getOffset:()=>k,auto:()=>ot(rt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>w.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,documentElementBoundingClientRect:()=>document.documentElement.getBoundingClientRect().right,max:()=>Math.max(..._e(rt)),min:()=>Math.min(..._e(rt)),rightMostElement:()=>Ke(r),scroll:()=>Math.max(rt.bodyScroll(),rt.documentElementScroll()),taggedElement:()=>Ke(r)};function at(e,t,n,o,i){let r,a;!function(){const e=(e,t)=>!(Math.abs(e-t)<=ce);return r=void 0===n?it[Z]():n,a=void 0===o?rt[fe]():o,W&&e(J,r)||F&&e(me,a)}()&&"init"!==e?!(e in{init:1,size:1})&&(W&&Z in A||F&&fe in A)&&dt(t):(st(),J=r,me=a,ut(J,me,e,i))}function lt(e,t,n,o,i){document.hidden?Pe("Page hidden - Ignored resize request"):(e in M||Pe(`Trigger event: ${t}`),at(e,t,n,o,i))}function st(){de||(de=!0,Pe("Trigger event lock on"),requestAnimationFrame((()=>{de=!1,Pe("Trigger event lock off"),Pe("--")})))}function ct(e){J=it[Z](),me=rt[fe](),ut(J,me,e)}function dt(e){const t=Z;Z=E,Pe(`Reset trigger event: ${e}`),st(),ct("reset"),Z=t}function ut(e,t,n,o,i){_<-1||(void 0!==i?Pe(`Message targetOrigin: ${i}`):i=se,function(){const r=`${te}:${`${e+(R||0)}:${t+(k||0)}`}:${n}${void 0===o?"":`:${o}`}`;Pe(`Sending message to host page (${r}) via ${re?"sameDomain":"postMessage"}`),re?window.parent.iframeParentListener(T+r):le.postMessage(T+r,i)}())}function mt(e){const t={init:function(){X=e.data,le=e.source,Ae(),U=!1,setTimeout((()=>{Q=!1}),S)},reset(){Q?Pe("Page reset ignored by init"):(Pe("Page size reset by host page"),ct("resetPage"))},resize(){lt("resizeParent","Parent window requested size check")},moveToAnchor(){Y.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();Pe(`PageInfo received from parent: ${e}`),ye?ye(JSON.parse(e)):ut(0,0,"pageInfoStop"),Pe(" --")},parentInfo(){const e=o();Pe(`ParentInfo received from parent: ${e}`),ve?ve(Object.freeze(JSON.parse(e))):ut(0,0,"parentInfoStop"),Pe(" --")},message(){const e=o();Pe(`onMessage called from parent: ${e}`),he(JSON.parse(e)),Pe(" --")}},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};T===`${e.data}`.slice(0,C)&&(!1!==U?r()?t.init():Pe(`Ignored message of type "${n()}". Received before initialization.`):function(){const o=n();o in t?t[o]():i()||r()||Me(`Unexpected message (${e.data})`)}())}function ft(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"undefined"!=typeof window&&(window.iframeChildListener=e=>mt({data:e,sameDomain:!0}),a(window,"message",mt),a(window,"readystatechange",ft),ft())}));
21
+ //# sourceMappingURL=index.umd.js.map
@@ -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","nonLoggableTriggerEvents","reset","resetPage","init","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","capitalizeFirstLetter","string","charAt","toUpperCase","slice","isDef","value","usedTags","addUsedTag","getElementName","nodeName","name","className","formatLogMsg","msg","join","log","console","info","advise","chrome","formatAdvise","adviser","strBool","str","data","split","Number","enable","readDataFromParent","readData","iframeResizer","iFrameResizer","JSON","stringify","prototype","hasOwnProperty","call","targetOrigin","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","constructor","readDataFromPage","location","href","error","checkCrossDomain","checkVersion","checkHeightMode","checkWidthMode","found","checkAttrs","attr","removeAttribute","checkDeprecatedAttrs","initContinue","setupObserveOverflow","setupCalcElements","parentIframe","freeze","resize","initEventListeners","manageEventListeners","disconnect","sendMsg","close","getId","getPageInfo","callback","getParentProps","TypeError","getParentProperties","moveToAnchor","hash","findTarget","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","jumpToTarget","jumpPosition","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","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","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","sizes","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,uBAE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AlB2D,OAAOkU,QAAwB,KAAMlU,OAAOkU,OAAO9O,UAIhD+O,EAAY,IAAMb,EAAM5O,KAAKC,MAAM,KAAK,IAAM,CAAEyP,KAAM,EAAGC,MAAO,GAZzC/T,IAAU,GAAGgT,EAAM5O,OAAOrB,MAAM,EAAG9C,MA4B7C,IAAbe,EAKA6S,IACFZ,EAAyBlT,OAI3B4D,GACE,4BAA4B8P,yCAzBhC,WACE,MAAMO,EAAcP,IAEhBO,KAAef,EACjBA,EAAyBe,KAItBL,KAAmBE,KACtBrV,GAAK,uBAAuBwU,EAAM5O,QAErC,CAIG6P,GAiBN,CAIA,SAASC,KACqB,YAAxBzX,SAAS0X,YACXzU,OAAOsC,OAAO6Q,YAAY,4BAA6B,IAE3D,CAGsB,oBAAXnT,SACTA,OAAO0U,oBAAuBhQ,GAAS2O,GAAS,CAAE3O,OAAMtC,YAAY,IACpErH,EAAiBiF,OAAQ,UAAWqT,IACpCtY,EAAiBiF,OAAQ,mBAAoBwU,IAC7CA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/child",
3
- "version": "5.1.4",
3
+ "version": "5.2.0-beta.2",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {