@iframe-resizer/child 6.0.0-beta.1 → 6.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,45 +1,32 @@
1
- (function(r,w){typeof exports=="object"&&typeof module<"u"?w(require("auto-console-group")):typeof define=="function"&&define.amd?define(["auto-console-group"],w):(r=typeof globalThis<"u"?globalThis:r||self,w(r.acg))})(this,(function(r){"use strict";const w="6.0.0-beta.1",Ee="iframeResizer",On="[iFrameResizerChild]Ready",Sn="autoResize",Tn="beforeUnload",Rn="close",Hn="inPageLink",te="init",Oe="message",Mn="mouseenter",An="mouseleave",st="pageHide",rt="pageInfo",it="parentInfo",$n="pageInfoStop",Ln="parentInfoStop",Nn="scrollBy",kn="scrollTo",ct="scrollToOffset",Gn="title",ne="data-iframe-size",at="data-iframe-overflowed",U="data-iframe-ignore",oe="height",lt="width",Se="offset",Te="offsetSize",W="string",A="number",Pn="boolean",Cn="object",se="function",jn="undefined",_n="false",Dn="null",$="auto",dt="readystatechange",ut="bottom",ft="right",Re="autoResizeEnabled",mt=Symbol("sizeChanged"),He="manualResize",Me="parentResize",Ae={[He]:1,[Me]:1},ht="setOffsetSize",pt="resizeObserver",$e="overflowObserver",gt="mutationObserver",yt="visibilityObserver",xn="font-weight: bold;",Le="none",vt="No change in content size detected",re="[iFrameSizer]",bt=re.length,Bn=$,zt=128,wt=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),Fn=e=>(t,n="renamed to")=>(o,s,u="",l="")=>e(l,`<rb>Deprecated ${t}(${o.replace("()","")})</>
1
+ (function(s,T){typeof exports=="object"&&typeof module<"u"?T(require("auto-console-group")):typeof define=="function"&&define.amd?define(["auto-console-group"],T):(s=typeof globalThis<"u"?globalThis:s||self,T(s.acg))})(this,(function(s){"use strict";const T="6.0.0-beta.3",ve="iframeResizer",zn="[iFrameResizerChild]Ready",wn="autoResize",En="beforeUnload",In="close",On="inPageLink",te="init",be="message",Sn="mouseenter",Rn="mouseleave",Xe="pageHide",Tn="pageInfo",et="parentInfo",Hn="parentInfoStop",Mn="scrollBy",Ln="scrollTo",tt="scrollToOffset",kn="title",ze="data-iframe-size",nt="data-iframe-overflowed",B="data-iframe-ignore",ne="height",ot="width",st="offsetSize",U="string",G="number",An="boolean",Nn="object",we="function",$n="undefined",Gn="false",Cn="null",W="auto",rt="readystatechange",it="bottom",ct="right",Ee="autoResizeEnabled",at=Symbol("sizeChanged"),Ie="manualResize",Oe="parentResize",Se={[Ie]:1,[Oe]:1},lt="setOffsetSize",ut="resizeObserver",Re="overflowObserver",dt="mutationObserver",ft="visibilityObserver",jn="font-weight: bold;",Te="none",mt="No change in content size detected",oe="[iFrameSizer]",ht=oe.length,Pn=W,pt=128,yt=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),_n=e=>typeof e===U,se=(e,...t)=>setTimeout(()=>e(...t),0),gt=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},re=e=>e,vt=1e3,C=e=>Math.round(e*vt)/vt,bt=e=>e.charAt(0).toUpperCase()+e.slice(1),k=e=>`${e}`!=""&&e!==void 0,Dn=e=>e(),xn=e=>e.toLowerCase();function Fn(e){switch(!0){case!k(e):return"";case k(e.id):return`${e.nodeName}#${e.id}`;case k(e.name):return`${e.nodeName} (${e.name}`;case k(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const Bn=e=>e?.__esModule?e.default:e,w=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${bt(t)}`)},zt={br:`
2
+ `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},Un=Object.keys(zt),Wn=new RegExp(`<(${Un.join("|")})>`,"gi"),Vn=(e,t)=>zt[t]??"",qn=e=>e.replace(Wn,Vn),Zn=e=>e.replaceAll("<br>",`
3
+ `).replaceAll(/<\/?[^>]+>/gi,""),Yn=e=>t=>e(_n(t)?window.chrome?qn(t):Zn(t):t);let He=!0,wt=ve;const V=Bn(s)({label:`${ve}(child)`,expand:!1});function Qn(e){wt=e.id||ve,V.label(`${wt}`),V.expand(e.expand),He=e.enabled}const Et=e=>(...t)=>He?V[e](...t):!0,l=Et("log"),u=l,ie=Et("debug");function Jn(e,t){console.info(`%ciframe-resizer ${e}`,He||t<1?jn:s.NORMAL)}const{assert:Kn,endAutoGroup:j,error:It,errorBoundary:Me,event:h,label:ii,purge:ci,warn:_}=V,Ot=Yn(re),z=(...e)=>V.warn(...e.map(Ot)),Xn=(...e)=>console.warn(...e.map(Ot)),Le=[];function St(e,t){l(`${e} event listener: %c${t}`,s.HIGHLIGHT)}const Rt=(e,t,n,o)=>{e.removeEventListener(t,n,o),St("Removed",t)},A=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Le.push(()=>Rt(e,t,n,o)),St("Added",t)},i={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let Tt=!1;function Ht(e){const t=window?.iframeResizer?.targetOrigin||"*",n=Array.isArray(t)?t:[t];for(const o of n)e.postMessage(zn,o)}function Mt(){if(document.readyState==="loading"||!i.firstRun||Tt)return;const{parent:e,top:t}=window;h("ready"),l("Sending%c ready%c to parent from",s.HIGHLIGHT,s.FOREGROUND,window.location.href),Ht(e),e!==t&&Ht(t),Tt=!0}const Lt="iframeResize",eo=e=>oe===`${e.data}`.slice(0,ht),to=()=>Lt in window||window.jQuery!==void 0&&Lt in window.jQuery.prototype,no=e=>e.data.split(":")[2]in{true:1,false:1},oo=()=>[document.documentElement,document.body],so=["min-height","min-width","max-height","max-width"],kt=new Set,ro=e=>!!e&&e!=="0px"&&e!==W&&e!==Te,At=e=>e.tagName?e.tagName.toLowerCase():"unknown",Nt=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),io=(e,t)=>ro(Nt(e,t));function co(e,t){const n=e.style.getPropertyValue(t);return n?{source:"an inline style attribute",value:n}:null}function ao({href:e}){kt.has(e)||(l("Unable to access stylesheet:",e),kt.add(e))}function lo(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[]){if(!("selectorText"in o))continue;const r=o;if(!e.matches(r.selectorText))continue;const d=r.style.getPropertyValue(t);if(!d)continue;const{ownerNode:a}=n;return{source:a instanceof Element&&a.tagName==="STYLE"?"an inline <style> block":`stylesheet (${n.href})`,value:d}}}catch{ao(n)}return{source:"cross-origin stylesheet",value:Nt(e,t)}}const uo=(e,t)=>co(e,t)||lo(e,t),fo=(e,t)=>{const{source:n,value:o}=uo(e,t),r=At(e);z(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
2
4
 
3
- The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${u}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`),Un=e=>typeof e===W,ie=(e,...t)=>setTimeout(()=>e(...t),0),It=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},ce=e=>e,Et=1e3,G=e=>Math.round(e*Et)/Et,Ot=e=>e.charAt(0).toUpperCase()+e.slice(1),_=e=>`${e}`!=""&&e!==void 0,Wn=e=>e(),Vn=e=>e.toLowerCase();function qn(e){switch(!0){case!_(e):return"";case _(e.id):return`${e.nodeName}#${e.id}`;case _(e.name):return`${e.nodeName} (${e.name}`;case _(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const Zn=e=>e?.__esModule?e.default:e,I=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Ot(t)}`)},St={br:`
4
- `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},Qn=Object.keys(St),Yn=new RegExp(`<(${Qn.join("|")})>`,"gi"),Jn=(e,t)=>St[t]??"",Kn=e=>e.replace(Yn,Jn),Xn=e=>e.replaceAll("<br>",`
5
- `).replaceAll(/<\/?[^>]+>/gi,""),eo=e=>t=>e(Un(t)?window.chrome?Kn(t):Xn(t):t);let Ne=!0,ke=Ee;const V=Zn(r)({label:`${Ee}(child)`,expand:!1});function to(e){ke=e.id||Ee,V.label(`${ke}`),V.expand(e.expand),Ne=e.enabled}const Tt=e=>(...t)=>Ne?V[e](...t):!0,a=Tt("log"),d=a,ae=Tt("debug");function no(e,t){console.info(`${ke} %ciframe-resizer ${e}`,Ne||t<1?xn:r.NORMAL)}const{assert:zi,endAutoGroup:P,error:Rt,errorBoundary:Ge,event:m,label:wi,purge:Ii,warn:C}=V,oo=eo(ce),g=(...e)=>V.warn(...e.map(oo)),Pe=Fn((e,t)=>g(t)),Ht=Pe("Method"),so=Pe("Method","replaced with"),ro=Pe("Option"),Ce=[];function Mt(e,t){a(`${e} event listener: %c${t}`,r.HIGHLIGHT)}const At=(e,t,n,o)=>{e.removeEventListener(t,n,o),Mt("Removed",t)},L=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Ce.push(()=>At(e,t,n,o)),Mt("Added",t)},i={applySelectors:null,firstRun:!0,hasTags:!1,hasOverflow:!1,height:0,isHidden:!1,initLock:!0,inPageLinks:{},origin:void 0,hasOverflowUpdated:!0,overflowedNodeSet:new Set,sameOrigin:!1,taggedElements:[],target:window?.parent,timerActive:!1,totalTime:0,triggerLocked:!1,width:0,win:window,onPageInfo:null,onParentInfo:null};let $t=!1;const Lt=e=>e.postMessage(On,window?.iframeResizer?.targetOrigin||"*");function Nt(){if(document.readyState==="loading"||!i.firstRun||$t)return;const{parent:e,top:t}=window;m("ready"),a("Sending%c ready%c to parent from",r.HIGHLIGHT,r.FOREGROUND,window.location.href),Lt(e),e!==t&&Lt(t),$t=!0}const kt="iframeResize",io=e=>re===`${e.data}`.slice(0,bt),co=()=>kt in window||window.jQuery!==void 0&&kt in window.jQuery.prototype,ao=e=>e.data.split(":")[2]in{true:1,false:1},lo=()=>[document.documentElement,document.body],uo=["min-height","min-width","max-height","max-width"],Gt=new Set,fo=e=>!!e&&e!=="0px"&&e!==$&&e!==Le,Pt=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ct=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),mo=(e,t)=>fo(Ct(e,t));function ho(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}function po({href:e}){Gt.has(e)||(a("Unable to access stylesheet:",e),Gt.add(e))}function go(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const s=o.style[t];if(s)return{source:n.ownerNode.tagName==="STYLE"?"an inline <style> block":`stylesheet (${n.href})`,value:s}}}catch{po(n)}return{source:"cross-origin stylesheet",value:Ct(e,t)}}const yo=(e,t)=>ho(e,t)||go(e,t),vo=(e,t)=>{const{source:n,value:o}=yo(e,t),s=Pt(e);g(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${s}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
6
-
7
- If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function bo(){for(const e of lo())for(const t of uo)a(`Checking <${Pt(e)}> for blocking CSS: ${t}`),mo(e,t)&&vo(e,t)}const zo=({calculateWidth:e,calculateHeight:t})=>e===t,c={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:$,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:$,onBeforeResize:void 0,onMessage:()=>{C("onMessage function not defined")},onReady:()=>{}},N=[r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT],le={height:0,width:0},D={height:0,width:0};function x(e,t,n){return D[e]=t,le[e]=n,t}function wo(e){const t=e.getOffset();return t!==0&&d(`Page offsetSize: %c${t}px`,r.HIGHLIGHT),t}const Io=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function jt(e){const{hasOverflow:t,hasTags:n,triggerLocked:o}=i,s=e.label,u=s===oe,l=e.boundingClientRect(),h=Math.ceil(l),b=Math.floor(l),f=Io(e),z=`HTML: %c${l}px %cPage: %c${f}px`;let p;switch(!0){case!e.enabled():return Math.max(f,1);case n:d("Found element with data-iframe-size attribute"),p=e.taggedElement();break;case(!t&&i.firstRun&&D[s]===0&&le[s]===0):d(`Initial page size values: ${z}`,...N),p=x(s,l,f);break;case(o&&l===D[s]&&f===le[s]):d(`Size unchanged: ${z}`,...N),p=Math.max(l,f);break;case(l===0&&f!==0):d(`Page is hidden: ${z}`,...N),p=f;break;case(!t&&l!==D[s]&&f<=le[s]):d(`New <html> size: ${z} `,...N),d(`Previous <html> size: %c${D[s]}px`,r.HIGHLIGHT),p=x(s,l,f);break;case!u:p=e.taggedElement();break;case(!t&&l<D[s]):d(`<html> size decreased: ${z}`,...N),p=x(s,l,f);break;case(f===b||f===h):d(`<html> size equals page size: ${z}`,...N),p=x(s,l,f);break;case l>f:d(`Page size < <html> size: ${z}`,...N),p=x(s,l,f);break;case t:d("Found elements possibly overflowing <html> "),p=e.taggedElement();break;default:d(`Using <html> size: ${z}`,...N),p=x(s,l,f)}return d(`Content ${s}: %c${p}px`,r.HIGHLIGHT),p+=wo(e),Math.max(p,1)}const Eo=5*1e3,Oo=4,So=10,To=100,je="--ifr-start",de="--ifr-end",_t="--ifr-measure",v=[];let ue={},Dt=0,_e;function xt(){try{performance.clearMarks(je),performance.clearMarks(de),performance.clearMeasures(_t)}catch{}}function Ro(){_e=setInterval(()=>{if(v.length<So||ue.hasTags&&ue.len<25)return;v.sort();const e=Math.min(v.reduce((n,o)=>n+o,0)/v.length,v[Math.floor(v.length/2)]),t=G(e);t>Dt&&(Dt=t,m("performanceObserver"),a("Mean time:",G(v[Math.floor(v.length/2)])),a("Median time:",G(v.reduce((n,o)=>n+o,0)/v.length)),a("Average time:",t),a("Max time:",G(Math.max(...v)))),xt(),!(e<=Oo)&&(clearInterval(_e),g(`<rb>Performance Warning</>
8
-
9
- Calculating the page size is taking an excessive amount of time (${G(e)}ms).
10
-
11
- To improve performance add the <b>data-iframe-size</> attribute to the ${ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},Eo)}function Ho(e){e.getEntries().forEach(t=>{if(t.name===de)try{const{duration:n}=performance.measure(_t,je,de);ue=t.detail,v.push(n),v.length>To&&v.shift()}catch{}})}function Mo(){d("Attached%c PerformanceObserver%c to page",r.HIGHLIGHT,r.FOREGROUND);const e=new PerformanceObserver(Ho);return e.observe({entryTypes:["mark"]}),Ro(),{disconnect:()=>{xt(),clearInterval(_e),e.disconnect(),d("Detached%c PerformanceObserver",r.HIGHLIGHT)}}}const Ao=e=>`:not(${e})`,$o=`* ${Array.from(wt).map(Ao).join("")}`,De=e=>e.querySelectorAll($o);function Lo(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=i;return t?o:e?Array.from(n):De(document.documentElement)}function No(e,t){const n=`margin-${t}`;let o,s=document.documentElement,u=i.hasTags?1:document.documentElement.getBoundingClientRect().bottom;for(const l of e)o=l.getBoundingClientRect()[t]+parseFloat(getComputedStyle(l).getPropertyValue(n)),o>u&&(u=o,s=l);return{maxEl:s,maxVal:u}}function Bt(e){performance.mark(je);const t=Ot(e),{logging:n}=c,{hasTags:o}=i,s=Lo(),{maxEl:u,maxVal:l}=No(s,e);return d(`${t} position calculated from:`,u),d(`Checked %c${s.length}%c elements`,r.HIGHLIGHT,r.FOREGROUND),performance.mark(de,{detail:{hasTags:o,len:s.length,logging:n,Side:t}}),l}const fe={label:oe,enabled:()=>c.calculateHeight,getOffset:()=>c.offsetHeight,auto:()=>jt(fe),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>Bt(ut)},me={label:lt,enabled:()=>c.calculateWidth,getOffset:()=>c.offsetWidth,auto:()=>jt(me),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>Bt(ft)};function Ft(e,t){const{label:n}=t;return e&&e!==$&&g(`<rb>Ignored ${n}CalculationMethod (${e})</>
12
-
13
- This version of <i>iframe-resizer</> auto detects the most suitable ${n} calculation method. The <b>${n}CalculationMethod</> option is no longer supported and has been ignored.
14
-
15
- To remove this warning, delete the <b>${n}CalculationMethod</> option from your parent page config and/or the <i>window.iframeResizer</> config on the child page.
16
- `),a(`Set ${n} calculation method: %c${$}`,r.HIGHLIGHT),$}function ko(){c.heightCalcMode=Ft(c.heightCalcMode,fe)}function Go(){c.widthCalcMode=Ft(c.widthCalcMode,me)}function Po(){try{i.sameOrigin=c.mode===1||"iframeParentListener"in window.parent}catch{a("Cross domain iframe detected")}}const Co=`<rb>Deprecated Attributes</>
17
-
18
- The <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`;function jo(){let e=!1;const t=n=>document.querySelectorAll(`[${n}]`).forEach(o=>{o.toggleAttribute(ne,!0),o.removeAttribute(n),e=!0});t("data-iframe-height"),t("data-iframe-width"),e&&g(Co)}let Ut=0;function _o(e){const t=e.length===1?"":"s";C(`%c[${U}]%c found on %c${e.length}%c element${t}`,r.BOLD,r.NORMAL,r.BOLD,r.NORMAL)}function Do(){const e=document.querySelectorAll(`*[${U}]`),t=e.length>0;return t&&e.length!==Ut&&(_o(e),Ut=e.length),t}const he=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,s=0;s<e.length;s++)o=e.codePointAt(s),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},R=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),xo=new Date,Wt=e=>new Set(Array.from({length:9},e)),Bo=e=>[e[0],...e.slice(1).map(t=>`${t} - lewpylk`),`${e[4]} - lewpylk`,...e.slice(1)],B=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],Fo=["<yi>Puchspk Spjluzl Rlf</><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</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> fvb jhu bzl aol mpyza 11 johyhjalyz vm fvb spjlujl rlf av nla h 60% kpzjvbua ha <ii>oaaw://pmyhtl-ylzpgly.jvt</>.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Av bwnyhkl av clyzpvu 6 vm<p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt.","<yi>VLT rlf lewpylk</><iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt."],Uo=Bo(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),Vt=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),Wo=new Set([1,6]),qt=xo[R(B[4])](),Vo=Wt((e,t)=>he(`${qt+t}`)),qo=Wt((e,t)=>he(`${qt-++t}`)),Zo=e=>Vo.has(e)?9:qo.has(e)?5:-2,xe=e=>Wo.has(e),F=e=>R(Fo[e]),Qo=e=>R(Uo[e]),Zt=e=>R(B[e]),Qt=e=>{const t=e[R(B[0])]||e[R(B[1])]||e[R(B[2])]||e[R(B[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",u=""){let l=-2;const h=he(R(s));return h in Vt&&(l=Vt[h]),l===9?Zo(u):l})(...n);return o===0||(s=>s[2]===he(s[0]+s[1]))(n)||(o=-2),o};function Yo({key:e,key2:t,mode:n,version:o}){const s=n,u=Qt({key:e}),l=Qt({key2:t});if(c.mode=n=Math.max(u,l),n<0){if(n=Math.min(u,l),g(`${F(n+2)}${F(2)}`),_(o))throw i.firstRun=!1,F(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!_(o)||s>-1&&n>s)&&(sessionStorage.getItem("ifr")!==w&&no(`v${w} (${Qo(n)})`,n),n<2&&g(F(3)),sessionStorage.setItem("ifr",w))}const Jo="BackCompat",Ko=`<rb>Quirks Mode Detected</>
5
+ If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function mo(){for(const e of oo())for(const t of so)l(`Checking <${At(e)}> for blocking CSS: ${t}`),io(e,t)&&fo(e,t)}const ho=({calculateWidth:e,calculateHeight:t})=>e===t,c={autoResize:!0,bodyBackground:"",bodyMargin:0,bodyMarginStr:"",bodyPadding:"",calculateHeight:!0,calculateWidth:!1,heightCalcMode:W,ignoreSelector:"",inPageLinks:!1,logging:!1,logExpand:!1,mode:0,mouseEvents:!1,offsetHeight:0,offsetWidth:0,parentId:void 0,sizeSelector:"",targetOrigin:"*",tolerance:0,widthCalcMode:W,onBeforeResize:void 0,onMessage:()=>{_("onMessage function not defined")},onReady:()=>{}};function po(){try{i.sameOrigin=c.mode===1||"iframeParentListener"in window.parent}catch{l("Cross domain iframe detected")}}let $t=0;function yo(e){const t=e.length===1?"":"s";_(`%c[${B}]%c found on %c${e.length}%c element${t}`,s.BOLD,s.NORMAL,s.BOLD,s.NORMAL)}function go(){const e=document.querySelectorAll(`*[${B}]`),t=e.length>0;return t&&e.length!==$t&&(yo(e),$t=e.length),t}const ce=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},H=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),vo=new Date,Gt=e=>new Set(Array.from({length:9},e)),Ct=" - lewpylk",D=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],bo=["<yi>Puchspk Spjluzl Rlf</><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</>. 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</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"],zo=e=>[e[0],...e.slice(1).map(t=>`${t}${Ct}`),`${e[4]}${Ct}`,...e.slice(1)],wo=zo(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),jt=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),Eo=new Set([1,6]),Pt=vo[H(D[4])](),Io=Gt((e,t)=>ce(`${Pt+t}`)),Oo=Gt((e,t)=>ce(`${Pt-++t}`)),So=e=>Io.has(e)?9:Oo.has(e)?5:-2,ke=e=>Eo.has(e),M=e=>H(bo[e]),Ro=e=>H(wo[e]),_t=e=>H(D[e]),Dt=e=>{const t=e[H(D[0])]||e[H(D[1])]||e[H(D[2])]||e[H(D[3])];if(!t)return-1;const n=t.split("-");let o=(function(r="",d=""){let a=-2;const f=ce(H(r));return f in jt&&(a=jt[f]),a===9?So(d):a})(...n);return o===0||(r=>r[2]===ce(r[0]+r[1]))(n)||(o=-2),o};function To(e,t,n){(!k(n)||t>-1&&e>t)&&(Jn(`v${T} (${Ro(e)})`,e),e===0&&Xn(M(3)))}function Ho({key:e,key2:t,mode:n,version:o}){const r=n,d=k(e)?Dt({key:e}):-1,a=k(t)?Dt({key:t}):-1;let f;switch(n=Math.max(d,a),n){case-2:case-1:f=`${M(Math.min(d,a)+2)}${M(2)}`,i.firstRun=!1;break;case 1:case 2:case 3:f=M(6);break;case 4:f=M(7);break;case 5:f=M(8);break}if(n>=0&&To(n,r,o),(!k(o)||!i.firstRun)&&(f&&z(f),n<0))throw z(M(9)),f.split("<br>")[0].replace(/<\/?[a-z][^>]*>|<\/>/gi,"");c.mode=n}const Mo="BackCompat",Lo=`<rb>Quirks Mode Detected</>
19
6
 
20
7
  This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
21
8
 
22
9
  For more information see <u>https://iframe-resizer.com/quirks-mode</>.
23
- `;function Xo(){document.compatMode===Jo&&g(Ko)}const es="complete";let Yt=!1;function Jt(e){document.readyState===es?ie(e):Yt||L(document,dt,()=>Jt(e)),Yt=!0}const ts=()=>{d(`Set targetOrigin for parent: %c${c.targetOrigin}`,r.HIGHLIGHT),c.autoResize!==!0&&a("Auto Resize disabled")};function Kt(){i.taggedElements=document.querySelectorAll(`[${ne}]`),i.hasTags=i.taggedElements.length>0,a(`Tagged elements found: %c${i.hasTags}`,r.HIGHLIGHT)}const ns=`<rb>Legacy version detected on parent page</>
10
+ `;function ko(){document.compatMode===Mo&&z(Lo)}const Ao="complete";let xt=!1;function Ft(e){document.readyState===Ao?se(e):xt||A(document,rt,()=>Ft(e)),xt=!0}const No=()=>{u(`Set targetOrigin for parent: %c${c.targetOrigin}`,s.HIGHLIGHT),c.autoResize!==!0&&l("Auto Resize disabled")};function Bt(){i.taggedElements=document.querySelectorAll(`[${ze}]`),i.hasTags=i.taggedElements.length>0,l(`Tagged elements found: %c${i.hasTags}`,s.HIGHLIGHT)}const $o=`<rb>Legacy version detected on parent page</>
24
11
 
25
12
  Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
26
13
 
27
14
  See <u>https://iframe-resizer.com/setup/</> for more details.
28
- `,os=e=>`<b>Version mismatch</>
15
+ `,Go=e=>`<b>Version mismatch</>
29
16
 
30
17
  The parent and child pages are running different versions of <i>iframe resizer</>.
31
18
 
32
- Parent page: ${e} - Child page: ${w}.
33
- `;function ss({version:e}){!e||e===""||e===_n?g(ns):e!==w&&g(os(e))}const rs=It(()=>g(F(4)));function is(e){if(!i.timerActive)return;const t=G(performance.now()-i.totalTime),n=e===te?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`;a(n,r.HIGHLIGHT)}function cs(e){return e===void 0?e=c.targetOrigin:a(`Message targetOrigin: %c${e}`,r.HIGHLIGHT),e}function as(e,t){const{mode:n}=c,{sameOrigin:o,target:s}=i;if(o)try{window.parent.iframeParentListener(re+e)}catch(u){if(xe(n))rs();else throw u;return!1}else s.postMessage(re+e,cs(t));return!0}function Xt(e,t,n,o,s){const{parentId:u}=c,{sameOrigin:l}=i,h=`${e}:${t}`,b=`${u}:${h}:${n}${o===void 0?"":`:${o}`}`;c.mode<-1||!as(b,s)||(is(n),d(`Sending message to parent page via ${l?"sameOrigin":"postMessage"}: %c%c${b}`,r.ITALIC,r.HIGHLIGHT))}const y=Ge((e,t,n,o,s)=>{m(n),Xt(e,t,n,o,s),P()}),ls=e=>y(0,0,e.type,`${e.screenY}:${e.screenX}`);function en(e,t){a(`Add event listener: %c${t}`,r.HIGHLIGHT),L(window.document,e,ls)}function ds({mouseEvents:e}){e===!0&&(en(Mn,"Mouse Enter"),en(An,"Mouse Leave"))}const us=()=>y(0,0,Tn);function fs({persisted:e}){e||us(),m(st),d("Page persisted:",e),!e&&Ce.forEach(Wn)}const ms=()=>L(window,Vn(st),fs),tn=(e,t)=>!(Math.abs(e-t)<=c.tolerance);function hs(e,t){const{calculateHeight:n,calculateWidth:o}=c,{height:s,width:u}=i;return n&&tn(s,e)||o&&tn(u,t)}function ps(e,t,n){const o=c.onBeforeResize(e,t,n);if(o===void 0)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(o))throw new TypeError(`Invalid value returned from onBeforeResize(): ${o}, expected Number`);if(o<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${o}, must be at least 1`);return o}const nn=(e,t)=>(n,o)=>{const s=e[n]();return e.enabled()&&c.onBeforeResize!==void 0?ps(s,o,t):s},gs=nn(fe,oe),ys=nn(me,lt);function vs(e,t,n,o){const{heightCalcMode:s,widthCalcMode:u}=c,l=n??gs(s,e),h=o??ys(u,e),b=hs(l,h)?mt:e;switch(a(`Resize event: %c${t}`,r.HIGHLIGHT),b){case te:case Re:case mt:case He:case Me:i.height=l,i.width=h;case ht:return i;case $e:case gt:case pt:case yt:{a(vt);break}default:d(vt)}return null}let pe=!1,Be=!1,q=null;function bs(e,t,n,o,s){const{autoResize:u}=c,{isHidden:l}=i;switch(m(e),!0){case(l===!0&&!(e in Ae)):{if(Be===!0)break;a("Iframe hidden - Ignored resize request"),Be=!0,pe=!1,cancelAnimationFrame(q),q=null;break}case(pe===!0&&e!==$e&&!(e in Ae)):{a("Resize already pending - Ignored resize request");break}case(!u&&!(e in Ae)):{d("Resizing disabled");break}default:{Be=!1,pe=!0,i.totalTime=performance.now(),i.timerActive=!0;const h=vs(e,t,n,o);h&&Xt(h.height,h.width,e,s),q||(q=requestAnimationFrame(()=>{pe=!1,q=null,m("requestAnimationFrame"),ae(`Reset sendPending: %c${e}`,r.HIGHLIGHT)})),i.timerActive=!1}}P()}const E=Ge(bs);function on({eventType:e,eventName:t}){L(window,t,()=>E(t,e),{passive:!0})}function zs(){on({eventType:"After Print",eventName:"afterprint"}),on({eventType:"Before Print",eventName:"beforeprint"})}function ws(){if(i.triggerLocked){a("TriggerLock blocked calculation");return}i.triggerLocked=!0,ae("Trigger event lock on"),requestAnimationFrame(()=>{i.triggerLocked=!1,ae("Trigger event lock off")})}function sn(e){const{heightCalcMode:t,widthCalcMode:n}=c,o=fe[t](),s=me[n]();a(`Reset trigger event: %c${e}`,r.HIGHLIGHT),y(o,s,e)}function Is(e){const t=c.heightCalcMode;a(`Reset trigger event: %c${e}`,r.HIGHLIGHT),c.heightCalcMode=Bn,ws(),sn("reset"),c.heightCalcMode=t}const Es=`Auto Resize can not be changed when <b>direction</> is set to '${Le}'.`;function Os(e){I(e,Pn,"parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:n,calculateWidth:o}=c;return o===!1&&n===!1?(m(Re),g(Es),!1):(e===!0&&t===!1?(c.autoResize=!0,queueMicrotask(()=>E(Re,"Auto Resize enabled"))):e===!1&&t===!0&&(c.autoResize=!1),y(0,0,Sn,JSON.stringify(c.autoResize)),c.autoResize)}function Ss(e){I(e,W,"parentIframe.moveToAnchor(anchor) anchor"),i.inPageLinks.findTarget(e)}function Ts(e){I(e,A,"parentIframe.setOffsetSize(offset) offset"),c.offsetHeight=e,c.offsetWidth=e,E(ht,`parentIframe.setOffsetSize(${e})`)}function Rs(){return m("getOrigin"),Ht("getOrigin()","getParentOrigin()"),i.origin}const Hs=()=>i.origin;function Ms(e){I(e,W,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),a(`Set targetOrigin: %c${e}`,r.HIGHLIGHT),c.targetOrigin=e}function As(e){if(typeof e===se){i.onPageInfo=e,y(0,0,rt),so("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");return}i.onPageInfo=null,y(0,0,$n)}function rn(e){return I(e,se,"parentIframe.getParentProps(callback) callback"),i.onParentInfo=e,y(0,0,it),()=>{i.onParentInfo=null,y(0,0,Ln)}}function $s(e){Ht("getParentProperties()","getParentProps()"),rn(e)}const Ls=e=>`<rb>Deprecated API object name</>
34
- The <b>window.parentIFrame</> object has been renamed to <b>window.parentIframe</>. Please update your code as the old object will be removed in a future version.
19
+ Parent page: ${e} - Child page: ${T}.
20
+ `;function Co({version:e}){!e||e===""||e===Gn?z($o):e!==T&&z(Go(e))}const jo=gt(()=>z(M(4)));function Po(e){if(!i.timerActive)return;const t=C(performance.now()-i.totalTime),n=e===te?`Initialised iframe in %c${t}ms`:`Size calculated in %c${t}ms`;l(n,s.HIGHLIGHT)}function _o(e){return e===void 0?e=c.targetOrigin:l(`Message targetOrigin: %c${e}`,s.HIGHLIGHT),e}function Do(e,t){const{mode:n}=c,{sameOrigin:o,target:r}=i;if(o)try{window.parent.iframeParentListener(oe+e)}catch(d){if(ke(n))jo();else throw new Error(d);return!1}else{Kn(r,"Internal error: postMessage target is undefined");const d=_o(t),a=Array.isArray(d)?d:[d];for(const f of a)r.postMessage(oe+e,f)}return!0}function Ut(e,t,n,o,r){const{parentId:d}=c,{sameOrigin:a}=i,f=`${e}:${t}`,v=`${d}:${f}:${n}${o===void 0?"":`:${o}`}`;c.mode<-1||!Do(v,r)||(Po(n),u(`Sending message to parent page via ${a?"sameOrigin":"postMessage"}: %c%c${v}`,s.ITALIC,s.HIGHLIGHT))}const g=Me((e,t,n,o,r)=>{h(n),Ut(e,t,n,o,r),j()}),xo=e=>g(0,0,e.type,`${e.screenY}:${e.screenX}`);function Wt(e,t){l(`Add event listener: %c${t}`,s.HIGHLIGHT),A(window.document,e,xo)}function Fo({mouseEvents:e}){e===!0&&(Wt(Sn,"Mouse Enter"),Wt(Rn,"Mouse Leave"))}const Bo=()=>g(0,0,En);function Uo({persisted:e}){e||Bo(),h(Xe),u("Page persisted:",e),!e&&Le.forEach(Dn)}const Wo=()=>A(window,xn(Xe),Uo),Vt=(e,t)=>!(Math.abs(e-t)<=c.tolerance);function Vo(e,t){const{calculateHeight:n,calculateWidth:o}=c,{height:r,width:d}=i;return n&&Vt(r,e)||o&&Vt(d,t)}const N=[s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT],ae={height:0,width:0},x={height:0,width:0};function F(e,t,n){return x[e]=t,ae[e]=n,t}function qo(e){const t=e.getOffset();return t!==0&&u(`Page offsetSize: %c${t}px`,s.HIGHLIGHT),t}const Zo=e=>e.documentElementScroll()+Math.max(0,e.getOffset());function qt(e){const{hasOverflow:t,hasTags:n,triggerLocked:o}=i,r=e.label,d=r===ne,a=e.boundingClientRect(),f=Math.ceil(a),v=Math.floor(a),m=Zo(e),b=`HTML: %c${a}px %cPage: %c${m}px`;let p;switch(!0){case!e.enabled():return Math.max(m,1);case n:u("Found element with data-iframe-size attribute"),p=e.taggedElement();break;case(!t&&i.firstRun&&x[r]===0&&ae[r]===0):u(`Initial page size values: ${b}`,...N),p=F(r,a,m);break;case(o&&a===x[r]&&m===ae[r]):u(`Size unchanged: ${b}`,...N),p=Math.max(a,m);break;case(a===0&&m!==0):u(`Page is hidden: ${b}`,...N),p=m;break;case(!t&&a!==x[r]&&m<=ae[r]):u(`New <html> size: ${b} `,...N),u(`Previous <html> size: %c${x[r]}px`,s.HIGHLIGHT),p=F(r,a,m);break;case!d:p=e.taggedElement();break;case(!t&&a<x[r]):u(`<html> size decreased: ${b}`,...N),p=F(r,a,m);break;case(m===v||m===f):u(`<html> size equals page size: ${b}`,...N),p=F(r,a,m);break;case a>m:u(`Page size < <html> size: ${b}`,...N),p=F(r,a,m);break;case t:u("Found elements possibly overflowing <html> "),p=e.taggedElement();break;default:u(`Using <html> size: ${b}`,...N),p=F(r,a,m)}return u(`Content ${r}: %c${p}px`,s.HIGHLIGHT),p+=qo(e),Math.max(p,1)}const Yo=5*1e3,Qo=4,Jo=10,Ko=100,Ae="--ifr-start",le="--ifr-end",Zt="--ifr-measure",y=[];let ue={},Yt=0,Ne;function Qt(){try{performance.clearMarks(Ae),performance.clearMarks(le),performance.clearMeasures(Zt)}catch{}}function Xo(){Ne=setInterval(()=>{if(y.length<Jo||ue.hasTags&&ue.len<25)return;y.sort();const e=Math.min(y.reduce((n,o)=>n+o,0)/y.length,y[Math.floor(y.length/2)]),t=C(e);t>Yt&&(Yt=t,h("performanceObserver"),l("Mean time:",C(y[Math.floor(y.length/2)])),l("Median time:",C(y.reduce((n,o)=>n+o,0)/y.length)),l("Average time:",t),l("Max time:",C(Math.max(...y)))),Qt(),!(e<=Qo)&&(clearInterval(Ne),z(`<rb>Performance Warning</>
21
+
22
+ Calculating the page size is taking an excessive amount of time (${C(e)}ms).
35
23
 
36
- Called property: '${String(e)}'
37
- `;function Ns(e){const t=new Set;return new Proxy(e,{get(n,o){t.has(o)||(g(Ls(o)),t.add(o));const s=n[o],u=Object.getOwnPropertyDescriptor(n,o);return u&&!u.configurable&&!u.writable?s:typeof s=="function"?s.bind(n):s}})}function ks(e,t){e!==void 0&&I(e,A,"parentIframe.resize(customHeight, customWidth) customHeight"),t!==void 0&&I(t,A,"parentIframe.resize(customHeight, customWidth) customWidth");const n=`${e||""}${t?`,${t}`:""}`;E(He,`parentIframe.resize(${n})`,e,t)}const Fe=e=>(t,n)=>{I(t,A,`parentIframe.${e}(x, y) x`),I(n,A,`parentIframe.${e}(x, y) y`),y(n,t,e)},Gs=Fe(Nn),Ps=Fe(kn),Cs=Fe(ct);function js(e,t){t&&I(t,W,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),y(0,0,Oe,JSON.stringify(e),t)}const _s=()=>y(0,0,Rn),Ds=()=>c.parentId,xs=()=>Is("parentIframe.reset"),Bs=()=>C("parentIframe.size() has been renamed parentIframe.resize()");function Fs(){const{win:e}=i;c.mode!==1&&(e.parentIframe=Object.freeze({autoResize:Os,close:_s,getId:Ds,getOrigin:Rs,getParentOrigin:Hs,getPageInfo:As,getParentProps:rn,getParentProperties:$s,moveToAnchor:Ss,reset:xs,setOffsetSize:Ts,scrollBy:Gs,scrollTo:Ps,scrollToOffset:Cs,sendMessage:js,setTargetOrigin:Ms,resize:ks,size:Bs}),e.parentIFrame=Ns(e.parentIframe))}const Z=(e="")=>t=>n=>{n.size>0&&ae(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[`
38
- `,o]))},Us=(e="")=>t=>n=>{n.size>0&&Rt(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[`
39
- `,o]))},cn=Z("attached to"),an=Us("already attached"),Ws=Z("detached from"),ge=(e,t=!0)=>n=>{n>0&&d(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${n}%c element${n===1?"":"s"}`,r.HIGHLIGHT,r.NORMAL,r.HIGHLIGHT,r.NORMAL)},ln=(e,t,n,o)=>{const s=Ws(e);return u=>{const l=new Set;let h=0;for(const b of u)n.has(b)&&(t.unobserve(b),n.delete(b),l.add(b),h+=1);s(l),o(h),l.clear()}},dn=16,un=2,Vs=200,Ue="Mutation",O=new Set,k=new Set,We=new Set,ye=[],qs={attributes:!0,attributeFilter:[U,ne],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ve=1,qe,Ze=!1,Qe=0;const Zs=Z("added")(Ue),Qs=Z("removed (page)")(Ue),Ys=Z("removed (added)")(Ue),fn=e=>e.nodeType!==Node.ELEMENT_NODE||wt.has(e.tagName.toLowerCase());function Js(e){const t=e.addedNodes;for(const n of t)fn(n)||O.add(n)}function Ks(e){const t=e.removedNodes;for(const n of t)fn(n)||(O.has(n)?(O.delete(n),We.add(n)):k.add(n))}const Xs=e=>{d("Mutations:",e);for(const t of e)Js(t),Ks(t);Zs(O),Qs(k),Ys(We),We.clear()};function er(){k.size>0&&a(`Detected %c${k.size} %cremoved element${k.size>1?"s":""}`,r.HIGHLIGHT,r.FOREGROUND),O.size>0&&a(`Found %c${O.size} %cnew element${O.size>1?"s":""}`,r.HIGHLIGHT,r.FOREGROUND)}const tr=e=>()=>{const t=performance.now(),n=t-Qe,o=dn*Ve+++un;if(n>o&&n<Vs){m("mutationThrottled"),d("Update delayed due to heavy workload on the callStack"),d(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-un}ms`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),setTimeout(qe,dn*Ve),Qe=t;return}Ve=1,ye.forEach(Xs),ye.length=0,Ze=!1,er(),e({addedNodes:O,removedNodes:k}),O.clear(),k.clear()};function nr(e){ye.push(e),!Ze&&(Qe=performance.now(),Ze=!0,requestAnimationFrame(qe))}function or(e){const t=new window.MutationObserver(nr),n=document.body||document.documentElement;return qe=tr(e),t.observe(n,qs),d("Attached%c MutationObserver%c to body",r.HIGHLIGHT,r.FOREGROUND),{...t,disconnect:()=>{O.clear(),k.clear(),ye.length=0,t.disconnect(),d("Detached%c MutationObserver",r.HIGHLIGHT)}}}const sr={characterData:!0,childList:!0,subtree:!0};function rr(e){const t=document.querySelector("title")??document.head??document.documentElement,n=new MutationObserver(e);return n.observe(t,sr),d("Attached%c TitleObserver%c to head",r.HIGHLIGHT,r.FOREGROUND),setTimeout(e),{disconnect:()=>{n.disconnect(),d("Detached%c TitleObserver",r.HIGHLIGHT)}}}function ir(e){const t=new IntersectionObserver(o=>e(o.at(-1)?.isIntersecting??!1),{threshold:0}),n=document.documentElement;return t.observe(n),d("Attached%c VisibilityObserver%c to page",r.HIGHLIGHT,r.FOREGROUND),{disconnect:()=>{t.disconnect(),d("Detached%c VisibilityObserver",r.HIGHLIGHT)}}}let mn=new Set;function cr(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${U}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{m("overflowIgnored"),d(`Ignoring elements with [data-iframe-ignore] > *:
40
- `,n),P()}),t}function hn(){const e=document.querySelectorAll(`[${at}]`),t=cr(e);let n=!1;return typeof Set.prototype.symmetricDifference===se&&(n=t.symmetricDifference(mn).size>0),mn=t,i.overflowedNodeSet=t,i.hasOverflow=t.size>0,{hasOverflowUpdated:n,overflowedNodeSet:t}}const S={},pn=e=>{const t=new Set;for(const n of e){t.add(n);for(const o of De(n))t.add(o)}return d(`Inspecting:
41
- `,t),t},ar=e=>{if(e.size===0)return;m("addObservers");const t=pn(e);S.overflow.attachObservers(t),S.resize.attachObserverToNonStaticElements(t),P()},lr=e=>{if(e.size===0)return;m("removeObservers");const t=pn(e);S.overflow.detachObservers(t),S.resize.detachObservers(t),P()};function dr({addedNodes:e,removedNodes:t}){m("contentMutated"),i.applySelectors(),Kt(),hn(),P(),lr(t),ar(e)}function ur(e){dr(e),E(gt,"Mutation Observed")}const Q="Overflow",fr=ge(Q),mr=ge(Q,!1),hr=cn(Q),pr=an(Q),gr=e=>e.hidden||e.offsetParent===null||e.style.display===Le,yr=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},s=window?.requestAnimationFrame||ce,u=(T=!1)=>e(T),l=(T,H)=>T===0||T>H[n],h=(T,H)=>T.toggleAttribute(at,H);function b(T){for(const H of T){const{boundingClientRect:X,rootBounds:ee,target:M}=H;if(!ee)continue;const mi=X[n],hi=l(mi,ee)&&!gr(M);h(M,hi)}s(u)}const f=new IntersectionObserver(b,o),z=new WeakSet;function p(T){const H=new Set,X=new Set;let ee=0;for(const M of T)if(M.nodeType===Node.ELEMENT_NODE){if(z.has(M)){H.add(M);continue}f.observe(M),z.add(M),X.add(M),ee+=1}pr(H),hr(X),fr(ee),X.clear(),H.clear()}return{attachObservers:p,detachObservers:ln(Q,f,z,mr),disconnect:()=>{f.disconnect(),d("Detached%c OverflowObserver",r.HIGHLIGHT)}}};function vr(){const{hasOverflow:e}=i,{hasOverflowUpdated:t,overflowedNodeSet:n}=hn();switch(!0){case!t:return;case n.size>1:d("Overflowed Elements:",n);break;case e:break;default:d("No overflow detected")}E($e,"Overflow updated")}function br(e){const t={root:document.documentElement,side:c.calculateHeight?ut:ft};return S.overflow=yr(vr,t),S.overflow.attachObservers(e),S.overflow}const Y="Resize",zr=ge(Y),wr=ge(Y,!1),Ir=cn(Y),Er=an(Y),ve=new WeakSet,Ye=new Set,Je=new Set;let J;function Or(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const o=getComputedStyle(n)?.position;if(!(o===""||o==="static")){if(ve.has(n)){Ye.add(n);continue}J.observe(n),ve.add(n),Je.add(n),t+=1}}Er(Ye),Ir(Je),zr(t),Je.clear(),Ye.clear()}const Sr=e=>(J=new ResizeObserver(e),J.observe(document.body),ve.add(document.body),d("Attached%c ResizeObserver%c to body",r.HIGHLIGHT,r.FOREGROUND),{attachObserverToNonStaticElements:Or,detachObservers:ln(Y,J,ve,wr),disconnect:()=>{J.disconnect(),d("Detached%c ResizeObserver",r.HIGHLIGHT)}});function Tr(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;E(pt,`Element resized <${qn(t)}>`)}function Rr(e){return S.resize=Sr(Tr),S.resize.attachObserverToNonStaticElements(e),S.resize}let gn;function Hr(){const e=document.title;e!==gn&&(gn=e,a(`Title: %c${e}`,r.HIGHLIGHT),e&&y(0,0,Gn,e))}function Mr(e){a(`Visible: %c${e}`,r.HIGHLIGHT),i.isHidden=!e,E(yt,"Visibility changed")}function Ar(e){Ce.push(...e.map(t=>t.disconnect))}function $r(){m("attachObservers");const e=De(document.documentElement),t=[or(ur),br(e),Mo(),Rr(e),rr(Hr),ir(Mr)];Ar(t)}const yn=(e,t,n)=>{if(n!==""){a(`${e}: %c${n}`,r.HIGHLIGHT);for(const o of document.querySelectorAll(n))a(`Applying ${t} to:`,o),o.toggleAttribute(t,!0)}};function Lr({sizeSelector:e,ignoreSelector:t}){return()=>{yn("sizeSelector",ne,e),yn("ignoreSelector",U,t)}}function Nr(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function kr(e,t){return t.includes("-")&&(C(`Negative CSS value ignored for ${e}`),t=""),t}function Ke(e,t){t===void 0||t===""||t===Dn||(document.body.style.setProperty(e,t),d(`Set body ${e}: %c${t}`,r.HIGHLIGHT))}function Gr({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),Ke("margin",kr("margin",e))}const Pr=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function Cr(e){const t=e.getBoundingClientRect(),n=Pr();return{x:parseInt(t.left,10)+parseInt(n.x,10),y:parseInt(t.top,10)+parseInt(n.y,10)}}function jr(e,t){const n=Cr(t);a(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),y(n.y,n.x,ct)}function Xe(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),o=document.getElementById(n)||document.getElementsByName(n)[0];if(o!==void 0){jr(t,o);return}a(`In page link (#${t}) not found in iframe, so sending to parent`),y(0,0,Hn,`#${t}`)}function vn(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&Xe(t)}function _r(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&L(e,"click",t=>{t.preventDefault(),Xe(e.getAttribute("href"))})}function Dr(){L(window,"hashchange",vn)}function xr(){setTimeout(vn,zt)}function Br(){a("Setting up location.hash handlers"),_r(),Dr(),xr(),i.inPageLinks={findTarget:Xe}}function Fr(e){const{mode:t}=c;e?xe(t)?g(F(5)):Br():a("In page linking not enabled")}const Ur="important";function Wr(){const e=t=>t.style.setProperty(oe,$,Ur);e(document.documentElement),e(document.body),a("Set HTML & body height: %cauto !important",r.HIGHLIGHT)}const et=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},tt=et(se),be=et(A),ze=et(W),Vr=e=>e!==null&&typeof e===Cn&&!Array.isArray(e);function qr(e){const{calculateHeight:t,calculateWidth:n}=c;let o,s;return typeof e?.offset===A&&(ro(Se,Te),t&&(o=be(e,Se)),n&&(s=be(e,Se))),typeof e?.offsetSize===A&&(t&&(o=be(e,Te)),n&&(s=be(e,Te))),{offsetHeight:o,offsetWidth:s}}function Zr(e){a("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=qr(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:ze(e,"ignoreSelector"),[Zt(3)]:ze(e,Zt(0)),sizeSelector:ze(e,"sizeSelector"),targetOrigin:ze(e,"targetOrigin"),onBeforeResize:tt(e,"onBeforeResize"),onMessage:tt(e,"onMessage"),onReady:tt(e,"onReady")}}function Qr(){const{mode:e}=c;if(xe(e))return{};const t=window.iframeResizer||window.iFrameResizer;return Vr(t)?Zr(t):{}}const Yr=e=>e==="true",bn=e=>t=>t===void 0?void 0:e(t),j=bn(Yr),K=bn(Number),Jr=e=>({parentId:e[0],bodyMargin:K(e[1]),calculateWidth:j(e[2]),logging:j(e[3]),autoResize:j(e[6]),bodyMarginStr:e[7],heightCalcMode:e[8],bodyBackground:e[9],bodyPadding:e[10],tolerance:K(e[11]),inPageLinks:j(e[12]),widthCalcMode:e[14],mouseEvents:j(e[15]),offsetHeight:K(e[16]),offsetWidth:K(e[17]),calculateHeight:j(e[18]),key:e[19],version:e[20],mode:K(e[21]),logExpand:j(e[23])});function Kr(e){const{mode:t}=c;e.forEach(n=>{try{n()}catch(o){if(t<0)throw o;g(`<rb>Error in setup function</>
24
+ To improve performance add the <b>data-iframe-size</> attribute to the ${ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},Yo)}function es(e){e.getEntries().forEach(t=>{if(t.name===le)try{const{duration:n}=performance.measure(Zt,Ae,le);ue=t.detail,y.push(n),y.length>Ko&&y.shift()}catch{}})}function ts(){u("Attached%c PerformanceObserver%c to page",s.HIGHLIGHT,s.FOREGROUND);const e=new PerformanceObserver(es);return e.observe({entryTypes:["mark"]}),Xo(),{disconnect:()=>{Qt(),clearInterval(Ne),e.disconnect(),u("Detached%c PerformanceObserver",s.HIGHLIGHT)}}}const ns=e=>`:not(${e})`,os=`* ${Array.from(yt).map(ns).join("")}`,$e=e=>e.querySelectorAll(os);function ss(){const{hasOverflow:e,hasTags:t,overflowedNodeSet:n,taggedElements:o}=i;return t?o:e?Array.from(n):$e(document.documentElement)}function rs(e,t){const n=`margin-${t}`;let o,r=document.documentElement,d=i.hasTags?1:document.documentElement.getBoundingClientRect().bottom;for(const a of e)o=a.getBoundingClientRect()[t]+parseFloat(getComputedStyle(a).getPropertyValue(n)),o>d&&(d=o,r=a);return{maxEl:r,maxVal:d}}function Jt(e){performance.mark(Ae);const t=bt(e),{logging:n}=c,{hasTags:o}=i,r=ss(),{maxEl:d,maxVal:a}=rs(r,e);return u(`${t} position calculated from:`,d),u(`Checked %c${r.length}%c elements`,s.HIGHLIGHT,s.FOREGROUND),performance.mark(le,{detail:{hasTags:o,len:r.length,logging:n,Side:t}}),a}const Ge={label:ne,enabled:()=>c.calculateHeight,getOffset:()=>c.offsetHeight,auto:()=>qt(Ge),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),documentElementScroll:()=>document.documentElement.scrollHeight,taggedElement:()=>Jt(it)},Ce={label:ot,enabled:()=>c.calculateWidth,getOffset:()=>c.offsetWidth,auto:()=>qt(Ce),boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),documentElementScroll:()=>document.documentElement.scrollWidth,taggedElement:()=>Jt(ct)};function is(e,t,n){const o=c.onBeforeResize(e,t,n);if(o===void 0)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(o))throw new TypeError(`Invalid value returned from onBeforeResize(): ${o}, expected Number`);if(o<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${o}, must be at least 1`);return o}const Kt=(e,t)=>(n,o)=>{const r=e[n]();return e.enabled()&&c.onBeforeResize!==void 0?is(r,o,t):r},cs=Kt(Ge,ne),as=Kt(Ce,ot);function ls(){(window.scrollY!==0||window.scrollX!==0)&&(u("Reset iframe scroll position to (0, 0)"),window.scrollTo(0,0))}function us(e,t,n,o){const{heightCalcMode:r,widthCalcMode:d}=c;ls();const a=n??cs(r,e),f=o??as(d,e),v=Vo(a,f)?at:e;switch(l(`Resize event: %c${t}`,s.HIGHLIGHT),v){case te:case Ee:case at:case Ie:case Oe:i.height=a,i.width=f;case lt:return i;case Re:case dt:case ut:case ft:{l(mt);break}default:u(mt)}return null}let de=!1,je=!1,q=null;function ds(e,t,n,o,r){const{autoResize:d}=c,{isHidden:a}=i;switch(h(e),!0){case(a===!0&&!(e in Se)):{if(je===!0)break;l("Iframe hidden - Ignored resize request"),je=!0,de=!1,cancelAnimationFrame(q),q=null;break}case(de===!0&&e!==Re&&!(e in Se)):{l("Resize already pending - Ignored resize request");break}case(!d&&!(e in Se)):{u("Resizing disabled");break}default:{je=!1,de=!0,i.totalTime=performance.now(),i.timerActive=!0;const f=us(e,t,n,o);f&&Ut(f.height,f.width,e,r),q||(q=requestAnimationFrame(()=>{de=!1,q=null,h("requestAnimationFrame"),ie(`Reset sendPending: %c${e}`,s.HIGHLIGHT)})),i.timerActive=!1}}j()}const E=Me(ds);function Xt({eventType:e,eventName:t}){A(window,t,()=>E(t,e),{passive:!0})}function fs(){Xt({eventType:"After Print",eventName:"afterprint"}),Xt({eventType:"Before Print",eventName:"beforeprint"})}function ms(){if(i.triggerLocked){l("TriggerLock blocked calculation");return}i.triggerLocked=!0,ie("Trigger event lock on"),requestAnimationFrame(()=>{i.triggerLocked=!1,ie("Trigger event lock off")})}function en(e){const{heightCalcMode:t,widthCalcMode:n}=c,o=Ge[t](),r=Ce[n]();l(`Reset trigger event: %c${e}`,s.HIGHLIGHT),g(o,r,e)}function hs(e){const t=c.heightCalcMode;l(`Reset trigger event: %c${e}`,s.HIGHLIGHT),c.heightCalcMode=Pn,ms(),en("reset"),c.heightCalcMode=t}const ps=`Auto Resize can not be changed when <b>direction</> is set to '${Te}'.`;function ys(e){w(e,An,"parentIframe.autoResize(enable) enable");const{autoResize:t,calculateHeight:n,calculateWidth:o}=c;return o===!1&&n===!1?(h(Ee),z(ps),!1):(e===!0&&t===!1?(c.autoResize=!0,queueMicrotask(()=>E(Ee,"Auto Resize enabled"))):e===!1&&t===!0&&(c.autoResize=!1),g(0,0,wn,JSON.stringify(c.autoResize)),c.autoResize)}function gs(e){w(e,U,"parentIframe.moveToAnchor(anchor) anchor"),i.inPageLinks.findTarget(e)}function vs(e){w(e,G,"parentIframe.setOffsetSize(offset) offset"),c.offsetHeight=e,c.offsetWidth=e,E(lt,`parentIframe.setOffsetSize(${e})`)}const bs=()=>i.origin;function zs(e){w(e,U,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),l(`Set targetOrigin: %c${e}`,s.HIGHLIGHT),c.targetOrigin=e}function ws(e){return w(e,we,"parentIframe.getParentProps(callback) callback"),i.onParentInfo=e,g(0,0,et),()=>{i.onParentInfo=null,g(0,0,Hn)}}function Es(e,t){e!==void 0&&w(e,G,"parentIframe.resize(customHeight, customWidth) customHeight"),t!==void 0&&w(t,G,"parentIframe.resize(customHeight, customWidth) customWidth");const n=e===void 0?"":e,o=t===void 0?"":`,${t}`,r=`${n}${o}`;E(Ie,`parentIframe.resize(${r})`,e,t)}const Pe=e=>(t,n)=>{w(t,G,`parentIframe.${e}(x, y) x`),w(n,G,`parentIframe.${e}(x, y) y`),g(n,t,e)},Is=Pe(Mn),Os=Pe(Ln),Ss=Pe(tt);function Rs(e,t){t&&w(t,U,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),g(0,0,be,JSON.stringify(e),t)}const Ts=()=>g(0,0,In),Hs=()=>c.parentId,Ms=()=>hs("parentIframe.reset");function Ls(){const{win:e}=i;c.mode!==1&&(e.parentIframe=Object.freeze({autoResize:ys,close:Ts,getId:Hs,getParentOrigin:bs,getParentProps:ws,moveToAnchor:gs,reset:Ms,setOffsetSize:vs,scrollBy:Is,scrollTo:Os,scrollToOffset:Ss,sendMessage:Rs,setTargetOrigin:zs,resize:Es}))}const Z=(e="")=>t=>n=>{n.size>0&&ie(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[`
25
+ `,o]))},ks=(e="")=>t=>n=>{n.size>0&&It(`${t}Observer ${e}:`,...Array.from(n).flatMap(o=>[`
26
+ `,o]))},tn=Z("attached to"),nn=ks("already attached"),As=Z("detached from"),fe=(e,t=!0)=>n=>{n>0&&u(`${t?"At":"De"}tached %c${e}Observer%c ${t?"to":"from"} %c${n}%c element${n===1?"":"s"}`,s.HIGHLIGHT,s.NORMAL,s.HIGHLIGHT,s.NORMAL)},on=(e,t,n,o)=>{const r=As(e);return d=>{const a=new Set;let f=0;for(const v of d)n.has(v)&&(t.unobserve(v),n.delete(v),a.add(v),f+=1);r(a),o(f),a.clear()}},sn=16,rn=2,Ns=200,_e="Mutation",I=new Set,$=new Set,De=new Set,me=[],$s={attributes:!0,attributeFilter:[B,ze],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let xe=1,Fe,Be=!1,Ue=0;const Gs=Z("added")(_e),Cs=Z("removed (page)")(_e),js=Z("removed (added)")(_e),cn=e=>e.nodeType!==Node.ELEMENT_NODE||yt.has(e.tagName.toLowerCase());function Ps(e){const t=e.addedNodes;for(const n of t)cn(n)||I.add(n)}function _s(e){const t=e.removedNodes;for(const n of t)cn(n)||(I.has(n)?(I.delete(n),De.add(n)):$.add(n))}const Ds=e=>{u("Mutations:",e);for(const t of e)Ps(t),_s(t);Gs(I),Cs($),js(De),De.clear()};function xs(){$.size>0&&l(`Detected %c${$.size} %cremoved element${$.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND),I.size>0&&l(`Found %c${I.size} %cnew element${I.size>1?"s":""}`,s.HIGHLIGHT,s.FOREGROUND)}const Fs=e=>()=>{const t=performance.now(),n=t-Ue,o=sn*xe+++rn;if(n>o&&n<Ns){h("mutationThrottled"),u("Update delayed due to heavy workload on the callStack"),u(`EventLoop busy time: %c${C(n)}ms %c> Max wait: %c${o-rn}ms`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),setTimeout(Fe,sn*xe),Ue=t;return}xe=1,me.forEach(Ds),me.length=0,Be=!1,xs(),e({addedNodes:I,removedNodes:$}),I.clear(),$.clear()};function Bs(e){me.push(e),!Be&&(Ue=performance.now(),Be=!0,requestAnimationFrame(Fe))}function Us(e){const t=new window.MutationObserver(Bs),n=document.body||document.documentElement;return Fe=Fs(e),t.observe(n,$s),u("Attached%c MutationObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{I.clear(),$.clear(),me.length=0,t.disconnect(),u("Detached%c MutationObserver",s.HIGHLIGHT)}}}const Ws={characterData:!0,childList:!0,subtree:!0};function Vs(e){const t=document.querySelector("title")??document.head??document.documentElement,n=new MutationObserver(e);return n.observe(t,Ws),u("Attached%c TitleObserver%c to head",s.HIGHLIGHT,s.FOREGROUND),setTimeout(e),{disconnect:()=>{n.disconnect(),u("Detached%c TitleObserver",s.HIGHLIGHT)}}}function qs(e){const t=new IntersectionObserver(o=>e(o.at(-1)?.isIntersecting??!1),{threshold:0}),n=document.documentElement;return t.observe(n),u("Attached%c VisibilityObserver%c to page",s.HIGHLIGHT,s.FOREGROUND),{disconnect:()=>{t.disconnect(),u("Detached%c VisibilityObserver",s.HIGHLIGHT)}}}let an=new Set;function Zs(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${B}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{h("overflowIgnored"),u(`Ignoring elements with [data-iframe-ignore] > *:
27
+ `,n),j()}),t}function ln(){const e=document.querySelectorAll(`[${nt}]`),t=Zs(e);let n=!0;return typeof Set.prototype.symmetricDifference===we&&(n=t.symmetricDifference(an).size>0),an=t,i.overflowedNodeSet=t,i.hasOverflow=t.size>0,{hasOverflowUpdated:n,overflowedNodeSet:t}}const O={},un=e=>{const t=new Set;for(const n of e)if(n instanceof Element){t.add(n);for(const o of $e(n))t.add(o)}return u(`Inspecting:
28
+ `,t),t},Ys=e=>{if(e.size===0)return;h("addObservers");const t=un(e);O.overflow.attachObservers(t),O.resize.attachObserverToNonStaticElements(t),j()},Qs=e=>{if(e.size===0)return;h("removeObservers");const t=un(e);O.overflow.detachObservers(t),O.resize.detachObservers(t),j()};function Js({addedNodes:e,removedNodes:t}){h("contentMutated"),i.applySelectors(),Bt(),ln(),j(),Qs(t),Ys(e)}function Ks(e){Js(e),E(dt,"Mutation Observed")}const Y="Overflow",Xs=fe(Y),er=fe(Y,!1),tr=tn(Y),nr=nn(Y),or=e=>e instanceof HTMLElement&&(!!e.hidden||e.offsetParent===null||e.style.display===Te),sr=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,d=(S=!1)=>e(S),a=(S,L)=>S===0||S>L[n],f=(S,L)=>{S.toggleAttribute(nt,L)};function v(S){for(const L of S){const{boundingClientRect:X,rootBounds:ee,target:R}=L;if(!ee)continue;const ei=X[n],ti=a(ei,ee)&&!(R instanceof HTMLElement&&or(R));f(R,ti)}r(d)}const m=new IntersectionObserver(v,o),b=new WeakSet;function p(S){const L=new Set,X=new Set;let ee=0;for(const R of S)if(R instanceof Element){if(b.has(R)){L.add(R);continue}m.observe(R),b.add(R),X.add(R),ee+=1}nr(L),tr(X),Xs(ee),X.clear(),L.clear()}return{attachObservers:p,detachObservers:on(Y,m,b,er),disconnect:()=>{m.disconnect(),u("Detached%c OverflowObserver",s.HIGHLIGHT)}}};function rr(){const{hasOverflow:e}=i,{hasOverflowUpdated:t,overflowedNodeSet:n}=ln();switch(!0){case!t:return;case n.size>1:u("Overflowed Elements:",n);break;case e:break;default:u("No overflow detected")}E(Re,"Overflow updated")}function ir(e){const t={root:document.documentElement,side:c.calculateHeight?it:ct};return O.overflow=sr(rr,t),O.overflow.attachObservers(e),O.overflow}const Q="Resize",cr=fe(Q),ar=fe(Q,!1),lr=tn(Q),ur=nn(Q),he=new WeakSet,We=new Set,Ve=new Set;let J;function dr(e){let t=0;for(const n of e){if(!(n instanceof Element))continue;const o=getComputedStyle(n)?.position;if(!(o===""||o==="static")){if(he.has(n)){We.add(n);continue}J.observe(n),he.add(n),Ve.add(n),t+=1}}ur(We),lr(Ve),cr(t),Ve.clear(),We.clear()}const fr=e=>(J=new ResizeObserver(e),J.observe(document.body),he.add(document.body),u("Attached%c ResizeObserver%c to body",s.HIGHLIGHT,s.FOREGROUND),{attachObserverToNonStaticElements:dr,detachObservers:on(Q,J,he,ar),disconnect:()=>{J.disconnect(),u("Detached%c ResizeObserver",s.HIGHLIGHT)}});function mr(e){if(!Array.isArray(e)||e.length===0)return;const t=e[0].target;E(ut,`Element resized <${Fn(t)}>`)}function hr(e){return O.resize=fr(mr),O.resize.attachObserverToNonStaticElements(e),O.resize}let dn;function pr(){const e=document.title;e!==dn&&(dn=e,l(`Title: %c${e}`,s.HIGHLIGHT),e&&g(0,0,kn,e))}function yr(e){l(`Visible: %c${e}`,s.HIGHLIGHT),i.isHidden=!e,E(ft,"Visibility changed")}function gr(e){Le.push(...e.map(t=>t.disconnect))}function vr(){h("attachObservers");const e=$e(document.documentElement),t=[Us(Ks),ir(e),ts(),hr(e),Vs(pr),qs(yr)];gr(t)}const fn=(e,t,n)=>{if(n!==""){l(`${e}: %c${n}`,s.HIGHLIGHT);for(const o of document.querySelectorAll(n))l(`Applying ${t} to:`,o),o.toggleAttribute(t,!0)}};function br({sizeSelector:e,ignoreSelector:t}){return()=>{fn("sizeSelector",ze,e),fn("ignoreSelector",B,t)}}function zr(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function wr(e,t){return t.includes("-")&&(_(`Negative CSS value ignored for ${e}`),t=""),t}function qe(e,t){t===void 0||t===""||t===Cn||(document.body.style.setProperty(e,t),u(`Set body ${e}: %c${t}`,s.HIGHLIGHT))}function Er({bodyMarginStr:e,bodyMargin:t}){e===void 0&&(e=`${t}px`),qe("margin",wr("margin",e))}const Ir=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function Or(e){const t=e.getBoundingClientRect(),n=Ir();return{x:Math.round(t.left+n.x),y:Math.round(t.top+n.y)}}function Sr(e,t){const n=Or(t);l(`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT,s.FOREGROUND,s.HIGHLIGHT),g(n.y,n.x,tt)}function Ze(e){const t=e.split("#")[1]||e,n=decodeURIComponent(t),o=document.getElementById(n)||document.getElementsByName(n)[0];if(o!==void 0){Sr(t,o);return}l(`In page link (#${t}) not found in iframe, so sending to parent`),g(0,0,On,`#${t}`)}function mn(){const{hash:e,href:t}=window.location;e!==""&&e!=="#"&&Ze(t)}function Rr(){for(const e of document.querySelectorAll('a[href^="#"]'))e.getAttribute("href")!=="#"&&A(e,"click",t=>{t.preventDefault(),Ze(e.getAttribute("href"))})}function Tr(){A(window,"hashchange",mn)}function Hr(){setTimeout(mn,pt)}function Mr(){l("Setting up location.hash handlers"),Rr(),Tr(),Hr(),i.inPageLinks={findTarget:Ze}}function Lr(e){const{mode:t}=c;e?ke(t)?z(M(5)):Mr():l("In page linking not enabled")}const kr="important";function Ar(){const e=t=>t.style.setProperty(ne,W,kr);e(document.documentElement),e(document.body),l("Set HTML & body height: %cauto !important",s.HIGHLIGHT)}const Ye=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Qe=Ye(we),hn=Ye(G),pe=Ye(U),Nr=e=>e!==null&&typeof e===Nn&&!Array.isArray(e);function $r(e){const{calculateHeight:t,calculateWidth:n}=c;let o,r;return typeof e?.offsetSize===G&&(t&&(o=hn(e,st)),n&&(r=hn(e,st))),{offsetHeight:o,offsetWidth:r}}function Gr(e){l("Reading data from page:",Object.keys(e));const{offsetHeight:t,offsetWidth:n}=$r(e);return{offsetHeight:t,offsetWidth:n,ignoreSelector:pe(e,"ignoreSelector"),[_t(3)]:pe(e,_t(0)),sizeSelector:pe(e,"sizeSelector"),targetOrigin:pe(e,"targetOrigin"),onBeforeResize:Qe(e,"onBeforeResize"),onMessage:Qe(e,"onMessage"),onReady:Qe(e,"onReady")}}function Cr(){const{mode:e}=c;if(ke(e))return{};const t=window.iframeResizer||window.iFrameResizer;return Nr(t)?Gr(t):{}}const jr=e=>e==="true",pn=e=>t=>t===void 0?void 0:e(t),P=pn(jr),K=pn(Number),Pr=e=>({parentId:e[0],bodyMargin:K(e[1]),calculateWidth:P(e[2]),logging:P(e[3]),autoResize:P(e[6]),bodyMarginStr:e[7],bodyBackground:e[9],bodyPadding:e[10],tolerance:K(e[11]),inPageLinks:P(e[12]),mouseEvents:P(e[15]),offsetHeight:K(e[16]),offsetWidth:K(e[17]),calculateHeight:P(e[18]),key:e[19],version:e[20],mode:K(e[21]),logExpand:P(e[23])});function _r(e){const{mode:t}=c;e.forEach(n=>{try{n()}catch(o){if(t<0)throw o;z(`<rb>Error in setup function</>
42
29
  <i>iframe-resizer</> detected an error during setup.
43
30
 
44
- Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),Rt(o)}})}function zn(e){for(const[t,n]of Object.entries(e))n!==void 0&&(c[t]=n)}function Xr({logExpand:e,logging:t,parentId:n}){to({id:n,enabled:t,expand:e}),m("initReceived"),a(`Initialising iframe v${w} ${window.location.href}`)}function ei(e){m("ready"),Jt(It(e)),a("Initialization complete",(({key:t,key2:n,...o})=>o)(c))}function ti({bodyBackground:e,bodyPadding:t,inPageLinks:n,onReady:o}){const s=zo(c),u=[()=>ss(c),()=>Yo(c),Do,Po,ko,Go,jo,Xo,Kt,ts,s?ce:bo,()=>Gr(c),()=>Ke("background",e),()=>Ke("padding",t),s?ce:Wr,Nr,i.applySelectors,()=>Fr(n),zs,()=>ds(c),ms,()=>Fs(),()=>E(te,"Init message from host page",void 0,void 0,`${w}:${c.mode}`),$r,P];Kr(u),ei(o)}function ni(e){i.firstRun&&(zn(Jr(e)),Xr(c),zn(Qr()),i.applySelectors=Lr(c),ti(c))}function oi(e){if(document.readyState==="loading"){a("Page not ready, ignoring init message");return}const t=e.data.slice(bt).split(":");i.target=e.source,i.origin=e.origin,ni(t),i.firstRun=!1,setTimeout(()=>{i.initLock=!1},zt)}const{freeze:si}=Object,{parse:nt}=JSON,ot=e=>si(nt(e)),wn=e=>y(0,0,`${e}Stop`),we=e=>e.data.slice(e.data.indexOf(":")+1),ri=e=>ao(e)?te:e.data.split("]")[1].split(":")[0];function ii(e){const t=we(e);a("onMessage called from parent:%c",r.HIGHLIGHT,ot(t)),ie(c.onMessage,nt(t))}function ci(e){const{onPageInfo:t}=i,n=we(e);a("PageInfo received from parent:",ot(n)),t?ie(t,nt(n)):wn(rt)}function ai(e){const{onParentInfo:t}=i,n=ot(we(e));a("ParentInfo received from parent:",n),t?ie(t,n):wn(it)}function li(){if(i.initLock){a("Page reset ignored by init");return}a("Page size reset by host page"),sn("resetPage")}function di(){a("Resize requested by host page"),E(Me,"Parent window requested size check")}const In=e=>i.inPageLinks.findTarget(we(e)),En={init:oi,reset:li,resize:di,moveToAnchor:In,inPageLink:In,pageInfo:ci,parentInfo:ai,message:ii};function ui(e){const{firstRun:t}=i,n=ri(e);switch(m(n),!0){case n in En:En[n](e);break;case(t&&co()):C(`Ignored message of type "${n}". Received before initialization.`);break;default:C(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const Ie=Ge(e=>{io(e)&&ui(e)});function fi(){if("iframeChildListener"in window){C("Already setup");return}window.iframeChildListener=t=>setTimeout(()=>Ie({data:t,sameOrigin:!0})),m("listen"),L(window,Oe,Ie),L(document,dt,Nt),Nt();function e(t){return Ie(t),i.win}try{top?.document?.getElementById("banner")&&(i.win={},window.mockMsgListener=e,At(window,Oe,Ie),typeof window.define=="function"&&window.define([],()=>e))}catch{}}typeof window!==jn&&fi()}));
31
+ Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`),It(o)}})}function yn(e){for(const[t,n]of Object.entries(e))n!==void 0&&(c[t]=n)}function Dr({logExpand:e,logging:t,parentId:n=""}){Qn({id:n,enabled:t,expand:e}),h("initReceived"),l(`Initialising iframe v${T} ${window.location.href}`)}function xr(e){h("ready"),Ft(gt(e)),l("Initialization complete",(({key:t,key2:n,...o})=>o)(c))}function Fr({bodyBackground:e,bodyPadding:t,inPageLinks:n,onReady:o}){const r=ho(c),d=[go,po,ko,Bt,No,r?re:mo,()=>Er(c),()=>qe("background",e),()=>qe("padding",t),r?re:Ar,zr,i.applySelectors,()=>Lr(n),fs,()=>Fo(c),Wo,()=>Ls(),()=>E(te,"Init message from host page",void 0,void 0,`${T}:${c.mode}`),vr,j];Co(c),Ho(c),_r(d),xr(o)}function Br(e){i.firstRun&&(yn(Pr(e)),Dr(c),yn(Cr()),i.applySelectors=br(c),Fr(c))}function Ur(e){if(document.readyState==="loading"){l("Page not ready, ignoring init message");return}const t=e.data.slice(ht).split(":");i.target=e.source,i.origin=e.origin,Br(t),i.firstRun=!1,setTimeout(()=>{i.initLock=!1},pt)}const{freeze:Wr}=Object,{parse:Je}=JSON,Ke=e=>Wr(Je(e)),gn=e=>g(0,0,`${e}Stop`),ye=e=>e.data.slice(e.data.indexOf(":")+1),Vr=e=>no(e)?te:e.data.split("]")[1].split(":")[0];function qr(e){const t=ye(e);l("onMessage called from parent:%c",s.HIGHLIGHT,Ke(t)),se(c.onMessage,Je(t))}function Zr(e){const{onPageInfo:t}=i,n=ye(e);l("PageInfo received from parent:",Ke(n)),t?se(t,Je(n)):gn(Tn)}function Yr(e){const{onParentInfo:t}=i,n=Ke(ye(e));l("ParentInfo received from parent:",n),t?se(t,n):gn(et)}function Qr(){if(i.initLock){l("Page reset ignored by init");return}l("Page size reset by host page"),en("resetPage")}function Jr(){l("Resize requested by host page"),E(Oe,"Parent window requested size check")}const vn=e=>i.inPageLinks.findTarget(ye(e)),bn={init:Ur,reset:Qr,resize:Jr,moveToAnchor:vn,inPageLink:vn,pageInfo:Zr,parentInfo:Yr,message:qr};function Kr(e){const{firstRun:t}=i,n=Vr(e);switch(h(n),!0){case n in bn:bn[n](e);break;case(t&&to()):_(`Ignored message of type "${n}". Received before initialization.`);break;default:_(`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`)}}const ge=Me(e=>{eo(e)&&Kr(e)});function Xr(){if("iframeChildListener"in window){_("Already setup");return}window.iframeChildListener=(t=>{setTimeout(()=>ge({data:t,sameOrigin:!0}))}),h("listen"),A(window,be,ge),A(document,rt,Mt),Mt();function e(t){return ge(t),i.win}try{top?.document?.getElementById("banner")&&(i.win={},window.mockMsgListener=e,Rt(window,be,ge),typeof window.define=="function"&&window.define([],()=>e))}catch{}}typeof window!==$n&&Xr()}));
45
32
  //# sourceMappingURL=index.umd.js.map