@iframe-resizer/child 5.5.1-beta.1 → 5.5.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +2 -2
- package/index.cjs.js.map +1 -1
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.2-beta.1 (esm) - 2025-08-03
|
|
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,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as i}from"auto-console-group";const a="5.5.1-beta.1",s="iframeResizer",l=10,c="data-iframe-size",u="data-iframe-overflowed",d="data-iframe-ignore",m="bottom",f="right",p="autoResizeEnabled",h=Symbol("sizeChanged"),g="manualResize",y={},b="setOffsetSize",v="resizeObserver",z="overflowObserver",w="mutationObserver",$="visibilityObserver",S="none",O="No change in content size detected",M="init",k=(e,t,n,o)=>e.addEventListener(t,n,o||!1),E=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},T=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),I=["spjluzl","rlf","clyzpvu"],j=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],A=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],x=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),P=e=>T(j[e]),N=e=>{const t=e[T(I[0])]||e[T(I[1])]||e[T(I[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=E(T(e));return n in x&&(t=x[n]),t}(n[0]);return 0===o||(e=>e[2]===E(e[0]+e[1]))(n)||(o=-2),o},C=(e,...t)=>setTimeout(()=>e(...t),0),R=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},q=e=>e,B=e=>Math.round(1e3*e)/1e3,L=e=>e.charAt(0).toUpperCase()+e.slice(1),W=e=>""!=`${e}`&&void 0!==e;const F=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${L(t)}`)};let D=!0,V=s;var H;const U=(H=e,H?.__esModule?H.default:H)({label:`${s}(child)`});const Z=(J="log",(...e)=>!D||U[J](...e));var J;const _=Z;const{assert:Q,debug:Y,endAutoGroup:G,error:X,errorBoundary:K,event:ee,label:te,purge:ne,warn:oe}=U,re=e=>{return U.warn((t=q,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},ie=re,ae=(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)=>re(t)),se=ae("Method"),le=ae("Method","replaced with"),ce=ae("Option"),ue=["min-height","min-width","max-height","max-width"],de=new Set,me=e=>e.tagName?e.tagName.toLowerCase():"unknown",fe=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),pe=(e,t)=>{return(n=fe(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function he({href:e}){de.has(e)||(Z("Unable to access stylesheet:",e),de.add(e))}const ge=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){he(n)}return{source:"cross-origin stylesheet",value:fe(e,t)}}(e,t),ye=(e,t)=>{const{source:n,value:o}=ge(e,t),r=me(e);re(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function be(){for(const e of[document.documentElement,document.body])for(const t of ue)Z(`Checking <${me(e)}> for blocking CSS: ${t}`),pe(e,t)&&ye(e,t)}const ve=e=>t=>void 0===t?void 0:e(t),ze=ve(e=>"true"===e),we=ve(Number),$e=new Set,Se=new Set,Oe=[];let Me,ke=1,Ee=!1,Te=0;const Ie=e=>{Z("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)$e.add(t);for(const e of n)$e.has(e)?$e.delete(e):Se.add(e)}};function je(e){Oe.push(e),Ee||(Te=performance.now(),Ee=!0,requestAnimationFrame(Me))}function Ae(e){const t=new window.MutationObserver(je),r=document.querySelector("body"),i={attributes:!0,attributeFilter:[d,c],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Me=(e=>()=>{const t=performance.now(),r=t-Te,i=16*ke+++2;if(r>i&&r<200)return ee("MutationDelay"),_("Update delayed due to heavy workload on the callStack"),_(`EventLoop busy time: %c${B(r)}ms %c> Max wait: %c${i-2}ms`,n,o,n),setTimeout(Me,16*ke),void(Te=t);ke=1,Oe.forEach(Ie),Oe.length=0,e({addedMutations:$e,removedMutations:Se}),Ee=!1,$e.clear(),Se.clear()})(e),t.observe(r,i),_("Attached MutationObserver to body"),t}const xe=(e,o=!0)=>r=>{r>0&&_(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Pe=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Ne=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Ce=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(u,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!Ne(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(Q(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Pe(0,l,c)}},Re="--ifr-start",qe="--ifr-end",Be=[],Le=new WeakSet,We=e=>"object"==typeof e&&Le.add(e);let Fe={},De=0;function Ve(e){e.getEntries().forEach(e=>{if(e.name===qe){const{duration:t}=performance.measure("--ifr-measure",Re,qe);Fe=e.detail,Be.push(t),Be.length>100&&Be.shift()}})}function He(){_("Attached PerformanceObserver to page");new PerformanceObserver(Ve).observe({entryTypes:["mark"]}),We(document.documentElement),We(document.body),function(){const e=setInterval(()=>{if(Be.length<10)return;if(Fe.hasTags&&Fe.len<25)return;Be.sort();const t=Math.min(Be.reduce((e,t)=>e+t,0)/Be.length,Be[Math.floor(Be.length/2)]),n=B(t);n>De&&(De=n,ee("performanceObserver"),Z("Mean time:",B(Be[Math.floor(Be.length/2)])),Z("Median time:",B(Be.reduce((e,t)=>e+t,0)/Be.length)),Z("Average time:",n),Z("Max time:",B(Math.max(...Be)))),t<=4||(clearInterval(e),re(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${B(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Fe.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const Ue=xe("Resize"),Ze=new WeakSet;let Je;function _e(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=Ze.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(Q(!o,"Node already observed for resize",n),o||(Je.observe(n),Ze.add(n),t+=1))}Ue(t)}const Qe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ye=Qe("function"),Ge=Qe("number"),Xe=Qe("string");"undefined"!=typeof window&&function(){const e={height:()=>(oe("Custom height calculation function not defined"),Ut.auto()),width:()=>(oe("Custom width calculation function not defined"),Zt.auto())},E={},j={},x="auto",q="[iFrameSizer]",H="scroll";let J,Q,X,ne,ae,ue,de,me,fe,pe,he,ge=!0,ye="",ve=0,$e="",Se="",Oe=!1,Me=!0,ke=!1,Ee=!0,Te=!1,Ie=!1,je=!1,Ne=1,Be=x,Le="",We=!0,Fe={},De=!1,Ve=!0,Ue=!1,Qe=0,Ke=!1,et=[],tt="",nt="child",ot=!1,rt="",it=[],at=window.parent,st="*",lt=0,ct=!1,ut=1,dt=H,mt=window,ft=()=>{oe("onMessage function not defined")},pt=()=>{},ht=null,gt=null;function yt(r){var i,u,d;!function(e){tt=e[0]??tt,ve=we(e[1])??ve,ke=ze(e[2])??ke,Ue=ze(e[3])??Ue,ge=ze(e[6])??ge,$e=e[7]??$e,Be=e[8]??Be,ye=e[9]??ye,Se=e[10]??Se,lt=we(e[11])??lt,Fe.enable=ze(e[12])??!1,nt=e[13]??nt,dt=e[14]??dt,Ke=ze(e[15])??Ke,X=we(e[16])??X,ne=we(e[17])??ne,Me=ze(e[18])??Me,J=e[19]??J,pe=e[20]??pe,Qe=we(e[21])??Qe,Ve=ze(e[23])??Ve}(r),V=(i={id:tt,enabled:Ue,expand:Ve}).id||s,U.label(`${V}`),U.expand(i.expand),D=i.enabled,Z(`Initialising iframe v${a} ${window.location.href}`),function(){function t(e){Z("Reading data from page:",Object.keys(e)),he=Ye(e,"onBeforeResize")??he,ft=Ye(e,"onMessage")??ft,pt=Ye(e,"onReady")??pt,"number"==typeof e?.offset&&(ce("offset","offsetSize"),Me&&(X=Ge(e,"offset")??X),ke&&(ne=Ge(e,"offset")??ne)),"number"==typeof e?.offsetSize&&(Me&&(X=Ge(e,"offsetSize")??X),ke&&(ne=Ge(e,"offsetSize")??ne)),Q=Xe(e,T(I[0]))??Q,Le=Xe(e,"ignoreSelector")??Le,rt=Xe(e,"sizeSelector")??rt,st=Xe(e,"targetOrigin")??st,Be=e?.heightCalculationMethod||Be,dt=e?.widthCalculationMethod||dt}function o(t,n){return"function"==typeof t&&(re(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===Qe)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),Be=o(Be,"height"),dt=o(dt,"width"),_(`Set targetOrigin for parent: %c${st}`,n))}(),Ot(),function(){try{ot=1===Qe||"iframeParentListener"in window.parent}catch(e){Z("Cross domain iframe detected")}}(),ke===Me&&(Oe=!0),function(){const e=Qe,n=N({key:J}),o=N({key:Q});if(Qe=Math.max(n,o),Qe<0){if(Qe=Math.min(n,o),re(`${P(Qe+2)}${P(2)}`),W(pe))throw P(Qe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!W(pe)||e>-1&&Qe>e)&&(sessionStorage.getItem("ifr")!==a&&function(e,n){console.info(`${V} %ciframe-resizer ${e}`,D||n<1?"font-weight: bold;":t)}(`v${a} (${(e=>T(A[e]))(Qe)})`,Qe),Qe<2&&ie(P(3)),sessionStorage.setItem("ifr",a))}(),pe&&""!==pe&&"false"!==pe?pe!==a&&re(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${pe} - Child page: ${a}.\n`):re("<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"),Et(),Tt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(c,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&re("<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&&re("<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"),vt(),Oe||be(),1!==Qe&&(mt.parentIframe=Object.freeze({autoResize:e=>(F(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ke&&!1===Me?(ee(p),re(`Auto Resize can not be changed when <b>direction</> is set to '${S}'.`),!1):(!0===e&&!1===ge?(ge=!0,queueMicrotask(()=>Xt(p,"Auto Resize enabled"))):!1===e&&!0===ge&&(ge=!1),en(0,0,"autoResize",JSON.stringify(ge)),ge)),close(){en(0,0,"close")},getId:()=>tt,getOrigin:()=>(se("getOrigin()","getParentOrigin()"),ae),getParentOrigin:()=>ae,getPageInfo(e){if("function"==typeof e)return ht=e,en(0,0,"pageInfo"),void le("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");ht=null,en(0,0,"pageInfoStop")},getParentProps:e=>(F(e,"function","parentIframe.getParentProps(callback) callback"),gt=e,en(0,0,"parentInfo"),()=>{gt=null,en(0,0,"parentInfoStop")}),getParentProperties(e){se("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){F(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Fe.findTarget(e)},reset(){!function(){const e=Be;Be=x,Z("Reset trigger event: %cparentIframe.reset",n),ct?Z("TriggerLock blocked calculation"):(ct=!0,Y("Trigger event lock on"),requestAnimationFrame(()=>{ct=!1,Y("Trigger event lock off")})),Kt("reset"),Be=e}()},setOffsetSize(e){F(e,"number","parentIframe.setOffsetSize(offset) offset"),X=e,ne=e,Xt(b,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){F(e,"number","parentIframe.scrollBy(x, y) x"),F(t,"number","parentIframe.scrollBy(x, y) y"),en(t,e,"scrollBy")},scrollTo(e,t){F(e,"number","parentIframe.scrollTo(x, y) x"),F(t,"number","parentIframe.scrollTo(x, y) y"),en(t,e,"scrollTo")},scrollToOffset(e,t){F(e,"number","parentIframe.scrollToOffset(x, y) x"),F(t,"number","parentIframe.scrollToOffset(x, y) y"),en(t,e,"scrollToOffset")},sendMessage(e,t){t&&F(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),en(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Be=e,Et()},setWidthCalculationMethod(e){dt=e,Tt()},setTargetOrigin(e){F(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Z(`Set targetOrigin: %c${e}`,n),st=e},resize(e,t){e&&F(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&F(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Xt(g,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){se("size()","resize()"),this.resize(e,t)}}),mt.parentIFrame=mt.parentIframe),function(){function e(e){en(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,o){Z(`Add event listener: %c${o}`,n),k(window.document,t,e)}!0===Ke&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Fe=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,l)+parseInt(o.x,l),y:parseInt(n.top,l)+parseInt(o.y,l)}}function r(e){function r(e){const r=t(e);Z(`Moving to in page link (%c#${i}%c) at x: %c${r.x}%c y: %c${r.y}`,n,o,n,o,n),en(r.y,r.x,"scrollToOffset")}const i=e.split("#")[1]||e,a=decodeURIComponent(i),s=document.getElementById(a)||document.getElementsByName(a)[0];void 0===s?(Z(`In page link (#${i}) not found in iFrame, so sending to parent`),en(0,0,"inPageLink",`#${i}`)):r(s)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",t=>{t.preventDefault(),r(e.getAttribute("href"))})}function s(){k(window,"hashchange",i)}function c(){setTimeout(i,128)}function u(){Z("Setting up location.hash handlers"),a(),s(),c()}return Fe.enable?1===Qe?re("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):u():Z("In page linking not enabled"),{findTarget:r}}(),void 0===$e&&($e=`${ve}px`),$t("margin",(u="margin",(d=$e).includes("-")&&(oe(`Negative CSS value ignored for ${u}`),d=""),d)),$t("background",ye),$t("padding",Se),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),Oe||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),Z("Set HTML & body height: %cauto !important",n)}(),!0!==ge&&Z("Auto Resize disabled"),function(e){Mt({method:e,eventType:"After Print",eventName:"afterprint"}),Mt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Mt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Wt(document.documentElement)();Z("Attaching Observers"),Ae(qt),function(e){const t={root:document.documentElement,side:Me?m:f};ue=Ce(jt,t),ue.attachObservers(e)}(e),He(),function(e){Je=new ResizeObserver(At),Je.observe(document.body),Ze.add(document.body),_("Attached ResizeObserver to body"),de={attachObserverToNonStaticElements:_e,detachObservers:Pe(0,Je,Ze)},de.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),_("Attached VisibilityObserver to page")}(xt)}(),bt(R(pt)),Z("Initialization complete"),Xt(M,"Init message from host page",void 0,void 0,`${a}:${Qe}`),document.title&&""!==document.title&&en(0,0,"title",document.title)}function bt(e){"complete"===document.readyState?C(e):k(document,"readystatechange",()=>bt(e))}function vt(){it=document.querySelectorAll(`[${c}]`),je=it.length>0,Z(`Tagged elements found: %c${je}`,n)}let zt=0;function wt(){const e=document.querySelectorAll(`*[${d}]`);Te=e.length>0,Te&&e.length!==zt&&(function(e){const n=1===e.length?"":"s";oe(`%c[${d}]%c found on %c${e.length}%c element${n}`,i,t,i,t)}(e),zt=e.length)}function $t(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),_(`Set body ${e}: %c${t}`,n))}function St(e,t,o){if(""!==o){Z(`${e}: %c${o}`,n);for(const e of document.querySelectorAll(o))Z(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ot(){St("sizeSelector",c,rt),St("ignoreSelector",d,Le)}function Mt(e){({add(t){function n(){Xt(e.eventName,e.eventType)}j[t]=n,k(window,t,n,{passive:!0})},remove(e){const t=j[e];var n,o;delete j[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),Z(`${L(e.method)} event listener: %c${e.eventType}`,n)}function kt(e,t,o,r){return t!==e&&(e in o||(oe(`${e} is not a valid option for ${r}CalculationMethod.`),e=t),e in E)&&re(`<rb>Deprecated ${r}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${pe?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),Z(`Set ${r} calculation method: %c${e}`,n),e}function Et(){Be=kt(Be,x,Ut,"height")}function Tt(){dt=kt(dt,H,Zt,"width")}function It(){const e=document.querySelectorAll(`[${u}]`);et=Array.from(e).filter(e=>!e.closest(`[${d}]`)),Ie=et.length>0}function jt(e){It(),(Ie||e)&&(et.length>1?_("Overflowed Elements:",...et):Ie||_("Overflow removed"),Xt(z,"Overflow updated"))}function At(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Xt(v,`Element resized <${function(e){switch(!0){case!W(e):return"";case W(e.id):return`${e.nodeName}#${e.id}`;case W(e.name):return`${e.nodeName} (${e.name}`;case W(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function xt(e){Z(`Visible: %c${e}`,n),De=!e,Xt($,"Visibility changed")}const Pt=xe("Overflow"),Nt=xe("Overflow",!1),Ct=xe("Resize"),Rt=xe("Resize",!1);function qt(e){!function({addedMutations:e,removedMutations:t}){ee("contentMutated"),Ot(),vt(),It();let n=0,o=0,r=0,i=0;for(const e of t){const t=Wt(e)();o+=ue.detachObservers(t),i+=de.detachObservers(t)}for(const t of e){const e=Wt(t)();n+=ue.attachObservers(e),r+=de.attachObserverToNonStaticElements(e)}Nt(o),Rt(i),Pt(n),Ct(r),G()}(e),Xt(w,"Mutation Observed")}function Bt(e){performance.mark(Re);const t=L(e);let n=0,o=document.documentElement,r=je?0:document.documentElement.getBoundingClientRect().bottom;const i=je?it:Ie?et:Wt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return _(`${t} position calculated from:`,o),performance.mark(qe,{detail:{hasTags:je,len:i.length,logging:Ue,Side:t}}),r}const Lt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Wt=e=>()=>{if(Z("node:",e),Z("node type:",e?.nodeType),!(e=>e.nodeType===Node.ELEMENT_NODE)(e))return[e];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 wt(),Te&&t.push(`not([${d}])`,`not([${d}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Ft={height:0,width:0},Dt={height:0,width:0},Vt=[n,o,n];function Ht(e){function t(){return Dt[r]=i,Ft[r]=l,i}const o=e===Ut,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!e.enabled():return l;case je:_("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!Ie&&0===Dt[r]&&0===Ft[r]:_(`Initial page size values: ${c}`,...Vt),u=t();break;case ct&&i===Dt[r]&&l===Ft[r]:_(`Size unchanged: ${c}`,...Vt),u=Math.max(i,l);break;case 0===i:_(`Page is hidden: ${c}`,...Vt),u=l;break;case!Ie&&i!==Dt[r]&&l<=Ft[r]:_(`New <html> size: ${c} `,...Vt),_(`Previous <html> size: %c${Dt[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!Ie&&i<Dt[r]:_(`<html> size decreased: ${c}`,...Vt),u=t();break;case l===s||l===a:_(`<html> size equals page size: ${c}`,...Vt),u=t();break;case i>l:_(`Page size < <html> size: ${c}`,...Vt),u=t();break;case Ie:_("Found element overflowing <html> "),u=e.taggedElement();break;default:_(`Using <html> size: ${c}`,...Vt),u=t()}return _(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&_(`Page offsetSize: %c${t}px`,n),t}(e),u}const Ut={enabled:()=>Me,getOffset:()=>X,auto:()=>Ht(Ut),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,l)+parseInt(t.marginBottom,l)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Ut.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Lt(Ut)),min:()=>Math.min(...Lt(Ut)),grow:()=>Ut.max(),lowestElement:()=>Bt(m),taggedElement:()=>Bt(m)},Zt={enabled:()=>ke,getOffset:()=>ne,auto:()=>Ht(Zt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Lt(Zt)),min:()=>Math.min(...Lt(Zt)),rightMostElement:()=>Bt(f),scroll:()=>Math.max(Zt.bodyScroll(),Zt.documentElementScroll()),taggedElement:()=>Bt(f)},Jt=(e,t)=>!(Math.abs(e-t)<=lt);function _t(e,t){const n=e[t]();return e.enabled()&&void 0!==he?function(e){const t=he(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Qt=!1;const Yt=R(()=>ie(P(4)));let Gt=!1;const Xt=K((e,t,o,r,i)=>{if(fe=performance.now(),me=!0,ee(e),!0!==Qt){if(!ge&&!(e in y))return _("Resizing disabled"),void G();if(De){if(!0===Gt)return;return Z("Iframe hidden - Ignored resize request"),void(Gt=!0)}Gt=!1,Qt=!0,requestAnimationFrame(()=>{Qt=!1}),function(e,t,o,r,i){const a=o??_t(Ut,Be),s=r??_t(Zt,dt),l=Me&&Jt(Ne,a)||ke&&Jt(ut,s)?h:e;switch(Z(`Resize event: %c${t}`,n),l){case M:case p:case h:Ne=a,ut=s;case b:en(Ne,ut,e,i);break;case z:case w:case v:case $:Z(O);break;default:_(O)}me=!1}(e,t,o,r,i)}});function Kt(e){Ne=Ut[Be](),ut=Zt[dt](),en(Ne,ut,e)}const en=K(function(e,t,o,i,a){Qe<-1||(ee(o),void 0!==a?Z(`Message targetOrigin: %c${a}`,n):a=st,function(){const s=`${tt}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(ot)try{window.parent.iframeParentListener(q+s)}catch(e){if(1!==Qe)throw e;return void Yt()}else at.postMessage(q+s,a);me&&Z(function(){const e=B(performance.now()-fe);return o===M?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),n),_(`Sending message to parent page via ${ot?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}(),G())}),tn=K(function(e){ee("onMessage");const{freeze:t}=Object,{parse:o}=JSON,r=e=>t(o(e)),i=e=>en(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void Z("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");at=e.source,ae=e.origin,yt(t),Ee=!1,setTimeout(()=>{We=!1},128)},reset(){We?Z("Page reset ignored by init"):(Z("Page size reset by host page"),Kt("resetPage"))},resize(){Z("Resize requested by host page"),Xt("parentResize","Parent window requested size check")},moveToAnchor(){Fe.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();Z("PageInfo received from parent:",r(e)),ht?C(ht,o(e)):i("pageInfo")},parentInfo(){const e=r(l());Z("ParentInfo received from parent:",e),gt?C(gt,e):i("parentInfo")},message(){const e=l();Z("onMessage called from parent:%c",n,r(e)),C(ft,o(e))}},s=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=s();ee(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||oe(`Unexpected message (${e.data})`)}q===`${e.data}`.slice(0,13)&&function(){if(!1!==Ee)return c()?(te(s()),ee(M),void a.init()):void Z(`Ignored message of type "${s()}". Received before initialization.`);u()}()});function nn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?oe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>tn({data:e,sameOrigin:!0})),k(window,"message",tn),k(window,"readystatechange",nn),nn())}();
|
|
20
|
+
import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as i}from"auto-console-group";const a="5.5.2-beta.1",s="iframeResizer",l=10,c="data-iframe-size",u="data-iframe-overflowed",d="data-iframe-ignore",m="bottom",f="right",p="autoResizeEnabled",h=Symbol("sizeChanged"),g="manualResize",y={},v="setOffsetSize",b="resizeObserver",z="overflowObserver",w="mutationObserver",$="visibilityObserver",S="none",O="No change in content size detected",M="init",k=new Set(["head","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),E=(e,t,n,o)=>e.addEventListener(t,n,o||!1),T=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},I=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),j=["spjluzl","rlf","clyzpvu"],A=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],x=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],P=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),N=e=>I(A[e]),C=e=>{const t=e[I(j[0])]||e[I(j[1])]||e[I(j[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=T(I(e));return n in P&&(t=P[n]),t}(n[0]);return 0===o||(e=>e[2]===T(e[0]+e[1]))(n)||(o=-2),o},R=e=>e.nodeType===Node.ELEMENT_NODE,L=(e,...t)=>setTimeout(()=>e(...t),0),q=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},B=e=>e,W=e=>Math.round(1e3*e)/1e3,F=e=>e.charAt(0).toUpperCase()+e.slice(1),D=e=>""!=`${e}`&&void 0!==e;const V=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${F(t)}`)};let H=!0,U=s;var Z;const J=(Z=e,Z?.__esModule?Z.default:Z)({label:`${s}(child)`});const _=(Q="log",(...e)=>!H||J[Q](...e));var Q;const Y=_;const{assert:G,debug:X,endAutoGroup:K,error:ee,errorBoundary:te,event:ne,label:oe,purge:re,warn:ie}=J,ae=e=>{return J.warn((t=B,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(e));var t},se=ae,le=(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)=>ae(t)),ce=le("Method"),ue=le("Method","replaced with"),de=le("Option"),me=["min-height","min-width","max-height","max-width"],fe=new Set,pe=e=>e.tagName?e.tagName.toLowerCase():"unknown",he=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ge=(e,t)=>{return(n=he(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function ye({href:e}){fe.has(e)||(_("Unable to access stylesheet:",e),fe.add(e))}const ve=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){ye(n)}return{source:"cross-origin stylesheet",value:he(e,t)}}(e,t),be=(e,t)=>{const{source:n,value:o}=ve(e,t),r=pe(e);ae(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function ze(){for(const e of[document.documentElement,document.body])for(const t of me)_(`Checking <${pe(e)}> for blocking CSS: ${t}`),ge(e,t)&&be(e,t)}const we=e=>t=>void 0===t?void 0:e(t),$e=we(e=>"true"===e),Se=we(Number),Oe=new Set,Me=new Set,ke=[],Ee={attributes:!0,attributeFilter:[d,c],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Te,Ie=1,je=!1,Ae=0;const xe=e=>{Y("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)R(t)&&(k.has(t.tagName.toLowerCase())||Oe.add(t));for(const e of n)R(e)&&(k.has(e.tagName.toLowerCase())||(Oe.has(e)?Oe.delete(e):Me.add(e)))}Me.size>0&&_(`Detected %c${Me.size} %cremoved element${Me.size>1?"s":""}`,n,o),Oe.size>0&&_(`Found %c${Oe.size} %cnew element${Oe.size>1?"s":""}`,n,o)};function Pe(e){ke.push(e),je||(Ae=performance.now(),je=!0,requestAnimationFrame(Te))}function Ne(e){const t=new window.MutationObserver(Pe),r=document.body||document.documentElement;return Te=(e=>()=>{const t=performance.now(),r=t-Ae,i=16*Ie+++2;if(r>i&&r<200)return ne("mutationThrottled"),Y("Update delayed due to heavy workload on the callStack"),Y(`EventLoop busy time: %c${W(r)}ms %c> Max wait: %c${i-2}ms`,n,o,n),setTimeout(Te,16*Ie),void(Ae=t);Ie=1,ke.forEach(xe),ke.length=0,e({addedMutations:Oe,removedMutations:Me}),je=!1,Oe.clear(),Me.clear()})(e),t.observe(r,Ee),Y("Attached MutationObserver to body"),t}const Ce=(e,o=!0)=>r=>{r>0&&Y(`${o?"At":"De"}tached ${e}Observer ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t)},Re=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Le=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,qe=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||B,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(u,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!Le(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(G(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Re(0,l,c)}},Be="--ifr-start",We="--ifr-end",Fe=[],De=new WeakSet,Ve=e=>"object"==typeof e&&De.add(e);let He={},Ue=0;function Ze(e){e.getEntries().forEach(e=>{if(e.name===We){const{duration:t}=performance.measure("--ifr-measure",Be,We);He=e.detail,Fe.push(t),Fe.length>100&&Fe.shift()}})}function Je(){Y("Attached PerformanceObserver to page");new PerformanceObserver(Ze).observe({entryTypes:["mark"]}),Ve(document.documentElement),Ve(document.body),function(){const e=setInterval(()=>{if(Fe.length<10)return;if(He.hasTags&&He.len<25)return;Fe.sort();const t=Math.min(Fe.reduce((e,t)=>e+t,0)/Fe.length,Fe[Math.floor(Fe.length/2)]),n=W(t);n>Ue&&(Ue=n,ne("performanceObserver"),_("Mean time:",W(Fe[Math.floor(Fe.length/2)])),_("Median time:",W(Fe.reduce((e,t)=>e+t,0)/Fe.length)),_("Average time:",n),_("Max time:",W(Math.max(...Fe)))),t<=4||(clearInterval(e),ae(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${W(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${He.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const _e=new WeakSet;let Qe;function Ye(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=_e.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(G(!o,"Node already observed for resize",n),o||(Qe.observe(n),_e.add(n),t+=1))}return t}const Ge=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Xe=Ge("function"),Ke=Ge("number"),et=Ge("string");"undefined"!=typeof window&&function(){const e={height:()=>(ie("Custom height calculation function not defined"),_t.auto()),width:()=>(ie("Custom width calculation function not defined"),Qt.auto())},T={},A={},P="auto",B="[iFrameSizer]",Z="scroll";let Q,ee,re,le,me,fe,pe,he,ge,ye,ve,be=!0,we="",Oe=0,Me="",ke="",Ee=!1,Te=!0,Ie=!1,je=!0,Ae=!1,xe=!1,Pe=!1,Le=1,Fe=P,De="",Ve=!0,He={},Ue=!1,Ze=!0,Ge=!1,tt=0,nt=!1,ot=[],rt="",it="child",at=!1,st="",lt=[],ct=window.parent,ut="*",dt=0,mt=!1,ft=1,pt=Z,ht=window,gt=()=>{ie("onMessage function not defined")},yt=()=>{},vt=null,bt=null;function zt(r){var i,u,d;!function(e){rt=e[0]??rt,Oe=Se(e[1])??Oe,Ie=$e(e[2])??Ie,Ge=$e(e[3])??Ge,be=$e(e[6])??be,Me=e[7]??Me,Fe=e[8]??Fe,we=e[9]??we,ke=e[10]??ke,dt=Se(e[11])??dt,He.enable=$e(e[12])??!1,it=e[13]??it,pt=e[14]??pt,nt=$e(e[15])??nt,re=Se(e[16])??re,le=Se(e[17])??le,Te=$e(e[18])??Te,Q=e[19]??Q,ye=e[20]??ye,tt=Se(e[21])??tt,Ze=$e(e[23])??Ze}(r),U=(i={id:rt,enabled:Ge,expand:Ze}).id||s,J.label(`${U}`),J.expand(i.expand),H=i.enabled,_(`Initialising iframe v${a} ${window.location.href}`),function(){function t(e){_("Reading data from page:",Object.keys(e)),ve=Xe(e,"onBeforeResize")??ve,gt=Xe(e,"onMessage")??gt,yt=Xe(e,"onReady")??yt,"number"==typeof e?.offset&&(de("offset","offsetSize"),Te&&(re=Ke(e,"offset")??re),Ie&&(le=Ke(e,"offset")??le)),"number"==typeof e?.offsetSize&&(Te&&(re=Ke(e,"offsetSize")??re),Ie&&(le=Ke(e,"offsetSize")??le)),ee=et(e,I(j[0]))??ee,De=et(e,"ignoreSelector")??De,st=et(e,"sizeSelector")??st,ut=et(e,"targetOrigin")??ut,Fe=e?.heightCalculationMethod||Fe,pt=e?.widthCalculationMethod||pt}function o(t,n){return"function"==typeof t&&(ae(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===tt)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(t(r),Fe=o(Fe,"height"),pt=o(pt,"width"),Y(`Set targetOrigin for parent: %c${ut}`,n))}(),Et(),function(){try{at=1===tt||"iframeParentListener"in window.parent}catch(e){_("Cross domain iframe detected")}}(),Ie===Te&&(Ee=!0),function(){const e=tt,n=C({key:Q}),o=C({key:ee});if(tt=Math.max(n,o),tt<0){if(tt=Math.min(n,o),ae(`${N(tt+2)}${N(2)}`),D(ye))throw N(tt+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!D(ye)||e>-1&&tt>e)&&(sessionStorage.getItem("ifr")!==a&&function(e,n){console.info(`${U} %ciframe-resizer ${e}`,H||n<1?"font-weight: bold;":t)}(`v${a} (${(e=>I(x[e]))(tt)})`,tt),tt<2&&se(N(3)),sessionStorage.setItem("ifr",a))}(),ye&&""!==ye&&"false"!==ye?ye!==a&&ae(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ye} - Child page: ${a}.\n`):ae("<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"),jt(),At(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(c,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ae("<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&&ae("<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"),$t(),Ee||ze(),1!==tt&&(ht.parentIframe=Object.freeze({autoResize:e=>(V(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ie&&!1===Te?(ne(p),ae(`Auto Resize can not be changed when <b>direction</> is set to '${S}'.`),!1):(!0===e&&!1===be?(be=!0,queueMicrotask(()=>tn(p,"Auto Resize enabled"))):!1===e&&!0===be&&(be=!1),on(0,0,"autoResize",JSON.stringify(be)),be)),close(){on(0,0,"close")},getId:()=>rt,getOrigin:()=>(ce("getOrigin()","getParentOrigin()"),me),getParentOrigin:()=>me,getPageInfo(e){if("function"==typeof e)return vt=e,on(0,0,"pageInfo"),void ue("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");vt=null,on(0,0,"pageInfoStop")},getParentProps:e=>(V(e,"function","parentIframe.getParentProps(callback) callback"),bt=e,on(0,0,"parentInfo"),()=>{bt=null,on(0,0,"parentInfoStop")}),getParentProperties(e){ce("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){V(e,"string","parentIframe.moveToAnchor(anchor) anchor"),He.findTarget(e)},reset(){!function(){const e=Fe;Fe=P,_("Reset trigger event: %cparentIframe.reset",n),mt?_("TriggerLock blocked calculation"):(mt=!0,X("Trigger event lock on"),requestAnimationFrame(()=>{mt=!1,X("Trigger event lock off")})),nn("reset"),Fe=e}()},setOffsetSize(e){V(e,"number","parentIframe.setOffsetSize(offset) offset"),re=e,le=e,tn(v,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){V(e,"number","parentIframe.scrollBy(x, y) x"),V(t,"number","parentIframe.scrollBy(x, y) y"),on(t,e,"scrollBy")},scrollTo(e,t){V(e,"number","parentIframe.scrollTo(x, y) x"),V(t,"number","parentIframe.scrollTo(x, y) y"),on(t,e,"scrollTo")},scrollToOffset(e,t){V(e,"number","parentIframe.scrollToOffset(x, y) x"),V(t,"number","parentIframe.scrollToOffset(x, y) y"),on(t,e,"scrollToOffset")},sendMessage(e,t){t&&V(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),on(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Fe=e,jt()},setWidthCalculationMethod(e){pt=e,At()},setTargetOrigin(e){V(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),_(`Set targetOrigin: %c${e}`,n),ut=e},resize(e,t){e&&V(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&V(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),tn(g,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ce("size()","resize()"),this.resize(e,t)}}),ht.parentIFrame=ht.parentIframe),function(){function e(e){on(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,o){_(`Add event listener: %c${o}`,n),E(window.document,t,e)}!0===nt&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),He=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,l)+parseInt(o.x,l),y:parseInt(n.top,l)+parseInt(o.y,l)}}function r(e){function r(e){const r=t(e);_(`Moving to in page link (%c#${i}%c) at x: %c${r.x}%c y: %c${r.y}`,n,o,n,o,n),on(r.y,r.x,"scrollToOffset")}const i=e.split("#")[1]||e,a=decodeURIComponent(i),s=document.getElementById(a)||document.getElementsByName(a)[0];void 0===s?(_(`In page link (#${i}) not found in iFrame, so sending to parent`),on(0,0,"inPageLink",`#${i}`)):r(s)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&E(e,"click",t=>{t.preventDefault(),r(e.getAttribute("href"))})}function s(){E(window,"hashchange",i)}function c(){setTimeout(i,128)}function u(){_("Setting up location.hash handlers"),a(),s(),c()}return He.enable?1===tt?ae("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):u():_("In page linking not enabled"),{findTarget:r}}(),void 0===Me&&(Me=`${Oe}px`),Mt("margin",(u="margin",(d=Me).includes("-")&&(ie(`Negative CSS value ignored for ${u}`),d=""),d)),Mt("background",we),Mt("padding",ke),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),Ee||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),_("Set HTML & body height: %cauto !important",n)}(),!0!==be&&_("Auto Resize disabled"),function(e){Tt({method:e,eventType:"After Print",eventName:"afterprint"}),Tt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Tt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Vt(document.documentElement)();_("Attaching Observers"),Ne(Wt),function(e){const t={root:document.documentElement,side:Te?m:f};fe=qe(Lt,t);const n=fe.attachObservers(e);xt(n)}(e),Je(),function(e){Qe=new ResizeObserver(qt),Qe.observe(document.body),_e.add(document.body),Y("Attached ResizeObserver to body"),pe={attachObserverToNonStaticElements:Ye,detachObservers:Re(0,Qe,_e)};const t=pe.attachObserverToNonStaticElements(e);Nt(t)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),Y("Attached VisibilityObserver to page")}(Bt)}(),wt(q(yt)),_("Initialization complete"),tn(M,"Init message from host page",void 0,void 0,`${a}:${tt}`),document.title&&""!==document.title&&on(0,0,"title",document.title)}function wt(e){"complete"===document.readyState?L(e):E(document,"readystatechange",()=>wt(e))}function $t(){lt=document.querySelectorAll(`[${c}]`),Pe=lt.length>0,_(`Tagged elements found: %c${Pe}`,n)}let St=0;function Ot(){const e=document.querySelectorAll(`*[${d}]`);return Ae=e.length>0,Ae&&e.length!==St&&(function(e){const n=1===e.length?"":"s";ie(`%c[${d}]%c found on %c${e.length}%c element${n}`,i,t,i,t)}(e),St=e.length),Ae}function Mt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),Y(`Set body ${e}: %c${t}`,n))}function kt(e,t,o){if(""!==o){_(`${e}: %c${o}`,n);for(const e of document.querySelectorAll(o))_(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Et(){kt("sizeSelector",c,st),kt("ignoreSelector",d,De)}function Tt(e){({add(t){function n(){tn(e.eventName,e.eventType)}A[t]=n,E(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),_(`${F(e.method)} event listener: %c${e.eventType}`,n)}function It(e,t,o,r){return t!==e&&(e in o||(ie(`${e} is not a valid option for ${r}CalculationMethod.`),e=t),e in T)&&ae(`<rb>Deprecated ${r}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${ye?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),_(`Set ${r} calculation method: %c${e}`,n),e}function jt(){Fe=It(Fe,P,_t,"height")}function At(){pt=It(pt,Z,Qt,"width")}const xt=Ce("Overflow"),Pt=Ce("Overflow",!1),Nt=Ce("Resize"),Ct=Ce("Resize",!1);function Rt(){const e=document.querySelectorAll(`[${u}]`);ot=Array.from(e).filter(e=>!e.closest(`[${d}]`)),xe=ot.length>0}function Lt(e){Rt(),(xe||e)&&(ot.length>1?Y("Overflowed Elements:",...ot):xe||Y("Overflow removed"),tn(z,"Overflow updated"))}function qt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;tn(b,`Element resized <${function(e){switch(!0){case!D(e):return"";case D(e.id):return`${e.nodeName}#${e.id}`;case D(e.name):return`${e.nodeName} (${e.name}`;case D(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function Bt(e){_(`Visible: %c${e}`,n),Ue=!e,tn($,"Visibility changed")}function Wt(e){!function({addedMutations:e,removedMutations:t}){ne("contentMutated"),Et(),$t(),Rt();let n=0,o=0,r=0,i=0;for(const e of t){const t=Vt(e)();o+=fe.detachObservers(t),i+=pe.detachObservers(t)}for(const t of e){const e=Vt(t)();n+=fe.attachObservers(e),r+=pe.attachObserverToNonStaticElements(e)}Pt(o),Ct(i),xt(n),Nt(r),K()}(e),tn(w,"Mutation Observed")}function Ft(e){performance.mark(Be);const t=F(e);let n=0,o=document.documentElement,r=Pe?0:document.documentElement.getBoundingClientRect().bottom;const i=Pe?lt:xe?ot:Vt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return Y(`${t} position calculated from:`,o),performance.mark(We,{detail:{hasTags:Pe,len:i.length,logging:Ge,Side:t}}),r}const Dt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Vt=e=>()=>{G(R(e),"getAllElements() requires a DOM element");const t=["* ",...[...k].map(e=>`not(${e})`)];return Ot()&&t.push(`not([${d}])`,`not([${d}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Ht={height:0,width:0},Ut={height:0,width:0},Zt=[n,o,n];function Jt(e){function t(){return Ut[r]=i,Ht[r]=l,i}const o=e===_t,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!e.enabled():return l;case Pe:Y("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!xe&&0===Ut[r]&&0===Ht[r]:Y(`Initial page size values: ${c}`,...Zt),u=t();break;case mt&&i===Ut[r]&&l===Ht[r]:Y(`Size unchanged: ${c}`,...Zt),u=Math.max(i,l);break;case 0===i:Y(`Page is hidden: ${c}`,...Zt),u=l;break;case!xe&&i!==Ut[r]&&l<=Ht[r]:Y(`New <html> size: ${c} `,...Zt),Y(`Previous <html> size: %c${Ut[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!xe&&i<Ut[r]:Y(`<html> size decreased: ${c}`,...Zt),u=t();break;case l===s||l===a:Y(`<html> size equals page size: ${c}`,...Zt),u=t();break;case i>l:Y(`Page size < <html> size: ${c}`,...Zt),u=t();break;case xe:Y("Found element overflowing <html> "),u=e.taggedElement();break;default:Y(`Using <html> size: ${c}`,...Zt),u=t()}return Y(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&Y(`Page offsetSize: %c${t}px`,n),t}(e),u}const _t={enabled:()=>Te,getOffset:()=>re,auto:()=>Jt(_t),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,l)+parseInt(t.marginBottom,l)},bodyScroll:()=>document.body.scrollHeight,offset:()=>_t.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Dt(_t)),min:()=>Math.min(...Dt(_t)),grow:()=>_t.max(),lowestElement:()=>Ft(m),taggedElement:()=>Ft(m)},Qt={enabled:()=>Ie,getOffset:()=>le,auto:()=>Jt(Qt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Dt(Qt)),min:()=>Math.min(...Dt(Qt)),rightMostElement:()=>Ft(f),scroll:()=>Math.max(Qt.bodyScroll(),Qt.documentElementScroll()),taggedElement:()=>Ft(f)},Yt=(e,t)=>!(Math.abs(e-t)<=dt);function Gt(e,t){const n=e[t]();return e.enabled()&&void 0!==ve?function(e){const t=ve(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Xt=!1;const Kt=q(()=>se(N(4)));let en=!1;const tn=te((e,t,o,r,i)=>{if(ge=performance.now(),he=!0,ne(e),!0!==Xt){if(!be&&!(e in y))return Y("Resizing disabled"),void K();if(Ue){if(!0===en)return;return _("Iframe hidden - Ignored resize request"),void(en=!0)}en=!1,Xt=!0,requestAnimationFrame(()=>{Xt=!1}),function(e,t,o,r,i){const a=o??Gt(_t,Fe),s=r??Gt(Qt,pt),l=Te&&Yt(Le,a)||Ie&&Yt(ft,s)?h:e;switch(_(`Resize event: %c${t}`,n),l){case M:case p:case h:Le=a,ft=s;case v:on(Le,ft,e,i);break;case z:case w:case b:case $:_(O);break;default:Y(O)}he=!1}(e,t,o,r,i)}});function nn(e){Le=_t[Fe](),ft=Qt[pt](),on(Le,ft,e)}const on=te(function(e,t,o,i,a){tt<-1||(ne(o),void 0!==a?_(`Message targetOrigin: %c${a}`,n):a=ut,function(){const s=`${rt}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(at)try{window.parent.iframeParentListener(B+s)}catch(e){if(1!==tt)throw e;return void Kt()}else ct.postMessage(B+s,a);he&&_(function(){const e=W(performance.now()-ge);return o===M?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),n),Y(`Sending message to parent page via ${at?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}(),K())}),rn=te(function(e){ne("onMessage");const{freeze:t}=Object,{parse:o}=JSON,r=e=>t(o(e)),i=e=>on(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void _("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");ct=e.source,me=e.origin,zt(t),je=!1,setTimeout(()=>{Ve=!1},128)},reset(){Ve?_("Page reset ignored by init"):(_("Page size reset by host page"),nn("resetPage"))},resize(){_("Resize requested by host page"),tn("parentResize","Parent window requested size check")},moveToAnchor(){He.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();_("PageInfo received from parent:",r(e)),vt?L(vt,o(e)):i("pageInfo")},parentInfo(){const e=r(l());_("ParentInfo received from parent:",e),bt?L(bt,e):i("parentInfo")},message(){const e=l();_("onMessage called from parent:%c",n,r(e)),L(gt,o(e))}},s=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=s();ne(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||ie(`Unexpected message (${e.data})`)}B===`${e.data}`.slice(0,13)&&function(){if(!1!==je)return c()?(oe(s()),ne(M),void a.init()):void _(`Ignored message of type "${s()}". Received before initialization.`);u()}()});function an(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?ie("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>rn({data:e,sameOrigin:!0})),E(window,"message",rn),E(window,"readystatechange",an),an())}();
|
|
21
21
|
//# sourceMappingURL=index.esm.js.map
|