iframe-resizer 5.4.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.4.0 (cjs) - 2025-03-31
4
+ * @module iframe-resizer/legacy 5.4.1 (cjs) - 2025-03-31
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.4.0 (esm) - 2025-03-31
4
+ * @module iframe-resizer/legacy 5.4.1 (esm) - 2025-03-31
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.4.0 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.1 (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,4 +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,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),f=m()?"color: #A9C7FB;":"color: #135CD2;",p=m()?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.0",y=10,g="data-iframe-size",v="data-iframe-overflowed",b="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",j="overflowObserver",k="mutationObserver",O=(e,t,n,o)=>e.addEventListener(t,n,o||!1),M=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),C=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,T=e=>Math.round(1e3*e)/1e3,N=e=>""!=`${e}`&&void 0!==e;let I=!0;var x;const R=(x=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function v(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function b(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function z(e,...t){0===m.length&&b(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},x?.__esModule?x.default:x)({label:"iframeResizer(child)"});const q=(L="info",(...e)=>!I||R[L](...e));var L;const{assert:B,debug:F,endAutoGroup:D,error:W,errorBoundary:V,event:H,purge:U,warn:Z}=R,J=e=>{return R.warn((t=A,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},_=J,Q=(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</>.`))(((e,t)=>J(t))),G=Q("Method"),X=Q("Method","replaced with"),Y=Q("Option"),K=requestAnimationFrame,ee="--ifr-start",te="--ifr-end",ne=[],oe=new WeakSet,ie=e=>"object"==typeof e&&oe.add(e);let re={},ae=0;const le=setInterval((()=>{if(ne.length<10)return;if(re.hasTags&&re.len<25)return;ne.sort();const e=Math.min(ne.reduce(((e,t)=>e+t),0)/ne.length,ne[Math.floor(ne.length/2)]),t=T(e);t>ae&&(ae=t,H("performanceObserver")),e<=4||(clearInterval(le),J(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function se(e){e.getEntries().forEach((e=>{if(e.name===te){const{duration:t}=performance.measure("--ifr-measure",ee,te);re=e.detail,ne.push(t),ne.length>100&&ne.shift()}}))}function ce(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ce):ce()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Z("Custom height calculation function not defined"),ct.auto()),width:()=>(Z("Custom width calculation function not defined"),ut.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,x,L,B,F=!0,W="",Q=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe="",he={},ye=!1,ge=0,ve=!1,be="",ze=A,we=[],$e="child",Se=null,Ee=!1,je="",ke=[],Oe=window.parent,Me="*",Pe=0,Ce=!1,Ae="",Te=1,Ne=d,Ie=window,xe=()=>{Z("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,t,n;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");be=t[0],Q=void 0===t[1]?Q:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),F=void 0===t[6]?F:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],W=t[9],oe=t[10],Pe=void 0===t[11]?Pe:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ae=t[20]||Ae,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:be,enabled:ye},R.label(`${e.id}`),I=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(Y("offset","offsetSize"),ie&&(m=e?.offset),re&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(m=e?.offsetSize),re&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===ge)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ne=t(Ne,"width"),q(`Set TargetOrigin for parent: %c${Me}`,f))}(),_e(),function(){try{Ee=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?_(`${P(ge+2)}${P(2)}`):Ae.codePointAt(0)>4||ge<2&&_(P(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==h&&J(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${h}.\n`):J("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&J("<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</>.")}(),"BackCompat"===document.compatMode&&J("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===F?(F=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),vt(0,0,"autoResize",JSON.stringify(F)),F),close(){vt(0,0,"close")},getId:()=>be,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),x),getParentOrigin:()=>x,getPageInfo(e){if("function"==typeof e)return qe=e,vt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,vt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}},getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){m=e,M=e,ht(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){vt(t,e,"scrollBy")},scrollTo(e,t){vt(t,e,"scrollTo")},scrollToOffset(e,t){vt(t,e,"scrollToOffset")},sendMessage(e,t){vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Me=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){O(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),he=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){O(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return he.enable&&(1===ge?J("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ne&&(ne=`${Q}px`),Ze("margin",(t="margin",(n=ne).includes("-")&&(Z(`Negative CSS value ignored for ${t}`),n=""),n)),Ze("background",W),Ze("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){H("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),Fe(),n=!1,ht(k,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;K(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{q("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[b],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:De,root:document.documentElement,side:ie?z:w})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${v}]:not([${b}]):not([${b}] *)`),se=we.length>0}function De(e){Fe(),(se||e)&&ht(j,"Overflow updated")}function We(){ke=document.querySelectorAll(`[${g}]`),ce=ke.length>0}function Ve(e){ce||ze(e)}let He=0;function Ue(){const n=document.querySelectorAll(`*[${b}]`);le=n.length>0,le&&n.length!==He&&(function(n){const o=1===n.length?"":"s";Z(`%c[${b}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),He=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,f))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,g,je),Je(0,b,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,O(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ge(e,t,n,o){return t!==e&&(e in n||(Z(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&J(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function Xe(){de=Ge(de,s,ct,"height")}function Ye(){Ne=Ge(Ne,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(E,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(e){performance.mark(ee);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const s=ce?ke:se?we:it(document)();let c=s.length;for(const t of s)ce||!l||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):c-=1;return q(`${t} position calculated from:`,r),performance.mark(te,{detail:{Side:t,len:c,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{Ue();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return le&&t.push(`not([${b}])`,`not([${b}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[f,p,f];function st(e){function t(){return at[o]=i,rt[o]=l,i}const n=e===ct,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:q("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===rt[o]:q(`Initial page size values: ${s}`,...lt),c=t();break;case Ce&&i===at[o]&&l===rt[o]:q(`Size unchanged: ${s}`,...lt),c=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&i!==at[o]&&l<=rt[o]:q(`New <html> size: ${s} `,...lt),q(`Previous <html> size: %c${at[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!se&&i<at[o]:q(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===r:q(`<html> size equals page size: ${s}`,...lt),c=t();break;case i>l:q(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:q("Found element overflowing <html> "),c=e.taggedElement();break;default:q(`Using <html> size: ${s}`,...lt),c=t()}return q(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,f),t}(e),c}const ct={enabled:()=>ie,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(z),taggedElement:()=>nt(z)},ut={enabled:()=>re,getOffset:()=>M,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(w),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(w)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===S:vt(ue,Te,e,i);break;case!e!==$&&(ie&&de in u||re&&Ne in u):gt();break;case e===E:case e===j:case e===k:U();break;default:U(),q("No change in content size detected")}L=!1}let ft=!1;const pt=C((()=>_(P(4)))),ht=V(((e,t,n,o,i)=>{B=performance.now(),H(e),F||e===$?document.hidden||(ft||(L=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):q("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),vt(ue,Te,e)}function gt(e){const t=de;de=s,Ce||(Ce=!0,requestAnimationFrame((()=>{Ce=!1}))),yt("reset"),de=t}const vt=V((function(e,t,o,i,r){ge<-1||(H(o),void 0!==r||(r=Me),function(){const a=`${be}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ge)throw e;return void pt()}else Oe.postMessage(c+a,r);L&&q(function(){const e=T(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),q("Sending message to host page via "+(Ee?"sameDomain":"postMessage")),q(`%c${a}`,n)}(),D())})),bt=V((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){pe=e.data,Oe=e.source,x=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht($,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Z(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(H(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Z("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>bt({data:e,sameDomain:!0}))),O(window,"message",bt),O(window,"readystatechange",zt),zt())}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),f=m()?"color: #A9C7FB;":"color: #135CD2;",p=m()?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.1",y=10,g="data-iframe-size",v="data-iframe-overflowed",b="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",j="overflowObserver",k="mutationObserver",O=(e,t,n,o)=>e.addEventListener(t,n,o||!1),M=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),C=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,T=e=>Math.round(1e3*e)/1e3,N=e=>""!=`${e}`&&void 0!==e;let I=!0;var x;const R=(x=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function v(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function b(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function z(e,...t){0===m.length&&b(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},x?.__esModule?x.default:x)({label:"iframeResizer(child)"});const q=(L="info",(...e)=>!I||R[L](...e));var L;const{assert:B,debug:F,endAutoGroup:D,error:W,errorBoundary:V,event:H,purge:U,warn:Z}=R,J=e=>{return R.warn((t=A,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},_=J,Q=(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</>.`))(((e,t)=>J(t))),G=Q("Method"),X=Q("Method","replaced with"),Y=Q("Option"),K=requestAnimationFrame,ee="--ifr-start",te="--ifr-end",ne=[],oe=new WeakSet,ie=e=>"object"==typeof e&&oe.add(e);let re={},ae=0;const le=setInterval((()=>{if(ne.length<10)return;if(re.hasTags&&re.len<25)return;ne.sort();const e=Math.min(ne.reduce(((e,t)=>e+t),0)/ne.length,ne[Math.floor(ne.length/2)]),t=T(e);t>ae&&(ae=t,H("performanceObserver")),e<=4||(clearInterval(le),J(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function se(e){e.getEntries().forEach((e=>{if(e.name===te){const{duration:t}=performance.measure("--ifr-measure",ee,te);re=e.detail,ne.push(t),ne.length>100&&ne.shift()}}))}function ce(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ce):ce()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Z("Custom height calculation function not defined"),ct.auto()),width:()=>(Z("Custom width calculation function not defined"),ut.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,x,L,B,F=!0,W="",Q=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe="",he={},ye=!1,ge=0,ve=!1,be="",ze=A,we=[],$e="child",Se=null,Ee=!1,je="",ke=[],Oe=window.parent,Me="*",Pe=0,Ce=!1,Ae="",Te=1,Ne=d,Ie=window,xe=()=>{Z("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,t,n;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");be=t[0],Q=void 0===t[1]?Q:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),F=void 0===t[6]?F:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],W=t[9],oe=t[10],Pe=void 0===t[11]?Pe:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ae=t[20]||Ae,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:be,enabled:ye},R.label(`${e.id}`),I=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(Y("offset","offsetSize"),ie&&(m=e?.offset),re&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(m=e?.offsetSize),re&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===ge)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ne=t(Ne,"width"),q(`Set TargetOrigin for parent: %c${Me}`,f))}(),_e(),function(){try{Ee=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?_(`${P(ge+2)}${P(2)}`):Ae.codePointAt(0)>4||ge<2&&_(P(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==h&&J(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${h}.\n`):J("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&J("<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</>.")}(),"BackCompat"===document.compatMode&&J("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===F?(F=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),vt(0,0,"autoResize",JSON.stringify(F)),F),close(){vt(0,0,"close")},getId:()=>be,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),x),getParentOrigin:()=>x,getPageInfo(e){if("function"==typeof e)return qe=e,vt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,vt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}},getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){m=e,M=e,ht(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){vt(t,e,"scrollBy")},scrollTo(e,t){vt(t,e,"scrollTo")},scrollToOffset(e,t){vt(t,e,"scrollToOffset")},sendMessage(e,t){vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Me=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){O(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),he=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){O(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return he.enable&&(1===ge?J("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ne&&(ne=`${Q}px`),Ze("margin",(t="margin",(n=ne).includes("-")&&(Z(`Negative CSS value ignored for ${t}`),n=""),n)),Ze("background",W),Ze("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){H("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),Fe(),n=!1,ht(k,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;K(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{q("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[b],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:De,root:document.documentElement,side:ie?z:w})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${v}]:not([${b}]):not([${b}] *)`),se=we.length>0}function De(e){Fe(),(se||e)&&ht(j,"Overflow updated")}function We(){ke=document.querySelectorAll(`[${g}]`),ce=ke.length>0}function Ve(e){ce||ze(e)}let He=0;function Ue(){const n=document.querySelectorAll(`*[${b}]`);le=n.length>0,le&&n.length!==He&&(function(n){const o=1===n.length?"":"s";Z(`%c[${b}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),He=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,f))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,g,je),Je(0,b,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,O(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ge(e,t,n,o){return t!==e&&(e in n||(Z(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&J(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function Xe(){de=Ge(de,s,ct,"height")}function Ye(){Ne=Ge(Ne,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(E,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(e){performance.mark(ee);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const s=ce?ke:se?we:it(document)();let c=s.length;for(const t of s)ce||!l||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):c-=1;return q(`${t} position calculated from:`,r),performance.mark(te,{detail:{Side:t,len:c,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{Ue();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return le&&t.push(`not([${b}])`,`not([${b}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[f,p,f];function st(e){function t(){return at[o]=i,rt[o]=l,i}const n=e===ct,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:q("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===rt[o]:q(`Initial page size values: ${s}`,...lt),c=t();break;case Ce&&i===at[o]&&l===rt[o]:q(`Size unchanged: ${s}`,...lt),c=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&i!==at[o]&&l<=rt[o]:q(`New <html> size: ${s} `,...lt),q(`Previous <html> size: %c${at[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!se&&i<at[o]:q(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===r:q(`<html> size equals page size: ${s}`,...lt),c=t();break;case i>l:q(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:q("Found element overflowing <html> "),c=e.taggedElement();break;default:q(`Using <html> size: ${s}`,...lt),c=t()}return q(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,f),t}(e),c}const ct={enabled:()=>ie,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(z),taggedElement:()=>nt(z)},ut={enabled:()=>re,getOffset:()=>M,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(w),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(w)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===S:vt(ue,Te,e,i);break;case!e!==$&&(ie&&de in u||re&&Ne in u):gt();break;case e===E:case e===j:case e===k:U();break;default:U(),q("No change in content size detected")}L=!1}let ft=!1;const pt=C((()=>_(P(4)))),ht=V(((e,t,n,o,i)=>{B=performance.now(),H(e),F||e===$?document.hidden||(ft||(L=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):q("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),vt(ue,Te,e)}function gt(e){const t=de;de=s,Ce||(Ce=!0,requestAnimationFrame((()=>{Ce=!1}))),yt("reset"),de=t}const vt=V((function(e,t,o,i,r){ge<-1||(H(o),void 0!==r||(r=Me),function(){const a=`${be}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ge)throw e;return void pt()}else Oe.postMessage(c+a,r);L&&q(function(){const e=T(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),q("Sending message to host page via "+(Ee?"sameDomain":"postMessage")),q(`%c${a}`,n)}(),D())})),bt=V((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){pe=e.data,Oe=e.source,x=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht($,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Z(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(H(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Z("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>bt({data:e,sameDomain:!0}))),O(window,"message",bt),O(window,"readystatechange",zt),zt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.0 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.1 (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,4 +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,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),f=m()?"color: #A9C7FB;":"color: #135CD2;",p=m()?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.0",y=10,g="data-iframe-size",v="data-iframe-overflowed",b="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",j="overflowObserver",k="mutationObserver",O=(e,t,n,o)=>e.addEventListener(t,n,o||!1),M=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),C=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,T=e=>Math.round(1e3*e)/1e3,N=e=>""!=`${e}`&&void 0!==e;let I=!0;var x;const R=(x=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function v(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function b(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function z(e,...t){0===m.length&&b(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},x?.__esModule?x.default:x)({label:"iframeResizer(child)"});const q=(L="info",(...e)=>!I||R[L](...e));var L;const{assert:B,debug:F,endAutoGroup:D,error:W,errorBoundary:V,event:H,purge:U,warn:Z}=R,J=e=>{return R.warn((t=A,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},_=J,Q=(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</>.`))(((e,t)=>J(t))),G=Q("Method"),X=Q("Method","replaced with"),Y=Q("Option"),K=requestAnimationFrame,ee="--ifr-start",te="--ifr-end",ne=[],oe=new WeakSet,ie=e=>"object"==typeof e&&oe.add(e);let re={},ae=0;const le=setInterval((()=>{if(ne.length<10)return;if(re.hasTags&&re.len<25)return;ne.sort();const e=Math.min(ne.reduce(((e,t)=>e+t),0)/ne.length,ne[Math.floor(ne.length/2)]),t=T(e);t>ae&&(ae=t,H("performanceObserver")),e<=4||(clearInterval(le),J(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function se(e){e.getEntries().forEach((e=>{if(e.name===te){const{duration:t}=performance.measure("--ifr-measure",ee,te);re=e.detail,ne.push(t),ne.length>100&&ne.shift()}}))}function ce(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ce):ce()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Z("Custom height calculation function not defined"),ct.auto()),width:()=>(Z("Custom width calculation function not defined"),ut.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,x,L,B,F=!0,W="",Q=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe="",he={},ye=!1,ge=0,ve=!1,be="",ze=A,we=[],$e="child",Se=null,Ee=!1,je="",ke=[],Oe=window.parent,Me="*",Pe=0,Ce=!1,Ae="",Te=1,Ne=d,Ie=window,xe=()=>{Z("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,t,n;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");be=t[0],Q=void 0===t[1]?Q:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),F=void 0===t[6]?F:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],W=t[9],oe=t[10],Pe=void 0===t[11]?Pe:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ae=t[20]||Ae,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:be,enabled:ye},R.label(`${e.id}`),I=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(Y("offset","offsetSize"),ie&&(m=e?.offset),re&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(m=e?.offsetSize),re&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===ge)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ne=t(Ne,"width"),q(`Set TargetOrigin for parent: %c${Me}`,f))}(),_e(),function(){try{Ee=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?_(`${P(ge+2)}${P(2)}`):Ae.codePointAt(0)>4||ge<2&&_(P(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==h&&J(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${h}.\n`):J("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&J("<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</>.")}(),"BackCompat"===document.compatMode&&J("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===F?(F=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),vt(0,0,"autoResize",JSON.stringify(F)),F),close(){vt(0,0,"close")},getId:()=>be,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),x),getParentOrigin:()=>x,getPageInfo(e){if("function"==typeof e)return qe=e,vt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,vt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}},getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){m=e,M=e,ht(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){vt(t,e,"scrollBy")},scrollTo(e,t){vt(t,e,"scrollTo")},scrollToOffset(e,t){vt(t,e,"scrollToOffset")},sendMessage(e,t){vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Me=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){O(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),he=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){O(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return he.enable&&(1===ge?J("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ne&&(ne=`${Q}px`),Ze("margin",(t="margin",(n=ne).includes("-")&&(Z(`Negative CSS value ignored for ${t}`),n=""),n)),Ze("background",W),Ze("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){H("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),Fe(),n=!1,ht(k,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;K(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{q("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[b],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:De,root:document.documentElement,side:ie?z:w})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${v}]:not([${b}]):not([${b}] *)`),se=we.length>0}function De(e){Fe(),(se||e)&&ht(j,"Overflow updated")}function We(){ke=document.querySelectorAll(`[${g}]`),ce=ke.length>0}function Ve(e){ce||ze(e)}let He=0;function Ue(){const n=document.querySelectorAll(`*[${b}]`);le=n.length>0,le&&n.length!==He&&(function(n){const o=1===n.length?"":"s";Z(`%c[${b}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),He=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,f))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,g,je),Je(0,b,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,O(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ge(e,t,n,o){return t!==e&&(e in n||(Z(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&J(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function Xe(){de=Ge(de,s,ct,"height")}function Ye(){Ne=Ge(Ne,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(E,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(e){performance.mark(ee);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const s=ce?ke:se?we:it(document)();let c=s.length;for(const t of s)ce||!l||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):c-=1;return q(`${t} position calculated from:`,r),performance.mark(te,{detail:{Side:t,len:c,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{Ue();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return le&&t.push(`not([${b}])`,`not([${b}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[f,p,f];function st(e){function t(){return at[o]=i,rt[o]=l,i}const n=e===ct,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:q("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===rt[o]:q(`Initial page size values: ${s}`,...lt),c=t();break;case Ce&&i===at[o]&&l===rt[o]:q(`Size unchanged: ${s}`,...lt),c=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&i!==at[o]&&l<=rt[o]:q(`New <html> size: ${s} `,...lt),q(`Previous <html> size: %c${at[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!se&&i<at[o]:q(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===r:q(`<html> size equals page size: ${s}`,...lt),c=t();break;case i>l:q(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:q("Found element overflowing <html> "),c=e.taggedElement();break;default:q(`Using <html> size: ${s}`,...lt),c=t()}return q(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,f),t}(e),c}const ct={enabled:()=>ie,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(z),taggedElement:()=>nt(z)},ut={enabled:()=>re,getOffset:()=>M,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(w),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(w)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===S:vt(ue,Te,e,i);break;case!e!==$&&(ie&&de in u||re&&Ne in u):gt();break;case e===E:case e===j:case e===k:U();break;default:U(),q("No change in content size detected")}L=!1}let ft=!1;const pt=C((()=>_(P(4)))),ht=V(((e,t,n,o,i)=>{B=performance.now(),H(e),F||e===$?document.hidden||(ft||(L=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):q("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),vt(ue,Te,e)}function gt(e){const t=de;de=s,Ce||(Ce=!0,requestAnimationFrame((()=>{Ce=!1}))),yt("reset"),de=t}const vt=V((function(e,t,o,i,r){ge<-1||(H(o),void 0!==r||(r=Me),function(){const a=`${be}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ge)throw e;return void pt()}else Oe.postMessage(c+a,r);L&&q(function(){const e=T(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),q("Sending message to host page via "+(Ee?"sameDomain":"postMessage")),q(`%c${a}`,n)}(),D())})),bt=V((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){pe=e.data,Oe=e.source,x=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht($,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Z(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(H(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Z("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>bt({data:e,sameDomain:!0}))),O(window,"message",bt),O(window,"readystatechange",zt),zt())}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),f=m()?"color: #A9C7FB;":"color: #135CD2;",p=m()?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.1",y=10,g="data-iframe-size",v="data-iframe-overflowed",b="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",j="overflowObserver",k="mutationObserver",O=(e,t,n,o)=>e.addEventListener(t,n,o||!1),M=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),C=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,T=e=>Math.round(1e3*e)/1e3,N=e=>""!=`${e}`&&void 0!==e;let I=!0;var x;const R=(x=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function v(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function b(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function z(e,...t){0===m.length&&b(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},x?.__esModule?x.default:x)({label:"iframeResizer(child)"});const q=(L="info",(...e)=>!I||R[L](...e));var L;const{assert:B,debug:F,endAutoGroup:D,error:W,errorBoundary:V,event:H,purge:U,warn:Z}=R,J=e=>{return R.warn((t=A,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},_=J,Q=(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</>.`))(((e,t)=>J(t))),G=Q("Method"),X=Q("Method","replaced with"),Y=Q("Option"),K=requestAnimationFrame,ee="--ifr-start",te="--ifr-end",ne=[],oe=new WeakSet,ie=e=>"object"==typeof e&&oe.add(e);let re={},ae=0;const le=setInterval((()=>{if(ne.length<10)return;if(re.hasTags&&re.len<25)return;ne.sort();const e=Math.min(ne.reduce(((e,t)=>e+t),0)/ne.length,ne[Math.floor(ne.length/2)]),t=T(e);t>ae&&(ae=t,H("performanceObserver")),e<=4||(clearInterval(le),J(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function se(e){e.getEntries().forEach((e=>{if(e.name===te){const{duration:t}=performance.measure("--ifr-measure",ee,te);re=e.detail,ne.push(t),ne.length>100&&ne.shift()}}))}function ce(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ce):ce()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Z("Custom height calculation function not defined"),ct.auto()),width:()=>(Z("Custom width calculation function not defined"),ut.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,x,L,B,F=!0,W="",Q=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe="",he={},ye=!1,ge=0,ve=!1,be="",ze=A,we=[],$e="child",Se=null,Ee=!1,je="",ke=[],Oe=window.parent,Me="*",Pe=0,Ce=!1,Ae="",Te=1,Ne=d,Ie=window,xe=()=>{Z("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,t,n;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");be=t[0],Q=void 0===t[1]?Q:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),F=void 0===t[6]?F:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],W=t[9],oe=t[10],Pe=void 0===t[11]?Pe:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ae=t[20]||Ae,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:be,enabled:ye},R.label(`${e.id}`),I=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(Y("offset","offsetSize"),ie&&(m=e?.offset),re&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(m=e?.offsetSize),re&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===ge)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ne=t(Ne,"width"),q(`Set TargetOrigin for parent: %c${Me}`,f))}(),_e(),function(){try{Ee=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?_(`${P(ge+2)}${P(2)}`):Ae.codePointAt(0)>4||ge<2&&_(P(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==h&&J(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${h}.\n`):J("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&J("<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</>.")}(),"BackCompat"===document.compatMode&&J("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===F?(F=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),vt(0,0,"autoResize",JSON.stringify(F)),F),close(){vt(0,0,"close")},getId:()=>be,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),x),getParentOrigin:()=>x,getPageInfo(e){if("function"==typeof e)return qe=e,vt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,vt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}},getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){m=e,M=e,ht(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){vt(t,e,"scrollBy")},scrollTo(e,t){vt(t,e,"scrollTo")},scrollToOffset(e,t){vt(t,e,"scrollToOffset")},sendMessage(e,t){vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Me=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){O(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),he=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){O(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return he.enable&&(1===ge?J("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ne&&(ne=`${Q}px`),Ze("margin",(t="margin",(n=ne).includes("-")&&(Z(`Negative CSS value ignored for ${t}`),n=""),n)),Ze("background",W),Ze("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){H("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),Fe(),n=!1,ht(k,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;K(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{q("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[b],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:De,root:document.documentElement,side:ie?z:w})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${v}]:not([${b}]):not([${b}] *)`),se=we.length>0}function De(e){Fe(),(se||e)&&ht(j,"Overflow updated")}function We(){ke=document.querySelectorAll(`[${g}]`),ce=ke.length>0}function Ve(e){ce||ze(e)}let He=0;function Ue(){const n=document.querySelectorAll(`*[${b}]`);le=n.length>0,le&&n.length!==He&&(function(n){const o=1===n.length?"":"s";Z(`%c[${b}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),He=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,f))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,g,je),Je(0,b,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,O(window,t,n,{passive:!0})},remove(e){const t=a[e];var n,o;delete a[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ge(e,t,n,o){return t!==e&&(e in n||(Z(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&J(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you remove this option.`)),e}function Xe(){de=Ge(de,s,ct,"height")}function Ye(){Ne=Ge(Ne,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(E,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(e){performance.mark(ee);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const s=ce?ke:se?we:it(document)();let c=s.length;for(const t of s)ce||!l||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):c-=1;return q(`${t} position calculated from:`,r),performance.mark(te,{detail:{Side:t,len:c,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{Ue();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return le&&t.push(`not([${b}])`,`not([${b}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[f,p,f];function st(e){function t(){return at[o]=i,rt[o]=l,i}const n=e===ct,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:q("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===rt[o]:q(`Initial page size values: ${s}`,...lt),c=t();break;case Ce&&i===at[o]&&l===rt[o]:q(`Size unchanged: ${s}`,...lt),c=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&i!==at[o]&&l<=rt[o]:q(`New <html> size: ${s} `,...lt),q(`Previous <html> size: %c${at[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!se&&i<at[o]:q(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===r:q(`<html> size equals page size: ${s}`,...lt),c=t();break;case i>l:q(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:q("Found element overflowing <html> "),c=e.taggedElement();break;default:q(`Using <html> size: ${s}`,...lt),c=t()}return q(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,f),t}(e),c}const ct={enabled:()=>ie,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(z),taggedElement:()=>nt(z)},ut={enabled:()=>re,getOffset:()=>M,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(w),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(w)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===S:vt(ue,Te,e,i);break;case!e!==$&&(ie&&de in u||re&&Ne in u):gt();break;case e===E:case e===j:case e===k:U();break;default:U(),q("No change in content size detected")}L=!1}let ft=!1;const pt=C((()=>_(P(4)))),ht=V(((e,t,n,o,i)=>{B=performance.now(),H(e),F||e===$?document.hidden||(ft||(L=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):q("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),vt(ue,Te,e)}function gt(e){const t=de;de=s,Ce||(Ce=!0,requestAnimationFrame((()=>{Ce=!1}))),yt("reset"),de=t}const vt=V((function(e,t,o,i,r){ge<-1||(H(o),void 0!==r||(r=Me),function(){const a=`${be}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ge)throw e;return void pt()}else Oe.postMessage(c+a,r);L&&q(function(){const e=T(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),q("Sending message to host page via "+(Ee?"sameDomain":"postMessage")),q(`%c${a}`,n)}(),D())})),bt=V((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){pe=e.data,Oe=e.source,x=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht($,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Z(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(H(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Z("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>bt({data:e,sameDomain:!0}))),O(window,"message",bt),O(window,"readystatechange",zt),zt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.0 (umd) - 2025-03-31
4
+ * @module iframe-resizer/legacy (parent) 5.4.1 (umd) - 2025-03-31
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,4 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,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={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:r,keys:a}=Object,s=e=>[e,console[e]],l=e=>t=>[t,function(n){e[t]=n}],c=(e,t)=>r(a(e).map(t));const u=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),d=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.0",h="iframeResizer",m="[iFrameSizer]",y=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),g=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)),w=e=>e,b=(v=function(r={}){const a={},u={},d=[],f={...o,...r};let p;function h(){d.length=0}function m(){delete f.event,h()}const y=()=>!d.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function g(){if(0!==d.length){console[y()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,"font-weight: bold;",t);for(const[e,...t]of d)console[e](...t);console.groupEnd(),m()}else m()}function w(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function b(e,...t){0===d.length&&w(),d.push([e,...t])}function v(e=n,...t){b("log",`${e}: ${performance.now()-a[e]} ms`,...t)}return{...c(f,l(f)),...c(console,(e=>[e,(...t)=>b(e,...t)])),...c(i,s),count:function(e=n){u[e]?u[e]+=1:u[e]=1,b("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:g,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){b("error",e)}return n},purge:h,time:function(e=n){a[e]=performance.now()},timeEnd:function(e=n){v(e),delete a[e]},timeLog:v}},v?.__esModule?v.default:v);var v;let z={},$=!1;const j=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...n)=>z[t]?.console[e](...n),T=(M="info",(e,...t)=>!0===(e=>z[e]?z[e].log:$)(e)?k(M)(e,...t):null);var M;const R=k("warn"),E=k("event");const S=(e,...t)=>z[e]?z[e].console.warn(g(w)(...t)):queueMicrotask((()=>console?.warn(g((e=>(...t)=>[`${h}(${e})`,...t].join(" "))(e))(...t)))),x=(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</>.`))(S),I=x("Function"),O=x("Option"),C=(e,t,n,o)=>e.addEventListener(t,n,o||!1),W=(e,t,n)=>e.removeEventListener(t,n,!1),A=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)},F=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),L=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],N=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],B=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),H=e=>F(L[e]),P=e=>{const t=e[F("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(F(e));return n in B&&(t=B[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},D={},q=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!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",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof D[e.id].onInit&&(O("init()","onReady()","",e.id),D[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),J={position:null,version:p};function U(e){function t(){K(M),_(x),$("onResized",M)}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=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ee(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{D[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(){a(0,W),c.disconnect(),u.disconnect()}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));a(0,C),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(D[l].iframe,{attributes:!0,childList:!1,subtree:!1}),D[l]&&(D[l][`stop${t}`]=s)},s=e=>()=>{e in D[x]&&(D[x][e](),delete D[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=M.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}=M,{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"),h=a(c,"ParentInfo"),y=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return X(),{x:Number(t.left)+Number(J.position.x),y:Number(t.top)+Number(J.position.y)}}function b(e){const t=e?w(M.iframe):{x:0,y:0};T(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,d,f,d);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(M,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){J.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=J.position,o=D[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?_(e):Y()}function z(e){let t={};if(0===M.width&&0===M.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:M.width,y:M.height};$(e,{iframe:M.iframe,screenX:Number(t.x),screenY:Number(t.y),type:M.type})}const $=(e,t)=>Z(x,e,t);function j(){switch(D[x]?.firstRun&&D[x]&&(D[x].firstRun=!1),M.type){case"close":G(M.iframe);break;case"message":n=i(6),$("onMessage",{iframe:M.iframe,message:JSON.parse(n)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":D[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=M.width,t=M.height,n=window.parentIframe||window.parentIFrame||window;T(x,`scrollBy: x: %c${e}%c y: %c${t}`,d,f,d),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":l("start",x),u();break;case"parentInfo":c("start",x),h();break;case"pageInfoStop":y();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=w(o);T(x,`Moving to in page link: %c#${t}`,d),J.position={x:e.x,y:e.y},v(x),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){D[t]?.syncTitle&&(D[t].iframe.title=e,T(t,`Set iframe title attribute: %c${e}`,d))}(M.msg,x);break;case"reset":Q(M);break;case"init":t(),function(e){try{D[e].sameDomain=!!D[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){D[e].sameDomain=!1}}(x),(e=M.msg)!==p&&(void 0!==e||S(x,"<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")),oe=!0,$("onReady",M.iframe);break;default:if(0===M.width&&0===M.height)return void R(x,`Unsupported message received (${M.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===M.width||0===M.height)return;if(document.hidden)return;t()}var e,n}let k=e.data,M={},x=null;"[iFrameResizerChild]Ready"!==k?m===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in D&&(M=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=D[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=M.id,x?(E(x,M.type),D[x].errorBoundary((function(){!function(e){if(!D[e])throw new Error(`${M.type} No settings for ${e}. Message was: ${k}`)}(x),M.type in{true:1,false:1,undefined:1}||(D[x].loaded=!0,(null!==M.iframe||(R(x,`The iframe (${M.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:n}=e;if(n)return!0;let o=D[x]?.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=D[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${M.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())}))()):R("","iframeResizer received messageData without id, message was: ",k)):Object.keys(D).forEach((e=>{D[e].mode>=0&&ee("iFrame requested init",te(e),e)}))}function Z(e,t,n){let o=null,i=null;if(D[e]){if(o=D[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),R(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function V(e){const{id:t}=e;delete D[t]}function G(e){const{id:t}=e;if(!1!==Z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){R(t,e)}Z(t,"onClosed",t),V(e)}}function X(e){null===J.position&&(J.position={x:window.scrollX,y:window.scrollY})}function Y(){J.position=null}function _(e){null!==J.position&&(window.scrollTo(J.position.x,J.position.y),T(e,`Set page position: %c${J.position.x}%c, %c${J.position.y}`,d,f,d),Y())}function Q(e){X(e.id),K(e),ee("reset","reset",e.id)}function K(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,T(n,`Set ${t}: %c${o}`,d)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=D[n];o&&t("height"),i&&t("width")}function ee(e,t,n,o){E(n,e),D[n]&&(D[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:i,targetOrigin:r}=D[n];if(i)try{return void e.contentWindow.iframeChildListener(m+t)}catch(e){}o.postMessage(m+t,r)}():R(n,`Iframe(${n}) not found`),o&&D[n]?.warningTimeout&&(D[n].msgTimeout=setTimeout((function(){if(void 0===D[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=D[n],{sandbox:r}=e;t||o||(D[n].loadErrorShown=!0,S(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${D[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This 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`))}),D[n].warningTimeout)))}function te(e){const t=D[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,J.version,t.mode].join(":")}z=D;let ne=0,oe=!1,ie=!1;const re=t=>n=>{function o(e){const{id:t}=n,{mode:o,waitForLoad:i}=D[t];-1!==o&&-2!==o&&(C(n,"load",(function(){ee("iFrame.onload",`${e}:${oe}`,t,!0),function(){const e=D[u]?.firstRun,t=D[u]?.heightCalculationMethod in y;!e&&t&&Q({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&ee("init",`${e}:${oe}`,t,!0))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&S(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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function r(){const{mode:n}=D[u];ie||n>0&&t.vInfoDisable||(ie=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,$||n<1?"font-weight: bold;":e)))}(`v${p} (${(e=>F(N[e]))(n)})`,n)),n<0?S("Parent",`${H(n+2)}${H(2)}`):n<1&&S("Parent",H(3))}function a(e){const t=D[e]?.iframe?.title;return""===t||void 0===t}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var t,o;D[u]={...D[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...q,...i(e),mouseEvents:s(e),mode:P(e),syncTitle:a(u)},E(u,"setup"),function(){const{direction:e}=D[u];if("horizontal"===e)return D[u].sizeWidth=!0,void(D[u].sizeHeight=!1);if("none"===e)return D[u].sizeWidth=!1,D[u].sizeHeight=!1,void(D[u].autoResize=!1);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===D[u].direction?D[u].offsetHeight=t:D[u].offsetWidth=t),e?.offset&&S(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</>."),null===D[u].postMessageTarget&&(D[u].postMessageTarget=n.contentWindow),D[u].targetOrigin=!0===D[u].checkOrigin?""===(o=D[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||q.id+ne++;return null!==document.getElementById(e)&&(e+=ne++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,iframeId:t}){const n=b({label:j(t)});$=e,z[t]||(z[t]={console:n,errorBoundary:n.errorBoundary})}({enabled:Object.hasOwn(t,"log")?t.log:q.log,iframeId:u}),D[u].errorBoundary((function(e){c()?R(u,`Ignored iframe (${u}), already setup.`):(l(e),r(),se(),function(){switch(n.style.overflow=!1===D[u]?.scrolling?"hidden":"auto",D[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=D[u]?D[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=D[u];"number"!=typeof e&&"0"!==e||(D[u].bodyMargin=`${e}px`)}(),o(te(u)),function(){if(D[u]){const{iframe:e}=D[u],t={close:G.bind(null,e),disconnect:V.bind(null,e),removeListeners(){S(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:ee.bind(null,"Window resize","resize",u),moveToAnchor(e){ee("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ee("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}())}))(t),n?.iFrameResizer};function ae(){!1===document.hidden&&function(e,t){const n=e=>D[e]?.autoResize&&!D[e]?.firstRun;Object.keys(D).forEach((function(o){n(o)&&ee(e,t,o)}))}("Tab Visible","resize")}const se=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{C(window,"message",U),C(document,"visibilitychange",ae),window.iframeParentListener=e=>setTimeout((()=>U({data:e,sameDomain:!0})))})),le=`[${h}] `;const ce=function(){function e(e){switch(!0){case!e:throw new TypeError(`${le}iframe is not defined`);case!e.tagName:throw new TypeError(`${le}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${le}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=re(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${le}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){I("iFrameResize()","iframeResize()","","parent"),ce(...e)}),ce}));
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={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:r,keys:a}=Object,s=e=>[e,console[e]],l=e=>t=>[t,function(n){e[t]=n}],c=(e,t)=>r(a(e).map(t));const u=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),d=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.1",h="iframeResizer",m="[iFrameSizer]",y=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),g=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)),w=e=>e,b=(v=function(r={}){const a={},u={},d=[],f={...o,...r};let p;function h(){d.length=0}function m(){delete f.event,h()}const y=()=>!d.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function g(){if(0!==d.length){console[y()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,"font-weight: bold;",t);for(const[e,...t]of d)console[e](...t);console.groupEnd(),m()}else m()}function w(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function b(e,...t){0===d.length&&w(),d.push([e,...t])}function v(e=n,...t){b("log",`${e}: ${performance.now()-a[e]} ms`,...t)}return{...c(f,l(f)),...c(console,(e=>[e,(...t)=>b(e,...t)])),...c(i,s),count:function(e=n){u[e]?u[e]+=1:u[e]=1,b("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:g,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){b("error",e)}return n},purge:h,time:function(e=n){a[e]=performance.now()},timeEnd:function(e=n){v(e),delete a[e]},timeLog:v}},v?.__esModule?v.default:v);var v;let z={},$=!1;const j=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...n)=>z[t]?.console[e](...n),T=(M="info",(e,...t)=>!0===(e=>z[e]?z[e].log:$)(e)?k(M)(e,...t):null);var M;const R=k("warn"),E=k("event");const S=(e,...t)=>z[e]?z[e].console.warn(g(w)(...t)):queueMicrotask((()=>console?.warn(g((e=>(...t)=>[`${h}(${e})`,...t].join(" "))(e))(...t)))),x=(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</>.`))(S),I=x("Function"),O=x("Option"),C=(e,t,n,o)=>e.addEventListener(t,n,o||!1),W=(e,t,n)=>e.removeEventListener(t,n,!1),A=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)},F=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),L=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],N=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],B=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),H=e=>F(L[e]),P=e=>{const t=e[F("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(F(e));return n in B&&(t=B[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},D={},q=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!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",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof D[e.id].onInit&&(O("init()","onReady()","",e.id),D[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),J={position:null,version:p};function U(e){function t(){K(M),_(x),$("onResized",M)}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=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ee(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{D[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(){a(0,W),c.disconnect(),u.disconnect()}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));a(0,C),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(D[l].iframe,{attributes:!0,childList:!1,subtree:!1}),D[l]&&(D[l][`stop${t}`]=s)},s=e=>()=>{e in D[x]&&(D[x][e](),delete D[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=M.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}=M,{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"),h=a(c,"ParentInfo"),y=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return X(),{x:Number(t.left)+Number(J.position.x),y:Number(t.top)+Number(J.position.y)}}function b(e){const t=e?w(M.iframe):{x:0,y:0};T(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,d,f,d);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(M,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){J.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=J.position,o=D[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?_(e):Y()}function z(e){let t={};if(0===M.width&&0===M.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:M.width,y:M.height};$(e,{iframe:M.iframe,screenX:Number(t.x),screenY:Number(t.y),type:M.type})}const $=(e,t)=>Z(x,e,t);function j(){switch(D[x]?.firstRun&&D[x]&&(D[x].firstRun=!1),M.type){case"close":G(M.iframe);break;case"message":n=i(6),$("onMessage",{iframe:M.iframe,message:JSON.parse(n)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":D[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=M.width,t=M.height,n=window.parentIframe||window.parentIFrame||window;T(x,`scrollBy: x: %c${e}%c y: %c${t}`,d,f,d),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":l("start",x),u();break;case"parentInfo":c("start",x),h();break;case"pageInfoStop":y();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=w(o);T(x,`Moving to in page link: %c#${t}`,d),J.position={x:e.x,y:e.y},v(x),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){D[t]?.syncTitle&&(D[t].iframe.title=e,T(t,`Set iframe title attribute: %c${e}`,d))}(M.msg,x);break;case"reset":Q(M);break;case"init":t(),function(e){try{D[e].sameDomain=!!D[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){D[e].sameDomain=!1}}(x),(e=M.msg)!==p&&(void 0!==e||S(x,"<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")),oe=!0,$("onReady",M.iframe);break;default:if(0===M.width&&0===M.height)return void R(x,`Unsupported message received (${M.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===M.width||0===M.height)return;if(document.hidden)return;t()}var e,n}let k=e.data,M={},x=null;"[iFrameResizerChild]Ready"!==k?m===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in D&&(M=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=D[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=M.id,x?(E(x,M.type),D[x].errorBoundary((function(){!function(e){if(!D[e])throw new Error(`${M.type} No settings for ${e}. Message was: ${k}`)}(x),M.type in{true:1,false:1,undefined:1}||(D[x].loaded=!0,(null!==M.iframe||(R(x,`The iframe (${M.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:n}=e;if(n)return!0;let o=D[x]?.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=D[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${M.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())}))()):R("","iframeResizer received messageData without id, message was: ",k)):Object.keys(D).forEach((e=>{D[e].mode>=0&&ee("iFrame requested init",te(e),e)}))}function Z(e,t,n){let o=null,i=null;if(D[e]){if(o=D[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),R(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function V(e){const{id:t}=e;delete D[t]}function G(e){const{id:t}=e;if(!1!==Z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){R(t,e)}Z(t,"onClosed",t),V(e)}}function X(e){null===J.position&&(J.position={x:window.scrollX,y:window.scrollY})}function Y(){J.position=null}function _(e){null!==J.position&&(window.scrollTo(J.position.x,J.position.y),T(e,`Set page position: %c${J.position.x}%c, %c${J.position.y}`,d,f,d),Y())}function Q(e){X(e.id),K(e),ee("reset","reset",e.id)}function K(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,T(n,`Set ${t}: %c${o}`,d)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=D[n];o&&t("height"),i&&t("width")}function ee(e,t,n,o){E(n,e),D[n]&&(D[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:i,targetOrigin:r}=D[n];if(i)try{return void e.contentWindow.iframeChildListener(m+t)}catch(e){}o.postMessage(m+t,r)}():R(n,`Iframe(${n}) not found`),o&&D[n]?.warningTimeout&&(D[n].msgTimeout=setTimeout((function(){if(void 0===D[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=D[n],{sandbox:r}=e;t||o||(D[n].loadErrorShown=!0,S(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${D[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This 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`))}),D[n].warningTimeout)))}function te(e){const t=D[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,J.version,t.mode].join(":")}z=D;let ne=0,oe=!1,ie=!1;const re=t=>n=>{function o(e){const{id:t}=n,{mode:o,waitForLoad:i}=D[t];-1!==o&&-2!==o&&(C(n,"load",(function(){ee("iFrame.onload",`${e}:${oe}`,t,!0),function(){const e=D[u]?.firstRun,t=D[u]?.heightCalculationMethod in y;!e&&t&&Q({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&ee("init",`${e}:${oe}`,t,!0))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&S(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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function r(){const{mode:n}=D[u];ie||n>0&&t.vInfoDisable||(ie=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,$||n<1?"font-weight: bold;":e)))}(`v${p} (${(e=>F(N[e]))(n)})`,n)),n<0?S("Parent",`${H(n+2)}${H(2)}`):n<1&&S("Parent",H(3))}function a(e){const t=D[e]?.iframe?.title;return""===t||void 0===t}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var t,o;D[u]={...D[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...q,...i(e),mouseEvents:s(e),mode:P(e),syncTitle:a(u)},E(u,"setup"),function(){const{direction:e}=D[u];if("horizontal"===e)return D[u].sizeWidth=!0,void(D[u].sizeHeight=!1);if("none"===e)return D[u].sizeWidth=!1,D[u].sizeHeight=!1,void(D[u].autoResize=!1);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===D[u].direction?D[u].offsetHeight=t:D[u].offsetWidth=t),e?.offset&&S(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</>."),null===D[u].postMessageTarget&&(D[u].postMessageTarget=n.contentWindow),D[u].targetOrigin=!0===D[u].checkOrigin?""===(o=D[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||q.id+ne++;return null!==document.getElementById(e)&&(e+=ne++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,iframeId:t}){const n=b({label:j(t)});$=e,z[t]||(z[t]={console:n,errorBoundary:n.errorBoundary})}({enabled:Object.hasOwn(t,"log")?t.log:q.log,iframeId:u}),D[u].errorBoundary((function(e){c()?R(u,`Ignored iframe (${u}), already setup.`):(l(e),r(),se(),function(){switch(n.style.overflow=!1===D[u]?.scrolling?"hidden":"auto",D[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=D[u]?D[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=D[u];"number"!=typeof e&&"0"!==e||(D[u].bodyMargin=`${e}px`)}(),o(te(u)),function(){if(D[u]){const{iframe:e}=D[u],t={close:G.bind(null,e),disconnect:V.bind(null,e),removeListeners(){S(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:ee.bind(null,"Window resize","resize",u),moveToAnchor(e){ee("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ee("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}())}))(t),n?.iFrameResizer};function ae(){!1===document.hidden&&function(e,t){const n=e=>D[e]?.autoResize&&!D[e]?.firstRun;Object.keys(D).forEach((function(o){n(o)&&ee(e,t,o)}))}("Tab Visible","resize")}const se=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{C(window,"message",U),C(document,"visibilitychange",ae),window.iframeParentListener=e=>setTimeout((()=>U({data:e,sameDomain:!0})))})),le=`[${h}] `;const ce=function(){function e(e){switch(!0){case!e:throw new TypeError(`${le}iframe is not defined`);case!e.tagName:throw new TypeError(`${le}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${le}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=re(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${le}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){I("iFrameResize()","iframeResize()","","parent"),ce(...e)}),ce}));
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.0 (umd) - 2025-03-31
4
+ * @module iframe-resizer/legacy (parent) 5.4.1 (umd) - 2025-03-31
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,4 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,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={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:r,keys:a}=Object,s=e=>[e,console[e]],l=e=>t=>[t,function(n){e[t]=n}],c=(e,t)=>r(a(e).map(t));const u=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),d=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.0",h="iframeResizer",m="[iFrameSizer]",y=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),g=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)),w=e=>e,b=(v=function(r={}){const a={},u={},d=[],f={...o,...r};let p;function h(){d.length=0}function m(){delete f.event,h()}const y=()=>!d.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function g(){if(0!==d.length){console[y()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,"font-weight: bold;",t);for(const[e,...t]of d)console[e](...t);console.groupEnd(),m()}else m()}function w(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function b(e,...t){0===d.length&&w(),d.push([e,...t])}function v(e=n,...t){b("log",`${e}: ${performance.now()-a[e]} ms`,...t)}return{...c(f,l(f)),...c(console,(e=>[e,(...t)=>b(e,...t)])),...c(i,s),count:function(e=n){u[e]?u[e]+=1:u[e]=1,b("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:g,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){b("error",e)}return n},purge:h,time:function(e=n){a[e]=performance.now()},timeEnd:function(e=n){v(e),delete a[e]},timeLog:v}},v?.__esModule?v.default:v);var v;let z={},$=!1;const j=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...n)=>z[t]?.console[e](...n),T=(M="info",(e,...t)=>!0===(e=>z[e]?z[e].log:$)(e)?k(M)(e,...t):null);var M;const R=k("warn"),E=k("event");const S=(e,...t)=>z[e]?z[e].console.warn(g(w)(...t)):queueMicrotask((()=>console?.warn(g((e=>(...t)=>[`${h}(${e})`,...t].join(" "))(e))(...t)))),x=(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</>.`))(S),I=x("Function"),O=x("Option"),C=(e,t,n,o)=>e.addEventListener(t,n,o||!1),W=(e,t,n)=>e.removeEventListener(t,n,!1),A=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)},F=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),L=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],N=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],B=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),H=e=>F(L[e]),P=e=>{const t=e[F("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(F(e));return n in B&&(t=B[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},D={},q=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!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",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof D[e.id].onInit&&(O("init()","onReady()","",e.id),D[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),J={position:null,version:p};function U(e){function t(){K(M),_(x),$("onResized",M)}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=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ee(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{D[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(){a(0,W),c.disconnect(),u.disconnect()}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));a(0,C),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(D[l].iframe,{attributes:!0,childList:!1,subtree:!1}),D[l]&&(D[l][`stop${t}`]=s)},s=e=>()=>{e in D[x]&&(D[x][e](),delete D[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=M.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}=M,{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"),h=a(c,"ParentInfo"),y=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return X(),{x:Number(t.left)+Number(J.position.x),y:Number(t.top)+Number(J.position.y)}}function b(e){const t=e?w(M.iframe):{x:0,y:0};T(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,d,f,d);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(M,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){J.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=J.position,o=D[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?_(e):Y()}function z(e){let t={};if(0===M.width&&0===M.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:M.width,y:M.height};$(e,{iframe:M.iframe,screenX:Number(t.x),screenY:Number(t.y),type:M.type})}const $=(e,t)=>Z(x,e,t);function j(){switch(D[x]?.firstRun&&D[x]&&(D[x].firstRun=!1),M.type){case"close":G(M.iframe);break;case"message":n=i(6),$("onMessage",{iframe:M.iframe,message:JSON.parse(n)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":D[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=M.width,t=M.height,n=window.parentIframe||window.parentIFrame||window;T(x,`scrollBy: x: %c${e}%c y: %c${t}`,d,f,d),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":l("start",x),u();break;case"parentInfo":c("start",x),h();break;case"pageInfoStop":y();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=w(o);T(x,`Moving to in page link: %c#${t}`,d),J.position={x:e.x,y:e.y},v(x),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){D[t]?.syncTitle&&(D[t].iframe.title=e,T(t,`Set iframe title attribute: %c${e}`,d))}(M.msg,x);break;case"reset":Q(M);break;case"init":t(),function(e){try{D[e].sameDomain=!!D[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){D[e].sameDomain=!1}}(x),(e=M.msg)!==p&&(void 0!==e||S(x,"<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")),oe=!0,$("onReady",M.iframe);break;default:if(0===M.width&&0===M.height)return void R(x,`Unsupported message received (${M.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===M.width||0===M.height)return;if(document.hidden)return;t()}var e,n}let k=e.data,M={},x=null;"[iFrameResizerChild]Ready"!==k?m===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in D&&(M=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=D[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=M.id,x?(E(x,M.type),D[x].errorBoundary((function(){!function(e){if(!D[e])throw new Error(`${M.type} No settings for ${e}. Message was: ${k}`)}(x),M.type in{true:1,false:1,undefined:1}||(D[x].loaded=!0,(null!==M.iframe||(R(x,`The iframe (${M.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:n}=e;if(n)return!0;let o=D[x]?.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=D[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${M.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())}))()):R("","iframeResizer received messageData without id, message was: ",k)):Object.keys(D).forEach((e=>{D[e].mode>=0&&ee("iFrame requested init",te(e),e)}))}function Z(e,t,n){let o=null,i=null;if(D[e]){if(o=D[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),R(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function V(e){const{id:t}=e;delete D[t]}function G(e){const{id:t}=e;if(!1!==Z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){R(t,e)}Z(t,"onClosed",t),V(e)}}function X(e){null===J.position&&(J.position={x:window.scrollX,y:window.scrollY})}function Y(){J.position=null}function _(e){null!==J.position&&(window.scrollTo(J.position.x,J.position.y),T(e,`Set page position: %c${J.position.x}%c, %c${J.position.y}`,d,f,d),Y())}function Q(e){X(e.id),K(e),ee("reset","reset",e.id)}function K(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,T(n,`Set ${t}: %c${o}`,d)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=D[n];o&&t("height"),i&&t("width")}function ee(e,t,n,o){E(n,e),D[n]&&(D[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:i,targetOrigin:r}=D[n];if(i)try{return void e.contentWindow.iframeChildListener(m+t)}catch(e){}o.postMessage(m+t,r)}():R(n,`Iframe(${n}) not found`),o&&D[n]?.warningTimeout&&(D[n].msgTimeout=setTimeout((function(){if(void 0===D[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=D[n],{sandbox:r}=e;t||o||(D[n].loadErrorShown=!0,S(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${D[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This 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`))}),D[n].warningTimeout)))}function te(e){const t=D[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,J.version,t.mode].join(":")}z=D;let ne=0,oe=!1,ie=!1;const re=t=>n=>{function o(e){const{id:t}=n,{mode:o,waitForLoad:i}=D[t];-1!==o&&-2!==o&&(C(n,"load",(function(){ee("iFrame.onload",`${e}:${oe}`,t,!0),function(){const e=D[u]?.firstRun,t=D[u]?.heightCalculationMethod in y;!e&&t&&Q({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&ee("init",`${e}:${oe}`,t,!0))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&S(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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function r(){const{mode:n}=D[u];ie||n>0&&t.vInfoDisable||(ie=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,$||n<1?"font-weight: bold;":e)))}(`v${p} (${(e=>F(N[e]))(n)})`,n)),n<0?S("Parent",`${H(n+2)}${H(2)}`):n<1&&S("Parent",H(3))}function a(e){const t=D[e]?.iframe?.title;return""===t||void 0===t}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var t,o;D[u]={...D[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...q,...i(e),mouseEvents:s(e),mode:P(e),syncTitle:a(u)},E(u,"setup"),function(){const{direction:e}=D[u];if("horizontal"===e)return D[u].sizeWidth=!0,void(D[u].sizeHeight=!1);if("none"===e)return D[u].sizeWidth=!1,D[u].sizeHeight=!1,void(D[u].autoResize=!1);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===D[u].direction?D[u].offsetHeight=t:D[u].offsetWidth=t),e?.offset&&S(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</>."),null===D[u].postMessageTarget&&(D[u].postMessageTarget=n.contentWindow),D[u].targetOrigin=!0===D[u].checkOrigin?""===(o=D[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||q.id+ne++;return null!==document.getElementById(e)&&(e+=ne++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,iframeId:t}){const n=b({label:j(t)});$=e,z[t]||(z[t]={console:n,errorBoundary:n.errorBoundary})}({enabled:Object.hasOwn(t,"log")?t.log:q.log,iframeId:u}),D[u].errorBoundary((function(e){c()?R(u,`Ignored iframe (${u}), already setup.`):(l(e),r(),se(),function(){switch(n.style.overflow=!1===D[u]?.scrolling?"hidden":"auto",D[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=D[u]?D[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=D[u];"number"!=typeof e&&"0"!==e||(D[u].bodyMargin=`${e}px`)}(),o(te(u)),function(){if(D[u]){const{iframe:e}=D[u],t={close:G.bind(null,e),disconnect:V.bind(null,e),removeListeners(){S(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:ee.bind(null,"Window resize","resize",u),moveToAnchor(e){ee("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ee("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}())}))(t),n?.iFrameResizer};function ae(){!1===document.hidden&&function(e,t){const n=e=>D[e]?.autoResize&&!D[e]?.firstRun;Object.keys(D).forEach((function(o){n(o)&&ee(e,t,o)}))}("Tab Visible","resize")}const se=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{C(window,"message",U),C(document,"visibilitychange",ae),window.iframeParentListener=e=>setTimeout((()=>U({data:e,sameDomain:!0})))})),le=`[${h}] `;const ce=function(){function e(e){switch(!0){case!e:throw new TypeError(`${le}iframe is not defined`);case!e.tagName:throw new TypeError(`${le}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${le}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=re(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${le}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){I("iFrameResize()","iframeResize()","","parent"),ce(...e)}),ce}));
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={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},i={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:r,keys:a}=Object,s=e=>[e,console[e]],l=e=>t=>[t,function(n){e[t]=n}],c=(e,t)=>r(a(e).map(t));const u=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),d=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.1",h="iframeResizer",m="[iFrameSizer]",y=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),g=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)),w=e=>e,b=(v=function(r={}){const a={},u={},d=[],f={...o,...r};let p;function h(){d.length=0}function m(){delete f.event,h()}const y=()=>!d.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function g(){if(0!==d.length){console[y()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,"font-weight: bold;",t);for(const[e,...t]of d)console[e](...t);console.groupEnd(),m()}else m()}function w(){p=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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function b(e,...t){0===d.length&&w(),d.push([e,...t])}function v(e=n,...t){b("log",`${e}: ${performance.now()-a[e]} ms`,...t)}return{...c(f,l(f)),...c(console,(e=>[e,(...t)=>b(e,...t)])),...c(i,s),count:function(e=n){u[e]?u[e]+=1:u[e]=1,b("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:g,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){b("error",e)}return n},purge:h,time:function(e=n){a[e]=performance.now()},timeEnd:function(e=n){v(e),delete a[e]},timeLog:v}},v?.__esModule?v.default:v);var v;let z={},$=!1;const j=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...n)=>z[t]?.console[e](...n),T=(M="info",(e,...t)=>!0===(e=>z[e]?z[e].log:$)(e)?k(M)(e,...t):null);var M;const R=k("warn"),E=k("event");const S=(e,...t)=>z[e]?z[e].console.warn(g(w)(...t)):queueMicrotask((()=>console?.warn(g((e=>(...t)=>[`${h}(${e})`,...t].join(" "))(e))(...t)))),x=(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</>.`))(S),I=x("Function"),O=x("Option"),C=(e,t,n,o)=>e.addEventListener(t,n,o||!1),W=(e,t,n)=>e.removeEventListener(t,n,!1),A=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)},F=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),L=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<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."],N=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],B=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),H=e=>F(L[e]),P=e=>{const t=e[F("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=A(F(e));return n in B&&(t=B[n]),t}(n[0]);return 0===o||(e=>e[2]===A(e[0]+e[1]))(n)||(o=-2),o},D={},q=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!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",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof D[e.id].onInit&&(O("init()","onReady()","",e.id),D[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),J={position:null,version:p};function U(e){function t(){K(M),_(x),$("onResized",M)}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=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ee(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{D[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(){a(0,W),c.disconnect(),u.disconnect()}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));a(0,C),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(D[l].iframe,{attributes:!0,childList:!1,subtree:!1}),D[l]&&(D[l][`stop${t}`]=s)},s=e=>()=>{e in D[x]&&(D[x][e](),delete D[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=M.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}=M,{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"),h=a(c,"ParentInfo"),y=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return X(),{x:Number(t.left)+Number(J.position.x),y:Number(t.top)+Number(J.position.y)}}function b(e){const t=e?w(M.iframe):{x:0,y:0};T(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,d,f,d);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(M,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){J.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=J.position,o=D[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?_(e):Y()}function z(e){let t={};if(0===M.width&&0===M.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:M.width,y:M.height};$(e,{iframe:M.iframe,screenX:Number(t.x),screenY:Number(t.y),type:M.type})}const $=(e,t)=>Z(x,e,t);function j(){switch(D[x]?.firstRun&&D[x]&&(D[x].firstRun=!1),M.type){case"close":G(M.iframe);break;case"message":n=i(6),$("onMessage",{iframe:M.iframe,message:JSON.parse(n)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":D[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=M.width,t=M.height,n=window.parentIframe||window.parentIFrame||window;T(x,`scrollBy: x: %c${e}%c y: %c${t}`,d,f,d),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":l("start",x),u();break;case"parentInfo":c("start",x),h();break;case"pageInfoStop":y();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=w(o);T(x,`Moving to in page link: %c#${t}`,d),J.position={x:e.x,y:e.y},v(x),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){D[t]?.syncTitle&&(D[t].iframe.title=e,T(t,`Set iframe title attribute: %c${e}`,d))}(M.msg,x);break;case"reset":Q(M);break;case"init":t(),function(e){try{D[e].sameDomain=!!D[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){D[e].sameDomain=!1}}(x),(e=M.msg)!==p&&(void 0!==e||S(x,"<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")),oe=!0,$("onReady",M.iframe);break;default:if(0===M.width&&0===M.height)return void R(x,`Unsupported message received (${M.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===M.width||0===M.height)return;if(document.hidden)return;t()}var e,n}let k=e.data,M={},x=null;"[iFrameResizerChild]Ready"!==k?m===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in D&&(M=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=D[e[0]]?.iframe,r=getComputedStyle(i);return{iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),x=M.id,x?(E(x,M.type),D[x].errorBoundary((function(){!function(e){if(!D[e])throw new Error(`${M.type} No settings for ${e}. Message was: ${k}`)}(x),M.type in{true:1,false:1,undefined:1}||(D[x].loaded=!0,(null!==M.iframe||(R(x,`The iframe (${M.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:n}=e;if(n)return!0;let o=D[x]?.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=D[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${M.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())}))()):R("","iframeResizer received messageData without id, message was: ",k)):Object.keys(D).forEach((e=>{D[e].mode>=0&&ee("iFrame requested init",te(e),e)}))}function Z(e,t,n){let o=null,i=null;if(D[e]){if(o=D[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),R(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function V(e){const{id:t}=e;delete D[t]}function G(e){const{id:t}=e;if(!1!==Z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){R(t,e)}Z(t,"onClosed",t),V(e)}}function X(e){null===J.position&&(J.position={x:window.scrollX,y:window.scrollY})}function Y(){J.position=null}function _(e){null!==J.position&&(window.scrollTo(J.position.x,J.position.y),T(e,`Set page position: %c${J.position.x}%c, %c${J.position.y}`,d,f,d),Y())}function Q(e){X(e.id),K(e),ee("reset","reset",e.id)}function K(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,T(n,`Set ${t}: %c${o}`,d)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=D[n];o&&t("height"),i&&t("width")}function ee(e,t,n,o){E(n,e),D[n]&&(D[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameDomain:i,targetOrigin:r}=D[n];if(i)try{return void e.contentWindow.iframeChildListener(m+t)}catch(e){}o.postMessage(m+t,r)}():R(n,`Iframe(${n}) not found`),o&&D[n]?.warningTimeout&&(D[n].msgTimeout=setTimeout((function(){if(void 0===D[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=D[n],{sandbox:r}=e;t||o||(D[n].loadErrorShown=!0,S(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${D[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!(r?.length>0)||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}This 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`))}),D[n].warningTimeout)))}function te(e){const t=D[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,J.version,t.mode].join(":")}z=D;let ne=0,oe=!1,ie=!1;const re=t=>n=>{function o(e){const{id:t}=n,{mode:o,waitForLoad:i}=D[t];-1!==o&&-2!==o&&(C(n,"load",(function(){ee("iFrame.onload",`${e}:${oe}`,t,!0),function(){const e=D[u]?.firstRun,t=D[u]?.heightCalculationMethod in y;!e&&t&&Q({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&ee("init",`${e}:${oe}`,t,!0))}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&S(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>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function r(){const{mode:n}=D[u];ie||n>0&&t.vInfoDisable||(ie=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,$||n<1?"font-weight: bold;":e)))}(`v${p} (${(e=>F(N[e]))(n)})`,n)),n<0?S("Parent",`${H(n+2)}${H(2)}`):n<1&&S("Parent",H(3))}function a(e){const t=D[e]?.iframe?.title;return""===t||void 0===t}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var t,o;D[u]={...D[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...q,...i(e),mouseEvents:s(e),mode:P(e),syncTitle:a(u)},E(u,"setup"),function(){const{direction:e}=D[u];if("horizontal"===e)return D[u].sizeWidth=!0,void(D[u].sizeHeight=!1);if("none"===e)return D[u].sizeWidth=!1,D[u].sizeHeight=!1,void(D[u].autoResize=!1);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===D[u].direction?D[u].offsetHeight=t:D[u].offsetWidth=t),e?.offset&&S(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</>."),null===D[u].postMessageTarget&&(D[u].postMessageTarget=n.contentWindow),D[u].targetOrigin=!0===D[u].checkOrigin?""===(o=D[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in n,u=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=t?.id||q.id+ne++;return null!==document.getElementById(e)&&(e+=ne++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,iframeId:t}){const n=b({label:j(t)});$=e,z[t]||(z[t]={console:n,errorBoundary:n.errorBoundary})}({enabled:Object.hasOwn(t,"log")?t.log:q.log,iframeId:u}),D[u].errorBoundary((function(e){c()?R(u,`Ignored iframe (${u}), already setup.`):(l(e),r(),se(),function(){switch(n.style.overflow=!1===D[u]?.scrolling?"hidden":"auto",D[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=D[u]?D[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=D[u];"number"!=typeof e&&"0"!==e||(D[u].bodyMargin=`${e}px`)}(),o(te(u)),function(){if(D[u]){const{iframe:e}=D[u],t={close:G.bind(null,e),disconnect:V.bind(null,e),removeListeners(){S(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:ee.bind(null,"Window resize","resize",u),moveToAnchor(e){ee("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ee("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}())}))(t),n?.iFrameResizer};function ae(){!1===document.hidden&&function(e,t){const n=e=>D[e]?.autoResize&&!D[e]?.firstRun;Object.keys(D).forEach((function(o){n(o)&&ee(e,t,o)}))}("Tab Visible","resize")}const se=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{C(window,"message",U),C(document,"visibilitychange",ae),window.iframeParentListener=e=>setTimeout((()=>U({data:e,sameDomain:!0})))})),le=`[${h}] `;const ce=function(){function e(e){switch(!0){case!e:throw new TypeError(`${le}iframe is not defined`);case!e.tagName:throw new TypeError(`${le}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${le}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=re(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${le}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){I("iFrameResize()","iframeResize()","","parent"),ce(...e)}),ce}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe-resizer",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -38,8 +38,8 @@
38
38
  "legacy"
39
39
  ],
40
40
  "dependencies": {
41
- "@iframe-resizer/child": "5.4.0",
42
- "@iframe-resizer/jquery": "5.4.0",
43
- "@iframe-resizer/parent": "5.4.0"
41
+ "@iframe-resizer/child": "5.4.1",
42
+ "@iframe-resizer/jquery": "5.4.1",
43
+ "@iframe-resizer/parent": "5.4.1"
44
44
  }
45
45
  }