iframe-resizer 5.5.6-beta.1 → 5.5.6

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