iframe-resizer 5.4.0-beta.8 → 5.4.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.4.0-beta.8 (cjs) - 2025-03-25
4
+ * @module iframe-resizer/legacy 5.4.0-beta.9 (cjs) - 2025-03-26
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.4.0-beta.8 (esm) - 2025-03-25
4
+ * @module iframe-resizer/legacy 5.4.0-beta.9 (esm) - 2025-03-26
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.4.0-beta.8 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.4.0-beta.9 (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,5 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const u=()=>null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches,m=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.0-beta.8",h=10,g="data-iframe-size",y="data-iframe-overflowed",v="data-iframe-ignore",b="bottom",z="right",w="resizeParent",$="setOffsetSize",S=(e,t,n,o)=>e.addEventListener(t,n,o||!1),E=["<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 M=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(E[e]),O=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},j=e=>e,k=e=>Math.round(1e3*e)/1e3,P=e=>e.charAt(0).toUpperCase()+e.slice(1),A=e=>""!=`${e}`&&void 0!==e;function C(e){switch(!0){case!A(e):return"";case A(e.id):return`${e.nodeName}#${e.id}`;case A(e.name):return`${e.nodeName} (${e.name}`;case A(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}let T=!0;const I=(N=function(n={}){const l={},s=[],u={...r,...n};let m;function f(){s.length=0}function p(){delete u.event,f()}const h=()=>!s.some((([e])=>"error"===e||"warn"===e))&&!!u.collapsed;function g(){if(0!==s.length){console[h()?"groupCollapsed":"group"](`%c${u.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(u)} %c${u.showTime?m:""}`,e,t,o);for(const[e,...t]of s)console[e](...t);console.groupEnd(),p()}else p()}function y(){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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function v(e,...t){0===s.length&&y(),s.push([e,...t])}function b(e=i,...t){v("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(u,c(u)),...d(console,(e=>[e,(...t)=>v(e,...t)])),...d(a,(e=>[e,console[e]])),endAutoGroup:g,purge:f,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){b(e),delete l[e]},timeLog:b}},N?.__esModule?N.default:N);var N;const R=I({label:"iframeResizer(child)"});const x=e=>(...t)=>!T||R[e](...t),q=x("log"),L=x("info"),{event:F,assert:B,debug:D,endAutoGroup:W,error:V,purge:H,warn:U}=R,Z=(...e)=>{return R.warn((t=j,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(...e));var t},J=Z,_=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,...t)=>Z(...t))),Q=_("Method"),G=_("Method","replaced with"),X=_("Option"),Y=requestAnimationFrame,K="--ifr-start",ee="--ifr-end",te=[],ne=new WeakSet,oe=e=>"object"==typeof e&&ne.add(e);let ie={},re=0;const ae=setInterval((()=>{if(te.length<10)return;if(ie.hasTags&&ie.len<25)return;te.sort();const e=Math.min(te.reduce(((e,t)=>e+t),0)/te.length,te[Math.floor(te.length/2)]),t=k(e);t>re&&(re=t,F("performanceObserver"),q("Mean time:",k(te[Math.floor(te.length/2)])),q("Median time:",k(te.reduce(((e,t)=>e+t),0)/te.length)),q("Average time:",t),q("Max time:",k(Math.max(...te)))),e<=4||(clearInterval(ae),Z(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${k(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ie.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function le(e){e.getEntries().forEach((e=>{if(e.name===ee){const{duration:t}=performance.measure("--ifr-measure",K,ee);ie=e.detail,te.push(t),te.length>100&&te.shift()}}))}function se(){new PerformanceObserver(le).observe({entryTypes:["mark"]}),oe(document.documentElement),oe(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",se):se()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(U("Custom height calculation function not defined"),at.auto()),width:()=>(U("Custom width calculation function not defined"),lt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let E,A,I,N,x,B=!0,V="",H=0,_="",te="",ne=!0,oe=!1,ie=!0,re=!1,ae=!1,le=!1,se=1,ce=s,de="",ue=!0,me="",fe={},pe=!1,he=0,ge=!1,ye="",ve=j,be=[],ze="child",we=null,$e=!1,Se="",Ee=[],Me=window.parent,Oe="*",je=0,ke=!1,Pe="",Ae=1,Ce=u,Te=window,Ie=()=>{U("onMessage function not defined")},Ne=()=>{},Re=null,xe=null;function qe(){var e,t,n,o;!function(){const e=e=>"true"===e,t=me.slice(13).split(":");ye=t[0],H=void 0===t[1]?H:Number(t[1]),oe=void 0===t[2]?oe:e(t[2]),pe=void 0===t[3]?pe:e(t[3]),B=void 0===t[6]?B:e(t[6]),_=t[7],ce=void 0===t[8]?ce:t[8],V=t[9],te=t[10],je=void 0===t[11]?je:Number(t[11]),fe.enable=void 0!==t[12]&&e(t[12]),ze=void 0===t[13]?ze:t[13],Ce=void 0===t[14]?Ce:t[14],ge=void 0===t[15]?ge:e(t[15]),E=void 0===t[16]?E:Number(t[16]),A=void 0===t[17]?A:Number(t[17]),ne=void 0===t[18]?ne:e(t[18]),t[19],Pe=t[20]||Pe,he=void 0===t[21]?he:Number(t[21])}(),e={id:ye,enabled:pe},R.label(`${e.id}`),T=e.enabled,q(`Initialising iframe v${p} ${window.location.href}`),function(){function e(e){q("Reading data from page:",e),Ie=e?.onMessage||Ie,Ne=e?.onReady||Ne,"number"==typeof e?.offset&&(X("offset","offsetSize"),ne&&(E=e?.offset),oe&&(A=e?.offset)),"number"==typeof e?.offsetSize&&(ne&&(E=e?.offsetSize),oe&&(A=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Se=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(de=e.ignoreSelector),Oe=e?.targetOrigin||Oe,ce=e?.heightCalculationMethod||ce,Ce=e?.widthCalculationMethod||Ce}function t(e,t){return"function"==typeof e&&(q(`Setup custom ${t}CalcMethod`),i[t]=e,e="custom"),e}if(1===he)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ce=t(ce,"height"),Ce=t(Ce,"width"),L(`Set TargetOrigin for parent: %c${Oe}`,m))}(),Ue(),function(){try{$e=1===he||"iframeParentListener"in window.parent}catch(e){q("Cross domain iframe detected")}}(),he<0?J(`${M(he+2)}${M(2)}`):Pe.codePointAt(0)>4||he<2&&J(M(3)),Pe&&""!==Pe&&"false"!==Pe?Pe!==p&&Z(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Pe} - Child page: ${p}.\n`):Z("<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"),_e(),Qe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Z("<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&&Z("<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"),Fe(),1!==he&&(Te.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===B?(B=!0,ut("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===B&&(B=!1),pt(0,0,"autoResize",JSON.stringify(B)),B),close(){pt(0,0,"close")},getId:()=>ye,getOrigin:()=>(Q("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return Re=e,pt(0,0,"pageInfo"),void G("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Re=null,pt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return xe=e,pt(0,0,"parentInfo"),()=>{xe=null,pt(0,0,"parentInfoStop")}},getParentProperties(e){Q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){fe.findTarget(e)},reset(){ft("parentIframe.reset")},setOffsetSize(e){E=e,A=e,ut($,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){pt(t,e,"scrollBy")},scrollTo(e,t){pt(t,e,"scrollTo")},scrollToOffset(e,t){pt(t,e,"scrollToOffset")},sendMessage(e,t){pt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ce=e,_e()},setWidthCalculationMethod(e){Ce=e,Qe()},setTargetOrigin(e){q(`Set targetOrigin: %c${e}`,m),Oe=e},resize(e,t){ut(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Q("size()","resize()"),this.resize(e,t)}}),Te.parentIFrame=Te.parentIframe),function(){function e(e){pt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){q(`Add event listener: %c${n}`,m),S(window.document,t,e)}!0===ge&&(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,h)+parseInt(o.x,h),y:parseInt(n.top,h)+parseInt(o.y,h)}}function n(e){function n(e){const n=t(e);q(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,m,f,m,f,m),pt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(q(`In page link (#${o}) not found in iFrame, so sending to parent`),pt(0,0,"inPageLink",`#${o}`)):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&S(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){S(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){q("Setting up location.hash handlers"),i(),r(),a()}return fe.enable?1===he?Z("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l():q("In page linking not enabled"),{findTarget:n}}(),void 0===_&&(_=`${H}px`),Ve("margin",(n="margin",(o=_).includes("-")&&(U(`Negative CSS value ignored for ${n}`),o=""),o)),Ve("background",V),Ve("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),q("Set HTML & body height: %cauto !important",m)}(),!0!==B&&q("Auto Resize disabled"),Ze({method:t="add",eventType:"After Print",eventName:"afterprint"}),Ze({method:t,eventType:"Before Print",eventName:"beforeprint"}),Ze({method:t,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{q("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)}},r=16,a=2,l=200;let s=1;function c(){F("mutationObserver");const d=performance.now(),u=d-n,f=r*s+++a;if(u>f&&u<l)return q(`MutationObserver delay: %c${u}ms > ${f}ms`,m),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ue(),Fe(),Be(e),e.forEach(Ye),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return q("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),q("Setup ResizeObserver"),we=new ResizeObserver(Ge),we.observe(document.body),Xe.add(document.body),Ye(document.body),ne!==oe&&(q("Setup OverflowObserver"),ve=(e=>{const t=e.side||b,n=e.onChange||j,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=()=>n(document.querySelectorAll(`[${y}]`)),a=(e,t)=>e.toggleAttribute(y,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;Y(r)}),i),s=new WeakSet;return function(e){q("Attached overflowObservers");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:Le,root:document.documentElement,side:ne?b:z})),Be(tt(document)()),queueMicrotask(Ne),q("Initialization complete"),ut("init","Init message from host page",void 0,void 0,p),document.title&&""!==document.title&&pt(0,0,"title",document.title)}function Le(e){be=e,ae=be.length>0,ae&&(q("Observed Elements:",e.length),ut("overflowObserver","Overflow updated"))}function Fe(){Ee=document.querySelectorAll(`[${g}]`),le=Ee.length>0,q(`Tagged elements found: %c${le}`,le?m:f)}function Be(e){le||ve(e)}let De=0;function We(){const n=document.querySelectorAll(`*[${v}]`);re=n.length>0,re&&n.length!==De&&(function(n){const o=1===n.length?"":"s";U(`%c[${v}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),De=n.length)}function Ve(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),L(`Set body ${e}: %c${t}`,m))}function He(e,t,n){if(""!==n){q(`${e}: %c${n}`,m);for(const e of document.querySelectorAll(n))q(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ue(){He("sizeSelector",g,Se),He("ignoreSelector",v,de)}function Ze(e){({add(t){function n(){ut(e.eventName,e.eventType)}a[t]=n,S(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),q(`${P(e.method)} event listener: %c${e.eventType}`,m)}function Je(e,t,n,o){return t!==e&&(e in n||(U(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&Z(`<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.`),q(`Set ${o} calculation method: %c${e}`,m)),e}function _e(){ce=Je(ce,s,at,"height")}function Qe(){Ce=Je(Ce,u,lt,"width")}function Ge(e){Array.isArray(e)&&0!==e.length&&ut("resizeObserver",`Element resized <${C(e[0].target)}>`)}const Xe=new WeakSet;function Ye(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Xe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(we.observe(e),Xe.add(e),q(`Attached resizeObserver: %c${C(e)}`,m))}const t=tt(e)();for(const e of t){if(Xe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(we.observe(e),Xe.add(e),q(`Attached resizeObserver: %c${C(e)}`,m))}}function Ke(e){performance.mark(K);const t=P(e);let n=0,i=document.documentElement,r=le?0:document.documentElement.getBoundingClientRect().bottom;const a=le?Ee:ae?be:tt(document)();let s=a.length;for(const t of a)le||!l||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):s-=1;return L(`${t} position calculated from:`,i),performance.mark(ee,{detail:{Side:t,len:s,hasTags:le,logging:pe}}),r}const et=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],tt=e=>()=>{We();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 re&&t.push(`not([${v}])`,`not([${v}] *)`),e.querySelectorAll(t.join(":"))},nt={height:0,width:0},ot={height:0,width:0},it=[m,f,m];function rt(e){function t(){return ot[o]=i,nt[o]=l,i}const n=e===at,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case le:L("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ae&&0===ot[o]&&0===nt[o]:L(`Initial page size values: ${s}`,...it),c=t();break;case ke&&i===ot[o]&&l===nt[o]:L(`Size unchanged: ${s}`,...it),c=Math.max(i,l);break;case 0===i:L(`Page is hidden: ${s}`,...it),c=l;break;case!ae&&i!==ot[o]&&l<=nt[o]:L(`New <html> size: ${s} `,...it),L(`Previous <html> size: %c${ot[o]}px`,m),c=t();break;case!n:c=e.taggedElement();break;case!ae&&i<ot[o]:L(`<html> size decreased: ${s}`,...it),c=t();break;case l===a||l===r:L(`<html> size equals page size: ${s}`,...it),c=t();break;case i>l:L(`Page size < <html> size: ${s}`,...it),c=t();break;case ae:L("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return L(`Content ${o}: %c${c}px`,m),c+=function(e){const t=e.getOffset();return 0!==t&&L(`Page offsetSize: %c${t}px`,m),t}(e),c}const at={enabled:()=>ne,getOffset:()=>E,auto:()=>rt(at),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,h)+parseInt(t.marginBottom,h)},bodyScroll:()=>document.body.scrollHeight,offset:()=>at.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...et(at)),min:()=>Math.min(...et(at)),grow:()=>at.max(),lowestElement:()=>Ke(b),taggedElement:()=>Ke(b)},lt={enabled:()=>oe,getOffset:()=>A,auto:()=>rt(lt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...et(lt)),min:()=>Math.min(...et(lt)),rightMostElement:()=>Ke(z),scroll:()=>Math.max(lt.bodyScroll(),lt.documentElementScroll()),taggedElement:()=>Ke(z)},st=(e,t)=>!(Math.abs(e-t)<=je);let ct=!1;const dt=O((()=>J(M(4))));function ut(e,t,n,o,i){x=performance.now(),F(e),B||e===w?document.hidden?q("Page hidden - Ignored resize request"):(ct||(q(`Resize event: %c${t}`,m),N=!0,function(e,t,n,o,i){const r=void 0===n?at[ce]():n,a=void 0===o?lt[Ce]():o;ne&&st(se,r)||oe&&st(Ae,a)||"init"===e?(se=r,Ae=a,pt(se,Ae,e,i)):!e!==w&&(ne&&ce in d||oe&&Ce in d)?ft(t):e===$?pt(se,Ae,e):(q("No change in content size detected"),N=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{ct=!1}))),ct=!0):L("Resizing disabled")}function mt(e){se=at[ce](),Ae=lt[Ce](),pt(se,Ae,e)}function ft(e){const t=ce;ce=s,q(`Reset trigger event: %c${e}`,m),ke?q("TriggerLock blocked calculation"):(ke=!0,D("Trigger event lock on"),requestAnimationFrame((()=>{ke=!1,D("Trigger event lock off")}))),mt("reset"),ce=t}function pt(e,t,o,i,r){he<-1||(F(o),void 0!==r?q(`Message targetOrigin: %c${r}`,m):r=Oe,function(){const a=`${ye}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if($e)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==he)throw e;return void dt()}else Me.postMessage(c+a,r);N&&L(function(){const e=k(performance.now()-x);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),m),N=!1,L("Sending message to host page via "+($e?"sameDomain":"postMessage")),L(`%c${a}`,n)}(),W())}function ht(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>pt(0,0,`${e}Stop`),i={init:function(){me=e.data,Me=e.source,I=e.origin,qe(),ie=!1,setTimeout((()=>{ue=!1}),128)},reset(){ue?q("Page reset ignored by init"):(q("Page size reset by host page"),mt("resetPage"))},resize(){ut(w,"Parent window requested size check")},moveToAnchor(){fe.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();q(`PageInfo received from parent: ${e}`),Re?setTimeout((()=>Re(n(e)))):o("pageInfo")},parentInfo(){const e=a();q(`ParentInfo received from parent: ${e}`),xe?setTimeout((()=>xe(t(n(e))))):o("parentInfo")},message(){const e=a();q(`onMessage called from parent: ${e}`),setTimeout((()=>Ie(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||U(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(F(r()),!1!==ie?l()?i.init():q(`Ignored message of type "${r()}". Received before initialization.`):s())}function gt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?U("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>ht({data:e}))),S(window,"message",ht),S(window,"readystatechange",gt),gt())}()}();
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const u=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),m=u()?"color: #A9C7FB;":"color: #135CD2;",f=u()?"color: #E3E3E3;":"color: #1F1F1F;",p="5.4.0-beta.9",h=10,g="data-iframe-size",y="data-iframe-overflowed",v="data-iframe-ignore",b="bottom",z="right",w="resizeParent",$="setOffsetSize",S=(e,t,n,o)=>e.addEventListener(t,n,o||!1),E=["<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 M=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(E[e]),O=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},j=e=>e,k=e=>Math.round(1e3*e)/1e3,P=e=>e.charAt(0).toUpperCase()+e.slice(1),A=e=>""!=`${e}`&&void 0!==e;function C(e){switch(!0){case!A(e):return"";case A(e.id):return`${e.nodeName}#${e.id}`;case A(e.name):return`${e.nodeName} (${e.name}`;case A(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}let T=!0;const I=(N=function(n={}){const l={},s=[],u={...r,...n};let m;function f(){s.length=0}function p(){delete u.event,f()}const h=()=>!s.some((([e])=>"error"===e||"warn"===e))&&!!u.collapsed;function g(){if(0!==s.length){console[h()?"groupCollapsed":"group"](`%c${u.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(u)} %c${u.showTime?m:""}`,e,t,o);for(const[e,...t]of s)console[e](...t);console.groupEnd(),p()}else p()}function y(){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)}`}(),queueMicrotask((()=>queueMicrotask(g)))}function v(e,...t){0===s.length&&y(),s.push([e,...t])}function b(e=i,...t){v("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(u,c(u)),...d(console,(e=>[e,(...t)=>v(e,...t)])),...d(a,(e=>[e,console[e]])),endAutoGroup:g,purge:f,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){b(e),delete l[e]},timeLog:b}},N?.__esModule?N.default:N);var N;const R=I({label:"iframeResizer(child)"});const x=e=>(...t)=>!T||R[e](...t),q=x("log"),L=x("info"),{event:F,assert:B,debug:D,endAutoGroup:W,error:V,purge:H,warn:U}=R,Z=(...e)=>{return R.warn((t=j,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):t(e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(...e));var t},J=Z,_=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,...t)=>Z(...t))),Q=_("Method"),G=_("Method","replaced with"),X=_("Option"),Y=requestAnimationFrame,K="--ifr-start",ee="--ifr-end",te=[],ne=new WeakSet,oe=e=>"object"==typeof e&&ne.add(e);let ie={},re=0;const ae=setInterval((()=>{if(te.length<10)return;if(ie.hasTags&&ie.len<25)return;te.sort();const e=Math.min(te.reduce(((e,t)=>e+t),0)/te.length,te[Math.floor(te.length/2)]),t=k(e);t>re&&(re=t,F("performanceObserver"),q("Mean time:",k(te[Math.floor(te.length/2)])),q("Median time:",k(te.reduce(((e,t)=>e+t),0)/te.length)),q("Average time:",t),q("Max time:",k(Math.max(...te)))),e<=4||(clearInterval(ae),Z(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${k(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ie.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function le(e){e.getEntries().forEach((e=>{if(e.name===ee){const{duration:t}=performance.measure("--ifr-measure",K,ee);ie=e.detail,te.push(t),te.length>100&&te.shift()}}))}function se(){new PerformanceObserver(le).observe({entryTypes:["mark"]}),oe(document.documentElement),oe(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",se):se()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(U("Custom height calculation function not defined"),at.auto()),width:()=>(U("Custom width calculation function not defined"),lt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",d={max:1,min:1,bodyScroll:1,documentElementScroll:1},u="scroll";let E,A,I,N,x,B=!0,V="",H=0,_="",te="",ne=!0,oe=!1,ie=!0,re=!1,ae=!1,le=!1,se=1,ce=s,de="",ue=!0,me="",fe={},pe=!1,he=0,ge=!1,ye="",ve=j,be=[],ze="child",we=null,$e=!1,Se="",Ee=[],Me=window.parent,Oe="*",je=0,ke=!1,Pe="",Ae=1,Ce=u,Te=window,Ie=()=>{U("onMessage function not defined")},Ne=()=>{},Re=null,xe=null;function qe(){var e,t,n,o;!function(){const e=e=>"true"===e,t=me.slice(13).split(":");ye=t[0],H=void 0===t[1]?H:Number(t[1]),oe=void 0===t[2]?oe:e(t[2]),pe=void 0===t[3]?pe:e(t[3]),B=void 0===t[6]?B:e(t[6]),_=t[7],ce=void 0===t[8]?ce:t[8],V=t[9],te=t[10],je=void 0===t[11]?je:Number(t[11]),fe.enable=void 0!==t[12]&&e(t[12]),ze=void 0===t[13]?ze:t[13],Ce=void 0===t[14]?Ce:t[14],ge=void 0===t[15]?ge:e(t[15]),E=void 0===t[16]?E:Number(t[16]),A=void 0===t[17]?A:Number(t[17]),ne=void 0===t[18]?ne:e(t[18]),t[19],Pe=t[20]||Pe,he=void 0===t[21]?he:Number(t[21])}(),e={id:ye,enabled:pe},R.label(`${e.id}`),T=e.enabled,q(`Initialising iframe v${p} ${window.location.href}`),function(){function e(e){q("Reading data from page:",e),Ie=e?.onMessage||Ie,Ne=e?.onReady||Ne,"number"==typeof e?.offset&&(X("offset","offsetSize"),ne&&(E=e?.offset),oe&&(A=e?.offset)),"number"==typeof e?.offsetSize&&(ne&&(E=e?.offsetSize),oe&&(A=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Se=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(de=e.ignoreSelector),Oe=e?.targetOrigin||Oe,ce=e?.heightCalculationMethod||ce,Ce=e?.widthCalculationMethod||Ce}function t(e,t){return"function"==typeof e&&(q(`Setup custom ${t}CalcMethod`),i[t]=e,e="custom"),e}if(1===he)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),ce=t(ce,"height"),Ce=t(Ce,"width"),L(`Set TargetOrigin for parent: %c${Oe}`,m))}(),Ue(),function(){try{$e=1===he||"iframeParentListener"in window.parent}catch(e){q("Cross domain iframe detected")}}(),he<0?J(`${M(he+2)}${M(2)}`):Pe.codePointAt(0)>4||he<2&&J(M(3)),Pe&&""!==Pe&&"false"!==Pe?Pe!==p&&Z(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Pe} - Child page: ${p}.\n`):Z("<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"),_e(),Qe(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Z("<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&&Z("<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"),Fe(),1!==he&&(Te.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===B?(B=!0,ut("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===B&&(B=!1),pt(0,0,"autoResize",JSON.stringify(B)),B),close(){pt(0,0,"close")},getId:()=>ye,getOrigin:()=>(Q("getOrigin()","getParentOrigin()"),I),getParentOrigin:()=>I,getPageInfo(e){if("function"==typeof e)return Re=e,pt(0,0,"pageInfo"),void G("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Re=null,pt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return xe=e,pt(0,0,"parentInfo"),()=>{xe=null,pt(0,0,"parentInfoStop")}},getParentProperties(e){Q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){fe.findTarget(e)},reset(){ft("parentIframe.reset")},setOffsetSize(e){E=e,A=e,ut($,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){pt(t,e,"scrollBy")},scrollTo(e,t){pt(t,e,"scrollTo")},scrollToOffset(e,t){pt(t,e,"scrollToOffset")},sendMessage(e,t){pt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){ce=e,_e()},setWidthCalculationMethod(e){Ce=e,Qe()},setTargetOrigin(e){q(`Set targetOrigin: %c${e}`,m),Oe=e},resize(e,t){ut(w,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Q("size()","resize()"),this.resize(e,t)}}),Te.parentIFrame=Te.parentIframe),function(){function e(e){pt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){q(`Add event listener: %c${n}`,m),S(window.document,t,e)}!0===ge&&(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,h)+parseInt(o.x,h),y:parseInt(n.top,h)+parseInt(o.y,h)}}function n(e){function n(e){const n=t(e);q(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,m,f,m,f,m),pt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?(q(`In page link (#${o}) not found in iFrame, so sending to parent`),pt(0,0,"inPageLink",`#${o}`)):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&S(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){S(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){q("Setting up location.hash handlers"),i(),r(),a()}return fe.enable?1===he?Z("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l():q("In page linking not enabled"),{findTarget:n}}(),void 0===_&&(_=`${H}px`),Ve("margin",(n="margin",(o=_).includes("-")&&(U(`Negative CSS value ignored for ${n}`),o=""),o)),Ve("background",V),Ve("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),q("Set HTML & body height: %cauto !important",m)}(),!0!==B&&q("Auto Resize disabled"),Ze({method:t="add",eventType:"After Print",eventName:"afterprint"}),Ze({method:t,eventType:"Before Print",eventName:"beforeprint"}),Ze({method:t,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{q("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)}},r=16,a=2,l=200;let s=1;function c(){F("mutationObserver");const d=performance.now(),u=d-n,f=r*s+++a;if(u>f&&u<l)return q(`MutationObserver delay: %c${u}ms > ${f}ms`,m),setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ue(),Fe(),Be(e),e.forEach(Ye),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return q("Setup <body> MutationObserver"),e.observe(t,n),e}u()}(),q("Setup ResizeObserver"),we=new ResizeObserver(Ge),we.observe(document.body),Xe.add(document.body),Ye(document.body),ne!==oe&&(q("Setup OverflowObserver"),ve=(e=>{const t=e.side||b,n=e.onChange||j,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=()=>n(document.querySelectorAll(`[${y}]`)),a=(e,t)=>e.toggleAttribute(y,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;Y(r)}),i),s=new WeakSet;return function(e){q("Attached overflowObservers");for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:Le,root:document.documentElement,side:ne?b:z})),Be(tt(document)()),queueMicrotask(Ne),q("Initialization complete"),ut("init","Init message from host page",void 0,void 0,p),document.title&&""!==document.title&&pt(0,0,"title",document.title)}function Le(e){be=e,ae=be.length>0,ae&&(q("Observed Elements:",e.length),ut("overflowObserver","Overflow updated"))}function Fe(){Ee=document.querySelectorAll(`[${g}]`),le=Ee.length>0,q(`Tagged elements found: %c${le}`,le?m:f)}function Be(e){le||ve(e)}let De=0;function We(){const n=document.querySelectorAll(`*[${v}]`);re=n.length>0,re&&n.length!==De&&(function(n){const o=1===n.length?"":"s";U(`%c[${v}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),De=n.length)}function Ve(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),L(`Set body ${e}: %c${t}`,m))}function He(e,t,n){if(""!==n){q(`${e}: %c${n}`,m);for(const e of document.querySelectorAll(n))q(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ue(){He("sizeSelector",g,Se),He("ignoreSelector",v,de)}function Ze(e){({add(t){function n(){ut(e.eventName,e.eventType)}a[t]=n,S(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),q(`${P(e.method)} event listener: %c${e.eventType}`,m)}function Je(e,t,n,o){return t!==e&&(e in n||(U(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&Z(`<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.`),q(`Set ${o} calculation method: %c${e}`,m)),e}function _e(){ce=Je(ce,s,at,"height")}function Qe(){Ce=Je(Ce,u,lt,"width")}function Ge(e){Array.isArray(e)&&0!==e.length&&ut("resizeObserver",`Element resized <${C(e[0].target)}>`)}const Xe=new WeakSet;function Ye(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Xe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(we.observe(e),Xe.add(e),q(`Attached resizeObserver: %c${C(e)}`,m))}const t=tt(e)();for(const e of t){if(Xe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(we.observe(e),Xe.add(e),q(`Attached resizeObserver: %c${C(e)}`,m))}}function Ke(e){performance.mark(K);const t=P(e);let n=0,i=document.documentElement,r=le?0:document.documentElement.getBoundingClientRect().bottom;const a=le?Ee:ae?be:tt(document)();let s=a.length;for(const t of a)le||!l||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):s-=1;return L(`${t} position calculated from:`,i),performance.mark(ee,{detail:{Side:t,len:s,hasTags:le,logging:pe}}),r}const et=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],tt=e=>()=>{We();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 re&&t.push(`not([${v}])`,`not([${v}] *)`),e.querySelectorAll(t.join(":"))},nt={height:0,width:0},ot={height:0,width:0},it=[m,f,m];function rt(e){function t(){return ot[o]=i,nt[o]=l,i}const n=e===at,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case le:L("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ae&&0===ot[o]&&0===nt[o]:L(`Initial page size values: ${s}`,...it),c=t();break;case ke&&i===ot[o]&&l===nt[o]:L(`Size unchanged: ${s}`,...it),c=Math.max(i,l);break;case 0===i:L(`Page is hidden: ${s}`,...it),c=l;break;case!ae&&i!==ot[o]&&l<=nt[o]:L(`New <html> size: ${s} `,...it),L(`Previous <html> size: %c${ot[o]}px`,m),c=t();break;case!n:c=e.taggedElement();break;case!ae&&i<ot[o]:L(`<html> size decreased: ${s}`,...it),c=t();break;case l===a||l===r:L(`<html> size equals page size: ${s}`,...it),c=t();break;case i>l:L(`Page size < <html> size: ${s}`,...it),c=t();break;case ae:L("Found element overflowing <html> "),c=e.taggedElement();break;default:c=t()}return L(`Content ${o}: %c${c}px`,m),c+=function(e){const t=e.getOffset();return 0!==t&&L(`Page offsetSize: %c${t}px`,m),t}(e),c}const at={enabled:()=>ne,getOffset:()=>E,auto:()=>rt(at),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,h)+parseInt(t.marginBottom,h)},bodyScroll:()=>document.body.scrollHeight,offset:()=>at.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...et(at)),min:()=>Math.min(...et(at)),grow:()=>at.max(),lowestElement:()=>Ke(b),taggedElement:()=>Ke(b)},lt={enabled:()=>oe,getOffset:()=>A,auto:()=>rt(lt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...et(lt)),min:()=>Math.min(...et(lt)),rightMostElement:()=>Ke(z),scroll:()=>Math.max(lt.bodyScroll(),lt.documentElementScroll()),taggedElement:()=>Ke(z)},st=(e,t)=>!(Math.abs(e-t)<=je);let ct=!1;const dt=O((()=>J(M(4))));function ut(e,t,n,o,i){x=performance.now(),F(e),B||e===w?document.hidden?q("Page hidden - Ignored resize request"):(ct||(q(`Resize event: %c${t}`,m),N=!0,function(e,t,n,o,i){const r=void 0===n?at[ce]():n,a=void 0===o?lt[Ce]():o;ne&&st(se,r)||oe&&st(Ae,a)||"init"===e?(se=r,Ae=a,pt(se,Ae,e,i)):!e!==w&&(ne&&ce in d||oe&&Ce in d)?ft(t):e===$?pt(se,Ae,e):(q("No change in content size detected"),N=!1)}(e,t,n,o,i),requestAnimationFrame((()=>{ct=!1}))),ct=!0):L("Resizing disabled")}function mt(e){se=at[ce](),Ae=lt[Ce](),pt(se,Ae,e)}function ft(e){const t=ce;ce=s,q(`Reset trigger event: %c${e}`,m),ke?q("TriggerLock blocked calculation"):(ke=!0,D("Trigger event lock on"),requestAnimationFrame((()=>{ke=!1,D("Trigger event lock off")}))),mt("reset"),ce=t}function pt(e,t,o,i,r){he<-1||(F(o),void 0!==r?q(`Message targetOrigin: %c${r}`,m):r=Oe,function(){const a=`${ye}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if($e)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==he)throw e;return void dt()}else Me.postMessage(c+a,r);N&&L(function(){const e=k(performance.now()-x);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),m),N=!1,L("Sending message to host page via "+($e?"sameDomain":"postMessage")),L(`%c${a}`,n)}(),W())}function ht(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>pt(0,0,`${e}Stop`),i={init:function(){me=e.data,Me=e.source,I=e.origin,qe(),ie=!1,setTimeout((()=>{ue=!1}),128)},reset(){ue?q("Page reset ignored by init"):(q("Page size reset by host page"),mt("resetPage"))},resize(){ut(w,"Parent window requested size check")},moveToAnchor(){fe.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();q(`PageInfo received from parent: ${e}`),Re?setTimeout((()=>Re(n(e)))):o("pageInfo")},parentInfo(){const e=a();q(`ParentInfo received from parent: ${e}`),xe?setTimeout((()=>xe(t(n(e))))):o("parentInfo")},message(){const e=a();q(`onMessage called from parent: ${e}`),setTimeout((()=>Ie(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||U(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(F(r()),!1!==ie?l()?i.init():q(`Ignored message of type "${r()}". Received before initialization.`):s())}function gt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?U("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>ht({data:e}))),S(window,"message",ht),S(window,"readystatechange",gt),gt())}()}();
21
21
  //# sourceMappingURL=iframeResizer.contentWindow.js.map