@iframe-resizer/child 5.4.6-beta.4 → 5.4.6

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