iframe-resizer 5.4.5-beta.8 → 5.4.5

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.5-beta.8 (cjs) - 2025-04-12
4
+ * @module iframe-resizer/legacy 5.4.5 (cjs) - 2025-04-16
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.5-beta.8 (esm) - 2025-04-12
4
+ * @module iframe-resizer/legacy 5.4.5 (esm) - 2025-04-16
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.5-beta.8 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.8",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",k="mutationObserver",j=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<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.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),T=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(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}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g="";function h(){f.length=0,g=""}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function w(e,...t){0===f.length&&(z(),queueMicrotask((()=>queueMicrotask(v)))),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},event:function(e){z(),p.event=e},purge:h,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$,touch:z}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.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},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=A,Me=[],Ee="child",ke=null,je=!1,Ie="",Pe=[],Te=window.parent,Ae="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Ae=e?.targetOrigin||Ae,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Ae}`,p))}(),Ye(),function(){try{je=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Ae=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),j(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&j(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){j(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),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),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);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)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G(k);const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return V("backed off due to heavy workload on callStack"),D(`%c${m}ms %c>%c ${f}ms`,p,g,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(k,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),ke=new ResizeObserver(ot),ke.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||A,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||A,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,j(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),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ke.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ke.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();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 de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===k:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=T((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{G(e),B=performance.now(),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Ae,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(je)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Te.postMessage(c+a,i);N&&D(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V(`Sending message to parent page via ${je?"sameOrigin":"postMessage"}: %c%c${a}`,n,p)}(),J())})),St=Q((function(e){G("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Te=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),j(window,"message",St),j(window,"readystatechange",Ot),Ot())}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.js.map
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},l={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:c,keys:u}=Object,d=e=>[e,s[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",E="resizeParent",O="setOffsetSize",j="resizeObserver",k="overflowObserver",M="mutationObserver",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),T=["<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 C=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(T[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},I=e=>e,x=e=>Math.round(1e3*e)/1e3,N=e=>e.charAt(0).toUpperCase()+e.slice(1),R=e=>""!=`${e}`&&void 0!==e;const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${N(t)}`)};let B=!0;const L=(F=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){s[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){c[e]?$("log",`${e}: ${performance.now()-c[e]} ms`,...t):$("timeLog",e,...t)}return{...f(h,m(h)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(l,d),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e)}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),c[e]=performance.now()},timeEnd:function(e=r){S(e),delete c[e]},timeLog:S,touch:w}},F?.__esModule?F.default:F);var F;const W=L({label:"iframeResizer(child)"});var D;const H=(D="log",(...e)=>!B||W[D](...e)),{assert:V,debug:U,endAutoGroup:Z,error:J,errorBoundary:_,event:Q,label:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=I,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",le=[],se=new WeakSet,ce=e=>"object"==typeof e&&se.add(e);let ue={},de=0;const me=setInterval((()=>{if(le.length<10)return;if(ue.hasTags&&ue.len<25)return;le.sort();const e=Math.min(le.reduce(((e,t)=>e+t),0)/le.length,le[Math.floor(le.length/2)]),t=x(e);t>de&&(de=t,Q("performanceObserver")),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);ue=e.detail,le.push(t),le.length>100&&le.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ct.auto()),width:()=>(Y("Custom width calculation function not defined"),ut.auto())},i={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,f,p,T=!0,x="",L=0,F="",D="",U=!0,J=!1,te=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe={},he=!0,ge=!1,ye=0,be=!1,ve="",ze=I,we=[],$e="child",Se=null,Ee=!1,Oe="",je=[],ke=window.parent,Me="*",Pe=0,Te=!1,Ce="",Ae=1,Ie=d,xe=window,Ne=()=>{Y("onMessage function not defined")},Re=()=>{},qe=null,Be=null;function Le(e){var t,n,o;!function(e){const t=e=>"true"===e;ve=e[0],L=void 0===e[1]?L:Number(e[1]),J=void 0===e[2]?J:t(e[2]),ge=void 0===e[3]?ge:t(e[3]),T=void 0===e[6]?T:t(e[6]),F=e[7],de=void 0===e[8]?de:e[8],x=e[9],D=e[10],Pe=void 0===e[11]?Pe:Number(e[11]),pe.enable=void 0!==e[12]&&t(e[12]),$e=void 0===e[13]?$e:e[13],Ie=void 0===e[14]?Ie:e[14],be=void 0===e[15]?be:t(e[15]),m=void 0===e[16]?m:Number(e[16]),f=void 0===e[17]?f:Number(e[17]),U=void 0===e[18]?U:t(e[18]),e[19],Ce=e[20]||Ce,ye=void 0===e[21]?ye:Number(e[21]),he=void 0===e[23]?he:t(e[23])}(e),t={id:ve,enabled:ge,expand:he},W.label(`${t.id}`),W.expand(t.expand),B=t.enabled,function(){function e(e){Ne=e?.onMessage||Ne,Re=e?.onReady||Re,"number"==typeof e?.offset&&(re("offset","offsetSize"),U&&(m=e?.offset),J&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(m=e?.offsetSize),J&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Oe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ie=e?.widthCalculationMethod||Ie}function t(e,t){return"function"==typeof e&&(r[t]=e,e="custom"),e}if(1===ye)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ie=t(Ie,"width"),H(`Set targetOrigin for parent: %c${Me}`,h))}(),_e(),function(){try{Ee=1===ye||"iframeParentListener"in window.parent}catch(e){}}(),ye<0?ee(`${C(ye+2)}${C(2)}`):Ce.codePointAt(0)>4||ye<2&&ee(C(3)),Ce&&""!==Ce&&"false"!==Ce?Ce!==y&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ce} - Child page: ${y}.\n`):K("<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(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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&&K("<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"),De(),1!==ye&&(xe.parentIframe=Object.freeze({autoResize:e=>(q(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===T?(T=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===T&&(T=!1),bt(0,0,"autoResize",JSON.stringify(T)),T),close(){bt(0,0,"close")},getId:()=>ve,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return qe=e,bt(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,bt(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),Be=e,bt(0,0,"parentInfo"),()=>{Be=null,bt(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),pe.findTarget(e)},reset(){yt()},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,ht(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),bt(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),bt(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),bt(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),bt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ie=e,Ye()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Me=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),xe.parentIFrame=xe.parentIframe),function(){function e(e){bt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){P(window.document,t,e)}!0===be&&(t("mouseenter"),t("mouseleave"))}(),pe=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,b)+parseInt(o.x,b),y:parseInt(n.top,b)+parseInt(o.y,b)}}function n(e){function n(e){const n=t(e);bt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?bt(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){r(),i(),a()}return pe.enable&&(1===ye?K("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===F&&(F=`${L}px`),Ze("margin",(n="margin",(o=F).includes("-")&&(Y(`Negative CSS value ignored for ${n}`),o=""),o)),Ze("background",x),Ze("padding",D),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 r=t=>{H("Mutations observed:",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)}},i=16,a=2,l=200;let s=1;function c(e){_e(),He(e),e.forEach(tt),e.clear()}function u(){const d=performance.now(),m=d-o;if(m>i*s+++a&&m<l)return H("Backed off due to heavy workload on callStack"),setTimeout(u,i*s),void(o=d);s=1,t.forEach(r),t.length=0,e.size>0&&c(e),De(),Fe(),n=!1,ht(M,"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:!0,attributeFilter:[w,v],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),U!==J&&(ze=(e=>{const t=e.side||$,n=e.onChange||I,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||I,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],l=(e,t)=>e.toggleAttribute(z,t),s=new IntersectionObserver((function(e){Q("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,s=e[t],c=a(s,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);l(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(s.observe(t),c.add(t)):V(!n,"Node already observed",t)}}})({onChange:We,root:document.documentElement,side:U?$:S})),He(rt(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&bt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),se=we.length>0}function We(e){Fe(),(se||e)&&ht(k,"Overflow updated")}function De(){je=document.querySelectorAll(`[${v}]`),ce=je.length>0}function He(e){ce||ze(e)}let Ve=0;function Ue(){const n=document.querySelectorAll(`*[${w}]`);le=n.length>0,le&&n.length!==Ve&&(function(n){const o=1===n.length?"":"s";Y(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ve=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),H(`Set body ${e}: %c${t}`,h))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,v,Oe),Je(0,w,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,P(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||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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(){Ie=Ge(Ie,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(j,`Element resized <${function(e){switch(!0){case!R(e):return"";case R(e.id):return`${e.nodeName}#${e.id}`;case R(e.name):return`${e.nodeName} (${e.name}`;case R(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=rt(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(ie);const t=N(e);let n=0,r=document.documentElement,i=ce?0:document.documentElement.getBoundingClientRect().bottom;const a=ce?je:se?we:rt(document)();let s=a.length;for(const t of a)ce||!l||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):s-=1;return H(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:s,hasTags:ce,logging:ge}}),i}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],rt=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([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},it={height:0,width:0},at={height:0,width:0},lt=[h,g,h];function st(e){function t(){return at[o]=r,it[o]=l,r}const n=e===ct,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${r}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:H("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===it[o]:H(`Initial page size values: ${s}`,...lt),c=t();break;case Te&&r===at[o]&&l===it[o]:H(`Size unchanged: ${s}`,...lt),c=Math.max(r,l);break;case 0===r:H(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&r!==at[o]&&l<=it[o]:H(`New <html> size: ${s} `,...lt),H(`Previous <html> size: %c${at[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!se&&r<at[o]:H(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===i:H(`<html> size equals page size: ${s}`,...lt),c=t();break;case r>l:H(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:H("Found element overflowing <html> "),c=e.taggedElement();break;default:H(`Using <html> size: ${s}`,...lt),c=t()}return H(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&H(`Page offsetSize: %c${t}px`,h),t}(e),c}const ct={enabled:()=>U,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>r.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($),taggedElement:()=>nt($)},ut={enabled:()=>J,getOffset:()=>f,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.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(S),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(S)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,r){const i=void 0===n?ct[de]():n,a=void 0===o?ut[Ie]():o;switch(!0){case U&&dt(ue,i)||J&&dt(Ae,a)||"init"===e:ue=i,Ae=a;case e===O:bt(ue,Ae,e,r);break;case!e!==E&&(U&&de in u||J&&Ie in u):yt();break;case e===j:case e===k:case e===M:X();break;default:X(),H("No change in content size detected")}}let ft=!1;const pt=A((()=>ee(C(4)))),ht=_(((e,t,n,o,r)=>{Q(e),performance.now(),T||e===E?document.hidden||(ft||(mt(e,0,n,o,r),requestAnimationFrame((()=>{ft=!1}))),ft=!0):H("Resizing disabled")}));function gt(e){ue=ct[de](),Ae=ut[Ie](),bt(ue,Ae,e)}function yt(e){const t=de;de=s,Te||(Te=!0,requestAnimationFrame((()=>{Te=!1}))),gt("reset"),de=t}const bt=_((function(e,t,o,r,i){ye<-1||(Q(o),void 0!==i||(i=Me),function(){const a=`${ve}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ye)throw e;return void pt()}else ke.postMessage(c+a,i);H(`Sending message to parent page via ${Ee?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),Z())})),vt=_((function(e){Q("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>bt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");ke=e.source,p=e.origin,Le(t),te=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||gt("resetPage")},resize(){ht(E,"Parent window requested size check")},moveToAnchor(){pe.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Be?setTimeout((()=>Be(e))):o("parentInfo")},message(){const e=a();setTimeout((()=>Ne(n(e))))}},i=()=>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=i();Q(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&function(){if(!1!==te)return l()?(G(i()),Q("init"),void r.init()):void 0;s()}()}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>vt({data:e,sameOrigin:!0}))),P(window,"message",vt),P(window,"readystatechange",zt),zt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.5-beta.8 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.5 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:c}=Object,d=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],m=(e,t)=>l(c(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",g=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.5-beta.8",y=10,b="data-iframe-size",v="data-iframe-overflowed",z="data-iframe-ignore",w="bottom",$="right",S="resizeParent",O="setOffsetSize",M="resizeObserver",E="overflowObserver",k="mutationObserver",j=(e,t,n,o)=>e.addEventListener(t,n,o||!1),I=["<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.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(I[e]),T=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,x=e=>Math.round(1e3*e)/1e3,C=e=>e.charAt(0).toUpperCase()+e.slice(1),N=e=>""!=`${e}`&&void 0!==e;function R(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}}const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${C(t)}`)};let L=!0;const B=(F=function(n={}){const l={},c={},f=[],p={...a,expand:!n.collapsed||a.expanded,...n};let g="";function h(){f.length=0,g=""}function y(){delete p.event,h()}const b=()=>!!f.some((([e])=>e in i))||!!p.expand;function v(){if(0!==f.length){console[b()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?g:""}`,e,t,o);for(const[e,...t]of f)console[e](...t);console.groupEnd(),y()}else y()}function z(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function w(e,...t){0===f.length&&(z(),queueMicrotask((()=>queueMicrotask(v)))),f.push([e,...t])}function $(e=r,...t){w("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...m(p,u(p)),...m(console,(e=>[e,(...t)=>w(e,...t)])),...m(s,d),count:function(e=r){c[e]?c[e]+=1:c[e]=1,w("log",`${e}: ${c[e]}`)},countReset:function(e=r){delete c[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;w("error",e)}return n},event:function(e){z(),p.event=e},purge:h,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){$(e),delete l[e]},timeLog:$,touch:z}},F?.__esModule?F.default:F);var F;const W=B({label:"iframeResizer(child)"});const D=(H="log",(...e)=>!L||W[H](...e));var H;const V=D,{assert:U,debug:Z,endAutoGroup:J,error:_,errorBoundary:Q,event:G,purge:X,warn:Y}=W,K=e=>{return W.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},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",se=[],le=new WeakSet,ce=e=>"object"==typeof e&&le.add(e);let de={},ue=0;const me=setInterval((()=>{if(se.length<10)return;if(de.hasTags&&de.len<25)return;se.sort();const e=Math.min(se.reduce(((e,t)=>e+t),0)/se.length,se[Math.floor(se.length/2)]),t=x(e);t>ue&&(ue=t,G("performanceObserver"),D("Mean time:",x(se[Math.floor(se.length/2)])),D("Median time:",x(se.reduce(((e,t)=>e+t),0)/se.length)),D("Average time:",t),D("Max time:",x(Math.max(...se)))),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);de=e.detail,se.push(t),se.length>100&&se.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ft.auto()),width:()=>(Y("Custom width calculation function not defined"),pt.auto())},i={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},s="checkVisibility"in window,l="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let m,f,I,N,B,F=!0,H="",_=0,X="",te="",se=!0,le=!1,ce=!0,de=!1,ue=!1,me=!1,fe=1,pe=l,ge="",he=!0,ye="",be={},ve=!0,ze=!1,we=0,$e=!1,Se="",Oe=A,Me=[],Ee="child",ke=null,je=!1,Ie="",Pe=[],Te=window.parent,Ae="*",xe=0,Ce=!1,Ne="",Re=1,qe=u,Le=window,Be=()=>{Y("onMessage function not defined")},Fe=()=>{},We=null,De=null;function He(){var e,t,n;!function(){const e=e=>"true"===e,t=ye.slice(13).split(":");Se=t[0],_=void 0===t[1]?_:Number(t[1]),le=void 0===t[2]?le:e(t[2]),ze=void 0===t[3]?ze:e(t[3]),F=void 0===t[6]?F:e(t[6]),X=t[7],pe=void 0===t[8]?pe:t[8],H=t[9],te=t[10],xe=void 0===t[11]?xe:Number(t[11]),be.enable=void 0!==t[12]&&e(t[12]),Ee=void 0===t[13]?Ee:t[13],qe=void 0===t[14]?qe:t[14],$e=void 0===t[15]?$e:e(t[15]),m=void 0===t[16]?m:Number(t[16]),f=void 0===t[17]?f:Number(t[17]),se=void 0===t[18]?se:e(t[18]),t[19],Ne=t[20]||Ne,we=void 0===t[21]?we:Number(t[21]),ve=void 0===t[23]?ve:e(t[23])}(),e={id:Se,enabled:ze,expand:ve},W.label(`${e.id}`),W.expand(e.expand),L=e.enabled,D(`Initialising iframe v${h} ${window.location.href}`),function(){function e(e){D("Reading data from page:",e),Be=e?.onMessage||Be,Fe=e?.onReady||Fe,"number"==typeof e?.offset&&(re("offset","offsetSize"),se&&(m=e?.offset),le&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(se&&(m=e?.offsetSize),le&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ie=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ge=e.ignoreSelector),Ae=e?.targetOrigin||Ae,pe=e?.heightCalculationMethod||pe,qe=e?.widthCalculationMethod||qe}function t(e,t){return"function"==typeof e&&(D(`Setup custom ${t}CalcMethod`),r[t]=e,e="custom"),e}if(1===we)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),pe=t(pe,"height"),qe=t(qe,"width"),V(`Set targetOrigin for parent: %c${Ae}`,p))}(),Ye(),function(){try{je=1===we||"iframeParentListener"in window.parent}catch(e){D("Cross domain iframe detected")}}(),we<0?ee(`${P(we+2)}${P(2)}`):Ne.codePointAt(0)>4||we<2&&ee(P(3)),Ne&&""!==Ne&&"false"!==Ne?Ne!==h&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ne} - Child page: ${h}.\n`):K("<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"),tt(),nt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(b,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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&&K("<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"),Ze(),1!==we&&(Le.parentIframe=Object.freeze({autoResize:e=>(q(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===F?(F=!0,vt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),$t(0,0,"autoResize",JSON.stringify(F)),F),close(){$t(0,0,"close")},getId:()=>Se,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return We=e,$t(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");We=null,$t(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),De=e,$t(0,0,"parentInfo"),()=>{De=null,$t(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),be.findTarget(e)},reset(){wt("parentIframe.reset")},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,vt(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),$t(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),$t(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),$t(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),$t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){pe=e,tt()},setWidthCalculationMethod(e){qe=e,nt()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),D(`Set targetOrigin: %c${e}`,p),Ae=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),vt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),Le.parentIFrame=Le.parentIframe),function(){function e(e){$t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){D(`Add event listener: %c${n}`,p),j(window.document,t,e)}!0===$e&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),be=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);D(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,p,g,p,g,p),$t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?(D(`In page link (#${o}) not found in iFrame, so sending to parent`),$t(0,0,"inPageLink",`#${o}`)):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&j(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){j(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){D("Setting up location.hash handlers"),r(),i(),a()}return be.enable?1===we?K("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():D("In page linking not enabled"),{findTarget:n}}(),void 0===X&&(X=`${_}px`),Ge("margin",(t="margin",(n=X).includes("-")&&(Y(`Negative CSS value ignored for ${t}`),n=""),n)),Ge("background",H),Ge("padding",te),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),D("Set HTML & body height: %cauto !important",p)}(),!0!==F&&D("Auto Resize disabled"),function(e){Ke({method:e,eventType:"After Print",eventName:"afterprint"}),Ke({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ke({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{D("Mutations observed:",t.length);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)}},i=16,a=2,s=200;let l=1;function c(e){Ye(),Je(e),e.forEach(it),e.clear()}function d(){G(k);const u=performance.now(),m=u-o,f=i*l+++a;if(m>f&&m<s)return V("backed off due to heavy workload on callStack"),D(`%c${m}ms %c>%c ${f}ms`,p,g,p),setTimeout(d,i*l),void(o=u);l=1,t.forEach(r),t.length=0,e.size>0&&c(e),Ze(),Ve(),n=!1,vt(k,"Mutation Observed")}function u(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(d))}function m(){const e=new window.MutationObserver(u),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return D("Setup <body> MutationObserver"),e.observe(t,n),e}m()}(),D("Setup ResizeObserver"),ke=new ResizeObserver(ot),ke.observe(document.body),rt.add(document.body),it(document.body),se!==le&&(D("Setup OverflowObserver"),Oe=(e=>{const t=e.side||w,n=e.onChange||A,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||A,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){G("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c),c&&D("Overflowed:",i)}var n;r(i)}),o),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{V("Detected changes in element attributes"),i(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[z],subtree:!0};D("Setup OverflowMutationObserver"),e.observe(t,n)}(),function(e){D("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(l.observe(t),c.add(t)):U(!n,"Node already observed",t)}}})({onChange:Ue,root:document.documentElement,side:se?w:$})),Je(lt(document)()),queueMicrotask(Fe),D("Initialization complete"),vt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&$t(0,0,"title",document.title)}function Ve(){Me=document.querySelectorAll(`[${v}]:not([${z}]):not([${z}] *)`),ue=Me.length>0}function Ue(e){Ve(),(ue||e)&&(D("Observed Elements:",Me.length),vt(E,"Overflow updated"))}function Ze(){Pe=document.querySelectorAll(`[${b}]`),me=Pe.length>0,D(`Tagged elements found: %c${me}`,me?p:g)}function Je(e){me||Oe(e)}let _e=0;function Qe(){const n=document.querySelectorAll(`*[${z}]`);de=n.length>0,de&&n.length!==_e&&(function(n){const o=1===n.length?"":"s";Y(`%c[${z}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),_e=n.length)}function Ge(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),V(`Set body ${e}: %c${t}`,p))}function Xe(e,t,n){if(""!==n){D(`${e}: %c${n}`,p);for(const e of document.querySelectorAll(n))D(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ye(){Xe("sizeSelector",b,Ie),Xe("ignoreSelector",z,ge)}function Ke(e){({add(t){function n(){vt(e.eventName,e.eventType)}a[t]=n,j(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),D(`${C(e.method)} event listener: %c${e.eventType}`,p)}function et(e,t,n,o){return t!==e&&(e in n||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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.`),D(`Set ${o} calculation method: %c${e}`,p)),e}function tt(){pe=et(pe,l,ft,"height")}function nt(){qe=et(qe,u,pt,"width")}function ot(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;vt(M,`Element resized <${R(t)}>`)}const rt=new WeakSet;function it(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!rt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ke.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}const t=lt(e)();for(const e of t){if(rt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ke.observe(e),rt.add(e),D(`Attached resizeObserver: %c${R(e)}`,p))}}function at(e){performance.mark(ie);const t=C(e);let n=0,r=document.documentElement,i=me?0:document.documentElement.getBoundingClientRect().bottom;const a=me?Pe:ue?Me:lt(document)();let l=a.length;for(const t of a)me||!s||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):l-=1;return V(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:l,hasTags:me,logging:ze}}),i}const st=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],lt=e=>()=>{Qe();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 de&&t.push(`not([${z}])`,`not([${z}] *)`),e.querySelectorAll(t.join(":"))},ct={height:0,width:0},dt={height:0,width:0},ut=[p,g,p];function mt(e){function t(){return dt[o]=r,ct[o]=s,r}const n=e===ft,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${r}px %cPage: %c${s}px`;let c=0;switch(!0){case!e.enabled():return s;case me:V("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ue&&0===dt[o]&&0===ct[o]:V(`Initial page size values: ${l}`,...ut),c=t();break;case Ce&&r===dt[o]&&s===ct[o]:V(`Size unchanged: ${l}`,...ut),c=Math.max(r,s);break;case 0===r:V(`Page is hidden: ${l}`,...ut),c=s;break;case!ue&&r!==dt[o]&&s<=ct[o]:V(`New <html> size: ${l} `,...ut),V(`Previous <html> size: %c${dt[o]}px`,p),c=t();break;case!n:c=e.taggedElement();break;case!ue&&r<dt[o]:V(`<html> size decreased: ${l}`,...ut),c=t();break;case s===a||s===i:V(`<html> size equals page size: ${l}`,...ut),c=t();break;case r>s:V(`Page size < <html> size: ${l}`,...ut),c=t();break;case ue:V("Found element overflowing <html> "),c=e.taggedElement();break;default:V(`Using <html> size: ${l}`,...ut),c=t()}return V(`Content ${o}: %c${c}px`,p),c+=function(e){const t=e.getOffset();return 0!==t&&V(`Page offsetSize: %c${t}px`,p),t}(e),c}const ft={enabled:()=>se,getOffset:()=>m,auto:()=>mt(ft),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ft.bodyOffset(),custom:()=>r.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...st(ft)),min:()=>Math.min(...st(ft)),grow:()=>ft.max(),lowestElement:()=>at(w),taggedElement:()=>at(w)},pt={enabled:()=>le,getOffset:()=>f,auto:()=>mt(pt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...st(pt)),min:()=>Math.min(...st(pt)),rightMostElement:()=>at($),scroll:()=>Math.max(pt.bodyScroll(),pt.documentElementScroll()),taggedElement:()=>at($)},gt=(e,t)=>!(Math.abs(e-t)<=xe);function ht(e,t,n,o,r){const i=void 0===n?ft[pe]():n,a=void 0===o?pt[qe]():o;switch(!0){case se&&gt(fe,i)||le&&gt(Re,a)||"init"===e:fe=i,Re=a;case e===O:$t(fe,Re,e,r);break;case!e!==S&&(se&&pe in d||le&&qe in d):wt(t);break;case e===M:case e===E:case e===k:D("No change in content size detected");break;default:V("No change in content size detected")}N=!1}let yt=!1;const bt=T((()=>ee(P(4)))),vt=Q(((e,t,n,o,r)=>{G(e),B=performance.now(),F||e===S?document.hidden?D("Page hidden - Ignored resize request"):(yt||(D(`Resize event: %c${t}`,p),N=!0,ht(e,t,n,o,r),requestAnimationFrame((()=>{yt=!1}))),yt=!0):V("Resizing disabled")}));function zt(e){fe=ft[pe](),Re=pt[qe](),$t(fe,Re,e)}function wt(e){const t=pe;pe=l,D(`Reset trigger event: %c${e}`,p),Ce?D("TriggerLock blocked calculation"):(Ce=!0,Z("Trigger event lock on"),requestAnimationFrame((()=>{Ce=!1,Z("Trigger event lock off")}))),zt("reset"),pe=t}const $t=Q((function(e,t,o,r,i){we<-1||(G(o),void 0!==i?D(`Message targetOrigin: %c${i}`,p):i=Ae,function(){const a=`${Se}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(je)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==we)throw e;return void bt()}else Te.postMessage(c+a,i);N&&D(function(){const e=x(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),p),V(`Sending message to parent page via ${je?"sameOrigin":"postMessage"}: %c%c${a}`,n,p)}(),J())})),St=Q((function(e){G("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>$t(0,0,`${e}Stop`),r={init:function(){ye=e.data,Te=e.source,I=e.origin,He(),ce=!1,setTimeout((()=>{he=!1}),128)},reset(){he?D("Page reset ignored by init"):(D("Page size reset by host page"),zt("resetPage"))},resize(){vt(S,"Parent window requested size check")},moveToAnchor(){be.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();D(`PageInfo received from parent: ${e}`),We?setTimeout((()=>We(n(e)))):o("pageInfo")},parentInfo(){const e=a();D(`ParentInfo received from parent: ${e}`),De?setTimeout((()=>De(t(n(e))))):o("parentInfo")},message(){const e=a();D(`onMessage called from parent: ${e}`),setTimeout((()=>Be(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(G(i()),!1!==ce?s()?r.init():D(`Ignored message of type "${i()}". Received before initialization.`):l())}));function Ot(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>St({data:e,sameOrigin:!0}))),j(window,"message",St),j(window,"readystatechange",Ot),Ot())}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.min.js.map
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},l={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:c,keys:u}=Object,d=e=>[e,s[e]],m=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>c(u(e).map(t));const p=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,h=p?"color: #A9C7FB;":"color: #135CD2;",g=p?"color: #E3E3E3;":"color: #1F1F1F;",y="5.4.5",b=10,v="data-iframe-size",z="data-iframe-overflowed",w="data-iframe-ignore",$="bottom",S="right",E="resizeParent",O="setOffsetSize",j="resizeObserver",k="overflowObserver",M="mutationObserver",P=(e,t,n,o)=>e.addEventListener(t,n,o||!1),T=["<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 C=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(T[e]),A=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},I=e=>e,x=e=>Math.round(1e3*e)/1e3,N=e=>e.charAt(0).toUpperCase()+e.slice(1),R=e=>""!=`${e}`&&void 0!==e;const q=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${N(t)}`)};let B=!0;const L=(F=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function b(){delete h.event,y()}const v=()=>!!p.some((([e])=>e in i))||!!h.expand;function z(){if(0!==p.length){s[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),b()}else b()}function w(){""===g&&(g=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function $(e,...t){0===p.length&&(w(),queueMicrotask((()=>queueMicrotask(z)))),p.push([e,...t])}function S(e=r,...t){c[e]?$("log",`${e}: ${performance.now()-c[e]} ms`,...t):$("timeLog",e,...t)}return{...f(h,m(h)),...f(console,(e=>[e,(...t)=>$(e,...t)])),...f(l,d),assert:function(e,...t){e||$("assert",e,...t)},count:function(e=r){u[e]?u[e]+=1:u[e]=1,$("log",`${e}: ${u[e]}`)},countReset:function(e=r){delete u[e]},endAutoGroup:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e)}return n},event:function(e){w(),h.event=e},purge:y,time:function(e=r){w(),c[e]=performance.now()},timeEnd:function(e=r){S(e),delete c[e]},timeLog:S,touch:w}},F?.__esModule?F.default:F);var F;const W=L({label:"iframeResizer(child)"});var D;const H=(D="log",(...e)=>!B||W[D](...e)),{assert:V,debug:U,endAutoGroup:Z,error:J,errorBoundary:_,event:Q,label:G,purge:X,warn:Y}=W,K=e=>{return W.warn((t=I,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ee=K,te=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>K(t))),ne=te("Method"),oe=te("Method","replaced with"),re=te("Option"),ie="--ifr-start",ae="--ifr-end",le=[],se=new WeakSet,ce=e=>"object"==typeof e&&se.add(e);let ue={},de=0;const me=setInterval((()=>{if(le.length<10)return;if(ue.hasTags&&ue.len<25)return;le.sort();const e=Math.min(le.reduce(((e,t)=>e+t),0)/le.length,le[Math.floor(le.length/2)]),t=x(e);t>de&&(de=t,Q("performanceObserver")),e<=4||(clearInterval(me),K(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${x(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ue.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function fe(e){e.getEntries().forEach((e=>{if(e.name===ae){const{duration:t}=performance.measure("--ifr-measure",ie,ae);ue=e.detail,le.push(t),le.length>100&&le.shift()}}))}function pe(){new PerformanceObserver(fe).observe({entryTypes:["mark"]}),ce(document.documentElement),ce(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",pe):pe()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},r={height:()=>(Y("Custom height calculation function not defined"),ct.auto()),width:()=>(Y("Custom width calculation function not defined"),ut.auto())},i={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,f,p,T=!0,x="",L=0,F="",D="",U=!0,J=!1,te=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe={},he=!0,ge=!1,ye=0,be=!1,ve="",ze=I,we=[],$e="child",Se=null,Ee=!1,Oe="",je=[],ke=window.parent,Me="*",Pe=0,Te=!1,Ce="",Ae=1,Ie=d,xe=window,Ne=()=>{Y("onMessage function not defined")},Re=()=>{},qe=null,Be=null;function Le(e){var t,n,o;!function(e){const t=e=>"true"===e;ve=e[0],L=void 0===e[1]?L:Number(e[1]),J=void 0===e[2]?J:t(e[2]),ge=void 0===e[3]?ge:t(e[3]),T=void 0===e[6]?T:t(e[6]),F=e[7],de=void 0===e[8]?de:e[8],x=e[9],D=e[10],Pe=void 0===e[11]?Pe:Number(e[11]),pe.enable=void 0!==e[12]&&t(e[12]),$e=void 0===e[13]?$e:e[13],Ie=void 0===e[14]?Ie:e[14],be=void 0===e[15]?be:t(e[15]),m=void 0===e[16]?m:Number(e[16]),f=void 0===e[17]?f:Number(e[17]),U=void 0===e[18]?U:t(e[18]),e[19],Ce=e[20]||Ce,ye=void 0===e[21]?ye:Number(e[21]),he=void 0===e[23]?he:t(e[23])}(e),t={id:ve,enabled:ge,expand:he},W.label(`${t.id}`),W.expand(t.expand),B=t.enabled,function(){function e(e){Ne=e?.onMessage||Ne,Re=e?.onReady||Re,"number"==typeof e?.offset&&(re("offset","offsetSize"),U&&(m=e?.offset),J&&(f=e?.offset)),"number"==typeof e?.offsetSize&&(U&&(m=e?.offsetSize),J&&(f=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Oe=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ie=e?.widthCalculationMethod||Ie}function t(e,t){return"function"==typeof e&&(r[t]=e,e="custom"),e}if(1===ye)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ie=t(Ie,"width"),H(`Set targetOrigin for parent: %c${Me}`,h))}(),_e(),function(){try{Ee=1===ye||"iframeParentListener"in window.parent}catch(e){}}(),ye<0?ee(`${C(ye+2)}${C(2)}`):Ce.codePointAt(0)>4||ye<2&&ee(C(3)),Ce&&""!==Ce&&"false"!==Ce?Ce!==y&&K(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ce} - Child page: ${y}.\n`):K("<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(v,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&K("<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&&K("<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"),De(),1!==ye&&(xe.parentIframe=Object.freeze({autoResize:e=>(q(e,"boolean","parentIframe.autoResize(enable) enable"),!0===e&&!1===T?(T=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===T&&(T=!1),bt(0,0,"autoResize",JSON.stringify(T)),T),close(){bt(0,0,"close")},getId:()=>ve,getOrigin:()=>(ne("getOrigin()","getParentOrigin()"),p),getParentOrigin:()=>p,getPageInfo(e){if("function"==typeof e)return qe=e,bt(0,0,"pageInfo"),void oe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,bt(0,0,"pageInfoStop")},getParentProps:e=>(q(e,"function","parentIframe.getParentProps(callback) callback"),Be=e,bt(0,0,"parentInfo"),()=>{Be=null,bt(0,0,"parentInfoStop")}),getParentProperties(e){ne("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){q(e,"string","parentIframe.moveToAnchor(anchor) anchor"),pe.findTarget(e)},reset(){yt()},setOffsetSize(e){q(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,f=e,ht(O,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){q(e,"number","parentIframe.scrollBy(x, y) x"),q(t,"number","parentIframe.scrollBy(x, y) y"),bt(t,e,"scrollBy")},scrollTo(e,t){q(e,"number","parentIframe.scrollTo(x, y) x"),q(t,"number","parentIframe.scrollTo(x, y) y"),bt(t,e,"scrollTo")},scrollToOffset(e,t){q(e,"number","parentIframe.scrollToOffset(x, y) x"),q(t,"number","parentIframe.scrollToOffset(x, y) y"),bt(t,e,"scrollToOffset")},sendMessage(e,t){t&&q(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),bt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ie=e,Ye()},setTargetOrigin(e){q(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Me=e},resize(e,t){e&&q(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&q(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ne("size()","resize()"),this.resize(e,t)}}),xe.parentIFrame=xe.parentIframe),function(){function e(e){bt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){P(window.document,t,e)}!0===be&&(t("mouseenter"),t("mouseleave"))}(),pe=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,b)+parseInt(o.x,b),y:parseInt(n.top,b)+parseInt(o.y,b)}}function n(e){function n(e){const n=t(e);bt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?bt(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&P(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){P(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){r(),i(),a()}return pe.enable&&(1===ye?K("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===F&&(F=`${L}px`),Ze("margin",(n="margin",(o=F).includes("-")&&(Y(`Negative CSS value ignored for ${n}`),o=""),o)),Ze("background",x),Ze("padding",D),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 r=t=>{H("Mutations observed:",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)}},i=16,a=2,l=200;let s=1;function c(e){_e(),He(e),e.forEach(tt),e.clear()}function u(){const d=performance.now(),m=d-o;if(m>i*s+++a&&m<l)return H("Backed off due to heavy workload on callStack"),setTimeout(u,i*s),void(o=d);s=1,t.forEach(r),t.length=0,e.size>0&&c(e),De(),Fe(),n=!1,ht(M,"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:!0,attributeFilter:[w,v],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),U!==J&&(ze=(e=>{const t=e.side||$,n=e.onChange||I,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||I,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],l=(e,t)=>e.toggleAttribute(z,t),s=new IntersectionObserver((function(e){Q("observation");for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,s=e[t],c=a(s,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);l(i,c)}var n;r(i)}),o),c=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=c.has(t);!n&&e?(s.observe(t),c.add(t)):V(!n,"Node already observed",t)}}})({onChange:We,root:document.documentElement,side:U?$:S})),He(rt(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,y),document.title&&""!==document.title&&bt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${z}]:not([${w}]):not([${w}] *)`),se=we.length>0}function We(e){Fe(),(se||e)&&ht(k,"Overflow updated")}function De(){je=document.querySelectorAll(`[${v}]`),ce=je.length>0}function He(e){ce||ze(e)}let Ve=0;function Ue(){const n=document.querySelectorAll(`*[${w}]`);le=n.length>0,le&&n.length!==Ve&&(function(n){const o=1===n.length?"":"s";Y(`%c[${w}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ve=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),H(`Set body ${e}: %c${t}`,h))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,v,Oe),Je(0,w,me)}function Qe(e){({add(t){function n(){ht(e.eventName,e.eventType)}a[t]=n,P(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||(Y(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in i&&K(`<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(){Ie=Ge(Ie,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(j,`Element resized <${function(e){switch(!0){case!R(e):return"";case R(e.id):return`${e.nodeName}#${e.id}`;case R(e.name):return`${e.nodeName} (${e.name}`;case R(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=rt(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(ie);const t=N(e);let n=0,r=document.documentElement,i=ce?0:document.documentElement.getBoundingClientRect().bottom;const a=ce?je:se?we:rt(document)();let s=a.length;for(const t of a)ce||!l||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,r=t)):s-=1;return H(`${t} position calculated from:`,r),performance.mark(ae,{detail:{Side:t,len:s,hasTags:ce,logging:ge}}),i}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],rt=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([${w}])`,`not([${w}] *)`),e.querySelectorAll(t.join(":"))},it={height:0,width:0},at={height:0,width:0},lt=[h,g,h];function st(e){function t(){return at[o]=r,it[o]=l,r}const n=e===ct,o=n?"height":"width",r=e.boundingClientRect(),i=Math.ceil(r),a=Math.floor(r),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${r}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:H("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===it[o]:H(`Initial page size values: ${s}`,...lt),c=t();break;case Te&&r===at[o]&&l===it[o]:H(`Size unchanged: ${s}`,...lt),c=Math.max(r,l);break;case 0===r:H(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&r!==at[o]&&l<=it[o]:H(`New <html> size: ${s} `,...lt),H(`Previous <html> size: %c${at[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!se&&r<at[o]:H(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===i:H(`<html> size equals page size: ${s}`,...lt),c=t();break;case r>l:H(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:H("Found element overflowing <html> "),c=e.taggedElement();break;default:H(`Using <html> size: ${s}`,...lt),c=t()}return H(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&H(`Page offsetSize: %c${t}px`,h),t}(e),c}const ct={enabled:()=>U,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>r.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($),taggedElement:()=>nt($)},ut={enabled:()=>J,getOffset:()=>f,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>r.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(S),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(S)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,r){const i=void 0===n?ct[de]():n,a=void 0===o?ut[Ie]():o;switch(!0){case U&&dt(ue,i)||J&&dt(Ae,a)||"init"===e:ue=i,Ae=a;case e===O:bt(ue,Ae,e,r);break;case!e!==E&&(U&&de in u||J&&Ie in u):yt();break;case e===j:case e===k:case e===M:X();break;default:X(),H("No change in content size detected")}}let ft=!1;const pt=A((()=>ee(C(4)))),ht=_(((e,t,n,o,r)=>{Q(e),performance.now(),T||e===E?document.hidden||(ft||(mt(e,0,n,o,r),requestAnimationFrame((()=>{ft=!1}))),ft=!0):H("Resizing disabled")}));function gt(e){ue=ct[de](),Ae=ut[Ie](),bt(ue,Ae,e)}function yt(e){const t=de;de=s,Te||(Te=!0,requestAnimationFrame((()=>{Te=!1}))),gt("reset"),de=t}const bt=_((function(e,t,o,r,i){ye<-1||(Q(o),void 0!==i||(i=Me),function(){const a=`${ve}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ye)throw e;return void pt()}else ke.postMessage(c+a,i);H(`Sending message to parent page via ${Ee?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),Z())})),vt=_((function(e){Q("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>bt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");ke=e.source,p=e.origin,Le(t),te=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||gt("resetPage")},resize(){ht(E,"Parent window requested size check")},moveToAnchor(){pe.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Be?setTimeout((()=>Be(e))):o("parentInfo")},message(){const e=a();setTimeout((()=>Ne(n(e))))}},i=()=>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=i();Q(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Y(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&function(){if(!1!==te)return l()?(G(i()),Q("init"),void r.init()):void 0;s()}()}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Y("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>vt({data:e,sameOrigin:!0}))),P(window,"message",vt),P(window,"readystatechange",zt),zt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.8 (umd) - 2025-04-12
4
+ * @module iframe-resizer/legacy (parent) 5.4.5 (umd) - 2025-04-16
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.8",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=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)),x=e=>e,E=(M=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h="";function m(){f.length=0,h=""}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function v(e,...t){0===f.length&&(b(),queueMicrotask((()=>queueMicrotask(w)))),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},event:function(e){b(),p.event=e},purge:m,time:function(e=i){b(),s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z,touch:b}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,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)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function n(){ue(x),ce(E),j("onResized",x)}function i(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 r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",V),c.disconnect(),d.disconnect()}const l=E,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}),ee[l]&&(ee[l][`stop${t}`]=s)},l=e=>()=>{e in ee[E]&&(ee[E][e](),delete ee[E][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,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:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return se(E),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(E,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,z(E)}(n)}function z(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>oe(E,e,t);function k(){switch(ee[E]?.firstRun&&ee[E]&&(ee[E].firstRun=!1),x.type){case"close":ae(x.iframe);break;case"message":i=r(6),C(E,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":ee[E].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(E,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",E),u();break;case"parentInfo":d("start",E),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(E,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},z(E),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(E,`In page link #${t} not found and window.parentIframe not found`)}():C(E,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,E);break;case"reset":de(x);break;case"init":n(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(E),(e=x.msg)!==m&&(void 0!==e?C(E,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):B(E,"<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")),ge=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(E,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(E,"Ignoring message with 0 height or width");if(document.hidden)return void C(E,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},E=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in ee?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=ee[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),E=x.id,E?(N(E,x.type),H(E,(function(){!function(e){if(!ee[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(E),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(E,"Ignoring init message from meta parent page"),e}()||(C(E,`Received: %c${T}`,t),ee[E].loaded=!0,(null!==x.iframe||(F(E,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[E]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(E,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[E]?.remoteHost;return C(E,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==E&&C(E,"Ignored:",T):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,n,i,o){function r(o){const r=e in z?fe(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),ee[i]&&(ee[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=ee[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&ee[i]?.warningTimeout&&(ee[i].msgTimeout=setTimeout((function(){if(void 0===ee[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=ee[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(ee[i].loadErrorShown=!0,B(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${ee[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <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":""}${!a||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${!a||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`))}),ee[i].warningTimeout)))}function he(e){const t=ee[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,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(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 a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(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===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"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||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
21
- //# sourceMappingURL=iframeResizer.js.map
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=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)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in o))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const S=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const I=e=>(t,...n)=>R[t]?.console[e](...n);var C;const A=(C="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?I(C)(e,...t):null),W=I("warn"),L=I("error"),F=I("event"),N=I("purge"),H=I("errorBoundary");const P=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(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</>.`))(P),q=B("Function"),D=B("Option"),U=(e,t,n,o)=>e.addEventListener(t,n,o||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),Z=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)},V=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<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."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>V(G[e]),Q=e=>{const t=e[V("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Z(V(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===o||(e=>e[2]===Z(e[0]+e[1]))(n)||(o=-2),o},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(D("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function t(){ue(T),le(x),$("onResized",T)}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(){fe(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{K[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(){F(l,`stop${t}`),a(0,J),c.disconnect(),u.disconnect(),J(K[l].iframe,"load",s)}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));K[l]&&(K[l][`stop${t}`]=s,U(K[l].iframe,"load",s),a(0,U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in K[x]&&(K[x][e](),delete K[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.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}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return ae(),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};A(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){te.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=te.position,o=K[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?le(e):se()}function z(e){let t={};if(0===T.width&&0===T.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=T;switch(K[x]?.firstRun&&K[x]&&(K[x].firstRun=!1),r){case"close":re(n);break;case"message":l=i(6),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":K[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;A(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=w(o);A(x,`Moving to in page link: %c#${t}`,p),te.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){K[t]?.syncTitle&&(K[t].iframe.title=e,A(t,`Set iframe title attribute: %c${e}`,p))}(o,x);break;case"reset":ce(T);break;case"init":t(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}}(x),(s=o)!==m&&(void 0!==s||P(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")),me=!0,$("onReady",n);break;default:if(0===a&&0===e)return void W(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in K&&(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=K[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=T.id,x?(F(x,T.type),H(x,(function(){!function(e){if(!K[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),T.type in{true:1,false:1,undefined:1}||(K[x].loaded=!0,(null!==T.iframe||(W(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=K[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=K[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.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())}))()):W("","iframeResizer received messageData without id, message was: ",k)):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function oe(e,t,n){let o=null,i=null;if(K[e]){if(o=K[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),W(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function ie(e){const{id:t}=e;delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){W(t,e)}oe(t,"onClosed",t),ie(e)}}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY})}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),A(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){ae(e.id),ue(e),fe("reset","reset",e.id)}function ue(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,A(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=K[n];o&&t("height"),i&&t("width")}R=K;const de=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,t,n,o){function i(o){const i=e in z?de(t):t;A(n,o,p,h,p),A(n,`Message data: %c${i}`,p)}F(n,e),K[n]&&(K[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameOrigin:r,targetOrigin:a}=K[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void i(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),o.postMessage(y+t,a)}():W(n,`Iframe(${n}) not found`),o&&K[n]?.warningTimeout&&(K[n].msgTimeout=setTimeout((function(){if(void 0===K[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=K[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||o||(K[n].loadErrorShown=!0,P(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${K[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":""}${!a||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${!a||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`))}),K[n].warningTimeout)))}function pe(e){const t=K[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,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function o(){if(K[d]){const{iframe:e}=K[d],t={close:re.bind(null,e),disconnect:ie.bind(null,e),removeListeners(){P(d,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",d),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function i(e){const{id:t}=n,{mode:o,waitForLoad:i}=K[t];-1!==o&&-2!==o&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[d]?.firstRun,t=K[d]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&P(d,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[d];if(n<0)throw P("Parent",`${_(n+2)}${_(2)}`),N(d),_(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ge||n>0&&t.vInfoDisable||function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>V(X[e]))(n)})`,n),!ge&&n<1&&P("Parent",_(3)),ge=!0}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,o;K[d]={...K[d],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(d)},F(d,"setup"),function(){const{direction:e}=K[d];if("horizontal"===e)return K[d].sizeWidth=!0,void(K[d].sizeHeight=!1);if("none"===e)return K[d].sizeWidth=!1,K[d].sizeHeight=!1,void(K[d].autoResize=!1);if("vertical"!==e)throw new TypeError(d,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[d].direction?K[d].offsetHeight=t:K[d].offsetWidth=t),e?.offset&&P(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[d].postMessageTarget&&(K[d].postMessageTarget=n.contentWindow),K[d].targetOrigin=!0===K[d].checkOrigin?""===(o=K[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const u=()=>"iframeResizer"in n,d=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||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:ee.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===$:ee.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=E({expand:t,label:S(n)});O=e,R[n]||(R[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,t),H(d,(function(e){u()?W(d,`Ignored iframe (${d}), already setup.`):(c(e),a(),be(),function(){switch(n.style.overflow=!1===K[d]?.scrolling?"hidden":"auto",K[d]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[d]?K[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[d];"number"!=typeof e&&"0"!==e||(K[d].bodyMargin=`${e}px`)}(),i(pe(d)),o())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(o){n(o)&&fe(e,t,o)}))}("Tab Visible","resize")}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}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=ye(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.4.5-beta.8 (umd) - 2025-04-12
4
+ * @module iframe-resizer/legacy (parent) 5.4.5 (umd) - 2025-04-16
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t="font-style: italic;",n=e+t,i="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),r={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:s,keys:l}=Object,c=e=>[e,console[e]],d=e=>t=>[t,function(n){e[t]=n}],u=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5-beta.8",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=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)),x=e=>e,E=(M=function(t={}){const s={},l={},f=[],p={...r,expand:!t.collapsed||r.expanded,...t};let h="";function m(){f.length=0,h=""}function g(){delete p.event,m()}const y=()=>!!f.some((([e])=>e in o))||!!p.expand;function w(){if(0!==f.length){console[y()?"group":"groupCollapsed"](`%c${p.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(p)} %c${p.showTime?h:""}`,e,"font-weight: bold;",n);for(const[e,...t]of f)console[e](...t);console.groupEnd(),g()}else g()}function b(){""===h&&(h=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function v(e,...t){0===f.length&&(b(),queueMicrotask((()=>queueMicrotask(w)))),f.push([e,...t])}function z(e=i,...t){v("log",`${e}: ${performance.now()-s[e]} ms`,...t)}return{...u(p,d(p)),...u(console,(e=>[e,(...t)=>v(e,...t)])),...u(a,c),count:function(e=i){l[e]?l[e]+=1:l[e]=1,v("log",`${e}: ${l[e]}`)},countReset:function(e=i){delete l[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;v("error",e)}return n},event:function(e){b(),p.event=e},purge:m,time:function(e=i){b(),s[e]=performance.now()},timeEnd:function(e=i){z(e),delete s[e]},timeLog:z,touch:b}},M?.__esModule?M.default:M);var M;let R={},O=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const S=e=>(t,...n)=>R[t]?.console[e](...n),C=(A="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?S(A)(e,...t):null);var A;const W=C,F=S("warn"),L=S("error"),N=S("event"),P=S("purge"),H=S("errorBoundary");const B=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),D=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(B),q=D("Function"),U=D("Option"),J=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),Z=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,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)},G=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),X=["<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."],Y=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],_=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),Q=e=>G(X[e]),K=e=>{const t=e[G("spjluzl")];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=Z(G(e));return n in _&&(t=_[n]),t}(n[0]);return 0===i||(e=>e[2]===Z(e[0]+e[1]))(n)||(i=-2),i},ee={},te=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ee[e.id].onInit&&(U("init()","onReady()","",e.id),ee[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ne={position:null,version:m};function ie(e){function n(){ue(x),ce(E),j("onResized",x)}function i(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 r=e=>T.slice(T.indexOf(":")+7+e);const a=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){pe(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},s=(e,t)=>()=>{let n=!1;const i=t=>()=>{ee[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame((()=>{n=!1}))):s()},o=i("scroll"),r=i("resize window");function a(e,n){C(l,`${e} listeners for send${t}`),n(window,"scroll",o),n(window,"resize",r)}function s(){a("Remove ",V),c.disconnect(),d.disconnect()}const l=E,c=new ResizeObserver(i("pageObserver")),d=new ResizeObserver(i("iframeObserver"));a("Add ",J),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(ee[l].iframe,{attributes:!0,childList:!1,subtree:!1}),ee[l]&&(ee[l][`stop${t}`]=s)},l=e=>()=>{e in ee[E]&&(ee[E][e](),delete ee[E][e])},c=a("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),d=a("parentInfo",(function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,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:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=s(c,"PageInfo"),f=s(d,"ParentInfo"),g=l("stopPageInfo"),w=l("stopParentInfo");function b(e){const t=e.getBoundingClientRect();return se(E),{x:Number(t.left)+Number(ne.position.x),y:Number(t.top)+Number(ne.position.y)}}function v(e){const t=e?b(x.iframe):{x:0,y:0};W(E,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(i,n):function(e){ne.position=e,z(E)}(n)}function z(e){const{x:t,y:n}=ne.position,i=ee[e]?.iframe;!1!==j("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?ce(e):le()}function $(e){let t={};if(0===x.width&&0===x.height){const e=r(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};j(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const j=(e,t)=>oe(E,e,t);function k(){switch(ee[E]?.firstRun&&ee[E]&&(ee[E].firstRun=!1),x.type){case"close":ae(x.iframe);break;case"message":i=r(6),C(E,`onMessage passed: {iframe: %c${x.iframe.id}%c, message: %c${i}}`,p,h,t),j("onMessage",{iframe:x.iframe,message:JSON.parse(i)});break;case"mouseenter":$("onMouseEnter");break;case"mouseleave":$("onMouseLeave");break;case"autoResize":ee[E].autoResize=JSON.parse(r(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;W(E,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":v(!1);break;case"scrollToOffset":v(!0);break;case"pageInfo":c("start",E),u();break;case"parentInfo":d("start",E),f();break;case"pageInfoStop":g();break;case"parentInfoStop":w();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=b(i);W(E,`Moving to in page link: %c#${t}`,p),ne.position={x:e.x,y:e.y},z(E),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):C(E,`In page link #${t} not found and window.parentIframe not found`)}():C(E,`In page link #${t} not found`)}(r(9));break;case"title":!function(e,t){ee[t]?.syncTitle&&(ee[t].iframe.title=e,W(t,`Set iframe title attribute: %c${e}`,p))}(x.msg,E);break;case"reset":de(x);break;case"init":n(),function(e){try{ee[e].sameOrigin=!!ee[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ee[e].sameOrigin=!1}C(e,`sameOrigin: %c${ee[e].sameOrigin}`,p)}(E),(e=x.msg)!==m&&(void 0!==e?C(E,`Version mismatch (Child: %c${e}%c !== Parent: %c${m})`,p,h,p):B(E,"<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")),ge=!0,j("onReady",x.iframe);break;default:if(0===x.width&&0===x.height)return void F(E,`Unsupported message received (${x.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===x.width||0===x.height)return void C(E,"Ignoring message with 0 height or width");if(document.hidden)return void C(E,"Page hidden - ignored resize request");n()}var e,i}let T=e.data,x={},E=null;"[iFrameResizerChild]Ready"!==T?y===`${T}`.slice(0,13)&&T.slice(13).split(":")[0]in ee?(x=function(){const e=T.slice(13).split(":"),t=e[1]?Number(e[1]):0,n=ee[e[0]]?.iframe,r=getComputedStyle(n);return{iframe:n,id:e[0],height:t+i(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]}}(),E=x.id,E?(N(E,x.type),H(E,(function(){!function(e){if(!ee[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${T}`)}(E),function(){const e=x.type in{true:1,false:1,undefined:1};return e&&C(E,"Ignoring init message from meta parent page"),e}()||(C(E,`Received: %c${T}`,t),ee[E].loaded=!0,(null!==x.iframe||(F(E,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ee[E]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(C(E,`Checking connection is from allowed list of origins: %c${i}`,p);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ee[E]?.remoteHost;return C(E,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&k())}))()):F("","iframeResizer received messageData without id, message was: ",T)):null!==E&&C(E,"Ignored:",T):Object.keys(ee).forEach((e=>{ee[e].mode>=0&&pe("iFrame requested init",he(e),e)}))}function oe(e,t,n){let i=null,o=null;if(ee[e]){if(i=ee[e][t],"function"!=typeof i)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else setTimeout((()=>i(n)))}return o}function re(e){const{id:t}=e;C(t,"Disconnected from iframe"),delete ee[t],delete e.iframeResizer}function ae(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){C(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){F(t,e)}oe(t,"onClosed",t),re(e)}else C(t,"Close iframe cancelled by onClose event")}function se(e){null===ne.position&&(ne.position={x:window.scrollX,y:window.scrollY},C(e,`Get page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p))}function le(){ne.position=null}function ce(e){null!==ne.position&&(window.scrollTo(ne.position.x,ne.position.y),W(e,`Set page position: %c${ne.position.x}%c, %c${ne.position.y}`,p,h,p),le())}function de(e){C(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),se(e.id),ue(e),pe("reset","reset",e.id)}function ue(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,W(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ee[n];i&&t("height"),o&&t("width")}R=ee;const fe=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function pe(e,n,i,o){function r(o){const r=e in z?fe(n):n;W(i,o,p,h,p),W(i,`%c${r}`,t)}N(i,e),ee[i]&&(ee[i]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:o,targetOrigin:a}=ee[i];if(o)try{return e.contentWindow.iframeChildListener(y+n),void r(`Sending message to iframe %c${i}%c via sameOrigin`)}catch(e){C(i,"Same domain connection failed. Trying cross domain%c")}r(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),t.postMessage(y+n,a)}():F(i,`Iframe(${i}) not found`),o&&ee[i]?.warningTimeout&&(ee[i].msgTimeout=setTimeout((function(){if(void 0===ee[i])return;const{iframe:e,loaded:t,loadErrorShown:n,waitForLoad:o}=ee[i],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||n||(ee[i].loadErrorShown=!0,B(i,`<rb>No response from iFrame</>\n \nThe iframe (<i>${i}</>) has not responded within ${ee[i].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <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":""}${!a||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${!a||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`))}),ee[i].warningTimeout)))}function he(e){const t=ee[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,ne.version,t.mode,"",t.logExpand].join(":")}let me=0,ge=!1,ye=!1;const we=t=>n=>{function i(){if(ee[u]){const{iframe:e}=ee[u],t={close:ae.bind(null,e),disconnect:re.bind(null,e),removeListeners(){B(u,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:pe.bind(null,"Window resize","resize",u),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,"string","moveToAnchor(anchor) anchor"),pe("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){pe("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:t}=n,{mode:i,waitForLoad:o}=ee[t];-1!==i&&-2!==i&&(J(n,"load",(function(){pe(b,`${e}:${ge}`,t,!0),function(){const e=ee[u]?.firstRun,t=ee[u]?.heightCalculationMethod in w;!e&&t&&de({iframe:n,height:0,width:0,type:"init"})}()})),!1===o&&pe(v,`${e}:${ge}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&B(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 a(){const{mode:n}=ee[u];if(n<0)throw B("Parent",`${Q(n+2)}${Q(2)}`),P(u),Q(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ye||n>0&&t.vInfoDisable||(ye=!0,function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>G(Y[e]))(n)})`,n)),n<1&&B("Parent",Q(3))}function s(e){const t=ee[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,i;ee[u]={...ee[u],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...te,...r(e),mouseEvents:l(e),mode:K(e),syncTitle:s(u)},N(u,"setup"),function(){const{direction:e}=ee[u];if("horizontal"===e)return ee[u].sizeWidth=!0,ee[u].sizeHeight=!1,void C(u,"Direction: %chorizontal",p);if("none"===e)return ee[u].sizeWidth=!1,ee[u].sizeHeight=!1,ee[u].autoResize=!1,void C(u,"Direction: %cnone",p);if("vertical"!==e)throw new TypeError(u,`Direction value of "${e}" is not valid`);C(u,"Direction: %cvertical",p)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===ee[u].direction?(ee[u].offsetHeight=t,C(u,`Offset height: %c${t}`,p)):(ee[u].offsetWidth=t,C(u,`Offset width: %c${t}`,p))),e?.offset&&B(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===ee[u].postMessageTarget&&(ee[u].postMessageTarget=n.contentWindow),ee[u].targetOrigin=!0===ee[u].checkOrigin?""===(i=ee[u].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const d=()=>"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||te.id+me++;return null!==document.getElementById(e)&&(e+=me++),e}(),n.id=e,C(e,`Added missing iframe ID: ${e} (${n.src})`)),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),i="string"==typeof t.log,o=n?!!i||t.log:te.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&i?t.log===$:te.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=E({expand:t,label:I(n)});O=e,R[n]||(R[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(u,t),H(u,(function(e){d()?F(u,`Ignored iframe (${u}), already setup.`):(c(e),a(),ve(),function(){switch(C(u,`Iframe scrolling ${ee[u]?.scrolling?"enabled":"disabled"} for ${u}`),n.style.overflow=!1===ee[u]?.scrolling?"hidden":"auto",ee[u]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=ee[u]?ee[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ee[u];"number"!=typeof e&&"0"!==e||(ee[u].bodyMargin=`${e}px`)}(),o(he(u)),i(),C(u,"Setup complete"))}))(t),n?.iFrameResizer};function be(){!1===document.hidden&&(C("document","Trigger event: Visibility change"),function(e,t){const n=e=>ee[e]?.autoResize&&!ee[e]?.firstRun;Object.keys(ee).forEach((function(i){n(i)&&pe(e,t,i)}))}("Tab Visible","resize"))}const ve=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{J(window,"message",ie),J(document,"visibilitychange",be),window.iframeParentListener=e=>setTimeout((()=>ie({data:e,sameOrigin:!0})))})),ze=`[${g}] `;const $e=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ze}iframe is not defined`);case!e.tagName:throw new TypeError(`${ze}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ze}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(i,o){if("undefined"==typeof window)return[];switch(t=we(i),n=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${ze}Unexpected data type (${typeof o})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),$e(...e)}),$e}));
21
- //# sourceMappingURL=iframeResizer.min.js.map
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.4.5",g="iframeResizer",y="[iFrameSizer]",w=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),b="onload",v="init",z=Object.freeze({[b]:1,[v]:1}),$="expanded",j="collapsed",k=Object.freeze({[$]:1,[j]:1}),T=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)),x=e=>e,E=(M=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some((([e])=>e in o))||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask((()=>queueMicrotask(b)))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(r,c),assert:function(e,...t){e||z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},M?.__esModule?M.default:M);var M;let R={},O=!1;const S=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const I=e=>(t,...n)=>R[t]?.console[e](...n);var C;const A=(C="log",(e,...t)=>!0===(e=>R[e]?R[e].log:O)(e)?I(C)(e,...t):null),W=I("warn"),L=I("error"),F=I("event"),N=I("purge"),H=I("errorBoundary");const P=(e,...t)=>R[e]?R[e].console.warn(T(x)(...t)):queueMicrotask((()=>console?.warn(T((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t)))),B=(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</>.`))(P),q=B("Function"),D=B("Option"),U=(e,t,n,o)=>e.addEventListener(t,n,o||!1),J=(e,t,n)=>e.removeEventListener(t,n,!1),Z=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)},V=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),G=["<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."],X=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Y=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),_=e=>V(G[e]),Q=e=>{const t=e[V("spjluzl")];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Z(V(e));return n in Y&&(t=Y[n]),t}(n[0]);return 0===o||(e=>e[2]===Z(e[0]+e[1]))(n)||(o=-2),o},K={},ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof K[e.id].onInit&&(D("init()","onReady()","",e.id),K[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),te={position:null,version:m};function ne(e){function t(){ue(T),le(x),$("onResized",T)}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(){fe(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame((()=>{i[a]=null})))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{K[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(){F(l,`stop${t}`),a(0,J),c.disconnect(),u.disconnect(),J(K[l].iframe,"load",s)}const l=x,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));K[l]&&(K[l][`stop${t}`]=s,U(K[l].iframe,"load",s),a(0,U),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(K[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in K[x]&&(K[x][e](),delete K[x][e])},l=r("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=T.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}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function w(e){const t=e.getBoundingClientRect();return ae(),{x:Number(t.left)+Number(te.position.x),y:Number(t.top)+Number(te.position.y)}}function b(e){const t=e?w(T.iframe):{x:0,y:0};A(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){te.position=e,v(x)}(n)}function v(e){const{x:t,y:n}=te.position,o=K[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?le(e):se()}function z(e){let t={};if(0===T.width&&0===T.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>oe(x,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=T;switch(K[x]?.firstRun&&K[x]&&(K[x].firstRun=!1),r){case"close":re(n);break;case"message":l=i(6),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":K[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;A(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":b(!1);break;case"scrollToOffset":b(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=w(o);A(x,`Moving to in page link: %c#${t}`,p),te.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){K[t]?.syncTitle&&(K[t].iframe.title=e,A(t,`Set iframe title attribute: %c${e}`,p))}(o,x);break;case"reset":ce(T);break;case"init":t(),function(e){try{K[e].sameOrigin=!!K[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){K[e].sameOrigin=!1}}(x),(s=o)!==m&&(void 0!==s||P(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")),me=!0,$("onReady",n);break;default:if(0===a&&0===e)return void W(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?y===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in K&&(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=K[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=T.id,x?(F(x,T.type),H(x,(function(){!function(e){if(!K[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),T.type in{true:1,false:1,undefined:1}||(K[x].loaded=!0,(null!==T.iframe||(W(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=K[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=K[x]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.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())}))()):W("","iframeResizer received messageData without id, message was: ",k)):Object.keys(K).forEach((e=>{K[e].mode>=0&&fe("iFrame requested init",pe(e),e)}))}function oe(e,t,n){let o=null,i=null;if(K[e]){if(o=K[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),W(e,`Error in ${t} callback`)}else setTimeout((()=>o(n)))}return i}function ie(e){const{id:t}=e;delete K[t],delete e.iframeResizer}function re(e){const{id:t}=e;if(!1!==oe(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){W(t,e)}oe(t,"onClosed",t),ie(e)}}function ae(e){null===te.position&&(te.position={x:window.scrollX,y:window.scrollY})}function se(){te.position=null}function le(e){null!==te.position&&(window.scrollTo(te.position.x,te.position.y),A(e,`Set page position: %c${te.position.x}%c, %c${te.position.y}`,p,h,p),se())}function ce(e){ae(e.id),ue(e),fe("reset","reset",e.id)}function ue(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,A(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=K[n];o&&t("height"),i&&t("width")}R=K;const de=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function fe(e,t,n,o){function i(o){const i=e in z?de(t):t;A(n,o,p,h,p),A(n,`Message data: %c${i}`,p)}F(n,e),K[n]&&(K[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:o,sameOrigin:r,targetOrigin:a}=K[n];if(r)try{return e.contentWindow.iframeChildListener(y+t),void i(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),o.postMessage(y+t,a)}():W(n,`Iframe(${n}) not found`),o&&K[n]?.warningTimeout&&(K[n].msgTimeout=setTimeout((function(){if(void 0===K[n])return;const{iframe:e,loaded:t,loadErrorShown:o,waitForLoad:i}=K[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||o||(K[n].loadErrorShown=!0,P(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${K[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":""}${!a||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${!a||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`))}),K[n].warningTimeout)))}function pe(e){const t=K[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,te.version,t.mode,"",t.logExpand].join(":")}let he=0,me=!1,ge=!1;const ye=t=>n=>{function o(){if(K[d]){const{iframe:e}=K[d],t={close:re.bind(null,e),disconnect:ie.bind(null,e),removeListeners(){P(d,"\n<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize:fe.bind(null,"Window resize","resize",d),moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),fe("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){fe("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function i(e){const{id:t}=n,{mode:o,waitForLoad:i}=K[t];-1!==o&&-2!==o&&(U(n,"load",(function(){fe(b,`${e}:${me}`,t,!0),function(){const e=K[d]?.firstRun,t=K[d]?.heightCalculationMethod in w;!e&&t&&ce({iframe:n,height:0,width:0,type:"init"})}()})),!1===i&&fe(v,`${e}:${me}`,t,!0))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&P(d,'<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function a(){const{mode:n}=K[d];if(n<0)throw P("Parent",`${_(n+2)}${_(2)}`),N(d),_(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ge||n>0&&t.vInfoDisable||function(t,n){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,O||n<1?"font-weight: bold;":e)))}(`v${m} (${(e=>V(X[e]))(n)})`,n),!ge&&n<1&&P("Parent",_(3)),ge=!0}function s(e){const t=K[e]?.iframe?.title;return""===t||void 0===t}const l=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function c(e){var t,o;K[d]={...K[d],iframe:n,firstRun:!0,remoteHost:n?.src.split("/").slice(0,3).join("/"),...ee,...r(e),mouseEvents:l(e),mode:Q(e),syncTitle:s(d)},F(d,"setup"),function(){const{direction:e}=K[d];if("horizontal"===e)return K[d].sizeWidth=!0,void(K[d].sizeHeight=!1);if("none"===e)return K[d].sizeWidth=!1,K[d].sizeHeight=!1,void(K[d].autoResize=!1);if("vertical"!==e)throw new TypeError(d,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===K[d].direction?K[d].offsetHeight=t:K[d].offsetWidth=t),e?.offset&&P(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===K[d].postMessageTarget&&(K[d].postMessageTarget=n.contentWindow),K[d].targetOrigin=!0===K[d].checkOrigin?""===(o=K[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const u=()=>"iframeResizer"in n,d=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||ee.id+he++;return null!==document.getElementById(e)&&(e+=he++),e}(),n.id=e),e}(n.id);if("object"!=typeof t)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=$,e.logExpand=!t.includes("ifrlog=collapsed"))}(t),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:ee.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===$:ee.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=E({expand:t,label:S(n)});O=e,R[n]||(R[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in k)&&L(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,t),H(d,(function(e){u()?W(d,`Ignored iframe (${d}), already setup.`):(c(e),a(),be(),function(){switch(n.style.overflow=!1===K[d]?.scrolling?"hidden":"auto",K[d]?.scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=K[d]?K[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=K[d];"number"!=typeof e&&"0"!==e||(K[d].bodyMargin=`${e}px`)}(),i(pe(d)),o())}))(t),n?.iFrameResizer};function we(){!1===document.hidden&&function(e,t){const n=e=>K[e]?.autoResize&&!K[e]?.firstRun;Object.keys(K).forEach((function(o){n(o)&&fe(e,t,o)}))}("Tab Visible","resize")}const be=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{U(window,"message",ne),U(document,"visibilitychange",we),window.iframeParentListener=e=>setTimeout((()=>ne({data:e,sameOrigin:!0})))})),ve=`[${g}] `;const ze=function(){function e(e){switch(!0){case!e:throw new TypeError(`${ve}iframe is not defined`);case!e.tagName:throw new TypeError(`${ve}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${ve}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=ye(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${ve}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){q("iFrameResize()","iframeResize()","","parent"),ze(...e)}),ze}));