@iframe-resizer/child 5.5.6 → 5.5.7

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
@@ -25,4 +25,4 @@ yarn add @iframe-resizer/child
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 5.5.6 2025-09-10 - 16:04:48.965Z_
28
+ _iframe-resizer version 5.5.7 2025-09-23 - 09:33:32.779Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6 (cjs) - 2025-09-10
4
+ * @module iframe-resizer/child 5.5.7 (cjs) - 2025-09-23
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,4 @@
17
17
  */
18
18
 
19
19
 
20
- "use strict";const e=require("auto-console-group"),t="5.5.6",n="iframeResizer",o="beforeUnload",r="init",a="message",i="pageInfo",s="parentInfo",c="scrollToOffset",l="title",u=10,d="data-iframe-size",f="data-iframe-overflowed",m="data-iframe-ignore",h="height",p="width",g="readystatechange",y="bottom",b="right",v="autoResizeEnabled",z=Symbol("sizeChanged"),w="manualResize",$="parentResize",O={[w]:1,[$]:1},S="setOffsetSize",I="resizeObserver",M="overflowObserver",E="mutationObserver",T="visibilityObserver",k="[iFrameSizer]",j=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),N=(e,t,n,o)=>e.addEventListener(t,n,o||!1),A=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)},x=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),R=["spjluzl","rlf","clyzpvu"],C=["<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."],P=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),L=e=>x(C[e]),G=e=>{const t=e[x(R[0])]||e[x(R[1])]||e[x(R[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(x(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},B=(e,...t)=>setTimeout(()=>e(...t),0),q=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},D=e=>e,F=e=>Math.round(1e3*e)/1e3,W=e=>e.charAt(0).toUpperCase()+e.slice(1),U=e=>""!=`${e}`&&void 0!==e;const V=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${W(t)}`)};let Z=!0,J=n;var _;const Q=(_=e,_?.__esModule?_.default:_)({label:`${n}(child)`,expand:!1});var Y;const X=(Y="log",(...e)=>!Z||Q[Y](...e));const{assert:K,endAutoGroup:ee,error:te,errorBoundary:ne,event:oe,label:re,purge:ae,warn:ie}=Q,se=e=>{return Q.warn((t=D,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ce=se,le=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>se(t)),ue=le("Method"),de=le("Method","replaced with"),fe=le("Option"),me=["min-height","min-width","max-height","max-width"],he=new Set,pe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ge=(e,t)=>{return(n=pe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ye({href:e}){he.has(e)||he.add(e)}const be=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ye(n)}return{source:"cross-origin stylesheet",value:pe(e,t)}}(e,t),ve=(e,t)=>{const{source:n,value:o}=be(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);se(`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</>.\n\nIf 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 ze(){for(const e of[document.documentElement,document.body])for(const t of me)ge(e,t)&&ve(e,t)}const we=e=>t=>void 0===t?void 0:e(t),$e=we(e=>"true"===e),Oe=we(Number),Se=e=>e=>{e.size},Ie=((e="")=>t=>n=>{n.size>0&&te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Me=e=>e=>{e.size},Ee=(t,n=!0)=>o=>{o>0&&X(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Te=(e,t,n,o)=>{const r=Me(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},ke=new Set,je=new Set,Ne=new Set,Ae=[],xe={attributes:!0,attributeFilter:[m,d],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Re,Ce=1,Pe=!1,He=0;const Le=e=>{e.size},Ge=e=>{e.size},Be=e=>{e.size},qe=e=>e.nodeType!==Node.ELEMENT_NODE||j.has(e.tagName.toLowerCase());function De(e){const t=e.addedNodes;for(const e of t)qe(e)||ke.add(e)}function Fe(e){const t=e.removedNodes;for(const e of t)qe(e)||(ke.has(e)?(ke.delete(e),Ne.add(e)):je.add(e))}const We=e=>{X("Mutations:",e);for(const t of e)De(t),Fe(t);Le(ke),Ge(je),Be(Ne),Ne.clear()};const Ue=t=>()=>{const n=performance.now(),o=n-He,r=16*Ce+++2;if(o>r&&o<200)return oe("mutationThrottled"),X("Update delayed due to heavy workload on the callStack"),X(`EventLoop busy time: %c${F(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(Re,16*Ce),void(He=n);Ce=1,Ae.forEach(We),Ae.length=0,Pe=!1,je.size,ke.size,t({addedNodes:ke,removedNodes:je}),ke.clear(),je.clear()};function Ve(e){Ae.push(e),Pe||(He=performance.now(),Pe=!0,requestAnimationFrame(Re))}function Ze(e){const t=new window.MutationObserver(Ve),n=document.body||document.documentElement;return Re=Ue(e),t.observe(n,xe),X("Attached MutationObserver to body"),{...t,disconnect:()=>{ke.clear(),je.clear(),Ae.length=0,t.disconnect(),X("Detached MutationObserver")}}}const Je="Overflow",_e=Ee(Je),Qe=Ee(Je,!1),Ye=Se(Je),Xe=Ie(Je),Ke=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||D,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(f,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!Ke(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));Xe(t),Ye(n),_e(o),n.clear(),t.clear()},detachObservers:Te(Je,c,l,Qe),disconnect:()=>{c.disconnect(),X("Detached OverflowObserver")}}},tt="--ifr-start",nt="--ifr-end",ot="--ifr-measure",rt=[];let at,it={},st=0;function ct(){try{performance.clearMarks(tt),performance.clearMarks(nt),performance.clearMeasures(ot)}catch{}}function lt(e){e.getEntries().forEach(e=>{if(e.name===nt)try{const{duration:t}=performance.measure(ot,tt,nt);it=e.detail,rt.push(t),rt.length>100&&rt.shift()}catch{}})}function ut(){X("Attached PerformanceObserver to page");const e=new PerformanceObserver(lt);return e.observe({entryTypes:["mark"]}),at=setInterval(()=>{if(rt.length<10)return;if(it.hasTags&&it.len<25)return;rt.sort();const e=Math.min(rt.reduce((e,t)=>e+t,0)/rt.length,rt[Math.floor(rt.length/2)]),t=F(e);t>st&&(st=t,oe("performanceObserver")),ct(),e<=4||(clearInterval(at),se(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${F(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${it.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ct(),clearInterval(at),e.disconnect(),X("Detached PerformanceObserver")}}}const dt="Resize",ft=Ee(dt),mt=Ee(dt,!1),ht=Se(dt),pt=Ie(dt),gt=new WeakSet,yt=new Set,bt=new Set;let vt;function zt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(gt.has(n)?yt.add(n):(vt.observe(n),gt.add(n),bt.add(n),t+=1))}pt(yt),ht(bt),ft(t),bt.clear(),yt.clear()}function wt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),X("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),X("Detached VisibilityObserver")}}}const $t=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ot=$t("function"),St=$t("number"),It=$t("string");"undefined"!=typeof window&&function(){const A={height:()=>(ie("Custom height calculation function not defined"),vn.auto()),width:()=>(ie("Custom width calculation function not defined"),zn.auto())},C={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},H={},F="auto",_=[],Y="scroll";let le,me,he,pe,ge,ye,be,ve=!0,we="",Se=0,Ie="",Me="",Ee=!1,ke=!0,je=!1,Ne=!0,Ae=!1,xe=!1,Re=!0,Ce=!1,Pe=1,He=F,Le="",Ge=!0,Be={},qe=!1,De=!1,Fe=!1,We=0,Ue=!1,Ve=0,Je=0,_e=new Set,Qe="",Ye="child",Xe=!1,Ke="",ot=[],rt=window.parent,at="*",it=0,st=!1,ct=1,lt=Y,ft=window,ht=()=>{ie("onMessage function not defined")},pt=()=>{},yt=null,bt=null;function $t(o){var a;!function(e){Qe=e[0]??Qe,Se=Oe(e[1])??Se,je=$e(e[2])??je,Fe=$e(e[3])??Fe,ve=$e(e[6])??ve,Ie=e[7]??Ie,He=e[8]??He,we=e[9]??we,Me=e[10]??Me,it=Oe(e[11])??it,Be.enable=$e(e[12])??!1,Ye=e[13]??Ye,lt=e[14]??lt,Ue=$e(e[15])??Ue,Ve=Oe(e[16])??Ve,Je=Oe(e[17])??Je,ke=$e(e[18])??ke,le=e[19]??le,ye=e[20]??ye,We=Oe(e[21])??We,De=$e(e[23])??De}(o),J=(a={id:Qe,enabled:Fe,expand:De}).id||n,Q.label(`${J}`),Q.expand(a.expand),Z=a.enabled,function(){function t(e){be=Ot(e,"onBeforeResize")??be,ht=Ot(e,"onMessage")??ht,pt=Ot(e,"onReady")??pt,"number"==typeof e?.offset&&(fe("offset","offsetSize"),ke&&(Ve=St(e,"offset")??Ve),je&&(Je=St(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(ke&&(Ve=St(e,"offsetSize")??Ve),je&&(Je=St(e,"offsetSize")??Je)),me=It(e,x(R[0]))??me,Le=It(e,"ignoreSelector")??Le,Ke=It(e,"sizeSelector")??Ke,at=It(e,"targetOrigin")??at,He=e?.heightCalculationMethod||He,lt=e?.widthCalculationMethod||lt}function n(e,t){return"function"==typeof e&&(se(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),A[t]=e,e="custom"),e}if(1===We)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),He=n(He,h),lt=n(lt,p),X(`Set targetOrigin for parent: %c${at}`,e.HIGHLIGHT))}(),[At,Rt,Vt,jt,xt,Wt,Ut,Dt,Nt,Tt,Ee?D:ze,Ht,Yt,Qt,_t,Lt,()=>Ct("background",we),()=>Ct("padding",Me),Ee?D:Gt,Jt,Zt,un,Mt].forEach(e=>{try{e()}catch(e){if(We<0)throw e;se("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),te(e)}}),Et(q(pt)),En(r,"Init message from host page",void 0,void 0,`${t}:${We}`),document.title&&""!==document.title&&jn(0,0,l,document.title)}function Mt(){N(window,o.toLowerCase(),()=>{_.forEach(e=>e()),jn(0,0,o)})}function Et(e){"complete"===document.readyState?B(e):N(document,g,()=>Et(e))}function Tt(){ot=document.querySelectorAll(`[${d}]`),Ce=ot.length>0}let kt=0;function jt(){const t=document.querySelectorAll(`*[${m}]`);return Ae=t.length>0,Ae&&t.length!==kt&&(function(t){const n=1===t.length?"":"s";ie(`%c[${m}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),kt=t.length),Ae}function Nt(){"BackCompat"===document.compatMode&&se("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function At(){ye&&""!==ye&&"false"!==ye?ye!==t&&se(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ye} - Child page: ${t}.\n`):se("<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/</> for more details.\n")}function xt(){try{Xe=1===We||"iframeParentListener"in window.parent}catch(e){}}function Rt(){je===ke&&(Ee=!0)}function Ct(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),X(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Pt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Ht(){Pt(0,d,Ke),Pt(0,m,Le)}function Lt(){var e,t;void 0===Ie&&(Ie=`${Se}px`),Ct("margin",(e="margin",(t=Ie).includes("-")&&(ie(`Negative CSS value ignored for ${e}`),t=""),t))}function Gt(){const e=e=>e.style.setProperty(h,"auto","important");e(document.documentElement),e(document.body)}function Bt(e){({add(t){function n(){En(e.eventName,e.eventType)}H[t]=n,N(window,t,n,{passive:!0})},remove(e){const t=H[e];var n,o;delete H[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function qt(e){Bt({method:e,eventType:"After Print",eventName:"afterprint"}),Bt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Bt({method:e,eventType:"Ready State Change",eventName:g})}function Dt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(d,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&se("<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 Ft(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ie(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in C)&&se(`<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 ${ye?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function Wt(){He=Ft(He,F,vn)}function Ut(){lt=Ft(lt,Y,zn)}function Vt(){const n=We,o=G({key:le}),r=G({key:me});if(We=Math.max(o,r),We<0){if(We=Math.min(o,r),ae(),se(`${L(We+2)}${L(2)}`),U(ye))throw L(We+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!U(ye)||n>-1&&We>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${J} %ciframe-resizer ${t}`,Z||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>x(P[e]))(We)})`,We),We<2&&ce(L(3)),sessionStorage.setItem("ifr",t))}function Zt(){qt("add"),_.push(()=>qt("remove"))}function Jt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function _t(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?jn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);jn(n.y,n.x,c)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Be.enable&&(1===We?se("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&N(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),N(window,"hashchange",n),setTimeout(n,128))),Be={findTarget:t}}function Qt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){N(window.document,t,e)}!0===Ue&&(t("mouseenter"),t("mouseleave"))}function Yt(){1!==We&&(ft.parentIframe=Object.freeze({autoResize:e=>(V(e,"boolean","parentIframe.autoResize(enable) enable"),!1===je&&!1===ke?(oe(v),se("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ve?(ve=!0,queueMicrotask(()=>En(v,"Auto Resize enabled"))):!1===e&&!0===ve&&(ve=!1),jn(0,0,"autoResize",JSON.stringify(ve)),ve)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(oe("getOrigin"),ue("getOrigin()","getParentOrigin()"),he),getParentOrigin:()=>he,getPageInfo(e){if("function"==typeof e)return yt=e,jn(0,0,i),void de("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");yt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(V(e,"function","parentIframe.getParentProps(callback) callback"),bt=e,jn(0,0,s),()=>{bt=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ue("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){V(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Be.findTarget(e)},reset(){!function(){const e=He;He=F,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Tn("reset"),He=e}()},setOffsetSize(e){V(e,"number","parentIframe.setOffsetSize(offset) offset"),Ve=e,Je=e,En(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){V(e,"number","parentIframe.scrollBy(x, y) x"),V(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){V(e,"number","parentIframe.scrollTo(x, y) x"),V(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){V(e,"number","parentIframe.scrollToOffset(x, y) x"),V(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,c)},sendMessage(e,t){t&&V(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,a,JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,Wt()},setWidthCalculationMethod(e){lt=e,Ut()},setTargetOrigin(e){V(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),at=e},resize(e,t){void 0!==e&&V(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&V(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),En(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ue("size()","resize()"),this.resize(e,t)}}),ft.parentIFrame=ft.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${f}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${m}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{oe("overflowIgnored"),X("Ignoring elements with [data-iframe-ignore] > *:\n",n),ee()}),t}(e),xe=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Re=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!Re:return;case _e.size>1:X("Overflowed Elements:",_e);break;case xe:break;default:X("No overflow detected")}En(M,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:ke?y:b};return pe=et(en,t),pe.attachObservers(e),pe}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;En(I,`Element resized <${function(e){switch(!0){case!U(e):return"";case U(e.id):return`${e.nodeName}#${e.id}`;case U(e.name):return`${e.nodeName} (${e.name}`;case U(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return vt=new ResizeObserver(nn),vt.observe(document.body),gt.add(document.body),X("Attached ResizeObserver to body"),ge={attachObserverToNonStaticElements:zt,detachObservers:Te(dt,vt,gt,mt),disconnect:()=>{vt.disconnect(),X("Detached ResizeObserver")}},ge.attachObserverToNonStaticElements(e),ge}function rn(e){qe=!e,En(T,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of hn(n))t.add(e)}return X("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;oe("addObservers");const t=an(e);pe.attachObservers(t),ge.attachObserverToNonStaticElements(t),ee()},cn=e=>{if(0===e.size)return;oe("removeObservers");const t=an(e);pe.detachObservers(t),ge.detachObservers(t),ee()};function ln(e){!function({addedNodes:e,removedNodes:t}){oe("contentMutated"),Ht(),Tt(),Kt(),ee(),cn(t),sn(e)}(e),En(E,"Mutation Observed")}function un(){const e=hn(document.documentElement);var t;t=[Ze(ln),tn(e),ut(),on(e),wt(rn)],_.push(...t.map(e=>e.disconnect))}function dn(t){performance.mark(tt);const n=W(t);let o=1,r=document.documentElement,a=Ce?0:document.documentElement.getBoundingClientRect().bottom;const i=Ce?ot:xe?Array.from(_e):hn(document.documentElement);for(const e of i)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>a&&(a=o,r=e);return X(`${n} position calculated from:`,r),X(`Checked %c${i.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(nt,{detail:{hasTags:Ce,len:i.length,logging:Fe,Side:n}}),a}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(j).map(e=>`:not(${e})`).join("")}`,hn=e=>e.querySelectorAll(mn),pn={height:0,width:0},gn={height:0,width:0},yn=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function bn(t){function n(){return gn[r]=a,pn[r]=c,Math.max(a,1)}const o=t===vn,r=t.label,a=t.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${a}px %cPage: %c${c}px`;let u=1;switch(!0){case!t.enabled():return Math.max(c,1);case Ce:X("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!xe&&Ne&&0===gn[r]&&0===pn[r]:X(`Initial page size values: ${l}`,...yn),u=n();break;case st&&a===gn[r]&&c===pn[r]:X(`Size unchanged: ${l}`,...yn),u=Math.max(a,c);break;case 0===a&&0!==c:X(`Page is hidden: ${l}`,...yn),u=c;break;case!xe&&a!==gn[r]&&c<=pn[r]:X(`New <html> size: ${l} `,...yn),X(`Previous <html> size: %c${gn[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!xe&&a<gn[r]:X(`<html> size decreased: ${l}`,...yn),u=n();break;case c===s||c===i:X(`<html> size equals page size: ${l}`,...yn),u=n();break;case a>c:X(`Page size < <html> size: ${l}`,...yn),u=n();break;case xe:X("Found elements possibly overflowing <html> "),u=t.taggedElement();break;default:X(`Using <html> size: ${l}`,...yn),u=n()}return X(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&X(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),Math.max(u,1)}const vn={label:h,enabled:()=>ke,getOffset:()=>Ve,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.bodyOffset(),custom:()=>A.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>dn(y),taggedElement:()=>dn(y)},zn={label:p,enabled:()=>je,getOffset:()=>Je,auto:()=>bn(zn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>A.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>dn(b),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>dn(b)},wn=(e,t)=>!(Math.abs(e-t)<=it);function $n(e,t){const n=e[t](),o=e.enabled()&&void 0!==be?function(e){const t=be(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return K(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let On=!1;const Sn=q(()=>ce(L(4)));let In,Mn=!1;const En=ne((e,t,n,o,a)=>{switch(oe(e),!0){case!0===qe:if(!0===Mn)break;Mn=!0,On=!1,cancelAnimationFrame(In);break;case!0===On&&e!==M:ae();break;case!ve&&!(e in O):X("Resizing disabled");break;default:Mn=!1,On=!0,performance.now(),In=requestAnimationFrame(()=>{On=!1,oe("requestAnimationFrame")}),function(e,t,n,o,a){const i=n??$n(vn,He),s=o??$n(zn,lt);switch(ke&&wn(Pe,i)||je&&wn(ct,s)?z:e){case r:case v:case z:Pe=i,ct=s;case S:kn(Pe,ct,e,a);break;case M:case E:case I:case T:ae();break;default:ae(),X("No change in content size detected")}}(e,0,n,o,a)}ee()});function Tn(e){Pe=vn[He](),ct=zn[lt](),jn(Pe,ct,e)}function kn(t,n,o,r,a){We<-1||(void 0!==a||(a=at),function(){const i=`${Qe}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Xe)try{window.parent.iframeParentListener(k+i)}catch(e){if(1!==We)throw e;return void Sn()}else rt.postMessage(k+i,a);X(`Sending message to parent page via ${Xe?"sameOrigin":"postMessage"}: %c%c${i}`,e.ITALIC,e.HIGHLIGHT)}())}const jn=ne((e,t,n,o,r)=>{oe(n),kn(e,t,n,o,r),ee()}),Nn=ne(function(e){oe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>jn(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,he=e.origin,$t(t),Ne=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Tn("resetPage")},resize(){En($,"Parent window requested size check")},moveToAnchor(){Be.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();yt?B(yt,n(e)):o(i)},parentInfo(){const e=(r=l(),t(n(r)));var r;bt?B(bt,e):o(s)},message(){const e=l();B(ht,n(e))}},c=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),u=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=c();oe(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||ie(`Unexpected message (${e.data})`)}k===`${e.data}`.slice(0,13)&&function(){if(!1!==Ne)return u()?(re(c()),oe(r),void a.init()):void 0;d()}()});let An=!1;const xn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Rn(){if("loading"===document.readyState||!Ne||An)return;const{parent:e,top:t}=window;oe("ready"),xn(e),e!==t&&xn(t),An=!0}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Nn({data:e,sameOrigin:!0})),N(window,a,Nn),N(document,g,Rn),Rn())}();
20
+ "use strict";const e=require("auto-console-group"),t="5.5.7",n="iframeResizer",o=":",r="init",a="message",i="pageHide",s="pageInfo",l="parentInfo",c="scrollToOffset",d="title",u=10,m="data-iframe-size",f="data-iframe-overflowed",p="data-iframe-ignore",h="height",y="width",g="offset",b="offsetSize",v="string",z="number",w="object",$="function",O="auto",S="readystatechange",I="bottom",M="right",E="autoResizeEnabled",T=Symbol("sizeChanged"),k="manualResize",j="parentResize",N={[k]:1,[j]:1},A="setOffsetSize",x="resizeObserver",R="overflowObserver",C="mutationObserver",P="visibilityObserver",H="[iFrameSizer]",L=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=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)},D=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),q=["spjluzl","rlf","clyzpvu"],W=["<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."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],U=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>D(W[e]),Z=e=>{const t=e[D(q[0])]||e[D(q[1])]||e[D(q[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(D(e));return n in U&&(t=U[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o},J=(e,...t)=>setTimeout(()=>e(...t),0),_=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},Q=e=>e,Y=e=>Math.round(1e3*e)/1e3,X=e=>e.charAt(0).toUpperCase()+e.slice(1),K=e=>""!=`${e}`&&void 0!==e,ee=e=>e();const te=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${X(t)}`)};let ne=!0,oe=n;var re;const ae=(re=e,re?.__esModule?re.default:re)({label:`${n}(child)`,expand:!1});var ie;const se=(ie="log",(...e)=>!ne||ae[ie](...e));const{assert:le,endAutoGroup:ce,error:de,errorBoundary:ue,event:me,label:fe,purge:pe,warn:he}=ae,ye=e=>{return ae.warn((t=Q,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ge=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>ye(t)),be=ge("Method"),ve=ge("Method","replaced with"),ze=ge("Option"),we=["min-height","min-width","max-height","max-width"],$e=new Set,Oe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=Oe(e,t))&&"0px"!==n&&n!==O&&"none"!==n;var n};function Ie({href:e}){$e.has(e)||$e.add(e)}const Me=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ie(n)}return{source:"cross-origin stylesheet",value:Oe(e,t)}}(e,t),Ee=(e,t)=>{const{source:n,value:o}=Me(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);ye(`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</>.\n\nIf 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 Te(){for(const e of[document.documentElement,document.body])for(const t of we)Se(e,t)&&Ee(e,t)}const ke=e=>t=>void 0===t?void 0:e(t),je=ke(e=>"true"===e),Ne=ke(Number),Ae=e=>e=>{e.size},xe=((e="")=>t=>n=>{n.size>0&&de(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Re=e=>e=>{e.size},Ce=(t,n=!0)=>o=>{o>0&&se(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL)},Pe=(e,t,n,o)=>{const r=Re(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},He=new Set,Le=new Set,Ge=new Set,Be=[],De={attributes:!0,attributeFilter:[p,m],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let qe,We=1,Fe=!1,Ue=0;const Ve=e=>{e.size},Ze=e=>{e.size},Je=e=>{e.size},_e=e=>e.nodeType!==Node.ELEMENT_NODE||L.has(e.tagName.toLowerCase());function Qe(e){const t=e.addedNodes;for(const e of t)_e(e)||He.add(e)}function Ye(e){const t=e.removedNodes;for(const e of t)_e(e)||(He.has(e)?(He.delete(e),Ge.add(e)):Le.add(e))}const Xe=e=>{se("Mutations:",e);for(const t of e)Qe(t),Ye(t);Ve(He),Ze(Le),Je(Ge),Ge.clear()};const Ke=t=>()=>{const n=performance.now(),o=n-Ue,r=16*We+++2;if(o>r&&o<200)return me("mutationThrottled"),se("Update delayed due to heavy workload on the callStack"),se(`EventLoop busy time: %c${Y(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(qe,16*We),void(Ue=n);We=1,Be.forEach(Xe),Be.length=0,Fe=!1,Le.size,He.size,t({addedNodes:He,removedNodes:Le}),He.clear(),Le.clear()};function et(e){Be.push(e),Fe||(Ue=performance.now(),Fe=!0,requestAnimationFrame(qe))}function tt(e){const t=new window.MutationObserver(et),n=document.body||document.documentElement;return qe=Ke(e),t.observe(n,De),se("Attached MutationObserver to body"),{...t,disconnect:()=>{He.clear(),Le.clear(),Be.length=0,t.disconnect(),se("Detached MutationObserver")}}}const nt="Overflow",ot=Ce(nt),rt=Ce(nt,!1),at=Ae(nt),it=xe(nt),st=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,lt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(f,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],l=i(a,o)&&!st(r);s(r,l)}r(a)},o),c=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(c.has(r)?t.add(r):(l.observe(r),c.add(r),n.add(r),o+=1));it(t),at(n),ot(o),n.clear(),t.clear()},detachObservers:Pe(nt,l,c,rt),disconnect:()=>{l.disconnect(),se("Detached OverflowObserver")}}},ct="--ifr-start",dt="--ifr-end",ut="--ifr-measure",mt=[];let ft,pt={},ht=0;function yt(){try{performance.clearMarks(ct),performance.clearMarks(dt),performance.clearMeasures(ut)}catch{}}function gt(e){e.getEntries().forEach(e=>{if(e.name===dt)try{const{duration:t}=performance.measure(ut,ct,dt);pt=e.detail,mt.push(t),mt.length>100&&mt.shift()}catch{}})}function bt(){se("Attached PerformanceObserver to page");const e=new PerformanceObserver(gt);return e.observe({entryTypes:["mark"]}),ft=setInterval(()=>{if(mt.length<10)return;if(pt.hasTags&&pt.len<25)return;mt.sort();const e=Math.min(mt.reduce((e,t)=>e+t,0)/mt.length,mt[Math.floor(mt.length/2)]),t=Y(e);t>ht&&(ht=t,me("performanceObserver")),yt(),e<=4||(clearInterval(ft),ye(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Y(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${pt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{yt(),clearInterval(ft),e.disconnect(),se("Detached PerformanceObserver")}}}const vt="Resize",zt=Ce(vt),wt=Ce(vt,!1),$t=Ae(vt),Ot=xe(vt),St=new WeakSet,It=new Set,Mt=new Set;let Et;function Tt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(St.has(n)?It.add(n):(Et.observe(n),St.add(n),Mt.add(n),t+=1))}Ot(It),$t(Mt),zt(t),Mt.clear(),It.clear()}function kt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),se("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),se("Detached VisibilityObserver")}}}const jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Nt=jt($),At=jt(z),xt=jt(v);"undefined"!=typeof window&&function(){const B={height:()=>(he("Custom height calculation function not defined"),Tn.auto()),width:()=>(he("Custom width calculation function not defined"),kn.auto())},W={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},U={},Y=O,re=[],ie="scroll";let ge,we,$e,Oe,Se,Ie,Me,Ee=!0,ke="",Ae=0,xe="",Re="",Ce=!1,He=!0,Le=!1,Ge=!0,Be=!1,De=!1,qe=!0,We=!1,Fe=1,Ue=Y,Ve="",Ze=!0,Je={},_e=!1,Qe=!1,Ye=!1,Xe=0,Ke=!1,et=0,nt=0,ot=new Set,rt="",at="child",it=!1,st="",ut=[],mt=window.parent,ft="*",pt=0,ht=!1,yt=1,gt=ie,zt=window,$t=()=>{he("onMessage function not defined")},Ot=()=>{},It=null,Mt=null;function jt(o){var a;!function(e){rt=e[0]??rt,Ae=Ne(e[1])??Ae,Le=je(e[2])??Le,Ye=je(e[3])??Ye,Ee=je(e[6])??Ee,xe=e[7]??xe,Ue=e[8]??Ue,ke=e[9]??ke,Re=e[10]??Re,pt=Ne(e[11])??pt,Je.enable=je(e[12])??!1,at=e[13]??at,gt=e[14]??gt,Ke=je(e[15])??Ke,et=Ne(e[16])??et,nt=Ne(e[17])??nt,He=je(e[18])??He,ge=e[19]??ge,Ie=e[20]??Ie,Xe=Ne(e[21])??Xe,Qe=je(e[23])??Qe}(o),oe=(a={id:rt,enabled:Ye,expand:Qe}).id||n,ae.label(`${oe}`),ae.expand(a.expand),ne=a.enabled,function(){function t(e){Me=Nt(e,"onBeforeResize")??Me,$t=Nt(e,"onMessage")??$t,Ot=Nt(e,"onReady")??Ot,typeof e?.offset===z&&(ze(g,b),He&&(et=At(e,g)??et),Le&&(nt=At(e,g)??nt)),typeof e?.offsetSize===z&&(He&&(et=At(e,b)??et),Le&&(nt=At(e,b)??nt)),we=xt(e,D(q[0]))??we,Ve=xt(e,"ignoreSelector")??Ve,st=xt(e,"sizeSelector")??st,ft=xt(e,"targetOrigin")??ft,Ue=e?.heightCalculationMethod||Ue,gt=e?.widthCalculationMethod||gt}function n(e,t){return typeof e===$&&(ye(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),B[t]=e,e="custom"),e}if(1===Xe)return;const o=window.iframeResizer||window.iFrameResizer;typeof o===w&&(t(o),Ue=n(Ue,h),gt=n(gt,y),se(`Set targetOrigin for parent: %c${ft}`,e.HIGHLIGHT))}(),[Dt,Wt,tn,Gt,qt,Kt,en,Yt,Bt,Ht,Ce?Q:Te,Vt,sn,an,rn,Zt,()=>Ft("background",ke),()=>Ft("padding",Re),Ce?Q:Jt,on,nn,vn,Ct].forEach(e=>{try{e()}catch(e){if(Xe<0)throw e;ye("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),de(e)}}),Pt(_(Ot)),Pn(r,"Init message from host page",void 0,void 0,`${t}:${Xe}`),document.title&&""!==document.title&&Gn(0,0,d,document.title)}function Rt({persisted:e}){e||Gn(0,0,"beforeUnload"),me(i),se("Page persisted:",e),e||re.forEach(ee)}const Ct=()=>G(window,i.toLowerCase(),Rt);function Pt(e){"complete"===document.readyState?J(e):G(document,S,()=>Pt(e))}function Ht(){ut=document.querySelectorAll(`[${m}]`),We=ut.length>0}let Lt=0;function Gt(){const t=document.querySelectorAll(`*[${p}]`);return Be=t.length>0,Be&&t.length!==Lt&&(function(t){const n=1===t.length?"":"s";he(`%c[${p}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),Lt=t.length),Be}function Bt(){"BackCompat"===document.compatMode&&ye("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Dt(){Ie&&""!==Ie&&"false"!==Ie?Ie!==t&&ye(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ie} - Child page: ${t}.\n`):ye("<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/</> for more details.\n")}function qt(){try{it=1===Xe||"iframeParentListener"in window.parent}catch(e){}}function Wt(){Le===He&&(Ce=!0)}function Ft(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),se(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Ut(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Vt(){Ut(0,m,st),Ut(0,p,Ve)}function Zt(){var e,t;void 0===xe&&(xe=`${Ae}px`),Ft("margin",(e="margin",(t=xe).includes("-")&&(he(`Negative CSS value ignored for ${e}`),t=""),t))}function Jt(){const e=e=>e.style.setProperty(h,O,"important");e(document.documentElement),e(document.body)}function _t(e){({add(t){function n(){Pn(e.eventName,e.eventType)}U[t]=n,G(window,t,n,{passive:!0})},remove(e){const t=U[e];var n,o;delete U[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Qt(e){_t({method:e,eventType:"After Print",eventName:"afterprint"}),_t({method:e,eventType:"Before Print",eventName:"beforeprint"}),_t({method:e,eventType:"Ready State Change",eventName:S})}function Yt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(m,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ye("<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 Xt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(he(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in W)&&ye(`<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 ${Ie?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function Kt(){Ue=Xt(Ue,Y,Tn)}function en(){gt=Xt(gt,ie,kn)}function tn(){const n=Xe,o=Z({key:ge}),r=Z({key:we});if(Xe=Math.max(o,r),Xe<0){if(Xe=Math.min(o,r),pe(),ye(`${V(Xe+2)}${V(2)}`),K(Ie))throw V(Xe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!K(Ie)||n>-1&&Xe>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${oe} %ciframe-resizer ${t}`,ne||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>D(F[e]))(Xe)})`,Xe),Xe<2&&ye(V(3)),sessionStorage.setItem("ifr",t))}function nn(){Qt("add"),re.push(()=>Qt("remove"))}function on(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function rn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Gn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Gn(n.y,n.x,c)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Je;o&&(1===Xe?ye(V(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&G(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),G(window,"hashchange",n),setTimeout(n,128))),Je={...Je,findTarget:t}}function an(){function e(e){Gn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){G(window.document,t,e)}!0===Ke&&(t("mouseenter"),t("mouseleave"))}function sn(){1!==Xe&&(zt.parentIframe=Object.freeze({autoResize:e=>(te(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Le&&!1===He?(me(E),ye("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ee?(Ee=!0,queueMicrotask(()=>Pn(E,"Auto Resize enabled"))):!1===e&&!0===Ee&&(Ee=!1),Gn(0,0,"autoResize",JSON.stringify(Ee)),Ee)),close(){Gn(0,0,"close")},getId:()=>rt,getOrigin:()=>(me("getOrigin"),be("getOrigin()","getParentOrigin()"),$e),getParentOrigin:()=>$e,getPageInfo(e){if(typeof e===$)return It=e,Gn(0,0,s),void ve("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");It=null,Gn(0,0,"pageInfoStop")},getParentProps:e=>(te(e,$,"parentIframe.getParentProps(callback) callback"),Mt=e,Gn(0,0,l),()=>{Mt=null,Gn(0,0,"parentInfoStop")}),getParentProperties(e){be("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){te(e,v,"parentIframe.moveToAnchor(anchor) anchor"),Je.findTarget(e)},reset(){!function(){const e=Ue;Ue=Y,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Hn("reset"),Ue=e}()},setOffsetSize(e){te(e,z,"parentIframe.setOffsetSize(offset) offset"),et=e,nt=e,Pn(A,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){te(e,z,"parentIframe.scrollBy(x, y) x"),te(t,z,"parentIframe.scrollBy(x, y) y"),Gn(t,e,"scrollBy")},scrollTo(e,t){te(e,z,"parentIframe.scrollTo(x, y) x"),te(t,z,"parentIframe.scrollTo(x, y) y"),Gn(t,e,"scrollTo")},scrollToOffset(e,t){te(e,z,"parentIframe.scrollToOffset(x, y) x"),te(t,z,"parentIframe.scrollToOffset(x, y) y"),Gn(t,e,c)},sendMessage(e,t){t&&te(t,v,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Gn(0,0,a,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ue=e,Kt()},setWidthCalculationMethod(e){gt=e,en()},setTargetOrigin(e){te(e,v,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ft=e},resize(e,t){void 0!==e&&te(e,z,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&te(t,z,"parentIframe.resize(customHeight, customWidth) customWidth"),Pn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){be("size()","resize()"),this.resize(e,t)}}),zt.parentIFrame=zt.parentIframe)}let ln=new Set;function cn(){const e=document.querySelectorAll(`[${f}]`);ot=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${p}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{me("overflowIgnored"),se("Ignoring elements with [data-iframe-ignore] > *:\n",n),ce()}),t}(e),De=ot.size>0,typeof Set.prototype.symmetricDifference===$&&(qe=ot.symmetricDifference(ln).size>0),ln=ot}function dn(){switch(cn(),!0){case!qe:return;case ot.size>1:se("Overflowed Elements:",ot);break;case De:break;default:se("No overflow detected")}Pn(R,"Overflow updated")}function un(e){const t={root:document.documentElement,side:He?I:M};return Oe=lt(dn,t),Oe.attachObservers(e),Oe}function mn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Pn(x,`Element resized <${function(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}}(t)}>`)}function fn(e){return Et=new ResizeObserver(mn),Et.observe(document.body),St.add(document.body),se("Attached ResizeObserver to body"),Se={attachObserverToNonStaticElements:Tt,detachObservers:Pe(vt,Et,St,wt),disconnect:()=>{Et.disconnect(),se("Detached ResizeObserver")}},Se.attachObserverToNonStaticElements(e),Se}function pn(e){_e=!e,Pn(P,"Visibility changed")}const hn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of On(n))t.add(e)}return se("Inspecting:\n",t),t},yn=e=>{if(0===e.size)return;me("addObservers");const t=hn(e);Oe.attachObservers(t),Se.attachObserverToNonStaticElements(t),ce()},gn=e=>{if(0===e.size)return;me("removeObservers");const t=hn(e);Oe.detachObservers(t),Se.detachObservers(t),ce()};function bn(e){!function({addedNodes:e,removedNodes:t}){me("contentMutated"),Vt(),Ht(),cn(),ce(),gn(t),yn(e)}(e),Pn(C,"Mutation Observed")}function vn(){const e=On(document.documentElement);var t;t=[tt(bn),un(e),bt(),fn(e),kt(pn)],re.push(...t.map(e=>e.disconnect))}function zn(t){performance.mark(ct);const n=X(t);let o=1,r=document.documentElement,a=We?0:document.documentElement.getBoundingClientRect().bottom;const i=We?ut:De?Array.from(ot):On(document.documentElement);for(const e of i)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>a&&(a=o,r=e);return se(`${n} position calculated from:`,r),se(`Checked %c${i.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(dt,{detail:{hasTags:We,len:i.length,logging:Ye,Side:n}}),a}const wn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],$n=`* ${Array.from(L).map(e=>`:not(${e})`).join("")}`,On=e=>e.querySelectorAll($n),Sn={height:0,width:0},In={height:0,width:0},Mn=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function En(t){function n(){return In[r]=a,Sn[r]=l,Math.max(a,1)}const o=t===Tn,r=t.label,a=t.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${a}px %cPage: %c${l}px`;let d=1;switch(!0){case!t.enabled():return Math.max(l,1);case We:se("Found element with data-iframe-size attribute"),d=t.taggedElement();break;case!De&&Ge&&0===In[r]&&0===Sn[r]:se(`Initial page size values: ${c}`,...Mn),d=n();break;case ht&&a===In[r]&&l===Sn[r]:se(`Size unchanged: ${c}`,...Mn),d=Math.max(a,l);break;case 0===a&&0!==l:se(`Page is hidden: ${c}`,...Mn),d=l;break;case!De&&a!==In[r]&&l<=Sn[r]:se(`New <html> size: ${c} `,...Mn),se(`Previous <html> size: %c${In[r]}px`,e.HIGHLIGHT),d=n();break;case!o:d=t.taggedElement();break;case!De&&a<In[r]:se(`<html> size decreased: ${c}`,...Mn),d=n();break;case l===s||l===i:se(`<html> size equals page size: ${c}`,...Mn),d=n();break;case a>l:se(`Page size < <html> size: ${c}`,...Mn),d=n();break;case De:se("Found elements possibly overflowing <html> "),d=t.taggedElement();break;default:se(`Using <html> size: ${c}`,...Mn),d=n()}return se(`Content ${r}: %c${d}px`,e.HIGHLIGHT),d+=function(t){const n=t.getOffset();return 0!==n&&se(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),Math.max(d,1)}const Tn={label:h,enabled:()=>He,getOffset:()=>et,auto:()=>En(Tn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Tn.bodyOffset(),custom:()=>B.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...wn(Tn)),min:()=>Math.min(...wn(Tn)),grow:()=>Tn.max(),lowestElement:()=>zn(I),taggedElement:()=>zn(I)},kn={label:y,enabled:()=>Le,getOffset:()=>nt,auto:()=>En(kn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>B.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...wn(kn)),min:()=>Math.min(...wn(kn)),rightMostElement:()=>zn(M),scroll:()=>Math.max(kn.bodyScroll(),kn.documentElementScroll()),taggedElement:()=>zn(M)},jn=(e,t)=>!(Math.abs(e-t)<=pt);function Nn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Me?function(e){const t=Me(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return le(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let An=!1;const xn=_(()=>ye(V(4)));let Rn,Cn=!1;const Pn=ue((e,t,n,o,a)=>{switch(me(e),!0){case!0===_e:if(!0===Cn)break;Cn=!0,An=!1,cancelAnimationFrame(Rn);break;case!0===An&&e!==R:pe();break;case!Ee&&!(e in N):se("Resizing disabled");break;default:Cn=!1,An=!0,performance.now(),Rn=requestAnimationFrame(()=>{An=!1,me("requestAnimationFrame")}),function(e,t,n,o,a){const i=n??Nn(Tn,Ue),s=o??Nn(kn,gt);switch(He&&jn(Fe,i)||Le&&jn(yt,s)?T:e){case r:case E:case T:Fe=i,yt=s;case A:Ln(Fe,yt,e,a);break;case R:case C:case x:case P:pe();break;default:pe(),se("No change in content size detected")}}(e,0,n,o,a)}ce()});function Hn(e){Fe=Tn[Ue](),yt=kn[gt](),Gn(Fe,yt,e)}function Ln(t,n,o,r,a){Xe<-1||(void 0!==a||(a=ft),function(){const i=`${rt}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(it)try{window.parent.iframeParentListener(H+i)}catch(e){if(1!==Xe)throw e;return void xn()}else mt.postMessage(H+i,a);se(`Sending message to parent page via ${it?"sameOrigin":"postMessage"}: %c%c${i}`,e.ITALIC,e.HIGHLIGHT)}())}const Gn=ue((e,t,n,o,r)=>{me(n),Ln(e,t,n,o,r),ce()}),Bn=ue(function(e){me("onMessage");const{freeze:t}=Object,{parse:n}=JSON,a=e=>Gn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(o);mt=e.source,$e=e.origin,jt(t),Ge=!1,setTimeout(()=>{Ze=!1},128)},reset(){Ze||Hn("resetPage")},resize(){Pn(j,"Parent window requested size check")},moveToAnchor(){Je.findTarget(d())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=d();It?J(It,n(e)):a(s)},parentInfo(){const e=(o=d(),t(n(o)));var o;Mt?J(Mt,e):a(l)},message(){const e=d();J($t,n(e))}},c=()=>e.data.split("]")[1].split(o)[0],d=()=>e.data.slice(e.data.indexOf(o)+1),u=()=>e.data.split(o)[2]in{true:1,false:1};function m(){const t=c();me(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||he(`Unexpected message (${e.data})`)}H===`${e.data}`.slice(0,13)&&function(){if(!1!==Ge)return u()?(fe(c()),me(r),void i.init()):void 0;m()}()});let Dn=!1;const qn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Wn(){if("loading"===document.readyState||!Ge||Dn)return;const{parent:e,top:t}=window;me("ready"),qn(e),e!==t&&qn(t),Dn=!0}"iframeChildListener"in window?he("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Bn({data:e,sameOrigin:!0})),G(window,a,Bn),G(document,S,Wn),Wn())}();
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6 (esm) - 2025-09-10
4
+ * @module iframe-resizer/child 5.5.7 (esm) - 2025-09-23
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,4 @@
17
17
  */
18
18
 
19
19
 
20
- import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.6",s="iframeResizer",c="beforeUnload",l="init",u="message",d="pageInfo",m="parentInfo",f="scrollToOffset",h="title",p=10,g="data-iframe-size",y="data-iframe-overflowed",b="data-iframe-ignore",v="height",z="width",w="readystatechange",$="bottom",S="right",O="autoResizeEnabled",E=Symbol("sizeChanged"),M="manualResize",k="parentResize",j={[M]:1,[k]:1},x="setOffsetSize",T="resizeObserver",A="overflowObserver",I="mutationObserver",N="visibilityObserver",C="[iFrameSizer]",P=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),R=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=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)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),L=["spjluzl","rlf","clyzpvu"],D=["<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."],W=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],F=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>q(D[e]),H=e=>{const t=e[q(L[0])]||e[q(L[1])]||e[q(L[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(q(e));return n in F&&(t=F[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o},U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,_=e=>Math.round(1e3*e)/1e3,Q=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const G=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Q(t)}`)};let X=!0,K=s;var ee;const te=(ee=e,ee?.__esModule?ee.default:ee)({label:`${s}(child)`,expand:!1});var ne;const oe=(ne="log",(...e)=>!X||te[ne](...e));const{assert:re,endAutoGroup:ae,error:ie,errorBoundary:se,event:ce,label:le,purge:ue,warn:de}=te,me=e=>{return te.warn((t=J,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},fe=me,he=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>me(t)),pe=he("Method"),ge=he("Method","replaced with"),ye=he("Option"),be=["min-height","min-width","max-height","max-width"],ve=new Set,ze=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),we=(e,t)=>{return(n=ze(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function $e({href:e}){ve.has(e)||ve.add(e)}const Se=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){$e(n)}return{source:"cross-origin stylesheet",value:ze(e,t)}}(e,t),Oe=(e,t)=>{const{source:n,value:o}=Se(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);me(`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</>.\n\nIf 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 Ee(){for(const e of[document.documentElement,document.body])for(const t of be)we(e,t)&&Oe(e,t)}const Me=e=>t=>void 0===t?void 0:e(t),ke=Me(e=>"true"===e),je=Me(Number),xe=e=>e=>{e.size},Te=((e="")=>t=>n=>{n.size>0&&ie(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ae=e=>e=>{e.size},Ie=(e,o=!0)=>r=>{r>0&&oe(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Ne=(e,t,n,o)=>{const r=Ae(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Ce=new Set,Pe=new Set,Re=new Set,Be=[],qe={attributes:!0,attributeFilter:[b,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Le,De=1,We=!1,Fe=0;const Ve=e=>{e.size},He=e=>{e.size},Ue=e=>{e.size},Ze=e=>e.nodeType!==Node.ELEMENT_NODE||P.has(e.tagName.toLowerCase());function Je(e){const t=e.addedNodes;for(const e of t)Ze(e)||Ce.add(e)}function _e(e){const t=e.removedNodes;for(const e of t)Ze(e)||(Ce.has(e)?(Ce.delete(e),Re.add(e)):Pe.add(e))}const Qe=e=>{oe("Mutations:",e);for(const t of e)Je(t),_e(t);Ve(Ce),He(Pe),Ue(Re),Re.clear()};const Ye=e=>()=>{const t=performance.now(),r=t-Fe,a=16*De+++2;if(r>a&&r<200)return ce("mutationThrottled"),oe("Update delayed due to heavy workload on the callStack"),oe(`EventLoop busy time: %c${_(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(Le,16*De),void(Fe=t);De=1,Be.forEach(Qe),Be.length=0,We=!1,Pe.size,Ce.size,e({addedNodes:Ce,removedNodes:Pe}),Ce.clear(),Pe.clear()};function Ge(e){Be.push(e),We||(Fe=performance.now(),We=!0,requestAnimationFrame(Le))}function Xe(e){const t=new window.MutationObserver(Ge),n=document.body||document.documentElement;return Le=Ye(e),t.observe(n,qe),oe("Attached MutationObserver to body"),{...t,disconnect:()=>{Ce.clear(),Pe.clear(),Be.length=0,t.disconnect(),oe("Detached MutationObserver")}}}const Ke="Overflow",et=Ie(Ke),tt=Ie(Ke,!1),nt=xe(Ke),ot=Te(Ke),rt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,at=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(y,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],c=i(a,o)&&!rt(r);s(r,c)}r(a)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ot(t),nt(n),et(o),n.clear(),t.clear()},detachObservers:Ne(Ke,c,l,tt),disconnect:()=>{c.disconnect(),oe("Detached OverflowObserver")}}},it="--ifr-start",st="--ifr-end",ct="--ifr-measure",lt=[];let ut,dt={},mt=0;function ft(){try{performance.clearMarks(it),performance.clearMarks(st),performance.clearMeasures(ct)}catch{}}function ht(e){e.getEntries().forEach(e=>{if(e.name===st)try{const{duration:t}=performance.measure(ct,it,st);dt=e.detail,lt.push(t),lt.length>100&&lt.shift()}catch{}})}function pt(){oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(ht);return e.observe({entryTypes:["mark"]}),ut=setInterval(()=>{if(lt.length<10)return;if(dt.hasTags&&dt.len<25)return;lt.sort();const e=Math.min(lt.reduce((e,t)=>e+t,0)/lt.length,lt[Math.floor(lt.length/2)]),t=_(e);t>mt&&(mt=t,ce("performanceObserver")),ft(),e<=4||(clearInterval(ut),me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${dt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ft(),clearInterval(ut),e.disconnect(),oe("Detached PerformanceObserver")}}}const gt="Resize",yt=Ie(gt),bt=Ie(gt,!1),vt=xe(gt),zt=Te(gt),wt=new WeakSet,$t=new Set,St=new Set;let Ot;function Et(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(wt.has(n)?$t.add(n):(Ot.observe(n),wt.add(n),St.add(n),t+=1))}zt($t),vt(St),yt(t),St.clear(),$t.clear()}function Mt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),oe("Detached VisibilityObserver")}}}const kt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},jt=kt("function"),xt=kt("number"),Tt=kt("string");"undefined"!=typeof window&&function(){const e={height:()=>(de("Custom height calculation function not defined"),Sn.auto()),width:()=>(de("Custom width calculation function not defined"),On.auto())},B={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},D={},F="auto",_=[],ee="scroll";let ne,he,be,ve,ze,we,$e,Se=!0,Oe="",Me=0,xe="",Te="",Ae=!1,Ie=!0,Ce=!1,Pe=!0,Re=!1,Be=!1,qe=!0,Le=!1,De=1,We=F,Fe="",Ve=!0,He={},Ue=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ye=0,Ge=0,Ke=new Set,et="",tt="child",nt=!1,ot="",rt=[],ct=window.parent,lt="*",ut=0,dt=!1,mt=1,ft=ee,ht=window,yt=()=>{de("onMessage function not defined")},vt=()=>{},zt=null,$t=null;function St(t){var o;!function(e){et=e[0]??et,Me=je(e[1])??Me,Ce=ke(e[2])??Ce,Je=ke(e[3])??Je,Se=ke(e[6])??Se,xe=e[7]??xe,We=e[8]??We,Oe=e[9]??Oe,Te=e[10]??Te,ut=je(e[11])??ut,He.enable=ke(e[12])??!1,tt=e[13]??tt,ft=e[14]??ft,Qe=ke(e[15])??Qe,Ye=je(e[16])??Ye,Ge=je(e[17])??Ge,Ie=ke(e[18])??Ie,ne=e[19]??ne,we=e[20]??we,_e=je(e[21])??_e,Ze=ke(e[23])??Ze}(t),K=(o={id:et,enabled:Je,expand:Ze}).id||s,te.label(`${K}`),te.expand(o.expand),X=o.enabled,function(){function t(e){$e=jt(e,"onBeforeResize")??$e,yt=jt(e,"onMessage")??yt,vt=jt(e,"onReady")??vt,"number"==typeof e?.offset&&(ye("offset","offsetSize"),Ie&&(Ye=xt(e,"offset")??Ye),Ce&&(Ge=xt(e,"offset")??Ge)),"number"==typeof e?.offsetSize&&(Ie&&(Ye=xt(e,"offsetSize")??Ye),Ce&&(Ge=xt(e,"offsetSize")??Ge)),he=Tt(e,q(L[0]))??he,Fe=Tt(e,"ignoreSelector")??Fe,ot=Tt(e,"sizeSelector")??ot,lt=Tt(e,"targetOrigin")??lt,We=e?.heightCalculationMethod||We,ft=e?.widthCalculationMethod||ft}function o(t,n){return"function"==typeof t&&(me(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===_e)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),We=o(We,v),ft=o(ft,z),oe(`Set targetOrigin for parent: %c${lt}`,n))}(),[Rt,qt,Yt,Ct,Bt,_t,Qt,Zt,Pt,It,Ae?J:Ee,Wt,tn,en,Kt,Ft,()=>Lt("background",Oe),()=>Lt("padding",Te),Ae?J:Vt,Xt,Gt,hn,kt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;me("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ie(e)}}),At(Z(vt)),An(l,"Init message from host page",void 0,void 0,`${i}:${_e}`),document.title&&""!==document.title&&Cn(0,0,h,document.title)}function kt(){R(window,c.toLowerCase(),()=>{_.forEach(e=>e()),Cn(0,0,c)})}function At(e){"complete"===document.readyState?U(e):R(document,w,()=>At(e))}function It(){rt=document.querySelectorAll(`[${g}]`),Le=rt.length>0}let Nt=0;function Ct(){const e=document.querySelectorAll(`*[${b}]`);return Re=e.length>0,Re&&e.length!==Nt&&(function(e){const n=1===e.length?"":"s";de(`%c[${b}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Nt=e.length),Re}function Pt(){"BackCompat"===document.compatMode&&me("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Rt(){we&&""!==we&&"false"!==we?we!==i&&me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${we} - Child page: ${i}.\n`):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/</> for more details.\n")}function Bt(){try{nt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function qt(){Ce===Ie&&(Ae=!0)}function Lt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),oe(`Set body ${e}: %c${t}`,n))}function Dt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Wt(){Dt(0,g,ot),Dt(0,b,Fe)}function Ft(){var e,t;void 0===xe&&(xe=`${Me}px`),Lt("margin",(e="margin",(t=xe).includes("-")&&(de(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(v,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}D[t]=n,R(window,t,n,{passive:!0})},remove(e){const t=D[e];var n,o;delete D[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:w})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});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</>.")}function Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(de(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in B)&&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 ${we?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){We=Jt(We,F,Sn)}function Qt(){ft=Jt(ft,ee,On)}function Yt(){const e=_e,n=H({key:ne}),o=H({key:he});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),ue(),me(`${V(_e+2)}${V(2)}`),Y(we))throw V(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(we)||e>-1&&_e>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${K} %ciframe-resizer ${e}`,X||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>q(W[e]))(_e)})`,_e),_e<2&&fe(V(3)),sessionStorage.setItem("ifr",i))}function Gt(){Ut("add"),_.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,p)+parseInt(n.x,p),y:parseInt(t.top,p)+parseInt(n.y,p)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Cn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Cn(n.y,n.x,f)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}He.enable&&(1===_e?me("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&R(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),R(window,"hashchange",n),setTimeout(n,128))),He={findTarget:t}}function en(){function e(e){Cn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){R(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(ht.parentIframe=Object.freeze({autoResize:e=>(G(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ce&&!1===Ie?(ce(O),me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Se?(Se=!0,queueMicrotask(()=>An(O,"Auto Resize enabled"))):!1===e&&!0===Se&&(Se=!1),Cn(0,0,"autoResize",JSON.stringify(Se)),Se)),close(){Cn(0,0,"close")},getId:()=>et,getOrigin:()=>(ce("getOrigin"),pe("getOrigin()","getParentOrigin()"),be),getParentOrigin:()=>be,getPageInfo(e){if("function"==typeof e)return zt=e,Cn(0,0,d),void ge("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");zt=null,Cn(0,0,"pageInfoStop")},getParentProps:e=>(G(e,"function","parentIframe.getParentProps(callback) callback"),$t=e,Cn(0,0,m),()=>{$t=null,Cn(0,0,"parentInfoStop")}),getParentProperties(e){pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){G(e,"string","parentIframe.moveToAnchor(anchor) anchor"),He.findTarget(e)},reset(){!function(){const e=We;We=F,dt||(dt=!0,requestAnimationFrame(()=>{dt=!1})),In("reset"),We=e}()},setOffsetSize(e){G(e,"number","parentIframe.setOffsetSize(offset) offset"),Ye=e,Ge=e,An(x,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){G(e,"number","parentIframe.scrollBy(x, y) x"),G(t,"number","parentIframe.scrollBy(x, y) y"),Cn(t,e,"scrollBy")},scrollTo(e,t){G(e,"number","parentIframe.scrollTo(x, y) x"),G(t,"number","parentIframe.scrollTo(x, y) y"),Cn(t,e,"scrollTo")},scrollToOffset(e,t){G(e,"number","parentIframe.scrollToOffset(x, y) x"),G(t,"number","parentIframe.scrollToOffset(x, y) y"),Cn(t,e,f)},sendMessage(e,t){t&&G(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Cn(0,0,u,JSON.stringify(e),t)},setHeightCalculationMethod(e){We=e,_t()},setWidthCalculationMethod(e){ft=e,Qt()},setTargetOrigin(e){G(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),lt=e},resize(e,t){void 0!==e&&G(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&G(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(M,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){pe("size()","resize()"),this.resize(e,t)}}),ht.parentIFrame=ht.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${y}]`);Ke=function(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(()=>{ce("overflowIgnored"),oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),ae()}),t}(e),Be=Ke.size>0,"function"==typeof Set.prototype.symmetricDifference&&(qe=Ke.symmetricDifference(nn).size>0),nn=Ke}function rn(){switch(on(),!0){case!qe:return;case Ke.size>1:oe("Overflowed Elements:",Ke);break;case Be:break;default:oe("No overflow detected")}An(A,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Ie?$:S};return ve=at(rn,t),ve.attachObservers(e),ve}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(T,`Element resized <${function(e){switch(!0){case!Y(e):return"";case Y(e.id):return`${e.nodeName}#${e.id}`;case Y(e.name):return`${e.nodeName} (${e.name}`;case Y(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Ot=new ResizeObserver(sn),Ot.observe(document.body),wt.add(document.body),oe("Attached ResizeObserver to body"),ze={attachObserverToNonStaticElements:Et,detachObservers:Ne(gt,Ot,wt,bt),disconnect:()=>{Ot.disconnect(),oe("Detached ResizeObserver")}},ze.attachObserverToNonStaticElements(e),ze}function ln(e){Ue=!e,An(N,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return oe("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;ce("addObservers");const t=un(e);ve.attachObservers(t),ze.attachObserverToNonStaticElements(t),ae()},mn=e=>{if(0===e.size)return;ce("removeObservers");const t=un(e);ve.detachObservers(t),ze.detachObservers(t),ae()};function fn(e){!function({addedNodes:e,removedNodes:t}){ce("contentMutated"),Wt(),It(),on(),ae(),mn(t),dn(e)}(e),An(I,"Mutation Observed")}function hn(){const e=bn(document.documentElement);var t;t=[Xe(fn),an(e),pt(),cn(e),Mt(ln)],_.push(...t.map(e=>e.disconnect))}function pn(e){performance.mark(it);const t=Q(e);let r=1,a=document.documentElement,i=Le?0:document.documentElement.getBoundingClientRect().bottom;const s=Le?rt:Be?Array.from(Ke):bn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return oe(`${t} position calculated from:`,a),oe(`Checked %c${s.length}%c elements`,n,o),performance.mark(st,{detail:{hasTags:Le,len:s.length,logging:Je,Side:t}}),i}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(P).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},zn={height:0,width:0},wn=[n,o,n];function $n(e){function t(){return zn[r]=a,vn[r]=c,Math.max(a,1)}const o=e===Sn,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${a}px %cPage: %c${c}px`;let u=1;switch(!0){case!e.enabled():return Math.max(c,1);case Le:oe("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Be&&Pe&&0===zn[r]&&0===vn[r]:oe(`Initial page size values: ${l}`,...wn),u=t();break;case dt&&a===zn[r]&&c===vn[r]:oe(`Size unchanged: ${l}`,...wn),u=Math.max(a,c);break;case 0===a&&0!==c:oe(`Page is hidden: ${l}`,...wn),u=c;break;case!Be&&a!==zn[r]&&c<=vn[r]:oe(`New <html> size: ${l} `,...wn),oe(`Previous <html> size: %c${zn[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!Be&&a<zn[r]:oe(`<html> size decreased: ${l}`,...wn),u=t();break;case c===s||c===i:oe(`<html> size equals page size: ${l}`,...wn),u=t();break;case a>c:oe(`Page size < <html> size: ${l}`,...wn),u=t();break;case Be:oe("Found elements possibly overflowing <html> "),u=e.taggedElement();break;default:oe(`Using <html> size: ${l}`,...wn),u=t()}return oe(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&oe(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(u,1)}const Sn={label:v,enabled:()=>Ie,getOffset:()=>Ye,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,p)+parseInt(t.marginBottom,p)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>pn($),taggedElement:()=>pn($)},On={label:z,enabled:()=>Ce,getOffset:()=>Ge,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>pn(S),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>pn(S)},En=(e,t)=>!(Math.abs(e-t)<=ut);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==$e?function(e){const t=$e(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return re(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=Z(()=>fe(V(4)));let xn,Tn=!1;const An=se((e,t,n,o,r)=>{switch(ce(e),!0){case!0===Ue:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==A:ue();break;case!Se&&!(e in j):oe("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,ce("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Mn(Sn,We),i=o??Mn(On,ft);switch(Ie&&En(De,a)||Ce&&En(mt,i)?E:e){case l:case O:case E:De=a,mt=i;case x:Nn(De,mt,e,r);break;case A:case I:case T:case N:ue();break;default:ue(),oe("No change in content size detected")}}(e,0,n,o,r)}ae()});function In(e){De=Sn[We](),mt=On[ft](),Cn(De,mt,e)}function Nn(e,t,o,a,i){_e<-1||(void 0!==i||(i=lt),function(){const s=`${et}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(nt)try{window.parent.iframeParentListener(C+s)}catch(e){if(1!==_e)throw e;return void jn()}else ct.postMessage(C+s,i);oe(`Sending message to parent page via ${nt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Cn=se((e,t,n,o,r)=>{ce(n),Nn(e,t,n,o,r),ae()}),Pn=se(function(e){ce("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Cn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");ct=e.source,be=e.origin,St(t),Pe=!1,setTimeout(()=>{Ve=!1},128)},reset(){Ve||In("resetPage")},resize(){An(k,"Parent window requested size check")},moveToAnchor(){He.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();zt?U(zt,n(e)):o(d)},parentInfo(){const e=(r=i(),t(n(r)));var r;$t?U($t,e):o(m)},message(){const e=i();U(yt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],i=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=a();ce(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||de(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==Pe)return s()?(le(a()),ce(l),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Pe||Rn)return;const{parent:e,top:t}=window;ce("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?de("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),R(window,u,Pn),R(document,w,qn),qn())}();
20
+ import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.7",s="iframeResizer",l=":",c="init",d="message",u="pageHide",m="pageInfo",f="parentInfo",p="scrollToOffset",h="title",y=10,g="data-iframe-size",b="data-iframe-overflowed",v="data-iframe-ignore",z="height",w="width",$="offset",S="offsetSize",O="string",E="number",M="object",k="function",j="auto",x="readystatechange",T="bottom",A="right",I="autoResizeEnabled",N=Symbol("sizeChanged"),C="manualResize",P="parentResize",R={[C]:1,[P]:1},B="setOffsetSize",L="resizeObserver",q="overflowObserver",D="mutationObserver",W="visibilityObserver",F="[iFrameSizer]",V=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),H=(e,t,n,o)=>e.addEventListener(t,n,o||!1),U=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)},Z=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),J=["spjluzl","rlf","clyzpvu"],_=["<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."],Q=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),G=e=>Z(_[e]),X=e=>{const t=e[Z(J[0])]||e[Z(J[1])]||e[Z(J[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=U(Z(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===o||(e=>e[2]===U(e[0]+e[1]))(n)||(o=-2),o},K=(e,...t)=>setTimeout(()=>e(...t),0),ee=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},te=e=>e,ne=e=>Math.round(1e3*e)/1e3,oe=e=>e.charAt(0).toUpperCase()+e.slice(1),re=e=>""!=`${e}`&&void 0!==e,ae=e=>e();const ie=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${oe(t)}`)};let se=!0,le=s;var ce;const de=(ce=e,ce?.__esModule?ce.default:ce)({label:`${s}(child)`,expand:!1});var ue;const me=(ue="log",(...e)=>!se||de[ue](...e));const{assert:fe,endAutoGroup:pe,error:he,errorBoundary:ye,event:ge,label:be,purge:ve,warn:ze}=de,we=e=>{return de.warn((t=te,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},$e=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>we(t)),Se=$e("Method"),Oe=$e("Method","replaced with"),Ee=$e("Option"),Me=["min-height","min-width","max-height","max-width"],ke=new Set,je=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),xe=(e,t)=>{return(n=je(e,t))&&"0px"!==n&&n!==j&&"none"!==n;var n};function Te({href:e}){ke.has(e)||ke.add(e)}const Ae=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Te(n)}return{source:"cross-origin stylesheet",value:je(e,t)}}(e,t),Ie=(e,t)=>{const{source:n,value:o}=Ae(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);we(`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</>.\n\nIf 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 Ne(){for(const e of[document.documentElement,document.body])for(const t of Me)xe(e,t)&&Ie(e,t)}const Ce=e=>t=>void 0===t?void 0:e(t),Pe=Ce(e=>"true"===e),Re=Ce(Number),Be=e=>e=>{e.size},Le=((e="")=>t=>n=>{n.size>0&&he(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),qe=e=>e=>{e.size},De=(e,o=!0)=>r=>{r>0&&me(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},We=(e,t,n,o)=>{const r=qe(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Fe=new Set,Ve=new Set,He=new Set,Ue=[],Ze={attributes:!0,attributeFilter:[v,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Je,_e=1,Qe=!1,Ye=0;const Ge=e=>{e.size},Xe=e=>{e.size},Ke=e=>{e.size},et=e=>e.nodeType!==Node.ELEMENT_NODE||V.has(e.tagName.toLowerCase());function tt(e){const t=e.addedNodes;for(const e of t)et(e)||Fe.add(e)}function nt(e){const t=e.removedNodes;for(const e of t)et(e)||(Fe.has(e)?(Fe.delete(e),He.add(e)):Ve.add(e))}const ot=e=>{me("Mutations:",e);for(const t of e)tt(t),nt(t);Ge(Fe),Xe(Ve),Ke(He),He.clear()};const rt=e=>()=>{const t=performance.now(),r=t-Ye,a=16*_e+++2;if(r>a&&r<200)return ge("mutationThrottled"),me("Update delayed due to heavy workload on the callStack"),me(`EventLoop busy time: %c${ne(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(Je,16*_e),void(Ye=t);_e=1,Ue.forEach(ot),Ue.length=0,Qe=!1,Ve.size,Fe.size,e({addedNodes:Fe,removedNodes:Ve}),Fe.clear(),Ve.clear()};function at(e){Ue.push(e),Qe||(Ye=performance.now(),Qe=!0,requestAnimationFrame(Je))}function it(e){const t=new window.MutationObserver(at),n=document.body||document.documentElement;return Je=rt(e),t.observe(n,Ze),me("Attached MutationObserver to body"),{...t,disconnect:()=>{Fe.clear(),Ve.clear(),Ue.length=0,t.disconnect(),me("Detached MutationObserver")}}}const st="Overflow",lt=De(st),ct=De(st,!1),dt=Be(st),ut=Le(st),mt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,ft=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||te,a=(t=!1)=>e(t),i=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(b,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const a=e[n],l=i(a,o)&&!mt(r);s(r,l)}r(a)},o),c=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(c.has(r)?t.add(r):(l.observe(r),c.add(r),n.add(r),o+=1));ut(t),dt(n),lt(o),n.clear(),t.clear()},detachObservers:We(st,l,c,ct),disconnect:()=>{l.disconnect(),me("Detached OverflowObserver")}}},pt="--ifr-start",ht="--ifr-end",yt="--ifr-measure",gt=[];let bt,vt={},zt=0;function wt(){try{performance.clearMarks(pt),performance.clearMarks(ht),performance.clearMeasures(yt)}catch{}}function $t(e){e.getEntries().forEach(e=>{if(e.name===ht)try{const{duration:t}=performance.measure(yt,pt,ht);vt=e.detail,gt.push(t),gt.length>100&&gt.shift()}catch{}})}function St(){me("Attached PerformanceObserver to page");const e=new PerformanceObserver($t);return e.observe({entryTypes:["mark"]}),bt=setInterval(()=>{if(gt.length<10)return;if(vt.hasTags&&vt.len<25)return;gt.sort();const e=Math.min(gt.reduce((e,t)=>e+t,0)/gt.length,gt[Math.floor(gt.length/2)]),t=ne(e);t>zt&&(zt=t,ge("performanceObserver")),wt(),e<=4||(clearInterval(bt),we(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ne(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${vt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{wt(),clearInterval(bt),e.disconnect(),me("Detached PerformanceObserver")}}}const Ot="Resize",Et=De(Ot),Mt=De(Ot,!1),kt=Be(Ot),jt=Le(Ot),xt=new WeakSet,Tt=new Set,At=new Set;let It;function Nt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(xt.has(n)?Tt.add(n):(It.observe(n),xt.add(n),At.add(n),t+=1))}jt(Tt),kt(At),Et(t),At.clear(),Tt.clear()}function Ct(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),me("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),me("Detached VisibilityObserver")}}}const Pt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Rt=Pt(k),Bt=Pt(E),Lt=Pt(O);"undefined"!=typeof window&&function(){const e={height:()=>(ze("Custom height calculation function not defined"),In.auto()),width:()=>(ze("Custom width calculation function not defined"),Nn.auto())},U={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},_={},Y=j,ne=[],ce="scroll";let ue,$e,Me,ke,je,xe,Te,Ae=!0,Ie="",Ce=0,Be="",Le="",qe=!1,De=!0,Fe=!1,Ve=!0,He=!1,Ue=!1,Ze=!0,Je=!1,_e=1,Qe=Y,Ye="",Ge=!0,Xe={},Ke=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,at=0,st=new Set,lt="",ct="child",dt=!1,ut="",mt=[],yt=window.parent,gt="*",bt=0,vt=!1,zt=1,wt=ce,$t=window,Et=()=>{ze("onMessage function not defined")},kt=()=>{},jt=null,Tt=null;function At(t){var o;!function(e){lt=e[0]??lt,Ce=Re(e[1])??Ce,Fe=Pe(e[2])??Fe,tt=Pe(e[3])??tt,Ae=Pe(e[6])??Ae,Be=e[7]??Be,Qe=e[8]??Qe,Ie=e[9]??Ie,Le=e[10]??Le,bt=Re(e[11])??bt,Xe.enable=Pe(e[12])??!1,ct=e[13]??ct,wt=e[14]??wt,ot=Pe(e[15])??ot,rt=Re(e[16])??rt,at=Re(e[17])??at,De=Pe(e[18])??De,ue=e[19]??ue,xe=e[20]??xe,nt=Re(e[21])??nt,et=Pe(e[23])??et}(t),le=(o={id:lt,enabled:tt,expand:et}).id||s,de.label(`${le}`),de.expand(o.expand),se=o.enabled,function(){function t(e){Te=Rt(e,"onBeforeResize")??Te,Et=Rt(e,"onMessage")??Et,kt=Rt(e,"onReady")??kt,typeof e?.offset===E&&(Ee($,S),De&&(rt=Bt(e,$)??rt),Fe&&(at=Bt(e,$)??at)),typeof e?.offsetSize===E&&(De&&(rt=Bt(e,S)??rt),Fe&&(at=Bt(e,S)??at)),$e=Lt(e,Z(J[0]))??$e,Ye=Lt(e,"ignoreSelector")??Ye,ut=Lt(e,"sizeSelector")??ut,gt=Lt(e,"targetOrigin")??gt,Qe=e?.heightCalculationMethod||Qe,wt=e?.widthCalculationMethod||wt}function o(t,n){return typeof t===k&&(we(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===nt)return;const r=window.iframeResizer||window.iFrameResizer;typeof r===M&&(t(r),Qe=o(Qe,z),wt=o(wt,w),me(`Set targetOrigin for parent: %c${gt}`,n))}(),[Ut,Jt,an,Vt,Zt,on,rn,tn,Ht,Wt,qe?te:Ne,Yt,un,dn,cn,Gt,()=>_t("background",Ie),()=>_t("padding",Le),qe?te:Xt,ln,sn,Sn,qt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;we("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),he(e)}}),Dt(ee(kt)),Dn(c,"Init message from host page",void 0,void 0,`${i}:${nt}`),document.title&&""!==document.title&&Vn(0,0,h,document.title)}function Pt({persisted:e}){e||Vn(0,0,"beforeUnload"),ge(u),me("Page persisted:",e),e||ne.forEach(ae)}const qt=()=>H(window,u.toLowerCase(),Pt);function Dt(e){"complete"===document.readyState?K(e):H(document,x,()=>Dt(e))}function Wt(){mt=document.querySelectorAll(`[${g}]`),Je=mt.length>0}let Ft=0;function Vt(){const e=document.querySelectorAll(`*[${v}]`);return He=e.length>0,He&&e.length!==Ft&&(function(e){const n=1===e.length?"":"s";ze(`%c[${v}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Ft=e.length),He}function Ht(){"BackCompat"===document.compatMode&&we("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Ut(){xe&&""!==xe&&"false"!==xe?xe!==i&&we(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${xe} - Child page: ${i}.\n`):we("<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/</> for more details.\n")}function Zt(){try{dt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Jt(){Fe===De&&(qe=!0)}function _t(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),me(`Set body ${e}: %c${t}`,n))}function Qt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Yt(){Qt(0,g,ut),Qt(0,v,Ye)}function Gt(){var e,t;void 0===Be&&(Be=`${Ce}px`),_t("margin",(e="margin",(t=Be).includes("-")&&(ze(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(z,j,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}_[t]=n,H(window,t,n,{passive:!0})},remove(e){const t=_[e];var n,o;delete _[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:x})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&we("<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 nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ze(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in U)&&we(`<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 ${xe?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Qe=nn(Qe,Y,In)}function rn(){wt=nn(wt,ce,Nn)}function an(){const e=nt,n=X({key:ue}),o=X({key:$e});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),ve(),we(`${G(nt+2)}${G(2)}`),re(xe))throw G(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!re(xe)||e>-1&&nt>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${le} %ciframe-resizer ${e}`,se||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>Z(Q[e]))(nt)})`,nt),nt<2&&we(G(3)),sessionStorage.setItem("ifr",i))}function sn(){en("add"),ne.push(()=>en("remove"))}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function cn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,y)+parseInt(n.x,y),y:parseInt(t.top,y)+parseInt(n.y,y)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Vn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Vn(n.y,n.x,p)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Xe;o&&(1===nt?we(G(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&H(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),H(window,"hashchange",n),setTimeout(n,128))),Xe={...Xe,findTarget:t}}function dn(){function e(e){Vn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){H(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function un(){1!==nt&&($t.parentIframe=Object.freeze({autoResize:e=>(ie(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Fe&&!1===De?(ge(I),we("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ae?(Ae=!0,queueMicrotask(()=>Dn(I,"Auto Resize enabled"))):!1===e&&!0===Ae&&(Ae=!1),Vn(0,0,"autoResize",JSON.stringify(Ae)),Ae)),close(){Vn(0,0,"close")},getId:()=>lt,getOrigin:()=>(ge("getOrigin"),Se("getOrigin()","getParentOrigin()"),Me),getParentOrigin:()=>Me,getPageInfo(e){if(typeof e===k)return jt=e,Vn(0,0,m),void Oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");jt=null,Vn(0,0,"pageInfoStop")},getParentProps:e=>(ie(e,k,"parentIframe.getParentProps(callback) callback"),Tt=e,Vn(0,0,f),()=>{Tt=null,Vn(0,0,"parentInfoStop")}),getParentProperties(e){Se("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ie(e,O,"parentIframe.moveToAnchor(anchor) anchor"),Xe.findTarget(e)},reset(){!function(){const e=Qe;Qe=Y,vt||(vt=!0,requestAnimationFrame(()=>{vt=!1})),Wn("reset"),Qe=e}()},setOffsetSize(e){ie(e,E,"parentIframe.setOffsetSize(offset) offset"),rt=e,at=e,Dn(B,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ie(e,E,"parentIframe.scrollBy(x, y) x"),ie(t,E,"parentIframe.scrollBy(x, y) y"),Vn(t,e,"scrollBy")},scrollTo(e,t){ie(e,E,"parentIframe.scrollTo(x, y) x"),ie(t,E,"parentIframe.scrollTo(x, y) y"),Vn(t,e,"scrollTo")},scrollToOffset(e,t){ie(e,E,"parentIframe.scrollToOffset(x, y) x"),ie(t,E,"parentIframe.scrollToOffset(x, y) y"),Vn(t,e,p)},sendMessage(e,t){t&&ie(t,O,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Vn(0,0,d,JSON.stringify(e),t)},setHeightCalculationMethod(e){Qe=e,on()},setWidthCalculationMethod(e){wt=e,rn()},setTargetOrigin(e){ie(e,O,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),gt=e},resize(e,t){void 0!==e&&ie(e,E,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ie(t,E,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(C,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Se("size()","resize()"),this.resize(e,t)}}),$t.parentIFrame=$t.parentIframe)}let mn=new Set;function fn(){const e=document.querySelectorAll(`[${b}]`);st=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${v}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ge("overflowIgnored"),me("Ignoring elements with [data-iframe-ignore] > *:\n",n),pe()}),t}(e),Ue=st.size>0,typeof Set.prototype.symmetricDifference===k&&(Ze=st.symmetricDifference(mn).size>0),mn=st}function pn(){switch(fn(),!0){case!Ze:return;case st.size>1:me("Overflowed Elements:",st);break;case Ue:break;default:me("No overflow detected")}Dn(q,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:De?T:A};return ke=ft(pn,t),ke.attachObservers(e),ke}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(L,`Element resized <${function(e){switch(!0){case!re(e):return"";case re(e.id):return`${e.nodeName}#${e.id}`;case re(e.name):return`${e.nodeName} (${e.name}`;case re(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return It=new ResizeObserver(yn),It.observe(document.body),xt.add(document.body),me("Attached ResizeObserver to body"),je={attachObserverToNonStaticElements:Nt,detachObservers:We(Ot,It,xt,Mt),disconnect:()=>{It.disconnect(),me("Detached ResizeObserver")}},je.attachObserverToNonStaticElements(e),je}function bn(e){Ke=!e,Dn(W,"Visibility changed")}const vn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return me("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;ge("addObservers");const t=vn(e);ke.attachObservers(t),je.attachObserverToNonStaticElements(t),pe()},wn=e=>{if(0===e.size)return;ge("removeObservers");const t=vn(e);ke.detachObservers(t),je.detachObservers(t),pe()};function $n(e){!function({addedNodes:e,removedNodes:t}){ge("contentMutated"),Yt(),Wt(),fn(),pe(),wn(t),zn(e)}(e),Dn(D,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[it($n),hn(e),St(),gn(e),Ct(bn)],ne.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(pt);const t=oe(e);let r=1,a=document.documentElement,i=Je?0:document.documentElement.getBoundingClientRect().bottom;const s=Je?mt:Ue?Array.from(st):kn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return me(`${t} position calculated from:`,a),me(`Checked %c${s.length}%c elements`,n,o),performance.mark(ht,{detail:{hasTags:Je,len:s.length,logging:tt,Side:t}}),i}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(V).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[n,o,n];function An(e){function t(){return xn[r]=a,jn[r]=l,Math.max(a,1)}const o=e===In,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${a}px %cPage: %c${l}px`;let d=1;switch(!0){case!e.enabled():return Math.max(l,1);case Je:me("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Ue&&Ve&&0===xn[r]&&0===jn[r]:me(`Initial page size values: ${c}`,...Tn),d=t();break;case vt&&a===xn[r]&&l===jn[r]:me(`Size unchanged: ${c}`,...Tn),d=Math.max(a,l);break;case 0===a&&0!==l:me(`Page is hidden: ${c}`,...Tn),d=l;break;case!Ue&&a!==xn[r]&&l<=jn[r]:me(`New <html> size: ${c} `,...Tn),me(`Previous <html> size: %c${xn[r]}px`,n),d=t();break;case!o:d=e.taggedElement();break;case!Ue&&a<xn[r]:me(`<html> size decreased: ${c}`,...Tn),d=t();break;case l===s||l===i:me(`<html> size equals page size: ${c}`,...Tn),d=t();break;case a>l:me(`Page size < <html> size: ${c}`,...Tn),d=t();break;case Ue:me("Found elements possibly overflowing <html> "),d=e.taggedElement();break;default:me(`Using <html> size: ${c}`,...Tn),d=t()}return me(`Content ${r}: %c${d}px`,n),d+=function(e){const t=e.getOffset();return 0!==t&&me(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(d,1)}const In={label:z,enabled:()=>De,getOffset:()=>rt,auto:()=>An(In),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>In.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),grow:()=>In.max(),lowestElement:()=>On(T),taggedElement:()=>On(T)},Nn={label:w,enabled:()=>Fe,getOffset:()=>at,auto:()=>An(Nn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(Nn)),min:()=>Math.min(...En(Nn)),rightMostElement:()=>On(A),scroll:()=>Math.max(Nn.bodyScroll(),Nn.documentElementScroll()),taggedElement:()=>On(A)},Cn=(e,t)=>!(Math.abs(e-t)<=bt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Te?function(e){const t=Te(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return fe(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=ee(()=>we(G(4)));let Ln,qn=!1;const Dn=ye((e,t,n,o,r)=>{switch(ge(e),!0){case!0===Ke:if(!0===qn)break;qn=!0,Rn=!1,cancelAnimationFrame(Ln);break;case!0===Rn&&e!==q:ve();break;case!Ae&&!(e in R):me("Resizing disabled");break;default:qn=!1,Rn=!0,performance.now(),Ln=requestAnimationFrame(()=>{Rn=!1,ge("requestAnimationFrame")}),function(e,t,n,o,r){const a=n??Pn(In,Qe),i=o??Pn(Nn,wt);switch(De&&Cn(_e,a)||Fe&&Cn(zt,i)?N:e){case c:case I:case N:_e=a,zt=i;case B:Fn(_e,zt,e,r);break;case q:case D:case L:case W:ve();break;default:ve(),me("No change in content size detected")}}(e,0,n,o,r)}pe()});function Wn(e){_e=In[Qe](),zt=Nn[wt](),Vn(_e,zt,e)}function Fn(e,t,o,a,i){nt<-1||(void 0!==i||(i=gt),function(){const s=`${lt}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(dt)try{window.parent.iframeParentListener(F+s)}catch(e){if(1!==nt)throw e;return void Bn()}else yt.postMessage(F+s,i);me(`Sending message to parent page via ${dt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Vn=ye((e,t,n,o,r)=>{ge(n),Fn(e,t,n,o,r),pe()}),Hn=ye(function(e){ge("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Vn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(l);yt=e.source,Me=e.origin,At(t),Ve=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Wn("resetPage")},resize(){Dn(P,"Parent window requested size check")},moveToAnchor(){Xe.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();jt?K(jt,n(e)):o(m)},parentInfo(){const e=(r=i(),t(n(r)));var r;Tt?K(Tt,e):o(f)},message(){const e=i();K(Et,n(e))}},a=()=>e.data.split("]")[1].split(l)[0],i=()=>e.data.slice(e.data.indexOf(l)+1),s=()=>e.data.split(l)[2]in{true:1,false:1};function d(){const t=a();ge(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||ze(`Unexpected message (${e.data})`)}F===`${e.data}`.slice(0,13)&&function(){if(!1!==Ve)return s()?(be(a()),ge(c),void r.init()):void 0;d()}()});let Un=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Ve||Un)return;const{parent:e,top:t}=window;ge("ready"),Zn(e),e!==t&&Zn(t),Un=!0}"iframeChildListener"in window?ze("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Hn({data:e,sameOrigin:!0})),H(window,d,Hn),H(document,x,Jn),Jn())}();
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/child 5.5.6 (umd) - 2025-09-10
4
+ * @module iframe-resizer/child 5.5.7 (umd) - 2025-09-23
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,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.5.6",b="iframeResizer",v="beforeUnload",w="init",z="message",$="pageInfo",S="parentInfo",O="scrollToOffset",E="title",M=10,k="data-iframe-size",j="data-iframe-overflowed",x="data-iframe-ignore",T="height",A="width",C="readystatechange",I="bottom",N="right",P="autoResizeEnabled",R=Symbol("sizeChanged"),B="manualResize",q="parentResize",L={[B]:1,[q]:1},D="setOffsetSize",F="resizeObserver",W="overflowObserver",V="mutationObserver",H="visibilityObserver",U="[iFrameSizer]",Z=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),J=(e,t,n,o)=>e.addEventListener(t,n,o||!1),_=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)},Q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),G=["spjluzl","rlf","clyzpvu"],Y=["<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."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],K=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ee=e=>Q(Y[e]),te=e=>{const t=e[Q(G[0])]||e[Q(G[1])]||e[Q(G[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in K&&(t=K[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o},ne=(e,...t)=>setTimeout(()=>e(...t),0),oe=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},re=e=>e,ie=e=>Math.round(1e3*e)/1e3,ae=e=>e.charAt(0).toUpperCase()+e.slice(1),se=e=>""!=`${e}`&&void 0!==e;const ce=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ae(t)}`)};let le=!0,ue=b;const de=(fe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function z(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(z(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),w()}return n},event:function(e){z(),h.event=e},purge:y,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},fe?.__esModule?fe.default:fe);var fe;const me=de({label:`${b}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!le||me[pe](...e));const{assert:ge,endAutoGroup:ye,error:be,errorBoundary:ve,event:we,label:ze,purge:$e,warn:Se}=me,Oe=e=>{return me.warn((t=re,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Ee=Oe,Me=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Oe(t)),ke=Me("Method"),je=Me("Method","replaced with"),xe=Me("Option"),Te=["min-height","min-width","max-height","max-width"],Ae=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ie=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ne({href:e}){Ae.has(e)||Ae.add(e)}const Pe=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ne(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Re=(e,t)=>{const{source:n,value:o}=Pe(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Oe(`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</>.\n\nIf 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 Be(){for(const e of[document.documentElement,document.body])for(const t of Te)Ie(e,t)&&Re(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),Le=qe(e=>"true"===e),De=qe(Number),Fe=e=>e=>{e.size},We=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ve=e=>e=>{e.size},He=(t,n=!0)=>o=>{o>0&&he(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n,o)=>{const r=Ve(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},Ze=new Set,Je=new Set,_e=new Set,Qe=[],Ge={attributes:!0,attributeFilter:[x,k],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Ye,Xe=1,Ke=!1,et=0;const tt=e=>{e.size},nt=e=>{e.size},ot=e=>{e.size},rt=e=>e.nodeType!==Node.ELEMENT_NODE||Z.has(e.tagName.toLowerCase());function it(e){const t=e.addedNodes;for(const e of t)rt(e)||Ze.add(e)}function at(e){const t=e.removedNodes;for(const e of t)rt(e)||(Ze.has(e)?(Ze.delete(e),_e.add(e)):Je.add(e))}const st=e=>{he("Mutations:",e);for(const t of e)it(t),at(t);tt(Ze),nt(Je),ot(_e),_e.clear()};const ct=e=>()=>{const t=performance.now(),n=t-et,o=16*Xe+++2;if(n>o&&n<200)return we("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${ie(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Ye,16*Xe),void(et=t);Xe=1,Qe.forEach(st),Qe.length=0,Ke=!1,Je.size,Ze.size,e({addedNodes:Ze,removedNodes:Je}),Ze.clear(),Je.clear()};function lt(e){Qe.push(e),Ke||(et=performance.now(),Ke=!0,requestAnimationFrame(Ye))}function ut(e){const t=new window.MutationObserver(lt),n=document.body||document.documentElement;return Ye=ct(e),t.observe(n,Ge),he("Attached MutationObserver to body"),{...t,disconnect:()=>{Ze.clear(),Je.clear(),Qe.length=0,t.disconnect(),he("Detached MutationObserver")}}}const dt="Overflow",ft=He(dt),mt=He(dt,!1),pt=Fe(dt),ht=We(dt),gt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||re,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(j,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!gt(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));ht(t),pt(n),ft(o),n.clear(),t.clear()},detachObservers:Ue(dt,c,l,mt),disconnect:()=>{c.disconnect(),he("Detached OverflowObserver")}}},bt="--ifr-start",vt="--ifr-end",wt="--ifr-measure",zt=[];let $t,St={},Ot=0;function Et(){try{performance.clearMarks(bt),performance.clearMarks(vt),performance.clearMeasures(wt)}catch{}}function Mt(e){e.getEntries().forEach(e=>{if(e.name===vt)try{const{duration:t}=performance.measure(wt,bt,vt);St=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function kt(){he("Attached PerformanceObserver to page");const e=new PerformanceObserver(Mt);return e.observe({entryTypes:["mark"]}),$t=setInterval(()=>{if(zt.length<10)return;if(St.hasTags&&St.len<25)return;zt.sort();const e=Math.min(zt.reduce((e,t)=>e+t,0)/zt.length,zt[Math.floor(zt.length/2)]),t=ie(e);t>Ot&&(Ot=t,we("performanceObserver")),Et(),e<=4||(clearInterval($t),Oe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${ie(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${St.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Et(),clearInterval($t),e.disconnect(),he("Detached PerformanceObserver")}}}const jt="Resize",xt=He(jt),Tt=He(jt,!1),At=Fe(jt),Ct=We(jt),It=new WeakSet,Nt=new Set,Pt=new Set;let Rt;function Bt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(It.has(n)?Nt.add(n):(Rt.observe(n),It.add(n),Pt.add(n),t+=1))}Ct(Nt),At(Pt),xt(t),Pt.clear(),Nt.clear()}function qt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),he("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),he("Detached VisibilityObserver")}}}const Lt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Dt=Lt("function"),Ft=Lt("number"),Wt=Lt("string");"undefined"!=typeof window&&function(){const o={height:()=>(Se("Custom height calculation function not defined"),Sn.auto()),width:()=>(Se("Custom width calculation function not defined"),On.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a="auto",s=[],c="scroll";let l,u,d,f,m,p,_,Y=!0,K="",ie=0,de="",fe="",pe=!1,Me=!0,Te=!1,Ae=!0,Ce=!1,Ie=!1,Ne=!0,Pe=!1,Re=1,qe=a,Fe="",We=!0,Ve={},He=!1,Ze=!1,Je=!1,_e=0,Qe=!1,Ge=0,Ye=0,Xe=new Set,Ke="",et="child",tt=!1,nt="",ot=[],rt=window.parent,it="*",at=0,st=!1,ct=1,lt=c,dt=window,ft=()=>{Se("onMessage function not defined")},mt=()=>{},pt=null,ht=null;function gt(e){var t;!function(e){Ke=e[0]??Ke,ie=De(e[1])??ie,Te=Le(e[2])??Te,Je=Le(e[3])??Je,Y=Le(e[6])??Y,de=e[7]??de,qe=e[8]??qe,K=e[9]??K,fe=e[10]??fe,at=De(e[11])??at,Ve.enable=Le(e[12])??!1,et=e[13]??et,lt=e[14]??lt,Qe=Le(e[15])??Qe,Ge=De(e[16])??Ge,Ye=De(e[17])??Ye,Me=Le(e[18])??Me,l=e[19]??l,p=e[20]??p,_e=De(e[21])??_e,Ze=Le(e[23])??Ze}(e),ue=(t={id:Ke,enabled:Je,expand:Ze}).id||b,me.label(`${ue}`),me.expand(t.expand),le=t.enabled,function(){function e(e){_=Dt(e,"onBeforeResize")??_,ft=Dt(e,"onMessage")??ft,mt=Dt(e,"onReady")??mt,"number"==typeof e?.offset&&(xe("offset","offsetSize"),Me&&(Ge=Ft(e,"offset")??Ge),Te&&(Ye=Ft(e,"offset")??Ye)),"number"==typeof e?.offsetSize&&(Me&&(Ge=Ft(e,"offsetSize")??Ge),Te&&(Ye=Ft(e,"offsetSize")??Ye)),u=Wt(e,Q(G[0]))??u,Fe=Wt(e,"ignoreSelector")??Fe,nt=Wt(e,"sizeSelector")??nt,it=Wt(e,"targetOrigin")??it,qe=e?.heightCalculationMethod||qe,lt=e?.widthCalculationMethod||lt}function t(e,t){return"function"==typeof e&&(Oe(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===_e)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),qe=t(qe,T),lt=t(lt,A),he(`Set targetOrigin for parent: %c${it}`,h))}(),[Mt,At,Gt,Ot,xt,_t,Qt,Zt,Et,$t,pe?re:Be,Pt,tn,en,Kt,Lt,()=>Ct("background",K),()=>Ct("padding",fe),pe?re:Vt,Xt,Yt,pn,wt].forEach(e=>{try{e()}catch(e){if(_e<0)throw e;Oe("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),be(e)}}),zt(oe(mt)),An(w,"Init message from host page",void 0,void 0,`${y}:${_e}`),document.title&&""!==document.title&&Nn(0,0,E,document.title)}function wt(){J(window,v.toLowerCase(),()=>{s.forEach(e=>e()),Nn(0,0,v)})}function zt(e){"complete"===document.readyState?ne(e):J(document,C,()=>zt(e))}function $t(){ot=document.querySelectorAll(`[${k}]`),Pe=ot.length>0}let St=0;function Ot(){const n=document.querySelectorAll(`*[${x}]`);return Ce=n.length>0,Ce&&n.length!==St&&(function(n){const o=1===n.length?"":"s";Se(`%c[${x}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),St=n.length),Ce}function Et(){"BackCompat"===document.compatMode&&Oe("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Mt(){p&&""!==p&&"false"!==p?p!==y&&Oe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${y}.\n`):Oe("<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/</> for more details.\n")}function xt(){try{tt=1===_e||"iframeParentListener"in window.parent}catch(e){}}function At(){Te===Me&&(pe=!0)}function Ct(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,h))}function Nt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Pt(){Nt(0,k,nt),Nt(0,x,Fe)}function Lt(){var e,t;void 0===de&&(de=`${ie}px`),Ct("margin",(e="margin",(t=de).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function Vt(){const e=e=>e.style.setProperty(T,"auto","important");e(document.documentElement),e(document.body)}function Ht(e){({add(t){function n(){An(e.eventName,e.eventType)}i[t]=n,J(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ut(e){Ht({method:e,eventType:"After Print",eventName:"afterprint"}),Ht({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ht({method:e,eventType:"Ready State Change",eventName:C})}function Zt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(k,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Oe("<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 Jt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Oe(`<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 ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: 'auto',\n}\n`}\n`),e}function _t(){qe=Jt(qe,a,Sn)}function Qt(){lt=Jt(lt,c,On)}function Gt(){const t=_e,n=te({key:l}),o=te({key:u});if(_e=Math.max(n,o),_e<0){if(_e=Math.min(n,o),$e(),Oe(`${ee(_e+2)}${ee(2)}`),se(p))throw ee(_e+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!se(p)||t>-1&&_e>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ue} %ciframe-resizer ${t}`,le||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>Q(X[e]))(_e)})`,_e),_e<2&&Ee(ee(3)),sessionStorage.setItem("ifr",y))}function Yt(){Ut("add"),s.push(()=>Ut("remove"))}function Xt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Kt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,M)+parseInt(n.x,M),y:parseInt(t.top,M)+parseInt(n.y,M)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Nn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Nn(n.y,n.x,O)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ve.enable&&(1===_e?Oe("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&J(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),J(window,"hashchange",n),setTimeout(n,128))),Ve={findTarget:t}}function en(){function e(e){Nn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){J(window.document,t,e)}!0===Qe&&(t("mouseenter"),t("mouseleave"))}function tn(){1!==_e&&(dt.parentIframe=Object.freeze({autoResize:e=>(ce(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Te&&!1===Me?(we(P),Oe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Y?(Y=!0,queueMicrotask(()=>An(P,"Auto Resize enabled"))):!1===e&&!0===Y&&(Y=!1),Nn(0,0,"autoResize",JSON.stringify(Y)),Y)),close(){Nn(0,0,"close")},getId:()=>Ke,getOrigin:()=>(we("getOrigin"),ke("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if("function"==typeof e)return pt=e,Nn(0,0,$),void je("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");pt=null,Nn(0,0,"pageInfoStop")},getParentProps:e=>(ce(e,"function","parentIframe.getParentProps(callback) callback"),ht=e,Nn(0,0,S),()=>{ht=null,Nn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ce(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ve.findTarget(e)},reset(){!function(){const e=qe;qe=a,st||(st=!0,requestAnimationFrame(()=>{st=!1})),Cn("reset"),qe=e}()},setOffsetSize(e){ce(e,"number","parentIframe.setOffsetSize(offset) offset"),Ge=e,Ye=e,An(D,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ce(e,"number","parentIframe.scrollBy(x, y) x"),ce(t,"number","parentIframe.scrollBy(x, y) y"),Nn(t,e,"scrollBy")},scrollTo(e,t){ce(e,"number","parentIframe.scrollTo(x, y) x"),ce(t,"number","parentIframe.scrollTo(x, y) y"),Nn(t,e,"scrollTo")},scrollToOffset(e,t){ce(e,"number","parentIframe.scrollToOffset(x, y) x"),ce(t,"number","parentIframe.scrollToOffset(x, y) y"),Nn(t,e,O)},sendMessage(e,t){t&&ce(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Nn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){qe=e,_t()},setWidthCalculationMethod(e){lt=e,Qt()},setTargetOrigin(e){ce(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),it=e},resize(e,t){void 0!==e&&ce(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ce(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),An(B,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),dt.parentIFrame=dt.parentIframe)}let nn=new Set;function on(){const e=document.querySelectorAll(`[${j}]`);Xe=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${x}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{we("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ye()}),t}(e),Ie=Xe.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ne=Xe.symmetricDifference(nn).size>0),nn=Xe}function rn(){switch(on(),!0){case!Ne:return;case Xe.size>1:he("Overflowed Elements:",Xe);break;case Ie:break;default:he("No overflow detected")}An(W,"Overflow updated")}function an(e){const t={root:document.documentElement,side:Me?I:N};return f=yt(rn,t),f.attachObservers(e),f}function sn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;An(F,`Element resized <${function(e){switch(!0){case!se(e):return"";case se(e.id):return`${e.nodeName}#${e.id}`;case se(e.name):return`${e.nodeName} (${e.name}`;case se(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function cn(e){return Rt=new ResizeObserver(sn),Rt.observe(document.body),It.add(document.body),he("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Bt,detachObservers:Ue(jt,Rt,It,Tt),disconnect:()=>{Rt.disconnect(),he("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function ln(e){He=!e,An(H,"Visibility changed")}const un=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of bn(n))t.add(e)}return he("Inspecting:\n",t),t},dn=e=>{if(0===e.size)return;we("addObservers");const t=un(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),ye()},fn=e=>{if(0===e.size)return;we("removeObservers");const t=un(e);f.detachObservers(t),m.detachObservers(t),ye()};function mn(e){!function({addedNodes:e,removedNodes:t}){we("contentMutated"),Pt(),$t(),on(),ye(),fn(t),dn(e)}(e),An(V,"Mutation Observed")}function pn(){const e=bn(document.documentElement);var t;t=[ut(mn),an(e),kt(),cn(e),qt(ln)],s.push(...t.map(e=>e.disconnect))}function hn(e){performance.mark(bt);const t=ae(e);let n=1,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?ot:Ie?Array.from(Xe):bn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return he(`${t} position calculated from:`,o),he(`Checked %c${i.length}%c elements`,h,g),performance.mark(vt,{detail:{hasTags:Pe,len:i.length,logging:Je,Side:t}}),r}const gn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],yn=`* ${Array.from(Z).map(e=>`:not(${e})`).join("")}`,bn=e=>e.querySelectorAll(yn),vn={height:0,width:0},wn={height:0,width:0},zn=[h,g,h];function $n(e){function t(){return wn[o]=r,vn[o]=s,Math.max(r,1)}const n=e===Sn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case Pe:he("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&Ae&&0===wn[o]&&0===vn[o]:he(`Initial page size values: ${c}`,...zn),l=t();break;case st&&r===wn[o]&&s===vn[o]:he(`Size unchanged: ${c}`,...zn),l=Math.max(r,s);break;case 0===r&&0!==s:he(`Page is hidden: ${c}`,...zn),l=s;break;case!Ie&&r!==wn[o]&&s<=vn[o]:he(`New <html> size: ${c} `,...zn),he(`Previous <html> size: %c${wn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<wn[o]:he(`<html> size decreased: ${c}`,...zn),l=t();break;case s===a||s===i:he(`<html> size equals page size: ${c}`,...zn),l=t();break;case r>s:he(`Page size < <html> size: ${c}`,...zn),l=t();break;case Ie:he("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:he(`Using <html> size: ${c}`,...zn),l=t()}return he(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Sn={label:T,enabled:()=>Me,getOffset:()=>Ge,auto:()=>$n(Sn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,M)+parseInt(t.marginBottom,M)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Sn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...gn(Sn)),min:()=>Math.min(...gn(Sn)),grow:()=>Sn.max(),lowestElement:()=>hn(I),taggedElement:()=>hn(I)},On={label:A,enabled:()=>Te,getOffset:()=>Ye,auto:()=>$n(On),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...gn(On)),min:()=>Math.min(...gn(On)),rightMostElement:()=>hn(N),scroll:()=>Math.max(On.bodyScroll(),On.documentElementScroll()),taggedElement:()=>hn(N)},En=(e,t)=>!(Math.abs(e-t)<=at);function Mn(e,t){const n=e[t](),o=e.enabled()&&void 0!==_?function(e){const t=_(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ge(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let kn=!1;const jn=oe(()=>Ee(ee(4)));let xn,Tn=!1;const An=ve((e,t,n,o,r)=>{switch(we(e),!0){case!0===He:if(!0===Tn)break;Tn=!0,kn=!1,cancelAnimationFrame(xn);break;case!0===kn&&e!==W:$e();break;case!Y&&!(e in L):he("Resizing disabled");break;default:Tn=!1,kn=!0,performance.now(),xn=requestAnimationFrame(()=>{kn=!1,we("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Mn(Sn,qe),a=o??Mn(On,lt);switch(Me&&En(Re,i)||Te&&En(ct,a)?R:e){case w:case P:case R:Re=i,ct=a;case D:In(Re,ct,e,r);break;case W:case V:case F:case H:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ye()});function Cn(e){Re=Sn[qe](),ct=On[lt](),Nn(Re,ct,e)}function In(e,t,o,r,i){_e<-1||(void 0!==i||(i=it),function(){const a=`${Ke}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(tt)try{window.parent.iframeParentListener(U+a)}catch(e){if(1!==_e)throw e;return void jn()}else rt.postMessage(U+a,i);he(`Sending message to parent page via ${tt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Nn=ve((e,t,n,o,r)=>{we(n),In(e,t,n,o,r),ye()}),Pn=ve(function(e){we("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Nn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");rt=e.source,d=e.origin,gt(t),Ae=!1,setTimeout(()=>{We=!1},128)},reset(){We||Cn("resetPage")},resize(){An(q,"Parent window requested size check")},moveToAnchor(){Ve.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();pt?ne(pt,n(e)):o($)},parentInfo(){const e=(r=a(),t(n(r)));var r;ht?ne(ht,e):o(S)},message(){const e=a();ne(ft,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();we(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}U===`${e.data}`.slice(0,13)&&function(){if(!1!==Ae)return s()?(ze(i()),we(w),void r.init()):void 0;c()}()});let Rn=!1;const Bn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function qn(){if("loading"===document.readyState||!Ae||Rn)return;const{parent:e,top:t}=window;we("ready"),Bn(e),e!==t&&Bn(t),Rn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Pn({data:e,sameOrigin:!0})),J(window,z,Pn),J(document,C,qn),qn())}()});
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},c=Object.assign(console);const{fromEntries:l,keys:u}=Object,d=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.7",b="iframeResizer",v=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",A="height",C="width",I="offset",N="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",U=Symbol("sizeChanged"),V="manualResize",Z="parentResize",J={[V]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ne=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)},oe=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),re=["spjluzl","rlf","clyzpvu"],ie=["<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."],ae=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],se=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ce=e=>oe(ie[e]),le=e=>{const t=e[oe(re[0])]||e[oe(re[1])]||e[oe(re[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=ne(oe(e));return n in se&&(t=se[n]),t}(n[0]);return 0===o||(e=>e[2]===ne(e[0]+e[1]))(n)||(o=-2),o},ue=(e,...t)=>setTimeout(()=>e(...t),0),de=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},fe=e=>e,me=e=>Math.round(1e3*e)/1e3,pe=e=>e.charAt(0).toUpperCase()+e.slice(1),he=e=>""!=`${e}`&&void 0!==e,ye=e=>e();const ge=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${pe(t)}`)};let be=!0,ve=b;const ze=(we=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let y="";function g(){p.length=0,y=""}function b(){delete h.event,g()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?y:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function w(){""===y&&(y=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask(()=>queueMicrotask(z))),p.push([e,...t])}function S(e=r,...t){l[e]?$("log",`${e}: ${performance.now()-l[e]} ms`,...t):$("timeLog",e,...t)}return{...m(h,f(h)),...m(console,e=>[e,(...t)=>$(e,...t)]),...m(s,d),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},we?.__esModule?we.default:we);var we;const $e=ze({label:`${b}(child)`,expand:!1});var Se;const Oe=(Se="log",(...e)=>!be||$e[Se](...e));const{assert:Ee,endAutoGroup:Me,error:ke,errorBoundary:je,event:xe,label:Te,purge:Ae,warn:Ce}=$e,Ie=e=>{return $e.warn((t=fe,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},Ne=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Ie(t)),Pe=Ne("Method"),Re=Ne("Method","replaced with"),Be=Ne("Option"),qe=["min-height","min-width","max-height","max-width"],Le=new Set,De=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Fe=(e,t)=>{return(n=De(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function We({href:e}){Le.has(e)||Le.add(e)}const He=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){We(n)}return{source:"cross-origin stylesheet",value:De(e,t)}}(e,t),Ue=(e,t)=>{const{source:n,value:o}=He(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Ie(`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</>.\n\nIf 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 Ve(){for(const e of[document.documentElement,document.body])for(const t of qe)Fe(e,t)&&Ue(e,t)}const Ze=e=>t=>void 0===t?void 0:e(t),Je=Ze(e=>"true"===e),_e=Ze(Number),Qe=e=>e=>{e.size},Ge=((e="")=>t=>n=>{n.size>0&&ke(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ye=e=>e=>{e.size},Xe=(t,n=!0)=>o=>{o>0&&Oe(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ke=(e,t,n,o)=>{const r=Ye(e);return e=>{const i=new Set;let a=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),i.add(o),a+=1);r(i),o(a),i.clear()}},et=new Set,tt=new Set,nt=new Set,ot=[],rt={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let it,at=1,st=!1,ct=0;const lt=e=>{e.size},ut=e=>{e.size},dt=e=>{e.size},ft=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function mt(e){const t=e.addedNodes;for(const e of t)ft(e)||et.add(e)}function pt(e){const t=e.removedNodes;for(const e of t)ft(e)||(et.has(e)?(et.delete(e),nt.add(e)):tt.add(e))}const ht=e=>{Oe("Mutations:",e);for(const t of e)mt(t),pt(t);lt(et),ut(tt),dt(nt),nt.clear()};const yt=e=>()=>{const t=performance.now(),n=t-ct,o=16*at+++2;if(n>o&&n<200)return xe("mutationThrottled"),Oe("Update delayed due to heavy workload on the callStack"),Oe(`EventLoop busy time: %c${me(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(it,16*at),void(ct=t);at=1,ot.forEach(ht),ot.length=0,st=!1,tt.size,et.size,e({addedNodes:et,removedNodes:tt}),et.clear(),tt.clear()};function gt(e){ot.push(e),st||(ct=performance.now(),st=!0,requestAnimationFrame(it))}function bt(e){const t=new window.MutationObserver(gt),n=document.body||document.documentElement;return it=yt(e),t.observe(n,rt),Oe("Attached MutationObserver to body"),{...t,disconnect:()=>{et.clear(),tt.clear(),ot.length=0,t.disconnect(),Oe("Detached MutationObserver")}}}const vt="Overflow",zt=Xe(vt),wt=Xe(vt,!1),$t=Qe(vt),St=Ge(vt),Ot=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Et=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||fe,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(x,t);const c=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t;if(!o)continue;const i=e[n],c=a(i,o)&&!Ot(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));St(t),$t(n),zt(o),n.clear(),t.clear()},detachObservers:Ke(vt,c,l,wt),disconnect:()=>{c.disconnect(),Oe("Detached OverflowObserver")}}},Mt="--ifr-start",kt="--ifr-end",jt="--ifr-measure",xt=[];let Tt,At={},Ct=0;function It(){try{performance.clearMarks(Mt),performance.clearMarks(kt),performance.clearMeasures(jt)}catch{}}function Nt(e){e.getEntries().forEach(e=>{if(e.name===kt)try{const{duration:t}=performance.measure(jt,Mt,kt);At=e.detail,xt.push(t),xt.length>100&&xt.shift()}catch{}})}function Pt(){Oe("Attached PerformanceObserver to page");const e=new PerformanceObserver(Nt);return e.observe({entryTypes:["mark"]}),Tt=setInterval(()=>{if(xt.length<10)return;if(At.hasTags&&At.len<25)return;xt.sort();const e=Math.min(xt.reduce((e,t)=>e+t,0)/xt.length,xt[Math.floor(xt.length/2)]),t=me(e);t>Ct&&(Ct=t,xe("performanceObserver")),It(),e<=4||(clearInterval(Tt),Ie(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${me(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${At.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(Tt),e.disconnect(),Oe("Detached PerformanceObserver")}}}const Rt="Resize",Bt=Xe(Rt),qt=Xe(Rt,!1),Lt=Qe(Rt),Dt=Ge(Rt),Ft=new WeakSet,Wt=new Set,Ht=new Set;let Ut;function Vt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Ft.has(n)?Wt.add(n):(Ut.observe(n),Ft.add(n),Ht.add(n),t+=1))}Dt(Wt),Lt(Ht),Bt(t),Ht.clear(),Wt.clear()}function Zt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),Oe("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),Oe("Detached VisibilityObserver")}}}const Jt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},_t=Jt(q),Qt=Jt(R),Gt=Jt(P);"undefined"!=typeof window&&function(){const o={height:()=>(Ce("Custom height calculation function not defined"),Cn.auto()),width:()=>(Ce("Custom width calculation function not defined"),In.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a=L,s=[],c="scroll";let l,u,d,f,m,p,ne,ie=!0,se="",me=0,ze="",we="",Se=!1,Ne=!0,qe=!1,Le=!0,De=!1,Fe=!1,We=!0,He=!1,Ue=1,Ze=a,Qe="",Ge=!0,Ye={},Xe=!1,et=!1,tt=!1,nt=0,ot=!1,rt=0,it=0,at=new Set,st="",ct="child",lt=!1,ut="",dt=[],ft=window.parent,mt="*",pt=0,ht=!1,yt=1,gt=c,vt=window,zt=()=>{Ce("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){st=e[0]??st,me=_e(e[1])??me,qe=Je(e[2])??qe,tt=Je(e[3])??tt,ie=Je(e[6])??ie,ze=e[7]??ze,Ze=e[8]??Ze,se=e[9]??se,we=e[10]??we,pt=_e(e[11])??pt,Ye.enable=Je(e[12])??!1,ct=e[13]??ct,gt=e[14]??gt,ot=Je(e[15])??ot,rt=_e(e[16])??rt,it=_e(e[17])??it,Ne=Je(e[18])??Ne,l=e[19]??l,p=e[20]??p,nt=_e(e[21])??nt,et=Je(e[23])??et}(e),ve=(t={id:st,enabled:tt,expand:et}).id||b,$e.label(`${ve}`),$e.expand(t.expand),be=t.enabled,function(){function e(e){ne=_t(e,"onBeforeResize")??ne,zt=_t(e,"onMessage")??zt,wt=_t(e,"onReady")??wt,typeof e?.offset===R&&(Be(I,N),Ne&&(rt=Qt(e,I)??rt),qe&&(it=Qt(e,I)??it)),typeof e?.offsetSize===R&&(Ne&&(rt=Qt(e,N)??rt),qe&&(it=Qt(e,N)??it)),u=Gt(e,oe(re[0]))??u,Qe=Gt(e,"ignoreSelector")??Qe,ut=Gt(e,"sizeSelector")??ut,mt=Gt(e,"targetOrigin")??mt,Ze=e?.heightCalculationMethod||Ze,gt=e?.widthCalculationMethod||gt}function t(e,t){return typeof e===q&&(Ie(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===nt)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),Ze=t(Ze,A),gt=t(gt,C),Oe(`Set targetOrigin for parent: %c${mt}`,h))}(),[Bt,Dt,an,It,Lt,on,rn,tn,Nt,At,Se?fe:Ve,Jt,dn,un,ln,Yt,()=>Wt("background",se),()=>Wt("padding",we),Se?fe:Xt,cn,sn,Sn,xt].forEach(e=>{try{e()}catch(e){if(nt<0)throw e;Ie("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),ke(e)}}),Tt(de(wt)),Dn(z,"Init message from host page",void 0,void 0,`${g}:${nt}`),document.title&&""!==document.title&&Hn(0,0,M,document.title)}function jt({persisted:e}){e||Hn(0,0,"beforeUnload"),xe($),Oe("Page persisted:",e),e||s.forEach(ye)}const xt=()=>te(window,$.toLowerCase(),jt);function Tt(e){"complete"===document.readyState?ue(e):te(document,D,()=>Tt(e))}function At(){dt=document.querySelectorAll(`[${j}]`),He=dt.length>0}let Ct=0;function It(){const n=document.querySelectorAll(`*[${T}]`);return De=n.length>0,De&&n.length!==Ct&&(function(n){const o=1===n.length?"":"s";Ce(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ct=n.length),De}function Nt(){"BackCompat"===document.compatMode&&Ie("<rb>Quirks Mode Detected</>\n\nThis 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</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Bt(){p&&""!==p&&"false"!==p?p!==g&&Ie(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${p} - Child page: ${g}.\n`):Ie("<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/</> for more details.\n")}function Lt(){try{lt=1===nt||"iframeParentListener"in window.parent}catch(e){}}function Dt(){qe===Ne&&(Se=!0)}function Wt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Oe(`Set body ${e}: %c${t}`,h))}function Ht(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Ht(0,j,ut),Ht(0,T,Qe)}function Yt(){var e,t;void 0===ze&&(ze=`${me}px`),Wt("margin",(e="margin",(t=ze).includes("-")&&(Ce(`Negative CSS value ignored for ${e}`),t=""),t))}function Xt(){const e=e=>e.style.setProperty(A,L,"important");e(document.documentElement),e(document.body)}function Kt(e){({add(t){function n(){Dn(e.eventName,e.eventType)}i[t]=n,te(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function en(e){Kt({method:e,eventType:"After Print",eventName:"afterprint"}),Kt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Kt({method:e,eventType:"Ready State Change",eventName:D})}function tn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Ie("<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 nn(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Ce(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&Ie(`<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 ${p?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n \nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: AUTO,\n}\n`}\n`),e}function on(){Ze=nn(Ze,a,Cn)}function rn(){gt=nn(gt,c,In)}function an(){const t=nt,n=le({key:l}),o=le({key:u});if(nt=Math.max(n,o),nt<0){if(nt=Math.min(n,o),Ae(),Ie(`${ce(nt+2)}${ce(2)}`),he(p))throw ce(nt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!he(p)||t>-1&&nt>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${ve} %ciframe-resizer ${t}`,be||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>oe(ae[e]))(nt)})`,nt),nt<2&&Ie(ce(3)),sessionStorage.setItem("ifr",g))}function sn(){en("add"),s.push(()=>en("remove"))}function cn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function ln(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ye;o&&(1===nt?Ie(ce(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&te(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),te(window,"hashchange",n),setTimeout(n,128))),Ye={...Ye,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){te(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function dn(){1!==nt&&(vt.parentIframe=Object.freeze({autoResize:e=>(ge(e,"boolean","parentIframe.autoResize(enable) enable"),!1===qe&&!1===Ne?(xe(H),Ie("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ie?(ie=!0,queueMicrotask(()=>Dn(H,"Auto Resize enabled"))):!1===e&&!0===ie&&(ie=!1),Hn(0,0,"autoResize",JSON.stringify(ie)),ie)),close(){Hn(0,0,"close")},getId:()=>st,getOrigin:()=>(xe("getOrigin"),Pe("getOrigin()","getParentOrigin()"),d),getParentOrigin:()=>d,getPageInfo(e){if(typeof e===q)return $t=e,Hn(0,0,S),void Re("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ge(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Hn(0,0,O),()=>{St=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){Pe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ge(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ye.findTarget(e)},reset(){!function(){const e=Ze;Ze=a,ht||(ht=!0,requestAnimationFrame(()=>{ht=!1})),Fn("reset"),Ze=e}()},setOffsetSize(e){ge(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,it=e,Dn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ge(e,R,"parentIframe.scrollBy(x, y) x"),ge(t,R,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ge(e,R,"parentIframe.scrollTo(x, y) x"),ge(t,R,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ge(e,R,"parentIframe.scrollToOffset(x, y) x"),ge(t,R,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,E)},sendMessage(e,t){t&&ge(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ze=e,on()},setWidthCalculationMethod(e){gt=e,rn()},setTargetOrigin(e){ge(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),mt=e},resize(e,t){void 0!==e&&ge(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ge(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Dn(V,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Pe("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let fn=new Set;function mn(){const e=document.querySelectorAll(`[${x}]`);at=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${T}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{xe("overflowIgnored"),Oe("Ignoring elements with [data-iframe-ignore] > *:\n",n),Me()}),t}(e),Fe=at.size>0,typeof Set.prototype.symmetricDifference===q&&(We=at.symmetricDifference(fn).size>0),fn=at}function pn(){switch(mn(),!0){case!We:return;case at.size>1:Oe("Overflowed Elements:",at);break;case Fe:break;default:Oe("No overflow detected")}Dn(G,"Overflow updated")}function hn(e){const t={root:document.documentElement,side:Ne?F:W};return f=Et(pn,t),f.attachObservers(e),f}function yn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Dn(Q,`Element resized <${function(e){switch(!0){case!he(e):return"";case he(e.id):return`${e.nodeName}#${e.id}`;case he(e.name):return`${e.nodeName} (${e.name}`;case he(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function gn(e){return Ut=new ResizeObserver(yn),Ut.observe(document.body),Ft.add(document.body),Oe("Attached ResizeObserver to body"),m={attachObserverToNonStaticElements:Vt,detachObservers:Ke(Rt,Ut,Ft,qt),disconnect:()=>{Ut.disconnect(),Oe("Detached ResizeObserver")}},m.attachObserverToNonStaticElements(e),m}function bn(e){Xe=!e,Dn(X,"Visibility changed")}const vn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return Oe("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;xe("addObservers");const t=vn(e);f.attachObservers(t),m.attachObserverToNonStaticElements(t),Me()},wn=e=>{if(0===e.size)return;xe("removeObservers");const t=vn(e);f.detachObservers(t),m.detachObservers(t),Me()};function $n(e){!function({addedNodes:e,removedNodes:t}){xe("contentMutated"),Jt(),At(),mn(),Me(),wn(t),zn(e)}(e),Dn(Y,"Mutation Observed")}function Sn(){const e=kn(document.documentElement);var t;t=[bt($n),hn(e),Pt(),gn(e),Zt(bn)],s.push(...t.map(e=>e.disconnect))}function On(e){performance.mark(Mt);const t=pe(e);let n=1,o=document.documentElement,r=He?0:document.documentElement.getBoundingClientRect().bottom;const i=He?dt:Fe?Array.from(at):kn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Oe(`${t} position calculated from:`,o),Oe(`Checked %c${i.length}%c elements`,h,y),performance.mark(kt,{detail:{hasTags:He,len:i.length,logging:tt,Side:t}}),r}const En=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Mn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(Mn),jn={height:0,width:0},xn={height:0,width:0},Tn=[h,y,h];function An(e){function t(){return xn[o]=r,jn[o]=s,Math.max(r,1)}const n=e===Cn,o=e.label,r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let l=1;switch(!0){case!e.enabled():return Math.max(s,1);case He:Oe("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Fe&&Le&&0===xn[o]&&0===jn[o]:Oe(`Initial page size values: ${c}`,...Tn),l=t();break;case ht&&r===xn[o]&&s===jn[o]:Oe(`Size unchanged: ${c}`,...Tn),l=Math.max(r,s);break;case 0===r&&0!==s:Oe(`Page is hidden: ${c}`,...Tn),l=s;break;case!Fe&&r!==xn[o]&&s<=jn[o]:Oe(`New <html> size: ${c} `,...Tn),Oe(`Previous <html> size: %c${xn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Fe&&r<xn[o]:Oe(`<html> size decreased: ${c}`,...Tn),l=t();break;case s===a||s===i:Oe(`<html> size equals page size: ${c}`,...Tn),l=t();break;case r>s:Oe(`Page size < <html> size: ${c}`,...Tn),l=t();break;case Fe:Oe("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:Oe(`Using <html> size: ${c}`,...Tn),l=t()}return Oe(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&Oe(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Cn={label:A,enabled:()=>Ne,getOffset:()=>rt,auto:()=>An(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>o.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...En(Cn)),min:()=>Math.min(...En(Cn)),grow:()=>Cn.max(),lowestElement:()=>On(F),taggedElement:()=>On(F)},In={label:C,enabled:()=>qe,getOffset:()=>it,auto:()=>An(In),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...En(In)),min:()=>Math.min(...En(In)),rightMostElement:()=>On(W),scroll:()=>Math.max(In.bodyScroll(),In.documentElementScroll()),taggedElement:()=>On(W)},Nn=(e,t)=>!(Math.abs(e-t)<=pt);function Pn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ne?function(e){const t=ne(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return Ee(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const Bn=de(()=>Ie(ce(4)));let qn,Ln=!1;const Dn=je((e,t,n,o,r)=>{switch(xe(e),!0){case!0===Xe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(qn);break;case!0===Rn&&e!==G:Ae();break;case!ie&&!(e in J):Oe("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),qn=requestAnimationFrame(()=>{Rn=!1,xe("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??Pn(Cn,Ze),a=o??Pn(In,gt);switch(Ne&&Nn(Ue,i)||qe&&Nn(yt,a)?U:e){case z:case H:case U:Ue=i,yt=a;case _:Wn(Ue,yt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),Oe("No change in content size detected")}}(e,0,n,o,r)}Me()});function Fn(e){Ue=Cn[Ze](),yt=In[gt](),Hn(Ue,yt,e)}function Wn(e,t,o,r,i){nt<-1||(void 0!==i||(i=mt),function(){const a=`${st}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(lt)try{window.parent.iframeParentListener(K+a)}catch(e){if(1!==nt)throw e;return void Bn()}else ft.postMessage(K+a,i);Oe(`Sending message to parent page via ${lt?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Hn=je((e,t,n,o,r)=>{xe(n),Wn(e,t,n,o,r),Me()}),Un=je(function(e){xe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(v);ft=e.source,d=e.origin,Ot(t),Le=!1,setTimeout(()=>{Ge=!1},128)},reset(){Ge||Fn("resetPage")},resize(){Dn(Z,"Parent window requested size check")},moveToAnchor(){Ye.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();$t?ue($t,n(e)):o(S)},parentInfo(){const e=(r=a(),t(n(r)));var r;St?ue(St,e):o(O)},message(){const e=a();ue(zt,n(e))}},i=()=>e.data.split("]")[1].split(v)[0],a=()=>e.data.slice(e.data.indexOf(v)+1),s=()=>e.data.split(v)[2]in{true:1,false:1};function c(){const t=i();xe(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Ce(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Le)return s()?(Te(i()),xe(z),void r.init()):void 0;c()}()});let Vn=!1;const Zn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Jn(){if("loading"===document.readyState||!Le||Vn)return;const{parent:e,top:t}=window;xe("ready"),Zn(e),e!==t&&Zn(t),Vn=!0}"iframeChildListener"in window?Ce("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),te(window,w,Un),te(document,D,Jn),Jn())}()});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/child",
3
- "version": "5.5.6",
3
+ "version": "5.5.7",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {