iframe-resizer 5.5.0-beta.3 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.0-beta.3 (cjs) - 2025-07-29
4
+ * @module iframe-resizer/legacy 5.5.0 (cjs) - 2025-07-29
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy 5.5.0-beta.3 (esm) - 2025-07-29
4
+ * @module iframe-resizer/legacy 5.5.0 (esm) - 2025-07-29
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.0-beta.3 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.0 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.5.0-beta.3",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",k=Symbol("sizeChanged"),E="manualResize",j={},I="setOffsetSize",T="resizeObserver",A="overflowObserver",x="mutationObserver",P="visibilityObserver",C="none",R="No change in content size detected",N="init",q=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},L=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),F=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],D=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>L(W[e]);var U=e=>{const t=e[L(F[0])]||e[L(F[1])]||e[L(F[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(L(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o};const Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},Q=e=>e,_=e=>Math.round(1e3*e)/1e3,G=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const X=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${G(t)}`)};let K=!0,ee=v;const te=(ne=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){l[b()?"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(),v()}else v()}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){!0!==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),z()}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}},ne?.__esModule?ne.default:ne);var ne;const oe=te({label:`${v}(child)`});const re=(ie="log",(...e)=>!K||oe[ie](...e));var ie;const ae=re;const{assert:se,debug:le,endAutoGroup:ce,error:ue,errorBoundary:de,event:fe,label:me,purge:pe,warn:he}=oe,ge=e=>{return oe.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},ye=ge,ve=(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)=>ge(t)),be=ve("Method"),ze=ve("Method","replaced with"),we=ve("Option"),$e=["min-height","min-width","max-height","max-width"],Se=new Set,Oe=e=>e.tagName?e.tagName.toLowerCase():"unknown",Me=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Me(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ee({href:e}){Se.has(e)||(re("Unable to access stylesheet:",e),Se.add(e))}const je=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ee(n)}return{source:"cross-origin stylesheet",value:Me(e,t)}}(e,t),Ie=(e,t)=>{const{source:n,value:o}=je(e,t),r=Oe(e);ge(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Te(){for(const e of[document.documentElement,document.body])for(const t of $e)re(`Checking <${Oe(e)}> for blocking CSS: ${t}`),ke(e,t)&&Ie(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),xe=Ae(e=>"true"===e),Pe=Ae(Number),Ce=new Set,Re=new Set,Ne=[];let qe,Be=1,Le=!1,Fe=0;const We=e=>{re("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)Ce.add(t);for(const e of n)Ce.has(e)?Ce.delete(e):Re.add(e)}};function De(e){Ne.push(e),Le||(Fe=performance.now(),Le=!0,requestAnimationFrame(qe))}function He(e){const t=new window.MutationObserver(De),n=document.querySelector("body"),o={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return qe=(e=>()=>{const t=performance.now(),n=t-Fe,o=16*Be+++2;if(n>o&&n<200)return ae("Backed off due to heavy workload on callStack"),re(`Delay: %c${_(n)}ms %c> Delay limit: %c${o}ms`,h,g,h),setTimeout(qe,16*Be),void(Fe=t);Be=1,Ne.forEach(We),Ne.length=0,e({addedMutations:Ce,removedMutations:Re}),Le=!1,Ce.clear(),Re.clear()})(e),t.observe(n,o),ae("Attached MutationObserver to body"),t}const Ve=(t,n=!0)=>o=>{o>0&&ae(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Ze=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Je=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!Ze(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(se(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Ue(0,l,c)}},Qe="--ifr-start",_e="--ifr-end",Ge=[],Ye=new WeakSet,Xe=e=>"object"==typeof e&&Ye.add(e);let Ke={},et=0;function tt(e){e.getEntries().forEach(e=>{if(e.name===_e){const{duration:t}=performance.measure("--ifr-measure",Qe,_e);Ke=e.detail,Ge.push(t),Ge.length>100&&Ge.shift()}})}function nt(){ae("Attached PerformanceObserver to page");new PerformanceObserver(tt).observe({entryTypes:["mark"]}),Xe(document.documentElement),Xe(document.body),function(){const e=setInterval(()=>{if(Ge.length<10)return;if(Ke.hasTags&&Ke.len<25)return;Ge.sort();const t=Math.min(Ge.reduce((e,t)=>e+t,0)/Ge.length,Ge[Math.floor(Ge.length/2)]),n=_(t);n>et&&(et=n,fe("performanceObserver"),re("Mean time:",_(Ge[Math.floor(Ge.length/2)])),re("Median time:",_(Ge.reduce((e,t)=>e+t,0)/Ge.length)),re("Average time:",n),re("Max time:",_(Math.max(...Ge)))),t<=4||(clearInterval(e),ge(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ke.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const ot=Ve("Resize"),rt=new WeakSet;let it;function at(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=rt.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(se(!o,"Node already observed for resize",n),o||(it.observe(n),rt.add(n),t+=1))}ot(t)}const st=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},lt=st("function"),ct=st("number"),ut=st("string");"undefined"!=typeof window&&function(){const o={height:()=>(he("Custom height calculation function not defined"),Vt.auto()),width:()=>(he("Custom width calculation function not defined"),Ut.auto())},r={},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,B,W,H,Q,te,ne=!0,ie="",se=0,ue="",pe="",ve=!1,$e=!0,Se=!1,Oe=!0,Me=!1,ke=!1,Ee=!1,je=1,Ie=a,Ae="",Ce=!0,Re={},Ne=!1,qe=!0,Be=!1,Le=0,Fe=!1,We=[],De="",Ze="child",Ge=!1,Ye="",Xe=[],Ke=window.parent,et="*",tt=0,ot=!1,st=1,dt=l,ft=window,mt=()=>{he("onMessage function not defined")},pt=()=>{},ht=null,gt=null;function yt(t){var n,r,i;!function(e){De=e[0]??De,se=Pe(e[1])??se,Se=xe(e[2])??Se,Be=xe(e[3])??Be,ne=xe(e[6])??ne,ue=e[7]??ue,Ie=e[8]??Ie,ie=e[9]??ie,pe=e[10]??pe,tt=Pe(e[11])??tt,Re.enable=xe(e[12])??!1,Ze=e[13]??Ze,dt=e[14]??dt,Fe=xe(e[15])??Fe,d=Pe(e[16])??d,f=Pe(e[17])??f,$e=xe(e[18])??$e,c=e[19]??c,Q=e[20]??Q,Le=Pe(e[21])??Le,qe=xe(e[23])??qe}(t),ee=(n={id:De,enabled:Be,expand:qe}).id||v,oe.label(`${ee}`),oe.expand(n.expand),K=n.enabled,re(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){re("Reading data from page:",Object.keys(e)),te=lt(e,"onBeforeResize")??te,mt=lt(e,"onMessage")??mt,pt=lt(e,"onReady")??pt,"number"==typeof e?.offset&&(we("offset","offsetSize"),$e&&(d=ct(e,"offset")??d),Se&&(f=ct(e,"offset")??f)),"number"==typeof e?.offsetSize&&($e&&(d=ct(e,"offsetSize")??d),Se&&(f=ct(e,"offsetSize")??f)),u=ut(e,L(F[0]))??u,Ae=ut(e,"ignoreSelector")??Ae,Ye=ut(e,"sizeSelector")??Ye,et=ut(e,"targetOrigin")??et,Ie=e?.heightCalculationMethod||Ie,dt=e?.widthCalculationMethod||dt}function t(e,t){return"function"==typeof e&&(ge(`<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===Le)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ie=t(Ie,"height"),dt=t(dt,"width"),ae(`Set targetOrigin for parent: %c${et}`,h))}(),Ot(),function(){try{Ge=1===Le||"iframeParentListener"in window.parent}catch(e){re("Cross domain iframe detected")}}(),Se===$e&&(ve=!0),function(){const t=Le,n=U({key:c}),o=U({key:u});if(Le=Math.max(n,o),Le<0){if(Le=Math.min(n,o),ge(`${V(Le+2)}${V(2)}`),Y(Q))throw V(Le+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(Q)||t>-1&&Le>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ee} %ciframe-resizer ${t}`,K||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>L(D[e]))(Le)})`,Le),Le<2&&ye(V(3)),sessionStorage.setItem("ifr",y))}(),Q&&""!==Q&&"false"!==Q?Q!==y&&ge(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Q} - Child page: ${y}.\n`):ge("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),Et(),jt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ge("<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&&ge("<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"),bt(),ve||Te(),1!==Le&&(ft.parentIframe=Object.freeze({autoResize:e=>(X(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Se&&!1===$e?(fe(M),ge(`Auto Resize can not be changed when <b>direction</> is set to '${C}'.`),!1):(!0===e&&!1===ne?(ne=!0,queueMicrotask(()=>Yt(M,"Auto Resize enabled"))):!1===e&&!0===ne&&(ne=!1),Kt(0,0,"autoResize",JSON.stringify(ne)),ne)),close(){Kt(0,0,"close")},getId:()=>De,getOrigin:()=>(be("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return ht=e,Kt(0,0,"pageInfo"),void ze("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");ht=null,Kt(0,0,"pageInfoStop")},getParentProps:e=>(X(e,"function","parentIframe.getParentProps(callback) callback"),gt=e,Kt(0,0,"parentInfo"),()=>{gt=null,Kt(0,0,"parentInfoStop")}),getParentProperties(e){be("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){X(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Re.findTarget(e)},reset(){!function(){const e=Ie;Ie=a,re("Reset trigger event: %cparentIframe.reset",h),ot?re("TriggerLock blocked calculation"):(ot=!0,le("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,le("Trigger event lock off")})),Xt("reset"),Ie=e}()},setOffsetSize(e){X(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,Yt(I,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){X(e,"number","parentIframe.scrollBy(x, y) x"),X(t,"number","parentIframe.scrollBy(x, y) y"),Kt(t,e,"scrollBy")},scrollTo(e,t){X(e,"number","parentIframe.scrollTo(x, y) x"),X(t,"number","parentIframe.scrollTo(x, y) y"),Kt(t,e,"scrollTo")},scrollToOffset(e,t){X(e,"number","parentIframe.scrollToOffset(x, y) x"),X(t,"number","parentIframe.scrollToOffset(x, y) y"),Kt(t,e,"scrollToOffset")},sendMessage(e,t){t&&X(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Kt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ie=e,Et()},setWidthCalculationMethod(e){dt=e,jt()},setTargetOrigin(e){X(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),re(`Set targetOrigin: %c${e}`,h),et=e},resize(e,t){e&&X(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&X(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Yt(E,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){be("size()","resize()"),this.resize(e,t)}}),ft.parentIFrame=ft.parentIframe),function(){function e(e){Kt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){re(`Add event listener: %c${n}`,h),q(window.document,t,e)}!0===Fe&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Re=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);re(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,h,g,h,g,h),Kt(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?(re(`In page link (#${o}) not found in iFrame, so sending to parent`),Kt(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")&&q(e,"click",t=>{t.preventDefault(),n(e.getAttribute("href"))})}function i(){q(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){re("Setting up location.hash handlers"),r(),i(),a()}return Re.enable?1===Le?ge("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():re("In page linking not enabled"),{findTarget:n}}(),void 0===ue&&(ue=`${se}px`),$t("margin",(r="margin",(i=ue).includes("-")&&(he(`Negative CSS value ignored for ${r}`),i=""),i)),$t("background",ie),$t("padding",pe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ve||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),re("Set HTML & body height: %cauto !important",h)}(),!0!==ne&&re("Auto Resize disabled"),function(e){Mt({method:e,eventType:"After Print",eventName:"afterprint"}),Mt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Mt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Lt(document)();re("Attaching Observers"),He(Nt),function(e){const t={root:document.documentElement,side:$e?S:O};p=Je(It,t),p.attachObservers(e)}(e),nt(),function(e){it=new ResizeObserver(Tt),it.observe(document.body),rt.add(document.body),ae("Attached ResizeObserver to body"),B={attachObserverToNonStaticElements:at,detachObservers:Ue(0,it,rt)},B.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),ae("Attached VisibilityObserver to page")}(At)}(),vt(J(pt)),re("Initialization complete"),Yt(N,"Init message from host page",void 0,void 0,`${y}:${Le}`),document.title&&""!==document.title&&Kt(0,0,"title",document.title)}function vt(e){"complete"===document.readyState?Z(e):q(document,"readystatechange",()=>vt(e))}function bt(){Xe=document.querySelectorAll(`[${z}]`),Ee=Xe.length>0,re(`Tagged elements found: %c${Ee}`,h)}let zt=0;function wt(){const n=document.querySelectorAll(`*[${$}]`);Me=n.length>0,Me&&n.length!==zt&&(function(n){const o=1===n.length?"":"s";he(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),zt=n.length)}function $t(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ae(`Set body ${e}: %c${t}`,h))}function St(e,t,n){if(""!==n){re(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))re(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ot(){St("sizeSelector",z,Ye),St("ignoreSelector",$,Ae)}function Mt(e){({add(t){function n(){Yt(e.eventName,e.eventType)}i[t]=n,q(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),re(`${G(e.method)} event listener: %c${e.eventType}`,h)}function kt(e,t,n,o){return t!==e&&(e in n||(he(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ge(`<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 ${Q?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),re(`Set ${o} calculation method: %c${e}`,h),e}function Et(){Ie=kt(Ie,a,Vt,"height")}function jt(){dt=kt(dt,l,Ut,"width")}function It(e){!function(){const e=document.querySelectorAll(`[${w}]`);We=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=We.length>0}(),(ke||e)&&(We.length>1?ae("Overflowed Elements:",...We):ke||ae("Overflow removed"),Yt(A,"Overflow updated"))}function Tt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Yt(T,`Element resized <${function(e){switch(!0){case!Y(e):return"";case Y(e.id):return`${e.nodeName}#${e.id}`;case Y(e.name):return`${e.nodeName} (${e.name}`;case Y(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function At(e){re(`Visible: %c${e}`,h),Ne=!e,Yt(P,"Visibility changed")}const xt=Ve("Overflow"),Pt=Ve("Overflow",!1),Ct=Ve("Resize"),Rt=Ve("Resize",!1);function Nt(e){!function({addedMutations:e,removedMutations:t}){fe("contentMutated"),Ot(),bt();let n=0,o=0,r=0,i=0;for(const e of t){const t=Lt(e)();o+=p.detachObservers(t),i+=B.detachObservers(t)}for(const t of e){const e=Lt(t)();n+=p.attachObservers(e),r+=B.attachObserverToNonStaticElements(e)}Pt(o),Rt(i),xt(n),Ct(r),ce()}(e),Yt(x,"Mutation Observed")}function qt(e){performance.mark(Qe);const t=G(e);let n=0,o=document.documentElement,r=Ee?0:document.documentElement.getBoundingClientRect().bottom;const i=Ee?Xe:ke?We:Lt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ae(`${t} position calculated from:`,o),performance.mark(_e,{detail:{hasTags:Ee,len:i.length,logging:Be,Side:t}}),r}const Bt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Lt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return wt(),Me&&t.push(`not([${$}])`,`not([${$}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Ft={height:0,width:0},Wt={height:0,width:0},Dt=[h,g,h];function Ht(e){function t(){return Wt[o]=r,Ft[o]=s,r}const n=e===Vt,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 Ee:ae("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ke&&0===Wt[o]&&0===Ft[o]:ae(`Initial page size values: ${l}`,...Dt),c=t();break;case ot&&r===Wt[o]&&s===Ft[o]:ae(`Size unchanged: ${l}`,...Dt),c=Math.max(r,s);break;case 0===r:ae(`Page is hidden: ${l}`,...Dt),c=s;break;case!ke&&r!==Wt[o]&&s<=Ft[o]:ae(`New <html> size: ${l} `,...Dt),ae(`Previous <html> size: %c${Wt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!ke&&r<Wt[o]:ae(`<html> size decreased: ${l}`,...Dt),c=t();break;case s===a||s===i:ae(`<html> size equals page size: ${l}`,...Dt),c=t();break;case r>s:ae(`Page size < <html> size: ${l}`,...Dt),c=t();break;case ke:ae("Found element overflowing <html> "),c=e.taggedElement();break;default:ae(`Using <html> size: ${l}`,...Dt),c=t()}return ae(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&ae(`Page offsetSize: %c${t}px`,h),t}(e),c}const Vt={enabled:()=>$e,getOffset:()=>d,auto:()=>Ht(Vt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Vt.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(...Bt(Vt)),min:()=>Math.min(...Bt(Vt)),grow:()=>Vt.max(),lowestElement:()=>qt(S),taggedElement:()=>qt(S)},Ut={enabled:()=>Se,getOffset:()=>f,auto:()=>Ht(Ut),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(...Bt(Ut)),min:()=>Math.min(...Bt(Ut)),rightMostElement:()=>qt(O),scroll:()=>Math.max(Ut.bodyScroll(),Ut.documentElementScroll()),taggedElement:()=>qt(O)},Zt=(e,t)=>!(Math.abs(e-t)<=tt);function Jt(e,t){const n=e[t]();return e.enabled()&&void 0!==te?function(e){const t=te(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Qt=!1;const _t=J(()=>ye(V(4)));let Gt=!1;const Yt=de((e,t,n,o,r)=>{if(H=performance.now(),W=!0,fe(e),!0!==Qt){if(!ne&&!(e in j))return ae("Resizing disabled"),void ce();if(Ne){if(!0===Gt)return;return re("Iframe hidden - Ignored resize request"),void(Gt=!0)}Gt=!1,Qt=!0,requestAnimationFrame(()=>{Qt=!1}),function(e,t,n,o,r){const i=n??Jt(Vt,Ie),a=o??Jt(Ut,dt),s=$e&&Zt(je,i)||Se&&Zt(st,a)?k:e;switch(re(`Resize event: %c${t}`,h),s){case N:case M:case k:je=i,st=a;case I:Kt(je,st,e,r);break;case A:case x:case T:case P:re(R);break;default:ae(R)}W=!1}(e,t,n,o,r)}});function Xt(e){je=Vt[Ie](),st=Ut[dt](),Kt(je,st,e)}const Kt=de(function(e,t,o,r,i){Le<-1||(fe(o),void 0!==i?re(`Message targetOrigin: %c${i}`,h):i=et,function(){const a=`${De}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ge)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Le)throw e;return void _t()}else Ke.postMessage(s+a,i);W&&re(function(){const e=_(performance.now()-H);return o===N?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),ae(`Sending message to parent page via ${Ge?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ce())}),en=de(function(e){fe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Kt(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void re("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ke=e.source,m=e.origin,yt(t),Oe=!1,setTimeout(()=>{Ce=!1},128)},reset(){Ce?re("Page reset ignored by init"):(re("Page size reset by host page"),Xt("resetPage"))},resize(){re("Resize requested by host page"),Yt("parentResize","Parent window requested size check")},moveToAnchor(){Re.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();re("PageInfo received from parent:",o(e)),ht?Z(ht,n(e)):r("pageInfo")},parentInfo(){const e=o(l());re("ParentInfo received from parent:",e),gt?Z(gt,e):r("parentInfo")},message(){const e=l();re("onMessage called from parent:%c",h,o(e)),Z(mt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();fe(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||he(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==Oe)return c()?(me(a()),fe(N),void i.init()):void re(`Ignored message of type "${a()}". Received before initialization.`);u()}()});function tn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?he("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>en({data:e,sameOrigin:!0})),q(window,"message",en),q(window,"readystatechange",tn),tn())}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.js.map
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},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.5.0",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),j="manualResize",k={},T="setOffsetSize",x="resizeObserver",A="overflowObserver",I="mutationObserver",C="visibilityObserver",P="none",N="init",R=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),L=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>q(W[e]);var V=e=>{const t=e[q(L[0])]||e[q(L[1])]||e[q(L[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(q(e));return n in D&&(t=D[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o};const U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,Q=e=>Math.round(1e3*e)/1e3,_=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>""!=`${e}`&&void 0!==e;const Y=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${_(t)}`)};let X=!0,K=v;const ee=(te=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){l[b()?"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(),v()}else v()}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){!0!==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),z()}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}},te?.__esModule?te.default:te);var te;const ne=ee({label:`${v}(child)`});var oe;const re=(oe="log",(...e)=>!X||ne[oe](...e));const{assert:ie,debug:ae,endAutoGroup:se,error:le,errorBoundary:ce,event:ue,label:de,purge:fe,warn:me}=ne,pe=e=>{return ne.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},he=pe,ge=(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)=>pe(t)),ye=ge("Method"),ve=ge("Method","replaced with"),be=ge("Option"),ze=["min-height","min-width","max-height","max-width"],we=new Set,$e=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=$e(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Oe({href:e}){we.has(e)||we.add(e)}const Me=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Oe(n)}return{source:"cross-origin stylesheet",value:$e(e,t)}}(e,t),Ee=(e,t)=>{const{source:n,value:o}=Me(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);pe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function je(){for(const e of[document.documentElement,document.body])for(const t of ze)Se(e,t)&&Ee(e,t)}const ke=e=>t=>void 0===t?void 0:e(t),Te=ke(e=>"true"===e),xe=ke(Number),Ae=new Set,Ie=new Set,Ce=[];let Pe,Ne=1,Re=!1,Be=0;const qe=e=>{for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)Ae.add(t);for(const e of n)Ae.has(e)?Ae.delete(e):Ie.add(e)}};function Le(e){Ce.push(e),Re||(Be=performance.now(),Re=!0,requestAnimationFrame(Pe))}function We(e){const t=new window.MutationObserver(Le),n=document.querySelector("body"),o={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Pe=(e=>()=>{const t=performance.now(),n=t-Be,o=16*Ne+++2;if(n>o&&n<200)return ue("MutationDelay"),re("Update delayed due to heavy workload on the callStack"),re(`EventLoop busy time: %c${Q(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Pe,16*Ne),void(Be=t);Ne=1,Ce.forEach(qe),Ce.length=0,e({addedMutations:Ae,removedMutations:Ie}),Re=!1,Ae.clear(),Ie.clear()})(e),t.observe(n,o),re("Attached MutationObserver to body"),t}const Fe=(t,n=!0)=>o=>{o>0&&re(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},De=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},He=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Ve=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!He(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(ie(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:De(0,l,c)}},Ue="--ifr-start",Ze="--ifr-end",Je=[],Qe=new WeakSet,_e=e=>"object"==typeof e&&Qe.add(e);let Ge={},Ye=0;function Xe(e){e.getEntries().forEach(e=>{if(e.name===Ze){const{duration:t}=performance.measure("--ifr-measure",Ue,Ze);Ge=e.detail,Je.push(t),Je.length>100&&Je.shift()}})}function Ke(){re("Attached PerformanceObserver to page");new PerformanceObserver(Xe).observe({entryTypes:["mark"]}),_e(document.documentElement),_e(document.body),function(){const e=setInterval(()=>{if(Je.length<10)return;if(Ge.hasTags&&Ge.len<25)return;Je.sort();const t=Math.min(Je.reduce((e,t)=>e+t,0)/Je.length,Je[Math.floor(Je.length/2)]),n=Q(t);n>Ye&&(Ye=n,ue("performanceObserver")),t<=4||(clearInterval(e),pe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ge.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const et=Fe("Resize"),tt=new WeakSet;let nt;function ot(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=tt.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(ie(!o,"Node already observed for resize",n),o||(nt.observe(n),tt.add(n),t+=1))}et(t)}const rt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},it=rt("function"),at=rt("number"),st=rt("string");"undefined"!=typeof window&&function(){const o={height:()=>(me("Custom height calculation function not defined"),Wt.auto()),width:()=>(me("Custom width calculation function not defined"),Ft.auto())},r={},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,B,W,D,J=!0,Q="",ee=0,te="",oe="",ie=!1,ae=!0,le=!1,ge=!0,ze=!1,we=!1,$e=!1,Se=1,Oe=a,Me="",Ee=!0,ke={},Ae=!1,Ie=!0,Ce=!1,Pe=0,Ne=!1,Re=[],Be="",qe="child",Le=!1,He="",Je=[],Qe=window.parent,_e="*",Ge=0,Ye=!1,Xe=1,et=l,rt=window,lt=()=>{me("onMessage function not defined")},ct=()=>{},ut=null,dt=null;function ft(t){var n,r,i;!function(e){Be=e[0]??Be,ee=xe(e[1])??ee,le=Te(e[2])??le,Ce=Te(e[3])??Ce,J=Te(e[6])??J,te=e[7]??te,Oe=e[8]??Oe,Q=e[9]??Q,oe=e[10]??oe,Ge=xe(e[11])??Ge,ke.enable=Te(e[12])??!1,qe=e[13]??qe,et=e[14]??et,Ne=Te(e[15])??Ne,d=xe(e[16])??d,f=xe(e[17])??f,ae=Te(e[18])??ae,c=e[19]??c,W=e[20]??W,Pe=xe(e[21])??Pe,Ie=Te(e[23])??Ie}(t),K=(n={id:Be,enabled:Ce,expand:Ie}).id||v,ne.label(`${K}`),ne.expand(n.expand),X=n.enabled,function(){function e(e){D=it(e,"onBeforeResize")??D,lt=it(e,"onMessage")??lt,ct=it(e,"onReady")??ct,"number"==typeof e?.offset&&(be("offset","offsetSize"),ae&&(d=at(e,"offset")??d),le&&(f=at(e,"offset")??f)),"number"==typeof e?.offsetSize&&(ae&&(d=at(e,"offsetSize")??d),le&&(f=at(e,"offsetSize")??f)),u=st(e,q(L[0]))??u,Me=st(e,"ignoreSelector")??Me,He=st(e,"sizeSelector")??He,_e=st(e,"targetOrigin")??_e,Oe=e?.heightCalculationMethod||Oe,et=e?.widthCalculationMethod||et}function t(e,t){return"function"==typeof e&&(pe(`<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===Pe)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Oe=t(Oe,"height"),et=t(et,"width"),re(`Set targetOrigin for parent: %c${_e}`,h))}(),bt(),function(){try{Le=1===Pe||"iframeParentListener"in window.parent}catch(e){}}(),le===ae&&(ie=!0),function(){const t=Pe,n=V({key:c}),o=V({key:u});if(Pe=Math.max(n,o),Pe<0){if(Pe=Math.min(n,o),fe(),pe(`${H(Pe+2)}${H(2)}`),G(W))throw H(Pe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(W)||t>-1&&Pe>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${K} %ciframe-resizer ${t}`,X||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>q(F[e]))(Pe)})`,Pe),Pe<2&&he(H(3)),sessionStorage.setItem("ifr",y))}(),W&&""!==W&&"false"!==W?W!==y&&pe(`<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`):pe("<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"),$t(),St(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&pe("<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&&pe("<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"),pt(),ie||je(),1!==Pe&&(rt.parentIframe=Object.freeze({autoResize:e=>(Y(e,"boolean","parentIframe.autoResize(enable) enable"),!1===le&&!1===ae?(ue(M),pe(`Auto Resize can not be changed when <b>direction</> is set to '${P}'.`),!1):(!0===e&&!1===J?(J=!0,queueMicrotask(()=>Jt(M,"Auto Resize enabled"))):!1===e&&!0===J&&(J=!1),_t(0,0,"autoResize",JSON.stringify(J)),J)),close(){_t(0,0,"close")},getId:()=>Be,getOrigin:()=>(ye("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return ut=e,_t(0,0,"pageInfo"),void ve("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");ut=null,_t(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),dt=e,_t(0,0,"parentInfo"),()=>{dt=null,_t(0,0,"parentInfoStop")}),getParentProperties(e){ye("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Y(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ke.findTarget(e)},reset(){!function(){const e=Oe;Oe=a,Ye||(Ye=!0,requestAnimationFrame(()=>{Ye=!1})),Qt("reset"),Oe=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,Jt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),_t(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),_t(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),_t(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),_t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Oe=e,$t()},setWidthCalculationMethod(e){et=e,St()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),_e=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Jt(j,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ye("size()","resize()"),this.resize(e,t)}}),rt.parentIFrame=rt.parentIframe),function(){function e(e){_t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){R(window.document,t,e)}!0===Ne&&(t("mouseenter"),t("mouseleave"))}(),ke=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);_t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?_t(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&R(e,"click",t=>{t.preventDefault(),n(e.getAttribute("href"))})}function i(){R(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){r(),i(),a()}return ke.enable&&(1===Pe?pe("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===te&&(te=`${ee}px`),yt("margin",(r="margin",(i=te).includes("-")&&(me(`Negative CSS value ignored for ${r}`),i=""),i)),yt("background",Q),yt("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ie||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){zt({method:e,eventType:"After Print",eventName:"afterprint"}),zt({method:e,eventType:"Before Print",eventName:"beforeprint"}),zt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Nt(document)();We(It),function(e){const t={root:document.documentElement,side:ae?S:O};p=Ve(Mt,t),p.attachObservers(e)}(e),Ke(),function(e){nt=new ResizeObserver(Et),nt.observe(document.body),tt.add(document.body),re("Attached ResizeObserver to body"),B={attachObserverToNonStaticElements:ot,detachObservers:De(0,nt,tt)},B.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),re("Attached VisibilityObserver to page")}(jt)}(),mt(Z(ct)),Jt(N,"Init message from host page",void 0,void 0,`${y}:${Pe}`),document.title&&""!==document.title&&_t(0,0,"title",document.title)}function mt(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>mt(e))}function pt(){Je=document.querySelectorAll(`[${z}]`),$e=Je.length>0}let ht=0;function gt(){const n=document.querySelectorAll(`*[${$}]`);ze=n.length>0,ze&&n.length!==ht&&(function(n){const o=1===n.length?"":"s";me(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ht=n.length)}function yt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),re(`Set body ${e}: %c${t}`,h))}function vt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function bt(){vt(0,z,He),vt(0,$,Me)}function zt(e){({add(t){function n(){Jt(e.eventName,e.eventType)}i[t]=n,R(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function wt(e,t,n,o){return t!==e&&(e in n||(me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&pe(`<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."}`),e}function $t(){Oe=wt(Oe,a,Wt,"height")}function St(){et=wt(et,l,Ft,"width")}function Ot(){const e=document.querySelectorAll(`[${w}]`);Re=Array.from(e).filter(e=>!e.closest(`[${$}]`)),we=Re.length>0}function Mt(e){Ot(),(we||e)&&(Re.length>1?re("Overflowed Elements:",...Re):we||re("Overflow removed"),Jt(A,"Overflow updated"))}function Et(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Jt(x,`Element resized <${function(e){switch(!0){case!G(e):return"";case G(e.id):return`${e.nodeName}#${e.id}`;case G(e.name):return`${e.nodeName} (${e.name}`;case G(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function jt(e){Ae=!e,Jt(C,"Visibility changed")}const kt=Fe("Overflow"),Tt=Fe("Overflow",!1),xt=Fe("Resize"),At=Fe("Resize",!1);function It(e){!function({addedMutations:e,removedMutations:t}){ue("contentMutated"),bt(),pt(),Ot();let n=0,o=0,r=0,i=0;for(const e of t){const t=Nt(e)();o+=p.detachObservers(t),i+=B.detachObservers(t)}for(const t of e){const e=Nt(t)();n+=p.attachObservers(e),r+=B.attachObserverToNonStaticElements(e)}Tt(o),At(i),kt(n),xt(r),se()}(e),Jt(I,"Mutation Observed")}function Ct(e){performance.mark(Ue);const t=_(e);let n=0,o=document.documentElement,r=$e?0:document.documentElement.getBoundingClientRect().bottom;const i=$e?Je:we?Re:Nt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return re(`${t} position calculated from:`,o),performance.mark(Ze,{detail:{hasTags:$e,len:i.length,logging:Ce,Side:t}}),r}const Pt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Nt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return gt(),ze&&t.push(`not([${$}])`,`not([${$}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Rt={height:0,width:0},Bt={height:0,width:0},qt=[h,g,h];function Lt(e){function t(){return Bt[o]=r,Rt[o]=s,r}const n=e===Wt,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:re("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!we&&0===Bt[o]&&0===Rt[o]:re(`Initial page size values: ${l}`,...qt),c=t();break;case Ye&&r===Bt[o]&&s===Rt[o]:re(`Size unchanged: ${l}`,...qt),c=Math.max(r,s);break;case 0===r:re(`Page is hidden: ${l}`,...qt),c=s;break;case!we&&r!==Bt[o]&&s<=Rt[o]:re(`New <html> size: ${l} `,...qt),re(`Previous <html> size: %c${Bt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!we&&r<Bt[o]:re(`<html> size decreased: ${l}`,...qt),c=t();break;case s===a||s===i:re(`<html> size equals page size: ${l}`,...qt),c=t();break;case r>s:re(`Page size < <html> size: ${l}`,...qt),c=t();break;case we:re("Found element overflowing <html> "),c=e.taggedElement();break;default:re(`Using <html> size: ${l}`,...qt),c=t()}return re(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&re(`Page offsetSize: %c${t}px`,h),t}(e),c}const Wt={enabled:()=>ae,getOffset:()=>d,auto:()=>Lt(Wt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},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(...Pt(Wt)),min:()=>Math.min(...Pt(Wt)),grow:()=>Wt.max(),lowestElement:()=>Ct(S),taggedElement:()=>Ct(S)},Ft={enabled:()=>le,getOffset:()=>f,auto:()=>Lt(Ft),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(Ft)),min:()=>Math.min(...Pt(Ft)),rightMostElement:()=>Ct(O),scroll:()=>Math.max(Ft.bodyScroll(),Ft.documentElementScroll()),taggedElement:()=>Ct(O)},Dt=(e,t)=>!(Math.abs(e-t)<=Ge);function Ht(e,t){const n=e[t]();return e.enabled()&&void 0!==D?function(e){const t=D(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 Vt=!1;const Ut=Z(()=>he(H(4)));let Zt=!1;const Jt=ce((e,t,n,o,r)=>{if(performance.now(),ue(e),!0!==Vt){if(!J&&!(e in k))return re("Resizing disabled"),void se();if(Ae){if(!0===Zt)return;Zt=!0}else Zt=!1,Vt=!0,requestAnimationFrame(()=>{Vt=!1}),function(e,t,n,o,r){const i=n??Ht(Wt,Oe),a=o??Ht(Ft,et);switch(ae&&Dt(Se,i)||le&&Dt(Xe,a)?E:e){case N:case M:case E:Se=i,Xe=a;case T:_t(Se,Xe,e,r);break;case A:case I:case x:case C:fe();break;default:fe(),re("No change in content size detected")}}(e,0,n,o,r)}});function Qt(e){Se=Wt[Oe](),Xe=Ft[et](),_t(Se,Xe,e)}const _t=ce(function(e,t,o,r,i){Pe<-1||(ue(o),void 0!==i||(i=_e),function(){const a=`${Be}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Le)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Pe)throw e;return void Ut()}else Qe.postMessage(s+a,i);re(`Sending message to parent page via ${Le?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),se())}),Gt=ce(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>_t(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Qe=e.source,m=e.origin,ft(t),ge=!1,setTimeout(()=>{Ee=!1},128)},reset(){Ee||Qt("resetPage")},resize(){Jt("parentResize","Parent window requested size check")},moveToAnchor(){ke.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();ut?U(ut,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;dt?U(dt,e):o("parentInfo")},message(){const e=a();U(lt,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();ue(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||me(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return l()?(de(i()),ue(N),void r.init()):void 0;c()}()});function Yt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Gt({data:e,sameOrigin:!0})),R(window,"message",Gt),R(window,"readystatechange",Yt),Yt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (child) 5.5.0-beta.3 (iife)
4
+ * @module iframe-resizer/legacy (child) 5.5.0 (iife)
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},s={profile:0,profileEnd:0,timeStamp:0,trace:0},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.5.0-beta.3",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",k=Symbol("sizeChanged"),E="manualResize",j={},I="setOffsetSize",T="resizeObserver",A="overflowObserver",x="mutationObserver",P="visibilityObserver",C="none",R="No change in content size detected",N="init",q=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},L=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),F=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],D=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],H=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),V=e=>L(W[e]);var U=e=>{const t=e[L(F[0])]||e[L(F[1])]||e[L(F[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(L(e));return n in H&&(t=H[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o};const Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},Q=e=>e,_=e=>Math.round(1e3*e)/1e3,G=e=>e.charAt(0).toUpperCase()+e.slice(1),Y=e=>""!=`${e}`&&void 0!==e;const X=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${G(t)}`)};let K=!0,ee=v;const te=(ne=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){l[b()?"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(),v()}else v()}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){!0!==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),z()}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}},ne?.__esModule?ne.default:ne);var ne;const oe=te({label:`${v}(child)`});const re=(ie="log",(...e)=>!K||oe[ie](...e));var ie;const ae=re;const{assert:se,debug:le,endAutoGroup:ce,error:ue,errorBoundary:de,event:fe,label:me,purge:pe,warn:he}=oe,ge=e=>{return oe.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},ye=ge,ve=(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)=>ge(t)),be=ve("Method"),ze=ve("Method","replaced with"),we=ve("Option"),$e=["min-height","min-width","max-height","max-width"],Se=new Set,Oe=e=>e.tagName?e.tagName.toLowerCase():"unknown",Me=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),ke=(e,t)=>{return(n=Me(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Ee({href:e}){Se.has(e)||(re("Unable to access stylesheet:",e),Se.add(e))}const je=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ee(n)}return{source:"cross-origin stylesheet",value:Me(e,t)}}(e,t),Ie=(e,t)=>{const{source:n,value:o}=je(e,t),r=Oe(e);ge(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Te(){for(const e of[document.documentElement,document.body])for(const t of $e)re(`Checking <${Oe(e)}> for blocking CSS: ${t}`),ke(e,t)&&Ie(e,t)}const Ae=e=>t=>void 0===t?void 0:e(t),xe=Ae(e=>"true"===e),Pe=Ae(Number),Ce=new Set,Re=new Set,Ne=[];let qe,Be=1,Le=!1,Fe=0;const We=e=>{re("Mutations:",e);for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)Ce.add(t);for(const e of n)Ce.has(e)?Ce.delete(e):Re.add(e)}};function De(e){Ne.push(e),Le||(Fe=performance.now(),Le=!0,requestAnimationFrame(qe))}function He(e){const t=new window.MutationObserver(De),n=document.querySelector("body"),o={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return qe=(e=>()=>{const t=performance.now(),n=t-Fe,o=16*Be+++2;if(n>o&&n<200)return ae("Backed off due to heavy workload on callStack"),re(`Delay: %c${_(n)}ms %c> Delay limit: %c${o}ms`,h,g,h),setTimeout(qe,16*Be),void(Fe=t);Be=1,Ne.forEach(We),Ne.length=0,e({addedMutations:Ce,removedMutations:Re}),Le=!1,Ce.clear(),Re.clear()})(e),t.observe(n,o),ae("Attached MutationObserver to body"),t}const Ve=(t,n=!0)=>o=>{o>0&&ae(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Ue=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},Ze=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Je=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||Q,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!Ze(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(se(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:Ue(0,l,c)}},Qe="--ifr-start",_e="--ifr-end",Ge=[],Ye=new WeakSet,Xe=e=>"object"==typeof e&&Ye.add(e);let Ke={},et=0;function tt(e){e.getEntries().forEach(e=>{if(e.name===_e){const{duration:t}=performance.measure("--ifr-measure",Qe,_e);Ke=e.detail,Ge.push(t),Ge.length>100&&Ge.shift()}})}function nt(){ae("Attached PerformanceObserver to page");new PerformanceObserver(tt).observe({entryTypes:["mark"]}),Xe(document.documentElement),Xe(document.body),function(){const e=setInterval(()=>{if(Ge.length<10)return;if(Ke.hasTags&&Ke.len<25)return;Ge.sort();const t=Math.min(Ge.reduce((e,t)=>e+t,0)/Ge.length,Ge[Math.floor(Ge.length/2)]),n=_(t);n>et&&(et=n,fe("performanceObserver"),re("Mean time:",_(Ge[Math.floor(Ge.length/2)])),re("Median time:",_(Ge.reduce((e,t)=>e+t,0)/Ge.length)),re("Average time:",n),re("Max time:",_(Math.max(...Ge)))),t<=4||(clearInterval(e),ge(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${_(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ke.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const ot=Ve("Resize"),rt=new WeakSet;let it;function at(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=rt.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(se(!o,"Node already observed for resize",n),o||(it.observe(n),rt.add(n),t+=1))}ot(t)}const st=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},lt=st("function"),ct=st("number"),ut=st("string");"undefined"!=typeof window&&function(){const o={height:()=>(he("Custom height calculation function not defined"),Vt.auto()),width:()=>(he("Custom width calculation function not defined"),Ut.auto())},r={},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,B,W,H,Q,te,ne=!0,ie="",se=0,ue="",pe="",ve=!1,$e=!0,Se=!1,Oe=!0,Me=!1,ke=!1,Ee=!1,je=1,Ie=a,Ae="",Ce=!0,Re={},Ne=!1,qe=!0,Be=!1,Le=0,Fe=!1,We=[],De="",Ze="child",Ge=!1,Ye="",Xe=[],Ke=window.parent,et="*",tt=0,ot=!1,st=1,dt=l,ft=window,mt=()=>{he("onMessage function not defined")},pt=()=>{},ht=null,gt=null;function yt(t){var n,r,i;!function(e){De=e[0]??De,se=Pe(e[1])??se,Se=xe(e[2])??Se,Be=xe(e[3])??Be,ne=xe(e[6])??ne,ue=e[7]??ue,Ie=e[8]??Ie,ie=e[9]??ie,pe=e[10]??pe,tt=Pe(e[11])??tt,Re.enable=xe(e[12])??!1,Ze=e[13]??Ze,dt=e[14]??dt,Fe=xe(e[15])??Fe,d=Pe(e[16])??d,f=Pe(e[17])??f,$e=xe(e[18])??$e,c=e[19]??c,Q=e[20]??Q,Le=Pe(e[21])??Le,qe=xe(e[23])??qe}(t),ee=(n={id:De,enabled:Be,expand:qe}).id||v,oe.label(`${ee}`),oe.expand(n.expand),K=n.enabled,re(`Initialising iframe v${y} ${window.location.href}`),function(){function e(e){re("Reading data from page:",Object.keys(e)),te=lt(e,"onBeforeResize")??te,mt=lt(e,"onMessage")??mt,pt=lt(e,"onReady")??pt,"number"==typeof e?.offset&&(we("offset","offsetSize"),$e&&(d=ct(e,"offset")??d),Se&&(f=ct(e,"offset")??f)),"number"==typeof e?.offsetSize&&($e&&(d=ct(e,"offsetSize")??d),Se&&(f=ct(e,"offsetSize")??f)),u=ut(e,L(F[0]))??u,Ae=ut(e,"ignoreSelector")??Ae,Ye=ut(e,"sizeSelector")??Ye,et=ut(e,"targetOrigin")??et,Ie=e?.heightCalculationMethod||Ie,dt=e?.widthCalculationMethod||dt}function t(e,t){return"function"==typeof e&&(ge(`<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===Le)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Ie=t(Ie,"height"),dt=t(dt,"width"),ae(`Set targetOrigin for parent: %c${et}`,h))}(),Ot(),function(){try{Ge=1===Le||"iframeParentListener"in window.parent}catch(e){re("Cross domain iframe detected")}}(),Se===$e&&(ve=!0),function(){const t=Le,n=U({key:c}),o=U({key:u});if(Le=Math.max(n,o),Le<0){if(Le=Math.min(n,o),ge(`${V(Le+2)}${V(2)}`),Y(Q))throw V(Le+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!Y(Q)||t>-1&&Le>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${ee} %ciframe-resizer ${t}`,K||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>L(D[e]))(Le)})`,Le),Le<2&&ye(V(3)),sessionStorage.setItem("ifr",y))}(),Q&&""!==Q&&"false"!==Q?Q!==y&&ge(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Q} - Child page: ${y}.\n`):ge("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n"),Et(),jt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&ge("<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&&ge("<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"),bt(),ve||Te(),1!==Le&&(ft.parentIframe=Object.freeze({autoResize:e=>(X(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Se&&!1===$e?(fe(M),ge(`Auto Resize can not be changed when <b>direction</> is set to '${C}'.`),!1):(!0===e&&!1===ne?(ne=!0,queueMicrotask(()=>Yt(M,"Auto Resize enabled"))):!1===e&&!0===ne&&(ne=!1),Kt(0,0,"autoResize",JSON.stringify(ne)),ne)),close(){Kt(0,0,"close")},getId:()=>De,getOrigin:()=>(be("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return ht=e,Kt(0,0,"pageInfo"),void ze("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");ht=null,Kt(0,0,"pageInfoStop")},getParentProps:e=>(X(e,"function","parentIframe.getParentProps(callback) callback"),gt=e,Kt(0,0,"parentInfo"),()=>{gt=null,Kt(0,0,"parentInfoStop")}),getParentProperties(e){be("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){X(e,"string","parentIframe.moveToAnchor(anchor) anchor"),Re.findTarget(e)},reset(){!function(){const e=Ie;Ie=a,re("Reset trigger event: %cparentIframe.reset",h),ot?re("TriggerLock blocked calculation"):(ot=!0,le("Trigger event lock on"),requestAnimationFrame(()=>{ot=!1,le("Trigger event lock off")})),Xt("reset"),Ie=e}()},setOffsetSize(e){X(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,Yt(I,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){X(e,"number","parentIframe.scrollBy(x, y) x"),X(t,"number","parentIframe.scrollBy(x, y) y"),Kt(t,e,"scrollBy")},scrollTo(e,t){X(e,"number","parentIframe.scrollTo(x, y) x"),X(t,"number","parentIframe.scrollTo(x, y) y"),Kt(t,e,"scrollTo")},scrollToOffset(e,t){X(e,"number","parentIframe.scrollToOffset(x, y) x"),X(t,"number","parentIframe.scrollToOffset(x, y) y"),Kt(t,e,"scrollToOffset")},sendMessage(e,t){t&&X(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Kt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Ie=e,Et()},setWidthCalculationMethod(e){dt=e,jt()},setTargetOrigin(e){X(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),re(`Set targetOrigin: %c${e}`,h),et=e},resize(e,t){e&&X(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&X(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Yt(E,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){be("size()","resize()"),this.resize(e,t)}}),ft.parentIFrame=ft.parentIframe),function(){function e(e){Kt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){re(`Add event listener: %c${n}`,h),q(window.document,t,e)}!0===Fe&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),Re=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);re(`Moving to in page link (%c#${o}%c) at x: %c${n.x}%c y: %c${n.y}`,h,g,h,g,h),Kt(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?(re(`In page link (#${o}) not found in iFrame, so sending to parent`),Kt(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")&&q(e,"click",t=>{t.preventDefault(),n(e.getAttribute("href"))})}function i(){q(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){re("Setting up location.hash handlers"),r(),i(),a()}return Re.enable?1===Le?ge("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s():re("In page linking not enabled"),{findTarget:n}}(),void 0===ue&&(ue=`${se}px`),$t("margin",(r="margin",(i=ue).includes("-")&&(he(`Negative CSS value ignored for ${r}`),i=""),i)),$t("background",ie),$t("padding",pe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ve||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),re("Set HTML & body height: %cauto !important",h)}(),!0!==ne&&re("Auto Resize disabled"),function(e){Mt({method:e,eventType:"After Print",eventName:"afterprint"}),Mt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Mt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Lt(document)();re("Attaching Observers"),He(Nt),function(e){const t={root:document.documentElement,side:$e?S:O};p=Je(It,t),p.attachObservers(e)}(e),nt(),function(e){it=new ResizeObserver(Tt),it.observe(document.body),rt.add(document.body),ae("Attached ResizeObserver to body"),B={attachObserverToNonStaticElements:at,detachObservers:Ue(0,it,rt)},B.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),ae("Attached VisibilityObserver to page")}(At)}(),vt(J(pt)),re("Initialization complete"),Yt(N,"Init message from host page",void 0,void 0,`${y}:${Le}`),document.title&&""!==document.title&&Kt(0,0,"title",document.title)}function vt(e){"complete"===document.readyState?Z(e):q(document,"readystatechange",()=>vt(e))}function bt(){Xe=document.querySelectorAll(`[${z}]`),Ee=Xe.length>0,re(`Tagged elements found: %c${Ee}`,h)}let zt=0;function wt(){const n=document.querySelectorAll(`*[${$}]`);Me=n.length>0,Me&&n.length!==zt&&(function(n){const o=1===n.length?"":"s";he(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),zt=n.length)}function $t(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ae(`Set body ${e}: %c${t}`,h))}function St(e,t,n){if(""!==n){re(`${e}: %c${n}`,h);for(const e of document.querySelectorAll(n))re(`Applying ${t} to:`,e),e.toggleAttribute(t,!0)}}function Ot(){St("sizeSelector",z,Ye),St("ignoreSelector",$,Ae)}function Mt(e){({add(t){function n(){Yt(e.eventName,e.eventType)}i[t]=n,q(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),re(`${G(e.method)} event listener: %c${e.eventType}`,h)}function kt(e,t,n,o){return t!==e&&(e in n||(he(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&ge(`<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 ${Q?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),re(`Set ${o} calculation method: %c${e}`,h),e}function Et(){Ie=kt(Ie,a,Vt,"height")}function jt(){dt=kt(dt,l,Ut,"width")}function It(e){!function(){const e=document.querySelectorAll(`[${w}]`);We=Array.from(e).filter(e=>!e.closest(`[${$}]`)),ke=We.length>0}(),(ke||e)&&(We.length>1?ae("Overflowed Elements:",...We):ke||ae("Overflow removed"),Yt(A,"Overflow updated"))}function Tt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Yt(T,`Element resized <${function(e){switch(!0){case!Y(e):return"";case Y(e.id):return`${e.nodeName}#${e.id}`;case Y(e.name):return`${e.nodeName} (${e.name}`;case Y(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function At(e){re(`Visible: %c${e}`,h),Ne=!e,Yt(P,"Visibility changed")}const xt=Ve("Overflow"),Pt=Ve("Overflow",!1),Ct=Ve("Resize"),Rt=Ve("Resize",!1);function Nt(e){!function({addedMutations:e,removedMutations:t}){fe("contentMutated"),Ot(),bt();let n=0,o=0,r=0,i=0;for(const e of t){const t=Lt(e)();o+=p.detachObservers(t),i+=B.detachObservers(t)}for(const t of e){const e=Lt(t)();n+=p.attachObservers(e),r+=B.attachObserverToNonStaticElements(e)}Pt(o),Rt(i),xt(n),Ct(r),ce()}(e),Yt(x,"Mutation Observed")}function qt(e){performance.mark(Qe);const t=G(e);let n=0,o=document.documentElement,r=Ee?0:document.documentElement.getBoundingClientRect().bottom;const i=Ee?Xe:ke?We:Lt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ae(`${t} position calculated from:`,o),performance.mark(_e,{detail:{hasTags:Ee,len:i.length,logging:Be,Side:t}}),r}const Bt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Lt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return wt(),Me&&t.push(`not([${$}])`,`not([${$}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Ft={height:0,width:0},Wt={height:0,width:0},Dt=[h,g,h];function Ht(e){function t(){return Wt[o]=r,Ft[o]=s,r}const n=e===Vt,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 Ee:ae("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ke&&0===Wt[o]&&0===Ft[o]:ae(`Initial page size values: ${l}`,...Dt),c=t();break;case ot&&r===Wt[o]&&s===Ft[o]:ae(`Size unchanged: ${l}`,...Dt),c=Math.max(r,s);break;case 0===r:ae(`Page is hidden: ${l}`,...Dt),c=s;break;case!ke&&r!==Wt[o]&&s<=Ft[o]:ae(`New <html> size: ${l} `,...Dt),ae(`Previous <html> size: %c${Wt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!ke&&r<Wt[o]:ae(`<html> size decreased: ${l}`,...Dt),c=t();break;case s===a||s===i:ae(`<html> size equals page size: ${l}`,...Dt),c=t();break;case r>s:ae(`Page size < <html> size: ${l}`,...Dt),c=t();break;case ke:ae("Found element overflowing <html> "),c=e.taggedElement();break;default:ae(`Using <html> size: ${l}`,...Dt),c=t()}return ae(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&ae(`Page offsetSize: %c${t}px`,h),t}(e),c}const Vt={enabled:()=>$e,getOffset:()=>d,auto:()=>Ht(Vt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Vt.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(...Bt(Vt)),min:()=>Math.min(...Bt(Vt)),grow:()=>Vt.max(),lowestElement:()=>qt(S),taggedElement:()=>qt(S)},Ut={enabled:()=>Se,getOffset:()=>f,auto:()=>Ht(Ut),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(...Bt(Ut)),min:()=>Math.min(...Bt(Ut)),rightMostElement:()=>qt(O),scroll:()=>Math.max(Ut.bodyScroll(),Ut.documentElementScroll()),taggedElement:()=>qt(O)},Zt=(e,t)=>!(Math.abs(e-t)<=tt);function Jt(e,t){const n=e[t]();return e.enabled()&&void 0!==te?function(e){const t=te(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let Qt=!1;const _t=J(()=>ye(V(4)));let Gt=!1;const Yt=de((e,t,n,o,r)=>{if(H=performance.now(),W=!0,fe(e),!0!==Qt){if(!ne&&!(e in j))return ae("Resizing disabled"),void ce();if(Ne){if(!0===Gt)return;return re("Iframe hidden - Ignored resize request"),void(Gt=!0)}Gt=!1,Qt=!0,requestAnimationFrame(()=>{Qt=!1}),function(e,t,n,o,r){const i=n??Jt(Vt,Ie),a=o??Jt(Ut,dt),s=$e&&Zt(je,i)||Se&&Zt(st,a)?k:e;switch(re(`Resize event: %c${t}`,h),s){case N:case M:case k:je=i,st=a;case I:Kt(je,st,e,r);break;case A:case x:case T:case P:re(R);break;default:ae(R)}W=!1}(e,t,n,o,r)}});function Xt(e){je=Vt[Ie](),st=Ut[dt](),Kt(je,st,e)}const Kt=de(function(e,t,o,r,i){Le<-1||(fe(o),void 0!==i?re(`Message targetOrigin: %c${i}`,h):i=et,function(){const a=`${De}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Ge)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Le)throw e;return void _t()}else Ke.postMessage(s+a,i);W&&re(function(){const e=_(performance.now()-H);return o===N?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),h),ae(`Sending message to parent page via ${Ge?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),ce())}),en=de(function(e){fe("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>t(n(e)),r=e=>Kt(0,0,`${e}Stop`),i={init:function(){if("loading"===document.readyState)return void re("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");Ke=e.source,m=e.origin,yt(t),Oe=!1,setTimeout(()=>{Ce=!1},128)},reset(){Ce?re("Page reset ignored by init"):(re("Page size reset by host page"),Xt("resetPage"))},resize(){re("Resize requested by host page"),Yt("parentResize","Parent window requested size check")},moveToAnchor(){Re.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();re("PageInfo received from parent:",o(e)),ht?Z(ht,n(e)):r("pageInfo")},parentInfo(){const e=o(l());re("ParentInfo received from parent:",e),gt?Z(gt,e):r("parentInfo")},message(){const e=l();re("onMessage called from parent:%c",h,o(e)),Z(mt,n(e))}},a=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function u(){const t=a();fe(t),t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||he(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==Oe)return c()?(me(a()),fe(N),void i.init()):void re(`Ignored message of type "${a()}". Received before initialization.`);u()}()});function tn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?he("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>en({data:e,sameOrigin:!0})),q(window,"message",en),q(window,"readystatechange",tn),tn())}()}();
21
- //# sourceMappingURL=iframeResizer.contentWindow.min.js.map
20
+ !function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},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.5.0",v="iframeResizer",b=10,z="data-iframe-size",w="data-iframe-overflowed",$="data-iframe-ignore",S="bottom",O="right",M="autoResizeEnabled",E=Symbol("sizeChanged"),j="manualResize",k={},T="setOffsetSize",x="resizeObserver",A="overflowObserver",I="mutationObserver",C="visibilityObserver",P="none",N="init",R=(e,t,n,o)=>e.addEventListener(t,n,o||!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},q=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),L=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>q(W[e]);var V=e=>{const t=e[q(L[0])]||e[q(L[1])]||e[q(L[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(q(e));return n in D&&(t=D[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o};const U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,Q=e=>Math.round(1e3*e)/1e3,_=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>""!=`${e}`&&void 0!==e;const Y=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${_(t)}`)};let X=!0,K=v;const ee=(te=function(n={}){const c={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let g="";function y(){p.length=0,g=""}function v(){delete h.event,y()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){l[b()?"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(),v()}else v()}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){!0!==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),z()}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}},te?.__esModule?te.default:te);var te;const ne=ee({label:`${v}(child)`});var oe;const re=(oe="log",(...e)=>!X||ne[oe](...e));const{assert:ie,debug:ae,endAutoGroup:se,error:le,errorBoundary:ce,event:ue,label:de,purge:fe,warn:me}=ne,pe=e=>{return ne.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},he=pe,ge=(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)=>pe(t)),ye=ge("Method"),ve=ge("Method","replaced with"),be=ge("Option"),ze=["min-height","min-width","max-height","max-width"],we=new Set,$e=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=$e(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Oe({href:e}){we.has(e)||we.add(e)}const Me=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Oe(n)}return{source:"cross-origin stylesheet",value:$e(e,t)}}(e,t),Ee=(e,t)=>{const{source:n,value:o}=Me(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);pe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function je(){for(const e of[document.documentElement,document.body])for(const t of ze)Se(e,t)&&Ee(e,t)}const ke=e=>t=>void 0===t?void 0:e(t),Te=ke(e=>"true"===e),xe=ke(Number),Ae=new Set,Ie=new Set,Ce=[];let Pe,Ne=1,Re=!1,Be=0;const qe=e=>{for(const t of e){const{addedNodes:e,removedNodes:n}=t;for(const t of e)Ae.add(t);for(const e of n)Ae.has(e)?Ae.delete(e):Ie.add(e)}};function Le(e){Ce.push(e),Re||(Be=performance.now(),Re=!0,requestAnimationFrame(Pe))}function We(e){const t=new window.MutationObserver(Le),n=document.querySelector("body"),o={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return Pe=(e=>()=>{const t=performance.now(),n=t-Be,o=16*Ne+++2;if(n>o&&n<200)return ue("MutationDelay"),re("Update delayed due to heavy workload on the callStack"),re(`EventLoop busy time: %c${Q(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Pe,16*Ne),void(Be=t);Ne=1,Ce.forEach(qe),Ce.length=0,e({addedMutations:Ae,removedMutations:Ie}),Re=!1,Ae.clear(),Ie.clear()})(e),t.observe(n,o),re("Attached MutationObserver to body"),t}const Fe=(t,n=!0)=>o=>{o>0&&re(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},De=(e,t,n)=>e=>{let o=0;for(const r of e)n.has(r)&&(t.unobserve(r),n.delete(r),o+=1);return o},He=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Ve=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||J,i=(t=!1)=>e(t),a=(e,t)=>0===e||e>t[n],s=(e,t)=>e.toggleAttribute(w,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:o,target:r}=t,i=e[n],l=a(i,o)&&!He(r);s(r,l)}r(i)},o),c=new WeakSet;return{attachObservers:function(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=c.has(n);e&&(ie(!o,"Node already observed for overflow",n),o||(l.observe(n),c.add(n),t+=1))}return t},detachObservers:De(0,l,c)}},Ue="--ifr-start",Ze="--ifr-end",Je=[],Qe=new WeakSet,_e=e=>"object"==typeof e&&Qe.add(e);let Ge={},Ye=0;function Xe(e){e.getEntries().forEach(e=>{if(e.name===Ze){const{duration:t}=performance.measure("--ifr-measure",Ue,Ze);Ge=e.detail,Je.push(t),Je.length>100&&Je.shift()}})}function Ke(){re("Attached PerformanceObserver to page");new PerformanceObserver(Xe).observe({entryTypes:["mark"]}),_e(document.documentElement),_e(document.body),function(){const e=setInterval(()=>{if(Je.length<10)return;if(Ge.hasTags&&Ge.len<25)return;Je.sort();const t=Math.min(Je.reduce((e,t)=>e+t,0)/Je.length,Je[Math.floor(Je.length/2)]),n=Q(t);n>Ye&&(Ye=n,ue("performanceObserver")),t<=4||(clearInterval(e),pe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(t)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Ge.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const et=Fe("Resize"),tt=new WeakSet;let nt;function ot(e){let t=0;for(const n of e){const e=n.nodeType===Node.ELEMENT_NODE,o=tt.has(n);if(!e)continue;const r=getComputedStyle(n)?.position;""!==r&&"static"!==r&&(ie(!o,"Node already observed for resize",n),o||(nt.observe(n),tt.add(n),t+=1))}et(t)}const rt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},it=rt("function"),at=rt("number"),st=rt("string");"undefined"!=typeof window&&function(){const o={height:()=>(me("Custom height calculation function not defined"),Wt.auto()),width:()=>(me("Custom width calculation function not defined"),Ft.auto())},r={},i={},a="auto",s="[iFrameSizer]",l="scroll";let c,u,d,f,m,p,B,W,D,J=!0,Q="",ee=0,te="",oe="",ie=!1,ae=!0,le=!1,ge=!0,ze=!1,we=!1,$e=!1,Se=1,Oe=a,Me="",Ee=!0,ke={},Ae=!1,Ie=!0,Ce=!1,Pe=0,Ne=!1,Re=[],Be="",qe="child",Le=!1,He="",Je=[],Qe=window.parent,_e="*",Ge=0,Ye=!1,Xe=1,et=l,rt=window,lt=()=>{me("onMessage function not defined")},ct=()=>{},ut=null,dt=null;function ft(t){var n,r,i;!function(e){Be=e[0]??Be,ee=xe(e[1])??ee,le=Te(e[2])??le,Ce=Te(e[3])??Ce,J=Te(e[6])??J,te=e[7]??te,Oe=e[8]??Oe,Q=e[9]??Q,oe=e[10]??oe,Ge=xe(e[11])??Ge,ke.enable=Te(e[12])??!1,qe=e[13]??qe,et=e[14]??et,Ne=Te(e[15])??Ne,d=xe(e[16])??d,f=xe(e[17])??f,ae=Te(e[18])??ae,c=e[19]??c,W=e[20]??W,Pe=xe(e[21])??Pe,Ie=Te(e[23])??Ie}(t),K=(n={id:Be,enabled:Ce,expand:Ie}).id||v,ne.label(`${K}`),ne.expand(n.expand),X=n.enabled,function(){function e(e){D=it(e,"onBeforeResize")??D,lt=it(e,"onMessage")??lt,ct=it(e,"onReady")??ct,"number"==typeof e?.offset&&(be("offset","offsetSize"),ae&&(d=at(e,"offset")??d),le&&(f=at(e,"offset")??f)),"number"==typeof e?.offsetSize&&(ae&&(d=at(e,"offsetSize")??d),le&&(f=at(e,"offsetSize")??f)),u=st(e,q(L[0]))??u,Me=st(e,"ignoreSelector")??Me,He=st(e,"sizeSelector")??He,_e=st(e,"targetOrigin")??_e,Oe=e?.heightCalculationMethod||Oe,et=e?.widthCalculationMethod||et}function t(e,t){return"function"==typeof e&&(pe(`<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===Pe)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Oe=t(Oe,"height"),et=t(et,"width"),re(`Set targetOrigin for parent: %c${_e}`,h))}(),bt(),function(){try{Le=1===Pe||"iframeParentListener"in window.parent}catch(e){}}(),le===ae&&(ie=!0),function(){const t=Pe,n=V({key:c}),o=V({key:u});if(Pe=Math.max(n,o),Pe<0){if(Pe=Math.min(n,o),fe(),pe(`${H(Pe+2)}${H(2)}`),G(W))throw H(Pe+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(W)||t>-1&&Pe>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${K} %ciframe-resizer ${t}`,X||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>q(F[e]))(Pe)})`,Pe),Pe<2&&he(H(3)),sessionStorage.setItem("ifr",y))}(),W&&""!==W&&"false"!==W?W!==y&&pe(`<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`):pe("<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"),$t(),St(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&pe("<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&&pe("<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"),pt(),ie||je(),1!==Pe&&(rt.parentIframe=Object.freeze({autoResize:e=>(Y(e,"boolean","parentIframe.autoResize(enable) enable"),!1===le&&!1===ae?(ue(M),pe(`Auto Resize can not be changed when <b>direction</> is set to '${P}'.`),!1):(!0===e&&!1===J?(J=!0,queueMicrotask(()=>Jt(M,"Auto Resize enabled"))):!1===e&&!0===J&&(J=!1),_t(0,0,"autoResize",JSON.stringify(J)),J)),close(){_t(0,0,"close")},getId:()=>Be,getOrigin:()=>(ye("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return ut=e,_t(0,0,"pageInfo"),void ve("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");ut=null,_t(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),dt=e,_t(0,0,"parentInfo"),()=>{dt=null,_t(0,0,"parentInfoStop")}),getParentProperties(e){ye("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Y(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ke.findTarget(e)},reset(){!function(){const e=Oe;Oe=a,Ye||(Ye=!0,requestAnimationFrame(()=>{Ye=!1})),Qt("reset"),Oe=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,Jt(T,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),_t(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),_t(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),_t(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),_t(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Oe=e,$t()},setWidthCalculationMethod(e){et=e,St()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),_e=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Jt(j,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ye("size()","resize()"),this.resize(e,t)}}),rt.parentIFrame=rt.parentIframe),function(){function e(e){_t(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){R(window.document,t,e)}!0===Ne&&(t("mouseenter"),t("mouseleave"))}(),ke=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);_t(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?_t(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&R(e,"click",t=>{t.preventDefault(),n(e.getAttribute("href"))})}function i(){R(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){r(),i(),a()}return ke.enable&&(1===Pe?pe("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===te&&(te=`${ee}px`),yt("margin",(r="margin",(i=te).includes("-")&&(me(`Negative CSS value ignored for ${r}`),i=""),i)),yt("background",Q),yt("padding",oe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),ie||function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){zt({method:e,eventType:"After Print",eventName:"afterprint"}),zt({method:e,eventType:"Before Print",eventName:"beforeprint"}),zt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=Nt(document)();We(It),function(e){const t={root:document.documentElement,side:ae?S:O};p=Ve(Mt,t),p.attachObservers(e)}(e),Ke(),function(e){nt=new ResizeObserver(Et),nt.observe(document.body),tt.add(document.body),re("Attached ResizeObserver to body"),B={attachObserverToNonStaticElements:ot,detachObservers:De(0,nt,tt)},B.attachObserverToNonStaticElements(e)}(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),re("Attached VisibilityObserver to page")}(jt)}(),mt(Z(ct)),Jt(N,"Init message from host page",void 0,void 0,`${y}:${Pe}`),document.title&&""!==document.title&&_t(0,0,"title",document.title)}function mt(e){"complete"===document.readyState?U(e):R(document,"readystatechange",()=>mt(e))}function pt(){Je=document.querySelectorAll(`[${z}]`),$e=Je.length>0}let ht=0;function gt(){const n=document.querySelectorAll(`*[${$}]`);ze=n.length>0,ze&&n.length!==ht&&(function(n){const o=1===n.length?"":"s";me(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),ht=n.length)}function yt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),re(`Set body ${e}: %c${t}`,h))}function vt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function bt(){vt(0,z,He),vt(0,$,Me)}function zt(e){({add(t){function n(){Jt(e.eventName,e.eventType)}i[t]=n,R(window,t,n,{passive:!0})},remove(e){const t=i[e];var n,o;delete i[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function wt(e,t,n,o){return t!==e&&(e in n||(me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&pe(`<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."}`),e}function $t(){Oe=wt(Oe,a,Wt,"height")}function St(){et=wt(et,l,Ft,"width")}function Ot(){const e=document.querySelectorAll(`[${w}]`);Re=Array.from(e).filter(e=>!e.closest(`[${$}]`)),we=Re.length>0}function Mt(e){Ot(),(we||e)&&(Re.length>1?re("Overflowed Elements:",...Re):we||re("Overflow removed"),Jt(A,"Overflow updated"))}function Et(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Jt(x,`Element resized <${function(e){switch(!0){case!G(e):return"";case G(e.id):return`${e.nodeName}#${e.id}`;case G(e.name):return`${e.nodeName} (${e.name}`;case G(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function jt(e){Ae=!e,Jt(C,"Visibility changed")}const kt=Fe("Overflow"),Tt=Fe("Overflow",!1),xt=Fe("Resize"),At=Fe("Resize",!1);function It(e){!function({addedMutations:e,removedMutations:t}){ue("contentMutated"),bt(),pt(),Ot();let n=0,o=0,r=0,i=0;for(const e of t){const t=Nt(e)();o+=p.detachObservers(t),i+=B.detachObservers(t)}for(const t of e){const e=Nt(t)();n+=p.attachObservers(e),r+=B.attachObserverToNonStaticElements(e)}Tt(o),At(i),kt(n),xt(r),se()}(e),Jt(I,"Mutation Observed")}function Ct(e){performance.mark(Ue);const t=_(e);let n=0,o=document.documentElement,r=$e?0:document.documentElement.getBoundingClientRect().bottom;const i=$e?Je:we?Re:Nt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return re(`${t} position calculated from:`,o),performance.mark(Ze,{detail:{hasTags:$e,len:i.length,logging:Ce,Side:t}}),r}const Pt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Nt=e=>()=>{const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return gt(),ze&&t.push(`not([${$}])`,`not([${$}] *)`),[e,...e.querySelectorAll(t.join(":"))]},Rt={height:0,width:0},Bt={height:0,width:0},qt=[h,g,h];function Lt(e){function t(){return Bt[o]=r,Rt[o]=s,r}const n=e===Wt,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:re("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!we&&0===Bt[o]&&0===Rt[o]:re(`Initial page size values: ${l}`,...qt),c=t();break;case Ye&&r===Bt[o]&&s===Rt[o]:re(`Size unchanged: ${l}`,...qt),c=Math.max(r,s);break;case 0===r:re(`Page is hidden: ${l}`,...qt),c=s;break;case!we&&r!==Bt[o]&&s<=Rt[o]:re(`New <html> size: ${l} `,...qt),re(`Previous <html> size: %c${Bt[o]}px`,h),c=t();break;case!n:c=e.taggedElement();break;case!we&&r<Bt[o]:re(`<html> size decreased: ${l}`,...qt),c=t();break;case s===a||s===i:re(`<html> size equals page size: ${l}`,...qt),c=t();break;case r>s:re(`Page size < <html> size: ${l}`,...qt),c=t();break;case we:re("Found element overflowing <html> "),c=e.taggedElement();break;default:re(`Using <html> size: ${l}`,...qt),c=t()}return re(`Content ${o}: %c${c}px`,h),c+=function(e){const t=e.getOffset();return 0!==t&&re(`Page offsetSize: %c${t}px`,h),t}(e),c}const Wt={enabled:()=>ae,getOffset:()=>d,auto:()=>Lt(Wt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,b)+parseInt(t.marginBottom,b)},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(...Pt(Wt)),min:()=>Math.min(...Pt(Wt)),grow:()=>Wt.max(),lowestElement:()=>Ct(S),taggedElement:()=>Ct(S)},Ft={enabled:()=>le,getOffset:()=>f,auto:()=>Lt(Ft),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(Ft)),min:()=>Math.min(...Pt(Ft)),rightMostElement:()=>Ct(O),scroll:()=>Math.max(Ft.bodyScroll(),Ft.documentElementScroll()),taggedElement:()=>Ct(O)},Dt=(e,t)=>!(Math.abs(e-t)<=Ge);function Ht(e,t){const n=e[t]();return e.enabled()&&void 0!==D?function(e){const t=D(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 Vt=!1;const Ut=Z(()=>he(H(4)));let Zt=!1;const Jt=ce((e,t,n,o,r)=>{if(performance.now(),ue(e),!0!==Vt){if(!J&&!(e in k))return re("Resizing disabled"),void se();if(Ae){if(!0===Zt)return;Zt=!0}else Zt=!1,Vt=!0,requestAnimationFrame(()=>{Vt=!1}),function(e,t,n,o,r){const i=n??Ht(Wt,Oe),a=o??Ht(Ft,et);switch(ae&&Dt(Se,i)||le&&Dt(Xe,a)?E:e){case N:case M:case E:Se=i,Xe=a;case T:_t(Se,Xe,e,r);break;case A:case I:case x:case C:fe();break;default:fe(),re("No change in content size detected")}}(e,0,n,o,r)}});function Qt(e){Se=Wt[Oe](),Xe=Ft[et](),_t(Se,Xe,e)}const _t=ce(function(e,t,o,r,i){Pe<-1||(ue(o),void 0!==i||(i=_e),function(){const a=`${Be}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(Le)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Pe)throw e;return void Ut()}else Qe.postMessage(s+a,i);re(`Sending message to parent page via ${Le?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),se())}),Gt=ce(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>_t(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Qe=e.source,m=e.origin,ft(t),ge=!1,setTimeout(()=>{Ee=!1},128)},reset(){Ee||Qt("resetPage")},resize(){Jt("parentResize","Parent window requested size check")},moveToAnchor(){ke.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();ut?U(ut,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;dt?U(dt,e):o("parentInfo")},message(){const e=a();U(lt,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=i();ue(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||me(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return l()?(de(i()),ue(N),void r.init()):void 0;c()}()});function Yt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Gt({data:e,sameOrigin:!0})),R(window,"message",Gt),R(window,"readystatechange",Yt),Yt())}()}();
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/legacy (parent) 5.5.0-beta.3 (umd) - 2025-07-29
4
+ * @module iframe-resizer/legacy (parent) 5.5.0 (umd) - 2025-07-29
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,4 @@
17
17
  */
18
18
 
19
19
 
20
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],d=e=>t=>[t,function(n){e[t]=n}],f=(e,t)=>a(l(e).map(t));const u=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=u?"color: #A9C7FB;":"color: #135CD2;",h=u?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.0-beta.3",g="iframeResizer",y="none",w="vertical",b="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),T="expanded",x="collapsed",M=Object.freeze({[T]:1,[x]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),O=e=>e,R=(S=function(a={}){const l={},u={},p=[],h={...i,expand:!a.collapsed||i.expanded,...a};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some(([e])=>e in o)||!!h.expand;function b(){if(0!==p.length){s[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(b))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...f(h,d(h)),...f(console,e=>[e,(...t)=>z(e,...t)]),...f(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){u[e]?u[e]+=1:u[e]=1,z("log",`${e}: ${u[e]}`)},countReset:function(e=n){delete u[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),b()}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},S?.__esModule?S.default:S);var S;let I={},C=!1;const A=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const W=e=>(t,...n)=>I[t]?.console[e](...n),L=(F="log",(e,...t)=>!0===(e=>I[e]?I[e].log:C)(e)?W(F)(e,...t):null);var F;const N=L,B=W("warn"),P=W("error"),H=W("event"),q=W("purge"),D=W("errorBoundary");const U=(e,...t)=>I[e]?I[e].console.warn(E(O)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),V=(e=>(t,n="renamed to")=>(o,i,r="",s="")=>e(s,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(U),J=V("Function"),Z=V("Option"),G=(e,t,n,o)=>e.addEventListener(t,n,o||!1),X=(e,t,n)=>e.removeEventListener(t,n,!1),Y=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},_=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Q=["spjluzl","rlf","clyzpvu"],K=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],ee=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],te=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),ne=e=>_(K[e]),oe=e=>{const t=e[_(Q[0])]||e[_(Q[1])]||e[_(Q[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=Y(_(e));return n in te&&(t=te[n]),t}(n[0]);return 0===o||(e=>e[2]===Y(e[0]+e[1]))(n)||(o=-2),o};function ie(e,t){const{warningTimeout:n}=t[e];0!==n&&(t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{loaded:n,loadErrorShown:o}=t[e];n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));U(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},n))}const re={},se=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:w,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof re[e.id].onInit&&(Z("init()","onReady()","",e.id),re[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ae={position:null,version:m};function le(e){function t(){ge(T),he(x),$("onResized",T)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,s;r=function(){we(`${n} (${e})`,`${e}:${t()}`,o)},i[s=o]||(r(),i[s]=requestAnimationFrame(()=>{i[s]=null}))},s=(e,t)=>()=>{let n=!1;const o=t=>()=>{re[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):a()},i=o("scroll"),r=o("resize window");function s(e,n){L(l,`${e}listeners for send${t}`),n(window,"scroll",i),n(window,"resize",r)}function a(){H(l,`stop${t}`),s("Remove ",X),c.disconnect(),d.disconnect(),X(re[l].iframe,"load",a)}const l=x,c=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));re[l]&&(re[l][`stop${t}`]=a,G(re[l].iframe,"load",a),s("Add ",G),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),d.observe(re[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in re[x]&&(re[x][e](),delete re[x][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=T.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,i||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:s,documentWidth:a,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=T,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),d=s(l,"PageInfo"),f=s(c,"ParentInfo"),u=a("stopPageInfo"),g=a("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return ue(x),{x:Number(t.left)+Number(ae.position.x),y:Number(t.top)+Number(ae.position.y)}}function w(e){const t=e?y(T.iframe):{x:0,y:0};N(x,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(T,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){ae.position=e,b(x)}(n)}function b(e){const{x:t,y:n}=ae.position,o=re[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?he(e):pe()}function z(e){let t={};if(0===T.width&&0===T.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:T.width,y:T.height};$(e,{iframe:T.iframe,screenX:Number(t.x),screenY:Number(t.y),type:T.type})}const $=(e,t)=>ce(x,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:s}=T;switch(re[x]?.firstRun&&function(){if(!re[x])return;ke(x,T.mode),re[x].firstRun=!1}(),r){case"close":fe(n);break;case"message":l=i(6),L(x,`onMessage passed: {iframe: %c${T.iframe.id}%c, message: %c${l}%c}`,p,h,p,h),$("onMessage",{iframe:T.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":re[x].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=T.width,t=T.height,n=window.parentIframe||window.parentIFrame||window;N(x,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":d();break;case"parentInfo":f();break;case"pageInfoStop":u();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);N(x,`Moving to in page link: %c#${t}`,p),ae.position={x:e.x,y:e.y},b(x),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):L(x,`In page link #${t} not found and window.parentIframe not found`)}():L(x,`In page link #${t} not found`)}(i(9));break;case"title":!function(e,t){re[t]?.syncTitle&&(re[t].iframe.title=e,N(t,`Set iframe title attribute: %c${e}`,p))}(o,x);break;case"reset":me(T);break;case"init":t(),function(e){try{re[e].sameOrigin=!!re[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){re[e].sameOrigin=!1}L(e,`sameOrigin: %c${re[e].sameOrigin}`,p)}(x),(a=o)!==m&&(void 0!==a?L(x,`Version mismatch (Child: %c${a}%c !== Parent: %c${m})`,p,h,p):U(x,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ze=!0,$("onReady",n);break;default:if(0===s&&0===e)return void B(x,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return void L(x,"Ignoring message with 0 height or width");if(document.hidden)return void L(x,"Page hidden - ignored resize request");t()}var a,l}let k=e.data,T={},x=null;"[iFrameResizerChild]Ready"!==k?v===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in re?(T=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=re[e[0]]?.iframe,r=getComputedStyle(i),s={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(s.mode=e[5]),s}(),x=T.id,x?(H(x,T.type),D(x,function(){!function(e){if(!re[e])throw new Error(`${T.type} No settings for ${e}. Message was: ${k}`)}(x),function(){const e=T.type in{};return e&&L(x,"Ignoring init message from meta parent page"),e}()||(L(x,`Received: %c${k}`,p),re[x].loaded=!0,(null!==T.iframe||(B(x,`The iframe (${T.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=re[x]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(L(x,`Checking connection is from allowed list of origins: %c${o}`,p);e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=re[x]?.remoteHost;return L(x,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${T.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):B("","iframeResizer received messageData without id, message was: ",k)):null!==x&&L(x,"Ignored:",k):Object.keys(re).forEach(e=>{we("iFrame requested init",be(e),e)})}function ce(e,t,n){let o=null,i=null;if(re[e]){if(o=re[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),B(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function de(e){const{id:t}=e;L(t,"Disconnected from iframe"),delete re[t],delete e.iframeResizer}function fe(e){const{id:t}=e;if(!1!==ce(t,"onBeforeClose",t)){L(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){B(t,e)}ce(t,"onAfterClose",t),de(e)}else L(t,"Close iframe cancelled by onBeforeClose")}function ue(e){null===ae.position&&(ae.position={x:window.scrollX,y:window.scrollY},L(e,`Get page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,h,p))}function pe(){ae.position=null}function he(e){null!==ae.position&&(window.scrollTo(ae.position.x,ae.position.y),N(e,`Set page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,h,p),pe())}function me(e){L(e.id,"Size reset requested by "+("init"===e.type?"parent page":"child page")),ue(e.id),ge(e),we("reset","reset",e.id)}function ge(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,N(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=re[n];o&&t("height"),i&&t("width")}I=re;const ye=e=>e.split(":").filter((e,t)=>19!==t).join(":");function we(e,t,n){function o(o){const i=e in k?ye(t):t;N(n,o,p,h,p),N(n,`Message data: %c${i}`,p)}H(n,e),re[n]&&(re[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:s}=re[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){L(n,"Same domain connection failed. Trying cross domain%c")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),i.postMessage(v+t,s)}():B(n,`Iframe(${n}) not found`))}function be(e){const t=re[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ae.version,t.mode,"",t.logExpand].join(":")}let ve=0,ze=!1,$e=!1,je=!1;function ke(t,n=-3){if($e)return;const o=Math.max(re[t].mode,n);if(o>re[t]&&(re[t].mode=o),o<0)throw q(t),re[t].vAdvised||U(t||"Parent",`${ne(o+2)}${ne(2)}`),re[t].vAdvised=!0,ne(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,C||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>_(ee[e]))(o)})`,o),o<1&&U("Parent",ne(3)),$e=!0}const Te=e=>t=>{function n(){if(re[d]){const{iframe:e}=re[d],t={close:fe.bind(null,e),disconnect:de.bind(null,e),removeListeners(){U(d,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){U(d,"<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 their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),we.bind(null,"Window resize","resize",d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),we("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){we("message",`message:${e=JSON.stringify(e)}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=re[n];ie(n,re),G(t,"load",function(){we($,`${e}:${ze}`,n),function(){const e=re[d]?.firstRun,n=re[d]?.heightCalculationMethod in z;!e&&n&&me({iframe:t,height:0,width:0,type:"init"})}()}),!1===o&&we(j,`${e}:${ze}`,n)}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&U(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${w}"</>, <i>"${b}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=re[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){Object.hasOwn(re[d],e)&&(U(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),re[d][t]=re[d][e],delete re[d][e])}const a=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var n,o;re[d]={...re[d],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...se,...i(e),mouseEvents:a(e),mode:oe(e),syncTitle:r(d)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),H(d,"setup"),function(){const{direction:e}=re[d];switch(e){case w:break;case b:re[d].sizeHeight=!1;case"both":re[d].sizeWidth=!0;break;case y:re[d].sizeWidth=!1,re[d].sizeHeight=!1,re[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}L(d,`Direction: %c${e}`,p)}(),(n=e?.offsetSize||e?.offset)&&(re[d].direction===w?(re[d].offsetHeight=n,L(d,`Offset height: %c${n}`,p)):(re[d].offsetWidth=n,L(d,`Offset width: %c${n}`,p))),e?.offset&&U(d,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===re[d].postMessageTarget&&(re[d].postMessageTarget=t.contentWindow),re[d].targetOrigin=!0===re[d].checkOrigin?""===(o=re[d].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,d=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||se.id+ve++;return null!==document.getElementById(t)&&(t+=ve++),t}(),t.id=n,L(n,`Added missing iframe ID: ${n} (${t.src})`)),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=T,e.logExpand=!t.includes("ifrlog=collapsed"))}(e),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:se.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===T:se.logExpand),function(e){-1===e?.log&&(e.log=!1,je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=R({expand:t,label:A(n)});C=e,I[n]||(I[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&P(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(d,e),D(d,function(e){c()?B(d,`Ignored iframe (${d}), already setup.`):(l(e),function(){if($e)return;const{mode:e}=re[d];-1!==e&&ke(d,e)}(),Me(),function(){switch(L(d,`Iframe scrolling ${re[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===re[d]?.scrolling?"hidden":"auto",re[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=re[d]?re[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=re[d];"number"!=typeof e&&"0"!==e||(re[d].bodyMargin=`${e}px`)}(),o(be(d)),n(),L(d,"Setup complete"))})(e),t?.iframeResizer};function xe(){!1===document.hidden&&(L("document","Trigger event: Visibility change"),function(e,t){const n=e=>re[e]?.autoResize&&!re[e]?.firstRun;Object.keys(re).forEach(function(o){n(o)&&we(e,t,o)})}("Tab Visible","resize"))}const Me=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{G(window,"message",le),G(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>le({data:e,sameOrigin:!0}))}),Ee=`[${g}] `;const Oe=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Ee}iframe is not defined`);case!e.tagName:throw new TypeError(`${Ee}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Ee}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=Te(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Ee}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){J("iFrameResize()","iframeResize()","","parent"),Oe(...e)}),Oe});
21
- //# sourceMappingURL=iframeResizer.js.map
20
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="font-weight: normal;",t=e+"font-style: italic;",n="default",o=Object.freeze({assert:!0,error:!0,warn:!0}),i={expand:!0,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.0",g="iframeResizer",y="none",w="vertical",b="horizontal",v="[iFrameSizer]",z=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),$="onload",j="init",k=Object.freeze({[$]:1,[j]:1}),x="expanded",T="collapsed",M=Object.freeze({[x]:1,[T]:1}),E=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),O=e=>e,R=(S=function(s={}){const l={},f={},p=[],h={...i,expand:!s.collapsed||i.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const w=()=>!!p.some(([e])=>e in o)||!!h.expand;function b(){if(0!==p.length){a[w()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(b))),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),b()}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},S?.__esModule?S.default:S);var S;let I={},A=!1;const C=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const W=e=>(t,...n)=>I[t]?.console[e](...n);var L;const N=(L="log",(e,...t)=>!0===(e=>I[e]?I[e].log:A)(e)?W(L)(e,...t):null),F=W("warn"),B=W("error"),H=W("event"),P=W("purge"),q=W("errorBoundary");const D=(e,...t)=>I[e]?I[e].console.warn(E(O)(...t)):queueMicrotask(()=>console?.warn(E((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e))(...t))),U=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(D),J=U("Function"),Z=U("Option"),V=(e,t,n,o)=>e.addEventListener(t,n,o||!1),G=(e,t,n)=>e.removeEventListener(t,n,!1),X=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,i=0;i<e.length;i++)o=e.codePointAt(i),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},Y=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),_=["spjluzl","rlf","clyzpvu"],Q=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],K=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>Y(Q[e]),ne=e=>{const t=e[Y(_[0])]||e[Y(_[1])]||e[Y(_[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=X(Y(e));return n in ee&&(t=ee[n]),t}(n[0]);return 0===o||(e=>e[2]===X(e[0]+e[1]))(n)||(o=-2),o};function oe(e,t){const{warningTimeout:n}=t[e];0!==n&&(t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{loaded:n,loadErrorShown:o}=t[e];n||o||(t[e].loadErrorShown=!0,function(e,t){const{iframe:n,waitForLoad:o}=t[e],{sandbox:i}=n,r="object"==typeof i&&i.length>0&&!(i.contains("allow-scripts")&&i.contains("allow-same-origin"));D(e,`<rb>No response from iframe</>\n \nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <b>'true'</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <b>'false'</>. \n":""}${r?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}(e,t))},n))}const ie={},re=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:w,inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:"auto",onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof ie[e.id].onInit&&(Z("init()","onReady()","",e.id),ie[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),ae={position:null,version:m};function se(e){function t(){me(x),pe(T),$("onResized",x)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function o(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const i=e=>k.slice(k.indexOf(":")+7+e);const r=(e,t)=>(n,o)=>{const i={};var r,a;r=function(){ye(`${n} (${e})`,`${e}:${t()}`,o)},i[a=o]||(r(),i[a]=requestAnimationFrame(()=>{i[a]=null}))},a=(e,t)=>()=>{let n=!1;const o=t=>()=>{ie[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},i=o("scroll"),r=o("resize window");function a(e,t){t(window,"scroll",i),t(window,"resize",r)}function s(){H(l,`stop${t}`),a(0,G),c.disconnect(),u.disconnect(),G(ie[l].iframe,"load",s)}const l=T,c=new ResizeObserver(o("pageObserver")),u=new ResizeObserver(o("iframeObserver"));ie[l]&&(ie[l][`stop${t}`]=s,V(ie[l].iframe,"load",s),a(0,V),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ie[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ie[T]&&(ie[T][e](),delete ie[T][e])},l=r("pageInfo",function(){const e=document.body.getBoundingClientRect(),t=x.iframe.getBoundingClientRect(),{scrollY:n,scrollX:o,innerHeight:i,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,i||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:i,windowWidth:r})}),c=r("parentInfo",function(){const{iframe:e}=x,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:i,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function y(e){const t=e.getBoundingClientRect();return de(),{x:Number(t.left)+Number(ae.position.x),y:Number(t.top)+Number(ae.position.y)}}function w(e){const t=e?y(x.iframe):{x:0,y:0};N(T,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(x,t),o=window.parentIframe||window.parentIFrame;o?function(t,n){t["scrollTo"+(e?"Offset":"")](n.x,n.y)}(o,n):function(e){ae.position=e,b(T)}(n)}function b(e){const{x:t,y:n}=ae.position,o=ie[e]?.iframe;!1!==$("onScroll",{iframe:o,top:n,left:t,x:t,y:n})?pe(e):fe()}function z(e){let t={};if(0===x.width&&0===x.height){const e=i(9).split(":");t={x:e[1],y:e[0]}}else t={x:x.width,y:x.height};$(e,{iframe:x.iframe,screenX:Number(t.x),screenY:Number(t.y),type:x.type})}const $=(e,t)=>le(T,e,t);function j(){const{height:e,iframe:n,msg:o,type:r,width:a}=x;switch(ie[T]?.firstRun&&function(){if(!ie[T])return;je(T,x.mode),ie[T].firstRun=!1}(),r){case"close":ue(n);break;case"message":l=i(6),$("onMessage",{iframe:x.iframe,message:JSON.parse(l)});break;case"mouseenter":z("onMouseEnter");break;case"mouseleave":z("onMouseLeave");break;case"autoResize":ie[T].autoResize=JSON.parse(i(9));break;case"scrollBy":!function(){const e=x.width,t=x.height,n=window.parentIframe||window.parentIFrame||window;N(T,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.scrollBy(e,t)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":u();break;case"parentInfo":d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",n=decodeURIComponent(t);let o=document.getElementById(n)||document.getElementsByName(n)[0];o?function(){const e=y(o);N(T,`Moving to in page link: %c#${t}`,p),ae.position={x:e.x,y:e.y},b(T),window.location.hash=t}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(t)}()}(i(9));break;case"title":!function(e,t){ie[t]?.syncTitle&&(ie[t].iframe.title=e,N(t,`Set iframe title attribute: %c${e}`,p))}(o,T);break;case"reset":he(x);break;case"init":t(),function(e){try{ie[e].sameOrigin=!!ie[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ie[e].sameOrigin=!1}}(T),(s=o)!==m&&(void 0!==s||D(T,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ve=!0,$("onReady",n);break;default:if(0===a&&0===e)return void F(T,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===a||0===e)return;if(document.hidden)return;t()}var s,l}let k=e.data,x={},T=null;"[iFrameResizerChild]Ready"!==k?v===`${k}`.slice(0,13)&&k.slice(13).split(":")[0]in ie&&(x=function(){const e=k.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=ie[e[0]]?.iframe,r=getComputedStyle(i),a={iframe:i,id:e[0],height:t+n(r)+o(r),width:Number(e[2]),type:e[3],msg:e[4]};return e[5]&&(a.mode=e[5]),a}(),T=x.id,T?(H(T,x.type),q(T,function(){!function(e){if(!ie[e])throw new Error(`${x.type} No settings for ${e}. Message was: ${k}`)}(T),x.type in{}||(ie[T].loaded=!0,(null!==x.iframe||(F(T,`The iframe (${x.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let o=ie[T]?.checkOrigin;if(o&&"null"!=`${t}`&&!(o.constructor===Array?function(){let e=0,n=!1;for(;e<o.length;e++)if(o[e]===t){n=!0;break}return n}():function(){const e=ie[T]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${x.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&j())})()):F("","iframeResizer received messageData without id, message was: ",k)):Object.keys(ie).forEach(e=>{ye("iFrame requested init",we(e),e)})}function le(e,t,n){let o=null,i=null;if(ie[e]){if(o=ie[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{i=o(n)}catch(n){console.error(n),F(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(o,n)}return i}function ce(e){const{id:t}=e;delete ie[t],delete e.iframeResizer}function ue(e){const{id:t}=e;if(!1!==le(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){F(t,e)}le(t,"onAfterClose",t),ce(e)}}function de(e){null===ae.position&&(ae.position={x:window.scrollX,y:window.scrollY})}function fe(){ae.position=null}function pe(e){null!==ae.position&&(window.scrollTo(ae.position.x,ae.position.y),N(e,`Set page position: %c${ae.position.x}%c, %c${ae.position.y}`,p,h,p),fe())}function he(e){de(e.id),me(e),ye("reset","reset",e.id)}function me(e){function t(t){const o=`${e[t]}px`;e.iframe.style[t]=o,N(n,`Set ${t}: %c${o}`,p)}const{id:n}=e,{sizeHeight:o,sizeWidth:i}=ie[n];o&&t("height"),i&&t("width")}I=ie;const ge=e=>e.split(":").filter((e,t)=>19!==t).join(":");function ye(e,t,n){function o(o){const i=e in k?ge(t):t;N(n,o,p,h,p),N(n,`Message data: %c${i}`,p)}H(n,e),ie[n]&&(ie[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameOrigin:r,targetOrigin:a}=ie[n];if(r)try{return e.contentWindow.iframeChildListener(v+t),void o(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),i.postMessage(v+t,a)}():F(n,`Iframe(${n}) not found`))}function we(e){const t=ie[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,ae.version,t.mode,"",t.logExpand].join(":")}let be=0,ve=!1,ze=!1,$e=!1;function je(t,n=-3){if(ze)return;const o=Math.max(ie[t].mode,n);if(o>ie[t]&&(ie[t].mode=o),o<0)throw P(t),ie[t].vAdvised||D(t||"Parent",`${te(o+2)}${te(2)}`),ie[t].vAdvised=!0,te(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");o>-1&&$e||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,A||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>Y(K[e]))(o)})`,o),o<1&&D("Parent",te(3)),ze=!0}const ke=e=>t=>{function n(){if(ie[u]){const{iframe:e}=ie[u],t={close:ue.bind(null,e),disconnect:ce.bind(null,e),removeListeners(){D(u,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){D(u,"<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 their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),ye.bind(null,"Window resize","resize",u)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),ye("Move to anchor",`moveToAnchor:${e}`,u)},sendMessage(e){ye("message",`message:${e=JSON.stringify(e)}`,u)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e){const{id:n}=t,{waitForLoad:o}=ie[n];oe(n,ie),V(t,"load",function(){ye($,`${e}:${ve}`,n),function(){const e=ie[u]?.firstRun,n=ie[u]?.heightCalculationMethod in z;!e&&n&&he({iframe:t,height:0,width:0,type:"init"})}()}),!1===o&&ye(j,`${e}:${ve}`,n)}function i(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&D(u,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <i>"${w}"</>, <i>"${b}"</> or <i>"${y}"</>.\n`),e):{}}function r(e){const t=ie[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){Object.hasOwn(ie[u],e)&&(D(u,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.`),ie[u][t]=ie[u][e],delete ie[u][e])}const s=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function l(e){var n,o;ie[u]={...ie[u],iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...re,...i(e),mouseEvents:s(e),mode:ne(e),syncTitle:r(u)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),H(u,"setup"),function(){const{direction:e}=ie[u];switch(e){case w:break;case b:ie[u].sizeHeight=!1;case"both":ie[u].sizeWidth=!0;break;case y:ie[u].sizeWidth=!1,ie[u].sizeHeight=!1,ie[u].autoResize=!1;break;default:throw new TypeError(u,`Direction value of "${e}" is not valid`)}}(),(n=e?.offsetSize||e?.offset)&&(ie[u].direction===w?ie[u].offsetHeight=n:ie[u].offsetWidth=n),e?.offset&&D(u,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===ie[u].postMessageTarget&&(ie[u].postMessageTarget=t.contentWindow),ie[u].targetOrigin=!0===ie[u].checkOrigin?""===(o=ie[u].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}const c=()=>"iframeResizer"in t,u=function(n){if(n&&"string"!=typeof n)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||re.id+be++;return null!==document.getElementById(t)&&(t+=be++),t}(),t.id=n),n}(t.id);if("object"!=typeof e)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=x,e.logExpand=!t.includes("ifrlog=collapsed"))}(e),function(e,t){const n=Object.hasOwn(t,"log"),o="string"==typeof t.log,i=n?!!o||t.log:re.log;Object.hasOwn(t,"logExpand")||(t.logExpand=n&&o?t.log===x:re.logExpand),function(e){-1===e?.log&&(e.log=!1,$e=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const o=R({expand:t,label:C(n)});A=e,I[n]||(I[n]={console:o})}({enabled:i,expand:t.logExpand,iframeId:e}),o&&!(t.log in M)&&B(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=i}(u,e),q(u,function(e){c()?F(u,`Ignored iframe (${u}), already setup.`):(l(e),function(){if(ze)return;const{mode:e}=ie[u];-1!==e&&je(u,e)}(),Te(),function(){switch(t.style.overflow=!1===ie[u]?.scrolling?"hidden":"auto",ie[u]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ie[u]?ie[u].scrolling:"no"}}(),function(){const{bodyMargin:e}=ie[u];"number"!=typeof e&&"0"!==e||(ie[u].bodyMargin=`${e}px`)}(),o(we(u)),n())})(e),t?.iframeResizer};function xe(){!1===document.hidden&&function(e,t){const n=e=>ie[e]?.autoResize&&!ie[e]?.firstRun;Object.keys(ie).forEach(function(o){n(o)&&ye(e,t,o)})}("Tab Visible","resize")}const Te=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{V(window,"message",se),V(document,"visibilitychange",xe),window.iframeParentListener=e=>setTimeout(()=>se({data:e,sameOrigin:!0}))}),Me=`[${g}] `;const Ee=function(){function e(e){switch(!0){case!e:throw new TypeError(`${Me}iframe is not defined`);case!e.tagName:throw new TypeError(`${Me}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${Me}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),n.push(e)}}let t,n;return function(o,i){if("undefined"==typeof window)return[];switch(t=ke(o),n=[],typeof i){case"undefined":case"string":document.querySelectorAll(i||"iframe").forEach(e);break;case"object":e(i);break;default:throw new TypeError(`${Me}Unexpected data type (${typeof i})`)}return Object.freeze(n)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){J("iFrameResize()","iframeResize()","","parent"),Ee(...e)}),Ee});