iframe-resizer 5.5.4-beta.3 → 5.5.4

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
@@ -1,6 +1,6 @@
1
1
  <p align="center"><br>
2
2
  <img src="https://iframe-resizer.com/logo-full.svg" alt="iframe-resizer - keep iframes sized to their content" title="" width="90%" style="width: 90%">
3
- <p><br>
3
+ <p>
4
4
 
5
5
  This package is a legacy version of __[iframe-resizer](https://iframe-resizer.com)__. This project has now been split into separate packages for the _parent_ and _child_ pages.
6
6
 
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.4-beta.3 (cjs) - 2025-08-27
4
+ * @module iframe-resizer/legacy 5.5.4 (cjs) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.4-beta.3 (esm) - 2025-08-27
4
+ * @module iframe-resizer/legacy 5.5.4 (esm) - 2025-08-27
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.4-beta.3 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.4 (iife)
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,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !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:!0,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:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(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.4-beta.3",b="iframeResizer",v=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k="manualResize",T="parentResize",I={[k]:1,[T]:1},j="setOffsetSize",x="resizeObserver",A="overflowObserver",C="mutationObserver",P="visibilityObserver",N="No change in content size detected",R="init",q=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),L=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)},F=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["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."],V=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>F(W[e]);var Z=e=>{const t=e[F(D[0])]||e[F(D[1])]||e[F(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(F(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const 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,G=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e;const K=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)};let ee=!0,te=b;const ne=(oe=function(n={}){const l={},d={},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 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?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 w(){""===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&&(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,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},oe?.__esModule?oe.default:oe);var oe;const re=ne({label:`${b}(child)`});const ie=e=>(...t)=>!ee||re[e](...t),ae=ie("log"),se=ae,ce=ie("debug");const{assert:le,endAutoGroup:de,error:ue,errorBoundary:fe,event:me,label:pe,purge:he,warn:ge}=re,ye=e=>{return re.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},be=ye,ve=(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)=>ye(t)),ze=ve("Method"),we=ve("Method","replaced with"),$e=ve("Option"),Se=["min-height","min-width","max-height","max-width"],Oe=new Set,Me=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ee=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Ee(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Te({href:e}){Oe.has(e)||(ae("Unable to access stylesheet:",e),Oe.add(e))}const Ie=(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:Ee(e,t)}}(e,t),je=(e,t)=>{const{source:n,value:o}=Ie(e,t),r=Me(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 xe(){for(const e of[document.documentElement,document.body])for(const t of Se)ae(`Checking <${Me(e)}> for blocking CSS: ${t}`),ke(e,t)&&je(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),Ce=Ae(e=>"true"===e),Pe=Ae(Number),Ne=(e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Re=Ne("attached to"),qe=((e="")=>t=>n=>{n.size>0&&ue(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Be=Ne("detached from"),Le=(t,n=!0)=>o=>{o>0&&se(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Fe=(e,t,n,o)=>{const r=Be(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()}},De="Mutation",We=new Set,Ve=new Set,He=new Set,Ue=[],Ze={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Je,_e=1,Qe=!1,Ge=0;const Ye=Ne("added")(De),Xe=Ne("removed (page)")(De),Ke=Ne("removed (added)")(De),et=e=>e.nodeType!==Node.ELEMENT_NODE||q.has(e.tagName.toLowerCase());function tt(e){const t=e.addedNodes;for(const e of t)et(e)||We.add(e)}function nt(e){const t=e.removedNodes;for(const e of t)et(e)||(We.has(e)?(We.delete(e),He.add(e)):Ve.add(e))}const ot=e=>{se("Mutations:",e);for(const t of e)tt(t),nt(t);Ye(We),Xe(Ve),Ke(He),He.clear()};const rt=e=>()=>{const t=performance.now(),n=t-Ge,o=16*_e+++2;if(n>o&&n<200)return me("mutationThrottled"),se("Update delayed due to heavy workload on the callStack"),se(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Je,16*_e),void(Ge=t);_e=1,Ue.forEach(ot),Ue.length=0,Qe=!1,Ve.size>0&&ae(`Detected %c${Ve.size} %cremoved element${Ve.size>1?"s":""}`,h,g),We.size>0&&ae(`Found %c${We.size} %cnew element${We.size>1?"s":""}`,h,g),e({addedNodes:We,removedNodes:Ve}),We.clear(),Ve.clear()};function it(e){Ue.push(e),Qe||(Ge=performance.now(),Qe=!0,requestAnimationFrame(Je))}function at(e){const t=new window.MutationObserver(it),n=document.body||document.documentElement;return Je=rt(e),t.observe(n,Ze),se("Attached MutationObserver to body"),{...t,disconnect:()=>{We.clear(),Ve.clear(),Ue.length=0,t.disconnect(),se("Detached MutationObserver")}}}const st="Overflow",ct=Le(st),lt=Le(st,!1),dt=Re(st),ut=qe(st),ft=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,mt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,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)&&!ft(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));ut(t),dt(n),ct(o),n.clear(),t.clear()},detachObservers:Fe(st,c,l,lt),disconnect:()=>{c.disconnect(),se("Detached OverflowObserver")}}},pt="--ifr-start",ht="--ifr-end",gt="--ifr-measure",yt=[];let bt,vt={},zt=0;function wt(){try{performance.clearMarks(pt),performance.clearMarks(ht),performance.clearMeasures(gt)}catch{}}function $t(e){e.getEntries().forEach(e=>{if(e.name===ht)try{const{duration:t}=performance.measure(gt,pt,ht);vt=e.detail,yt.push(t),yt.length>100&&yt.shift()}catch{}})}function St(){se("Attached PerformanceObserver to page");const e=new PerformanceObserver($t);return e.observe({entryTypes:["mark"]}),bt=setInterval(()=>{if(yt.length<10)return;if(vt.hasTags&&vt.len<25)return;yt.sort();const e=Math.min(yt.reduce((e,t)=>e+t,0)/yt.length,yt[Math.floor(yt.length/2)]),t=G(e);t>zt&&(zt=t,me("performanceObserver"),ae("Mean time:",G(yt[Math.floor(yt.length/2)])),ae("Median time:",G(yt.reduce((e,t)=>e+t,0)/yt.length)),ae("Average time:",t),ae("Max time:",G(Math.max(...yt)))),wt(),e<=4||(clearInterval(bt),ye(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${G(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(),se("Detached PerformanceObserver")}}}const Ot="Resize",Mt=Le(Ot),Et=Le(Ot,!1),kt=Re(Ot),Tt=qe(Ot),It=new WeakSet,jt=new Set,xt=new Set;let At;function Ct(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)?jt.add(n):(At.observe(n),It.add(n),xt.add(n),t+=1))}Tt(jt),kt(xt),Mt(t),xt.clear(),jt.clear()}function Pt(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 Nt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Rt=Nt("function"),qt=Nt("number"),Bt=Nt("string");"undefined"!=typeof window&&function(){const o={height:()=>(ge("Custom height calculation function not defined"),vn.auto()),width:()=>(ge("Custom width calculation function not defined"),zn.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="[iFrameSizer]",c=[],l="scroll";let d,u,f,m,p,L,W,H,ne,oe=!0,ie="",he=0,ve="",Se="",Oe=!1,Me=!0,Ee=!1,ke=!0,Te=!1,Ie=!1,je=!0,Ae=!1,Ne=1,Re=a,qe="",Be=!0,Le={},De=!1,We=!1,Ve=!1,He=0,Ue=!1,Ze=0,Je=0,_e=new Set,Qe="",Ge="child",Ye=!1,Xe="",Ke=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=l,st=window,ct=()=>{ge("onMessage function not defined")},lt=()=>{},dt=null,ut=null;function ft(e){var t;!function(e){Qe=e[0]??Qe,he=Pe(e[1])??he,Ee=Ce(e[2])??Ee,Ve=Ce(e[3])??Ve,oe=Ce(e[6])??oe,ve=e[7]??ve,Re=e[8]??Re,ie=e[9]??ie,Se=e[10]??Se,nt=Pe(e[11])??nt,Le.enable=Ce(e[12])??!1,Ge=e[13]??Ge,it=e[14]??it,Ue=Ce(e[15])??Ue,Ze=Pe(e[16])??Ze,Je=Pe(e[17])??Je,Me=Ce(e[18])??Me,d=e[19]??d,H=e[20]??H,He=Pe(e[21])??He,We=Ce(e[23])??We}(e),te=(t={id:Qe,enabled:Ve,expand:We}).id||b,re.label(`${te}`),re.expand(t.expand),ee=t.enabled,ae(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){ae("Reading data from page:",Object.keys(e)),ne=Rt(e,"onBeforeResize")??ne,ct=Rt(e,"onMessage")??ct,lt=Rt(e,"onReady")??lt,"number"==typeof e?.offset&&($e("offset","offsetSize"),Me&&(Ze=qt(e,"offset")??Ze),Ee&&(Je=qt(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(Me&&(Ze=qt(e,"offsetSize")??Ze),Ee&&(Je=qt(e,"offsetSize")??Je)),u=Bt(e,F(D[0]))??u,qe=Bt(e,"ignoreSelector")??qe,Xe=Bt(e,"sizeSelector")??Xe,tt=Bt(e,"targetOrigin")??tt,Re=e?.heightCalculationMethod||Re,it=e?.widthCalculationMethod||it}function t(e,t){return"function"==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.`),o[t]=e,e="custom"),e}if(1===He)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Re=t(Re,"height"),it=t(it,"width"),se(`Set targetOrigin for parent: %c${tt}`,h))}(),[$t,kt,Zt,zt,Mt,Ht,Ut,Wt,wt,bt,Oe?Q:xe,xt,Yt,Gt,Qt,Nt,()=>Tt("background",ie),()=>Tt("padding",Se),Oe?Q:Lt,_t,Jt,dn,gt].forEach(e=>{try{e()}catch(e){if(He<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</>"),ue(e)}}),yt(_(lt)),ae("Initialization complete"),kn(R,"Init message from host page",void 0,void 0,`${y}:${He}`),document.title&&""!==document.title&&jn(0,0,"title",document.title)}function gt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),jn(0,0,"beforeUnload")})}function yt(e){"complete"===document.readyState?J(e):B(document,"readystatechange",()=>yt(e))}function bt(){Ke=document.querySelectorAll(`[${z}]`),Ae=Ke.length>0,ae(`Tagged elements found: %c${Ae}`,h)}let vt=0;function zt(){const n=document.querySelectorAll(`*[${$}]`);return Te=n.length>0,Te&&n.length!==vt&&(function(n){const o=1===n.length?"":"s";ge(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),vt=n.length),Te}function wt(){"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 $t(){H&&""!==H&&"false"!==H?H!==y&&ye(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${H} - Child page: ${y}.\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 Mt(){try{Ye=1===He||"iframeParentListener"in window.parent}catch(e){ae("Cross domain iframe detected")}}function kt(){Ee===Me&&(Oe=!0)}function Tt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),se(`Set body ${e}: %c${t}`,h))}function jt(e,t,n){if(""!==n){ae(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))ae(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function xt(){jt("sizeSelector",z,Xe),jt("ignoreSelector",$,qe)}function Nt(){var e,t;void 0===ve&&(ve=`${he}px`),Tt("margin",(e="margin",(t=ve).includes("-")&&(ge(`Negative CSS value ignored for ${e}`),t=""),t))}function Lt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),ae("Set HTML & body height: %cauto !important",h)}function Ft(e){({add(t){function n(){kn(e.eventName,e.eventType)}i[t]=n,B(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),ae(`${Y(e.method)} event listener: %c${e.eventType}`,h)}function Dt(e){Ft({method:e,eventType:"After Print",eventName:"afterprint"}),Ft({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ft({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Wt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!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 Vt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ge(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&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 ${H?"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`),ae(`Set ${o} calculation method: %c${e}`,h),e}function Ht(){Re=Vt(Re,a,vn)}function Ut(){it=Vt(it,l,zn)}function Zt(){const t=He,n=Z({key:d}),o=Z({key:u});if(He=Math.max(n,o),He<0){if(He=Math.min(n,o),ye(`${U(He+2)}${U(2)}`),X(H))throw U(He+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(H)||t>-1&&He>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${te} %ciframe-resizer ${t}`,ee||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>F(V[e]))(He)})`,He),He<2&&be(U(3)),sessionStorage.setItem("ifr",y))}function Jt(){!0!==oe&&ae("Auto Resize disabled"),Dt("add"),c.push(()=>Dt("remove"))}function _t(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Qt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(ae(`In page link (#${n}) not found in iFrame, so sending to parent`),jn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);ae(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),jn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Le.enable?1===He?ye("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(ae("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128)):ae("In page linking not enabled"),Le={findTarget:t}}function Gt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){ae(`Add event listener: %c${n}`,h),B(window.document,t,e)}!0===Ue&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Yt(){1!==He&&(st.parentIframe=Object.freeze({autoResize:e=>(K(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ee&&!1===Me?(me(M),ye("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask(()=>kn(M,"Auto Resize enabled"))):!1===e&&!0===oe&&(oe=!1),jn(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(ze("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return dt=e,jn(0,0,"pageInfo"),void we("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(K(e,"function","parentIframe.getParentProps(callback) callback"),ut=e,jn(0,0,"parentInfo"),()=>{ut=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ze("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){K(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Le.findTarget(e)},reset(){!function(){const e=Re;Re=a,ae(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?ae("TriggerLock blocked calculation"):(ot=!0,ce("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,ce("Trigger event lock off")})),Tn("reset"),Re=e}()},setOffsetSize(e){K(e,"number","parentIframe.setOffsetSize(offset) offset"),Ze=e,Je=e,kn(j,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){K(e,"number","parentIframe.scrollBy(x, y) x"),K(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){K(e,"number","parentIframe.scrollTo(x, y) x"),K(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){K(e,"number","parentIframe.scrollToOffset(x, y) x"),K(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,"scrollToOffset")},sendMessage(e,t){t&&K(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Re=e,Ht()},setWidthCalculationMethod(e){it=e,Ut()},setTargetOrigin(e){K(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ae(`Set targetOrigin: %c${e}`,h),tt=e},resize(e,t){void 0!==e&&K(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&K(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),kn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ze("size()","resize()"),this.resize(e,t)}}),st.parentIFrame=st.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${w}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{me("overflowIgnored"),se("Ignoring elements with [data-iframe-ignore] > *:\n",n),de()}),t}(e),Ie=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(je=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!je:return;case _e.size>1:se("Overflowed Elements:",_e);break;case Ie:break;default:se("No overflow detected")}kn(A,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:Me?S:O};return m=mt(en,t),m.attachObservers(e),m}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;kn(x,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return At=new ResizeObserver(nn),At.observe(document.body),It.add(document.body),se("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:Ct,detachObservers:Fe(Ot,At,It,Et),disconnect:()=>{At.disconnect(),se("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function rn(e){ae(`Visible: %c${e}`,h),De=!e,kn(P,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of pn(n))t.add(e)}return se("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;me("addObservers");const t=an(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),de()},cn=e=>{if(0===e.size)return;me("removeObservers");const t=an(e);m.detachObservers(t),p.detachObservers(t),de()};function ln(e){!function({addedNodes:e,removedNodes:t}){me("contentMutated"),xt(),bt(),Kt(),de(),cn(t),sn(e)}(e),kn(C,"Mutation Observed")}function dn(){const e=pn(document.documentElement);var t;ae("Attaching Observers"),t=[at(ln),tn(e),St(),on(e),Pt(rn)],c.push(...t.map(e=>e.disconnect))}function un(e){performance.mark(pt);const t=Y(e);let n=1,o=document.documentElement,r=Ae?0:document.documentElement.getBoundingClientRect().bottom;const i=Ae?Ke:Ie?Array.from(_e):pn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return se(`${t} position calculated from:`,o),se(`Checked %c${i.length}%c elements`,h,g),performance.mark(ht,{detail:{hasTags:Ae,len:i.length,logging:Ve,Side:t}}),r}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(q).map(e=>`:not(${e})`).join("")}`,pn=e=>e.querySelectorAll(mn),hn={height:0,width:0},gn={height:0,width:0},yn=[h,g,h];function bn(e){function t(){return gn[o]=r,hn[o]=s,Math.max(r,1)}const n=e===vn,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=0;switch(!0){case!e.enabled():return Math.max(s,1);case Ae:se("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&ke&&0===gn[o]&&0===hn[o]:se(`Initial page size values: ${c}`,...yn),l=t();break;case ot&&r===gn[o]&&s===hn[o]:se(`Size unchanged: ${c}`,...yn),l=Math.max(r,s);break;case 0===r&&0!==s:se(`Page is hidden: ${c}`,...yn),l=s;break;case!Ie&&r!==gn[o]&&s<=hn[o]:se(`New <html> size: ${c} `,...yn),se(`Previous <html> size: %c${gn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<gn[o]:se(`<html> size decreased: ${c}`,...yn),l=t();break;case s===a||s===i:se(`<html> size equals page size: ${c}`,...yn),l=t();break;case r>s:se(`Page size < <html> size: ${c}`,...yn),l=t();break;case Ie:se("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:se(`Using <html> size: ${c}`,...yn),l=t()}return se(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&se(`Page offsetSize: %c${t}px`,h),t}(e),l}const vn={label:"height",enabled:()=>Me,getOffset:()=>Ze,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.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(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>un(S),taggedElement:()=>un(S)},zn={label:"width",enabled:()=>Ee,getOffset:()=>Je,auto:()=>bn(zn),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(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>un(O),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>un(O)},wn=(e,t)=>!(Math.abs(e-t)<=nt);function $n(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 le(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Sn=!1;const On=_(()=>be(U(4)));let Mn,En=!1;const kn=fe((e,t,n,o,r)=>{switch(me(e),!0){case!0===De:if(!0===En)break;ae("Iframe hidden - Ignored resize request"),En=!0,Sn=!1,cancelAnimationFrame(Mn);break;case!0===Sn:break;case!oe&&!(e in I):se("Resizing disabled");break;default:En=!1,Sn=!0,W=performance.now(),L=!0,Mn=requestAnimationFrame(()=>{Sn=!1,me("requestAnimationFrame"),ce(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??$n(vn,Re),a=o??$n(zn,it),s=Me&&wn(Ne,i)||Ee&&wn(rt,a)?E:e;switch(ae(`Resize event: %c${t}`,h),s){case R:case M:case E:Ne=i,rt=a;case j:In(Ne,rt,e,r);break;case A:case C:case x:case P:ae(N);break;default:se(N)}L=!1}(e,t,n,o,r)}de()});function Tn(e){Ne=vn[Re](),rt=zn[it](),jn(Ne,rt,e)}function In(e,t,o,r,i){He<-1||(void 0!==i?ae(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${Qe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ye)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==He)throw e;return void On()}else et.postMessage(s+a,i);L&&ae(function(){const e=G(performance.now()-W);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),se(`Sending message to parent page via ${Ye?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const jn=fe((e,t,n,o,r)=>{me(n),In(e,t,n,o,r),de()}),xn=fe(function(e){me("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>jn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void ae("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");et=e.source,f=e.origin,ft(t),ke=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?ae("Page reset ignored by init"):(ae("Page size reset by host page"),Tn("resetPage"))},resize(){ae("Resize requested by host page"),kn(T,"Parent window requested size check")},moveToAnchor(){Le.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();ae("PageInfo received from parent:",o(e)),dt?J(dt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());ae("ParentInfo received from parent:",e),ut?J(ut,e):r("parentInfo")},message(){const e=c();ae("onMessage called from parent:%c",h,o(e)),J(ct,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();me(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ge(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ke)return l()?(pe(a()),me(R),void i.init()):void ae(`Ignored message of type "${a()}". Received before initialization.`);d()}()});let An=!1;const Cn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Pn(){if("loading"===document.readyState||!ke||An)return;const{parent:e,top:t}=window;ae("[iFrameResizerChild]Ready"),Cn(e),e!==t&&Cn(t),An=!0}"iframeChildListener"in window?ge("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>xn({data:e,sameOrigin:!0})),B(window,"message",xn),B(document,"readystatechange",Pn),setTimeout(Pn))}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.js.map
20
+ !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:!0,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.4",b="iframeResizer",v=10,w="data-iframe-size",z="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",E="autoResizeEnabled",M=Symbol("sizeChanged"),k="manualResize",j="parentResize",T={[k]:1,[j]:1},x="setOffsetSize",A="resizeObserver",I="overflowObserver",N="mutationObserver",C="visibilityObserver",P="init",R=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),q=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)},L=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["spjluzl","rlf","clyzpvu"],F=["<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"],V=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>L(F[e]);var U=e=>{const t=e[L(D[0])]||e[L(D[1])]||e[L(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=q(L(e));return n in V&&(t=V[n]),t}(n[0]);return 0===o||(e=>e[2]===q(e[0]+e[1]))(n)||(o=-2),o};const Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},_=e=>e,Q=e=>Math.round(1e3*e)/1e3,G=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const X=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${G(t)}`)};let K=!0,ee=b;const te=(ne=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}},ne?.__esModule?ne.default:ne);var ne;const oe=te({label:`${b}(child)`});var re;const ie=(re="log",(...e)=>!K||oe[re](...e));const{assert:ae,endAutoGroup:se,error:ce,errorBoundary:le,event:ue,label:de,purge:fe,warn:me}=oe,pe=e=>{return oe.warn((t=_,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},he=pe,ge=(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)=>pe(t)),ye=ge("Method"),be=ge("Method","replaced with"),ve=ge("Option"),we=["min-height","min-width","max-height","max-width"],ze=new Set,$e=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=$e(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Oe({href:e}){ze.has(e)||ze.add(e)}const Ee=(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){Oe(n)}return{source:"cross-origin stylesheet",value:$e(e,t)}}(e,t),Me=(e,t)=>{const{source:n,value:o}=Ee(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);pe(`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 ke(){for(const e of[document.documentElement,document.body])for(const t of we)Se(e,t)&&Me(e,t)}const je=e=>t=>void 0===t?void 0:e(t),Te=je(e=>"true"===e),xe=je(Number),Ae=e=>e=>{e.size},Ie=((e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ne=e=>e=>{e.size},Ce=(t,n=!0)=>o=>{o>0&&ie(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Pe=(e,t,n,o)=>{const r=Ne(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()}},Re=new Set,Be=new Set,qe=new Set,Le=[],De={attributes:!0,attributeFilter:[$,w],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Fe,We=1,Ve=!1,He=0;const Ue=e=>{e.size},Ze=e=>{e.size},Je=e=>{e.size},_e=e=>e.nodeType!==Node.ELEMENT_NODE||R.has(e.tagName.toLowerCase());function Qe(e){const t=e.addedNodes;for(const e of t)_e(e)||Re.add(e)}function Ge(e){const t=e.removedNodes;for(const e of t)_e(e)||(Re.has(e)?(Re.delete(e),qe.add(e)):Be.add(e))}const Ye=e=>{ie("Mutations:",e);for(const t of e)Qe(t),Ge(t);Ue(Re),Ze(Be),Je(qe),qe.clear()};const Xe=e=>()=>{const t=performance.now(),n=t-He,o=16*We+++2;if(n>o&&n<200)return ue("mutationThrottled"),ie("Update delayed due to heavy workload on the callStack"),ie(`EventLoop busy time: %c${Q(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Fe,16*We),void(He=t);We=1,Le.forEach(Ye),Le.length=0,Ve=!1,Be.size,Re.size,e({addedNodes:Re,removedNodes:Be}),Re.clear(),Be.clear()};function Ke(e){Le.push(e),Ve||(He=performance.now(),Ve=!0,requestAnimationFrame(Fe))}function et(e){const t=new window.MutationObserver(Ke),n=document.body||document.documentElement;return Fe=Xe(e),t.observe(n,De),ie("Attached MutationObserver to body"),{...t,disconnect:()=>{Re.clear(),Be.clear(),Le.length=0,t.disconnect(),ie("Detached MutationObserver")}}}const tt="Overflow",nt=Ce(tt),ot=Ce(tt,!1),rt=Ae(tt),it=Ie(tt),at=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,st=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||_,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(z,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)&&!at(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));it(t),rt(n),nt(o),n.clear(),t.clear()},detachObservers:Pe(tt,c,l,ot),disconnect:()=>{c.disconnect(),ie("Detached OverflowObserver")}}},ct="--ifr-start",lt="--ifr-end",ut="--ifr-measure",dt=[];let ft,mt={},pt=0;function ht(){try{performance.clearMarks(ct),performance.clearMarks(lt),performance.clearMeasures(ut)}catch{}}function gt(e){e.getEntries().forEach(e=>{if(e.name===lt)try{const{duration:t}=performance.measure(ut,ct,lt);mt=e.detail,dt.push(t),dt.length>100&&dt.shift()}catch{}})}function yt(){ie("Attached PerformanceObserver to page");const e=new PerformanceObserver(gt);return e.observe({entryTypes:["mark"]}),ft=setInterval(()=>{if(dt.length<10)return;if(mt.hasTags&&mt.len<25)return;dt.sort();const e=Math.min(dt.reduce((e,t)=>e+t,0)/dt.length,dt[Math.floor(dt.length/2)]),t=Q(e);t>pt&&(pt=t,ue("performanceObserver")),ht(),e<=4||(clearInterval(ft),pe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${mt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ht(),clearInterval(ft),e.disconnect(),ie("Detached PerformanceObserver")}}}const bt="Resize",vt=Ce(bt),wt=Ce(bt,!1),zt=Ae(bt),$t=Ie(bt),St=new WeakSet,Ot=new Set,Et=new Set;let Mt;function kt(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)?Ot.add(n):(Mt.observe(n),St.add(n),Et.add(n),t+=1))}$t(Ot),zt(Et),vt(t),Et.clear(),Ot.clear()}function jt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ie("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),ie("Detached VisibilityObserver")}}}const Tt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},xt=Tt("function"),At=Tt("number"),It=Tt("string");"undefined"!=typeof window&&function(){const o={height:()=>(me("Custom height calculation function not defined"),pn.auto()),width:()=>(me("Custom width calculation function not defined"),hn.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="[iFrameSizer]",c=[],l="scroll";let u,d,f,m,p,q,F,V=!0,Q="",te=0,ne="",re="",ge=!1,we=!0,ze=!1,$e=!0,Se=!1,Oe=!1,Ee=!0,Me=!1,je=1,Ae=a,Ie="",Ne=!0,Ce={},Re=!1,Be=!1,qe=!1,Le=0,De=!1,Fe=0,We=0,Ve=new Set,He="",Ue="child",Ze=!1,Je="",_e=[],Qe=window.parent,Ge="*",Ye=0,Xe=!1,Ke=1,tt=l,nt=window,ot=()=>{me("onMessage function not defined")},rt=()=>{},it=null,at=null;function ut(e){var t;!function(e){He=e[0]??He,te=xe(e[1])??te,ze=Te(e[2])??ze,qe=Te(e[3])??qe,V=Te(e[6])??V,ne=e[7]??ne,Ae=e[8]??Ae,Q=e[9]??Q,re=e[10]??re,Ye=xe(e[11])??Ye,Ce.enable=Te(e[12])??!1,Ue=e[13]??Ue,tt=e[14]??tt,De=Te(e[15])??De,Fe=xe(e[16])??Fe,We=xe(e[17])??We,we=Te(e[18])??we,u=e[19]??u,q=e[20]??q,Le=xe(e[21])??Le,Be=Te(e[23])??Be}(e),ee=(t={id:He,enabled:qe,expand:Be}).id||b,oe.label(`${ee}`),oe.expand(t.expand),K=t.enabled,function(){function e(e){F=xt(e,"onBeforeResize")??F,ot=xt(e,"onMessage")??ot,rt=xt(e,"onReady")??rt,"number"==typeof e?.offset&&(ve("offset","offsetSize"),we&&(Fe=At(e,"offset")??Fe),ze&&(We=At(e,"offset")??We)),"number"==typeof e?.offsetSize&&(we&&(Fe=At(e,"offsetSize")??Fe),ze&&(We=At(e,"offsetSize")??We)),d=It(e,L(D[0]))??d,Ie=It(e,"ignoreSelector")??Ie,Je=It(e,"sizeSelector")??Je,Ge=It(e,"targetOrigin")??Ge,Ae=e?.heightCalculationMethod||Ae,tt=e?.widthCalculationMethod||tt}function t(e,t){return"function"==typeof e&&(pe(`<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===Le)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ae=t(Ae,"height"),tt=t(tt,"width"),ie(`Set targetOrigin for parent: %c${Ge}`,h))}(),[vt,$t,Ft,ht,zt,Lt,Dt,Bt,gt,mt,ge?_:ke,Tt,Zt,Ut,Ht,Nt,()=>Ot("background",Q),()=>Ot("padding",re),ge?_:Ct,Vt,Wt,rn,dt].forEach(e=>{try{e()}catch(e){if(Le<0)throw e;pe("<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</>"),ce(e)}}),ft(J(rt)),$n(P,"Init message from host page",void 0,void 0,`${y}:${Le}`),document.title&&""!==document.title&&En(0,0,"title",document.title)}function dt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),En(0,0,"beforeUnload")})}function ft(e){"complete"===document.readyState?Z(e):B(document,"readystatechange",()=>ft(e))}function mt(){_e=document.querySelectorAll(`[${w}]`),Me=_e.length>0}let pt=0;function ht(){const n=document.querySelectorAll(`*[${$}]`);return Se=n.length>0,Se&&n.length!==pt&&(function(n){const o=1===n.length?"":"s";me(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),pt=n.length),Se}function gt(){"BackCompat"===document.compatMode&&pe("<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 vt(){q&&""!==q&&"false"!==q?q!==y&&pe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${q} - Child page: ${y}.\n`):pe("<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{Ze=1===Le||"iframeParentListener"in window.parent}catch(e){}}function $t(){ze===we&&(ge=!0)}function Ot(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function Et(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Tt(){Et(0,w,Je),Et(0,$,Ie)}function Nt(){var e,t;void 0===ne&&(ne=`${te}px`),Ot("margin",(e="margin",(t=ne).includes("-")&&(me(`Negative CSS value ignored for ${e}`),t=""),t))}function Ct(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}function Pt(e){({add(t){function n(){$n(e.eventName,e.eventType)}i[t]=n,B(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 Rt(e){Pt({method:e,eventType:"After Print",eventName:"afterprint"}),Pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Bt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(w,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&pe("<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 qt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&pe(`<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 ${q?"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 Lt(){Ae=qt(Ae,a,pn)}function Dt(){tt=qt(tt,l,hn)}function Ft(){const t=Le,n=U({key:u}),o=U({key:d});if(Le=Math.max(n,o),Le<0){if(Le=Math.min(n,o),fe(),pe(`${H(Le+2)}${H(2)}`),Y(q))throw H(Le+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(q)||t>-1&&Le>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ee} %ciframe-resizer ${t}`,K||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>L(W[e]))(Le)})`,Le),Le<2&&he(H(3)),sessionStorage.setItem("ifr",y))}function Wt(){Rt("add"),c.push(()=>Rt("remove"))}function Vt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Ht(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?En(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);En(n.y,n.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ce.enable&&(1===Le?pe("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")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128))),Ce={findTarget:t}}function Ut(){function e(e){En(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){B(window.document,t,e)}!0===De&&(t("mouseenter"),t("mouseleave"))}function Zt(){1!==Le&&(nt.parentIframe=Object.freeze({autoResize:e=>(X(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ze&&!1===we?(ue(E),pe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===V?(V=!0,queueMicrotask(()=>$n(E,"Auto Resize enabled"))):!1===e&&!0===V&&(V=!1),En(0,0,"autoResize",JSON.stringify(V)),V)),close(){En(0,0,"close")},getId:()=>He,getOrigin:()=>(ye("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return it=e,En(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");it=null,En(0,0,"pageInfoStop")},getParentProps:e=>(X(e,"function","parentIframe.getParentProps(callback) callback"),at=e,En(0,0,"parentInfo"),()=>{at=null,En(0,0,"parentInfoStop")}),getParentProperties(e){ye("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){X(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ce.findTarget(e)},reset(){!function(){const e=Ae;Ae=a,Xe||(Xe=!0,requestAnimationFrame(()=>{Xe=!1})),Sn("reset"),Ae=e}()},setOffsetSize(e){X(e,"number","parentIframe.setOffsetSize(offset) offset"),Fe=e,We=e,$n(x,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){X(e,"number","parentIframe.scrollBy(x, y) x"),X(t,"number","parentIframe.scrollBy(x, y) y"),En(t,e,"scrollBy")},scrollTo(e,t){X(e,"number","parentIframe.scrollTo(x, y) x"),X(t,"number","parentIframe.scrollTo(x, y) y"),En(t,e,"scrollTo")},scrollToOffset(e,t){X(e,"number","parentIframe.scrollToOffset(x, y) x"),X(t,"number","parentIframe.scrollToOffset(x, y) y"),En(t,e,"scrollToOffset")},sendMessage(e,t){t&&X(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),En(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ae=e,Lt()},setWidthCalculationMethod(e){tt=e,Dt()},setTargetOrigin(e){X(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Ge=e},resize(e,t){void 0!==e&&X(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&X(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),$n(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ye("size()","resize()"),this.resize(e,t)}}),nt.parentIFrame=nt.parentIframe)}let Jt=new Set;function _t(){const e=document.querySelectorAll(`[${z}]`);Ve=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ue("overflowIgnored"),ie("Ignoring elements with [data-iframe-ignore] > *:\n",n),se()}),t}(e),Oe=Ve.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ee=Ve.symmetricDifference(Jt).size>0),Jt=Ve}function Qt(){switch(_t(),!0){case!Ee:return;case Ve.size>1:ie("Overflowed Elements:",Ve);break;case Oe:break;default:ie("No overflow detected")}$n(I,"Overflow updated")}function Gt(e){const t={root:document.documentElement,side:we?S:O};return m=st(Qt,t),m.attachObservers(e),m}function Yt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;$n(A,`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 Xt(e){return Mt=new ResizeObserver(Yt),Mt.observe(document.body),St.add(document.body),ie("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:kt,detachObservers:Pe(bt,Mt,St,wt),disconnect:()=>{Mt.disconnect(),ie("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function Kt(e){Re=!e,$n(C,"Visibility changed")}const en=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of ln(n))t.add(e)}return ie("Inspecting:\n",t),t},tn=e=>{if(0===e.size)return;ue("addObservers");const t=en(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),se()},nn=e=>{if(0===e.size)return;ue("removeObservers");const t=en(e);m.detachObservers(t),p.detachObservers(t),se()};function on(e){!function({addedNodes:e,removedNodes:t}){ue("contentMutated"),Tt(),mt(),_t(),se(),nn(t),tn(e)}(e),$n(N,"Mutation Observed")}function rn(){const e=ln(document.documentElement);var t;t=[et(on),Gt(e),yt(),Xt(e),jt(Kt)],c.push(...t.map(e=>e.disconnect))}function an(e){performance.mark(ct);const t=G(e);let n=1,o=document.documentElement,r=Me?0:document.documentElement.getBoundingClientRect().bottom;const i=Me?_e:Oe?Array.from(Ve):ln(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ie(`${t} position calculated from:`,o),ie(`Checked %c${i.length}%c elements`,h,g),performance.mark(lt,{detail:{hasTags:Me,len:i.length,logging:qe,Side:t}}),r}const sn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],cn=`* ${Array.from(R).map(e=>`:not(${e})`).join("")}`,ln=e=>e.querySelectorAll(cn),un={height:0,width:0},dn={height:0,width:0},fn=[h,g,h];function mn(e){function t(){return dn[o]=r,un[o]=s,Math.max(r,1)}const n=e===pn,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=0;switch(!0){case!e.enabled():return Math.max(s,1);case Me:ie("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Oe&&$e&&0===dn[o]&&0===un[o]:ie(`Initial page size values: ${c}`,...fn),l=t();break;case Xe&&r===dn[o]&&s===un[o]:ie(`Size unchanged: ${c}`,...fn),l=Math.max(r,s);break;case 0===r&&0!==s:ie(`Page is hidden: ${c}`,...fn),l=s;break;case!Oe&&r!==dn[o]&&s<=un[o]:ie(`New <html> size: ${c} `,...fn),ie(`Previous <html> size: %c${dn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Oe&&r<dn[o]:ie(`<html> size decreased: ${c}`,...fn),l=t();break;case s===a||s===i:ie(`<html> size equals page size: ${c}`,...fn),l=t();break;case r>s:ie(`Page size < <html> size: ${c}`,...fn),l=t();break;case Oe:ie("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:ie(`Using <html> size: ${c}`,...fn),l=t()}return ie(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ie(`Page offsetSize: %c${t}px`,h),t}(e),l}const pn={label:"height",enabled:()=>we,getOffset:()=>Fe,auto:()=>mn(pn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pn.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(...sn(pn)),min:()=>Math.min(...sn(pn)),grow:()=>pn.max(),lowestElement:()=>an(S),taggedElement:()=>an(S)},hn={label:"width",enabled:()=>ze,getOffset:()=>We,auto:()=>mn(hn),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(...sn(hn)),min:()=>Math.min(...sn(hn)),rightMostElement:()=>an(O),scroll:()=>Math.max(hn.bodyScroll(),hn.documentElementScroll()),taggedElement:()=>an(O)},gn=(e,t)=>!(Math.abs(e-t)<=Ye);function yn(e,t){const n=e[t](),o=e.enabled()&&void 0!==F?function(e){const t=F(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 ae(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let bn=!1;const vn=J(()=>he(H(4)));let wn,zn=!1;const $n=le((e,t,n,o,r)=>{switch(ue(e),!0){case!0===Re:if(!0===zn)break;zn=!0,bn=!1,cancelAnimationFrame(wn);break;case!0===bn:fe();break;case!V&&!(e in T):ie("Resizing disabled");break;default:zn=!1,bn=!0,performance.now(),wn=requestAnimationFrame(()=>{bn=!1,ue("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??yn(pn,Ae),a=o??yn(hn,tt);switch(we&&gn(je,i)||ze&&gn(Ke,a)?M:e){case P:case E:case M:je=i,Ke=a;case x:On(je,Ke,e,r);break;case I:case N:case A:case C:fe();break;default:fe(),ie("No change in content size detected")}}(e,0,n,o,r)}se()});function Sn(e){je=pn[Ae](),Ke=hn[tt](),En(je,Ke,e)}function On(e,t,o,r,i){Le<-1||(void 0!==i||(i=Ge),function(){const a=`${He}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ze)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Le)throw e;return void vn()}else Qe.postMessage(s+a,i);ie(`Sending message to parent page via ${Ze?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const En=le((e,t,n,o,r)=>{ue(n),On(e,t,n,o,r),se()}),Mn=le(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>En(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Qe=e.source,f=e.origin,ut(t),$e=!1,setTimeout(()=>{Ne=!1},128)},reset(){Ne||Sn("resetPage")},resize(){$n(j,"Parent window requested size check")},moveToAnchor(){Ce.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();it?Z(it,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;at?Z(at,e):o("parentInfo")},message(){const e=a();Z(ot,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();ue(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||me(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==$e)return c()?(de(i()),ue(P),void r.init()):void 0;l()}()});let kn=!1;const jn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Tn(){if("loading"===document.readyState||!$e||kn)return;const{parent:e,top:t}=window;jn(e),e!==t&&jn(t),kn=!0}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Mn({data:e,sameOrigin:!0})),B(window,"message",Mn),B(document,"readystatechange",Tn),setTimeout(Tn))}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.4-beta.3 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.4 (iife)
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,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !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:!0,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:d}=Object,u=e=>[e,c[e]],f=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(d(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.4-beta.3",b="iframeResizer",v=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),k="manualResize",T="parentResize",I={[k]:1,[T]:1},j="setOffsetSize",x="resizeObserver",A="overflowObserver",C="mutationObserver",P="visibilityObserver",N="No change in content size detected",R="init",q=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),L=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)},F=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["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."],V=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>F(W[e]);var Z=e=>{const t=e[F(D[0])]||e[F(D[1])]||e[F(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=L(F(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===L(e[0]+e[1]))(n)||(o=-2),o};const 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,G=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e;const K=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)};let ee=!0,te=b;const ne=(oe=function(n={}){const l={},d={},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 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?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 w(){""===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&&(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,u),assert:function(e,...t){!0!==e&&$("assert",e,...t)},count:function(e=r){d[e]?d[e]+=1:d[e]=1,$("log",`${e}: ${d[e]}`)},countReset:function(e=r){delete d[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:y,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},oe?.__esModule?oe.default:oe);var oe;const re=ne({label:`${b}(child)`});const ie=e=>(...t)=>!ee||re[e](...t),ae=ie("log"),se=ae,ce=ie("debug");const{assert:le,endAutoGroup:de,error:ue,errorBoundary:fe,event:me,label:pe,purge:he,warn:ge}=re,ye=e=>{return re.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},be=ye,ve=(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)=>ye(t)),ze=ve("Method"),we=ve("Method","replaced with"),$e=ve("Option"),Se=["min-height","min-width","max-height","max-width"],Oe=new Set,Me=e=>e.tagName?e.tagName.toLowerCase():"unknown",Ee=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Ee(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Te({href:e}){Oe.has(e)||(ae("Unable to access stylesheet:",e),Oe.add(e))}const Ie=(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:Ee(e,t)}}(e,t),je=(e,t)=>{const{source:n,value:o}=Ie(e,t),r=Me(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 xe(){for(const e of[document.documentElement,document.body])for(const t of Se)ae(`Checking <${Me(e)}> for blocking CSS: ${t}`),ke(e,t)&&je(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),Ce=Ae(e=>"true"===e),Pe=Ae(Number),Ne=(e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))},Re=Ne("attached to"),qe=((e="")=>t=>n=>{n.size>0&&ue(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Be=Ne("detached from"),Le=(t,n=!0)=>o=>{o>0&&se(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Fe=(e,t,n,o)=>{const r=Be(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()}},De="Mutation",We=new Set,Ve=new Set,He=new Set,Ue=[],Ze={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Je,_e=1,Qe=!1,Ge=0;const Ye=Ne("added")(De),Xe=Ne("removed (page)")(De),Ke=Ne("removed (added)")(De),et=e=>e.nodeType!==Node.ELEMENT_NODE||q.has(e.tagName.toLowerCase());function tt(e){const t=e.addedNodes;for(const e of t)et(e)||We.add(e)}function nt(e){const t=e.removedNodes;for(const e of t)et(e)||(We.has(e)?(We.delete(e),He.add(e)):Ve.add(e))}const ot=e=>{se("Mutations:",e);for(const t of e)tt(t),nt(t);Ye(We),Xe(Ve),Ke(He),He.clear()};const rt=e=>()=>{const t=performance.now(),n=t-Ge,o=16*_e+++2;if(n>o&&n<200)return me("mutationThrottled"),se("Update delayed due to heavy workload on the callStack"),se(`EventLoop busy time: %c${G(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Je,16*_e),void(Ge=t);_e=1,Ue.forEach(ot),Ue.length=0,Qe=!1,Ve.size>0&&ae(`Detected %c${Ve.size} %cremoved element${Ve.size>1?"s":""}`,h,g),We.size>0&&ae(`Found %c${We.size} %cnew element${We.size>1?"s":""}`,h,g),e({addedNodes:We,removedNodes:Ve}),We.clear(),Ve.clear()};function it(e){Ue.push(e),Qe||(Ge=performance.now(),Qe=!0,requestAnimationFrame(Je))}function at(e){const t=new window.MutationObserver(it),n=document.body||document.documentElement;return Je=rt(e),t.observe(n,Ze),se("Attached MutationObserver to body"),{...t,disconnect:()=>{We.clear(),Ve.clear(),Ue.length=0,t.disconnect(),se("Detached MutationObserver")}}}const st="Overflow",ct=Le(st),lt=Le(st,!1),dt=Re(st),ut=qe(st),ft=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,mt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,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)&&!ft(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));ut(t),dt(n),ct(o),n.clear(),t.clear()},detachObservers:Fe(st,c,l,lt),disconnect:()=>{c.disconnect(),se("Detached OverflowObserver")}}},pt="--ifr-start",ht="--ifr-end",gt="--ifr-measure",yt=[];let bt,vt={},zt=0;function wt(){try{performance.clearMarks(pt),performance.clearMarks(ht),performance.clearMeasures(gt)}catch{}}function $t(e){e.getEntries().forEach(e=>{if(e.name===ht)try{const{duration:t}=performance.measure(gt,pt,ht);vt=e.detail,yt.push(t),yt.length>100&&yt.shift()}catch{}})}function St(){se("Attached PerformanceObserver to page");const e=new PerformanceObserver($t);return e.observe({entryTypes:["mark"]}),bt=setInterval(()=>{if(yt.length<10)return;if(vt.hasTags&&vt.len<25)return;yt.sort();const e=Math.min(yt.reduce((e,t)=>e+t,0)/yt.length,yt[Math.floor(yt.length/2)]),t=G(e);t>zt&&(zt=t,me("performanceObserver"),ae("Mean time:",G(yt[Math.floor(yt.length/2)])),ae("Median time:",G(yt.reduce((e,t)=>e+t,0)/yt.length)),ae("Average time:",t),ae("Max time:",G(Math.max(...yt)))),wt(),e<=4||(clearInterval(bt),ye(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${G(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(),se("Detached PerformanceObserver")}}}const Ot="Resize",Mt=Le(Ot),Et=Le(Ot,!1),kt=Re(Ot),Tt=qe(Ot),It=new WeakSet,jt=new Set,xt=new Set;let At;function Ct(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)?jt.add(n):(At.observe(n),It.add(n),xt.add(n),t+=1))}Tt(jt),kt(xt),Mt(t),xt.clear(),jt.clear()}function Pt(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 Nt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Rt=Nt("function"),qt=Nt("number"),Bt=Nt("string");"undefined"!=typeof window&&function(){const o={height:()=>(ge("Custom height calculation function not defined"),vn.auto()),width:()=>(ge("Custom width calculation function not defined"),zn.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="[iFrameSizer]",c=[],l="scroll";let d,u,f,m,p,L,W,H,ne,oe=!0,ie="",he=0,ve="",Se="",Oe=!1,Me=!0,Ee=!1,ke=!0,Te=!1,Ie=!1,je=!0,Ae=!1,Ne=1,Re=a,qe="",Be=!0,Le={},De=!1,We=!1,Ve=!1,He=0,Ue=!1,Ze=0,Je=0,_e=new Set,Qe="",Ge="child",Ye=!1,Xe="",Ke=[],et=window.parent,tt="*",nt=0,ot=!1,rt=1,it=l,st=window,ct=()=>{ge("onMessage function not defined")},lt=()=>{},dt=null,ut=null;function ft(e){var t;!function(e){Qe=e[0]??Qe,he=Pe(e[1])??he,Ee=Ce(e[2])??Ee,Ve=Ce(e[3])??Ve,oe=Ce(e[6])??oe,ve=e[7]??ve,Re=e[8]??Re,ie=e[9]??ie,Se=e[10]??Se,nt=Pe(e[11])??nt,Le.enable=Ce(e[12])??!1,Ge=e[13]??Ge,it=e[14]??it,Ue=Ce(e[15])??Ue,Ze=Pe(e[16])??Ze,Je=Pe(e[17])??Je,Me=Ce(e[18])??Me,d=e[19]??d,H=e[20]??H,He=Pe(e[21])??He,We=Ce(e[23])??We}(e),te=(t={id:Qe,enabled:Ve,expand:We}).id||b,re.label(`${te}`),re.expand(t.expand),ee=t.enabled,ae(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){ae("Reading data from page:",Object.keys(e)),ne=Rt(e,"onBeforeResize")??ne,ct=Rt(e,"onMessage")??ct,lt=Rt(e,"onReady")??lt,"number"==typeof e?.offset&&($e("offset","offsetSize"),Me&&(Ze=qt(e,"offset")??Ze),Ee&&(Je=qt(e,"offset")??Je)),"number"==typeof e?.offsetSize&&(Me&&(Ze=qt(e,"offsetSize")??Ze),Ee&&(Je=qt(e,"offsetSize")??Je)),u=Bt(e,F(D[0]))??u,qe=Bt(e,"ignoreSelector")??qe,Xe=Bt(e,"sizeSelector")??Xe,tt=Bt(e,"targetOrigin")??tt,Re=e?.heightCalculationMethod||Re,it=e?.widthCalculationMethod||it}function t(e,t){return"function"==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.`),o[t]=e,e="custom"),e}if(1===He)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Re=t(Re,"height"),it=t(it,"width"),se(`Set targetOrigin for parent: %c${tt}`,h))}(),[$t,kt,Zt,zt,Mt,Ht,Ut,Wt,wt,bt,Oe?Q:xe,xt,Yt,Gt,Qt,Nt,()=>Tt("background",ie),()=>Tt("padding",Se),Oe?Q:Lt,_t,Jt,dn,gt].forEach(e=>{try{e()}catch(e){if(He<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</>"),ue(e)}}),yt(_(lt)),ae("Initialization complete"),kn(R,"Init message from host page",void 0,void 0,`${y}:${He}`),document.title&&""!==document.title&&jn(0,0,"title",document.title)}function gt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),jn(0,0,"beforeUnload")})}function yt(e){"complete"===document.readyState?J(e):B(document,"readystatechange",()=>yt(e))}function bt(){Ke=document.querySelectorAll(`[${z}]`),Ae=Ke.length>0,ae(`Tagged elements found: %c${Ae}`,h)}let vt=0;function zt(){const n=document.querySelectorAll(`*[${$}]`);return Te=n.length>0,Te&&n.length!==vt&&(function(n){const o=1===n.length?"":"s";ge(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),vt=n.length),Te}function wt(){"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 $t(){H&&""!==H&&"false"!==H?H!==y&&ye(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${H} - Child page: ${y}.\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 Mt(){try{Ye=1===He||"iframeParentListener"in window.parent}catch(e){ae("Cross domain iframe detected")}}function kt(){Ee===Me&&(Oe=!0)}function Tt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),se(`Set body ${e}: %c${t}`,h))}function jt(e,t,n){if(""!==n){ae(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))ae(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function xt(){jt("sizeSelector",z,Xe),jt("ignoreSelector",$,qe)}function Nt(){var e,t;void 0===ve&&(ve=`${he}px`),Tt("margin",(e="margin",(t=ve).includes("-")&&(ge(`Negative CSS value ignored for ${e}`),t=""),t))}function Lt(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),ae("Set HTML & body height: %cauto !important",h)}function Ft(e){({add(t){function n(){kn(e.eventName,e.eventType)}i[t]=n,B(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),ae(`${Y(e.method)} event listener: %c${e.eventType}`,h)}function Dt(e){Ft({method:e,eventType:"After Print",eventName:"afterprint"}),Ft({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ft({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Wt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!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 Vt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(ge(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&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 ${H?"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`),ae(`Set ${o} calculation method: %c${e}`,h),e}function Ht(){Re=Vt(Re,a,vn)}function Ut(){it=Vt(it,l,zn)}function Zt(){const t=He,n=Z({key:d}),o=Z({key:u});if(He=Math.max(n,o),He<0){if(He=Math.min(n,o),ye(`${U(He+2)}${U(2)}`),X(H))throw U(He+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(H)||t>-1&&He>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${te} %ciframe-resizer ${t}`,ee||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>F(V[e]))(He)})`,He),He<2&&be(U(3)),sessionStorage.setItem("ifr",y))}function Jt(){!0!==oe&&ae("Auto Resize disabled"),Dt("add"),c.push(()=>Dt("remove"))}function _t(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Qt(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?(ae(`In page link (#${n}) not found in iFrame, so sending to parent`),jn(0,0,"inPageLink",`#${n}`)):function(t){const o=e(t);ae(`Moving to in page link (%c#${n}%c) at x: %c${o.x}%c y: %c${o.y}`,h,g,h,g,h),jn(o.y,o.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Le.enable?1===He?ye("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):(ae("Setting up location.hash handlers"),function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128)):ae("In page linking not enabled"),Le={findTarget:t}}function Gt(){function e(e){jn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){ae(`Add event listener: %c${n}`,h),B(window.document,t,e)}!0===Ue&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}function Yt(){1!==He&&(st.parentIframe=Object.freeze({autoResize:e=>(K(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ee&&!1===Me?(me(M),ye("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask(()=>kn(M,"Auto Resize enabled"))):!1===e&&!0===oe&&(oe=!1),jn(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){jn(0,0,"close")},getId:()=>Qe,getOrigin:()=>(ze("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return dt=e,jn(0,0,"pageInfo"),void we("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");dt=null,jn(0,0,"pageInfoStop")},getParentProps:e=>(K(e,"function","parentIframe.getParentProps(callback) callback"),ut=e,jn(0,0,"parentInfo"),()=>{ut=null,jn(0,0,"parentInfoStop")}),getParentProperties(e){ze("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){K(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Le.findTarget(e)},reset(){!function(){const e=Re;Re=a,ae(`Reset trigger event: %c${"parentIframe.reset"}`,h),ot?ae("TriggerLock blocked calculation"):(ot=!0,ce("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,ce("Trigger event lock off")})),Tn("reset"),Re=e}()},setOffsetSize(e){K(e,"number","parentIframe.setOffsetSize(offset) offset"),Ze=e,Je=e,kn(j,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){K(e,"number","parentIframe.scrollBy(x, y) x"),K(t,"number","parentIframe.scrollBy(x, y) y"),jn(t,e,"scrollBy")},scrollTo(e,t){K(e,"number","parentIframe.scrollTo(x, y) x"),K(t,"number","parentIframe.scrollTo(x, y) y"),jn(t,e,"scrollTo")},scrollToOffset(e,t){K(e,"number","parentIframe.scrollToOffset(x, y) x"),K(t,"number","parentIframe.scrollToOffset(x, y) y"),jn(t,e,"scrollToOffset")},sendMessage(e,t){t&&K(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),jn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Re=e,Ht()},setWidthCalculationMethod(e){it=e,Ut()},setTargetOrigin(e){K(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ae(`Set targetOrigin: %c${e}`,h),tt=e},resize(e,t){void 0!==e&&K(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&K(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),kn(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ze("size()","resize()"),this.resize(e,t)}}),st.parentIFrame=st.parentIframe)}let Xt=new Set;function Kt(){const e=document.querySelectorAll(`[${w}]`);_e=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{me("overflowIgnored"),se("Ignoring elements with [data-iframe-ignore] > *:\n",n),de()}),t}(e),Ie=_e.size>0,"function"==typeof Set.prototype.symmetricDifference&&(je=_e.symmetricDifference(Xt).size>0),Xt=_e}function en(){switch(Kt(),!0){case!je:return;case _e.size>1:se("Overflowed Elements:",_e);break;case Ie:break;default:se("No overflow detected")}kn(A,"Overflow updated")}function tn(e){const t={root:document.documentElement,side:Me?S:O};return m=mt(en,t),m.attachObservers(e),m}function nn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;kn(x,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function on(e){return At=new ResizeObserver(nn),At.observe(document.body),It.add(document.body),se("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:Ct,detachObservers:Fe(Ot,At,It,Et),disconnect:()=>{At.disconnect(),se("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function rn(e){ae(`Visible: %c${e}`,h),De=!e,kn(P,"Visibility changed")}const an=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of pn(n))t.add(e)}return se("Inspecting:\n",t),t},sn=e=>{if(0===e.size)return;me("addObservers");const t=an(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),de()},cn=e=>{if(0===e.size)return;me("removeObservers");const t=an(e);m.detachObservers(t),p.detachObservers(t),de()};function ln(e){!function({addedNodes:e,removedNodes:t}){me("contentMutated"),xt(),bt(),Kt(),de(),cn(t),sn(e)}(e),kn(C,"Mutation Observed")}function dn(){const e=pn(document.documentElement);var t;ae("Attaching Observers"),t=[at(ln),tn(e),St(),on(e),Pt(rn)],c.push(...t.map(e=>e.disconnect))}function un(e){performance.mark(pt);const t=Y(e);let n=1,o=document.documentElement,r=Ae?0:document.documentElement.getBoundingClientRect().bottom;const i=Ae?Ke:Ie?Array.from(_e):pn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return se(`${t} position calculated from:`,o),se(`Checked %c${i.length}%c elements`,h,g),performance.mark(ht,{detail:{hasTags:Ae,len:i.length,logging:Ve,Side:t}}),r}const fn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],mn=`* ${Array.from(q).map(e=>`:not(${e})`).join("")}`,pn=e=>e.querySelectorAll(mn),hn={height:0,width:0},gn={height:0,width:0},yn=[h,g,h];function bn(e){function t(){return gn[o]=r,hn[o]=s,Math.max(r,1)}const n=e===vn,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=0;switch(!0){case!e.enabled():return Math.max(s,1);case Ae:se("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Ie&&ke&&0===gn[o]&&0===hn[o]:se(`Initial page size values: ${c}`,...yn),l=t();break;case ot&&r===gn[o]&&s===hn[o]:se(`Size unchanged: ${c}`,...yn),l=Math.max(r,s);break;case 0===r&&0!==s:se(`Page is hidden: ${c}`,...yn),l=s;break;case!Ie&&r!==gn[o]&&s<=hn[o]:se(`New <html> size: ${c} `,...yn),se(`Previous <html> size: %c${gn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Ie&&r<gn[o]:se(`<html> size decreased: ${c}`,...yn),l=t();break;case s===a||s===i:se(`<html> size equals page size: ${c}`,...yn),l=t();break;case r>s:se(`Page size < <html> size: ${c}`,...yn),l=t();break;case Ie:se("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:se(`Using <html> size: ${c}`,...yn),l=t()}return se(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&se(`Page offsetSize: %c${t}px`,h),t}(e),l}const vn={label:"height",enabled:()=>Me,getOffset:()=>Ze,auto:()=>bn(vn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vn.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(...fn(vn)),min:()=>Math.min(...fn(vn)),grow:()=>vn.max(),lowestElement:()=>un(S),taggedElement:()=>un(S)},zn={label:"width",enabled:()=>Ee,getOffset:()=>Je,auto:()=>bn(zn),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(...fn(zn)),min:()=>Math.min(...fn(zn)),rightMostElement:()=>un(O),scroll:()=>Math.max(zn.bodyScroll(),zn.documentElementScroll()),taggedElement:()=>un(O)},wn=(e,t)=>!(Math.abs(e-t)<=nt);function $n(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 le(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Sn=!1;const On=_(()=>be(U(4)));let Mn,En=!1;const kn=fe((e,t,n,o,r)=>{switch(me(e),!0){case!0===De:if(!0===En)break;ae("Iframe hidden - Ignored resize request"),En=!0,Sn=!1,cancelAnimationFrame(Mn);break;case!0===Sn:break;case!oe&&!(e in I):se("Resizing disabled");break;default:En=!1,Sn=!0,W=performance.now(),L=!0,Mn=requestAnimationFrame(()=>{Sn=!1,me("requestAnimationFrame"),ce(`Reset sendPending: %c${e}`,h)}),function(e,t,n,o,r){const i=n??$n(vn,Re),a=o??$n(zn,it),s=Me&&wn(Ne,i)||Ee&&wn(rt,a)?E:e;switch(ae(`Resize event: %c${t}`,h),s){case R:case M:case E:Ne=i,rt=a;case j:In(Ne,rt,e,r);break;case A:case C:case x:case P:ae(N);break;default:se(N)}L=!1}(e,t,n,o,r)}de()});function Tn(e){Ne=vn[Re](),rt=zn[it](),jn(Ne,rt,e)}function In(e,t,o,r,i){He<-1||(void 0!==i?ae(`Message targetOrigin: %c${i}`,h):i=tt,function(){const a=`${Qe}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ye)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==He)throw e;return void On()}else et.postMessage(s+a,i);L&&ae(function(){const e=G(performance.now()-W);return o===R?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),se(`Sending message to parent page via ${Ye?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const jn=fe((e,t,n,o,r)=>{me(n),In(e,t,n,o,r),de()}),xn=fe(function(e){me("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>jn(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void ae("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");et=e.source,f=e.origin,ft(t),ke=!1,setTimeout(()=>{Be=!1},128)},reset(){Be?ae("Page reset ignored by init"):(ae("Page size reset by host page"),Tn("resetPage"))},resize(){ae("Resize requested by host page"),kn(T,"Parent window requested size check")},moveToAnchor(){Le.findTarget(c())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=c();ae("PageInfo received from parent:",o(e)),dt?J(dt,n(e)):r("pageInfo")},parentInfo(){const e=o(c());ae("ParentInfo received from parent:",e),ut?J(ut,e):r("parentInfo")},message(){const e=c();ae("onMessage called from parent:%c",h,o(e)),J(ct,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],c=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=a();me(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||ge(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ke)return l()?(pe(a()),me(R),void i.init()):void ae(`Ignored message of type "${a()}". Received before initialization.`);d()}()});let An=!1;const Cn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Pn(){if("loading"===document.readyState||!ke||An)return;const{parent:e,top:t}=window;ae("[iFrameResizerChild]Ready"),Cn(e),e!==t&&Cn(t),An=!0}"iframeChildListener"in window?ge("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>xn({data:e,sameOrigin:!0})),B(window,"message",xn),B(document,"readystatechange",Pn),setTimeout(Pn))}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.min.js.map
20
+ !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:!0,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.4",b="iframeResizer",v=10,w="data-iframe-size",z="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",E="autoResizeEnabled",M=Symbol("sizeChanged"),k="manualResize",j="parentResize",T={[k]:1,[j]:1},x="setOffsetSize",A="resizeObserver",I="overflowObserver",N="mutationObserver",C="visibilityObserver",P="init",R=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),B=(e,t,n,o)=>e.addEventListener(t,n,o||!1),q=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)},L=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),D=["spjluzl","rlf","clyzpvu"],F=["<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"],V=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>L(F[e]);var U=e=>{const t=e[L(D[0])]||e[L(D[1])]||e[L(D[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=q(L(e));return n in V&&(t=V[n]),t}(n[0]);return 0===o||(e=>e[2]===q(e[0]+e[1]))(n)||(o=-2),o};const Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},_=e=>e,Q=e=>Math.round(1e3*e)/1e3,G=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const X=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${G(t)}`)};let K=!0,ee=b;const te=(ne=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}},ne?.__esModule?ne.default:ne);var ne;const oe=te({label:`${b}(child)`});var re;const ie=(re="log",(...e)=>!K||oe[re](...e));const{assert:ae,endAutoGroup:se,error:ce,errorBoundary:le,event:ue,label:de,purge:fe,warn:me}=oe,pe=e=>{return oe.warn((t=_,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},he=pe,ge=(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)=>pe(t)),ye=ge("Method"),be=ge("Method","replaced with"),ve=ge("Option"),we=["min-height","min-width","max-height","max-width"],ze=new Set,$e=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=$e(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Oe({href:e}){ze.has(e)||ze.add(e)}const Ee=(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){Oe(n)}return{source:"cross-origin stylesheet",value:$e(e,t)}}(e,t),Me=(e,t)=>{const{source:n,value:o}=Ee(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);pe(`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 ke(){for(const e of[document.documentElement,document.body])for(const t of we)Se(e,t)&&Me(e,t)}const je=e=>t=>void 0===t?void 0:e(t),Te=je(e=>"true"===e),xe=je(Number),Ae=e=>e=>{e.size},Ie=((e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ne=e=>e=>{e.size},Ce=(t,n=!0)=>o=>{o>0&&ie(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Pe=(e,t,n,o)=>{const r=Ne(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()}},Re=new Set,Be=new Set,qe=new Set,Le=[],De={attributes:!0,attributeFilter:[$,w],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Fe,We=1,Ve=!1,He=0;const Ue=e=>{e.size},Ze=e=>{e.size},Je=e=>{e.size},_e=e=>e.nodeType!==Node.ELEMENT_NODE||R.has(e.tagName.toLowerCase());function Qe(e){const t=e.addedNodes;for(const e of t)_e(e)||Re.add(e)}function Ge(e){const t=e.removedNodes;for(const e of t)_e(e)||(Re.has(e)?(Re.delete(e),qe.add(e)):Be.add(e))}const Ye=e=>{ie("Mutations:",e);for(const t of e)Qe(t),Ge(t);Ue(Re),Ze(Be),Je(qe),qe.clear()};const Xe=e=>()=>{const t=performance.now(),n=t-He,o=16*We+++2;if(n>o&&n<200)return ue("mutationThrottled"),ie("Update delayed due to heavy workload on the callStack"),ie(`EventLoop busy time: %c${Q(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Fe,16*We),void(He=t);We=1,Le.forEach(Ye),Le.length=0,Ve=!1,Be.size,Re.size,e({addedNodes:Re,removedNodes:Be}),Re.clear(),Be.clear()};function Ke(e){Le.push(e),Ve||(He=performance.now(),Ve=!0,requestAnimationFrame(Fe))}function et(e){const t=new window.MutationObserver(Ke),n=document.body||document.documentElement;return Fe=Xe(e),t.observe(n,De),ie("Attached MutationObserver to body"),{...t,disconnect:()=>{Re.clear(),Be.clear(),Le.length=0,t.disconnect(),ie("Detached MutationObserver")}}}const tt="Overflow",nt=Ce(tt),ot=Ce(tt,!1),rt=Ae(tt),it=Ie(tt),at=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,st=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||_,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(z,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)&&!at(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));it(t),rt(n),nt(o),n.clear(),t.clear()},detachObservers:Pe(tt,c,l,ot),disconnect:()=>{c.disconnect(),ie("Detached OverflowObserver")}}},ct="--ifr-start",lt="--ifr-end",ut="--ifr-measure",dt=[];let ft,mt={},pt=0;function ht(){try{performance.clearMarks(ct),performance.clearMarks(lt),performance.clearMeasures(ut)}catch{}}function gt(e){e.getEntries().forEach(e=>{if(e.name===lt)try{const{duration:t}=performance.measure(ut,ct,lt);mt=e.detail,dt.push(t),dt.length>100&&dt.shift()}catch{}})}function yt(){ie("Attached PerformanceObserver to page");const e=new PerformanceObserver(gt);return e.observe({entryTypes:["mark"]}),ft=setInterval(()=>{if(dt.length<10)return;if(mt.hasTags&&mt.len<25)return;dt.sort();const e=Math.min(dt.reduce((e,t)=>e+t,0)/dt.length,dt[Math.floor(dt.length/2)]),t=Q(e);t>pt&&(pt=t,ue("performanceObserver")),ht(),e<=4||(clearInterval(ft),pe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${mt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{ht(),clearInterval(ft),e.disconnect(),ie("Detached PerformanceObserver")}}}const bt="Resize",vt=Ce(bt),wt=Ce(bt,!1),zt=Ae(bt),$t=Ie(bt),St=new WeakSet,Ot=new Set,Et=new Set;let Mt;function kt(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)?Ot.add(n):(Mt.observe(n),St.add(n),Et.add(n),t+=1))}$t(Ot),zt(Et),vt(t),Et.clear(),Ot.clear()}function jt(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ie("Attached VisibilityObserver to page"),{disconnect:()=>{t.disconnect(),ie("Detached VisibilityObserver")}}}const Tt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},xt=Tt("function"),At=Tt("number"),It=Tt("string");"undefined"!=typeof window&&function(){const o={height:()=>(me("Custom height calculation function not defined"),pn.auto()),width:()=>(me("Custom width calculation function not defined"),hn.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="[iFrameSizer]",c=[],l="scroll";let u,d,f,m,p,q,F,V=!0,Q="",te=0,ne="",re="",ge=!1,we=!0,ze=!1,$e=!0,Se=!1,Oe=!1,Ee=!0,Me=!1,je=1,Ae=a,Ie="",Ne=!0,Ce={},Re=!1,Be=!1,qe=!1,Le=0,De=!1,Fe=0,We=0,Ve=new Set,He="",Ue="child",Ze=!1,Je="",_e=[],Qe=window.parent,Ge="*",Ye=0,Xe=!1,Ke=1,tt=l,nt=window,ot=()=>{me("onMessage function not defined")},rt=()=>{},it=null,at=null;function ut(e){var t;!function(e){He=e[0]??He,te=xe(e[1])??te,ze=Te(e[2])??ze,qe=Te(e[3])??qe,V=Te(e[6])??V,ne=e[7]??ne,Ae=e[8]??Ae,Q=e[9]??Q,re=e[10]??re,Ye=xe(e[11])??Ye,Ce.enable=Te(e[12])??!1,Ue=e[13]??Ue,tt=e[14]??tt,De=Te(e[15])??De,Fe=xe(e[16])??Fe,We=xe(e[17])??We,we=Te(e[18])??we,u=e[19]??u,q=e[20]??q,Le=xe(e[21])??Le,Be=Te(e[23])??Be}(e),ee=(t={id:He,enabled:qe,expand:Be}).id||b,oe.label(`${ee}`),oe.expand(t.expand),K=t.enabled,function(){function e(e){F=xt(e,"onBeforeResize")??F,ot=xt(e,"onMessage")??ot,rt=xt(e,"onReady")??rt,"number"==typeof e?.offset&&(ve("offset","offsetSize"),we&&(Fe=At(e,"offset")??Fe),ze&&(We=At(e,"offset")??We)),"number"==typeof e?.offsetSize&&(we&&(Fe=At(e,"offsetSize")??Fe),ze&&(We=At(e,"offsetSize")??We)),d=It(e,L(D[0]))??d,Ie=It(e,"ignoreSelector")??Ie,Je=It(e,"sizeSelector")??Je,Ge=It(e,"targetOrigin")??Ge,Ae=e?.heightCalculationMethod||Ae,tt=e?.widthCalculationMethod||tt}function t(e,t){return"function"==typeof e&&(pe(`<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===Le)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ae=t(Ae,"height"),tt=t(tt,"width"),ie(`Set targetOrigin for parent: %c${Ge}`,h))}(),[vt,$t,Ft,ht,zt,Lt,Dt,Bt,gt,mt,ge?_:ke,Tt,Zt,Ut,Ht,Nt,()=>Ot("background",Q),()=>Ot("padding",re),ge?_:Ct,Vt,Wt,rn,dt].forEach(e=>{try{e()}catch(e){if(Le<0)throw e;pe("<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</>"),ce(e)}}),ft(J(rt)),$n(P,"Init message from host page",void 0,void 0,`${y}:${Le}`),document.title&&""!==document.title&&En(0,0,"title",document.title)}function dt(){B(window,"beforeunload",()=>{c.forEach(e=>e()),En(0,0,"beforeUnload")})}function ft(e){"complete"===document.readyState?Z(e):B(document,"readystatechange",()=>ft(e))}function mt(){_e=document.querySelectorAll(`[${w}]`),Me=_e.length>0}let pt=0;function ht(){const n=document.querySelectorAll(`*[${$}]`);return Se=n.length>0,Se&&n.length!==pt&&(function(n){const o=1===n.length?"":"s";me(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),pt=n.length),Se}function gt(){"BackCompat"===document.compatMode&&pe("<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 vt(){q&&""!==q&&"false"!==q?q!==y&&pe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${q} - Child page: ${y}.\n`):pe("<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{Ze=1===Le||"iframeParentListener"in window.parent}catch(e){}}function $t(){ze===we&&(ge=!0)}function Ot(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ie(`Set body ${e}: %c${t}`,h))}function Et(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Tt(){Et(0,w,Je),Et(0,$,Ie)}function Nt(){var e,t;void 0===ne&&(ne=`${te}px`),Ot("margin",(e="margin",(t=ne).includes("-")&&(me(`Negative CSS value ignored for ${e}`),t=""),t))}function Ct(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}function Pt(e){({add(t){function n(){$n(e.eventName,e.eventType)}i[t]=n,B(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 Rt(e){Pt({method:e,eventType:"After Print",eventName:"afterprint"}),Pt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Pt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}function Bt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(w,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&pe("<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 qt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&pe(`<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 ${q?"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 Lt(){Ae=qt(Ae,a,pn)}function Dt(){tt=qt(tt,l,hn)}function Ft(){const t=Le,n=U({key:u}),o=U({key:d});if(Le=Math.max(n,o),Le<0){if(Le=Math.min(n,o),fe(),pe(`${H(Le+2)}${H(2)}`),Y(q))throw H(Le+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(q)||t>-1&&Le>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ee} %ciframe-resizer ${t}`,K||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>L(W[e]))(Le)})`,Le),Le<2&&he(H(3)),sessionStorage.setItem("ifr",y))}function Wt(){Rt("add"),c.push(()=>Rt("remove"))}function Vt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Ht(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,v)+parseInt(n.x,v),y:parseInt(t.top,v)+parseInt(n.y,v)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?En(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);En(n.y,n.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}Ce.enable&&(1===Le?pe("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")&&B(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),B(window,"hashchange",n),setTimeout(n,128))),Ce={findTarget:t}}function Ut(){function e(e){En(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){B(window.document,t,e)}!0===De&&(t("mouseenter"),t("mouseleave"))}function Zt(){1!==Le&&(nt.parentIframe=Object.freeze({autoResize:e=>(X(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ze&&!1===we?(ue(E),pe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===V?(V=!0,queueMicrotask(()=>$n(E,"Auto Resize enabled"))):!1===e&&!0===V&&(V=!1),En(0,0,"autoResize",JSON.stringify(V)),V)),close(){En(0,0,"close")},getId:()=>He,getOrigin:()=>(ye("getOrigin()","getParentOrigin()"),f),getParentOrigin:()=>f,getPageInfo(e){if("function"==typeof e)return it=e,En(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");it=null,En(0,0,"pageInfoStop")},getParentProps:e=>(X(e,"function","parentIframe.getParentProps(callback) callback"),at=e,En(0,0,"parentInfo"),()=>{at=null,En(0,0,"parentInfoStop")}),getParentProperties(e){ye("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){X(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Ce.findTarget(e)},reset(){!function(){const e=Ae;Ae=a,Xe||(Xe=!0,requestAnimationFrame(()=>{Xe=!1})),Sn("reset"),Ae=e}()},setOffsetSize(e){X(e,"number","parentIframe.setOffsetSize(offset) offset"),Fe=e,We=e,$n(x,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){X(e,"number","parentIframe.scrollBy(x, y) x"),X(t,"number","parentIframe.scrollBy(x, y) y"),En(t,e,"scrollBy")},scrollTo(e,t){X(e,"number","parentIframe.scrollTo(x, y) x"),X(t,"number","parentIframe.scrollTo(x, y) y"),En(t,e,"scrollTo")},scrollToOffset(e,t){X(e,"number","parentIframe.scrollToOffset(x, y) x"),X(t,"number","parentIframe.scrollToOffset(x, y) y"),En(t,e,"scrollToOffset")},sendMessage(e,t){t&&X(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),En(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ae=e,Lt()},setWidthCalculationMethod(e){tt=e,Dt()},setTargetOrigin(e){X(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Ge=e},resize(e,t){void 0!==e&&X(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&X(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),$n(k,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ye("size()","resize()"),this.resize(e,t)}}),nt.parentIFrame=nt.parentIframe)}let Jt=new Set;function _t(){const e=document.querySelectorAll(`[${z}]`);Ve=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${$}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ue("overflowIgnored"),ie("Ignoring elements with [data-iframe-ignore] > *:\n",n),se()}),t}(e),Oe=Ve.size>0,"function"==typeof Set.prototype.symmetricDifference&&(Ee=Ve.symmetricDifference(Jt).size>0),Jt=Ve}function Qt(){switch(_t(),!0){case!Ee:return;case Ve.size>1:ie("Overflowed Elements:",Ve);break;case Oe:break;default:ie("No overflow detected")}$n(I,"Overflow updated")}function Gt(e){const t={root:document.documentElement,side:we?S:O};return m=st(Qt,t),m.attachObservers(e),m}function Yt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;$n(A,`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 Xt(e){return Mt=new ResizeObserver(Yt),Mt.observe(document.body),St.add(document.body),ie("Attached ResizeObserver to body"),p={attachObserverToNonStaticElements:kt,detachObservers:Pe(bt,Mt,St,wt),disconnect:()=>{Mt.disconnect(),ie("Detached ResizeObserver")}},p.attachObserverToNonStaticElements(e),p}function Kt(e){Re=!e,$n(C,"Visibility changed")}const en=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of ln(n))t.add(e)}return ie("Inspecting:\n",t),t},tn=e=>{if(0===e.size)return;ue("addObservers");const t=en(e);m.attachObservers(t),p.attachObserverToNonStaticElements(t),se()},nn=e=>{if(0===e.size)return;ue("removeObservers");const t=en(e);m.detachObservers(t),p.detachObservers(t),se()};function on(e){!function({addedNodes:e,removedNodes:t}){ue("contentMutated"),Tt(),mt(),_t(),se(),nn(t),tn(e)}(e),$n(N,"Mutation Observed")}function rn(){const e=ln(document.documentElement);var t;t=[et(on),Gt(e),yt(),Xt(e),jt(Kt)],c.push(...t.map(e=>e.disconnect))}function an(e){performance.mark(ct);const t=G(e);let n=1,o=document.documentElement,r=Me?0:document.documentElement.getBoundingClientRect().bottom;const i=Me?_e:Oe?Array.from(Ve):ln(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ie(`${t} position calculated from:`,o),ie(`Checked %c${i.length}%c elements`,h,g),performance.mark(lt,{detail:{hasTags:Me,len:i.length,logging:qe,Side:t}}),r}const sn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],cn=`* ${Array.from(R).map(e=>`:not(${e})`).join("")}`,ln=e=>e.querySelectorAll(cn),un={height:0,width:0},dn={height:0,width:0},fn=[h,g,h];function mn(e){function t(){return dn[o]=r,un[o]=s,Math.max(r,1)}const n=e===pn,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=0;switch(!0){case!e.enabled():return Math.max(s,1);case Me:ie("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Oe&&$e&&0===dn[o]&&0===un[o]:ie(`Initial page size values: ${c}`,...fn),l=t();break;case Xe&&r===dn[o]&&s===un[o]:ie(`Size unchanged: ${c}`,...fn),l=Math.max(r,s);break;case 0===r&&0!==s:ie(`Page is hidden: ${c}`,...fn),l=s;break;case!Oe&&r!==dn[o]&&s<=un[o]:ie(`New <html> size: ${c} `,...fn),ie(`Previous <html> size: %c${dn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Oe&&r<dn[o]:ie(`<html> size decreased: ${c}`,...fn),l=t();break;case s===a||s===i:ie(`<html> size equals page size: ${c}`,...fn),l=t();break;case r>s:ie(`Page size < <html> size: ${c}`,...fn),l=t();break;case Oe:ie("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:ie(`Using <html> size: ${c}`,...fn),l=t()}return ie(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ie(`Page offsetSize: %c${t}px`,h),t}(e),l}const pn={label:"height",enabled:()=>we,getOffset:()=>Fe,auto:()=>mn(pn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>pn.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(...sn(pn)),min:()=>Math.min(...sn(pn)),grow:()=>pn.max(),lowestElement:()=>an(S),taggedElement:()=>an(S)},hn={label:"width",enabled:()=>ze,getOffset:()=>We,auto:()=>mn(hn),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(...sn(hn)),min:()=>Math.min(...sn(hn)),rightMostElement:()=>an(O),scroll:()=>Math.max(hn.bodyScroll(),hn.documentElementScroll()),taggedElement:()=>an(O)},gn=(e,t)=>!(Math.abs(e-t)<=Ye);function yn(e,t){const n=e[t](),o=e.enabled()&&void 0!==F?function(e){const t=F(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 ae(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let bn=!1;const vn=J(()=>he(H(4)));let wn,zn=!1;const $n=le((e,t,n,o,r)=>{switch(ue(e),!0){case!0===Re:if(!0===zn)break;zn=!0,bn=!1,cancelAnimationFrame(wn);break;case!0===bn:fe();break;case!V&&!(e in T):ie("Resizing disabled");break;default:zn=!1,bn=!0,performance.now(),wn=requestAnimationFrame(()=>{bn=!1,ue("requestAnimationFrame")}),function(e,t,n,o,r){const i=n??yn(pn,Ae),a=o??yn(hn,tt);switch(we&&gn(je,i)||ze&&gn(Ke,a)?M:e){case P:case E:case M:je=i,Ke=a;case x:On(je,Ke,e,r);break;case I:case N:case A:case C:fe();break;default:fe(),ie("No change in content size detected")}}(e,0,n,o,r)}se()});function Sn(e){je=pn[Ae](),Ke=hn[tt](),En(je,Ke,e)}function On(e,t,o,r,i){Le<-1||(void 0!==i||(i=Ge),function(){const a=`${He}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ze)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Le)throw e;return void vn()}else Qe.postMessage(s+a,i);ie(`Sending message to parent page via ${Ze?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const En=le((e,t,n,o,r)=>{ue(n),On(e,t,n,o,r),se()}),Mn=le(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>En(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Qe=e.source,f=e.origin,ut(t),$e=!1,setTimeout(()=>{Ne=!1},128)},reset(){Ne||Sn("resetPage")},resize(){$n(j,"Parent window requested size check")},moveToAnchor(){Ce.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();it?Z(it,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;at?Z(at,e):o("parentInfo")},message(){const e=a();Z(ot,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();ue(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||me(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==$e)return c()?(de(i()),ue(P),void r.init()):void 0;l()}()});let kn=!1;const jn=e=>e.postMessage("[iFrameResizerChild]Ready","*");function Tn(){if("loading"===document.readyState||!$e||kn)return;const{parent:e,top:t}=window;jn(e),e!==t&&jn(t),kn=!0}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Mn({data:e,sameOrigin:!0})),B(window,"message",Mn),B(document,"readystatechange",Tn),setTimeout(Tn))}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.5.4-beta.3 (umd) - 2025-08-27
4
+ * @module iframe-resizer/legacy (parent) 5.5.4 (umd) - 2025-08-27
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,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],d=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>s(l(e).map(t));const u=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=u?"color: #A9C7FB;":"color: #135CD2;",m=u?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.4-beta.3",g="iframeResizer",y="none",b="vertical",w="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),S=e=>e,I=(O=function(s={}){const l={},u={},p=[],m={...i,expand:!s.collapsed||i.expanded,...s};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!m.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===h&&(h=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 z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...f(m,d(m)),...f(console,e=>[e,(...t)=>z(e,...t)]),...f(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){u[e]?u[e]+=1:u[e]=1,z("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},O?.__esModule?O.default:O);var O;let C={},A=!1;const W=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const L=e=>(t,...n)=>C[t]?.console[e](...n),N=(F="log",(e,...t)=>!0===(e=>C[e]?C[e].log:A)(e)?L(F)(e,...t):null);var F;const B=N,P=L("warn"),H=L("error"),q=L("event"),D=L("purge"),U=L("errorBoundary");const V=(e,...t)=>C[e]?C[e].console.warn(E(S)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),J=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(V),Z=J("Function"),G=J("Option"),X=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Y=(e,t,n)=>e.removeEventListener(t,n,!1),_=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),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)),K=["spjluzl","rlf","clyzpvu"],ee=["<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."],te=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ne=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),oe=e=>Q(ee[e]),ie=e=>{const t=e[Q(K[0])]||e[Q(K[1])]||e[Q(K[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=_(Q(e));return n in ne&&(t=ne[n]),t}(n[0]);return 0===o||(e=>e[2]===_(e[0]+e[1]))(n)||(o=-2),o};function re(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));q(e,"noResponse"),V(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const ae={},se=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:b,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ae[e.id].onInit&&(G("init()","onReady()","",e.id),ae[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),le={position:null,version:h};function ce(e){function t(){ye(x),he(M),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){we(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{ae[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o("scroll"),r=o("resize window");function a(e,n){N(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function s(){q(l,`stop${t}`),a("Remove ",Y),c.disconnect(),d.disconnect(),Y(ae[l].iframe,"load",s)}const l=M,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));ae[l]&&(ae[l][`stop${t}`]=s,X(ae[l].iframe,"load",s),a("Add ",X),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ae[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ae[M]&&(ae[M][e](),delete ae[M][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),d=a(l,"PageInfo"),f=a(c,"ParentInfo"),u=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return pe(M),{x:Number(t.left)+Number(le.position.x),y:Number(t.top)+Number(le.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};B(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){le.position=e,w(M)}(n)}function w(e){const{x:t,y:n}=le.position,o=ae[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?he(e):me()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>de(M,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=x;switch(ae[M]?.firstRun&&function(){if(!ae[M])return;Te(M,x.mode),ae[M].firstRun=!1}(),r){case"close":ue(n);break;case"message":l=i(6),N(M,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":B(M,"Ready state reset"),ae[M].ready=!1;break;case"autoResize":ae[M].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;B(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":d();break;case"parentInfo":f();break;case"pageInfoStop":u();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);B(M,`Moving to in page link: %c#${t}`,p),le.position={x:e.x,y:e.y},w(M),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):N(M,`In page link #${t} not found and window.parentIframe not found`)}():N(M,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){ae[t]?.syncTitle&&(ae[t].iframe.title=e,B(t,`Set iframe title attribute: %c${e}`,p))}(o,M);break;case"reset":ge(x);break;case"init":t(),function(e){try{ae[e].sameOrigin=!!ae[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ae[e].sameOrigin=!1}N(e,`sameOrigin: %c${ae[e].sameOrigin}`,p)}(M),(s=o)!==h&&(void 0!==s?N(M,`Version mismatch (Child: %c${s}%c !== Parent: %c${h})`,p,m,p):V(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),$e=!0,$("onReady",n);break;default:if(0===a&&0===e)return void P(M,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return void N(M,"Ignoring message with 0 height or width");if(document.hidden)return void N(M,"Page hidden - ignored resize request");t()}var s,l}function k(e){ae[e].ready||(we("iframe requested init",ve(e),e),re(e,ae))}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?v===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in ae?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=ae[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),M=x.id,M?(q(M,x.type),U(M,function(){!function(e){if(!ae[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&N(M,"Ignoring init message from meta parent page"),e}()||(N(M,`Received: %c${T}`,p),ae[M].ready=!0,(null!==x.iframe||(P(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=ae[M]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(N(M,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=ae[M]?.remoteHost;return N(M,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):P("","iframeResizer received messageData without id, message was: ",T)):null!==M&&N(M,"Ignored:",T):Object.keys(ae).forEach(k)}function de(e,t,n){let o=null,i=null;if(ae[e]){if(o=ae[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),P(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function fe(e){const{id:t}=e;N(t,"Disconnected from iframe"),delete ae[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==de(t,"onBeforeClose",t)){N(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){P(t,e)}de(t,"onAfterClose",t),fe(e)}else N(t,"Close iframe cancelled by onBeforeClose")}function pe(e){null===le.position&&(le.position={x:window.scrollX,y:window.scrollY},N(e,`Get page position: %c${le.position.x}%c, %c${le.position.y}`,p,m,p))}function me(){le.position=null}function he(e){null!==le.position&&(window.scrollTo(le.position.x,le.position.y),B(e,`Set page position: %c${le.position.x}%c, %c${le.position.y}`,p,m,p),me())}function ge(e){N(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),pe(e.id),ye(e),we("reset","reset",e.id)}function ye(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,B(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=ae[n];o&&t("height"),i&&t("width")}C=ae;const be=e=>e.split(":").filter((e,t)=>19!==t).join(":");function we(e,t,n){function o(o){const i=e in k?be(t):t;B(n,o,p,m,p),B(n,`Message data: %c${i}`,p)}q(n,e),ae[n]&&(ae[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ae[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){N(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():P(n,`Iframe(${n}) not found`))}function ve(e){const t=ae[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,le.version,t.mode,"",t.logExpand].join(":")}let ze=0,$e=!1,je=!1,ke=!1;function Te(t,n=-3){if(je)return;const o=Math.max(ae[t].mode,n);if(o>ae[t].mode&&(ae[t].mode=o),o<0)throw D(t),ae[t].vAdvised||V(t||"Parent",`${oe(o+2)}${oe(2)}`),ae[t].vAdvised=!0,oe(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&ke||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,A||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>Q(te[e]))(o)})`,o),o<1&&V("Parent",oe(3)),je=!0}const xe=e=>t=>{function n(){if(ae[d]){const{iframe:e}=ae[d],t={close:ue.bind(null,e),disconnect:fe.bind(null,e),removeListeners(){V(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){V(d,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),we.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),we("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){we("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=ae[n];X(t,"load",()=>{we($,`${e}:${$e}`,n),re(n,ae),function(){const e=ae[d]?.firstRun,n=ae[d]?.heightCalculationMethod in z;!e&&n&&ge({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(we(j,`${e}:${$e}`,n),re(n,ae))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&V(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${b}"</>, <i>"${w}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=ae[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){R(ae[d],e)&&(V(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),ae[d][t]=ae[d][e],delete ae[d][e])}const s=e=>R(e,"onMouseEnter")||R(e,"onMouseLeave");function l(e){var n,o;ae[d]={...ae[d],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...se,...i(e),mouseEvents:s(e),mode:ie(e),syncTitle:r(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),q(d,"setup"),function(){const{direction:e}=ae[d];switch(e){case b:break;case w:ae[d].sizeHeight=!1;case"both":ae[d].sizeWidth=!0;break;case y:ae[d].sizeWidth=!1,ae[d].sizeHeight=!1,ae[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}N(d,`direction: %c${e}`,p)}(),(n=e?.offsetSize||e?.offset)&&(ae[d].direction===b?(ae[d].offsetHeight=n,N(d,`Offset height: %c${n}`,p)):(ae[d].offsetWidth=n,N(d,`Offset width: %c${n}`,p))),function(e){e?.offset&&V(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),ae[d].warningTimeout||B(d,"warningTimeout:%c disabled",p),null===ae[d].postMessageTarget&&(ae[d].postMessageTarget=t.contentWindow),ae[d].targetOrigin=!0===ae[d].checkOrigin?""===(o=ae[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||se.id+ze++;return null!==document.getElementById(t)&&(t+=ze++),t}(),t.id=n,N(n,`Added missing iframe ID: ${n} (${t.src})`)),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=R(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:se.log;R(t,"logExpand")||(t.logExpand=n&&o?t.log===T:se.logExpand),function(e){-1===e?.log&&(e.log=!1,ke=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=I({expand:t,label:W(n)});A=e,C[n]||(C[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&H(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),U(d,function(e){c()?P(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if(je)return;const{mode:e}=ae[d];-1!==e&&Te(d,e)}(),Ee(),function(){switch(N(d,`Iframe scrolling ${ae[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===ae[d]?.scrolling?"hidden":"auto",ae[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ae[d]?ae[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ae[d];"number"!=typeof e&&"0"!==e||(ae[d].bodyMargin=`${e}px`)}(),o(ve(d)),n(),N(d,"Setup complete"))})(e),t?.iframeResizer};function Me(){!1===document.hidden&&(N("document","Trigger event: Visibility change"),function(e,t){const n=e=>ae[e]?.autoResize&&!ae[e]?.firstRun;Object.keys(ae).forEach(function(o){n(o)&&we(e,t,o)})}("tabVisible","resize"))}const Ee=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{X(window,"message",ce),X(document,"visibilitychange",Me),window.iframeParentListener=e=>setTimeout(()=>ce({data:e,sameOrigin:!0}))}),Re=`[${g}] `;const Se=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Re}iframe is not defined`);case!e.tagName:throw new TypeError(`${Re}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Re}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=xe(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Re}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){Z("iFrameResize()","iframeResize()","","parent"),Se(...e)}),Se});
21
- //# sourceMappingURL=iframeResizer.js.map
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.4",g="iframeResizer",y="none",b="vertical",w="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),R=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),S=e=>e,O=(I=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in o)||!!h.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=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 z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},I?.__esModule?I.default:I);var I;let A={},C=!1;const W=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const L=e=>(t,...n)=>A[t]?.console[e](...n);var N;const F=(N="log",(e,...t)=>!0===(e=>A[e]?A[e].log:C)(e)?L(N)(e,...t):null),B=L("warn"),P=L("error"),H=L("event"),q=L("purge"),D=L("errorBoundary");const U=(e,...t)=>A[e]?A[e].console.warn(E(S)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),J=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(U),Z=J("Function"),V=J("Option"),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),X=(e,t,n)=>e.removeEventListener(t,n,!1),Y=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),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)},_=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"],K=["<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."],ee=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],te=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ne=e=>_(K[e]),oe=e=>{const t=e[_(Q[0])]||e[_(Q[1])]||e[_(Q[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Y(_(e));return n in te&&(t=te[n]),t}(n[0]);return 0===o||(e=>e[2]===Y(e[0]+e[1]))(n)||(o=-2),o};function ie(e,t){const{msgTimeout:n,warningTimeout:o}=t[e];o&&(n&&clearTimeout(n),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{ready:n,loadErrorShown:o}=t[e];t[e].msgTimeout=void 0,n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));H(e,"noResponse"),U(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},o))}const re={},ae=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:b,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof re[e.id].onInit&&(V("init()","onReady()","",e.id),re[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),se={position:null,version:m};function le(e){function t(){ge(x),he(M),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>T.slice(T.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){be(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{re[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o("scroll"),r=o("resize window");function a(e,t){t(window,"scroll",i),t(window,"resize",r)}function s(){H(l,`stop${t}`),a(0,X),c.disconnect(),u.disconnect(),X(re[l].iframe,"load",s)}const l=M,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));re[l]&&(re[l][`stop${t}`]=s,G(re[l].iframe,"load",s),a(0,G),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(re[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in re[M]&&(re[M][e](),delete re[M][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return fe(),{x:Number(t.left)+Number(se.position.x),y:Number(t.top)+Number(se.position.y)}}function b(e){const t=e?y(x.iframe):{x:0,y:0};F(M,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){se.position=e,w(M)}(n)}function w(e){const{x:t,y:n}=se.position,o=re[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?he(e):pe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>ce(M,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=x;switch(re[M]?.firstRun&&function(){if(!re[M])return;ke(M,x.mode),re[M].firstRun=!1}(),r){case"close":de(n);break;case"message":l=i(6),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"beforeUnload":F(M,"Ready state reset"),re[M].ready=!1;break;case"autoResize":re[M].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;F(M,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);F(M,`Moving to in page link: %c#${t}`,p),se.position={x:e.x,y:e.y},w(M),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){re[t]?.syncTitle&&(re[t].iframe.title=e,F(t,`Set iframe title attribute: %c${e}`,p))}(o,M);break;case"reset":me(x);break;case"init":t(),function(e){try{re[e].sameOrigin=!!re[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){re[e].sameOrigin=!1}}(M),(s=o)!==m&&(void 0!==s||U(M,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ze=!0,$("onReady",n);break;default:if(0===a&&0===e)return void B(M,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}function k(e){re[e].ready||(be("iframe requested init",we(e),e),ie(e,re))}let T=e.data,x={},M=null;"[iFrameResizerChild]Ready"!==T?v===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in re&&(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=re[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),M=x.id,M?(H(M,x.type),D(M,function(){!function(e){if(!re[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(M),x.type in{true:1,false:1,undefined:1}||(re[M].ready=!0,(null!==x.iframe||(B(M,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=re[M]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=re[M]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):B("","iframeResizer received messageData without id, message was: ",T)):Object.keys(re).forEach(k)}function ce(e,t,n){let o=null,i=null;if(re[e]){if(o=re[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),B(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function ue(e){const{id:t}=e;delete re[t],delete e.iframeResizer}function de(e){const{id:t}=e;if(!1!==ce(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){B(t,e)}ce(t,"onAfterClose",t),ue(e)}}function fe(e){null===se.position&&(se.position={x:window.scrollX,y:window.scrollY})}function pe(){se.position=null}function he(e){null!==se.position&&(window.scrollTo(se.position.x,se.position.y),F(e,`Set page position: %c${se.position.x}%c, %c${se.position.y}`,p,h,p),pe())}function me(e){fe(e.id),ge(e),be("reset","reset",e.id)}function ge(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,F(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=re[n];o&&t("height"),i&&t("width")}A=re;const ye=e=>e.split(":").filter((e,t)=>19!==t).join(":");function be(e,t,n){function o(o){const i=e in k?ye(t):t;F(n,o,p,h,p),F(n,`Message data: %c${i}`,p)}H(n,e),re[n]&&(re[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=re[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():B(n,`Iframe(${n}) not found`))}function we(e){const t=re[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,se.version,t.mode,"",t.logExpand].join(":")}let ve=0,ze=!1,$e=!1,je=!1;function ke(t,n=-3){if($e)return;const o=Math.max(re[t].mode,n);if(o>re[t].mode&&(re[t].mode=o),o<0)throw q(t),re[t].vAdvised||U(t||"Parent",`${ne(o+2)}${ne(2)}`),re[t].vAdvised=!0,ne(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,C||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>_(ee[e]))(o)})`,o),o<1&&U("Parent",ne(3)),$e=!0}const Te=e=>t=>{function n(){if(re[u]){const{iframe:e}=re[u],t={close:de.bind(null,e),disconnect:ue.bind(null,e),removeListeners(){U(u,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){U(u,"<rb>Deprecated Method</>\n \nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),be.bind(null,"Window resize","resize",u)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),be("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){be("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=re[n];G(t,"load",()=>{be($,`${e}:${ze}`,n),ie(n,re),function(){const e=re[u]?.firstRun,n=re[u]?.heightCalculationMethod in z;!e&&n&&me({iframe:t,height:0,width:0,type:"init"})}()}),!0!==o&&(be(j,`${e}:${ze}`,n),ie(n,re))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&U(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${b}"</>, <i>"${w}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=re[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){R(re[u],e)&&(U(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),re[u][t]=re[u][e],delete re[u][e])}const s=e=>R(e,"onMouseEnter")||R(e,"onMouseLeave");function l(e){var n,o;re[u]={...re[u],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...ae,...i(e),mouseEvents:s(e),mode:oe(e),syncTitle:r(u)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),H(u,"setup"),function(){const{direction:e}=re[u];switch(e){case b:break;case w:re[u].sizeHeight=!1;case"both":re[u].sizeWidth=!0;break;case y:re[u].sizeWidth=!1,re[u].sizeHeight=!1,re[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(re[u].direction===b?re[u].offsetHeight=n:re[u].offsetWidth=n),function(e){e?.offset&&U(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.")}(e),re[u].warningTimeout||F(u,"warningTimeout:%c disabled",p),null===re[u].postMessageTarget&&(re[u].postMessageTarget=t.contentWindow),re[u].targetOrigin=!0===re[u].checkOrigin?""===(o=re[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,u=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||ae.id+ve++;return null!==document.getElementById(t)&&(t+=ve++),t}(),t.id=n),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const n=R(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:ae.log;R(t,"logExpand")||(t.logExpand=n&&o?t.log===T:ae.logExpand),function(e){-1===e?.log&&(e.log=!1,je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=O({expand:t,label:W(n)});C=e,A[n]||(A[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&P(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,e),D(u,function(e){c()?B(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if($e)return;const{mode:e}=re[u];-1!==e&&ke(u,e)}(),Me(),function(){switch(t.style.overflow=!1===re[u]?.scrolling?"hidden":"auto",re[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=re[u]?re[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=re[u];"number"!=typeof e&&"0"!==e||(re[u].bodyMargin=`${e}px`)}(),o(we(u)),n())})(e),t?.iframeResizer};function xe(){!1===document.hidden&&function(e,t){const n=e=>re[e]?.autoResize&&!re[e]?.firstRun;Object.keys(re).forEach(function(o){n(o)&&be(e,t,o)})}("tabVisible","resize")}const Me=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{G(window,"message",le),G(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>le({data:e,sameOrigin:!0}))}),Ee=`[${g}] `;const Re=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Ee}iframe is not defined`);case!e.tagName:throw new TypeError(`${Ee}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Ee}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Te(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Ee}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){Z("iFrameResize()","iframeResize()","","parent"),Re(...e)}),Re});